diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -106,11 +106,13 @@ strip = true lto = true -[profile.bench] -debug = true - [lints.rust] -unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] } +unexpected_cfgs = { level = "warn", check-cfg = ["cfg(coverage_nightly)"] } [package.metadata.cargo-udeps.ignore] normal = ["openssl"] + +[package.metadata.binstall] +pkg-url = "https://sandhole.com.br/download/v{ version }/sandhole-{ target-family }-{ target-arch }{ binary-ext }" +pkg-fmt = "bin" +disabled-strategies = ["quick-install"] diff --git a/book/compose.yaml b/book/compose.yaml new file mode 100644 --- /dev/null +++ b/book/compose.yaml @@ -0,0 +1,43 @@ +networks: + sandhole-book: + external: false + +services: + nginx: + image: docker.io/nginx:1.29.0-alpine3.22 + container_name: sandhole_book + restart: unless-stopped + networks: + - sandhole-book + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" + volumes: + - ./book:/static:ro + - ./nginx.vh.default.conf:/etc/nginx/conf.d/default.conf:ro + - ./nginx.conf:/etc/nginx/nginx.conf:ro + + autossh: + image: docker.io/epiceric/sandhole-client:latest + restart: unless-stopped + container_name: sandhole_book_autossh + volumes: + - ./ssh_secret:/secret + networks: + - sandhole-book + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" + command: | + -i /secret/id_ed25519 + -c aes256-gcm@openssh.com + -o StrictHostKeyChecking=accept-new + -o ServerAliveInterval=30 + -R sandhole.com.br:80:nginx:80 + -R www.sandhole.com.br:80:nginx:80 + sandhole.com.br + http2 diff --git a/book/nginx.conf b/book/nginx.conf new file mode 100644 --- /dev/null +++ b/book/nginx.conf @@ -0,0 +1,20 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + access_log off; + sendfile on; + keepalive_timeout 65; + gzip on; + include /etc/nginx/conf.d/*.conf; +} + diff --git a/book/nginx.vh.default.conf b/book/nginx.vh.default.conf new file mode 100644 --- /dev/null +++ b/book/nginx.vh.default.conf @@ -0,0 +1,15 @@ +server { + charset utf-8; + listen 80; + http2 on; + server_name localhost; + + rewrite ^/download/v(.*)/sandhole-linux-x86_64$ https://github.com/EpicEric/sandhole/releases/download/v$1/sandhole-linux-amd64 permanent; + rewrite ^/download/v(.*)/sandhole-linux-aarch64$ https://github.com/EpicEric/sandhole/releases/download/v$1/sandhole-linux-arm64 permanent; + + location / { + root /static; + index index.html index.htm; + } +} + diff --git a/book/src/admin_interface.png b/book/src/admin_interface.png --- a/book/src/admin_interface.png +++ b/book/src/admin_interface.png