Compare commits
16 Commits
Author | SHA1 | Date |
---|---|---|
|
da5fc5295b | 2 months ago |
|
1704a52542 | 2 months ago |
|
1736639a04 | 2 months ago |
|
ccf3370ab5 | 2 months ago |
|
ab53dc2d5c | 2 months ago |
|
2d4a30d675 | 2 months ago |
|
b2eba08767 | 2 months ago |
|
fca510308b | 2 months ago |
|
4717c93610 | 2 months ago |
|
b3c0237ad9 | 2 months ago |
|
9650e66147 | 2 months ago |
|
c37c18d723 | 2 months ago |
|
64edada887 | 2 months ago |
![]() |
a4bf8f8017 | 3 months ago |
![]() |
0a6585a2bd | 3 months ago |
|
32cba5812d | 5 months ago |
18 changed files with 304 additions and 8 deletions
@ -0,0 +1,23 @@
|
||||
GEN_ROBOTS_TXT=false |
||||
GEN_SITE_MAP=false |
||||
MAX_UPLOAD_SIZE=128 |
||||
PROD=false |
||||
SITE_NAME=UGUU |
||||
SITE_URL=https://localhost |
||||
ABUSE_CONTACT=abuse@example.com |
||||
INFO_CONTACT=info@example.com |
||||
SERVER_CN_LOC=Sweden |
||||
SITE_META_INFO=SITENAME is a temporary file hosting service, upload files up to 128MiB for 24 hours. |
||||
PAYPAL_URL= |
||||
BTC_ADDR= |
||||
FLATTR_URL= |
||||
DB_PATH=/var/www/db/uguu.sq3 |
||||
FILES_ROOT=/var/www/files/ |
||||
LOG_IP=false |
||||
DB_USER=NULL |
||||
DB_PASS=NULL |
||||
ANTI_DUPE=false |
||||
FILES_RETRIES=15 |
||||
SSL=true |
||||
NAME_LENGTH=8 |
||||
URL=https://filesdomain |
@ -0,0 +1,70 @@
|
||||
FROM alpine:latest |
||||
|
||||
ARG VERSION |
||||
|
||||
# Install the needed software |
||||
RUN apk add --no-cache curl nginx php8-fpm php8-sqlite3 php8-opcache sqlite nodejs git npm bash build-base supervisor |
||||
|
||||
# Create the www-data user and group |
||||
RUN set -x ; \ |
||||
addgroup -g 82 -S www-data ; \ |
||||
adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1 |
||||
|
||||
# Link php bin |
||||
RUN ln -s /usr/bin/php8 /usr/bin/php |
||||
|
||||
# Copy supervisor conf file |
||||
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf |
||||
|
||||
# Set default workdir |
||||
WORKDIR /var/www/ |
||||
|
||||
COPY docker/docker-entrypoint.sh . |
||||
|
||||
# Download Uguu |
||||
ADD https://git.pomf.se/Pomf/uguu/archive/v${VERSION}.tar.gz v${VERSION}.tar.gz |
||||
RUN tar xvf v${VERSION}.tar.gz |
||||
|
||||
# Create the needed directories |
||||
RUN mkdir /var/www/uguu/dist && \ |
||||
mkdir /var/www/db && \ |
||||
mkdir /var/www/files |
||||
|
||||
# Create the Sqlite DB |
||||
RUN sqlite3 /var/www/db/uguu.sq3 -init /var/www/uguu/sqlite_schema.sql && \ |
||||
chown -R www-data:www-data /var/www && \ |
||||
chmod -R 775 /var/www/ |
||||
|
||||
# Fix script paths |
||||
RUN chmod a+x /var/www/uguu/checkdb.sh && \ |
||||
chmod a+x /var/www/uguu/checkfiles.sh && \ |
||||
sed -i 's#/path/to/files/#/var/www/uguu/files/#g' /var/www/uguu/checkfiles.sh && \ |
||||
sed -i 's#/path/to/db/uguu.sq3#/var/www/db/uguu.sq3#g' /var/www/uguu/checkdb.sh |
||||
|
||||
# Add scripts to cron |
||||
RUN echo "0,30 * * * * bash /var/www/uguu/checkfiles.sh" >> /var/spool/cron/crontabs/www-data && \ |
||||
echo "0,30 * * * * bash /var/www/uguu/checkdb.sh" >> /var/spool/cron/crontabs/www-data |
||||
|
||||
# Copy Nginx Server conf |
||||
COPY docker/uguu.conf /etc/nginx/http.d/ |
||||
|
||||
# Copy SSL certs |
||||
COPY docker/ssl /etc/ssl |
||||
|
||||
# Copy Uguu config |
||||
COPY dist.json /var/www/uguu/dist.json |
||||
|
||||
# Give permissions to www-data |
||||
RUN chown -R www-data:www-data /run /var/lib/php8 /var/lib/nginx /var/log/nginx /var/log/php8 /etc/nginx /etc/php8 |
||||
|
||||
# Change user to www-data |
||||
USER www-data |
||||
|
||||
# Expose port 80 from the container |
||||
EXPOSE 80 |
||||
|
||||
# Expose port 443 from the container |
||||
EXPOSE 443 |
||||
|
||||
# Load entrypoint |
||||
ENTRYPOINT [ "bash", "/var/www/docker-entrypoint.sh" ] |
@ -0,0 +1,70 @@
|
||||
{ |
||||
"init": { |
||||
"allowErrors": false |
||||
}, |
||||
"dest": "dist", |
||||
"pkgVersion": "1.5.3", |
||||
"banners": [ |
||||
"banners/malware_scans.swig", |
||||
"banners/donations.swig" |
||||
], |
||||
"src": [ |
||||
"templates/index.swig", |
||||
"templates/faq.swig", |
||||
"templates/tools.swig" |
||||
], |
||||
|
||||
"generateRobotstxt": "${GEN_ROBOTS_TXT}", |
||||
"generateSitemap": "${GEN_SITE_MAP}", |
||||
"max_upload_size": "${MAX_UPLOAD_SIZE}", |
||||
"production": "${PROD}", |
||||
"siteName": "${SITE_NAME}", |
||||
"siteUrl": "${SITE_URL}", |
||||
"abuseContact": "${ABUSE_CONTACT}", |
||||
"infoContact": "${INFO_CONTACT}", |
||||
"ServerCountryLocation": "${SERVER_CN_LOC}", |
||||
"SiteMetaInfo": "${SITE_META_INFO}", |
||||
"ToolsDesc": "The following tools might need editing to work on this clone of Uguu, usually editing the URL works.", |
||||
"paypalUrl": "${PAYPAL_URL}", |
||||
"bitcoinAddress": "${BTC_ADDR}", |
||||
"flattrUrl": "${FLATTR_URL}", |
||||
"DB_MODE": "sqlite", |
||||
"DB_PATH": "${DB_PATH}", |
||||
"DB_USER": "${DB_USER}", |
||||
"DB_PASS": "${DB_PASS}", |
||||
"LOG_IP": "${LOG_IP}", |
||||
"ANTI_DUPE": "${ANTI_DUPE}", |
||||
"BLACKLIST_DB": true, |
||||
"FILTER_MODE": true, |
||||
"FILES_ROOT": "${FILES_ROOT}", |
||||
"FILES_RETRIES": "${FILES_RETRIES}", |
||||
"SSL": "${SSL}", |
||||
"URL": "${URL}", |
||||
"NAME_LENGTH": "${NAME_LENGTH}", |
||||
"ID_CHARSET": "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ", |
||||
"BLOCKED_EXTENSIONS": [ |
||||
"exe", |
||||
"scr", |
||||
"com", |
||||
"vbs", |
||||
"bat", |
||||
"cmd", |
||||
"htm", |
||||
"html", |
||||
"jar", |
||||
"msi", |
||||
"apk", |
||||
"phtml", |
||||
"svg" |
||||
], |
||||
"BLOCKED_MIME": [ |
||||
"application/msword", |
||||
"text/html", |
||||
"application/x-dosexec", |
||||
"application/java", |
||||
"application/java-archive", |
||||
"application/x-executable", |
||||
"application/x-mach-binary", |
||||
"image/svg+xml" |
||||
] |
||||
} |
@ -0,0 +1,5 @@
|
||||
#!/bin/bash |
||||
cd /var/www/uguu/ |
||||
make |
||||
make install |
||||
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf |
@ -0,0 +1,32 @@
|
||||
[supervisord] |
||||
nodaemon=true |
||||
logfile=/dev/null |
||||
logfile_maxbytes=0 |
||||
pidfile=/run/supervisord.pid |
||||
|
||||
[program:php-fpm] |
||||
command=php-fpm8 -F |
||||
stdout_logfile=/dev/stdout |
||||
stdout_logfile_maxbytes=0 |
||||
stderr_logfile=/dev/stderr |
||||
stderr_logfile_maxbytes=0 |
||||
autorestart=false |
||||
startretries=0 |
||||
|
||||
[program:nginx] |
||||
command=nginx -g 'daemon off;' |
||||
stdout_logfile=/dev/stdout |
||||
stdout_logfile_maxbytes=0 |
||||
stderr_logfile=/dev/stderr |
||||
stderr_logfile_maxbytes=0 |
||||
autorestart=false |
||||
startretries=0 |
||||
|
||||
[program:crond] |
||||
command=crond -b |
||||
stdout_logfile=/dev/stdout |
||||
stdout_logfile_maxbytes=0 |
||||
stderr_logfile=/dev/stderr |
||||
stderr_logfile_maxbytes=0 |
||||
autorestart=false |
||||
startretries=0 |
@ -0,0 +1,64 @@
|
||||
server { |
||||
listen 80; |
||||
server_name localhost; |
||||
return 301 https://localhost$request_uri; |
||||
} |
||||
|
||||
server { |
||||
listen 80; |
||||
server_name filesdomain; |
||||
return 301 https://filesdomain$request_uri; |
||||
} |
||||
|
||||
server{ |
||||
|
||||
listen 443 ssl; |
||||
server_name localhost; |
||||
ssl on; |
||||
ssl_certificate /etc/nginx/ssl/fullchain.pem; |
||||
ssl_certificate_key /etc/nginx/ssl/privkey.pem; |
||||
ssl_protocols TLSv1.2 TLSv1.3; |
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; |
||||
ssl_ecdh_curve secp384r1; |
||||
|
||||
root /var/www/uguu/dist/; |
||||
autoindex on; |
||||
access_log on; |
||||
index index.html index.php; |
||||
|
||||
location ~* \.(css|js|jpg|jpeg|gif|png|ico|xml|eot|woff|woff2|ttf|svg|otf|x-icon|avif|webp|apng)$ { |
||||
expires 30d; |
||||
} |
||||
|
||||
gzip on; |
||||
gzip_min_length 1000; |
||||
gzip_comp_level 6; |
||||
gzip_proxied any; |
||||
gzip_types text/css text/js text/javascript application/javascript application/x-javascript; |
||||
|
||||
location ~* \.php$ { |
||||
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock; |
||||
fastcgi_intercept_errors on; |
||||
fastcgi_index index.php; |
||||
fastcgi_split_path_info ^(.+\.php)(.*)$; |
||||
include fastcgi_params; |
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
||||
} |
||||
} |
||||
|
||||
server { |
||||
listen 443 ssl; |
||||
server_name filesdomain; |
||||
|
||||
ssl on; |
||||
ssl_certificate /etc/nginx/ssl/fullchain.pem; |
||||
ssl_certificate_key /etc/nginx/ssl/privkey.pem; |
||||
ssl_protocols TLSv1.2 TLSv1.3; |
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; |
||||
ssl_ecdh_curve secp384r1; |
||||
|
||||
root /var/www/files/; |
||||
autoindex off; |
||||
access_log off; |
||||
index index.html; |
||||
} |
@ -0,0 +1,8 @@
|
||||
#!/bin/bash |
||||
echo ">>> BUILDING UGUU CONTAINER <<<" |
||||
make UGUU_RELEASE_VER=$(cat package.json | grep version | cut -d '"' -f4) DOCKER_TAG=$(cat package.json | grep version | cut -d '"' -f4) build-image |
||||
echo ">>> DONE! <<<" |
||||
|
||||
echo ">>> Starting Uguu container! <<<" |
||||
make DOCKER_TAG=$(cat package.json | grep version | cut -d '"' -f4) CONTAINER_NAME=uguu run-container |
||||
echo ">>> DONE! <<<" |
@ -0,0 +1,2 @@
|
||||
#!/bin/bash |
||||
make DOCKER_TAG=$(cat package.json | grep version | cut -d '"' -f4) CONTAINER_NAME=uguu purge-container |
Loading…
Reference in new issue