mirror of
https://github.com/YunoHost-Apps/funkwhale_ynh.git
synced 2024-09-03 18:36:24 +02:00
Testing (#233)
* Closes https://github.com/YunoHost-Apps/funkwhale_ynh/issues/206 * fix issue? * Update funkwhale-server.service * Update funkwhale-beat.service * Update funkwhale-worker.service * Update upgrade * Fix nginx and issue https://github.com/YunoHost-Apps/funkwhale_ynh/issues/230 * Fix https://github.com/YunoHost-Apps/funkwhale_ynh/issues/230 * Auto-update README * Revert loglevel to error because issue seems to be fixed * Update upgrade * apply Tagadda suggestions * fix chown * fix chown * Update restore * Update funkwhale-server.service * fix logs * Update upgrade * Update restore * Update remove * Update ADMIN.md * Update ADMIN_fr.md * Update funkwhale-server.service * fix logs * fix logs * fix service * fix service? * fix permissions * fix permissions * fix permissions * test * add logs * Update funkwhale-server.service * Update funkwhale-beat.service * Update funkwhale-worker.service * fix service * Update funkwhale-server.service * Update funkwhale-server.service * Update funkwhale-server.service * Update funkwhale-worker.service --------- Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
parent
d1d2dce5c0
commit
1dca005542
15 changed files with 82 additions and 35 deletions
|
@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
|
||||
Funkwhale is a community-driven project that lets you listen and share music and audio within a decentralized, open network.
|
||||
|
||||
**Shipped version:** 1.3.0~ynh2
|
||||
**Shipped version:** 1.3.0~ynh3
|
||||
|
||||
**Demo:** https://demo.funkwhale.audio
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po
|
|||
|
||||
Funkwhale est un projet communautaire qui vous permet d'écouter et de partager de la musique et de l'audio au sein d'un réseau ouvert et décentralisé.
|
||||
|
||||
**Version incluse :** 1.3.0~ynh2
|
||||
**Version incluse :** 1.3.0~ynh3
|
||||
|
||||
**Démo :** https://demo.funkwhale.audio
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ FUNKWHALE_HOSTNAME=__DOMAIN__
|
|||
FUNKWHALE_PROTOCOL=https
|
||||
|
||||
# Log level (debug, info, warning, error, critical)
|
||||
LOGLEVEL=debug
|
||||
LOGLEVEL=error
|
||||
|
||||
# Configure e-mail sending using this variale
|
||||
# By default, funkwhale will output e-mails sent to stdout
|
||||
|
|
|
@ -6,6 +6,7 @@ PartOf=__APP__.target
|
|||
[Service]
|
||||
User=__APP__
|
||||
Group=__APP__
|
||||
StandardOutput=append:/var/log/__APP__/__APP__-beat.log
|
||||
WorkingDirectory=__INSTALL_DIR__/api
|
||||
EnvironmentFile=__INSTALL_DIR__/config/.env
|
||||
|
||||
|
|
|
@ -15,7 +15,8 @@ ExecStart=__INSTALL_DIR__/venv/bin/gunicorn \
|
|||
config.asgi:application \
|
||||
--workers ${FUNKWHALE_WEB_WORKERS} \
|
||||
--worker-class uvicorn.workers.UvicornWorker \
|
||||
--bind ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}
|
||||
--bind ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT} \
|
||||
--timeout 120
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
|
||||
|
||||
|
|
|
@ -3,4 +3,4 @@ Description=Funkwhale (__APP__)
|
|||
Wants=__APP__-server.service __APP__-worker.service __APP__-beat.service
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
|
@ -108,7 +108,7 @@ location /media/attachments/ {
|
|||
# has been checked on API side.
|
||||
# Comment the "NON-S3" commented lines and uncomment "S3" commented lines
|
||||
# if you're storing media files in a S3 bucket.
|
||||
location ~ /_protected/media/(.+)/ {
|
||||
location /_protected/media/ {
|
||||
internal;
|
||||
alias __DATA_DIR__/data/media/$1; # NON-S3
|
||||
# Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932.
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
|
||||
To add a collection of music files to a library in your YunoHost installation of Funkwhale, create a symlink to your collection titled "music" in `__DATA_DIR__/data`
|
||||
```console
|
||||
foo@bar:~$sudo ln -s /your/music/collection __DATA_DIR__/data/music
|
||||
sudo ln -s /your/music/collection __DATA_DIR__/data/music
|
||||
```
|
||||
The files can then be added to your library from the *uploading* tab in a music library under the heading **Import music from your server**.
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
|
||||
* Admin
|
||||
* L'administrateur utilise le login que vous avez fourni lors de l'installation. Le mot de passe est le même que celui que vous utilisez pour YunoHost.
|
||||
* L'interface d'administration est accessible à l'adresse : __DOMAIN__/api/admin
|
||||
* L'interface d'administration est accessible à l'adresse : `__DOMAIN__/api/admin`
|
||||
|
||||
Pour ajouter une collection de fichiers musicaux à une bibliothèque dans votre installation YunoHost de Funkwhale, créez un lien symbolique vers votre collection intitulée "music" dans `__DATA_DIR__/data/`.
|
||||
`foo@bar:~$sudo ln -s /your/music/collection __DATA_DIR__/data/music`
|
||||
```console
|
||||
sudo ln -s /votre/collection/de/musique __DATA_DIR__/data/music
|
||||
```
|
||||
Les fichiers peuvent ensuite être ajoutés à votre bibliothèque à partir de l'onglet *Envoi* dans une bibliothèque musicale sous la rubrique **Importer de la musique de votre serveur**.
|
||||
|
|
|
@ -5,7 +5,7 @@ name = "Funkwhale"
|
|||
description.en = "Convivial and modern music server"
|
||||
description.fr = "Serveur de musique moderne et convivial"
|
||||
|
||||
version = "1.3.0~ynh2"
|
||||
version = "1.3.0~ynh3"
|
||||
|
||||
maintainers = ["Thovi98"]
|
||||
|
||||
|
|
|
@ -47,9 +47,9 @@ ynh_exec_warn_less ynh_exec_as $app $install_dir/venv/bin/funkwhale-manage fix_f
|
|||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name="$app-server" --action="start" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name="$app-worker" --action="start" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="/var/log/$app/${app}-beat.log"
|
||||
ynh_systemd_action --service_name="$app-server" --action="start" --log_path="/var/log/$app/${app}-server.log"
|
||||
ynh_systemd_action --service_name="$app-worker" --action="start" --log_path="/var/log/$app/${app}-worker.log"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
|
|
|
@ -26,10 +26,6 @@ ynh_setup_source --dest_dir="$install_dir/front" --source_id="front"
|
|||
|
||||
mkdir -p $install_dir/config
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -50,7 +46,7 @@ mkdir -p $data_dir/data/{static,media,music}
|
|||
|
||||
chmod 750 "$data_dir"
|
||||
chmod -R o-rwx "$data_dir/"
|
||||
chown -R $app:www-data "$data_dir/"
|
||||
chown -R $app:$app "$data_dir/"
|
||||
|
||||
#=================================================
|
||||
# ADD A CONFIGURATION
|
||||
|
@ -112,6 +108,18 @@ chmod 750 "$install_dir"
|
|||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring logrotate to manage application logfiles" --weight=1
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate --specific_user=$app
|
||||
touch /var/log/$app/${app}-server.log
|
||||
touch /var/log/$app/${app}-worker.log
|
||||
touch /var/log/$app/${app}-beat.log
|
||||
chown -R $app:$app /var/log/$app/
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -119,9 +127,9 @@ chown -R $app:www-data "$install_dir"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add "${app}-beat"
|
||||
yunohost service add "${app}-server"
|
||||
yunohost service add "${app}-worker"
|
||||
yunohost service add "${app}-beat" --description="${app} celery beat process" --log="/var/log/$app/${app}-beat.log"
|
||||
yunohost service add "${app}-server" --description="${app} application server" --log="/var/log/$app/${app}-server.log"
|
||||
yunohost service add "${app}-worker" --description="${app} celery worker" --log="/var/log/$app/${app}-worker.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
|
@ -58,6 +58,17 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
|||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE LOGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing logs..." --weight=5
|
||||
|
||||
ynh_remove_logrotate
|
||||
|
||||
# Remove the log files
|
||||
ynh_secure_remove --file="/var/log/$app"
|
||||
|
||||
|
||||
#=================================================
|
||||
# REMOVE FAIL2BAN CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -28,11 +28,11 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1
|
|||
ynh_restore_file --origin_path="$data_dir/" --not_mandatory
|
||||
|
||||
mkdir -p $data_dir/data
|
||||
mkdir -p $data_dir/{static,media,music}
|
||||
mkdir -p $data_dir/data/{static,media,music}
|
||||
|
||||
chmod 750 "$data_dir/"
|
||||
chmod -R o-rwx "$data_dir/"
|
||||
chown -R $app:www-data "$data_dir/"
|
||||
chown -R $app:$app "$data_dir/"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
|
@ -48,6 +48,18 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." --weight
|
|||
|
||||
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
|
||||
|
||||
#=================================================
|
||||
# LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring logrotate to manage application logfiles" --weight=1
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate --specific_user=$app
|
||||
touch /var/log/$app/${app}-server.log
|
||||
touch /var/log/$app/${app}-worker.log
|
||||
touch /var/log/$app/${app}-beat.log
|
||||
chown -R $app:$app /var/log/$app/
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
#=================================================
|
||||
|
@ -67,9 +79,13 @@ systemctl enable "${app}-worker.service" --quiet
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add "${app}-beat"
|
||||
yunohost service add "${app}-server"
|
||||
yunohost service add "${app}-worker"
|
||||
ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service"
|
||||
ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service"
|
||||
ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service"
|
||||
|
||||
yunohost service add "${app}-beat" --description="${app} celery beat process" --log="/var/log/$app/${app}-beat.log"
|
||||
yunohost service add "${app}-server" --description="${app} application server" --log="/var/log/$app/${app}-server.log"
|
||||
yunohost service add "${app}-worker" --description="${app} celery worker" --log="/var/log/$app/${app}-worker.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
|
@ -36,17 +36,13 @@ then
|
|||
|
||||
# Remove the old files
|
||||
ynh_secure_remove --file="$install_dir/api"
|
||||
ynh_secure_remove --file="$install_dir/api"
|
||||
ynh_secure_remove --file="$install_dir/front"
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir/api" --source_id="api"
|
||||
ynh_setup_source --dest_dir="$install_dir/front" --source_id="front"
|
||||
fi
|
||||
|
||||
chmod 750 "$install_dir"
|
||||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -62,7 +58,7 @@ ynh_script_progression --message="Assure correct permissions to $data_dir..." --
|
|||
|
||||
chmod 750 "$data_dir"
|
||||
chmod -R o-rwx "$data_dir/"
|
||||
chown -R $app:www-data "$data_dir/"
|
||||
chown -R $app:$app "$data_dir/"
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
|
@ -112,6 +108,18 @@ chmod 750 "$install_dir"
|
|||
chmod -R o-rwx "$install_dir"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring logrotate to manage application logfiles" --weight=1
|
||||
|
||||
# Use logrotate to manage application logfile(s)
|
||||
ynh_use_logrotate --specific_user=$app
|
||||
touch /var/log/$app/${app}-server.log
|
||||
touch /var/log/$app/${app}-worker.log
|
||||
touch /var/log/$app/${app}-beat.log
|
||||
chown -R $app:$app /var/log/$app/
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
@ -131,9 +139,9 @@ ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.serv
|
|||
#=================================================
|
||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||
|
||||
yunohost service add "${app}-beat"
|
||||
yunohost service add "${app}-server"
|
||||
yunohost service add "${app}-worker"
|
||||
yunohost service add "${app}-beat" --description="${app} celery beat process" --log="/var/log/$app/${app}-beat.log"
|
||||
yunohost service add "${app}-server" --description="${app} application server" --log="/var/log/$app/${app}-server.log"
|
||||
yunohost service add "${app}-worker" --description="${app} celery worker" --log="/var/log/$app/${app}-worker.log"
|
||||
|
||||
#=================================================
|
||||
# START SYSTEMD SERVICE
|
||||
|
|
Loading…
Reference in a new issue