Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non quoted string in env file. #507

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,31 @@ https://watchstate.example.org {

---

### WS_API_AUTO

The purpose of this environment variable is to automate the configuration process. It's mainly used for people who uses many browsers
to access the `WebUI` and want to automate the configuration process. as it's requires the API settings to be configured before it
can be used. This environment variable can be enabled by setting `WS_API_AUTO=true` in `${WS_DATA_PATH}/config/.env`.

#### Why you should use it?

You normally should not use it, as it's a **GREAT SECURITY RISK**. However, if you are using the tool in a secure environment
and not worried about exposing your API key, you can use it to automate the configuration process.

#### Why you should not use it?

Because, by exposing your API key, you are also exposing every data you have in the tool. This is a **GREAT SECURITY RISK**,
any person or bot that are able to access the `WebUI` will also be able to visit `/v1/api/system/auto` and get your API key. And with this key
they can do anything they want with your data. including viewing your media servers api keys.

So, please while we have this option available, we strongly recommend not to use it if `WatchState` is exposed to the internet.

> [!IMPORTANT]
> This environment variable is **GREAT SECURITY RISK**, and we strongly recommend not to use it if `WatchState` is exposed to the internet.
> I cannot stress this enough, please do not use it unless you are in a secure environment.

---

### How to disable the included cache server and use external cache server?

Set this environment variable in your `compose.yaml` file `DISABLE_CACHE` with value of `1`. to use external redis server
Expand Down Expand Up @@ -745,7 +770,7 @@ Once that is done you are ready to compile the `WebUI`.

```bash
$ cd frontend
$ yarn install --production --prefer-offline --frozen-lockfile
$ yarn install --production --prefer-offline --frozen-lockfile && yarn run generate
```

There should be a new directory called `exported`, you need to move that folder to the `public` directory.
Expand All @@ -761,7 +786,7 @@ ws:/opt/app/public$ ls
exported index.php
```

There must be exactly one `index.php` file and one `exported` directory. inside that directory.
There must be exactly one `index.php` file and one `exported` directory. inside that directory, or if you prefer, you can add `WS_WEBUI_PATH` environment variable to point to the `exported` directory.

* link the app to the frontend proxy. For caddy, you can use the following configuration.

Expand Down
16 changes: 16 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Old Updates

### 2024-05-14

We are happy to announce the beta testing of the `WebUI`. To get started on using it you just need to visit the url `http://localhost:8080` We are supposed to
enabled it by default tomorrow, but we decided to give you a head start. We are looking forward to your feedback. If you don't use the `WebUI` then you need to
add the environment variable `WEBUI_ENABLED=0` in your `compose.yaml` file. and restart the container.

### 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
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@
This tool primary goal is to sync your backends play state without relying on third party services,
out of the box, this tool support `Jellyfin`, `Plex` and `Emby` media servers.

## updates
## Updates

### 2024-05-14
### 2024-06-23

We are happy to announce the beta testing of the `WebUI`. To get started on using it you just need to visit the url `http://localhost:8080` We are supposed to
enabled it by default tomorrow, but we decided to give you a head start. We are looking forward to your feedback. If you don't use the `WebUI` then you need to
add the environment variable `WEBUI_ENABLED=0` in your `compose.yaml` file. and restart the container.
WE are happy to announce that the `WebUI` is ready for wider usage and we are planning to release it in the next few months.
We are actively working on it to improve it. If you have any feedback or suggestions, please let us know. We feel it's almost future complete
for the things that we want.

### 2024-05-13
On another related news, we have added new environment variable `WS_API_AUTO` "disabled by default" which can be used
to automatically expose your **API KEY/TOKEN**. This is useful for users who are using the `WebUI` from many different browsers
and want to automate the configuration process.

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.
While the `WebUI` is included in the main project, it's a standalone feature and requires the API settings to be configured before it
can be used. This environment variable can be enabled by setting `WS_API_AUTO=true` in `${WS_DATA_PATH}/config/.env`.

Note: `WS_WEBUI_ENABLED` will be gone in few weeks, However it will still work for now, if `WEBUI_ENABLED` is not set.
> [!IMPORTANT]
> This environment variable is **GREAT SECURITY RISK**, and we strongly recommend not to use it if `WatchState` is exposed to the internet.

Refer to [NEWS](NEWS.md) for old updates.

# Features

* **NEW** WebUI. (Preview).
* WebUI.
* Sync backends play state (from many to many).
* Backup your backends play state into `portable` format.
* Receive Webhook events from media backends.
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"symfony/yaml": "^6.1.4",
"symfony/process": "^6.1.3",
"symfony/http-client": "^6.1.4",
"symfony/dotenv": "^6.1",
"symfony/lock": "^6.1.3",
"league/container": "^4.2",
"psr/http-client": "^1.0.1",
Expand Down
120 changes: 25 additions & 95 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'prefix' => '/v1/api',
'key' => env('WS_API_KEY', null),
'secure' => (bool)env('WS_SECURE_API_ENDPOINTS', false),
'auto' => (bool)env('WS_API_AUTO', false),
'pattern_match' => [
'backend' => '[a-zA-Z0-9_-]+',
],
Expand Down
Loading