mirror of
https://github.com/caronc/apprise-api.git
synced 2025-03-03 17:11:43 +01:00
IPV4_ONLY and IPV6_ONLY environment control added (#235)
This commit is contained in:
parent
9147575fca
commit
4c038de8b3
@ -398,6 +398,8 @@ The use of environment variables allow you to provide over-rides to default sett
|
|||||||
|--------------------- | ----------- |
|
|--------------------- | ----------- |
|
||||||
| `PUID` | The User ID you wish the Apprise instance under the hood to run as. The default is `1000` if not otherwise specified.
|
| `PUID` | The User ID you wish the Apprise instance under the hood to run as. The default is `1000` if not otherwise specified.
|
||||||
| `PGID` | The Group ID you wish the Apprise instance under the hood to run as. The default is `1000` if not otherwise specified.
|
| `PGID` | The Group ID you wish the Apprise instance under the hood to run as. The default is `1000` if not otherwise specified.
|
||||||
|
| `IPV4_ONLY` | Force an all IPv4 only environment (default supports both IPV4 and IPv6). Nothing is done if `IPV6_ONLY` is also set as this creates an ambigious setup.
|
||||||
|
| `IPV6_ONLY` | Force an all IPv6 only environment (default supports both IPv4 and IPv6). Nothing is done if `IPV4_ONLY` is also set as this creates an ambigious setup.
|
||||||
| `APPRISE_DEFAULT_THEME` | Can be set to `light` or `dark`; it defaults to `light` if not otherwise provided. The theme can be toggled from within the website as well.
|
| `APPRISE_DEFAULT_THEME` | Can be set to `light` or `dark`; it defaults to `light` if not otherwise provided. The theme can be toggled from within the website as well.
|
||||||
| `APPRISE_DEFAULT_CONFIG_ID` | Defaults to `apprise`. This is the presumed configuration ID you always default to when accessing the configuration manager via the website.
|
| `APPRISE_DEFAULT_CONFIG_ID` | Defaults to `apprise`. This is the presumed configuration ID you always default to when accessing the configuration manager via the website.
|
||||||
| `APPRISE_CONFIG_DIR` | Defines an (optional) persistent store location of all configuration files saved. By default:<br/> - Configuration is written to the `apprise_api/var/config` directory when just using the _Django_ `manage runserver` script. However for the path for the container is `/config`.
|
| `APPRISE_CONFIG_DIR` | Defines an (optional) persistent store location of all configuration files saved. By default:<br/> - Configuration is written to the `apprise_api/var/config` directory when just using the _Django_ `manage runserver` script. However for the path for the container is `/config`.
|
||||||
|
@ -42,8 +42,8 @@ http {
|
|||||||
client_body_in_file_only off;
|
client_body_in_file_only off;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 8000;
|
listen 8000; # IPv4 Support
|
||||||
listen [::]:8000;
|
listen [::]:8000; # IPv6 Support
|
||||||
|
|
||||||
# Allow users to map to this file and provide their own custom
|
# Allow users to map to this file and provide their own custom
|
||||||
# overrides such as
|
# overrides such as
|
||||||
|
@ -38,10 +38,8 @@ pythonpath = '/opt/apprise/webapp'
|
|||||||
|
|
||||||
# bind to port 8000
|
# bind to port 8000
|
||||||
bind = [
|
bind = [
|
||||||
# ipv4
|
'0.0.0.0:8000', # IPv4 Support
|
||||||
'0.0.0.0:8000',
|
'[::]:8000', # IPv6 Support
|
||||||
# ipv6
|
|
||||||
'[::]:8000'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Workers are relative to the number of CPU's provided by hosting server
|
# Workers are relative to the number of CPU's provided by hosting server
|
||||||
|
@ -70,6 +70,22 @@ sed -i -e "s/^\(user[ \t]*=[ \t]*\).*$/\1$USER/g" \
|
|||||||
sed -i -e "s/^\(group[ \t]*=[ \t]*\).*$/\1$GROUP/g" \
|
sed -i -e "s/^\(group[ \t]*=[ \t]*\).*$/\1$GROUP/g" \
|
||||||
/opt/apprise/webapp/etc/supervisord.conf
|
/opt/apprise/webapp/etc/supervisord.conf
|
||||||
|
|
||||||
|
if [ "${IPV4_ONLY+x}" ] && [ "${IPV6_ONLY+x}" ]; then
|
||||||
|
echo -n "Warning: both IPV4_ONLY and IPV6_ONLY flags set; ambigious; no changes made."
|
||||||
|
|
||||||
|
# Handle IPV4_ONLY flag
|
||||||
|
elif [ "${IPV4_ONLY+x}" ]; then
|
||||||
|
echo -n "Enforcing Exclusive IPv4 environment... "
|
||||||
|
sed -ibak -e '/IPv6 Support/d' /opt/apprise/webapp/etc/nginx.conf /opt/apprise/webapp/gunicorn.conf.py && \
|
||||||
|
echo "Done." || echo "Failed!"
|
||||||
|
|
||||||
|
# Handle IPV6_ONLY flag
|
||||||
|
elif [ "${IPV6_ONLY+x}" ]; then
|
||||||
|
echo -n "Enforcing Exclusive IPv6 environment... "
|
||||||
|
sed -ibak -e '/IPv4 Support/d' /opt/apprise/webapp/etc/nginx.conf /opt/apprise/webapp/gunicorn.conf.py && \
|
||||||
|
echo "Done." || echo "Failed!"
|
||||||
|
fi
|
||||||
|
|
||||||
# Working directory
|
# Working directory
|
||||||
cd /opt/apprise
|
cd /opt/apprise
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user