This commit is contained in:
Jokob-sk
2023-07-07 08:05:21 +10:00
parent 45dd94e5d5
commit 79b5429a01
3 changed files with 82 additions and 9 deletions

47
docs/DEBUG_TIPS.md Executable file
View File

@@ -0,0 +1,47 @@
## More Logging
When debugging an issue always set the highest log level:
`LOG_LEVEL='debug'`
## Check the _dev image and open issues
If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is:
`jokobsk/pi.alert_dev:latest`
> ⚠ Please backup your DB and config beforehand!
PLease also search [open issues](https://github.com/jokob-sk/Pi.Alert/issues).
## Surfacing errors when container restarts
Start the container via the terminal with a command similar to this one:
```bash
docker run --rm --network=host \
-v local/path/pialert/config:/home/pi/pialert/config \
-v local/path/pialert/db:/home/pi/pialert/db \
-e TZ=Europe/Berlin \
-e PORT=20211 \
jokobsk/pi.alert:latest
```
> ⚠ Please note, don't use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description.
## Disable restart behavior
To prevent a Docker container from automatically restarting in a Docker Compose file, specify the restart policy as `no`:
```yaml
version: '3'
services:
your-service:
image: your-image:tag
restart: no
# Other service configurations...
```

View File

@@ -16,6 +16,7 @@ There is also an in-app Help / FAQ section that should be answering frequently a
#### Popular/Suggested
- [Debugging tips](/docs/DEBUG_TIPS.md)
- [API endpoints details](/docs/API.md)
- [Plugin system details and how to develop your own](/front/plugins/README.md)
- [Network tree map configuration](/docs/NETWORK_TREE.md)
@@ -39,6 +40,7 @@ There is also an in-app Help / FAQ section that should be answering frequently a
- [Version history (legacy)](/docs/VERSIONS_HISTORY.md)
- [Invalid JSON errors debug help](/docs/DEBUG_INVALID_JSON.md)
- [Database structure](/docs/DATABASE.md)
- [Reverse proxy with SWAG](/docs/REVERSE_PROXY.md)
Feel free to suggest or submit new docs via a PR.

View File

@@ -1,19 +1,38 @@
## Reverse proxy configuration
Submitted by [s33d1ing](https://github.com/s33d1ing).
# Reverse Proxy Configuration
Reverse proxy example by using LinuxServer's SWAG container.
### nginx config
> Submitted by [s33d1ing](https://github.com/s33d1ing). 🙏
## [linuxserver/swag](https://github.com/linuxserver/docker-swag)
In the SWAG container create `/config/nginx/proxy-confs/pialert.subfolder.conf` with the following contents:
``` nginx
## Version 2023/02/05
# make sure that your pialert container is named pialert
# pialert does not require a base url setting
# Since Pi.Alert uses a Host network, you may need to use the IP address of the system running Pi.Alert for $upstream_app.
location /pialert {
return 301 $scheme://$host/pialert/;
}
location ^~ /pialert/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable for ldap auth (requires ldap-server.conf in the server block)
#include /config/nginx/ldap-location.conf;
# enable for Authelia (requires authelia-server.conf in the server block)
#include /config/nginx/authelia-location.conf;
# enable for Authentik (requires authentik-server.conf in the server block)
#include /config/nginx/authentik-location.conf;
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
@@ -33,9 +52,14 @@ location ^~ /pialert/ {
sub_filter 'href="/' 'href="/pialert/';
sub_filter '(?>$host)/css' '/pialert/css';
sub_filter '(?>$host)/img' '/pialert/img';
sub_filter '(?>$host)/js' '/pialert/js';
sub_filter '(?>$host)/lib' '/pialert/lib';
sub_filter '(?>$host)/php' '/pialert/php';
sub_filter '/img' '/pialert/img';
sub_filter '/lib' '/pialert/lib';
sub_filter '/php' '/pialert/php';
}
```
```