diff options
author | FxQnLr <[email protected]> | 2024-04-10 12:20:17 +0200 |
---|---|---|
committer | FxQnLr <[email protected]> | 2024-04-10 12:20:17 +0200 |
commit | bd5ed2f47fe870776783a5b2a56c899126a51860 (patch) | |
tree | 398fa227d8df143ebf5d4ecfe8b6f03f88022e65 | |
parent | 3428a637ce420baef9aa9f9803e71bd587867005 (diff) | |
download | webol-bd5ed2f47fe870776783a5b2a56c899126a51860.tar webol-bd5ed2f47fe870776783a5b2a56c899126a51860.tar.gz webol-bd5ed2f47fe870776783a5b2a56c899126a51860.zip |
Closes #29. Usable Readme and hopefully versioned container
-rw-r--r-- | .github/workflows/push.yml | 1 | ||||
-rw-r--r-- | README.md | 27 | ||||
-rw-r--r-- | src/config.rs | 1 | ||||
-rw-r--r-- | src/main.rs | 1 |
4 files changed, 25 insertions, 5 deletions
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: | |||
47 | tags: | | 47 | tags: | |
48 | ghcr.io/fxqnlr/webol:dev-latest | 48 | ghcr.io/fxqnlr/webol:dev-latest |
49 | ghcr.io/fxqnlr/webol:dev-${{ github.run_number }} | 49 | ghcr.io/fxqnlr/webol:dev-${{ github.run_number }} |
50 | ghcr.io/fxqnlr/webol:${{ env.CARGO_PKG_VERSION }} | ||
@@ -1,9 +1,28 @@ | |||
1 | # webol | 1 | # webol |
2 | 2 | ||
3 | DATABASE_URL: `String` | 3 | ## Config |
4 | Default `config.toml`: | ||
5 | ```toml | ||
6 | serveraddr = "0.0.0.0:7229" # String | ||
7 | pingtimeout = 10 # i64 | ||
8 | pingthreshold = 1 # i64 | ||
9 | timeoffset = 0 # i8 | ||
4 | 10 | ||
5 | WEBOL_APIKEY: `String` | 11 | [auth] |
12 | method = "none" # "none"|"key" | ||
13 | secret = "" # String | ||
14 | ``` | ||
6 | 15 | ||
7 | WEBOL_SERVERADDR: `Option<String>` (0.0.0.0:7229) | 16 | ## Docker |
8 | 17 | ||
9 | WEBOL_PINGTIMEOUT: `Option<i64>` (10) | 18 | minimal `docker-compose.yaml`: |
19 | ```yaml | ||
20 | services: | ||
21 | webol: | ||
22 | image: ghcr.io/fxqnlr/webol:0.4.0 | ||
23 | container_name: webol | ||
24 | restart: unless-stopped | ||
25 | volumes: | ||
26 | - ./devices:/devices | ||
27 | network_mode: host | ||
28 | ``` | ||
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 { | |||
25 | .set_default("pingtimeout", 10)? | 25 | .set_default("pingtimeout", 10)? |
26 | .set_default("pingthreshold", 1)? | 26 | .set_default("pingthreshold", 1)? |
27 | .set_default("timeoffset", 0)? | 27 | .set_default("timeoffset", 0)? |
28 | .set_default("auth.method", "none")? | ||
28 | .set_default("auth.secret", "")? | 29 | .set_default("auth.secret", "")? |
29 | .add_source(File::with_name("config.toml").required(false)) | 30 | .add_source(File::with_name("config.toml").required(false)) |
30 | .add_source(File::with_name("config.dev.toml").required(false)) | 31 | .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 { | |||
68 | } | 68 | } |
69 | 69 | ||
70 | #[tokio::main] | 70 | #[tokio::main] |
71 | #[allow(deprecated)] | ||
72 | async fn main() -> color_eyre::eyre::Result<()> { | 71 | async fn main() -> color_eyre::eyre::Result<()> { |
73 | color_eyre::install()?; | 72 | color_eyre::install()?; |
74 | 73 | ||