mirror of
https://github.com/TrustTunnel/TrustTunnel.git
synced 2026-03-25 02:08:30 +00:00
Squashed commit of the following:
commit 6eae1e962a27b2c3bcb6362f53bb1d7d92a66983
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Fri Dec 26 11:46:12 2025 +0400
Run lint on both macos and linux
commit 94254caec3ea166db80c6b3f4004b4126605a1b7
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 22:44:10 2025 +0400
Fix note again by adding lint hint
commit 5a67ae358a5676a22e85798683674607d2788a51
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 22:42:02 2025 +0400
Fix note
commit 937b178302244fe237d06b6f38ba0f29db6e0d7e
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 22:39:45 2025 +0400
Fix README
commit 769c5d9ebdc03e8500f9fc00d7f2b6f316924557
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 22:39:15 2025 +0400
Cargo update
commit 1e932e4037c2b9ffc4b12f398f1ef14c32b5481e
Merge: dcf6a53 2041edc
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 22:37:24 2025 +0400
Merge remote-tracking branch 'origin/master' into feature/TRUST-235
commit dcf6a53410e59411a3e05f798ed4be7f7c9994ce
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 22:24:56 2025 +0400
Get rid of rustls-pemfile and update sentry
commit cb2e26e47d4612d65ae990ec887875bb1ac94456
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 19:08:23 2025 +0400
Fix tests
commit a3cde3fdf16edfe2e2a574b8d729c2b9d59daf84
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 18:33:46 2025 +0400
Fix vulnerabilities
commit 35cb9c699a0ddf2eb344c7c475be3c36a26dbf83
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 17:13:18 2025 +0400
Don't install cargo-audit manually
commit 71a5411ac4fe31fc08c3bacb83d327bf6b7ab8c3
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 17:07:30 2025 +0400
Install stable rust for cargo-audit
commit b7f38a90054cda39d72760b0ebc3ce295fba95d2
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:54:13 2025 +0400
Fix yaml
commit fbbe78f68b2987280874f23d4ed05ef75ed42f46
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:53:15 2025 +0400
Try to lock cargo-audit version
commit 08f31734b49c70d9dc03c7977ac6182198d1cbde
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:46:06 2025 +0400
Update audit workflow
commit c202f186cd1610439a13928fc1fabac88e83097b
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:30:55 2025 +0400
Install rust tools and better rust cache
commit eccf2fa91efcc4c6e5684960e368892bc68e67cd
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:30:25 2025 +0400
Name for job
commit dccc19f13180e767b8390c8ea32fde4285c0cab8
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:30:17 2025 +0400
Update checkout step version
commit edbb4404bf6fc1927f0184433df9982767a9c762
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:30:02 2025 +0400
Run lint only on linux
commit b59ed893fa55edf030f9ffee2e442c8b947fa28f
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 16:09:43 2025 +0400
Lint in the same workflow as testing to avoid rebuilds
commit 8d8ecd51859c825d0437361f8c51bde6b46994bc
Author: Andrey Yakushin <a.yakushin@adguard.com>
Date: Thu Dec 25 15:27:23 2025 +0400
More clippy fixes
... and 6 more commits
100 lines
2.8 KiB
Makefile
100 lines
2.8 KiB
Makefile
BUILD_TYPE ?= release
|
|
ifeq ($(BUILD_TYPE), release)
|
|
CARGO_BUILD_TYPE = --release
|
|
endif
|
|
LOG_LEVEL ?= trace
|
|
CONFIG_FILE ?= vpn.toml
|
|
HOSTS_CONFIG_FILE ?= hosts.toml
|
|
DOCKER_IMAGE_NAME ?= trusttunnel-endpoint
|
|
ENDPOINT_URL ?= git@github.com:TrustTunnel/TrustTunnel.git
|
|
ENDPOINT_VERSION ?= master
|
|
ENDPOINT_HOSTNAME ?= vpn.endpoint
|
|
DOCKER_DIR = docker
|
|
DOCKER_ENDPOINT_DIR = TrustTunnel
|
|
DOCKER_ENDPOINT_CONFIG_DIR = config
|
|
LISTEN_ADDRESS ?= 0.0.0.0
|
|
LISTEN_PORT ?= 443
|
|
|
|
.PHONY: init
|
|
## Initialize the development environment (git hooks, etc.)
|
|
init:
|
|
git config core.hooksPath ./scripts/hooks
|
|
|
|
.PHONY: endpoint/build-wizard
|
|
## Build the setup wizard
|
|
endpoint/build-wizard:
|
|
cargo build $(CARGO_BUILD_TYPE) --bin setup_wizard
|
|
|
|
.PHONY: endpoint/setup
|
|
## Run the setup wizard to create all the required configuration files
|
|
endpoint/setup: endpoint/build-wizard
|
|
cargo run $(CARGO_BUILD_TYPE) --bin setup_wizard -- \
|
|
--hostname "$(ENDPOINT_HOSTNAME)" \
|
|
--address "$(LISTEN_ADDRESS):$(LISTEN_PORT)" \
|
|
--lib-settings "$(CONFIG_FILE)" \
|
|
--hosts-settings "$(HOSTS_CONFIG_FILE)"
|
|
|
|
.PHONY: endpoint/build
|
|
## Build the endpoint
|
|
endpoint/build:
|
|
cargo build $(CARGO_BUILD_TYPE) --bin trusttunnel_endpoint
|
|
|
|
.PHONY: endpoint/run
|
|
## Run the endpoint with the existing configuration files
|
|
endpoint/run: endpoint/build
|
|
cargo run $(CARGO_BUILD_TYPE) --bin trusttunnel_endpoint -- \
|
|
-l "$(LOG_LEVEL)" "$(CONFIG_FILE)" "$(HOSTS_CONFIG_FILE)"
|
|
|
|
.PHONY: endpoint/gen_client_config
|
|
## Generate the config for specified client to be used with vpn client and exit
|
|
endpoint/gen_client_config:
|
|
$(if $(CLIENT_NAME),,$(error CLIENT_NAME is not set. Specify the client name to generate the config for))
|
|
$(if $(ENDPOINT_ADDRESS),,$(error ENDPOINT_ADDRESS is not set. Set it to `ip:port` that client is going to use to connect to the endpoint))
|
|
cargo run $(CARGO_BUILD_TYPE) --bin trusttunnel_endpoint -- \
|
|
-c "$(CLIENT_NAME)" --address "$(ENDPOINT_ADDRESS)" "$(CONFIG_FILE)" "$(HOSTS_CONFIG_FILE)"
|
|
|
|
.PHONY: endpoint/clean
|
|
## Clean cargo artifacts
|
|
endpoint/clean:
|
|
cargo clean
|
|
|
|
.PHONY: lint
|
|
lint: lint-md lint-rust
|
|
|
|
## Lint markdown files.
|
|
## `markdownlint-cli` should be installed:
|
|
## macOS: `brew install markdownlint-cli`
|
|
## Linux: `npm install -g markdownlint-cli`
|
|
.PHONY: lint-md
|
|
lint-md:
|
|
markdownlint .
|
|
|
|
## Check Rust code formatting with rustfmt.
|
|
## `rustfmt` should be installed:
|
|
## rustup component add rustfmt
|
|
.PHONY: lint-rust
|
|
lint-rust:
|
|
cargo fmt --all -- --check
|
|
cargo clippy -- -D warnings
|
|
|
|
## Fix linter issues that are auto-fixable.
|
|
.PHONY: lint-fix
|
|
lint-fix: lint-fix-rust lint-fix-md
|
|
|
|
## Auto-fix Rust code formatting issues with rustfmt.
|
|
.PHONY: lint-fix-rust
|
|
lint-fix-rust:
|
|
cargo clippy --fix --allow-dirty
|
|
cargo fmt --all
|
|
|
|
## Auto-fix markdown files.
|
|
.PHONY: lint-fix-md
|
|
lint-fix-md:
|
|
markdownlint --fix .
|
|
|
|
.PHONY: test
|
|
test: test-rust
|
|
|
|
test-rust:
|
|
cargo test --workspace
|