Home | Notifications | New Note | Local | Federated | Search | Logout
Note Detail
philip@philip@gotosocial.wittamore.fr (2026-05-18 23:25:11)
Installation of Snac2 on Artix linux dinit/nginx
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 /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 https://it-notes.dragas.net/2025/01/29/improving-snac-performance-with-nginx-proxy-cache/
Nginx configuration
see https://comam.es/snac-doc/snac.8.html
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 default;
listen [::]:443 ssl;
server_name example.com default;
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;
root /srv/http/example.com;
location / {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /.well-known/web
Reply