🔧 Adding minimum and maximum port as environment variable (#136)

* 🔧 Adding minimum and maximum port as environment variable

* 🏗️ Updating `actions/*` to v4 because nodejs version is old
This commit is contained in:
Ricardo Araújo Paes 2024-10-15 20:50:33 -03:00 committed by GitHub
parent a1e1f55a29
commit 7fec9700c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 20 additions and 20 deletions

View File

@ -11,7 +11,7 @@ jobs:
name: Build and Test name: Build and Test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
@ -26,7 +26,7 @@ jobs:
name: Rustfmt name: Rustfmt
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
@ -40,7 +40,7 @@ jobs:
name: Clippy name: Clippy
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Docker meta - name: Docker meta
id: meta id: meta

View File

@ -10,7 +10,7 @@ jobs:
install-cross: install-cross:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v4
with: with:
fetch-depth: 50 fetch-depth: 50
@ -22,7 +22,7 @@ jobs:
matches: ${{ matrix.platform }} matches: ${{ matrix.platform }}
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v4
with: with:
name: cross-${{ matrix.platform }} name: cross-${{ matrix.platform }}
path: ${{ steps.cross.outputs.install_path }} path: ${{ steps.cross.outputs.install_path }}
@ -41,7 +41,7 @@ jobs:
steps: steps:
- name: Setup | Checkout - name: Setup | Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Setup | Rust - name: Setup | Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
@ -61,12 +61,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: install-cross needs: install-cross
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
fetch-depth: 50 fetch-depth: 50
- name: Download Cross - name: Download Cross
uses: actions/download-artifact@v1 uses: actions/download-artifact@v4
with: with:
name: cross-linux-musl name: cross-linux-musl
path: /tmp/ path: /tmp/
@ -105,7 +105,7 @@ jobs:
# artifacts are downloaded first. # artifacts are downloaded first.
needs: install-cross needs: install-cross
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
with: with:
fetch-depth: 50 fetch-depth: 50
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }} - run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }}

View File

@ -16,7 +16,7 @@ jobs:
install-cross: install-cross:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v4
with: with:
fetch-depth: 50 fetch-depth: 50
@ -28,7 +28,7 @@ jobs:
matches: ${{ matrix.platform }} matches: ${{ matrix.platform }}
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v4
with: with:
name: cross-${{ matrix.platform }} name: cross-${{ matrix.platform }}
path: ${{ steps.cross.outputs.install_path }} path: ${{ steps.cross.outputs.install_path }}
@ -50,7 +50,7 @@ jobs:
uses: dawidd6/action-get-tag@v1 uses: dawidd6/action-get-tag@v1
- name: Setup | Checkout - name: Setup | Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
# Cache files between builds # Cache files between builds
- name: Setup | Cache Cargo - name: Setup | Cache Cargo
@ -114,8 +114,8 @@ jobs:
id: tag id: tag
uses: dawidd6/action-get-tag@v1 uses: dawidd6/action-get-tag@v1
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions/download-artifact@v1 - uses: actions/download-artifact@v4
with: with:
name: cross-linux-musl name: cross-linux-musl
path: /tmp/ path: /tmp/
@ -163,7 +163,7 @@ jobs:
id: tag id: tag
uses: dawidd6/action-get-tag@v1 uses: dawidd6/action-get-tag@v1
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- run: bash ci/set_rust_version.bash stable ${{ matrix.target }} - run: bash ci/set_rust_version.bash stable ${{ matrix.target }}
- run: bash ci/build.bash cargo ${{ matrix.target }} RELEASE - run: bash ci/build.bash cargo ${{ matrix.target }} RELEASE
- run: | - run: |

View File

@ -93,8 +93,8 @@ Runs the remote proxy server
Usage: bore server [OPTIONS] Usage: bore server [OPTIONS]
Options: Options:
--min-port <MIN_PORT> Minimum accepted TCP port number [default: 1024] --min-port <MIN_PORT> Minimum accepted TCP port number [default: 1024, env: BORE_MIN_PORT]
--max-port <MAX_PORT> Maximum accepted TCP port number [default: 65535] --max-port <MAX_PORT> Maximum accepted TCP port number [default: 65535, env: BORE_MAX_PORT]
-s, --secret <SECRET> Optional secret for authentication [env: BORE_SECRET] -s, --secret <SECRET> Optional secret for authentication [env: BORE_SECRET]
-h, --help Print help information -h, --help Print help information
``` ```

View File

@ -36,11 +36,11 @@ enum Command {
/// Runs the remote proxy server. /// Runs the remote proxy server.
Server { Server {
/// Minimum accepted TCP port number. /// Minimum accepted TCP port number.
#[clap(long, default_value_t = 1024)] #[clap(long, default_value_t = 1024, env = "BORE_MIN_PORT")]
min_port: u16, min_port: u16,
/// Maximum accepted TCP port number. /// Maximum accepted TCP port number.
#[clap(long, default_value_t = 65535)] #[clap(long, default_value_t = 65535, env = "BORE_MAX_PORT")]
max_port: u16, max_port: u16,
/// Optional secret for authentication. /// Optional secret for authentication.