diff --git a/conf/systemd.service b/conf/systemd.service index d31dfae..43d8228 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ Group=__APP__ UMask=0002 Type=simple -ExecStart=/usr/bin/mono --debug /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/__INSTALL_DIR__ +ExecStart=mono --debug __INSTALL_DIR__/Sonarr -nobrowser -data=__DATA_DIR__ TimeoutStopSec=20 KillMode=process Restart=on-failure diff --git a/manifest.toml b/manifest.toml index 684795c..c9d7f75 100644 --- a/manifest.toml +++ b/manifest.toml @@ -44,9 +44,21 @@ ram.runtime = "50M" help = "This app is only protected by YunoHost's SSO, so do not make it accessible by visitors." [resources] + [resources.sources.main] + amd64.url = "https://github.com/Sonarr/Sonarr/releases/download/v4.0.1.1047/Sonarr.develop.4.0.1.1047.linux-x64.tar.gz" + arm64.url = "https://github.com/Sonarr/Sonarr/releases/download/v4.0.1.1047/Sonarr.develop.4.0.1.1047.linux-arm64.tar.gz" + armhf.url = "https://github.com/Sonarr/Sonarr/releases/download/v4.0.1.1047/Sonarr.develop.4.0.1.1047.linux-arm.tar.gz" + + autoupdate.strategy = "latest_github_release" + autoupdate.asset.amd64 = ".*\\.linux-x64.tar.gz" + autoupdate.asset.arm64 = ".*\\.linux-arm64.tar.gz" + autoupdate.asset.armhf = ".*\\.linux-arm.tar.gz" + [resources.system_user] [resources.install_dir] + + [resources.data_dir] dir = "/var/lib/__APP__" [resources.ports] @@ -66,18 +78,3 @@ ram.runtime = "50M" "ca-certificates", "mediainfo", ] - - # extras.mono-devel.repo = "https://download.mono-project.com/repo/debian bullseye main" - # extras.mono-devel.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" - # extras.mono-devel.packages = "mono-devel" - - extras.sonarr.repo = "https://apt.sonarr.tv/debian bullseye main" - extras.sonarr.key = "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8" - extras.sonarr.packages = "sonarr" - - # Dummy source to trigger the auto-updater - [resources.sources.main] - url = "https://github.com/Sonarr/Sonarr/archive/refs/tags/3.0.10.1567.tar.gz" - sha256 = "1fd4129216a1baee66c40ecc6af7d86802a04ffd12ecc5fd0afff1e5469ae99c" - prefetch = false - autoupdate.strategy = "latest_github_tag" diff --git a/scripts/install b/scripts/install index 7d9e176..10ed482 100755 --- a/scripts/install +++ b/scripts/install @@ -17,23 +17,31 @@ source /usr/share/yunohost/helpers api_key=$(ynh_string_random --length=32) ynh_app_setting_set --app=$app --key="api_key" --value="$api_key" -# Stop the service automatically created upon installation of the package -ynh_systemd_action --service_name="sonarr" --action="stop" +#================================================= +# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=1 + +# Download, check integrity, uncompress and patch the source from manifest.toml +ynh_setup_source --dest_dir="$install_dir" + +chown -R "$app:$app" "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Configuring Radarr..." --weight=2 -# Create $install_dir and its logs subdirectory mkdir -p "/var/log/$app" -ln -s "/var/log/$app" "$install_dir/logs" +ln -s "/var/log/$app" "$data_dir/logs" -ynh_add_config --template="config.xml" --destination="$install_dir/config.xml" +ynh_add_config --template="config.xml" --destination="$data_dir/config.xml" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R "$app:$app" "$install_dir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R "$app:$app" "$data_dir" #================================================= # YUNOHOST MULTIMEDIA INTEGRATION @@ -68,13 +76,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 -# If a first Sonarr app was running before installing this one, -# it may have been stopped by the installation of the dependencies. -# Let's restart it. (hence why we use sonarr and not $app..) -if ! systemctl -q is-active sonarr; then - ynh_exec_fully_quiet ynh_systemd_action --service_name=sonarr --action="restart" --log_path="systemd" --line_match="Starting Web Server" --timeout=30 -fi - #================================================= # END OF SCRIPT #=================================================