mirror of
https://github.com/YunoHost-Apps/bazarr_ynh.git
synced 2024-09-03 18:06:27 +02:00
Merge pull request #1 from YunoHost-Apps/testing
Add support for multimedia directories, apply latest app example, fix Python call for Bullseye
This commit is contained in:
commit
4b0240056d
12 changed files with 58 additions and 42 deletions
|
@ -24,7 +24,7 @@ Bazarr is a companion application to Sonarr and Radarr that manages and download
|
|||
- Subtitles upgrade whenever better ones are released
|
||||
|
||||
|
||||
**Shipped version:** 1.0.1~ynh1
|
||||
**Shipped version:** 1.0.1~ynh2
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ Bazarr is a companion application to Sonarr and Radarr that manages and download
|
|||
- Subtitles upgrade whenever better ones are released
|
||||
|
||||
|
||||
**Version incluse :** 1.0.1~ynh1
|
||||
**Version incluse :** 1.0.1~ynh2
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
# See here for more information
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
|
||||
# Move this file from check_process.default to check_process when you have filled it.
|
||||
|
||||
;; Test complet
|
||||
; pre-install
|
||||
# sudo yunohost domain add arr.domain.tld
|
||||
|
@ -20,7 +15,7 @@
|
|||
setup_private=1
|
||||
setup_public=0
|
||||
upgrade=1
|
||||
#upgrade=1 from_commit=CommitHash
|
||||
upgrade=1 from_commit=22445f018b70ed1a89593107afff498b672f93ad
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
port_already_use=0
|
||||
|
@ -29,6 +24,6 @@
|
|||
Email=
|
||||
Notification=none
|
||||
;;; Upgrade options
|
||||
; commit=CommitHash
|
||||
name=Name and date of the commit.
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&
|
||||
; commit=22445f018b70ed1a89593107afff498b672f93ad
|
||||
name=2022-01-13 v1.0.1~ynh1
|
||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[general]
|
||||
ip = 127.0.0.1
|
||||
port = __PORT__
|
||||
base_url = __PATH__
|
||||
base_url = __PATH_URL__
|
||||
path_mappings = []
|
||||
debug = False
|
||||
branch = master
|
||||
|
|
|
@ -14,6 +14,8 @@ StandardOutput=append:/var/log/__APP__/__APP__.log
|
|||
StandardError=inherit
|
||||
|
||||
# Sandboxing options to harden security
|
||||
# Depending on specificities of your service/app, you may need to tweak these
|
||||
# .. but this should be a good baseline
|
||||
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
|
||||
NoNewPrivileges=yes
|
||||
PrivateTmp=yes
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Automated subtitle downloading for Sonarr and Radarr",
|
||||
"fr": "Téléchargement automatique de sous-titres pour Sonarr et Radarr"
|
||||
},
|
||||
"version": "1.0.1~ynh1",
|
||||
"version": "1.0.1~ynh2",
|
||||
"url": "https://bazarr.media",
|
||||
"upstream": {
|
||||
"license": "GPL-3.0",
|
||||
|
@ -27,7 +27,7 @@
|
|||
"nginx"
|
||||
],
|
||||
"arguments": {
|
||||
"install" : [
|
||||
"install": [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain"
|
||||
|
|
|
@ -7,15 +7,9 @@
|
|||
python_version="3.7"
|
||||
python_major_version=$(echo $python_version | cut -d. -f1)
|
||||
|
||||
# dependencies used by the app
|
||||
if [[ $YNH_ARCH != arm* ]]
|
||||
then
|
||||
pkg_dependencies="libxml2-dev libxslt1-dev python3-dev python3-libxml2 python3-lxml unrar-free ffmpeg libatlas-base-dev"
|
||||
else
|
||||
pkg_dependencies="libxml2-dev libxslt1-dev python3-dev python3-libxml2 python3-lxml unrar-free ffmpeg libatlas-base-dev"
|
||||
fi
|
||||
|
||||
pkg_dependencies+=" python${python_major_version}-venv"
|
||||
pkg_dependencies="libxml2-dev libxslt1-dev unrar-free ffmpeg libatlas-base-dev"
|
||||
pkg_dependencies+=" python${python_major_version}-libxml2 python${python_major_version}-lxml"
|
||||
pkg_dependencies+=" python${python_major_version}-dev python${python_major_version}-venv"
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
|
|
|
@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
### Remove this function if there's nothing to clean before calling the remove script.
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
|
|
|
@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
### Remove this function if there's nothing to clean before calling the remove script.
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
|
@ -112,7 +111,7 @@ ynh_script_progression --message="Installing Bazarr and its dependencies..." --w
|
|||
|
||||
pushd $final_path
|
||||
# Initialize virtual environment
|
||||
ynh_exec_as $app python${python_version} -m venv venv
|
||||
ynh_exec_as $app python${python_major_version} -m venv venv
|
||||
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install -r "$final_path/requirements.txt"
|
||||
popd
|
||||
|
@ -138,13 +137,26 @@ ynh_systemd_action --service_name=$app --action="stop" --line_match="Bazarr exit
|
|||
detect_and_read_radarr_and_sonarr_settings
|
||||
|
||||
flask_key=$(ynh_string_random --length=32)
|
||||
ynh_app_setting_set --app=$app --key=flask_key --value=$flask_key
|
||||
|
||||
api_key=$(ynh_string_random --length=32)
|
||||
ynh_app_setting_set --app=$app --key=api_key --value=$api_key
|
||||
|
||||
ynh_add_config --template="config.ini" --destination="$final_path/data/config/config.ini"
|
||||
|
||||
chmod 660 "$final_path/data/config/config.ini"
|
||||
chown $app: "$final_path/data/config/config.ini"
|
||||
|
||||
#=================================================
|
||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding multimedia directories..." --weight=1
|
||||
|
||||
# Build YunoHost multimedia directories
|
||||
ynh_multimedia_build_main_dir
|
||||
# Enable writing into these directories
|
||||
ynh_multimedia_addaccess $app
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
|
|
@ -49,14 +49,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight=
|
|||
# Remove the app-specific logrotate config
|
||||
ynh_remove_logrotate
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=2
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -73,6 +65,14 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
|||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
|
||||
#=================================================
|
||||
# REMOVE DEPENDENCIES
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing dependencies..." --weight=2
|
||||
|
||||
# Remove metapackage and its dependencies
|
||||
ynh_remove_app_dependencies
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
|
|
|
@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
|
||||
ynh_clean_setup () {
|
||||
#### Remove this function if there's nothing to clean before calling the remove script.
|
||||
true
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
|
@ -98,6 +97,16 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
|
|||
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
|
||||
systemctl enable $app.service --quiet
|
||||
|
||||
#=================================================
|
||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding multimedia directories..." --weight=1
|
||||
|
||||
# Build YunoHost multimedia directories
|
||||
ynh_multimedia_build_main_dir
|
||||
# Enable writing into these directories
|
||||
ynh_multimedia_addaccess $app
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE LOGROTATE CONFIGURATION
|
||||
#=================================================
|
||||
|
|
|
@ -27,6 +27,7 @@ detect_and_read_radarr_and_sonarr_settings
|
|||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Checking version..."
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
|
@ -53,12 +54,6 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
#ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
@ -114,7 +109,7 @@ ynh_script_progression --message="Upgrading Bazarr and its dependencies..." --we
|
|||
|
||||
pushd $final_path
|
||||
# Initialize virtual environment
|
||||
ynh_exec_as $app python${python_version} -m venv venv
|
||||
ynh_exec_as $app python${python_major_version} -m venv venv
|
||||
|
||||
ynh_exec_as $app $final_path/venv/bin/pip install -r "$final_path/requirements.txt"
|
||||
popd
|
||||
|
@ -129,6 +124,16 @@ ynh_add_config --template="config.ini" --destination="$final_path/data/config/co
|
|||
chmod 660 "$final_path/data/config/config.ini"
|
||||
chown $app: "$final_path/data/config/config.ini"
|
||||
|
||||
#=================================================
|
||||
# YUNOHOST MULTIMEDIA INTEGRATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Adding multimedia directories..." --weight=1
|
||||
|
||||
# Build YunoHost multimedia directories
|
||||
ynh_multimedia_build_main_dir
|
||||
# Enable writing into these directories
|
||||
ynh_multimedia_addaccess $app
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue