Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tun
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
tun
Commits
653c74fb
Commit
653c74fb
authored
Dec 19, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crlf
parent
4a3859fc
Pipeline
#42032
passed with stages
in 1 minute and 42 seconds
Changes
5
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
674 additions
and
674 deletions
+674
-674
.gitignore
.gitignore
+2
-2
.gitlab-ci.yml
.gitlab-ci.yml
+51
-51
Dockerfile
Dockerfile
+24
-24
src/main.rs
src/main.rs
+158
-158
src/router.rs
src/router.rs
+439
-439
No files found.
.gitignore
View file @
653c74fb
/.idea/
/target
/.idea/
/target
.gitlab-ci.yml
View file @
653c74fb
stages
:
-
build
-
deploy
variables
:
GIT_DEPTH
:
"
1"
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
.build-image
:
stage
:
build
script
:
- docker build --pull -t $TARGET_IMAGE .
- docker push $TARGET_IMAGE
build-x86
:
extends
:
.build-image
tags
:
-
docker
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
build-arm
:
extends
:
.build-image
tags
:
-
docker-arm
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
.deploy
:
stage
:
deploy
tags
:
- docker
script
:
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
- docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
- docker manifest create $TARGET_IMAGE --amend $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86 --amend
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
- docker manifest push $TARGET_IMAGE
deploy_latest
:
extends
:
.deploy
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:latest
only
:
-
master
deploy_branch
:
extends
:
.deploy
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
stages
:
-
build
-
deploy
variables
:
GIT_DEPTH
:
"
1"
before_script
:
-
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
.build-image
:
stage
:
build
script
:
-
docker build --pull -t $TARGET_IMAGE .
-
docker push $TARGET_IMAGE
build-x86
:
extends
:
.build-image
tags
:
-
docker
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
build-arm
:
extends
:
.build-image
tags
:
-
docker-arm
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
.deploy
:
stage
:
deploy
tags
:
-
docker
script
:
-
docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
-
docker pull $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
-
docker manifest create $TARGET_IMAGE --amend $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86 --amend
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
-
docker manifest push $TARGET_IMAGE
deploy_latest
:
extends
:
.deploy
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:latest
only
:
-
master
deploy_branch
:
extends
:
.deploy
variables
:
TARGET_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
Dockerfile
View file @
653c74fb
FROM
rust:1.91-alpine3.22 as chef
RUN
apk add
--no-cache
musl-dev
RUN
cargo
install
cargo-chef
WORKDIR
/usr/src/app
FROM
chef as planner
COPY
Cargo.toml Cargo.lock ./
COPY
src src
RUN
cargo chef prepare
--recipe-path
recipe.json
FROM
chef as builder
COPY
--from=planner /usr/src/app/recipe.json recipe.json
RUN
cargo chef cook
--release
--recipe-path
recipe.json
COPY
Cargo.toml Cargo.lock ./
COPY
src src
RUN
cargo build
--release
FROM
alpine:3.22
RUN
apk
--no-cache
add libgcc libstdc++ bash iproute2 iptables iptables-legacy ipset netcat-openbsd jq iputils
COPY
--from=builder /usr/src/app/target/release/tun1 /usr/local/bin/tun
COPY
./entrypoint.sh /entrypoint.sh
ENTRYPOINT
["/entrypoint.sh"]
CMD
["tun"]
FROM
rust:1.91-alpine3.22 as chef
RUN
apk add
--no-cache
musl-dev
RUN
cargo
install
cargo-chef
WORKDIR
/usr/src/app
FROM
chef as planner
COPY
Cargo.toml Cargo.lock ./
COPY
src src
RUN
cargo chef prepare
--recipe-path
recipe.json
FROM
chef as builder
COPY
--from=planner /usr/src/app/recipe.json recipe.json
RUN
cargo chef cook
--release
--recipe-path
recipe.json
COPY
Cargo.toml Cargo.lock ./
COPY
src src
RUN
cargo build
--release
FROM
alpine:3.22
RUN
apk
--no-cache
add libgcc libstdc++ bash iproute2 iptables iptables-legacy ipset netcat-openbsd jq iputils
COPY
--from=builder /usr/src/app/target/release/tun1 /usr/local/bin/tun
COPY
./entrypoint.sh /entrypoint.sh
ENTRYPOINT
["/entrypoint.sh"]
CMD
["tun"]
src/main.rs
View file @
653c74fb
This diff is collapsed.
Click to expand it.
src/router.rs
View file @
653c74fb
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment