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)
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)
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/
# 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
--- /dev/null
+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
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'],
];
}
"subTitle": "wahooo",
"DOMAIN": "domain.com",
"FILE_DOMAIN": "files.domain.com",
- "siteUrl": "https://domain.com",
"abuseContact": "abuse@example.com",
"infoContact": "info@example.com",
"ServerCountryLocation": "Sweden",
"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,
"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": [
<h3>
To upload using curl or make a tool you can post using:
<br>
- curl -i -F files[]=@yourfile.jpeg <%= siteUrl %>/upload.php (JSON Response)
+ curl -i -F files[]=@yourfile.jpeg <%= DOMAIN %>/upload.php (JSON Response)
</h3>
- <p>To upload using curl or make a tool you can post using: curl -i -F files[]=@yourfile.jpeg <%= siteUrl %>/upload.php (JSON Response)</p>
+ <p>To upload using curl or make a tool you can post using: curl -i -F files[]=@yourfile.jpeg <%= DOMAIN %>/upload.php (JSON Response)</p>
<section>
<h2>ShareX</h2>
<dl>