🗃️ Committing everything that changed 🗃️

This commit is contained in:
casjay 2023-02-24 05:21:10 -05:00
parent d0397e44c4
commit be06b27a35
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F
8 changed files with 8451 additions and 8 deletions

View File

@ -3,7 +3,7 @@ ARG LICENSE="MIT"
ARG IMAGE_NAME="aria2"
ARG PHP_SERVER="aria2"
ARG TIMEZONE="America/New_York"
ARG BUILD_DATE="Fri Feb 24 03:55:13 AM EST 2023"
ARG BUILD_DATE="Fri Feb 24 04:58:11 AM EST 2023"
ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data"
ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config"
ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
@ -65,14 +65,24 @@ RUN set -ex; \
if [ "${DISTRO_VERSION}" = "edge" ]; then echo "http://dl-cdn.alpinelinux.org/alpine/${DISTRO_VERSION}/testing" >>"/etc/apk/repositories" ; fi ; \
apk update --update-cache && apk add --no-cache ${PACK_LIST}
RUN curl -q -LSsf https://github.com/mayswind/AriaNg/releases/download/$ARIANG_VERSION/AriaNg-$ARIANG_VERSION.zip -o /tmp/AriaNg-$ARIANG_VERSION.zip && \
mkdir -p /var/www/ariang && unzip /tmp/AriaNg-$ARIANG_VERSION.zip -d /var/www/ariang
RUN curl -q -LSsf "https://github.com/mayswind/AriaNg/releases/download/$ARIANG_VERSION/AriaNg-$ARIANG_VERSION.zip" -o "/tmp/AriaNg-$ARIANG_VERSION.zip" && \
mkdir -p" /var/www/ariang" && unzip "/tmp/AriaNg-$ARIANG_VERSION.zip" -d "/var/www/ariang"
RUN echo "$TIMEZONE" >"/etc/timezone" ; \
touch "/etc/profile" "/root/.profile" ; \
PHP_FPM="$(ls /usr/*bin/php*fpm* 2>/dev/null)" ; \
echo 'hosts: files dns' >"/etc/nsswitch.conf" ; \
[ -f "/etc/bash/bashrc" ] && cp -Rf "/etc/bash/bashrc" "/root" ; \
sed -i 's|root:x:.*|root:x:0:0:root:/root:/bin/bash|g' "/etc/passwd" ; \
[ -f "/usr/share/zoneinfo/${TZ}" ] && ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime" ; \
[ -n "$PHP_FPM" ] && [ -z "$(type -P php-fpm)" ] && ln -sf "$PHP_FPM" "/usr/bin/php-fpm" ; \
rm -rf "/bin/sh" ; BASH_CMD="$(type -P bash)" ; [ -f "$BASH_CMD" ] && ln -sf "$BASH_CMD" "/bin/sh" ; \
printf '# Profile\n\n%s\n%s\n%s\n' '. /etc/profile' '. /root/.profile' "alias quit='exit 0 2>/dev/null'" >"/root/.bashrc" ; \
if [ -f "/etc/profile.d/color_prompt.sh.disabled" ]; then mv -f "/etc/profile.d/color_prompt.sh.disabled" "/etc/profile.d/color_prompt.sh"; fi
RUN echo 'Running cleanup' ; \
BASH_CMD="$(type -P bash)" ; \
rm -rf /etc/systemd/system/*.wants/* ; \
rm -rf /lib/systemd/system/systemd-update-utmp* ; \
[ -f "BASH_CMD" ] && ln -sf $BASH_CMD /usr/bin/sh ; \
rm -rf /lib/systemd/system/local-fs.target.wants/* ; \
rm -rf /lib/systemd/system/multi-user.target.wants/* ; \
rm -rf /lib/systemd/system/sockets.target.wants/*udev* ; \
@ -101,7 +111,7 @@ ARG DISTRO_VERSION
ARG PHP_VERSION
USER ${USER}
WORKDIR /data/aria2
WORKDIR /root
LABEL maintainer="CasjaysDev <docker-admin@casjaysdev.com>"
LABEL org.opencontainers.image.vendor="CasjaysDev"

View File

@ -39,7 +39,7 @@ __certbot() {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__heath_check() {
local healthStatus=0 health="Good"
#__pgrep ${1:-$SERVICE_NAME} &>/dev/null || healthStatus=$((healthStatus + 1))
__pgrep ${1:-$SERVICE_NAME} &>/dev/null || healthStatus=$((healthStatus + 1))
#__curl "http://localhost:$SERVICE_PORT/server-health" || healthStatus=$((healthStatus + 1))
[ "$healthStatus" -eq 0 ] || health="Errors reported see docker logs --follow $CONTAINER_NAME"
return $healthStatus
@ -87,7 +87,7 @@ __start_message() {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__exec_pre_start() {
__start_message
nginx -c /etc/nginx/nginx.conf
__exec_command nginx -c /etc/nginx/nginx.conf
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__run_backup() {

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,35 @@
# Default configuration for aria2
dir=/data/aria2
log=/proc/self/fd/2
input-file=/config/aria2/aria2.session
save-session=/config/aria2/aria2.session
enable-rpc=true
rpc-listen-port=8080
rpc-allow-origin-all=true
rpc-listen-all=true
disable-ipv6=true
max-concurrent-downloads=5
continue=true
max-connection-per-server=5
min-split-size=10M
split=10
enable-http-pipelining=true
max-overall-download-limit=0
max-download-limit=0
max-overall-upload-limit=0
max-upload-limit=0
file-allocation=prealloc
console-log-level=error
save-session-interval=10
max-upload-limit=0
follow-torrent=true
listen-port=51413
user-agent=Transmission/2.77
seed-ratio=0
bt-seed-unverified=false
bt-save-metadata=true
bt-tracker=udp://62.138.0.158:6969/announce,udp://188.241.58.209:6969/announce,udp://151.80.120.112:2710/announce,udp://151.80.120.114:2710/announce,udp://93.158.213.92:1337/announce,udp://185.19.107.254:80/announce,udp://185.225.17.100:1337/announce,udp://208.83.20.20:6969/announce,udp://5.206.19.247:6969/announce,udp://37.235.174.46:2710/announce,udp://142.44.243.4:1337/announce,udp://195.154.52.99:80/announce,udp://54.37.235.149:6969/announce,udp://212.1.226.176:2710/announce,udp://89.234.156.205:451/announce,udp://159.100.245.181:6969/announce,udp://45.56.74.11:6969/announce,udp://51.15.226.113:6969/announce,udp://176.113.71.19:6961/announce,udp://51.15.40.114:80/announce
on-download-error=/config/aria2/scripts/post-hook.sh
on-download-complete=/config/aria2/scripts/post-hook.sh

View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
##@Version : 202210191942-git
# @@Author : Jason Hempstead
# @@Contact : git-admin@casjaysdev.com
# @@License : LICENSE.md
# @@ReadME : post-hook.sh --help
# @@Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments
# @@Created : Wednesday, Oct 19, 2022 19:42 EDT
# @@File : post-hook.sh
# @@Description : post script
# @@Changelog : newScript
# @@TODO : Refactor code
# @@Other :
# @@Resource : https://aria2.github.io/manual/en/html/aria2c.html#event-hook
# @@Terminal App : no
# @@sudo/root : no
# @@Template : bash/system
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
set -eu
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Aria2 hook triggered with parameters: GID [$1], Files Count: [$2], Files Path: [$3]"

View File

@ -0,0 +1,99 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/avif avif;
image/png png;
image/svg+xml svg svgz;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/webp webp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
font/woff woff;
font/woff2 woff2;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.text odt;
application/vnd.openxmlformats-officedocument.presentationml.presentation
pptx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
xlsx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document
docx;
application/vnd.wap.wmlc wmlc;
application/wasm wasm;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@ -0,0 +1,82 @@
# Default nginx configuration
user root;
worker_processes 1;
daemon off;
error_log /proc/self/fd/2 error;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
map $http_upgrade $connection_upgrade { default upgrade; '' close; }
server {
listen 6800;
root /var/www/ariang;
index index.html;
proxy_intercept_errors off;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' *; frame-src 'self' *; object-src 'self'" always;
location /jsonrpc {
proxy_pass http://127.0.0.1:8080/jsonrpc;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
location /rpc {
proxy_pass http://127.0.0.1:8080/jsonrpc;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location /nginx_status {
stub_status;
}
location /health {
default_type text/html;
allow all;
access_log off;
return 200 'OK';
}
location /health.json {
default_type application/json;
allow all;
access_log off;
return 200 '{"status":"OK"}';
}
}
}