Changed WS_WEBUI_ENABLED to WEBUI_ENABLED

This commit is contained in:
abdulmohsen
2024-05-13 21:08:20 +03:00
parent 578d626408
commit 32ccd4e695
5 changed files with 46 additions and 30 deletions

24
FAQ.md
View File

@@ -336,7 +336,6 @@ These environment variables relates to the tool itself, you can load them via th
| WS_TRUST_HEADER | string | Which header contain user true IP. | `X-Forwarded-For` |
| WS_LIBRARY_SEGMENT | integer | Paginate backend library items request. Per request get total X number. | `1000` |
| WS_CACHE_URL | string | Cache server URL. | `redis://127.0.0.1:6379` |
| WS_WEBUI_ENABLED | bool | Enable Web UI. | `false` |
| WS_SECURE_API_ENDPOINTS | bool | Disregard the open route policy and require API key for all endpoints. | `false` |
> [!IMPORTANT]
@@ -352,16 +351,17 @@ $ docker exec -ti watchstate console system:tasks
> [!IMPORTANT]
> These environment variables relates to the container itself, and must be added via the `compose.yaml` file.
| Key | Type | Description | Default |
|----------------------|---------|------------------------------------|----------|
| DISABLE_HTTP | integer | Disable included `HTTP Server`. | `0` |
| DISABLE_CRON | integer | Disable included `Task Scheduler`. | `0` |
| DISABLE_CACHE | integer | Disable included `Cache Server`. | `0` |
| HTTP_PORT | string | Change the `HTTP` listen port. | `"8080"` |
| FPM_PORT | string | Change the `PHP-FPM` listen port. | `"9000"` |
| ~~WS_DISABLE_HTTP~~ | integer | Deprecated use `DISABLE_HTTP` | `0` |
| ~~WS_DISABLE_CRON~~ | integer | Deprecated use `DISABLE_CRON` | `0` |
| ~~WS_DISABLE_CACHE~~ | integer | Deprecated use `DISABLE_CACHE` | `0` |
| Key | Type | Description | Default |
|----------------------|---------|--------------------------------------|----------|
| WEBUI_ENABLED | bool | Enable WebUI. Value casted to a bool | `true` |
| DISABLE_HTTP | integer | Disable included `HTTP Server`. | `0` |
| DISABLE_CRON | integer | Disable included `Task Scheduler`. | `0` |
| DISABLE_CACHE | integer | Disable included `Cache Server`. | `0` |
| HTTP_PORT | string | Change the `HTTP` listen port. | `"8080"` |
| FPM_PORT | string | Change the `PHP-FPM` listen port. | `"9000"` |
| ~~WS_DISABLE_HTTP~~ | integer | Deprecated use `DISABLE_HTTP` | `0` |
| ~~WS_DISABLE_CRON~~ | integer | Deprecated use `DISABLE_CRON` | `0` |
| ~~WS_DISABLE_CACHE~~ | integer | Deprecated use `DISABLE_CACHE` | `0` |
---
@@ -369,7 +369,7 @@ $ docker exec -ti watchstate console system:tasks
The Webhook URL is backend specific, the request path is `/v1/api/backend/[BACKEND_NAME]/webhook`,
Where `[BACKEND_NAME]` is the name of the backend you want to add webhook for. Typically, the full URL
is `http://localhost:8080/v1/api/backend/[BACKEND_NAME]/webhook]`.
is `http://localhost:8080/v1/api/backend/[BACKEND_NAME]/webhook`.
> [!NOTE]
> You will keep seeing the `webhook.token` key, it's being kept for backward compatibility, and will be removed in the

View File

@@ -9,18 +9,33 @@ out of the box, this tool support `Jellyfin`, `Plex` and `Emby` media servers.
## updates
### 2024-05-13
In preparation for the beta testing of `WebUI` in two days, we have made little breaking change, we have changed the
environment variable `WS_WEBUI_ENABLED` to just `WEBUI_ENABLED`, We made this change to make sure people don't disable
the `WebUI`by mistake via the environment page in the `WebUI`. The `WebUI` will be enabled by default, in two days from
now, to disable it from now add `WEBUI_ENABLED=false` to your `compose.yaml` file. As this environment variable is
system level, it cannot be set via `.env` file.
Note: `WS_WEBUI_ENABLED` will be gone in few weeks, However it will still work for now, if `WEBUI_ENABLED` is not set.
### 2024-05-05
**Edit** - We received requests that people are exposing watchstate externally, and there was concern that having open webhook
**Edit** - We received requests that people are exposing watchstate externally, and there was concern that having open
webhook
endpoints might lead to abuse. As such, we have added a new environment variable `WS_SECURE_API_ENDPOINTS`. Simply set
the environment variable to `1` to secure the webhook endpoint. This means you have to add `?apikey=yourapikey` to the end
the environment variable to `1` to secure the webhook endpoint. This means you have to add `?apikey=yourapikey` to the
end
of the webhook endpoint.
-----
We are deprecating the use of the following environment variables `WS_DISABLE_HTTP`, `WS_DISABLE_CRON`, `WS_DISABLE_CACHE`,
and replacing them with `DISABLE_CACHE`, `DISABLE_CRON`, `DISABLE_HTTP`. The old environment variables will be removed in the future versions.
It doesn't make sense to mark them as `WS_` since they are global and do not relate to the tool itself. And they must be set from the `compose.yaml` file itself.
We are deprecating the use of the following environment
variables `WS_DISABLE_HTTP`, `WS_DISABLE_CRON`, `WS_DISABLE_CACHE`,
and replacing them with `DISABLE_CACHE`, `DISABLE_CRON`, `DISABLE_HTTP`. The old environment variables will be removed
in the future versions.
It doesn't make sense to mark them as `WS_` since they are global and do not relate to the tool itself. And they must be
set from the `compose.yaml` file itself.
### 2024-05-04

View File

@@ -38,7 +38,7 @@ return (function () {
],
],
'webui' => [
'enabled' => (bool)env('WS_WEBUI_ENABLED', false),
'enabled' => (bool)env('WEBUI_ENABLED', env('WS_WEBUI_ENABLED', false)),
'path' => fixPath(env('WS_WEBUI_PATH', __DIR__ . '/../public/exported')),
],
'database' => [

View File

@@ -70,11 +70,6 @@ return (function () {
'description' => 'Enable the null cache driver. This is useful for testing or container container startup.',
'type' => 'bool',
],
[
'key' => 'WS_WEBUI_ENABLED',
'description' => 'Enable the WebUI.',
'type' => 'bool',
],
[
'key' => 'WS_WEBUI_PATH',
'description' => 'The path to where the WebUI is compiled.',

View File

@@ -25,6 +25,19 @@
<BackendAdd @addBackend="toggleForm = false; loadContent()" :backends="backends"/>
</div>
<div class="column is-12" v-if="backends.length<1 && !toggleForm">
<Message class="is-warning" title="Warning">
<span class="icon-text">
<span class="icon"><i class="fas fa-exclamation"></i></span>
<span>
No backends found. Please add new backends to start using the tool. You can add new backend by
<NuxtLink @click="toggleForm=true" v-text="'clicking here'"/>
or by clicking the <span class="icon is-small"><i class="fas fa-add"></i></span> button above.
</span>
</span>
</Message>
</div>
<div v-for="backend in backends" :key="backend.name" class="column is-6-tablet is-12-mobile">
<div class="card">
<header class="card-header">
@@ -83,7 +96,6 @@ import 'assets/css/bulma-switch.css'
import moment from 'moment'
import request from '~/utils/request.js'
import BackendAdd from '~/components/BackendAdd.vue'
import {notification} from '~/utils/index.js'
useHead({title: 'Backends'})
@@ -94,12 +106,6 @@ const loadContent = async () => {
backends.value = []
const response = await request('/backends')
backends.value = await response.json()
if (backends.value.length > 0) {
return
}
toggleForm.value = true
notification('warning', 'Information', 'No backends found.')
}
onMounted(() => loadContent())