Writefreely

imported>Malacology2022年5月30日 (一) 00:07的版本 (add nginx part)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

安装

$ yay -S writefreely

配置

Mariadb

参见 MariaDB

初始化

cd /usr/share/writefreely
writefreely --config
writefreely --gen-keys
writefreely --create-admin <username>:<passwd>

Nginx

server {
            listen 80;
            server_name DOMAIN;
            return 301 https://$server_name$request_uri;
}
server {
    listen 443 ssl http2;
    server_name DOMAIN;
    ssl_certificate /etc/letsencrypt/live/DOMAIN/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/DOMAIN/privkey.pem;
    ssl_session_cache builtin:1000 shared:SSL:10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;
    access_log /var/log/nginx/access.log;
    
    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://127.0.0.1:5820;
        proxy_read_timeout 90;
        proxy_redirect http://127.0.0.1:5820 https://DOMAIN;
    }
}