Home | Notifications | New Note | Local | Federated | Search | Logout
Note Detail
philip@philip@gotosocial.wittamore.fr (2026-05-18 05:43:01)
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
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
edit /etc/nginx/sites-available/your-site
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/webfinger {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /api/v1/ {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /api/v2/ {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /oauth {
proxy_pass http://127.0.0.1:8001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
location /.well-kno
Reply