From af4b9c424600265fbc2f155f16e6424bc08a1ab9 Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 09:45:39 +0100 Subject: [PATCH 1/8] in --- .gitignore | 1 + Makefile | 83 +++++++++++++++----------- README.md | 17 +++--- docker/Dockerfile | 79 ++++++++++++------------ docker/docker-entrypoint.sh | 16 ++--- docker/nginx/uguu.conf | 6 +- docker_build.sh | 8 --- docker_purge.sh | 2 - package.json | 7 +-- src/config.json | 4 +- src/static/dbSchemas/sqlite_schema.sql | 6 -- 11 files changed, 116 insertions(+), 113 deletions(-) delete mode 100755 docker_build.sh delete mode 100755 docker_purge.sh diff --git a/.gitignore b/.gitignore index c5b018d..d82fc8c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ uguu.sq3 .vscode composer.phar composer.lock +docker/uguuForDocker.tar.gz diff --git a/Makefile b/Makefile index d43db37..20a5a86 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,50 @@ -MAKE="make" -INSTALL="install" -TAR="tar" -GREP="grep" -NODE="node" -NPM="npm" -NODEJQ="node_modules/node-jq/bin/jq" -SQLITE="sqlite3" -CONF="src/config.json" -PHP="php" -CURL="curl" +MAKE = "make" +INSTALL = "install" +TAR = "tar" +GREP = "grep" +NODE = "node" +NPM = "npm" +NODEJQ = "node_modules/node-jq/bin/jq" +SQLITE = "sqlite3" +CONF = "src/config.json" +PHP = "php" +CURL = "curl" DESTDIR = $(shell $(CURDIR)/$(NODEJQ) -r ".dest" $(CURDIR)/$(CONF)) -NPX="npx" +SITEDOMAIN = $(shell $(CURDIR)/$(NODEJQ) -r ".DOMAIN" $(CURDIR)/$(CONF)) +FILESDOMAIN = $(shell $(CURDIR)/$(NODEJQ) -r ".FILE_DOMAIN" $(CURDIR)/$(CONF)) +CONTACT_EMAIL = $(shell $(CURDIR)/$(NODEJQ) -r ".infoContact" $(CURDIR)/$(CONF)) PKG_VERSION = $(shell $(CURDIR)/$(NODEJQ) -r ".version" $(CURDIR)/package.json) TMPDIR = $(shell mktemp -d) DOCKER_IMAGE = "$(shell basename $(CURDIR) | tr [:upper:] [:lower:])" -DOCKER_TAG="$(DOCKER_TAG)" -CONTAINER_NAME="$(CONTAINER_NAME)" +DOCKER_TAG = "$(DOCKER_TAG)" +CONTAINER_NAME = "$(CONTAINER_NAME)" # default modules MODULES="php" pageList = $(shell $(CURDIR)/$(NODEJQ) -r ".pages[]" $(CURDIR)/$(CONF)) noExt = $(shell echo $(i) | cut -d '.' -f1) -all: builddirs npm_dependencies ejs minify-all copy-img copy-php +all: builddirs npm_dependencies ejs "node_modules/minify/bin/minify.js"-all copy-img copy-php ejs: $(foreach i,$(pageList), \ - $(NPX) ejs -f $(CURDIR)/$(CONF) $(CURDIR)/src/templates/$(i) -o $(CURDIR)/build/html/unmin/$(noExt).html;) + "node_modules/ejs/bin/cli.js" -f $(CURDIR)/$(CONF) $(CURDIR)/src/templates/$(i) -o $(CURDIR)/build/html/unmin/$(noExt).html;) -minify-all: - $(NPX) minify-all-cli -s $(CURDIR)/src/static/js -d $(CURDIR)/build/js - $(NPX) minify-all-cli -s $(CURDIR)/src/static/css -d $(CURDIR)/build/css - $(NPX) minify-all-cli -s $(CURDIR)/build/html/unmin/ -d $(CURDIR)/build/html/min/ -h +"node_modules/minify/bin/minify.js"-all: + "node_modules/minify/bin/minify.js" $(CURDIR)/src/static/js/uguu.js > $(CURDIR)/build/js/uguu.min.js + "node_modules/minify/bin/minify.js" $(CURDIR)/src/static/css/uguu.css > $(CURDIR)/build/css/uguu.min.css + "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/faq.html > $(CURDIR)/build/html/min/faq.html + "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/tools.html > $(CURDIR)/build/html/min/index.html + "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/tools.html > $(CURDIR)/build/html/min/tools.html installdirs: mkdir -p $(DESTDIR)/ $(DESTDIR)/img mkdir -p $(DESTDIR)/ $(DESTDIR)/img/grills copy-img: - $(NPX) imagemin $(CURDIR)/src/static/img/*.png -o=$(CURDIR)/build/img/ - $(NPX) imagemin $(CURDIR)/src/static/img/grills/*.png --plugin=pngquant -o=$(CURDIR)/build/img/grills/ + "node_modules/imagemin-cli/cli.js" $(CURDIR)/src/static/img/*.png -o=$(CURDIR)/build/img/ + "node_modules/imagemin-cli/cli.js" $(CURDIR)/src/static/img/grills/*.png --plugin=pngquant -o=$(CURDIR)/build/img/grills/ + copy-php: cp -v $(CURDIR)/src/static/php/*.php $(CURDIR)/build/php/ @@ -56,8 +61,6 @@ install: installdirs rm -rf $(DESTDIR)/css rm -rf $(DESTDIR)/js rm -rf $(DESTDIR)/php - mv $(DESTDIR)/public/uguu.css $(DESTDIR)/public/uguu.min.css - mv $(DESTDIR)/public/uguu.js $(DESTDIR)/public/uguu.min.js mv $(DESTDIR)/img $(DESTDIR)/public/ mv $(DESTDIR)/grill.php $(DESTDIR)/public/ mv $(DESTDIR)/upload.php $(DESTDIR)/public/ @@ -72,33 +75,43 @@ dist: install $(TAR) cJf uguu-$(PKG_VERSION).tar.xz $(DESTDIR) rm -rf $(TMPDIR) - + clean: - rm -rvf $(CURDIR)/node_modules + rm -rvf $(CURDIR)/node_modules rm -rvf $(CURDIR)/build - + uninstall: rm -rvf $(DESTDIR)/ - + npm_dependencies: $(NPM) install -build-image: - tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' -czf uguuForDocker.tar.gz . +build-container-no-cache: + tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' --exclude='./build' --exclude='./dist' --exclude='./.git' -czf uguuForDocker.tar.gz . mv uguuForDocker.tar.gz docker/ - docker build -f docker/Dockerfile --build-arg VERSION=$(UGUU_RELEASE_VER) --no-cache -t $(DOCKER_IMAGE):$(DOCKER_TAG) . + docker build -f docker/Dockerfile --build-arg VERSION=$(PKG_VERSION) --no-cache -t uguu:$(PKG_VERSION) . + +build-container: + tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' --exclude='./build' --exclude='./dist' --exclude='./.git' -czf uguuForDocker.tar.gz . + mv uguuForDocker.tar.gz docker/ + docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) -t uguu:$(PKG_VERSION) . run-container: - docker run --name $(CONTAINER_NAME) -d -p 8080:80 -p 8081:443 $(DOCKER_IMAGE):$(DOCKER_TAG) + docker run --name uguu -d -p 8080:80 -p 8081:443 uguu:$(PKG_VERSION) + docker exec -it uguu /bin/bash service nginx start + docker exec -it uguu /bin/bash service php8.1-fpm start -purge-container: - if docker images | grep $(DOCKER_IMAGE); then \ - docker rm -f $(CONTAINER_NAME) && docker rmi $(DOCKER_IMAGE):$(DOCKER_TAG) || true;\ +purge-containers: + if docker images | grep uguu; then \ + docker rm -f uguu && docker rmi uguu:$(PKG_VERSION) || true;\ fi; +remove-container: + docker rm -f uguu + builddirs: mkdir -p $(CURDIR)/build $(CURDIR)/build/img $(CURDIR)/build/html $(CURDIR)/build/html/min $(CURDIR)/build/html/unmin $(CURDIR)/build/js $(CURDIR)/build/css $(CURDIR)/build/php $(CURDIR)/build/php/Classes $(CURDIR)/build/public diff --git a/README.md b/README.md index 575b5db..c6d7fcb 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,19 @@ Uguu is a simple lightweight temporary file hosting and sharing platform, but ca ## Features -- One click uploading, no registration required -- A minimal, modern web interface -- Drag & Drop & Paste supported -- Upload API with multiple response choices +- One click uploading, no registration required. +- A minimal, modern web interface. +- Drag & Drop & Paste supported. +- Upload API with multiple response choices: - JSON - HTML - Text - CSV -- Supports [ShareX](https://getsharex.com/) and other screenshot tools +- Supports [ShareX](https://getsharex.com/) and other screenshot tools. +- File extension & MIME black/whitelisting. +- Upload rate limiting. +- File (hash) blacklisting. +- Run bare or as a container. ### Demo @@ -26,7 +30,7 @@ See the real world site at [uguu.se](https://uguu.se). ## Requirements -Tested and working with Nginx + PHP-8.0/8.1 + SQLite/MySQL. +Tested and working with Nginx + PHP-8.1 + SQLite/MySQL. Node is used to compile Uguu, after that it runs on PHP. @@ -57,7 +61,6 @@ tests. * S3 Bucket Support * Azure File Storage Support * Temporal/RR Support -* ## Credits diff --git a/docker/Dockerfile b/docker/Dockerfile index 368cf65..0aa09d7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,26 +1,21 @@ -FROM php:8.1-alpine +FROM --platform=linux/amd64 debian:bullseye-slim -ARG VERSION +# Install needed software +RUN apt-get update - -RUN apk add --no-cache $PHPIZE_DEPS \ - php-fpm zlib-dev libzip-dev libgomp; \ - docker-php-ext-install intl pcntl gd exif zip pdo mysql dom; \ - apk del $PHPIZE_DEPS; \ - rm -rf /tmp/pear; - -# Install the needed software -RUN apk add --no-cache sqlite nodejs git npm bash build-base supervisor curl wget nginx -#php8-fileinfo php8-pdo php8-tokenizer php8-dom php8-iconv php8-xml php8-simplexml \ -#php8-sqlite3 php8-opcache php8-mbstring php8-phar php8-openssl - -# 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 - -# Copy supervisor conf file -COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf +RUN apt-get install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 curl cron socat +RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list +RUN curl -fsSL https://packages.sury.org/php/apt.gpg| gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg +RUN apt-get update +RUN apt-get upgrade -y +RUN curl -o nodejssetup.sh https://deb.nodesource.com/setup_19.x +RUN chmod a+x nodejssetup.sh +RUN ./nodejssetup.sh +RUN apt-get install -y nodejs gcc g++ make +RUN apt-get install -y build-essential nginx-full php8.1-fpm php8.1 sqlite3 php8.1-sqlite3 \ + php8.1-curl php8.1-cli php8.1-lz4 \ + php8.1-mcrypt php8.1-mysql php8.1-xdebug php8.1-zip \ + php8.1-common php8.1-readline php8.1-bcmath php8.1-common php8.1-xml # Set default workdir WORKDIR /var/www/ @@ -37,45 +32,51 @@ RUN mkdir /var/www/files && \ mkdir /var/www/db # Create the Sqlite DB -RUN sqlite3 /var/www/db/uguu.sq3 -init /var/www/uguu/src/static/dbSchemas/sqlite_schema.sql && \ +RUN sqlite3 /var/www/db/uguuDB.sq3 -init /var/www/uguu/src/static/dbSchemas/sqlite_schema.sql "" && \ chown -R www-data:www-data /var/www && \ chmod -R 775 /var/www/ +# Add scripts to cron +RUN echo "0,30 * * * * bash /var/www/uguu/src/static/scripts/checkfiles.sh" >> /var/spool/cron/crontabs/www-data && \ + echo "0,30 * * * * bash /var/www/uguu/src/static/scripts/checkdb.sh" >> /var/spool/cron/crontabs/www-data + # Fix script paths RUN chmod a+x /var/www/uguu/src/static/scripts/checkdb.sh && \ chmod a+x /var/www/uguu/src/static/scripts/checkfiles.sh && \ sed -i 's#/path/to/files/#/var/www/uguu/files/#g' /var/www/uguu/src/static/scripts/checkfiles.sh && \ sed -i 's#/path/to/db/uguu.sq3#/var/www/db/uguu.sq3#g' /var/www/uguu/src/static/scripts/checkdb.sh -# Add scripts to cron -RUN echo "0,30 * * * * bash /var/www/uguu/src/static/scripts/checkfiles.sh" >> /var/spool/cron/crontabs/www-data && \ - echo "0,30 * * * * bash /var/www/uguu/src/static/scripts/checkdb.sh" >> /var/spool/cron/crontabs/www-data - # Copy Nginx Server conf -COPY docker/nginx/uguu.conf /etc/nginx/http.d/ +COPY docker/nginx/uguu.conf /etc/nginx/sites-enabled/uguu.conf + +#RUN sed -i 's#XXX#$()#g' /var/www/uguu/src/static/scripts/checkfiles.sh # Copy SSL certs -COPY docker/ssl /etc/ssl - -# Copy PHP config -COPY docker/php/php.ini /etc/php8/ -COPY docker/php/www.conf /etc/php8/php-fpm.d/ -RUN mkdir /var/run/php +#COPY docker/ssl /etc/ssl # Copy Uguu config COPY src/config.json /var/www/uguu/config.json -# Give permissions to www-data -RUN chown -R www-data:www-data /run /var/lib/nginx /var/log/nginx /etc/nginx /etc/php8 /var/log/php8 /var/run/php - -# Change user to www-data -USER www-data - # Expose port 80 from the container EXPOSE 80 # Expose port 443 from the container EXPOSE 443 +#RUN service nginx restart +# Change user to www-data +#USER www-data + +#RUN cd /var/www/uguu && make && make install + +ARG DOMAIN +ENV DOMAIN=$DOMAIN +ARG FILE_DOMAIN +ENV FILE_DOMAIN=$FILE_DOMAIN +ARG CONTACT_EMAIL +ENV CONTACT_EMAIL=$CONTACT_EMAIL +RUN curl -o acmeinstall.sh https://get.acme.sh +RUN chmod a+x acmeinstall.sh +RUN ./acmeinstall.sh # Load entrypoint ENTRYPOINT [ "bash", "/var/www/docker-entrypoint.sh" ] \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 76e1ae6..2c8c003 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,11 +1,11 @@ #!/bin/bash -cd /var/www/uguu/ +cd /var/www/uguu +npm install make make install -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" -php composer-setup.php -php -r "unlink('composer-setup.php');" -php composer.phar install -php composer.phar update -/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf +/root/.acme.sh/acme.sh --set-default-ca --server letsencrypt +/root/.acme.sh/acme.sh --issue -d $DOMAIN -w /var/www/uguu/dist/public/ +/root/.acme.sh/acme.sh --issue -d $FILE_DOMAIN -w /var/www/files/ +service nginx start +service php8.1-fpm start +tail -f /var/log/nginx/access.log \ No newline at end of file diff --git a/docker/nginx/uguu.conf b/docker/nginx/uguu.conf index 9732b6c..af13672 100644 --- a/docker/nginx/uguu.conf +++ b/docker/nginx/uguu.conf @@ -1,7 +1,7 @@ server{ listen 80; - server_name 192.168.240.9; + server_name XXX; #ssl on; #ssl_certificate /etc/nginx/ssl/fullchain.pem; #ssl_certificate_key /etc/nginx/ssl/privkey.pem; @@ -12,7 +12,7 @@ server{ root /var/www/uguu/dist/public/; autoindex on; access_log on; - index index.html index.php; + index index.html; location ~* \.(css|js|jpg|jpeg|gif|png|ico|xml|eot|woff|woff2|ttf|svg|otf|x-icon|avif|webp|apng)$ { expires 30d; @@ -26,7 +26,7 @@ server{ 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_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_intercept_errors on; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; diff --git a/docker_build.sh b/docker_build.sh deleted file mode 100755 index 7b4d91d..0000000 --- a/docker_build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/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! <<<" diff --git a/docker_purge.sh b/docker_purge.sh deleted file mode 100755 index f87fe5c..0000000 --- a/docker_purge.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -make DOCKER_TAG="$(cat package.json | grep version | cut -d '"' -f4)" CONTAINER_NAME=uguu purge-container diff --git a/package.json b/package.json index 394fe4c..a54fbf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uguu", - "version": "1.6.5", + "version": "1.6.6", "description": "Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.", "homepage": "https://uguu.se", "repository": { @@ -17,10 +17,9 @@ "url": "https://github.com/nokonoko/uguu/issues" }, "devDependencies": { + "minify": "^9.1.0", "ejs": "^3.1.8", - "minify-all-cli": "^1.0.13", - "node-jq": "^2.3.3", - "npx": "^10.2.2", + "node-jq": "^2.3.4", "imagemin-cli": "^7.0.0", "imagemin-pngquant": "^9.0.2" } diff --git a/src/config.json b/src/config.json index 39f5839..9759b69 100755 --- a/src/config.json +++ b/src/config.json @@ -3,7 +3,7 @@ "allowErrors": false }, "dest": "dist", - "pkgVersion": "1.6.5", + "pkgVersion": "1.6.6", "pages": [ "index.ejs", "faq.ejs", @@ -13,6 +13,8 @@ "expireTime": "48H", "siteName": "Uguu", "subTitle": "wahooo", + "DOMAIN": "domain.com", + "FILE_DOMAIN": "files.domain.com", "siteUrl": "https://domain.com", "abuseContact": "abuse@example.com", "infoContact": "info@example.com", diff --git a/src/static/dbSchemas/sqlite_schema.sql b/src/static/dbSchemas/sqlite_schema.sql index f26b65b..9354ab4 100644 --- a/src/static/dbSchemas/sqlite_schema.sql +++ b/src/static/dbSchemas/sqlite_schema.sql @@ -28,10 +28,4 @@ CREATE TABLE `ratelimit` ( , `time` integer default NULL , `files` integer default NULL ); -CREATE TABLE `ratelimit`( - `id` integer NOT NULL PRIMARY KEY AUTOINCREMENT -, `iphash` char(40) default NULL -, `files` integer default NULL -, `time` integer default NULL -); END TRANSACTION; From 7f8963f6ede34931e3c9a0a90fcfe6e9d40d53ef Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 10:26:04 +0100 Subject: [PATCH 2/8] fix --- Makefile | 2 +- docker/Dockerfile | 17 +++++---- docker/docker-entrypoint.sh | 5 ++- docker/nginx/uguu.conf | 76 +++++++++++++++++++++++++------------ docker/ssl/fullchain.pem | 0 docker/ssl/privkey.pem | 0 docker/supervisord.conf | 32 ---------------- 7 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 docker/ssl/fullchain.pem delete mode 100644 docker/ssl/privkey.pem delete mode 100644 docker/supervisord.conf diff --git a/Makefile b/Makefile index 20a5a86..688c091 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ build-container-no-cache: docker build -f docker/Dockerfile --build-arg VERSION=$(PKG_VERSION) --no-cache -t uguu:$(PKG_VERSION) . build-container: - tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' --exclude='./build' --exclude='./dist' --exclude='./.git' -czf uguuForDocker.tar.gz . + tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . mv uguuForDocker.tar.gz docker/ docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) -t uguu:$(PKG_VERSION) . diff --git a/docker/Dockerfile b/docker/Dockerfile index 0aa09d7..4ec2ea8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,6 +17,14 @@ RUN apt-get install -y build-essential nginx-full php8.1-fpm php8.1 sqlite3 php8 php8.1-mcrypt php8.1-mysql php8.1-xdebug php8.1-zip \ php8.1-common php8.1-readline php8.1-bcmath php8.1-common php8.1-xml + +ARG DOMAIN +ENV DOMAIN=$DOMAIN +ARG FILE_DOMAIN +ENV FILE_DOMAIN=$FILE_DOMAIN +ARG CONTACT_EMAIL +ENV CONTACT_EMAIL=$CONTACT_EMAIL + # Set default workdir WORKDIR /var/www/ @@ -49,7 +57,8 @@ RUN chmod a+x /var/www/uguu/src/static/scripts/checkdb.sh && \ # Copy Nginx Server conf COPY docker/nginx/uguu.conf /etc/nginx/sites-enabled/uguu.conf -#RUN sed -i 's#XXX#$()#g' /var/www/uguu/src/static/scripts/checkfiles.sh +RUN sed -i "s#XMAINDOMAINX#${DOMAIN}#g" /etc/nginx/sites-enabled/uguu.conf +RUN sed -i "s#XFILESDOMAINX#${FILE_DOMAIN}#g" /etc/nginx/sites-enabled/uguu.conf # Copy SSL certs #COPY docker/ssl /etc/ssl @@ -69,12 +78,6 @@ EXPOSE 443 #RUN cd /var/www/uguu && make && make install -ARG DOMAIN -ENV DOMAIN=$DOMAIN -ARG FILE_DOMAIN -ENV FILE_DOMAIN=$FILE_DOMAIN -ARG CONTACT_EMAIL -ENV CONTACT_EMAIL=$CONTACT_EMAIL RUN curl -o acmeinstall.sh https://get.acme.sh RUN chmod a+x acmeinstall.sh RUN ./acmeinstall.sh diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 2c8c003..9f3a26f 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -3,9 +3,10 @@ cd /var/www/uguu npm install make make install +service nginx stop +rm /etc/nginx/sites-enabled/default /root/.acme.sh/acme.sh --set-default-ca --server letsencrypt -/root/.acme.sh/acme.sh --issue -d $DOMAIN -w /var/www/uguu/dist/public/ -/root/.acme.sh/acme.sh --issue -d $FILE_DOMAIN -w /var/www/files/ +/root/.acme.sh/acme.sh --issue --standalone -d $DOMAIN -d $FILE_DOMAIN service nginx start service php8.1-fpm start tail -f /var/log/nginx/access.log \ No newline at end of file diff --git a/docker/nginx/uguu.conf b/docker/nginx/uguu.conf index af13672..45b3d35 100644 --- a/docker/nginx/uguu.conf +++ b/docker/nginx/uguu.conf @@ -1,36 +1,64 @@ -server{ +server { + listen 443 ssl http2; + server_name XMAINDOMAINX; - listen 80; - server_name XXX; - #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; + ssl on; + ssl_certificate /root/.acme.sh/XMAINDOMAINX/fullchain.cer; + ssl_certificate_key /root/.acme.sh/XMAINDOMAINX/XMAINDOMAINX.key; + 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/public/; - autoindex on; - access_log on; - index index.html; + root /var/www/uguu/dist/public/; + autoindex off; + access_log off; + index index.html; location ~* \.(css|js|jpg|jpeg|gif|png|ico|xml|eot|woff|woff2|ttf|svg|otf|x-icon|avif|webp|apng)$ { - expires 30d; + expires 30d; } - client_max_body_size 128M; - 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; + 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.1-fpm.sock; + fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_intercept_errors on; - fastcgi_index index.php; + fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } + +server { + listen 443 ssl; + server_name XFILESDOMAINX; + + ssl on; + ssl_certificate /root/.acme.sh/XMAINDOMAINX/fullchain.cer; + ssl_certificate_key /root/.acme.sh/XMAINDOMAINX/XMAINDOMAINX.key; + 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; + } + + server { + listen 80; + server_name XMAINDOMAINX; + return 301 https://XMAINDOMAINX$request_uri; + } + + server { + listen 80; + server_name XFILESDOMAINX; + return 301 https://XFILESDOMAINX$request_uri; + } diff --git a/docker/ssl/fullchain.pem b/docker/ssl/fullchain.pem deleted file mode 100644 index e69de29..0000000 diff --git a/docker/ssl/privkey.pem b/docker/ssl/privkey.pem deleted file mode 100644 index e69de29..0000000 diff --git a/docker/supervisord.conf b/docker/supervisord.conf deleted file mode 100644 index 7a704d3..0000000 --- a/docker/supervisord.conf +++ /dev/null @@ -1,32 +0,0 @@ -[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 From f6ba4130db6ec6d4a965120834ee91c1b3c151a0 Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 11:06:29 +0100 Subject: [PATCH 3/8] fix --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 688c091..f18aa42 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,8 @@ ejs: "node_modules/minify/bin/minify.js" $(CURDIR)/src/static/js/uguu.js > $(CURDIR)/build/js/uguu.min.js "node_modules/minify/bin/minify.js" $(CURDIR)/src/static/css/uguu.css > $(CURDIR)/build/css/uguu.min.css "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/faq.html > $(CURDIR)/build/html/min/faq.html - "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/tools.html > $(CURDIR)/build/html/min/index.html "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/tools.html > $(CURDIR)/build/html/min/tools.html + "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/index.html > $(CURDIR)/build/html/min/index.html installdirs: mkdir -p $(DESTDIR)/ $(DESTDIR)/img @@ -100,7 +100,7 @@ build-container: docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) -t uguu:$(PKG_VERSION) . run-container: - docker run --name uguu -d -p 8080:80 -p 8081:443 uguu:$(PKG_VERSION) + docker run --name uguu -d -p 80:80 -p 443:443 uguu:$(PKG_VERSION) docker exec -it uguu /bin/bash service nginx start docker exec -it uguu /bin/bash service php8.1-fpm start From 65b55416e00674386b0907e4b41ea26d6161f8e6 Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 11:06:58 +0100 Subject: [PATCH 4/8] Update Makefile --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index f18aa42..248f192 100644 --- a/Makefile +++ b/Makefile @@ -101,8 +101,6 @@ build-container: run-container: docker run --name uguu -d -p 80:80 -p 443:443 uguu:$(PKG_VERSION) - docker exec -it uguu /bin/bash service nginx start - docker exec -it uguu /bin/bash service php8.1-fpm start purge-containers: if docker images | grep uguu; then \ From f7f02b9280d942bbe53670b33ad58e1d08fc416c Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 11:27:49 +0100 Subject: [PATCH 5/8] changes --- Makefile | 3 +- docker/Dockerfile | 10 +++++-- docker/nginx/nginx.conf | 62 +++++++++++++++++++++++++++++++++++++++++ src/Classes/Upload.php | 2 +- src/config.json | 4 +-- src/templates/tools.ejs | 4 +-- 6 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 docker/nginx/nginx.conf diff --git a/Makefile b/Makefile index 248f192..cf69cf8 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ CURL = "curl" DESTDIR = $(shell $(CURDIR)/$(NODEJQ) -r ".dest" $(CURDIR)/$(CONF)) SITEDOMAIN = $(shell $(CURDIR)/$(NODEJQ) -r ".DOMAIN" $(CURDIR)/$(CONF)) FILESDOMAIN = $(shell $(CURDIR)/$(NODEJQ) -r ".FILE_DOMAIN" $(CURDIR)/$(CONF)) +MAXSIZE = $(shell $(CURDIR)/$(NODEJQ) -r ".max_upload_size" $(CURDIR)/$(CONF)) CONTACT_EMAIL = $(shell $(CURDIR)/$(NODEJQ) -r ".infoContact" $(CURDIR)/$(CONF)) PKG_VERSION = $(shell $(CURDIR)/$(NODEJQ) -r ".version" $(CURDIR)/package.json) TMPDIR = $(shell mktemp -d) @@ -97,7 +98,7 @@ build-container-no-cache: build-container: tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . mv uguuForDocker.tar.gz docker/ - docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) -t uguu:$(PKG_VERSION) . + docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) --build-arg MAX_SIZE=$(MAXSIZE) -t uguu:$(PKG_VERSION) . run-container: docker run --name uguu -d -p 80:80 -p 443:443 uguu:$(PKG_VERSION) diff --git a/docker/Dockerfile b/docker/Dockerfile index 4ec2ea8..8985fe0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,6 +24,8 @@ ARG FILE_DOMAIN ENV FILE_DOMAIN=$FILE_DOMAIN ARG CONTACT_EMAIL ENV CONTACT_EMAIL=$CONTACT_EMAIL +ARG MAX_SIZE +ENV MAX_SIZE=$MAX_SIZE # Set default workdir WORKDIR /var/www/ @@ -56,12 +58,16 @@ RUN chmod a+x /var/www/uguu/src/static/scripts/checkdb.sh && \ # Copy Nginx Server conf COPY docker/nginx/uguu.conf /etc/nginx/sites-enabled/uguu.conf +COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf +# Modify nginx values RUN sed -i "s#XMAINDOMAINX#${DOMAIN}#g" /etc/nginx/sites-enabled/uguu.conf RUN sed -i "s#XFILESDOMAINX#${FILE_DOMAIN}#g" /etc/nginx/sites-enabled/uguu.conf +RUN sed -i "s#client_max_body_size 128M#$client_max_body_size {MAX_SIZE}M#g" /etc/nginx/nginx.conf -# Copy SSL certs -#COPY docker/ssl /etc/ssl +# Modify php-fpm values +RUN sed -i "s#post_max_size = 8M#post_max_size = ${MAX_SIZE}M#g" /etc/php/8.1/fpm/php.ini +RUN sed -i "s#upload_max_filesize = 2M#upload_max_filesize = ${MAX_SIZE}M#g" /etc/php/8.1/fpm/php.ini # Copy Uguu config COPY src/config.json /var/www/uguu/config.json diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf new file mode 100644 index 0000000..e962754 --- /dev/null +++ b/docker/nginx/nginx.conf @@ -0,0 +1,62 @@ +user www-data; +worker_processes auto; +pid /run/nginx.pid; +include /etc/nginx/modules-enabled/*.conf; + +events { + worker_connections 768; + # multi_accept on; +} + +http { + + ## + # Basic Settings + ## + + sendfile on; + tcp_nopush on; + types_hash_max_size 2048; + client_max_body_size 128M; + # server_tokens off; + + # server_names_hash_bucket_size 64; + # server_name_in_redirect off; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + ## + # SSL Settings + ## + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE + ssl_prefer_server_ciphers on; + + ## + # Logging Settings + ## + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + ## + # Gzip Settings + ## + + gzip on; + + # gzip_vary on; + # gzip_proxied any; + # gzip_comp_level 6; + # gzip_buffers 16 8k; + # gzip_http_version 1.1; + # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; + + ## + # Virtual Host Configs + ## + + include /etc/nginx/conf.d/*.conf; + include /etc/nginx/sites-enabled/*; +} \ No newline at end of file diff --git a/src/Classes/Upload.php b/src/Classes/Upload.php index 604463c..79d7ab4 100644 --- a/src/Classes/Upload.php +++ b/src/Classes/Upload.php @@ -170,7 +170,7 @@ class Upload extends Response return [ 'hash' => $this->FILE_INFO['SHA1'], 'name' => $this->FILE_INFO['NAME'], - 'url' => $this->Connector->CONFIG['FILES_URL'] . '/' . $this->FILE_INFO['NEW_NAME'], + 'url' => 'https://' . $this->Connector->CONFIG['FILE_DOMAIN'] . '/' . $this->FILE_INFO['NEW_NAME'], 'size' => $this->FILE_INFO['SIZE'], ]; } diff --git a/src/config.json b/src/config.json index 9759b69..89a4763 100755 --- a/src/config.json +++ b/src/config.json @@ -15,7 +15,6 @@ "subTitle": "wahooo", "DOMAIN": "domain.com", "FILE_DOMAIN": "files.domain.com", - "siteUrl": "https://domain.com", "abuseContact": "abuse@example.com", "infoContact": "info@example.com", "ServerCountryLocation": "Sweden", @@ -28,7 +27,7 @@ "kofiUrl": "", "malwareBanner": false, "DB_MODE": "sqlite", - "DB_PATH": "/var/www/db/uguu.sq3", + "DB_PATH": "/var/www/db/uguuDB.sq3", "DB_USER": "NULL", "DB_PASS": "NULL", "LOG_IP": false, @@ -40,7 +39,6 @@ "RATE_LIMIT_FILES": 100, "FILES_ROOT": "/var/www/files/", "FILES_RETRIES": 15, - "FILES_URL": "https://files.domain.com", "NAME_LENGTH": 8, "ID_CHARSET": "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ", "DOUBLE_DOTS_EXTENSIONS": [ diff --git a/src/templates/tools.ejs b/src/templates/tools.ejs index d773257..5d761b4 100644 --- a/src/templates/tools.ejs +++ b/src/templates/tools.ejs @@ -8,9 +8,9 @@

To upload using curl or make a tool you can post using:
- curl -i -F files[]=@yourfile.jpeg <%= siteUrl %>/upload.php (JSON Response) + curl -i -F files[]=@yourfile.jpeg <%= DOMAIN %>/upload.php (JSON Response)

-

To upload using curl or make a tool you can post using: curl -i -F files[]=@yourfile.jpeg <%= siteUrl %>/upload.php (JSON Response)

+

To upload using curl or make a tool you can post using: curl -i -F files[]=@yourfile.jpeg <%= DOMAIN %>/upload.php (JSON Response)

ShareX

From 8e96eafc0dd7bc6fea32233528b51e72151dec54 Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 11:30:02 +0100 Subject: [PATCH 6/8] Update Dockerfile --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8985fe0..0b4a62b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -63,7 +63,7 @@ COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf # Modify nginx values RUN sed -i "s#XMAINDOMAINX#${DOMAIN}#g" /etc/nginx/sites-enabled/uguu.conf RUN sed -i "s#XFILESDOMAINX#${FILE_DOMAIN}#g" /etc/nginx/sites-enabled/uguu.conf -RUN sed -i "s#client_max_body_size 128M#$client_max_body_size {MAX_SIZE}M#g" /etc/nginx/nginx.conf +RUN sed -i "s#client_max_body_size 128M#client_max_body_size ${MAX_SIZE}M#g" /etc/nginx/nginx.conf # Modify php-fpm values RUN sed -i "s#post_max_size = 8M#post_max_size = ${MAX_SIZE}M#g" /etc/php/8.1/fpm/php.ini From 7d787da8e7634e34b57023f8530ba8492737146e Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 11:42:39 +0100 Subject: [PATCH 7/8] more --- Makefile | 7 +++---- docker/Dockerfile | 11 +++-------- docker/docker-entrypoint.sh | 6 +++--- docker/nginx/nginx.conf | 6 +++--- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index cf69cf8..fb0f536 100644 --- a/Makefile +++ b/Makefile @@ -19,9 +19,6 @@ TMPDIR = $(shell mktemp -d) DOCKER_IMAGE = "$(shell basename $(CURDIR) | tr [:upper:] [:lower:])" DOCKER_TAG = "$(DOCKER_TAG)" CONTAINER_NAME = "$(CONTAINER_NAME)" -# default modules -MODULES="php" - pageList = $(shell $(CURDIR)/$(NODEJQ) -r ".pages[]" $(CURDIR)/$(CONF)) noExt = $(shell echo $(i) | cut -d '.' -f1) @@ -91,11 +88,13 @@ npm_dependencies: $(NPM) install build-container-no-cache: - tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' --exclude='./build' --exclude='./dist' --exclude='./.git' -czf uguuForDocker.tar.gz . + rm uguuForDocker.tar.gz + tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . mv uguuForDocker.tar.gz docker/ docker build -f docker/Dockerfile --build-arg VERSION=$(PKG_VERSION) --no-cache -t uguu:$(PKG_VERSION) . build-container: + rm uguuForDocker.tar.gz tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . mv uguuForDocker.tar.gz docker/ docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) --build-arg MAX_SIZE=$(MAXSIZE) -t uguu:$(PKG_VERSION) . diff --git a/docker/Dockerfile b/docker/Dockerfile index 0b4a62b..880e658 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,6 @@ FROM --platform=linux/amd64 debian:bullseye-slim # Install needed software RUN apt-get update - RUN apt-get install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 curl cron socat RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list RUN curl -fsSL https://packages.sury.org/php/apt.gpg| gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg @@ -17,7 +16,7 @@ RUN apt-get install -y build-essential nginx-full php8.1-fpm php8.1 sqlite3 php8 php8.1-mcrypt php8.1-mysql php8.1-xdebug php8.1-zip \ php8.1-common php8.1-readline php8.1-bcmath php8.1-common php8.1-xml - +# Set ENV values for configuration ARG DOMAIN ENV DOMAIN=$DOMAIN ARG FILE_DOMAIN @@ -78,14 +77,10 @@ EXPOSE 80 # Expose port 443 from the container EXPOSE 443 -#RUN service nginx restart -# Change user to www-data -#USER www-data - -#RUN cd /var/www/uguu && make && make install - +# Install acme.sh RUN curl -o acmeinstall.sh https://get.acme.sh RUN chmod a+x acmeinstall.sh RUN ./acmeinstall.sh + # Load entrypoint ENTRYPOINT [ "bash", "/var/www/docker-entrypoint.sh" ] \ No newline at end of file diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 9f3a26f..cf7d19d 100644 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,12 +1,12 @@ #!/bin/bash -cd /var/www/uguu +cd /var/www/uguu || exit npm install make make install service nginx stop rm /etc/nginx/sites-enabled/default /root/.acme.sh/acme.sh --set-default-ca --server letsencrypt -/root/.acme.sh/acme.sh --issue --standalone -d $DOMAIN -d $FILE_DOMAIN +/root/.acme.sh/acme.sh --issue --standalone -d "$DOMAIN" -d "$FILE_DOMAIN" service nginx start service php8.1-fpm start -tail -f /var/log/nginx/access.log \ No newline at end of file +tail -f /dev/null \ No newline at end of file diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index e962754..22ca851 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -4,8 +4,8 @@ pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; events { - worker_connections 768; - # multi_accept on; + worker_connections 1024; + multi_accept on; } http { @@ -37,7 +37,7 @@ http { # Logging Settings ## - access_log /var/log/nginx/access.log; + access_log off; error_log /var/log/nginx/error.log; ## From 4873a8aac1fe11e9294afb220421813dacb27517 Mon Sep 17 00:00:00 2001 From: "Go Johansson (neku)" Date: Sun, 1 Jan 2023 11:48:19 +0100 Subject: [PATCH 8/8] Update Makefile --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index fb0f536..61a12b7 100644 --- a/Makefile +++ b/Makefile @@ -88,14 +88,12 @@ npm_dependencies: $(NPM) install build-container-no-cache: - rm uguuForDocker.tar.gz - tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . + tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz src docker Makefile package.json package-lock.json mv uguuForDocker.tar.gz docker/ docker build -f docker/Dockerfile --build-arg VERSION=$(PKG_VERSION) --no-cache -t uguu:$(PKG_VERSION) . build-container: - rm uguuForDocker.tar.gz - tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz . + tar --exclude='uguuForDocker.tar.gz' --exclude='vendor' --exclude='node_modules' --exclude='build' --exclude='dist' --exclude='.git' -czf uguuForDocker.tar.gz src docker Makefile package.json package-lock.json mv uguuForDocker.tar.gz docker/ docker build -f docker/Dockerfile --build-arg DOMAIN=$(SITEDOMAIN) --build-arg FILE_DOMAIN=$(FILESDOMAIN) --build-arg CONTACT_EMAIL=$(FILESDOMAIN) --build-arg MAX_SIZE=$(MAXSIZE) -t uguu:$(PKG_VERSION) .