Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
support:audio [05/02/2021 14:05] – créée LibertAdmin | support:audio [12/06/2023 17:23] (Version actuelle) – LibertAdmin | ||
---|---|---|---|
Ligne 6: | Ligne 6: | ||
N' | N' | ||
+ | |||
+ | ===== Machine virtuelle ===== | ||
+ | |||
+ | * 2 CPU, 2 Go de mémoire | ||
+ | * Système d' | ||
+ | * Stockage des données : [[https:// | ||
+ | |||
+ | ===== Configuration ===== | ||
+ | |||
+ | Funkwhale est installé via la méthode classique « Non-Docker ». | ||
+ | |||
+ | Le fichier de configuration principal ''/ | ||
+ | |||
+ | <code bash> | ||
+ | FUNKWHALE_API_IP=127.0.0.1 | ||
+ | FUNKWHALE_API_PORT=(privé) | ||
+ | FUNKWHALE_WEB_WORKERS=4 | ||
+ | FUNKWHALE_HOSTNAME=audio.liberta.vip | ||
+ | FUNKWHALE_PROTOCOL=https | ||
+ | TYPESENSE_API_KEY=(privé) | ||
+ | EMAIL_CONFIG=smtp+tls:// | ||
+ | ACCOUNT_EMAIL_VERIFICATION_ENFORCE=true | ||
+ | DEFAULT_FROM_EMAIL=libertadmin@liberta.vip | ||
+ | REVERSE_PROXY_TYPE=nginx | ||
+ | DATABASE_URL=postgresql:// | ||
+ | CACHE_URL=redis:// | ||
+ | MEDIA_ROOT=/ | ||
+ | STATIC_ROOT=/ | ||
+ | DJANGO_SETTINGS_MODULE=config.settings.production | ||
+ | DJANGO_SECRET_KEY=(privé) | ||
+ | RAVEN_ENABLED=true | ||
+ | RAVEN_DSN=https:// | ||
+ | MUSIC_DIRECTORY_PATH=/ | ||
+ | MUSIC_DIRECTORY_SERVE_PATH=/ | ||
+ | FUNKWHALE_FRONTEND_PATH=/ | ||
+ | NGINX_MAX_BODY_SIZE=4000M | ||
+ | </ | ||
+ | |||
+ | Le fichier de configuration du serveur HTTP Nginx ''/ | ||
+ | |||
+ | <code bash> | ||
+ | upstream funkwhale-api { | ||
+ | server 127.0.0.1: | ||
+ | } | ||
+ | server { | ||
+ | listen 80; | ||
+ | listen [::]:80; | ||
+ | server_name audio.liberta.vip; | ||
+ | location / { | ||
+ | return 301 https:// | ||
+ | } | ||
+ | } | ||
+ | map $http_upgrade $connection_upgrade { | ||
+ | default upgrade; | ||
+ | '' | ||
+ | } | ||
+ | server { | ||
+ | listen | ||
+ | listen [::]:443 ssl http2; | ||
+ | charset | ||
+ | server_name audio.liberta.vip; | ||
+ | ssl_protocols TLSv1.2; | ||
+ | ssl_ciphers HIGH: | ||
+ | ssl_prefer_server_ciphers on; | ||
+ | ssl_session_cache shared: | ||
+ | ssl_certificate | ||
+ | ssl_certificate_key / | ||
+ | add_header Strict-Transport-Security " | ||
+ | add_header Content-Security-Policy " | ||
+ | add_header Referrer-Policy " | ||
+ | add_header X-Frame-Options " | ||
+ | add_header Service-Worker-Allowed "/"; | ||
+ | root / | ||
+ | gzip on; | ||
+ | gzip_comp_level | ||
+ | gzip_min_length | ||
+ | gzip_proxied | ||
+ | gzip_vary | ||
+ | gzip_types | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | application/ | ||
+ | font/ | ||
+ | image/bmp | ||
+ | image/ | ||
+ | image/ | ||
+ | text/ | ||
+ | text/css | ||
+ | text/plain | ||
+ | text/vcard | ||
+ | text/ | ||
+ | text/vtt | ||
+ | text/ | ||
+ | text/ | ||
+ | location /api/ { | ||
+ | include / | ||
+ | client_max_body_size 4000M; | ||
+ | proxy_pass | ||
+ | } | ||
+ | location / { | ||
+ | alias / | ||
+ | expires 1d; | ||
+ | try_files $uri $uri/ / | ||
+ | } | ||
+ | location = /embed.html { | ||
+ | add_header Content-Security-Policy " | ||
+ | add_header Referrer-Policy " | ||
+ | alias / | ||
+ | expires 1d; | ||
+ | } | ||
+ | location / | ||
+ | include / | ||
+ | proxy_pass | ||
+ | } | ||
+ | location /rest/ { | ||
+ | include / | ||
+ | proxy_pass | ||
+ | } | ||
+ | location / | ||
+ | include / | ||
+ | proxy_pass | ||
+ | } | ||
+ | location / | ||
+ | alias / | ||
+ | add_header Access-Control-Allow-Origin ' | ||
+ | } | ||
+ | location / | ||
+ | alias / | ||
+ | add_header Access-Control-Allow-Origin ' | ||
+ | } | ||
+ | location ~ / | ||
+ | internal; | ||
+ | add_header Access-Control-Allow-Origin ' | ||
+ | } | ||
+ | location / | ||
+ | internal; | ||
+ | alias / | ||
+ | add_header Access-Control-Allow-Origin ' | ||
+ | } | ||
+ | location / | ||
+ | return 302 / | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Mises à jour ===== | ||
+ | |||
+ | Un simple script Shell est utilisé pour « automatiser » le processus : | ||
+ | |||
+ | Le fichier '' | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | export FUNKWHALE_VERSION=" | ||
+ | cd / | ||
+ | sudo -u (privé) curl -L -o front.zip " | ||
+ | sudo -u (privé) unzip -o front.zip | ||
+ | sudo -u (privé) rm front.zip | ||
+ | sudo -u (privé) curl -L -o " | ||
+ | sudo -u (privé) unzip " | ||
+ | sudo -u (privé) rm -rf api/ | ||
+ | sudo -u (privé) mv extracted/ | ||
+ | sudo -u (privé) rm -rf extracted | ||
+ | api/ | ||
+ | sudo -u (privé) -H -E / | ||
+ | sudo -u (privé) -H -E / | ||
+ | sudo -u (privé) -H -E / | ||
+ | systemctl stop funkwhale-beat funkwhale-worker funkwhale-server | ||
+ | curl -L -o "/ | ||
+ | curl -L -o "/ | ||
+ | curl -L -o "/ | ||
+ | curl -L -o "/ | ||
+ | sed -i -e ' | ||
+ | systemctl daemon-reload | ||
+ | sudo -u (privé) -H -E / | ||
+ | systemctl start funkwhale-server funkwhale-worker funkwhale-beat | ||
+ | systemctl restart nginx | ||
+ | </ |