From 3428a637ce420baef9aa9f9803e71bd587867005 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Wed, 10 Apr 2024 00:16:55 +0200 Subject: Closes #24. Changed postgres to json directory storage --- .github/workflows/pull_request.yml | 1 - .github/workflows/push.yml | 1 - 2 files changed, 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 7196d4e..663f437 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,7 +5,6 @@ on: [ pull_request, workflow_dispatch ] env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" - SQLX_OFFLINE: "true" CARGO_TERM_COLOR: always jobs: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d41941b..c04a19a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -8,7 +8,6 @@ on: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" - SQLX_OFFLINE: "true" CARGO_TERM_COLOR: always jobs: -- cgit v1.2.3 From bd5ed2f47fe870776783a5b2a56c899126a51860 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Wed, 10 Apr 2024 12:20:17 +0200 Subject: Closes #29. Usable Readme and hopefully versioned container --- .github/workflows/push.yml | 1 + README.md | 27 +++++++++++++++++++++++---- src/config.rs | 1 + src/main.rs | 1 - 4 files changed, 25 insertions(+), 5 deletions(-) (limited to '.github') diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c04a19a..bdedfee 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -47,3 +47,4 @@ jobs: tags: | ghcr.io/fxqnlr/webol:dev-latest ghcr.io/fxqnlr/webol:dev-${{ github.run_number }} + ghcr.io/fxqnlr/webol:${{ env.CARGO_PKG_VERSION }} diff --git a/README.md b/README.md index eabc051..88f786a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,28 @@ # webol -DATABASE_URL: `String` +## Config +Default `config.toml`: +```toml +serveraddr = "0.0.0.0:7229" # String +pingtimeout = 10 # i64 +pingthreshold = 1 # i64 +timeoffset = 0 # i8 -WEBOL_APIKEY: `String` +[auth] +method = "none" # "none"|"key" +secret = "" # String +``` -WEBOL_SERVERADDR: `Option` (0.0.0.0:7229) +## Docker -WEBOL_PINGTIMEOUT: `Option` (10) +minimal `docker-compose.yaml`: +```yaml +services: + webol: + image: ghcr.io/fxqnlr/webol:0.4.0 + container_name: webol + restart: unless-stopped + volumes: + - ./devices:/devices + network_mode: host +``` diff --git a/src/config.rs b/src/config.rs index 124893b..bfb28be 100644 --- a/src/config.rs +++ b/src/config.rs @@ -25,6 +25,7 @@ impl Config { .set_default("pingtimeout", 10)? .set_default("pingthreshold", 1)? .set_default("timeoffset", 0)? + .set_default("auth.method", "none")? .set_default("auth.secret", "")? .add_source(File::with_name("config.toml").required(false)) .add_source(File::with_name("config.dev.toml").required(false)) diff --git a/src/main.rs b/src/main.rs index cf0d39b..779385f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,7 +68,6 @@ impl Modify for SecurityAddon { } #[tokio::main] -#[allow(deprecated)] async fn main() -> color_eyre::eyre::Result<()> { color_eyre::install()?; -- cgit v1.2.3 From 2476e182f61d209768635e8eca6e75b4acfbd007 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Thu, 11 Apr 2024 09:16:21 +0200 Subject: Change Docker release system --- .github/workflows/push.yml | 56 +++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 23 deletions(-) (limited to '.github') diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index bdedfee..30edefa 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,14 +1,11 @@ -name: build and push +name: container on: push: - branches: [ "main" ] - workflow_dispatch: - -env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - CARGO_TERM_COLOR: always + branches: + - "main" + tags: + - "v*.*.*" jobs: test: @@ -22,29 +19,42 @@ jobs: - run: cargo check --release - run: cargo clippy --release - build: + docker: runs-on: ubuntu-latest - needs: test steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: ghcr.io/fxqnlr/webol + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/setup-buildx-action@v3 + - name: Login to GHCR + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - id: docker_build - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: - push: true + context: . platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max - tags: | - ghcr.io/fxqnlr/webol:dev-latest - ghcr.io/fxqnlr/webol:dev-${{ github.run_number }} - ghcr.io/fxqnlr/webol:${{ env.CARGO_PKG_VERSION }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} -- cgit v1.2.3