Skip to content
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
3 changes: 1 addition & 2 deletions proxy-manager/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ ports_description:
81/tcp: Proxy management web interface
443/tcp: HTTPS/SSL Entrance port
map:
- ssl:rw
- backup:rw
- addon_config:rw
backup_exclude:
- "*/logs"
schema:
Expand Down
6 changes: 3 additions & 3 deletions proxy-manager/rootfs/etc/letsencrypt.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
text = True
non-interactive = True
webroot-path = /data/letsencrypt-acme-challenge
logs-dir = /data/logs/letsencrypt
work-dir = /data/letsencrypt-workdir
webroot-path = /config/letsencrypt-acme-challenge
logs-dir = /config/logs/letsencrypt
work-dir = /config/letsencrypt-workdir
63 changes: 21 additions & 42 deletions proxy-manager/rootfs/etc/s6-overlay/s6-rc.d/init-npm/run
Original file line number Diff line number Diff line change
Expand Up @@ -38,38 +38,33 @@ sed -i 's#/var/lib/nginx/cache/private#/tmp/nginx/cache/private#g' \
sed -i 's#daemon off;#daemon off;\nload_module /usr/lib/nginx/modules/ngx_stream_module.so;#g' \
/etc/nginx/nginx.conf

if ! bashio::fs.directory_exists "/data/nginx"; then
if ! bashio::fs.directory_exists "/config/nginx"; then
mkdir -p \
/data/nginx/dead_host \
/data/nginx/proxy_host \
/data/nginx/redirection_host \
/data/nginx/stream \
/data/nginx/temp
/config/nginx/dead_host \
/config/nginx/proxy_host \
/config/nginx/redirection_host \
/config/nginx/stream \
/config/nginx/temp
fi

if ! bashio::fs.directory_exists "/data/logs/letsencrypt"; then
mkdir -p /data/logs/letsencrypt
if ! bashio::fs.directory_exists "/config/logs/letsencrypt"; then
mkdir -p /config/logs/letsencrypt
fi

if ! bashio::fs.directory_exists "/data/letsencrypt-acme-challenge"; then
mkdir /data/letsencrypt-acme-challenge
mkdir /data/letsencrypt-workdir
if ! bashio::fs.directory_exists "/config/letsencrypt-acme-challenge"; then
mkdir /config/letsencrypt-acme-challenge
mkdir /config/letsencrypt-workdir
fi

if ! bashio::fs.directory_exists "/data/manager"; then
mkdir /data/manager
cp /defaults/production.json /data/manager/production.json
fi

if ! bashio::fs.directory_exists "/ssl/nginxproxymanager"; then
if ! bashio::fs.directory_exists "/config/letsencrypt"; then
mkdir -p \
/ssl/nginxproxymanager
/config/letsencrypt
fi

if ! bashio::fs.directory_exists "/data/nginx/default_host"; then
if ! bashio::fs.directory_exists "/config/nginx/default_host"; then
mkdir -p \
/data/nginx/default_host \
/data/nginx/default_www
/config/nginx/default_host \
/config/nginx/default_www
fi

# Creates basic temporary files directory structure
Expand All @@ -84,22 +79,9 @@ mkdir -p \

ln -s /tmp/nginx /var/tmp/nginx
ln -s /tmp/nginx /var/lib/nginx/tmp
ln -s /data/manager /opt/nginx-proxy-manager/config
ln -s /config/npm /opt/nginx-proxy-manager/config

#Tidy unneeded symlinks
if bashio::fs.file_exists "/data/logs/default.log"; then
unlink /data/logs/default.log
fi

if bashio::fs.file_exists "/data/logs/manager.log"; then
unlink /data/logs/manager.log
fi

if bashio::fs.file_exists "/data/logs/letsencrypt-requests.log"; then
unlink /data/logs/letsencrypt-requests.log
fi

ln -sf /ssl/nginxproxymanager /etc/letsencrypt
ln -sf /config/letsencrypt /etc/letsencrypt

# NGinx needs this file to be able to start.
# It will not continously log into it.
Expand All @@ -108,7 +90,7 @@ touch /var/lib/nginx/logs/error.log
chmod 777 /var/lib/nginx/logs/error.log

# This file generates a dummy SSL certificate
if ! bashio::fs.directory_exists "/data/nginx/dummycert.pem" && ! bashio::fs.file_exists "/data/nginx/dummykey.pem";
if ! bashio::fs.directory_exists "/config/nginx/dummycert.pem" && ! bashio::fs.file_exists "/config/nginx/dummykey.pem";
then
bashio::log.info "Generating dummy SSL certificate"
openssl req \
Expand All @@ -118,10 +100,7 @@ then
-nodes \
-x509 \
-subj '/O=Nginx Proxy Manager/OU=Dummy Certificate/CN=localhost' \
-keyout /data/nginx/dummykey.pem \
-out /data/nginx/dummycert.pem \
-keyout /config/nginx/dummykey.pem \
-out /config/nginx/dummycert.pem \
|| bashio::exit.nok "Could not generate dummy certificate"
fi

# Clean up old database configuration file
rm -f /data/manager/production.json
6 changes: 3 additions & 3 deletions proxy-manager/rootfs/etc/s6-overlay/s6-rc.d/nginx/run
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ bashio::log.info "Starting NGinx..."
mkdir -p \
/tmp/nginx/body \
/var/log/nginx \
/data/custom_ssl \
/data/logs \
/data/access \
/config/custom_ssl \
/config/logs \
/config/access \
/tmp/nginx/cache/public \
/tmp/nginx/cache/private \
/var/cache/nginx/proxy_temp
Expand Down