From 50c3fbcb73d81c18608ca10c2116559c83e388a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 16:42:26 +0200 Subject: [PATCH 01/14] v2 --- conf/docker-image-extract.src | 7 -- conf/lemmy-translations.src | 7 -- conf/lemmy-ui.service | 2 +- conf/lemmy.service | 6 +- manifest.toml | 57 ++++++++++++++++ scripts/_common.sh | 6 +- scripts/backup | 20 +++--- scripts/install | 122 +++++++++++++++++----------------- scripts/remove | 32 ++++----- scripts/restore | 60 ++++++++--------- scripts/upgrade | 94 +++++++++++++------------- 11 files changed, 228 insertions(+), 185 deletions(-) delete mode 100644 conf/docker-image-extract.src delete mode 100644 conf/lemmy-translations.src create mode 100644 manifest.toml diff --git a/conf/docker-image-extract.src b/conf/docker-image-extract.src deleted file mode 100644 index 64fe1a1..0000000 --- a/conf/docker-image-extract.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://codeload.github.com/jjlin/docker-image-extract/tar.gz/a9e455e44bbbfba897bf3342d9661b182cee67a9 -SOURCE_SUM=9eb0c734e83a3fd7102fc7209af4977024ec467fbc819782491af47295675f67 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/conf/lemmy-translations.src b/conf/lemmy-translations.src deleted file mode 100644 index 87b40c6..0000000 --- a/conf/lemmy-translations.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://codeload.github.com/LemmyNet/lemmy-translations/tar.gz/00e4efbef6c3ac34cd2f5f444a95eddce9ec12d7 -SOURCE_SUM=0587c1867c785e6d229d1519a37fc9a280e78f356d919f868f21a896abddff71 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/conf/lemmy-ui.service b/conf/lemmy-ui.service index 45da3dc..3fdf846 100644 --- a/conf/lemmy-ui.service +++ b/conf/lemmy-ui.service @@ -10,7 +10,7 @@ Environment="LEMMY_INTERNAL_HOST=127.0.0.1:__PORT_LEMMY__" Environment="LEMMY_EXTERNAL_HOST=__DOMAIN__" Environment="LEMMY_HTTPS=true" Environment="LEMMY_UI_HOST=0.0.0.0:__PORT_UI__" -WorkingDirectory=__FINALPATH__/lemmy-ui/ +WorkingDirectory=__INSTALL_DIR__/lemmy-ui/ ExecStart=__YNH_NODE__ dist/js/server.js StandardOutput=append:/var/log/__APP__/__APP__-ui.log StandardError=inherit diff --git a/conf/lemmy.service b/conf/lemmy.service index 3cfc327..8806833 100644 --- a/conf/lemmy.service +++ b/conf/lemmy.service @@ -6,9 +6,9 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -Environment="LEMMY_CONFIG_LOCATION=__FINALPATH__/config/config.hjson" -WorkingDirectory=__FINALPATH__/lemmy/ -ExecStart=__FINALPATH__/lemmy/lemmy +Environment="LEMMY_CONFIG_LOCATION=__INSTALL_DIR__/config/config.hjson" +WorkingDirectory=__INSTALL_DIR__/lemmy/ +ExecStart=__INSTALL_DIR__/lemmy/lemmy StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..73a58cb --- /dev/null +++ b/manifest.toml @@ -0,0 +1,57 @@ +packaging_format = 2 + +id = "lemmy" +name = "Lemmy" +description.en = "Link aggregator/Reddit clone for the fediverse" +description.fr = "Agrégateur de liens/clone Reddit pour le fedivers" + +version = "0.16.7~ynh1" + +maintainers = [] + +[upstream] +license = "GPL-3.0" +website = "https://join-lemmy.org/" +demo = "https://lemmy.ml/" +admindoc = "https://join-lemmy.org/docs/en/" +code = "https://github.com/LemmyNet/lemmy" +cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) +fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. + +[integration] +yunohost = ">= 4.3.0" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +multi_instance = false +ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. +sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. +disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... +ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... + + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + full_domain = true + +[resources] + [resources.sources] + [resources.sources.docker-image-extract] + url = "https://codeload.github.com/jjlin/docker-image-extract/tar.gz/a9e455e44bbbfba897bf3342d9661b182cee67a9" + sha256 = "9eb0c734e83a3fd7102fc7209af4977024ec467fbc819782491af47295675f67" + + [resources.sources.lemmy-translations] + url = "https://codeload.github.com/LemmyNet/lemmy-translations/tar.gz/00e4efbef6c3ac34cd2f5f444a95eddce9ec12d7" + sha256 = "0587c1867c785e6d229d1519a37fc9a280e78f356d919f868f21a896abddff71" + + + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + main.url = "/" + + [resources.database] + type = "postgresql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 07ff72a..fb32dc3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,10 +5,10 @@ #================================================= # dependencies used by the app -lemmy_dependencies="postgresql postgresql-contrib" -lemmyui_dependencies="espeak" +#REMOVEME? lemmy_dependencies="postgresql postgresql-contrib" +#REMOVEME? lemmyui_dependencies="espeak" -pkg_dependencies="$lemmy_dependencies $lemmyui_dependencies" +#REMOVEME? pkg_dependencies="$lemmy_dependencies $lemmyui_dependencies" NODEJS_VERSION=12 diff --git a/scripts/backup b/scripts/backup index 4ddf8d0..99e0831 100755 --- a/scripts/backup +++ b/scripts/backup @@ -14,23 +14,23 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_print_info --message="Loading installation settings..." +#REMOVEME? ynh_print_info --message="Loading installation settings..." -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -41,13 +41,13 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$final_path" +ynh_backup --src_path="$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= -ynh_backup --src_path="$datadir" --is_big +ynh_backup --src_path="$data_dir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/install b/scripts/install index b50cbcc..3e9033c 100755 --- a/scripts/install +++ b/scripts/install @@ -13,59 +13,59 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -domain=$YNH_APP_ARG_DOMAIN -path_url="/" +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +path="/" -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +#REMOVEME? install_dir=/var/www/$app +#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" # Register (book) web path -ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url +#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url +#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path #================================================= # STANDARD MODIFICATIONS #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --weight=1 +#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port -port_lemmy=$(ynh_find_port --port=8536) -ynh_app_setting_set --app=$app --key=port_lemmy --value=$port_lemmy -port_ui=$(ynh_find_port --port=1235) -ynh_app_setting_set --app=$app --key=port_ui --value=$port_ui +#REMOVEME? port_lemmy=$(ynh_find_port --port=8536) +#REMOVEME? ynh_app_setting_set --app=$app --key=port_lemmy --value=$port_lemmy +#REMOVEME? port_ui=$(ynh_find_port --port=1235) +#REMOVEME? ynh_app_setting_set --app=$app --key=port_ui --value=$port_ui #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ln -fs /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 @@ -73,23 +73,23 @@ ln -fs /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 +#REMOVEME? ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 -ynh_psql_test_if_first_run -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -db_pwd=$(ynh_string_random --length=30) -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? ynh_psql_test_if_first_run +#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) +#REMOVEME? db_user=$db_name +#REMOVEME? db_pwd=$(ynh_string_random --length=30) +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd +#REMOVEME? ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --database="$db_name" #================================================= @@ -97,15 +97,15 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --data #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -ynh_app_setting_set --app=$app --key=final_path --value=$final_path +#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path/build-lemmy/" --source_id="docker-image-extract" -ynh_setup_source --dest_dir="$final_path/build-lemmy-ui/" --source_id="docker-image-extract" -ynh_setup_source --dest_dir="$final_path/lemmy-ui/lemmy-translations/" --source_id="lemmy-translations" +ynh_setup_source --dest_dir="$install_dir/build-lemmy/" --source_id="docker-image-extract" +ynh_setup_source --dest_dir="$install_dir/build-lemmy-ui/" --source_id="docker-image-extract" +ynh_setup_source --dest_dir="$install_dir/lemmy-ui/lemmy-translations/" --source_id="lemmy-translations" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # NGINX CONFIGURATION @@ -122,14 +122,14 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Creating a data directory..." --weight=1 -datadir=/home/yunohost.app/$app -ynh_app_setting_set --app=$app --key=datadir --value=$datadir +#REMOVEME? data_dir=/home/yunohost.app/$app +#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir -mkdir -p $datadir/pictrs-data +mkdir -p $data_dir/pictrs-data -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:$app "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:$app "$data_dir" #================================================= # MAKE INSTALL @@ -137,35 +137,35 @@ chown -R $app:$app "$datadir" ynh_script_progression --message="Making install..." --weight=1 # Install lemmy-ui -pushd $final_path/build-lemmy-ui +pushd $install_dir/build-lemmy-ui ./docker-image-extract dessalines/lemmy-ui:$(ynh_app_upstream_version) popd -mkdir -p "$final_path/lemmy-ui/" -rsync -a "$final_path/build-lemmy-ui/output/app/" "$final_path/lemmy-ui/" -ynh_secure_remove --file="$final_path/build-lemmy-ui" +mkdir -p "$install_dir/lemmy-ui/" +rsync -a "$install_dir/build-lemmy-ui/output/app/" "$install_dir/lemmy-ui/" +#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy-ui" # Install lemmy -pushd $final_path/build-lemmy +pushd $install_dir/build-lemmy ./docker-image-extract dessalines/lemmy:$(ynh_app_upstream_version) popd -mkdir -p "$final_path/lemmy/" -mv -f "$final_path/build-lemmy/output/app/lemmy" "$final_path/lemmy/lemmy" -ynh_secure_remove --file="$final_path/build-lemmy" +mkdir -p "$install_dir/lemmy/" +mv -f "$install_dir/build-lemmy/output/app/lemmy" "$install_dir/lemmy/lemmy" +#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -mkdir -p "$final_path/config/" -ynh_add_config --template="../conf/lemmy.hjson" --destination="$final_path/config/config.hjson" +mkdir -p "$install_dir/config/" +ynh_add_config --template="../conf/lemmy.hjson" --destination="$install_dir/config/config.hjson" -chmod 400 "$final_path/config/config.hjson" -chown $app:$app "$final_path/config/config.hjson" +chmod 400 "$install_dir/config/config.hjson" +chown $app:$app "$install_dir/config/config.hjson" #================================================= # SETUP SYSTEMD @@ -211,17 +211,17 @@ ynh_systemd_action --service_name=$app-ui --action="start" --line_match="http:// #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public -ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index e9f6065..15b4863 100755 --- a/scripts/remove +++ b/scripts/remove @@ -12,15 +12,15 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # STANDARD REMOVE @@ -60,18 +60,18 @@ ynh_remove_logrotate #================================================= # REMOVE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 # Remove a database if it exists, along with the associated user -ynh_psql_remove_db --db_user=$db_user --db_name=$db_name +#REMOVEME? ynh_psql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -81,7 +81,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing app data directory..." --weight=1 - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -95,11 +95,11 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_nodejs -ynh_remove_app_dependencies +#REMOVEME? ynh_remove_app_dependencies ynh_secure_remove --file="/lib/libc.musl-x86_64.so.1" #================================================= @@ -117,10 +117,10 @@ ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 # Delete a system user -ynh_system_user_delete --username=$app +#REMOVEME? ynh_system_user_delete --username=$app #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 2e62c14..9693a5f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -14,78 +14,78 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { +#REMOVEME? ynh_clean_setup () { true } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --weight=1 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " +#REMOVEME? test ! -d $install_dir \ + || ynh_die --message="There is already a directory: $install_dir " #================================================= # STANDARD RESTORATION STEPS #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 +#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # RESTORE THE APP MAIN DIR #================================================= ynh_script_progression --message="Restoring the app main directory..." --weight=1 -ynh_restore_file --origin_path="$final_path" +ynh_restore_file --origin_path="$install_dir" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # RESTORE THE DATA DIRECTORY #================================================= ynh_script_progression --message="Restoring the data directory..." --weight=1 -ynh_restore_file --origin_path="$datadir" --not_mandatory +ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $datadir +mkdir -p $data_dir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:$app "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:$app "$data_dir" #================================================= # SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ln -fs /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 @@ -100,10 +100,10 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 +#REMOVEME? ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -ynh_psql_test_if_first_run -ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? ynh_psql_test_if_first_run +#REMOVEME? ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --database="$db_name" diff --git a/scripts/upgrade b/scripts/upgrade index 20b91df..b7f91bb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,20 +12,20 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 +#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 -app=$YNH_APP_INSTANCE_NAME +#REMOVEME? app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get --app=$app --key=domain) -path_url=$(ynh_app_setting_get --app=$app --key=path) -admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -port_lemmy=$(ynh_app_setting_get --app=$app --key=port_lemmy) -port_ui=$(ynh_app_setting_get --app=$app --key=port_ui) +#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) +#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) +#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) +#REMOVEME? db_user=$db_name +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) +#REMOVEME? port_lemmy=$(ynh_app_setting_get --app=$app --key=port_lemmy) +#REMOVEME? port_ui=$(ynh_app_setting_get --app=$app --key=port_ui) #================================================= # CHECK VERSION @@ -37,16 +37,16 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 +#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { +#REMOVEME? ynh_backup_before_upgrade +#REMOVEME? ynh_clean_setup () { # Restore it if the upgrade fails - ynh_restore_upgradebackup +#REMOVEME? ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS @@ -64,8 +64,8 @@ ynh_systemd_action --service_name=$app-ui --action="stop" --line_match="Stopped" ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all +#REMOVEME? if ynh_legacy_permissions_exists; then +#REMOVEME? ynh_legacy_permissions_delete_all ynh_app_setting_delete --app=$app --key=is_public fi @@ -87,16 +87,16 @@ then yunohost service remove $app-pict-rs fi ynh_remove_systemd_config --service=$app-pict-rs -ynh_secure_remove --file="$final_path/pict-rs" +#REMOVEME? ynh_secure_remove --file="$install_dir/pict-rs" ynh_app_setting_delete --app=$app --key=port_pictrs #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 +#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" +#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -107,21 +107,21 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress the source of lemmy from app.src to his build directory - ynh_setup_source --dest_dir="$final_path/build-lemmy/" --source_id="docker-image-extract" - ynh_setup_source --dest_dir="$final_path/build-lemmy-ui/" --source_id="docker-image-extract" - ynh_setup_source --dest_dir="$final_path/lemmy-ui/lemmy-translations/" --source_id="lemmy-translations" + ynh_setup_source --dest_dir="$install_dir/build-lemmy/" --source_id="docker-image-extract" + ynh_setup_source --dest_dir="$install_dir/build-lemmy-ui/" --source_id="docker-image-extract" + ynh_setup_source --dest_dir="$install_dir/lemmy-ui/lemmy-translations/" --source_id="lemmy-translations" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=1 +#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 -ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies +#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ln -fs /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 @@ -144,36 +144,36 @@ ynh_script_progression --message="Making upgrade..." --weight=1 if [ "$upgrade_type" == "UPGRADE_APP" ] then # Install lemmy-ui - pushd $final_path/build-lemmy-ui + pushd $install_dir/build-lemmy-ui ./docker-image-extract dessalines/lemmy-ui:$(ynh_app_upstream_version) popd - mkdir -p "$final_path/lemmy-ui/" - rsync -a "$final_path/build-lemmy-ui/output/app/" "$final_path/lemmy-ui/" - ynh_secure_remove --file="$final_path/build-lemmy-ui" + mkdir -p "$install_dir/lemmy-ui/" + rsync -a "$install_dir/build-lemmy-ui/output/app/" "$install_dir/lemmy-ui/" +#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy-ui" # Install lemmy - pushd $final_path/build-lemmy + pushd $install_dir/build-lemmy ./docker-image-extract dessalines/lemmy:$(ynh_app_upstream_version) popd - mkdir -p "$final_path/lemmy/" - mv -f "$final_path/build-lemmy/output/app/lemmy" "$final_path/lemmy/lemmy" - ynh_secure_remove --file="$final_path/build-lemmy" + mkdir -p "$install_dir/lemmy/" + mv -f "$install_dir/build-lemmy/output/app/lemmy" "$install_dir/lemmy/lemmy" +#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy" fi -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:$app "$install_dir" #================================================= # UPDATE A CONFIG FILE #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -mkdir -p "$final_path/lemmy/" -ynh_add_config --template="../conf/lemmy.hjson" --destination="$final_path/config/config.hjson" +mkdir -p "$install_dir/lemmy/" +ynh_add_config --template="../conf/lemmy.hjson" --destination="$install_dir/config/config.hjson" -chmod 400 "$final_path/config/config.hjson" -chown $app:$app "$final_path/config/config.hjson" +chmod 400 "$install_dir/config/config.hjson" +chown $app:$app "$install_dir/config/config.hjson" #================================================= # CREATE EXTENSION IF NOT EXISTS pgcrypto @@ -225,9 +225,9 @@ ynh_systemd_action --service_name=$app-ui --action="start" --line_match="http:// #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -ynh_systemd_action --service_name=nginx --action=reload +#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 5e53b148ab9eab29a237afcf97d64dc70bf76817 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 26 May 2023 14:42:31 +0000 Subject: [PATCH 02/14] Auto-update README --- README.md | 4 ++-- README_fr.md | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5a4fe84..befb88b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Lemmy for YunoHost -[![Integration level](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Working status](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Working status](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg) + [![Install Lemmy with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy) *[Lire ce readme en français.](./README_fr.md)* @@ -20,7 +21,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in **Shipped version:** 0.16.7~ynh1 - **Demo:** https://lemmy.ml/ ## Screenshots diff --git a/README_fr.md b/README_fr.md index 0d70934..0d4d1e4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,27 +5,27 @@ It shall NOT be edited by hand. # Lemmy pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/lemmy.svg)](https://dash.yunohost.org/appci/app/lemmy) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/lemmy.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/lemmy.maintain.svg) + [![Installer Lemmy avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=lemmy) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Lemmy rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer Lemmy rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble [Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse). -**Version incluse :** 0.16.7~ynh1 - +**Version incluse :** 0.16.7~ynh1 **Démo :** https://lemmy.ml/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de Lemmy](./doc/screenshots/screenshot1.webp) +![Capture d’écran de Lemmy](./doc/screenshots/screenshot1.webp) ## Avertissements / informations importantes @@ -34,9 +34,9 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -52,4 +52,4 @@ ou sudo yunohost app upgrade lemmy -u https://github.com/YunoHost-Apps/lemmy_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file From c5d6a3d37776273c19f3ad6c2a523a4605429945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 16:48:51 +0200 Subject: [PATCH 03/14] v2 --- manifest.json | 38 ---------------- manifest.toml | 25 ++++++----- scripts/_common.sh | 6 --- scripts/backup | 22 ---------- scripts/install | 107 ++------------------------------------------- scripts/remove | 53 +--------------------- scripts/restore | 51 +-------------------- scripts/upgrade | 64 ++------------------------- tests.toml | 10 +++++ 9 files changed, 35 insertions(+), 341 deletions(-) delete mode 100644 manifest.json create mode 100644 tests.toml diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 7a9cffe..0000000 --- a/manifest.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "Lemmy", - "id": "lemmy", - "packaging_format": 1, - "description": { - "en": "Link aggregator/Reddit clone for the fediverse", - "fr": "Agrégateur de liens/clone Reddit pour le fedivers" - }, - "version": "0.16.7~ynh1", - "url": "https://join.lemmy.ml/", - "upstream": { - "license": "GPL-3.0", - "website": "https://join-lemmy.org/", - "demo": "https://lemmy.ml/", - "admindoc": "https://join-lemmy.org/docs/en/", - "code": "https://github.com/LemmyNet/lemmy" - }, - "license": "GPL-3.0", - "maintainer": { - "name": "", - "email": "" - }, - "requirements": { - "yunohost": ">= 4.3.0" - }, - "multi_instance": false, - "services": [ - "nginx" - ], - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - } - ] - } -} diff --git a/manifest.toml b/manifest.toml index 73a58cb..1fe9f5f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -15,21 +15,18 @@ website = "https://join-lemmy.org/" demo = "https://lemmy.ml/" admindoc = "https://join-lemmy.org/docs/en/" code = "https://github.com/LemmyNet/lemmy" -cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number) -fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin. [integration] -yunohost = ">= 4.3.0" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"] +yunohost = ">= 11.1.19" +architectures = "all" multi_instance = false -ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials. -sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal. -disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ... -ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... -ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ... +ldap = false +sso = false +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" full_domain = true @@ -43,15 +40,23 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen url = "https://codeload.github.com/LemmyNet/lemmy-translations/tar.gz/00e4efbef6c3ac34cd2f5f444a95eddce9ec12d7" sha256 = "0587c1867c785e6d229d1519a37fc9a280e78f356d919f868f21a896abddff71" +#REMOVEME? port_lemmy=$(ynh_find_port --port=8536) +#REMOVEME? ynh_app_setting_set --app=$app --key=port_lemmy --value=$port_lemmy +#REMOVEME? port_ui=$(ynh_find_port --port=1235) +#REMOVEME? ynh_app_setting_set --app=$app --key=port_ui --value=$port_ui [resources.system_user] [resources.install_dir] [resources.data_dir] + subdirs = ["pictrs-data"] [resources.permissions] main.url = "/" + [resources.apt] + packages = "postgresql espeak" + [resources.database] type = "postgresql" diff --git a/scripts/_common.sh b/scripts/_common.sh index fb32dc3..12c8c01 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,12 +4,6 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -#REMOVEME? lemmy_dependencies="postgresql postgresql-contrib" -#REMOVEME? lemmyui_dependencies="espeak" - -#REMOVEME? pkg_dependencies="$lemmy_dependencies $lemmyui_dependencies" - NODEJS_VERSION=12 #================================================= diff --git a/scripts/backup b/scripts/backup index 99e0831..e0ee696 100755 --- a/scripts/backup +++ b/scripts/backup @@ -10,28 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_print_info --message="Loading installation settings..." - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= diff --git a/scripts/install b/scripts/install index 3e9033c..1c533ac 100755 --- a/scripts/install +++ b/scripts/install @@ -9,87 +9,21 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -path="/" - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= -#REMOVEME? ynh_script_progression --message="Validating installation parameters..." --weight=1 - -#REMOVEME? install_dir=/var/www/$app -#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder" - -# Register (book) web path -#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -#REMOVEME? ynh_script_progression --message="Storing installation settings..." --weight=1 - -#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path - -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port_lemmy=$(ynh_find_port --port=8536) -#REMOVEME? ynh_app_setting_set --app=$app --key=port_lemmy --value=$port_lemmy -#REMOVEME? port_ui=$(ynh_find_port --port=1235) -#REMOVEME? ynh_app_setting_set --app=$app --key=port_ui --value=$port_ui - #================================================= # INSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=1 +ynh_script_progression --message="Installing dependencies..." --weight=1 -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ln -fs /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" #================================================= # CREATE A POSTGRESQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 +ynh_script_progression --message="Creating a PostgreSQL database..." --weight=1 -#REMOVEME? ynh_psql_test_if_first_run -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? db_pwd=$(ynh_string_random --length=30) -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd -#REMOVEME? ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --database="$db_name" #================================================= @@ -97,13 +31,11 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --data #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 -#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir/build-lemmy/" --source_id="docker-image-extract" ynh_setup_source --dest_dir="$install_dir/build-lemmy-ui/" --source_id="docker-image-extract" ynh_setup_source --dest_dir="$install_dir/lemmy-ui/lemmy-translations/" --source_id="lemmy-translations" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -115,22 +47,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SPECIFIC SETUP -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." --weight=1 - -#REMOVEME? data_dir=/home/yunohost.app/$app -#REMOVEME? ynh_app_setting_set --app=$app --key=data_dir --value=$data_dir - -mkdir -p $data_dir/pictrs-data - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:$app "$data_dir" - #================================================= # MAKE INSTALL #================================================= @@ -142,7 +58,7 @@ pushd $install_dir/build-lemmy-ui popd mkdir -p "$install_dir/lemmy-ui/" rsync -a "$install_dir/build-lemmy-ui/output/app/" "$install_dir/lemmy-ui/" -#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy-ui" +ynh_secure_remove --file="$install_dir/build-lemmy-ui" # Install lemmy pushd $install_dir/build-lemmy @@ -150,7 +66,7 @@ pushd $install_dir/build-lemmy popd mkdir -p "$install_dir/lemmy/" mv -f "$install_dir/build-lemmy/output/app/lemmy" "$install_dir/lemmy/lemmy" -#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy" +ynh_secure_remove --file="$install_dir/build-lemmy" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" @@ -208,21 +124,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --line_match="Starting http server at" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app-ui --action="start" --line_match="http://0.0.0.0" --log_path="/var/log/$app/$app-ui.log" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" - -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 15b4863..4d8e799 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,19 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # STANDARD REMOVE #================================================= @@ -57,33 +44,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight= # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE THE POSTGRESQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the PostgreSQL database..." --weight=1 - -# Remove a database if it exists, along with the associated user -#REMOVEME? ynh_psql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=1 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." --weight=1 -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -95,11 +55,10 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1 +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_nodejs -#REMOVEME? ynh_remove_app_dependencies ynh_secure_remove --file="/lib/libc.musl-x86_64.so.1" #================================================= @@ -112,16 +71,6 @@ ynh_script_progression --message="Removing various files..." --weight=1 # Remove the log files ynh_secure_remove --file="/var/log/$app" -#================================================= -# GENERIC FINALIZATION -#================================================= -# REMOVE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..." --weight=1 - -# Delete a system user -#REMOVEME? ynh_system_user_delete --username=$app - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 9693a5f..8b14a8d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -10,49 +10,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#REMOVEME? ynh_clean_setup () { - true -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - -#================================================= -# CHECK IF THE APP CAN BE RESTORED -#================================================= -#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=1 - -#REMOVEME? test ! -d $install_dir \ - || ynh_die --message="There is already a directory: $install_dir " - -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -60,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" @@ -71,10 +27,6 @@ ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_restore_file --origin_path="$data_dir" --not_mandatory -mkdir -p $data_dir - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" chown -R $app:$app "$data_dir" #================================================= @@ -82,10 +34,9 @@ chown -R $app:$app "$data_dir" #================================================= # REINSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ln -fs /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 diff --git a/scripts/upgrade b/scripts/upgrade index b7f91bb..692b23c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,45 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# LOAD SETTINGS -#================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=1 - -#REMOVEME? app=$YNH_APP_INSTANCE_NAME - -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#REMOVEME? db_user=$db_name -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) -#REMOVEME? port_lemmy=$(ynh_app_setting_get --app=$app --key=port_lemmy) -#REMOVEME? port_ui=$(ynh_app_setting_get --app=$app --key=port_ui) - #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." --weight=1 upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -63,13 +30,6 @@ ynh_systemd_action --service_name=$app-ui --action="stop" --line_match="Stopped" #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Cleaning legacy permissions -#REMOVEME? if ynh_legacy_permissions_exists; then -#REMOVEME? ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - # Removing previously installed iframely if ynh_exec_warn_less yunohost service status $app-iframely >/dev/null then @@ -87,17 +47,9 @@ then yunohost service remove $app-pict-rs fi ynh_remove_systemd_config --service=$app-pict-rs -#REMOVEME? ynh_secure_remove --file="$install_dir/pict-rs" +ynh_secure_remove --file="$install_dir/pict-rs" ynh_app_setting_delete --app=$app --key=port_pictrs -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -119,9 +71,8 @@ chown -R $app:$app "$install_dir" #================================================= # UPGRADE DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=1 +ynh_script_progression --message="Upgrading dependencies..." --weight=1 -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_use_nodejs ln -fs /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1 @@ -149,7 +100,7 @@ then popd mkdir -p "$install_dir/lemmy-ui/" rsync -a "$install_dir/build-lemmy-ui/output/app/" "$install_dir/lemmy-ui/" -#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy-ui" + ynh_secure_remove --file="$install_dir/build-lemmy-ui" # Install lemmy pushd $install_dir/build-lemmy @@ -157,7 +108,7 @@ then popd mkdir -p "$install_dir/lemmy/" mv -f "$install_dir/build-lemmy/output/app/lemmy" "$install_dir/lemmy/lemmy" -#REMOVEME? ynh_secure_remove --file="$install_dir/build-lemmy" + ynh_secure_remove --file="$install_dir/build-lemmy" fi chmod 750 "$install_dir" @@ -222,13 +173,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --line_match="Starting http server at" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$app-ui --action="start" --line_match="http://0.0.0.0" --log_path="/var/log/$app/$app-ui.log" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..46ebf94 --- /dev/null +++ b/tests.toml @@ -0,0 +1,10 @@ +test_format = 1.0 + +[default] + + # ------------------------------- + # Default args to use for install + # ------------------------------- + + args.admin = "john" + args.sitename = "lemmy website" \ No newline at end of file From 56592df437e5a75cd19d4657981a826b10dacc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 16:54:23 +0200 Subject: [PATCH 04/14] v2 --- .github/workflows/updater.sh | 66 ----------------------------------- .github/workflows/updater.yml | 49 -------------------------- conf/lemmy-ui.service | 2 +- conf/lemmy.hjson | 2 +- conf/nginx.conf | 6 ++-- doc/DESCRIPTION.md | 2 +- doc/DISCLAIMER.md | 2 -- manifest.toml | 7 ++-- 8 files changed, 9 insertions(+), 127 deletions(-) delete mode 100644 .github/workflows/updater.sh delete mode 100644 .github/workflows/updater.yml delete mode 100644 doc/DISCLAIMER.md diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh deleted file mode 100644 index 1aeb2f1..0000000 --- a/.github/workflows/updater.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -#================================================= -# PACKAGE UPDATING HELPER -#================================================= - -# This script is meant to be run by GitHub Actions -# The YunoHost-Apps organisation offers a template Action to run this script periodically -# Since each app is different, maintainers can adapt its contents so as to perform -# automatic actions when a new upstream release is detected. - -#================================================= -# FETCHING LATEST RELEASE AND ITS ASSETS -#================================================= - -# Fetching information -current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') -repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .tag_name | contains("v") | not ) | .tag_name' | sort -V | tail -1) - -# Later down the script, we assume the version has only digits and dots -# Sometimes the release name starts with a "v", so let's filter it out. -# You may need more tweaks here if the upstream repository has different naming conventions. -if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then - version=${version:1} -fi - -# Setting up the environment variables -echo "Current version: $current_version" -echo "Latest release from upstream: $version" -echo "VERSION=$version" >> $GITHUB_ENV -echo "REPO=$repo" >> $GITHUB_ENV -# For the time being, let's assume the script will fail -echo "PROCEED=false" >> $GITHUB_ENV - -# Proceed only if the retrieved version is greater than the current one -if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then - echo "::warning ::No new version available" - exit 0 -# Proceed only if a PR for this new version does not already exist -elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then - echo "::warning ::A branch already exists for this update" - exit 0 -fi - -#================================================= -# SPECIFIC UPDATE STEPS -#================================================= - -# Any action on the app's source code can be done. -# The GitHub Action workflow takes care of committing all changes after this script ends. - -#================================================= -# GENERIC FINALIZATION -#================================================= - -# Replace new version in manifest -echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json - -# No need to update the README, yunohost-bot takes care of it - -# The Action will proceed only if the PROCEED environment variable is set to true -echo "PROCEED=true" >> $GITHUB_ENV -exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml deleted file mode 100644 index fb72ba0..0000000 --- a/.github/workflows/updater.yml +++ /dev/null @@ -1,49 +0,0 @@ -# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. -# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. -# This file should be enough by itself, but feel free to tune it to your needs. -# It calls updater.sh, which is where you should put the app-specific update steps. -name: Check for new upstream releases -on: - # Allow to manually trigger the workflow - workflow_dispatch: - # Run it every day at 6:00 UTC - schedule: - - cron: '0 6 * * *' -jobs: - updater: - runs-on: ubuntu-latest - steps: - - name: Fetch the source code - uses: actions/checkout@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run the updater script - id: run_updater - run: | - # Setting up Git user - git config --global user.name 'yunohost-bot' - git config --global user.email 'yunohost-bot@users.noreply.github.com' - # Run the updater script - /bin/bash .github/workflows/updater.sh - - name: Commit changes - id: commit - if: ${{ env.PROCEED == 'true' }} - run: | - git commit -am "Upgrade to v$VERSION" - - name: Create Pull Request - id: cpr - if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: Update to version ${{ env.VERSION }} - committer: 'yunohost-bot ' - author: 'yunohost-bot ' - signoff: false - base: testing - branch: ci-auto-update-v${{ env.VERSION }} - delete-branch: true - title: 'Upgrade to version ${{ env.VERSION }}' - body: | - Upgrade to v${{ env.VERSION }} - draft: false diff --git a/conf/lemmy-ui.service b/conf/lemmy-ui.service index 3fdf846..2d176a3 100644 --- a/conf/lemmy-ui.service +++ b/conf/lemmy-ui.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -Environment="LEMMY_INTERNAL_HOST=127.0.0.1:__PORT_LEMMY__" +Environment="LEMMY_INTERNAL_HOST=127.0.0.1:__PORT__" Environment="LEMMY_EXTERNAL_HOST=__DOMAIN__" Environment="LEMMY_HTTPS=true" Environment="LEMMY_UI_HOST=0.0.0.0:__PORT_UI__" diff --git a/conf/lemmy.hjson b/conf/lemmy.hjson index 6e2ddcf..6923310 100644 --- a/conf/lemmy.hjson +++ b/conf/lemmy.hjson @@ -84,7 +84,7 @@ # Address where lemmy should listen for incoming requests bind: "0.0.0.0" # Port where lemmy should listen for incoming requests - port: __PORT_LEMMY__ + port: __PORT__ # Whether the site is available over TLS. Needs to be true for federation to work. tls_enabled: true # Address where pictrs is available (for image hosting) diff --git a/conf/nginx.conf b/conf/nginx.conf index 219df32..1ec7d21 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -20,10 +20,10 @@ location / { set $proxpass "http://127.0.0.1:__PORT_UI__"; if ($http_accept ~ "^application/.*$") { - set $proxpass "http://127.0.0.1:__PORT_LEMMY__"; + set $proxpass "http://127.0.0.1:__PORT__"; } if ($request_method = POST) { - set $proxpass "http://127.0.0.1:__PORT_LEMMY__"; + set $proxpass "http://127.0.0.1:__PORT__"; } proxy_pass $proxpass; @@ -37,7 +37,7 @@ location / { # backend location ~ ^/(api|pictrs|feeds|nodeinfo|.well-known) { - proxy_pass http://127.0.0.1:__PORT_LEMMY__; + proxy_pass http://127.0.0.1:__PORT__; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 0fe3cc8..0c98e9b 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1 @@ -[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse). +Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md deleted file mode 100644 index ff56e98..0000000 --- a/doc/DISCLAIMER.md +++ /dev/null @@ -1,2 +0,0 @@ -* Lemmy require full domain path to be installed. Eg. lemmy.domain.tld -* pict-rs image hosting service has been removed, it caused too much issue during compilation diff --git a/manifest.toml b/manifest.toml index 1fe9f5f..f8c8b7f 100644 --- a/manifest.toml +++ b/manifest.toml @@ -40,10 +40,9 @@ ram.runtime = "50M" url = "https://codeload.github.com/LemmyNet/lemmy-translations/tar.gz/00e4efbef6c3ac34cd2f5f444a95eddce9ec12d7" sha256 = "0587c1867c785e6d229d1519a37fc9a280e78f356d919f868f21a896abddff71" -#REMOVEME? port_lemmy=$(ynh_find_port --port=8536) -#REMOVEME? ynh_app_setting_set --app=$app --key=port_lemmy --value=$port_lemmy -#REMOVEME? port_ui=$(ynh_find_port --port=1235) -#REMOVEME? ynh_app_setting_set --app=$app --key=port_ui --value=$port_ui + [resources.ports] + main.default = 8536 + ui.default = 8537 [resources.system_user] From e84cd38cd653e9f82843e130f3b9e35675c23e02 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 26 May 2023 14:54:27 +0000 Subject: [PATCH 05/14] Auto-update README --- README.md | 7 +------ README_fr.md | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index befb88b..fcc2648 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse). +Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse. **Shipped version:** 0.16.7~ynh1 @@ -27,11 +27,6 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ![Screenshot of Lemmy](./doc/screenshots/screenshot1.webp) -## Disclaimers / important information - -* Lemmy require full domain path to be installed. Eg. lemmy.domain.tld -* pict-rs image hosting service has been removed, it caused too much issue during compilation - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 0d4d1e4..a5565f9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,7 +16,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ## Vue d’ensemble -[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse). +Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse. **Version incluse :** 0.16.7~ynh1 @@ -27,11 +27,6 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po ![Capture d’écran de Lemmy](./doc/screenshots/screenshot1.webp) -## Avertissements / informations importantes - -* Lemmy require full domain path to be installed. Eg. lemmy.domain.tld -* pict-rs image hosting service has been removed, it caused too much issue during compilation - ## Documentations et ressources * Site officiel de l’app : From 0c76c791618d8f496cddd1a12805bd1ff9759b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 17:01:30 +0200 Subject: [PATCH 06/14] Update restore --- scripts/restore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/restore b/scripts/restore index 8b14a8d..10048d1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -51,10 +51,8 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 +ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -#REMOVEME? ynh_psql_test_if_first_run -#REMOVEME? ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --database="$db_name" From 7ca7f9eb2dbf1b137d214a60aecabf75f83917c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 17:12:12 +0200 Subject: [PATCH 07/14] fix --- manifest.toml | 8 ++++---- scripts/_common.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.toml b/manifest.toml index f8c8b7f..ca10134 100644 --- a/manifest.toml +++ b/manifest.toml @@ -33,12 +33,12 @@ ram.runtime = "50M" [resources] [resources.sources] [resources.sources.docker-image-extract] - url = "https://codeload.github.com/jjlin/docker-image-extract/tar.gz/a9e455e44bbbfba897bf3342d9661b182cee67a9" - sha256 = "9eb0c734e83a3fd7102fc7209af4977024ec467fbc819782491af47295675f67" + url = "https://codeload.github.com/jjlin/docker-image-extract/tar.gz/b664b29a1de37d25f732e885e1331a8e90f67dcd" + sha256 = "7b2c8baeec6e9a67c905d4d55e4dc0944815cf55bd6bf11fadbb6eb8990b4912" [resources.sources.lemmy-translations] - url = "https://codeload.github.com/LemmyNet/lemmy-translations/tar.gz/00e4efbef6c3ac34cd2f5f444a95eddce9ec12d7" - sha256 = "0587c1867c785e6d229d1519a37fc9a280e78f356d919f868f21a896abddff71" + url = "https://codeload.github.com/LemmyNet/lemmy-translations/tar.gz/ddf0d3a4dcfba5eddbcdb702db2470b52abb3815" + sha256 = "7df72cdba8a6c23c9dca528d3fd71dce13f5263b7a59c8512253364d94797757" [resources.ports] main.default = 8536 diff --git a/scripts/_common.sh b/scripts/_common.sh index 12c8c01..702e69f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -NODEJS_VERSION=12 +NODEJS_VERSION=18 #================================================= # PERSONAL HELPERS From 0602e291572481c5c0acc2e753ecf17019df10de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 17:16:13 +0200 Subject: [PATCH 08/14] Create change_url --- scripts/change_url | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 scripts/change_url diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..f6b925a --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,54 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# STANDARD MODIFICATIONS +#================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="stop" --line_match="Stopped" --log_path=systemd +ynh_systemd_action --service_name=$app-ui --action="stop" --line_match="Stopped" --log_path=systemd + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 + +ynh_change_url_nginx_config + +#================================================= +# ADD A CONFIGURATION +#================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +mkdir -p "$install_dir/config/" +ynh_add_config --template="../conf/lemmy.hjson" --destination="$install_dir/config/config.hjson" + +chmod 400 "$install_dir/config/config.hjson" +chown $app:$app "$install_dir/config/config.hjson" + +#================================================= +# GENERIC FINALISATION +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --line_match="Starting http server at" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app-ui --action="start" --line_match="http://0.0.0.0" --log_path="/var/log/$app/$app-ui.log" + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last From 6980546028bb5953c384e4dedc32dd4eca072445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 17:19:20 +0200 Subject: [PATCH 09/14] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index ca10134..7805499 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,7 +23,7 @@ multi_instance = false ldap = false sso = false disk = "50M" -ram.build = "50M" +ram.build = "100M" ram.runtime = "50M" [install.domain] From 2d526fbe6a7de9519031b5e0895d0a155379756c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 17:21:28 +0200 Subject: [PATCH 10/14] cleaning --- check_process | 27 --------------------------- tests.toml | 9 ++++++++- 2 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 check_process diff --git a/check_process b/check_process deleted file mode 100644 index 3fe9751..0000000 --- a/check_process +++ /dev/null @@ -1,27 +0,0 @@ -;; Test complet - ; Manifest - domain="domain.tld" - path="/" - admin="john" - sitename="lemmy website" - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=0 - setup_public=1 - upgrade=1 - # 0.15.2~ynh3 - upgrade=1 from_commit=206df4db0b99c52f07ea1a2d5daf799d4b8357fd - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=0 -;;; Options -Email= -Notification=none -;;; Upgrade options - ; commit=206df4db0b99c52f07ea1a2d5daf799d4b8357fd - name=0.15.2~ynh3 - manifest_arg=domain=DOMAIN&admin=USER&sitename=lemmy_website& diff --git a/tests.toml b/tests.toml index 46ebf94..524d6d3 100644 --- a/tests.toml +++ b/tests.toml @@ -7,4 +7,11 @@ test_format = 1.0 # ------------------------------- args.admin = "john" - args.sitename = "lemmy website" \ No newline at end of file + args.sitename = "lemmy website" + + + # ------------------------------- + # Commits to test upgrade from + # ------------------------------- + + test_upgrade_from.206df4db0b99c52f07ea1a2d5daf799d4b8357fd.name = "Upgrade from 0.15.2~ynh3" \ No newline at end of file From 305a3d677b6ced3b221a9d99523241ebe2a67c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 26 May 2023 17:48:35 +0200 Subject: [PATCH 11/14] cleaning --- conf/lemmy-ui.service | 2 +- conf/lemmy.service | 2 +- manifest.toml | 2 +- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf/lemmy-ui.service b/conf/lemmy-ui.service index 2d176a3..0b0c0c6 100644 --- a/conf/lemmy-ui.service +++ b/conf/lemmy-ui.service @@ -1,5 +1,5 @@ [Unit] -Description=__APP__ UI Daemon +Description=Lemmy: UI Daemon After=network.target [Service] diff --git a/conf/lemmy.service b/conf/lemmy.service index 8806833..5e2a223 100644 --- a/conf/lemmy.service +++ b/conf/lemmy.service @@ -1,5 +1,5 @@ [Unit] -Description=__APP__ Daemon +Description=Lemmy: Link aggregator After=network.target [Service] diff --git a/manifest.toml b/manifest.toml index f8c8b7f..4bb2e97 100644 --- a/manifest.toml +++ b/manifest.toml @@ -32,7 +32,7 @@ ram.runtime = "50M" [resources] [resources.sources] - [resources.sources.docker-image-extract] + [resources.sources.main] url = "https://codeload.github.com/jjlin/docker-image-extract/tar.gz/a9e455e44bbbfba897bf3342d9661b182cee67a9" sha256 = "9eb0c734e83a3fd7102fc7209af4977024ec467fbc819782491af47295675f67" diff --git a/scripts/install b/scripts/install index 1c533ac..e4dab13 100755 --- a/scripts/install +++ b/scripts/install @@ -32,8 +32,8 @@ ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pgcrypto;" --data ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir/build-lemmy/" --source_id="docker-image-extract" -ynh_setup_source --dest_dir="$install_dir/build-lemmy-ui/" --source_id="docker-image-extract" +ynh_setup_source --dest_dir="$install_dir/build-lemmy/" +ynh_setup_source --dest_dir="$install_dir/build-lemmy-ui/" ynh_setup_source --dest_dir="$install_dir/lemmy-ui/lemmy-translations/" --source_id="lemmy-translations" chmod -R o-rwx "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 692b23c..06a9d25 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,8 +59,8 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress the source of lemmy from app.src to his build directory - ynh_setup_source --dest_dir="$install_dir/build-lemmy/" --source_id="docker-image-extract" - ynh_setup_source --dest_dir="$install_dir/build-lemmy-ui/" --source_id="docker-image-extract" + ynh_setup_source --dest_dir="$install_dir/build-lemmy/" + ynh_setup_source --dest_dir="$install_dir/build-lemmy-ui/" ynh_setup_source --dest_dir="$install_dir/lemmy-ui/lemmy-translations/" --source_id="lemmy-translations" fi From bdfda023c3f312ebdb35faa5379135e45b576906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 11 Jun 2023 17:01:26 +0200 Subject: [PATCH 12/14] Update manifest.toml --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index cf414d3..86ed432 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Lemmy" description.en = "Link aggregator/Reddit clone for the fediverse" description.fr = "Agrégateur de liens/clone Reddit pour le fedivers" -version = "0.16.7~ynh1" +version = "0.16.7~ynh2" maintainers = [] @@ -17,7 +17,7 @@ admindoc = "https://join-lemmy.org/docs/en/" code = "https://github.com/LemmyNet/lemmy" [integration] -yunohost = ">= 11.1.19" +yunohost = ">= 11.1.20" architectures = "all" multi_instance = false ldap = false From 48a22a66fa3d4814ee8fdf52dbcd1b85b714c34a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 11 Jun 2023 15:01:31 +0000 Subject: [PATCH 13/14] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcc2648..d4a1ddf 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse. -**Shipped version:** 0.16.7~ynh1 +**Shipped version:** 0.16.7~ynh2 **Demo:** https://lemmy.ml/ diff --git a/README_fr.md b/README_fr.md index a5565f9..859ae42 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) po Lemmy is similar to sites like Reddit, Lobste.rs, or Hacker News: you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the Fediverse. -**Version incluse :** 0.16.7~ynh1 +**Version incluse :** 0.16.7~ynh2 **Démo :** https://lemmy.ml/ From 7ed80a03602ac008240481526c91a9c1475d721f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 11 Jun 2023 17:25:52 +0200 Subject: [PATCH 14/14] Update manifest.toml --- manifest.toml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 86ed432..b19ece2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -34,12 +34,16 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://codeload.github.com/jjlin/docker-image-extract/tar.gz/a9e455e44bbbfba897bf3342d9661b182cee67a9" - sha256 = "9eb0c734e83a3fd7102fc7209af4977024ec467fbc819782491af47295675f67" + url = "https://github.com/jjlin/docker-image-extract/archive/b664b29a1de37d25f732e885e1331a8e90f67dcd.tar.gz" + sha256 = "7b2c8baeec6e9a67c905d4d55e4dc0944815cf55bd6bf11fadbb6eb8990b4912" + autoupdate.upstream = "https://github.com/jjlin/docker-image-extract" + autoupdate.strategy = "latest_github_commit" [resources.sources.lemmy-translations] - url = "https://codeload.github.com/LemmyNet/lemmy-translations/tar.gz/ddf0d3a4dcfba5eddbcdb702db2470b52abb3815" - sha256 = "7df72cdba8a6c23c9dca528d3fd71dce13f5263b7a59c8512253364d94797757" + url = "https://github.com/LemmyNet/lemmy-translations/archive/f45ddff206adb52ab0ac7555bf14978edac5d2f2.tar.gz" + sha256 = "4d91ed10bceba5de04a870ac7086e1fab383634eefae8afeefa500c9fe2627db" + autoupdate.upstream = "https://github.com/LemmyNet/lemmy-translations/" + autoupdate.strategy = "latest_github_commit" [resources.ports] main.default = 8536