aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/cargohold.sql2
-rw-r--r--backend/config.py5
-rw-r--r--config/nginx.config27
3 files changed, 34 insertions, 0 deletions
diff --git a/backend/cargohold.sql b/backend/cargohold.sql
new file mode 100644
index 0000000..5447325
--- /dev/null
+++ b/backend/cargohold.sql
@@ -0,0 +1,2 @@
+CREATE TABLE users (name TEXT NOT NULL UNIQUE PRIMARY KEY, storage INTEGER DEFAULT (0));
+CREATE TABLE aliases (alias TEXT PRIMARY KEY UNIQUE NOT NULL, user TEXT REFERENCES users (name) ON DELETE CASCADE ON UPDATE CASCADE NOT NULL, real TEXT NOT NULL, access TEXT DEFAULT r, storage INTEGER, display TEXT);
diff --git a/backend/config.py b/backend/config.py
index 3f70c39..effbf85 100644
--- a/backend/config.py
+++ b/backend/config.py
@@ -1,5 +1,10 @@
+# Default URL to redirect invalid accesses to
homepage = "https://stumpf.es/"
+# Base path for uploaded files
fileroot = "/media/disk1/files.stumpf.es/"
+# Global disk space limit
global_limit = 0
+# Use per-user directories below the fileroot for individual storage
user_subdirs = True
+# Path to the backing database
database = "cargohold.db3"
diff --git a/config/nginx.config b/config/nginx.config
new file mode 100644
index 0000000..16fc053
--- /dev/null
+++ b/config/nginx.config
@@ -0,0 +1,27 @@
+server {
+ listen [::]:443 ssl;
+
+ root /var/www/nonesuch;
+ server_name files.stumpf.es;
+
+ location / {
+ client_max_body_size 100M;
+ uwsgi_pass unix:///tmp/cargohold.sock;
+ include uwsgi_params;
+ error_page 502 /assets/502.html;
+ }
+
+ location /interface {
+ internal;
+ alias /var/www/cargohold/interface;
+ }
+
+ location /data {
+ internal;
+ alias /media/disk1/files.stumpf.es;
+ }
+
+ location /assets {
+ alias /var/www/cargohold/assets;
+ }
+}