From c19dbe391092735372cb7468664f9d934e2957ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:02:19 +0100 Subject: [PATCH 01/21] v2 --- conf/app.ini | 14 +++---- conf/systemd.service | 6 +-- manifest.toml | 62 ++++++++++++++++++++++++++++ scripts/backup | 18 ++++----- scripts/install | 96 ++++++++++++++++++++++---------------------- scripts/remove | 30 +++++++------- scripts/restore | 52 ++++++++++++------------ scripts/upgrade | 48 +++++++++++----------- 8 files changed, 194 insertions(+), 132 deletions(-) create mode 100644 manifest.toml diff --git a/conf/app.ini b/conf/app.ini index b50dd07..9378a20 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -46,7 +46,7 @@ DISABLE_ROUTER_LOG = true ENABLE_GZIP = false ; The path for storing application specific data. -APP_DATA_PATH = __DATADIR__/data +APP_DATA_PATH = __DATA_DIR__/data ; Whether to enable to load assets (i.e. "conf", "templates", "public") from disk instead of embedded bindata. LOAD_ASSETS_FROM_DISK = false @@ -91,7 +91,7 @@ DSA = 1024 [repository] ; The root path for storing managed repositories, default is "~/gogs-repositories" -ROOT = __DATADIR__/repositories +ROOT = __DATA_DIR__/repositories ; The script type server supports, sometimes could be "sh". SCRIPT_TYPE = bash ; Default ANSI charset for an unrecognized charset. @@ -126,7 +126,7 @@ PREVIEWABLE_FILE_MODES = markdown ; Whether to enable repository file uploads. ENABLED = true ; The path to temporarily store uploads (content under this path gets wiped out on every start). -TEMP_PATH = __DATADIR__/data/tmp/uploads +TEMP_PATH = __DATA_DIR__/data/tmp/uploads ; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type. ALLOWED_TYPES = ; The maximum size of each file in MB. @@ -267,13 +267,13 @@ ACCESS_CONTROL_ALLOW_ORIGIN = ; The storage backend for uploading new objects. STORAGE = local ; The root path to store LFS objects on local file system. -OBJECTS_PATH = __DATADIR__/data/lfs-objects +OBJECTS_PATH = __DATA_DIR__/data/lfs-objects [attachment] ; Whether to enabled upload attachments in general. ENABLED = true ; The path to store attachments on the file system. -PATH = __DATADIR__/data/attachments +PATH = __DATA_DIR__/data/attachments ; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type. ALLOWED_TYPES = image/jpeg|image/png ; The maximum size of each file in MB. @@ -300,9 +300,9 @@ FORMAT = RFC1123 [picture] ; The path to store user avatars on the file system. -AVATAR_UPLOAD_PATH = __DATADIR__/data/avatars +AVATAR_UPLOAD_PATH = __DATA_DIR__/data/avatars ; The path to store repository avatars on the file system. -REPOSITORY_AVATAR_UPLOAD_PATH = __DATADIR__/data/repo-avatars +REPOSITORY_AVATAR_UPLOAD_PATH = __DATA_DIR__/data/repo-avatars ; Chinese users can use a custom avatar source, such as http://cn.gravatar.com/avatar/. GRAVATAR_SOURCE = gravatar ; Whether to disable Gravatar, this value will be forced to be true in offline mode. diff --git a/conf/systemd.service b/conf/systemd.service index f277cdc..2674594 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,10 +6,10 @@ After=syslog.target network.target mysql.service slapd.service redis.service Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__DATADIR__ -ExecStart=__FINALPATH__/gogs web +WorkingDirectory=__DATA_DIR__ +ExecStart=__INSTALL_DIR__/gogs web Restart=always -Environment=USER=__APP__ HOME=__DATADIR__ +Environment=USER=__APP__ HOME=__DATA_DIR__ [Install] WantedBy=multi-user.target diff --git a/manifest.toml b/manifest.toml new file mode 100644 index 0000000..d2caeea --- /dev/null +++ b/manifest.toml @@ -0,0 +1,62 @@ +packaging_format = 2 + +id = "gogs" +name = "Gogs" +description.en = "Lightweight self-hosted Git forge" +description.fr = "Forge Git légère auto-hébergé" + +version = "0.12.10~ynh1" + +maintainers = [] + +[upstream] +license = "MIT" +website = "http://gogs.io" +demo = "https://try.gogs.io/user/login" +admindoc = "https://gogs.io/docs" +code = "https://github.com/gogs/gogs" +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 = ">= 11.0.9" +architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64/armel), for example: ["amd64", "i386"] +multi_instance = true +ldap = "?" # FIXME: replace with true, false, or "not_relevant" +sso = "?" # FIXME: replace with true, false, or "not_relevant" +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] + [install.domain] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "domain" + + [install.path] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "path" + default = "/gogs" + + [install.admin] + # this is a generic question - ask strings are automatically handled by Yunohost's core + type = "user" + + [install.init_main_permission] + help.en = "If enabled, Gogs will be accessible by people who do not have an account. This can be changed later via the webadmin." + help.fr = "Si cette case est cochée, Gogs sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + type = "group" + default = "visitors" + +[resources] + [resources.system_user] + + [resources.install_dir] + + [resources.data_dir] + + [resources.permissions] + main.url = "/" + + [resources.database] + type = "mysql" diff --git a/scripts/backup b/scripts/backup index dc499f5..0890f04 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,19 +13,19 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -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 @@ -36,13 +36,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 451e477..bb4f641 100644 --- a/scripts/install +++ b/scripts/install @@ -14,40 +14,40 @@ source /usr/share/yunohost/helpers #================================================= # 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 #================================================= # Retrieve arguments -domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH -admin=$YNH_APP_ARG_ADMIN -is_public=$YNH_APP_ARG_IS_PUBLIC +#REMOVEME? domain=$YNH_APP_ARG_DOMAIN +#REMOVEME? path=$YNH_APP_ARG_PATH +#REMOVEME? admin=$YNH_APP_ARG_ADMIN +#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC key=$(ynh_string_random) -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=admin --value=$admin -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=admin --value=$admin +#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=key --value=$key #================================================= @@ -55,42 +55,42 @@ ynh_app_setting_set --app=$app --key=key --value=$key #================================================= # 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=$(ynh_find_port --port=6000) -ynh_app_setting_set --app=$app --key=port --value=$port +#REMOVEME? port=$(ynh_find_port --port=6000) +#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --weight=3 +#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=3 -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) +#REMOVEME? db_user=$db_name +#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # 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 #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -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 --source_id=$YNH_ARCH +ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # NGINX CONFIGURATION @@ -105,39 +105,39 @@ 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 +mkdir -p $data_dir # create needed directories -mkdir -p "$final_path/custom/conf/auth.d" -mkdir -p "$datadir/data/repositories" -mkdir -p "$datadir/data/avatars" -mkdir -p "$datadir/data/attachments" +mkdir -p "$install_dir/custom/conf/auth.d" +mkdir -p "$data_dir/data/repositories" +mkdir -p "$data_dir/data/avatars" +mkdir -p "$data_dir/data/attachments" -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -if [ "$path_url" = "/" ] +if [ "$path" = "/" ] then url="$domain" else - url="$domain${path_url%/}" + url="$domain${path%/}" fi -ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini" +ynh_add_config --template="../conf/app.ini" --destination="$install_dir/custom/conf/app.ini" -chmod 400 "$final_path/custom/conf/app.ini" -chown $app:$app "$final_path/custom/conf/app.ini" +chmod 400 "$install_dir/custom/conf/app.ini" +chown $app:$app "$install_dir/custom/conf/app.ini" -ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" +ynh_add_config --template="../conf/ldap.conf" --destination="$install_dir/custom/conf/auth.d/ldap.conf" #================================================= # SETUP SYSTEMD @@ -178,12 +178,12 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it -if [ $is_public -eq 1 ] +#REMOVEME? if [ $is_public -eq 1 ] then - ynh_permission_update --permission="main" --add="visitors" +#REMOVEME? ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/remove b/scripts/remove index ab926e8..ca2e39b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,16 +12,16 @@ 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) -port=$(ynh_app_setting_get --app=$app --key=port) -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? port=$(ynh_app_setting_get --app=$app --key=port) +#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 @@ -47,18 +47,18 @@ ynh_remove_systemd_config #================================================= # REMOVE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Removing the MySQL database..." --weight=2 +#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." --weight=2 # Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=3 +#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=3 # Remove the app directory securely -ynh_secure_remove --file="$final_path" +#REMOVEME? ynh_secure_remove --file="$install_dir" #================================================= # REMOVE DATA DIR @@ -68,7 +68,7 @@ ynh_secure_remove --file="$final_path" if [ "${YNH_APP_PURGE:-0}" -eq 1 ] then ynh_script_progression --message="Removing $app data directory..." --weight=2 - ynh_secure_remove --file="$datadir" +#REMOVEME? ynh_secure_remove --file="$data_dir" fi #================================================= @@ -97,10 +97,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 05ea48d..605cead 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,29 +14,29 @@ source /usr/share/yunohost/helpers #================================================= # 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 -admin=$(ynh_app_setting_get --app=$app --key=admin) -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? admin=$(ynh_app_setting_get --app=$app --key=admin) +#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=2 +#REMOVEME? ynh_script_progression --message="Validating restoration parameters..." --weight=2 -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 @@ -50,42 +50,42 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # 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 $app main directory..." --weight=10 -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:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$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:www-data "$datadir" +chmod 750 "$data_dir" +chmod -R o-rwx "$data_dir" +chown -R $app:www-data "$data_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=3 +#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=3 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ec8bfde..bdb2160 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,24 +9,24 @@ source _common.sh source /usr/share/yunohost/helpers -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=mysqlpwd) -admin=$(ynh_app_setting_get --app=$app --key=admin) -port=$(ynh_app_setting_get --app=$app --key=port) -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=mysqlpwd) +#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) +#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) +#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) #================================================= # 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 #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -54,8 +54,8 @@ ynh_abort_if_errors 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 @@ -74,13 +74,13 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -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 --source_id=$YNH_ARCH --keep="custom/conf/app.ini custom/conf/auth.d/ldap.conf" +ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH --keep="custom/conf/app.ini custom/conf/auth.d/ldap.conf" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" #================================================= # SETUP SYSTEMD From 3627dc961f2c841901e2166a2cc457cf5b9d3e9e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 4 Nov 2022 21:02:25 +0000 Subject: [PATCH 02/21] Auto-update README --- README.md | 1 - README_fr.md | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index b89d2a9..9cdb557 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part **Shipped version:** 0.12.10~ynh1 - **Demo:** https://try.gogs.io/user/login ## Screenshots diff --git a/README_fr.md b/README_fr.md index 3382742..fc6e175 100644 --- a/README_fr.md +++ b/README_fr.md @@ -18,8 +18,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Gogs (Go Git Service) est une forge multiplateforme basée sur git écrite en Go. Sa particularité est d’être léger et pouvant fonctionner sur carte ARM, ce qui fait qu’il est adapté à l’auto-hébergement. Gogs a une interface web similaire à celle de GitHub. -**Version incluse :** 0.12.10~ynh1 - +**Version incluse :** 0.12.10~ynh1 **Démo :** https://try.gogs.io/user/login From 0cf5f90b0d403759c77a242e14847247244f8aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:19:23 +0100 Subject: [PATCH 03/21] v2 --- manifest.toml | 16 ++++++----- scripts/backup | 18 ------------ scripts/install | 75 +------------------------------------------------ scripts/remove | 49 -------------------------------- scripts/restore | 41 +-------------------------- scripts/upgrade | 46 ------------------------------ 6 files changed, 11 insertions(+), 234 deletions(-) diff --git a/manifest.toml b/manifest.toml index d2caeea..40a5426 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,14 +19,14 @@ cpe = "???" # FIXME: optional but recommended if relevant, this is meant to cont 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 = ">= 11.0.9" -architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64/armel), for example: ["amd64", "i386"] +yunohost = ">= 11.1.0" +architectures = "all" multi_instance = true -ldap = "?" # FIXME: replace with true, false, or "not_relevant" -sso = "?" # FIXME: replace with true, false, or "not_relevant" -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 = "true" +sso = "true" +disk = "50M" +ram.build = "50M" +ram.runtime = "50M" [install] [install.domain] @@ -49,6 +49,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen default = "visitors" [resources] + [resources.port] + [resources.system_user] [resources.install_dir] diff --git a/scripts/backup b/scripts/backup index 0890f04..8d7899c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -9,24 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -#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 bb4f641..7bf1eec 100644 --- a/scripts/install +++ b/scripts/install @@ -9,82 +9,25 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= # Retrieve arguments -#REMOVEME? domain=$YNH_APP_ARG_DOMAIN -#REMOVEME? path=$YNH_APP_ARG_PATH -#REMOVEME? admin=$YNH_APP_ARG_ADMIN -#REMOVEME? is_public=$YNH_APP_ARG_IS_PUBLIC key=$(ynh_string_random) -#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 +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=admin --value=$admin -#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path ynh_app_setting_set --app=$app --key=key --value=$key -#================================================= -# STANDARD MODIFICATIONS -#================================================= -# FIND AND OPEN A PORT -#================================================= -#REMOVEME? ynh_script_progression --message="Finding an available port..." --weight=1 - -# Find an available port -#REMOVEME? port=$(ynh_find_port --port=6000) -#REMOVEME? ynh_app_setting_set --app=$app --key=port --value=$port - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Creating a MySQL database..." --weight=3 - -#REMOVEME? db_name=$(ynh_sanitize_dbid --db_name=$app) -#REMOVEME? db_user=$db_name -#REMOVEME? ynh_app_setting_set --app=$app --key=db_name --value=$db_name -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - -#================================================= -# 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 - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -#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 --source_id=$YNH_ARCH @@ -105,11 +48,6 @@ ynh_add_nginx_config #================================================= 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 - # create needed directories mkdir -p "$install_dir/custom/conf/auth.d" mkdir -p "$data_dir/data/repositories" @@ -175,17 +113,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# SETUP SSOWAT -#================================================= -#REMOVEME? ynh_script_progression --message="Configuring permissions..." --weight=1 - -# Make app public if necessary or protect it -#REMOVEME? if [ $is_public -eq 1 ] -then -#REMOVEME? ynh_permission_update --permission="main" --add="visitors" -fi - #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/remove b/scripts/remove index ca2e39b..c546491 100644 --- a/scripts/remove +++ b/scripts/remove @@ -9,20 +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? port=$(ynh_app_setting_get --app=$app --key=port) -#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 #================================================= @@ -44,33 +30,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -#REMOVEME? ynh_script_progression --message="Removing the MySQL database..." --weight=2 - -# Remove a database if it exists, along with the associated user -#REMOVEME? ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -#REMOVEME? ynh_script_progression --message="Removing app main directory..." --weight=3 - -# Remove the app directory securely -#REMOVEME? ynh_secure_remove --file="$install_dir" - -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the app data directory with the command `yunohost app remove gogs --purge` -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing $app data directory..." --weight=2 -#REMOVEME? ynh_secure_remove --file="$data_dir" -fi - #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= @@ -94,14 +53,6 @@ ynh_script_progression --message="Removing various files..." --weight=1 ynh_secure_remove --file="/var/log/$app" -#================================================= -# 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 605cead..4afa392 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,35 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# 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? admin=$(ynh_app_setting_get --app=$app --key=admin) -#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=2 - -#REMOVEME? test ! -d $install_dir || ynh_die --message="There is already a directory: $install_dir " - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -47,14 +18,6 @@ ynh_script_progression --message="Restoring the NGINX configuration..." --weight ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# 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 #================================================= @@ -82,10 +45,8 @@ chown -R $app:www-data "$data_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -#REMOVEME? ynh_script_progression --message="Restoring the MySQL database..." --weight=3 +ynh_script_progression --message="Restoring the MySQL database..." --weight=3 -#REMOVEME? db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -#REMOVEME? ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index bdb2160..c72a827 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,57 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers -#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=mysqlpwd) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? data_dir=$(ynh_app_setting_get --app=$app --key=data_dir) - #================================================= # CHECK VERSION #================================================= 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 - -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -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 - #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -74,7 +29,6 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -#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 --source_id=$YNH_ARCH --keep="custom/conf/app.ini custom/conf/auth.d/ldap.conf" From ffc3a51fd13132e899433d9e9e438e352c002238 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 23 Feb 2023 23:36:06 +0100 Subject: [PATCH 04/21] [autopatch] Upgrade auto-updater --- .github/workflows/updater.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml index fb72ba0..a56d7cb 100644 --- a/.github/workflows/updater.yml +++ b/.github/workflows/updater.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Fetch the source code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Run the updater script @@ -33,7 +33,7 @@ jobs: - name: Create Pull Request id: cpr if: ${{ env.PROCEED == 'true' }} - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v4 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update to version ${{ env.VERSION }} From 6b870606f6dc98d402197524d462f5a93febd95e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 23 Feb 2023 22:36:08 +0000 Subject: [PATCH 05/21] 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 b89d2a9..c46871c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Gogs for YunoHost -[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Working status](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Working status](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) + [![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs) *[Lire ce readme en français.](./README_fr.md)* @@ -33,7 +34,6 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part **Shipped version:** 0.12.10~ynh1 - **Demo:** https://try.gogs.io/user/login ## Screenshots diff --git a/README_fr.md b/README_fr.md index 3382742..db26f71 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,27 +5,27 @@ It shall NOT be edited by hand. # Gogs pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) + [![Installer Gogs avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Gogs 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 Gogs 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 Gogs (Go Git Service) est une forge multiplateforme basée sur git écrite en Go. Sa particularité est d’être léger et pouvant fonctionner sur carte ARM, ce qui fait qu’il est adapté à l’auto-hébergement. Gogs a une interface web similaire à celle de GitHub. -**Version incluse :** 0.12.10~ynh1 - +**Version incluse :** 0.12.10~ynh1 **Démo :** https://try.gogs.io/user/login -## Captures d'écran +## Captures d’écran -![Capture d'écran de Gogs](./doc/screenshots/screenshot.png) +![Capture d’écran de Gogs](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -56,9 +56,9 @@ Actually it's possible to access to the Git repositories by the `git` command ov ## 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 : @@ -74,4 +74,4 @@ ou sudo yunohost app upgrade gogs -u https://github.com/YunoHost-Apps/gogs_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 d99c6664034c808982bbaec5f453e0705dc1de78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:49:27 +0100 Subject: [PATCH 06/21] Fix --- conf/arm64.src | 4 ++-- conf/armhf.src | 4 ++-- conf/i386.src | 4 ++-- conf/nginx.conf | 2 +- doc/{DISCLAIMER.md => ADMIN.md} | 0 manifest.toml | 9 ++------- scripts/restore | 5 ----- 7 files changed, 9 insertions(+), 19 deletions(-) rename doc/{DISCLAIMER.md => ADMIN.md} (100%) diff --git a/conf/arm64.src b/conf/arm64.src index bf23341..004003c 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_armv8.tar.gz -SOURCE_SUM=103c13ad8ff304767c7618e80429e294c059e44608050d1d19ba9ca53d41c40a +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_armv8.tar.gz +SOURCE_SUM= SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/armhf.src b/conf/armhf.src index 0f6bd5c..a913114 100644 --- a/conf/armhf.src +++ b/conf/armhf.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_armv7.tar.gz -SOURCE_SUM=c9eb724591be817bdcd835057d1ae22f0a6236135a20d25c0da331e3046d34f3 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_armv7.tar.gz +SOURCE_SUM= SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src index 1b0b23f..e09cb53 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_386.tar.gz -SOURCE_SUM=8cc9aaa8ffa4b0e8579a49b285d0e67642dbf8ec94d0d130759727fa51d6d415 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_386.tar.gz +SOURCE_SUM= SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index c62661e..8c9a26a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,7 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - proxy_pass http://localhost:__PORT__/; + proxy_pass http://127.0.0.1:__PORT__/; proxy_set_header Host $host; proxy_buffering off; fastcgi_param REMOTE_USER $remote_user; diff --git a/doc/DISCLAIMER.md b/doc/ADMIN.md similarity index 100% rename from doc/DISCLAIMER.md rename to doc/ADMIN.md diff --git a/manifest.toml b/manifest.toml index 40a5426..7101228 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Gogs" description.en = "Lightweight self-hosted Git forge" description.fr = "Forge Git légère auto-hébergé" -version = "0.12.10~ynh1" +version = "0.13.0~ynh1" maintainers = [] @@ -15,11 +15,9 @@ website = "http://gogs.io" demo = "https://try.gogs.io/user/login" admindoc = "https://gogs.io/docs" code = "https://github.com/gogs/gogs" -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 = ">= 11.1.0" +yunohost = ">= 11.1.11" architectures = "all" multi_instance = true ldap = "true" @@ -30,16 +28,13 @@ ram.runtime = "50M" [install] [install.domain] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "domain" [install.path] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "path" default = "/gogs" [install.admin] - # this is a generic question - ask strings are automatically handled by Yunohost's core type = "user" [install.init_main_permission] diff --git a/scripts/restore b/scripts/restore index 4afa392..a3c0189 100644 --- a/scripts/restore +++ b/scripts/restore @@ -25,7 +25,6 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=10 ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -36,10 +35,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:www-data "$data_dir" #================================================= From 7f084d760b9b9ce07af147c3b5c3cb040726b4e5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 25 Feb 2023 13:49:31 +0000 Subject: [PATCH 07/21] Auto-update README --- README.md | 30 ++---------------------------- README_fr.md | 48 +++++++++++------------------------------------- 2 files changed, 13 insertions(+), 65 deletions(-) diff --git a/README.md b/README.md index 9cdb557..811feac 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # Gogs for YunoHost -[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Working status](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Working status](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) + [![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs) *[Lire ce readme en français.](./README_fr.md)* @@ -39,33 +40,6 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part ![Screenshot of Gogs](./doc/screenshots/screenshot.png) -## Disclaimers / important information - -## Notes on SSH usage - -If you want to use Gogs with SSH and be able to pull/push with you SSH key, your SSH daemon must be properly configured to use private/public keys. Here is a sample configuration of `/etc/ssh/sshd_config` that works with Gogs: - -```bash -PubkeyAuthentication yes -AuthorizedKeysFile %h/.ssh/authorized_keys -ChallengeResponseAuthentication no -PasswordAuthentication no -UsePAM no -``` - -You also need to add your public key to your Gogs profile. - -If you use SSH on another port than 22, you need to add theses lines to your ssh config in `~/.ssh/config`: - -```bash -Host domain.tld - port 2222 # change this with the port you use -``` - -## Private Mode - -Actually it's possible to access to the Git repositories by the `git` command over HTTP also in private mode installation. It's important to know that in this mode the repository could be ALSO getted if you don't set the repository as private in the repos settings. - ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index fc6e175..a07d593 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,16 @@ It shall NOT be edited by hand. # Gogs pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) + [![Installer Gogs avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer Gogs 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 Gogs 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 Gogs (Go Git Service) est une forge multiplateforme basée sur git écrite en Go. Sa particularité est d’être léger et pouvant fonctionner sur carte ARM, ce qui fait qu’il est adapté à l’auto-hébergement. Gogs a une interface web similaire à celle de GitHub. @@ -22,42 +23,15 @@ Gogs (Go Git Service) est une forge multiplateforme basée sur git écrite en Go **Démo :** https://try.gogs.io/user/login -## Captures d'écran +## Captures d’écran -![Capture d'écran de Gogs](./doc/screenshots/screenshot.png) - -## Avertissements / informations importantes - -## Notes on SSH usage - -If you want to use Gogs with SSH and be able to pull/push with you SSH key, your SSH daemon must be properly configured to use private/public keys. Here is a sample configuration of `/etc/ssh/sshd_config` that works with Gogs: - -```bash -PubkeyAuthentication yes -AuthorizedKeysFile %h/.ssh/authorized_keys -ChallengeResponseAuthentication no -PasswordAuthentication no -UsePAM no -``` - -You also need to add your public key to your Gogs profile. - -If you use SSH on another port than 22, you need to add theses lines to your ssh config in `~/.ssh/config`: - -```bash -Host domain.tld - port 2222 # change this with the port you use -``` - -## Private Mode - -Actually it's possible to access to the Git repositories by the `git` command over HTTP also in private mode installation. It's important to know that in this mode the repository could be ALSO getted if you don't set the repository as private in the repos settings. +![Capture d’écran de Gogs](./doc/screenshots/screenshot.png) ## 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 : @@ -73,4 +47,4 @@ ou sudo yunohost app upgrade gogs -u https://github.com/YunoHost-Apps/gogs_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 62066730c23080711aa97d116a00114f01486db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:49:42 +0100 Subject: [PATCH 08/21] Fix --- conf/amd64.src | 4 ++-- scripts/install | 2 -- scripts/upgrade | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/conf/amd64.src b/conf/amd64.src index bebc731..18560f2 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_amd64.tar.gz -SOURCE_SUM=7b7bb550a99c0b0a4c182c30ffcb456ae6fccac58f2ddcaf59ca3836f7156575 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_amd64.tar.gz +SOURCE_SUM= SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/scripts/install b/scripts/install index 7bf1eec..e96b760 100644 --- a/scripts/install +++ b/scripts/install @@ -31,7 +31,6 @@ ynh_script_progression --message="Setting up source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -54,7 +53,6 @@ mkdir -p "$data_dir/data/repositories" mkdir -p "$data_dir/data/avatars" mkdir -p "$data_dir/data/attachments" -chmod 750 "$data_dir" chmod -R o-rwx "$data_dir" chown -R $app:www-data "$data_dir" diff --git a/scripts/upgrade b/scripts/upgrade index c72a827..7298f49 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,6 @@ ynh_script_progression --message="Setting up source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH --keep="custom/conf/app.ini custom/conf/auth.d/ldap.conf" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From 3f52e44f29458b065abb5e94595e0786227a52b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:50:13 +0100 Subject: [PATCH 09/21] Create tests.toml --- tests.toml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests.toml diff --git a/tests.toml b/tests.toml new file mode 100644 index 0000000..e69de29 From da4ab8a67878898e180d9d4e764683a54cac147e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Mar 2023 23:11:58 +0100 Subject: [PATCH 10/21] fix --- check_process | 21 ----------- manifest.json | 63 ------------------------------- manifest.toml | 5 ++- scripts/change_url | 92 +--------------------------------------------- tests.toml | 7 ++++ 5 files changed, 12 insertions(+), 176 deletions(-) delete mode 100644 check_process delete mode 100644 manifest.json diff --git a/check_process b/check_process deleted file mode 100644 index 375685c..0000000 --- a/check_process +++ /dev/null @@ -1,21 +0,0 @@ -;; General - ; Manifest - domain="domain.tld" - path="/path" - admin="john" - is_public=1 - ; Checks - pkg_linter=1 - setup_sub_dir=1 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - #upgrade=1 from_commit= - backup_restore=1 - multi_instance=1 - change_url=1 -;;; Upgrade options - ; commit= - name= diff --git a/manifest.json b/manifest.json deleted file mode 100644 index 8a7f3b3..0000000 --- a/manifest.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "Gogs", - "id": "gogs", - "packaging_format": 1, - "description": { - "en": "Lightweight self-hosted Git forge", - "fr": "Forge Git légère auto-hébergé" - }, - "version": "0.12.10~ynh1", - "url": "http://gogs.io", - "upstream": { - "license": "MIT", - "website": "http://gogs.io", - "demo": "https://try.gogs.io/user/login", - "admindoc": "https://gogs.io/docs", - "code": "https://github.com/gogs/gogs", - "cpe": "cpe:2.3:a:gogs:gogs" - }, - "license": "MIT", - "maintainer": { - "name": "", - "email": "" - }, - "previous_maintainers": { - "name": "tostaki", - "email": "maxime@max.privy.place" - }, - "multi_instance": true, - "services": [ - "nginx", - "mysql" - ], - "requirements": { - "yunohost": ">= 11.0.9" - }, - "arguments": { - "install": [ - { - "name": "domain", - "type": "domain" - }, - { - "name": "path", - "type": "path", - "example": "/gogs", - "default": "/gogs" - }, - { - "name": "admin", - "type": "user" - }, - { - "name": "is_public", - "type": "boolean", - "help": { - "en": "If enabled, Gogs will be accessible by people who do not have an account. This can be changed later via the webadmin.", - "fr": "Si cette case est cochée, Gogs sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." - }, - "default": true - } - ] - } -} \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 7101228..7661154 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ admindoc = "https://gogs.io/docs" code = "https://github.com/gogs/gogs" [integration] -yunohost = ">= 11.1.11" +yunohost = ">= 11.1.15" architectures = "all" multi_instance = true ldap = "true" @@ -55,5 +55,8 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" + [resources.apt] + packages = "mariadb-server" + [resources.database] type = "mysql" diff --git a/scripts/change_url b/scripts/change_url index da7c4f7..9772cbd 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,67 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH - -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH - -app=$YNH_APP_INSTANCE_NAME - -#================================================= -# LOAD SETTINGS -#================================================= -ynh_script_progression --message="Loading installation settings..." --weight=1 - -# Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -port=$(ynh_app_setting_get --app=$app --key=port) -admin=$(ynh_app_setting_get --app=$app --key=admin) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -key=$(ynh_app_setting_get --app=$app --key=key) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) -path_url=$(ynh_app_setting_get --app=$app --key=path) - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. - ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - - # Restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - -#================================================= -# CHECK WHICH PARTS SHOULD BE CHANGED -#================================================= - -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -84,29 +23,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 -nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf - -# Change the path in the NGINX config file -if [ $change_path -eq 1 ] -then - # Make a backup of the original NGINX config file if modified - ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for NGINX helper - domain="$old_domain" - path_url="$new_path" - # Create a dedicated NGINX config - ynh_add_nginx_config -fi - -# Change the domain for NGINX -if [ $change_domain -eq 1 ] -then - # Delete file checksum for the old conf file location - ynh_delete_file_checksum --file="$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf - # Store file checksum for the new config file location - ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" -fi +ynh_change_url_nginx_config #================================================= # SPECIFIC MODIFICATIONS @@ -135,13 +52,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/tests.toml b/tests.toml index e69de29..91daf17 100644 --- a/tests.toml +++ b/tests.toml @@ -0,0 +1,7 @@ +test_format = 1.0 + +[default] + + # ------------ + # Tests to run + # ------------ \ No newline at end of file From 49ccdb4304657518a3506d0af411b4e8c62b5099 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 15 Mar 2023 22:12:04 +0000 Subject: [PATCH 11/21] 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 811feac..d415a95 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part - Customize HTML templates, static files and many others. -**Shipped version:** 0.12.10~ynh1 +**Shipped version:** 0.13.0~ynh1 **Demo:** https://try.gogs.io/user/login diff --git a/README_fr.md b/README_fr.md index a07d593..f1489ad 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 Gogs (Go Git Service) est une forge multiplateforme basée sur git écrite en Go. Sa particularité est d’être léger et pouvant fonctionner sur carte ARM, ce qui fait qu’il est adapté à l’auto-hébergement. Gogs a une interface web similaire à celle de GitHub. -**Version incluse :** 0.12.10~ynh1 +**Version incluse :** 0.13.0~ynh1 **Démo :** https://try.gogs.io/user/login From b7e66c9972b05ad547cdf6c5e666b754dc6e4919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Mar 2023 23:20:00 +0100 Subject: [PATCH 12/21] Fix --- conf/amd64.src | 5 ----- conf/arm64.src | 5 ----- conf/armhf.src | 5 ----- conf/i386.src | 5 ----- manifest.toml | 12 ++++++++++++ 5 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 conf/amd64.src delete mode 100644 conf/arm64.src delete mode 100644 conf/armhf.src delete mode 100644 conf/i386.src diff --git a/conf/amd64.src b/conf/amd64.src deleted file mode 100644 index 18560f2..0000000 --- a/conf/amd64.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_amd64.tar.gz -SOURCE_SUM= -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true diff --git a/conf/arm64.src b/conf/arm64.src deleted file mode 100644 index 004003c..0000000 --- a/conf/arm64.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_armv8.tar.gz -SOURCE_SUM= -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true diff --git a/conf/armhf.src b/conf/armhf.src deleted file mode 100644 index a913114..0000000 --- a/conf/armhf.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_armv7.tar.gz -SOURCE_SUM= -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src deleted file mode 100644 index e09cb53..0000000 --- a/conf/i386.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_386.tar.gz -SOURCE_SUM= -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true diff --git a/manifest.toml b/manifest.toml index 7661154..be77c4d 100644 --- a/manifest.toml +++ b/manifest.toml @@ -44,6 +44,18 @@ ram.runtime = "50M" default = "visitors" [resources] + + [resources.sources] + [resources.sources.main] + amd64.url = "https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_amd64.tar.gz" + amd64.sha256 = "75da1c026cacb187a7c1dcad8263873ec566ce30cc0df56dd1dc129b8292d34f" + arm64.url = "https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_armv8.tar.gz" + arm64.sha256 = "3a8401ed3f9f9b73708c682f9b3211401dec01d3ce36294655b9394c28eab2e1" + armhf.url = "https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_armv7.tar.gz" + armhf.sha256 = "816e753719fc920e5df5f43b98e31db04d8e5e8c3b49cab662ad69852e2a8863" + i386.url = "https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_386.tar.gz" + i386.sha256 = "c4ddd0c9f1d9216ff15e0fbcb53f9da0999d0a3e84b2e270601aa86c8ff6f00c" + [resources.port] [resources.system_user] From 383ff100ba4073575c90fb2bc0fab40359dbc0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 15 Mar 2023 23:20:57 +0100 Subject: [PATCH 13/21] fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index e96b760..6269332 100644 --- a/scripts/install +++ b/scripts/install @@ -29,7 +29,7 @@ ynh_app_setting_set --app=$app --key=key --value=$key ynh_script_progression --message="Setting up source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH +ynh_setup_source --dest_dir=$install_dir chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 7298f49..ba0cb68 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,7 +30,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" ynh_script_progression --message="Setting up source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$install_dir --source_id=$YNH_ARCH --keep="custom/conf/app.ini custom/conf/auth.d/ldap.conf" +ynh_setup_source --dest_dir=$install_dir --keep="custom/conf/app.ini custom/conf/auth.d/ldap.conf" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From d1582543ce08bf48eff01041d0050ccc44b9e67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Mar 2023 22:10:02 +0100 Subject: [PATCH 14/21] Update manifest.toml --- manifest.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index be77c4d..f89670b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -20,8 +20,8 @@ code = "https://github.com/gogs/gogs" yunohost = ">= 11.1.15" architectures = "all" multi_instance = true -ldap = "true" -sso = "true" +ldap = true +sso = true disk = "50M" ram.build = "50M" ram.runtime = "50M" From a2b692d7b9d5cb3112df3ca2aa02bc40c21c44ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 16 Mar 2023 22:10:52 +0100 Subject: [PATCH 15/21] cleaning --- scripts/install | 7 ------- scripts/upgrade | 7 ------- 2 files changed, 14 deletions(-) diff --git a/scripts/install b/scripts/install index 6269332..0904208 100644 --- a/scripts/install +++ b/scripts/install @@ -111,13 +111,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ba0cb68..1b41366 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,13 +79,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -ynh_systemd_action --service_name=nginx --action=reload - #================================================= # END OF SCRIPT #================================================= From c1d97b37059482463e4ccc9687ac4d9085195799 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 22 Mar 2023 06:12:03 +0000 Subject: [PATCH 16/21] Upgrade to v0.13.0 --- conf/amd64.src | 6 +++--- conf/arm64.src | 6 +++--- conf/armhf.src | 6 +++--- conf/i386.src | 6 +++--- manifest.json | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/conf/amd64.src b/conf/amd64.src index bebc731..c65b515 100644 --- a/conf/amd64.src +++ b/conf/amd64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_amd64.tar.gz -SOURCE_SUM=7b7bb550a99c0b0a4c182c30ffcb456ae6fccac58f2ddcaf59ca3836f7156575 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_amd64.zip +SOURCE_SUM=dcf1b98e0cf0e7ade19294eeb886825f80c45f7b61c17807a1cebc5ec85d23b0 SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz +SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/arm64.src b/conf/arm64.src index bf23341..b6f62d2 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_armv8.tar.gz -SOURCE_SUM=103c13ad8ff304767c7618e80429e294c059e44608050d1d19ba9ca53d41c40a +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_windows_amd64_mws.zip +SOURCE_SUM=4323c6cba1aa522642772e051fb9e63df02566af93a7b85294a458a520bbc1eb SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz +SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/armhf.src b/conf/armhf.src index 0f6bd5c..a9d1b84 100644 --- a/conf/armhf.src +++ b/conf/armhf.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_armv7.tar.gz -SOURCE_SUM=c9eb724591be817bdcd835057d1ae22f0a6236135a20d25c0da331e3046d34f3 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_armv7.zip +SOURCE_SUM=836bad63e6b1e3edd3cd8ec6c987fe5ddc7ca5705122405570d8e44862c3c3b1 SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz +SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src index 1b0b23f..66e8ee4 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.10/gogs_0.12.10_linux_386.tar.gz -SOURCE_SUM=8cc9aaa8ffa4b0e8579a49b285d0e67642dbf8ec94d0d130759727fa51d6d415 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_386.zip +SOURCE_SUM=fd29651139013b450dfaaeb057973b4df204ccc0fc28078354c8428983506136 SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz +SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 8a7f3b3..6f014da 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Lightweight self-hosted Git forge", "fr": "Forge Git légère auto-hébergé" }, - "version": "0.12.10~ynh1", + "version": "0.13.0~ynh1", "url": "http://gogs.io", "upstream": { "license": "MIT", @@ -60,4 +60,4 @@ } ] } -} \ No newline at end of file +} From 5e5a0a2695ab0cf52a7342dcaeabbba8fd3705b5 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 22 Mar 2023 06:12:10 +0000 Subject: [PATCH 17/21] 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 c46871c..5045465 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part - Customize HTML templates, static files and many others. -**Shipped version:** 0.12.10~ynh1 +**Shipped version:** 0.13.0~ynh1 **Demo:** https://try.gogs.io/user/login diff --git a/README_fr.md b/README_fr.md index db26f71..24b19ec 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 Gogs (Go Git Service) est une forge multiplateforme basée sur git écrite en Go. Sa particularité est d’être léger et pouvant fonctionner sur carte ARM, ce qui fait qu’il est adapté à l’auto-hébergement. Gogs a une interface web similaire à celle de GitHub. -**Version incluse :** 0.12.10~ynh1 +**Version incluse :** 0.13.0~ynh1 **Démo :** https://try.gogs.io/user/login From 1abcda86640f614547181b70a25586184753f5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 22 Mar 2023 08:00:03 +0100 Subject: [PATCH 18/21] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index f89670b..cc43da7 100644 --- a/manifest.toml +++ b/manifest.toml @@ -56,7 +56,7 @@ ram.runtime = "50M" i386.url = "https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_386.tar.gz" i386.sha256 = "c4ddd0c9f1d9216ff15e0fbcb53f9da0999d0a3e84b2e270601aa86c8ff6f00c" - [resources.port] + [resources.ports] [resources.system_user] From 7e06f1c697c426c76af6a256d324ebc47f38faf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 22 Mar 2023 08:02:54 +0100 Subject: [PATCH 19/21] cleaning --- conf/systemd.service | 2 +- doc/DESCRIPTION.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 2674594..4804b74 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Gogs (Go Git Service) +Description=Gogs: Go Git Service After=syslog.target network.target mysql.service slapd.service redis.service [Service] diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 506ba45..399a737 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -3,7 +3,6 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part ### Features - User dashboard, user profile and activity timeline. -- User, organization and repository management. - Repository and organization webhooks, including Slack, Discord and Dingtalk. - Repository Git hooks, deploy keys and Git LFS. - Repository issues, pull requests, wiki, protected branches and collaboration. @@ -11,4 +10,3 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part - Web editor for quick editing repository files and wiki. - Jupyter Notebook and PDF rendering. - Authentication via SMTP, LDAP. -- Customize HTML templates, static files and many others. From fc846b665392d5c5bff7034a9a0a59c18521385f Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 22 Mar 2023 07:02:59 +0000 Subject: [PATCH 20/21] Auto-update README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d415a95..5922c64 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part ### Features - User dashboard, user profile and activity timeline. -- User, organization and repository management. - Repository and organization webhooks, including Slack, Discord and Dingtalk. - Repository Git hooks, deploy keys and Git LFS. - Repository issues, pull requests, wiki, protected branches and collaboration. @@ -29,7 +28,6 @@ Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its part - Web editor for quick editing repository files and wiki. - Jupyter Notebook and PDF rendering. - Authentication via SMTP, LDAP. -- Customize HTML templates, static files and many others. **Shipped version:** 0.13.0~ynh1 From 508309dc2ce677beb8b583303efaaf3c3c90b8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 22 Mar 2023 15:21:12 +0100 Subject: [PATCH 21/21] Update change_url --- scripts/change_url | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 9772cbd..c42a529 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -38,10 +38,10 @@ fi domain=$new_domain -ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini" +ynh_add_config --template="../conf/app.ini" --destination="$install_dir/custom/conf/app.ini" -chmod 400 "$final_path/custom/conf/app.ini" -chown $app:$app "$final_path/custom/conf/app.ini" +chmod 400 "$install_dir/custom/conf/app.ini" +chown $app:$app "$install_dir/custom/conf/app.ini" #================================================= # GENERIC FINALISATION