summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejavu Moe <[email protected]>2023-05-10 18:34:07 +0800
committerDejavu Moe <[email protected]>2023-05-10 18:34:07 +0800
commitbe80e4433cb09c61bb66e964bb3c208ac2a16444 (patch)
tree485410e62a985fcac2e71136729b4f05a74324d1
parentfe74919e5af3a0a4b4b8af77f53a7257d79e2107 (diff)
downloadself-hosted-be80e4433cb09c61bb66e964bb3c208ac2a16444.tar.gz
self-hosted-be80e4433cb09c61bb66e964bb3c208ac2a16444.zip
add gotosocial
-rw-r--r--gotosocial/copy-assets.sh2
-rw-r--r--gotosocial/data/.gitkeep0
-rw-r--r--gotosocial/docker-compose.yml32
-rw-r--r--gotosocial/gotosocial.nginx82
-rw-r--r--gotosocial/web/.gitkeep0
5 files changed, 116 insertions, 0 deletions
diff --git a/gotosocial/copy-assets.sh b/gotosocial/copy-assets.sh
new file mode 100644
index 0000000..cdef36c
--- /dev/null
+++ b/gotosocial/copy-assets.sh
@@ -0,0 +1,2 @@
+sudo docker cp gotosocial:/gotosocial/web/assets $(pwd)/web
+sudo chown -R 1000:1000 ./web \ No newline at end of file
diff --git a/gotosocial/data/.gitkeep b/gotosocial/data/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gotosocial/data/.gitkeep
diff --git a/gotosocial/docker-compose.yml b/gotosocial/docker-compose.yml
new file mode 100644
index 0000000..afeb82f
--- /dev/null
+++ b/gotosocial/docker-compose.yml
@@ -0,0 +1,32 @@
+version: "3.3"
+
+services:
+ gotosocial:
+ image: superseriousbusiness/gotosocial:latest
+ container_name: gotosocial
+ user: 1000:1000
+ networks:
+ - gotosocial
+ environment:
+ GTS_HOST: yourdomain.com
+ GTS_DB_TYPE: sqlite
+ GTS_DB_ADDRESS: /gotosocial/storage/sqlite.db
+ # Let's Encrpt SSL
+ GTS_LETSENCRYPT_ENABLED: "false"
+ GTS_LETSENCRYPT_EMAIL_ADDRESS: ""
+ ## For reverse proxy setups:
+ GTS_TRUSTED_PROXIES: "172.26.0.1"
+ ports:
+ #- "443:8080"
+ ## For letsencrypt:
+ #- "80:80"
+ ## For reverse proxy setups:
+ - "127.0.0.1:8788:8080"
+ volumes:
+ - ./data:/gotosocial/storage
+ restart: "always"
+
+networks:
+ gotosocial:
+ ipam:
+ driver: default \ No newline at end of file
diff --git a/gotosocial/gotosocial.nginx b/gotosocial/gotosocial.nginx
new file mode 100644
index 0000000..eff683b
--- /dev/null
+++ b/gotosocial/gotosocial.nginx
@@ -0,0 +1,82 @@
+server {
+ listen 80;
+ listen [::]:80;
+ server_name yourdomain.com;
+ return 301 https://$server_name$request_uri;
+}
+
+server {
+ listen 443 ssl http2;
+ listen [::]:443 ssl http2;
+ server_name yourdomain.com;
+
+ ssl_certificate /etc/nginx/cert/yourdomain.com.pem;
+ ssl_certificate_key /etc/nginx/cert/yourdomain.com.key;
+
+ location ~ /.well-known/(webfinger|host-meta)$ {
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ proxy_cache gotosocial_ap_public_responses;
+ proxy_cache_background_update on;
+ proxy_cache_key $scheme://$host$uri$is_args$query_string;
+ proxy_cache_valid 200 10m;
+ proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504 http_429;
+ proxy_cache_lock on;
+ add_header X-Cache-Status $upstream_cache_status;
+
+ proxy_pass http://127.0.0.1:8788;
+ }
+
+ location ~ ^\/users\/(?:[a-z0-9_\.]+)\/main-key$ {
+ proxy_set_header Host $host;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+
+ proxy_cache gotosocial_ap_public_responses;
+ proxy_cache_background_update on;
+ proxy_cache_key $scheme://$host$uri;
+ proxy_cache_valid 200 604800s;
+ proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504 http_429;
+ proxy_cache_lock on;
+ add_header X-Cache-Status $upstream_cache_status;
+
+ proxy_pass http://127.0.0.1:8788;
+ }
+
+ location /assets/ {
+ alias web-asset-base-dir/;
+ autoindex off;
+ expires 5m;
+ add_header Cache-Control "public";
+ }
+
+ location @fileserver {
+
+ proxy_set_header Host $host;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ }
+
+ location /fileserver/ {
+ proxy_pass http://127.0.0.1:8788/;
+ alias storage-local-base-path/;
+ autoindex off;
+ expires max;
+ add_header Cache-Control "private, immutable";
+ try_files $uri @fileserver;
+ }
+
+ location / {
+ proxy_pass http://127.0.0.1:8788;
+ proxy_set_header Host $host;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ }
+ client_max_body_size 40M;
+} \ No newline at end of file
diff --git a/gotosocial/web/.gitkeep b/gotosocial/web/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gotosocial/web/.gitkeep