mirror of
https://github.com/casjaysdevdocker/aria2
synced 2025-01-18 06:34:24 -05:00
🗃️ Committing everything that changed 🗃️
This commit is contained in:
parent
16760ba893
commit
81de015f7d
@ -85,13 +85,14 @@ __run_message() {
|
|||||||
# rewrite variables
|
# rewrite variables
|
||||||
ENV_PORTS="${ENV_PORTS//,/ }"
|
ENV_PORTS="${ENV_PORTS//,/ }"
|
||||||
ENV_PORTS="${ENV_PORTS//\/*/}"
|
ENV_PORTS="${ENV_PORTS//\/*/}"
|
||||||
|
SERVER_PORTS="${SERVER_PORTS//,/ }"
|
||||||
WEB_SERVER_PORTS="${SERVICE_PORT//\/*/}"
|
WEB_SERVER_PORTS="${SERVICE_PORT//\/*/}"
|
||||||
HEALTH_ENDPOINTS="${HEALTH_ENDPOINTS//,/ }"
|
HEALTH_ENDPOINTS="${HEALTH_ENDPOINTS//,/ }"
|
||||||
WEB_SERVER_PORTS="${WEB_SERVER_PORTS//\/*/}"
|
WEB_SERVER_PORTS="${WEB_SERVER_PORTS//\/*/}"
|
||||||
WEB_SERVER_PORTS="${SERVICE_PORT//,/ } ${WEB_SERVER_PORTS//,/ }"
|
WEB_SERVER_PORTS="${SERVICE_PORT//,/ } ${WEB_SERVER_PORTS//,/ }"
|
||||||
ENV_PORTS="$(echo "$ENV_PORTS" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' ' | grep '^' || false)"
|
ENV_PORTS="$(echo "$ENV_PORTS" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' ' | grep '^' || false)"
|
||||||
WEB_SERVER_PORTS="$(echo "$WEB_SERVER_PORTS" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' ' | grep '^' || false)"
|
WEB_SERVER_PORTS="$(echo "$WEB_SERVER_PORTS" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' ' | grep '^' || false)"
|
||||||
ENV_PORTS="$(echo "$WEB_SERVER_PORTS $ENV_PORTS $SERVER_PORTS" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' ' | grep '^' || false)"
|
ENV_PORTS="$(echo "$SERVER_PORTS" "$WEB_SERVER_PORTS" "$ENV_PORTS" "$SERVER_PORTS" | tr ' ' '\n' | sort -u | grep -v '^$' | tr '\n' ' ' | grep '^' || false)"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# variables based on env/files
|
# variables based on env/files
|
||||||
[ "$SERVICE_PORT" = "443" ] && SSL_ENABLED="true"
|
[ "$SERVICE_PORT" = "443" ] && SSL_ENABLED="true"
|
||||||
@ -112,21 +113,21 @@ DEFAULT_TEMPLATE_DIR="${DEFAULT_TEMPLATE_DIR:-/usr/local/share/template-files/de
|
|||||||
mkdir -p "/run"
|
mkdir -p "/run"
|
||||||
mkdir -p "/tmp"
|
mkdir -p "/tmp"
|
||||||
mkdir -p "/root"
|
mkdir -p "/root"
|
||||||
mkdir -p "/var/log"
|
mkdir -p "/data/logs"
|
||||||
mkdir -p "/run/init.d"
|
mkdir -p "/run/init.d"
|
||||||
mkdir -p "/config/secure"
|
mkdir -p "/config/secure"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# create required files
|
# create required files
|
||||||
touch "/var/log/entrypoint.log"
|
touch "/data/logs/entrypoint.log"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# fix permissions
|
# fix permissions
|
||||||
chmod -f 777 "/run"
|
chmod -f 777 "/run"
|
||||||
chmod -f 777 "/tmp"
|
chmod -f 777 "/tmp"
|
||||||
chmod -f 700 "/root"
|
chmod -f 700 "/root"
|
||||||
chmod -f 777 "/var/log"
|
chmod -f 777 "/data/logs"
|
||||||
chmod -f 777 "/run/init.d"
|
chmod -f 777 "/run/init.d"
|
||||||
chmod -f 777 "/config/secure"
|
chmod -f 777 "/config/secure"
|
||||||
chmod -f 777 "/var/log/entrypoint.log"
|
chmod -f 777 "/data/logs/entrypoint.log"
|
||||||
################## END OF CONFIGURATION #####################
|
################## END OF CONFIGURATION #####################
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Create the backup dir
|
# Create the backup dir
|
||||||
|
@ -202,7 +202,7 @@ __cron() {
|
|||||||
eval "$command"
|
eval "$command"
|
||||||
sleep $interval
|
sleep $interval
|
||||||
[ -f "/run/cron/$cmd" ] || break
|
[ -f "/run/cron/$cmd" ] || break
|
||||||
done |& tee /var/log/entrypoint.log
|
done |& tee /data/logs/entrypoint.log
|
||||||
}
|
}
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
__replace() {
|
__replace() {
|
||||||
|
@ -43,9 +43,9 @@ __update_conf_files() {
|
|||||||
local port="${SERVICE_PORT:-${ARIA2RPCPORT:-8000}}"
|
local port="${SERVICE_PORT:-${ARIA2RPCPORT:-8000}}"
|
||||||
[ -d "$etc_dir" ] || mkdir -p "$etc_dir"
|
[ -d "$etc_dir" ] || mkdir -p "$etc_dir"
|
||||||
[ -d "$data_dir" ] || mkdir -p "$data_dir"
|
[ -d "$data_dir" ] || mkdir -p "$data_dir"
|
||||||
[ -d "/var/log/aria2" ] || mkdir -p "/var/log/aria2"
|
[ -d "/data/logs/aria2" ] || mkdir -p "/data/logs/aria2"
|
||||||
cp -Rf "$conf_dir/." "$etc_dir/"
|
cp -Rf "$conf_dir/." "$etc_dir/"
|
||||||
ln -sf "/dev/stdout" "/var/log/aria2/aria2.log"
|
ln -sf "/dev/stdout" "/data/logs/aria2/aria2.log"
|
||||||
ln -sf "$conf_dir/aria2.session" "$etc_dir/aria2.session"
|
ln -sf "$conf_dir/aria2.session" "$etc_dir/aria2.session"
|
||||||
if [ -f "$etc_dir/aria-ng.config.js" ]; then
|
if [ -f "$etc_dir/aria-ng.config.js" ]; then
|
||||||
rm -Rf "$get_config"
|
rm -Rf "$get_config"
|
||||||
|
@ -45,7 +45,7 @@ __update_conf_files() {
|
|||||||
[ -d "$etc_dir" ] || mkdir -p "$etc_dir"
|
[ -d "$etc_dir" ] || mkdir -p "$etc_dir"
|
||||||
[ -d "$conf_dir" ] && cp -Rf "$conf_dir/." "$etc_dir/"
|
[ -d "$conf_dir" ] && cp -Rf "$conf_dir/." "$etc_dir/"
|
||||||
ln -sf "/dev/stderr" "var/log/nginx/nginx.log"
|
ln -sf "/dev/stderr" "var/log/nginx/nginx.log"
|
||||||
ln -sf "/dev/stdout" "/var/log/nginx/access.log"
|
ln -sf "/dev/stdout" "/data/logs/nginx/access.log"
|
||||||
if [ "$SSL_ENABLED" = "true" ]; then
|
if [ "$SSL_ENABLED" = "true" ]; then
|
||||||
__file_copy "$conf_dir/nginx.ssl.conf" "$etc_dir/nginx.conf"
|
__file_copy "$conf_dir/nginx.ssl.conf" "$etc_dir/nginx.conf"
|
||||||
__file_copy "$conf_dir/vhosts.d/default.ssl.conf" "$etc_dir/vhosts.d/default.conf"
|
__file_copy "$conf_dir/vhosts.d/default.ssl.conf" "$etc_dir/vhosts.d/default.conf"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Default configuration for aria2
|
# Default configuration for aria2
|
||||||
dir=/data/downloads/aria2
|
dir=/data/downloads/aria2
|
||||||
log=/var/log/aria2/aria2.log
|
log=/data/logs/aria2/aria2.log
|
||||||
input-file=/config/aria2/aria2.session
|
input-file=/config/aria2/aria2.session
|
||||||
save-session=/config/aria2/aria2.session
|
save-session=/config/aria2/aria2.session
|
||||||
enable-rpc=true
|
enable-rpc=true
|
||||||
|
@ -3,7 +3,7 @@ user root;
|
|||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
daemon off;
|
daemon off;
|
||||||
|
|
||||||
error_log /var/log/nginx/nginx.log error;
|
error_log /data/logs/nginx/nginx.log error;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
events {
|
events {
|
||||||
@ -16,7 +16,7 @@ http {
|
|||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
access_log /var/log/nginx/access.log main;
|
access_log /data/logs/nginx/access.log main;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
gzip on;
|
gzip on;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user