diff options
Diffstat (limited to 'articles/2026/Installation-of-Snac2-on-Artix-Linux.html')
| -rw-r--r-- | articles/2026/Installation-of-Snac2-on-Artix-Linux.html | 144 |
1 files changed, 144 insertions, 0 deletions
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 @@ +<!doctype html> +<html lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" > + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" href="/style.css"> + <link rel="icon" type="image/x-icon" href="/favicon.ico"> + <title>Installation of Snac2 on Artix Linux</title> + </head> + <body> + <header> + <h1>Bloggings</h1> + <a href="/index.php">Back</a> + </header> + <main> + <article> +<h2>Installation of Snac2 on Artix Linux</h2> +<h3>2026-05-20</h3> +<h4>Installation of snac2 on Artix Linux +Nginx +Dinit</h4> +<pre> +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 +</pre> +<h3>snac init will ask these questions:</h2> +<pre> +Host name: your.server.domain +Path prefix: leave empty +Network address: 127.0.0.1 +Port: 8001 +</pre> +<h3>add user</h3> +<pre> +snac adduser ~/data +</pre> +<h3> In /home/snac/data/server.json edit these settings:</h3> +<pre> +admin_email +admin_account +title +short_description + +and add this line: + +"proxy_media: true +</pre> +<h3> As root, create the dinit script: /etc/dinit.d/snac2</h3> +<pre> +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 +</pre> +<h3>enable snac2</h3> +<pre> +dinitcl enable snac2 +</pre> +<h3>NGINX Media caching</h3> +<p> +see <a href="https://it-notes.dragas.net/2025/01/29/improving-snac-performance-with-nginx-proxy-cache/">it-notes.fragas.net</a> +</p> +<h3>Nginx configuration +<p> +see <a href="https://comam.es/snac-doc/snac.8.html">comam.es</a>.<br/> +Use $host not $http_host (gixy) +</p> +<h3>in /etc/nginx/nginx.conf http section add:</h3> +<pre> +proxy_cache_path /var/cache/nginx/snac_cache levels=1:2 keys_zone=snac:10m max_size=1g inactive=1440m use_temp_path=off; +</pre> +<h3>make cache folder</h3> +<pre> +mkdir -p /var/cache/nginx/snac_cache +</pre> +<h3>/etc/nginx/sites-available/example.com</h3> +<pre> +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; +} +</pre> + +<h3>add pleroma relay</h3> +<p>see <a href="https://relaylist.com/">relaylist.com</a></p> +<pre> +su - snac +snac adduser ~/data relay +snac follow ~/data relay https://relay.toot.io/actor +</pre> + </article> + </main> + <footer> + <p>ยง</p> + </footer> + </body> +</html> |
