diff --git a/manifest.toml b/manifest.toml index 3a50d3c..343e5c5 100644 --- a/manifest.toml +++ b/manifest.toml @@ -74,17 +74,15 @@ ram.runtime = "800M" "libcurl4-openssl-dev", ] - # Manual install in scripts - # [resources.apt.extras.ttf] - # repo = "deb http://deb.debian.org/debian/ bullseye main contrib" - # key = "https://ftp-master.debian.org/keys/release-bullseye.asc" - # packages = ["ttf-mscorefonts-installer"] - - # Manual install in scripts - # [resources.apt.extras.onlyoffice] - # repo = "https://download.onlyoffice.com/repo/debian squeeze main" - # key = "https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE" - # packages = "onlyoffice-documentserver" + [resources.sources.main] + amd64.url = "https://github.com/ONLYOFFICE/DocumentServer/releases/download/v8.0.1/onlyoffice-documentserver_amd64.deb" + amd64.sha256 = "82b2e59ff7d3064a2d35614be7669bec88735f0837dac786762f7ba6a595cff3" + arm64.url = "https://github.com/ONLYOFFICE/DocumentServer/releases/download/v8.0.1/onlyoffice-documentserver_arm64.deb" + arm64.sha256 = "3fe98049dc483b04f9deeaa935795c49ff6086649d7d51a4a8e67e2f1a7c6093" + rename = "onlyoffice-documentserver.deb" + autoupdate.asset.amd64 = "^onlyoffice-documentserver_amd64.deb$" + autoupdate.asset.arm64 = "^onlyoffice-documentserver_arm64.deb$" + autoupdate.strategy = "latest_github_release" [resources.database] type = "postgresql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 4de1a72..99d4be9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -32,15 +32,9 @@ _install_onlyoffice_deb() { # the install/configure of their package, which is awful since that will # restart NGINX and the whole webadmin and maybe even the YunoHost command # running the install... - - # Do not replace app dependencies - YNH_INSTALL_APP_DEPENDENCIES_REPLACE="false" - - # Can't do that in the manifest because we need the debconf-set-selections and postgresql already configured - ynh_exec_warn_less ynh_install_extra_app_dependencies \ - --repo="https://download.onlyoffice.com/repo/debian squeeze main" \ - --key="https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE" \ - --package="onlyoffice-documentserver" + + ynh_setup_source --dest_dir="$install_dir" + ynh_package_install $install_dir/onlyoffice-documentserver.deb } #================================================= diff --git a/scripts/install b/scripts/install index fca5967..9068b61 100644 --- a/scripts/install +++ b/scripts/install @@ -50,6 +50,22 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R ds:ds "$install_dir" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + yunohost service add "$service" +done + +#================================================= +# START SERVICES +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + ynh_systemd_action --action=restart --service_name="$service" +done + #================================================= # NGINX CONFIGURATION #================================================= diff --git a/scripts/remove b/scripts/remove index 018a353..dc0a40f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -7,6 +7,17 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# REMOVE SERVICE FROM ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + if yunohost service status "$service" >/dev/null 2>&1 + then + yunohost service remove "$service" + fi +done + #================================================= # REMOVE ONLYOFFICE #================================================= @@ -25,8 +36,6 @@ ynh_package_autopurge onlyoffice-documentserver dpkg --configure -a -apt-key del "E09C A29F 6E17 8040 EF22 B409 8320 CA65 CB2D E8E5" 2>/dev/null - #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= diff --git a/scripts/restore b/scripts/restore index 89df2da..a379264 100644 --- a/scripts/restore +++ b/scripts/restore @@ -59,6 +59,22 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + yunohost service add "$service" +done + +#================================================= +# START SERVICES +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + ynh_systemd_action --action=restart --service_name="$service" +done + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f8cd7d5..e2e760c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,6 +55,22 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R ds:ds "$install_dir" +#================================================= +# ADVERTISE SERVICE IN ADMIN PANEL +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + yunohost service add "$service" +done + +#================================================= +# START SERVICES +#================================================= + +for service in "ds-converter" "ds-docservice" "ds-metrics"; do + ynh_systemd_action --action=restart --service_name="$service" +done + #================================================= # REAPPLY SYSTEM CONFIGURATIONS #=================================================