From 420ceb49b53a8fa9d8ba8443e42e50cd7bd7cea9 Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Sun, 12 Jul 2026 11:08:50 +0200 Subject: update --- .../2026/Installation-of-Snac2-on-Artix-Linux.html | 144 +++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 articles/2026/Installation-of-Snac2-on-Artix-Linux.html (limited to 'articles/2026/Installation-of-Snac2-on-Artix-Linux.html') diff --git a/articles/2026/Installation-of-Snac2-on-Artix-Linux.html b/articles/2026/Installation-of-Snac2-on-Artix-Linux.html new file mode 100644 index 0000000..2b752ea --- /dev/null +++ b/articles/2026/Installation-of-Snac2-on-Artix-Linux.html @@ -0,0 +1,144 @@ + + + + + + + + Installation of Snac2 on Artix Linux + + +
+

Bloggings

+ Back +
+
+
+

Installation of Snac2 on Artix Linux

+

2026-05-20

+

Installation of snac2 on Artix Linux +Nginx +Dinit

+
+useradd -m -s /bin/bash snac
+passwd snac
+usermod -aG wheel snac
+su - snac
+mkdir src
+cd src
+git clone https://codeberg.org/grunfink/snac2.git
+cd snac2
+make
+sudo make install
+snac init ~/data
+
+

snac init will ask these questions:

+
+Host name: your.server.domain
+Path prefix: leave empty
+Network address: 127.0.0.1
+Port: 8001
+
+

add user

+
+snac adduser ~/data
+
+

In /home/snac/data/server.json edit these settings:

+
+admin_email
+admin_account
+title
+short_description
+
+and add this line:
+
+"proxy_media: true
+
+

As root, create the dinit script: /etc/dinit.d/snac2

+
+type = process
+run-as = snac
+command = /usr/local/bin/snac httpd /home/snac/data
+depends-on = NetworkManager
+restart = true
+smooth-recovery = yes
+log-type = file
+logfile = /var/log/dinit/snac2.log
+
+

enable snac2

+
+dinitcl enable snac2
+
+

NGINX Media caching

+

+see it-notes.fragas.net +

+

Nginx configuration +

+see comam.es.
+Use $host not $http_host (gixy) +

+

in /etc/nginx/nginx.conf http section add:

+
+proxy_cache_path /var/cache/nginx/snac_cache levels=1:2 keys_zone=snac:10m max_size=1g inactive=1440m use_temp_path=off;
+
+

make cache folder

+
+mkdir -p /var/cache/nginx/snac_cache
+
+

/etc/nginx/sites-available/example.com

+
+server {
+    listen 443 ssl;
+    listen [::]:443 ssl;
+    server_name example.com;
+
+    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/example.com/privkey.pem;
+    ssl_protocols TLSv1.2 TLSv1.3;
+    ssl_ciphers HIGH:!aNULL:!MD5;
+    # openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
+    ssl_dhparam /etc/ssl/certs/dhparam.pem;
+
+    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
+
+location / {
+    proxy_pass http://127.0.0.1:8001;
+    proxy_set_header Host $host;
+    proxy_set_header X-Forwarded-For $remote_addr;
+}
+
+location ~ ^/.+/s/ {
+    proxy_cache snac;
+    proxy_pass http://127.0.0.1:8001;
+    proxy_set_header Host $host;
+    proxy_cache_valid 200 1d;
+    proxy_cache_valid 404 1h;
+    proxy_ignore_headers "Cache-Control" "Expires";
+    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
+    proxy_cache_lock on;
+    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
+    add_header X-Proxy-Cache $upstream_cache_status;
+}
+}
+
+server {
+    listen 80;
+    listen [::]:80;
+    server_name example.com;
+    return 301 https://$host$request_uri;
+}
+
+ +

add pleroma relay

+

see relaylist.com

+
+su - snac
+snac adduser ~/data relay
+snac follow ~/data relay https://relay.toot.io/actor
+
+
+
+ + + -- cgit v1.3.1