From 76ce0e961e27a80ca7a01d778b856de2bd06c730 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 11 Oct 2020 22:38:04 +0200 Subject: [PATCH 01/96] v.0.12.3 --- README.md | 32 ++++++++---------- conf/arm.src | 10 ++---- conf/i386.src | 10 ++---- conf/x86-64.src | 10 ++---- manifest.json | 5 ++- scripts/backup | 1 - scripts/change_url | 1 - scripts/experimental_helper.sh | 61 ---------------------------------- scripts/install | 1 - scripts/remove | 1 - scripts/restore | 1 - scripts/upgrade | 1 - 12 files changed, 22 insertions(+), 112 deletions(-) delete mode 100644 scripts/experimental_helper.sh diff --git a/README.md b/README.md index 1e22aa8..0a8ab12 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Gogs package for YunoHost +# Gogs for YunoHost Gogs is a self-hosted Git service written in Go. Alternative to Github. - [Gogs website](http://gogs.io) @@ -77,27 +77,23 @@ Architecture: this package is compatible with amd64, i386 and arm. The package w ## 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. -## Issue -Any issue is welcome here : https://github.com/YunoHost-Apps/gogs_ynh/issues +## Links -## License -Gogs is published under the MIT License: -https://github.com/gogits/gogs/blob/master/LICENSE + * Report a bug: https://github.com/YunoHost-Apps/gogs_ynh/issues + * App website: http://gogs.io + * Upstream app repository: https://github.com/gogs/gogs + * YunoHost website: https://yunohost.org/ -This package is published under the MIT License. +--- +## Developer info -## Developper info -Please do your pull requests to the `dev` branch. - -Test or upgrade to dev version: -```bash -sudo su - admin -git clone -b dev https://github.com/YunoHost-Apps/gogs_ynh -# to install -sudo yunohost app install -l Gogs /home/admin/gogs_ynh -# to upgrade -sudo yunohost app upgrade -f /home/admin/gogs_ynh gogs +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gogs_ynh/tree/testing). +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug +or +sudo yunohost app upgrade gogs -u https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug ``` diff --git a/conf/arm.src b/conf/arm.src index 7c882e3..f75a170 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,11 +1,5 @@ -SOURCE_URL=https://github.com/gogits/gogs/releases/download/v0.11.79/raspi2_armv6.zip -SOURCE_SUM=a7d17f6dc542fd2d88f884271bca9c62729fbd725fdb310616b2987dba382631 -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.3/gogs_0.12.3_linux_armv7.zip +SOURCE_SUM=9116d4f1baf6a47dc3a47cfce8f435ad77f7939f2e80323f31382913e895ab35 SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=zip -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src index abf6148..a30b0a9 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,11 +1,5 @@ -SOURCE_URL=https://github.com/gogits/gogs/releases/download/v0.11.79/linux_386.zip -SOURCE_SUM=ad1a89eb01723a4b289b7b8773fd018f78b0dad801101f27c1af0f2d649edeeb -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.3/gogs_0.12.3_linux_386.zip +SOURCE_SUM=bcf7a31ad61865217eca93f4d90ede15837c857accb2394782ebf4a7805e1cbc SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=zip -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true diff --git a/conf/x86-64.src b/conf/x86-64.src index cd8f52b..1e54b76 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,11 +1,5 @@ -SOURCE_URL=https://github.com/gogits/gogs/releases/download/v0.11.79/linux_amd64.zip -SOURCE_SUM=85f60494de63e6c4af16faba9bc739eb7c9e5477de1f16d11c6665495141162f -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 +SOURCE_URL=https://github.com/gogs/gogs/releases/download/v0.12.3/gogs_0.12.3_linux_amd64.zip +SOURCE_SUM=0eeab278aaf8fc999329e611fe0709e95e08c26d15bdf60d499268f144e40406 SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=zip -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index f25402e..9a365df 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,4 @@ { - "package_format": 1, "name": "Gogs", "id": "gogs", "packaging_format": 1, @@ -9,7 +8,7 @@ }, "url": "http://gogs.io", "license": "MIT", - "version": "0.11.66~ynh1", + "version": "0.12.3~ynh1", "maintainer": { "name": "Josué Tille", "email": "josue@tille.ch" @@ -24,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 2.7.12" + "yunohost": ">= 3.8.1" }, "arguments": { "install" : [ diff --git a/scripts/backup b/scripts/backup index 772fae0..01a0761 100644 --- a/scripts/backup +++ b/scripts/backup @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ../settings/scripts/experimental_helper.sh source ../settings/scripts/_common.sh # Retrieve app settings diff --git a/scripts/change_url b/scripts/change_url index c85fa31..fb02f6c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Import common cmd -source ./experimental_helper.sh source ./_common.sh # RETRIEVE ARGUMENTS diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh deleted file mode 100644 index 600a653..0000000 --- a/scripts/experimental_helper.sh +++ /dev/null @@ -1,61 +0,0 @@ -# Delete a file checksum from the app settings -# -# $app should be defined when calling this helper -# -# usage: ynh_remove_file_checksum file -# | arg: file - The file for which the checksum will be deleted -ynh_delete_file_checksum () { - local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_' - ynh_app_setting_delete $app $checksum_setting_name -} - -# Start or restart a service and follow its booting -# -# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name] -# -# | arg: Line to match - The line to find in the log to attest the service have finished to boot. -# | arg: Log file - The log file to watch -# | arg: Service name -# /var/log/$app/$app.log will be used if no other log is defined. -# | arg: Timeout - The maximum time to wait before ending the watching. Defaut 300 seconds. -ynh_check_starting () { - local line_to_match="$1" - local service_name="${4:-$app}" - local app_log="${2:-/var/log/$service_name/$service_name.log}" - local timeout=${3:-300} - - ynh_clean_check_starting () { - # Stop the execution of tail. - kill -s 15 $pid_tail 2>&1 - ynh_secure_remove "$templog" 2>&1 - } - - echo "Starting of $service_name" >&2 - systemctl stop $service_name - local templog="$(mktemp)" - # Following the starting of the app in its log - tail -F -n0 "$app_log" > "$templog" & - # Get the PID of the tail command - local pid_tail=$! - systemctl start $service_name - - local i=0 - for i in `seq 1 $timeout` - do - # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout - if grep --quiet "$line_to_match" "$templog" - then - echo "The service $service_name has correctly started." >&2 - break - fi - echo -n "." >&2 - sleep 1 - done - if [ $i -eq $timeout ] - then - echo "The service $service_name didn't fully started before the timeout." >&2 - fi - - echo "" - ynh_clean_check_starting -} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 76586ee..b97b0a9 100644 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ./experimental_helper.sh source ./_common.sh # Retrieve arguments diff --git a/scripts/remove b/scripts/remove index 681dd01..e5deb31 100644 --- a/scripts/remove +++ b/scripts/remove @@ -8,7 +8,6 @@ source /usr/share/yunohost/helpers # Load common variables and helpers -source ./experimental_helper.sh source ./_common.sh #================================================= diff --git a/scripts/restore b/scripts/restore index 27b6ee5..f135ead 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ../settings/scripts/experimental_helper.sh source ../settings/scripts/_common.sh # Retrieve old app settings diff --git a/scripts/upgrade b/scripts/upgrade index 82d0b6d..483f6b4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ./experimental_helper.sh source ./_common.sh # Retrieve app settings From 1390568de3cb3d7228659f20dacf2ead7bfe40f5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 11 Oct 2020 22:45:51 +0200 Subject: [PATCH 02/96] fix --- README.md | 22 +++++++++++--------- scripts/_common.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0a8ab12..4f3af24 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ # Gogs for YunoHost -Gogs is a self-hosted Git service written in Go. Alternative to Github. -- [Gogs website](http://gogs.io) - -[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://ci-apps.yunohost.org/jenkins/job/gogs%20%28Community%29/lastBuild/consoleFull) - +[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) [![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=gogs) -# IMPORTANT INFORMATION +*[Lire ce readme en français.](./README_fr.md)* -**Note that this package will not be longer be maintened by the actual maintener. -The idea is to migrate to [gitea](https://github.com/YunoHost-Apps/gitea_ynh) which is more featured.** +> *This package allows you to install Gogs quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* + +## Overview +Gogs is a self-hosted Git service written in Go. Alternative to Github. + +## Info +**Shipped version:** 0.12.3 + +# IMPORTANT INFORMATION For the old install you can migrate to gitea easly by juste upgrading your actuall gogs instance with the gitea source by this command: ``` @@ -67,8 +71,6 @@ Also, in some cases, Gogs will not restart properly during the update. If so, yo Sources and issues of the old package can be found [here](https://github.com/YunoHost-Apps/gogs_ynh_old/) -## Info -Gogs v0.11.66 - [YunoHost forum thread](https://forum.yunohost.org/t/gogs-package-an-awesome-github-alternative/1127) diff --git a/scripts/_common.sh b/scripts/_common.sh index 38d9424..ae6de87 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -106,3 +106,55 @@ set_access_settings() { ynh_app_setting_set $app skipped_regex "$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-receive%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-upload%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/info/refs" fi } + + +# Start or restart a service and follow its booting +# +# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name] +# +# | arg: Line to match - The line to find in the log to attest the service have finished to boot. +# | arg: Log file - The log file to watch +# | arg: Service name +# /var/log/$app/$app.log will be used if no other log is defined. +# | arg: Timeout - The maximum time to wait before ending the watching. Defaut 300 seconds. +ynh_check_starting () { + local line_to_match="$1" + local service_name="${4:-$app}" + local app_log="${2:-/var/log/$service_name/$service_name.log}" + local timeout=${3:-300} + + ynh_clean_check_starting () { + # Stop the execution of tail. + kill -s 15 $pid_tail 2>&1 + ynh_secure_remove "$templog" 2>&1 + } + + echo "Starting of $service_name" >&2 + systemctl stop $service_name + local templog="$(mktemp)" + # Following the starting of the app in its log + tail -F -n0 "$app_log" > "$templog" & + # Get the PID of the tail command + local pid_tail=$! + systemctl start $service_name + + local i=0 + for i in `seq 1 $timeout` + do + # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout + if grep --quiet "$line_to_match" "$templog" + then + echo "The service $service_name has correctly started." >&2 + break + fi + echo -n "." >&2 + sleep 1 + done + if [ $i -eq $timeout ] + then + echo "The service $service_name didn't fully started before the timeout." >&2 + fi + + echo "" + ynh_clean_check_starting +} From a62b96d9e563974bac8e640a567e27d7796cb4ca Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 11 Oct 2020 23:46:18 +0200 Subject: [PATCH 03/96] fix --- check_process | 3 --- manifest.json | 2 +- scripts/backup | 59 ++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/check_process b/check_process index 14429cb..e03f6ef 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,6 @@ upgrade=1 upgrade=1 from_commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab upgrade=1 from_commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 - upgrade=1 from_commit=5a706ed246392c1ce39c47a648cb93e2996e80d3 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -37,5 +36,3 @@ name=Before multi_instance and refactoring ; commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 name=From V0.10.18 - ; commit=5a706ed246392c1ce39c47a648cb93e2996e80d3 - name=The oldest package diff --git a/manifest.json b/manifest.json index 9a365df..0994575 100644 --- a/manifest.json +++ b/manifest.json @@ -59,7 +59,7 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public site ?", + "en": "Is it a public site?", "fr": "Est-ce un site public ?" }, "default": true diff --git a/scripts/backup b/scripts/backup index 01a0761..318a30c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -3,35 +3,70 @@ #================================================= # GENERIC START #================================================= - # IMPORT GENERIC HELPERS +#================================================= + +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -# Exit if an error occurs during the execution of the script +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + ynh_abort_if_errors -# Load common variables and helpers -source ../settings/scripts/_common.sh +#================================================= +# LOAD SETTINGS +#================================================= +ynh_print_info --message="Loading installation settings..." -# Retrieve app settings -domain=$(ynh_app_setting_get "$app" domain) +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) #================================================= -# STANDARD BACKUP STEPS +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + +#================================================= +# BACKUP THE APP MAIN DIR #================================================= -# Copy the app source files ynh_backup "$final_path" # Copy the data files ynh_backup "$DATADIR" -# Copy the conf files +#================================================= +# BACKUP THE NGINX CONFIGURATION +#================================================= + ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" + +#================================================= +# BACKUP SYSTEMD +#================================================= + ynh_backup "/etc/systemd/system/${app}.service" -# Backup logs +#================================================= +# BACKUP VARIOUS FILES +#================================================= + ynh_backup "/var/log/$app" -# Dump the database -ynh_mysql_dump_db "$dbname" > ./db.sql \ No newline at end of file +#================================================= +# BACKUP THE MYSQL DATABASE +#================================================= +ynh_print_info --message="Backing up the MySQL database..." + +ynh_mysql_dump_db --database="$db_name" > db.sql + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." From 8c4ff1d828437a01a890f9b7c5fda4f904aa3865 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 11 Oct 2020 23:51:25 +0200 Subject: [PATCH 04/96] Update remove --- scripts/remove | 91 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 72 insertions(+), 19 deletions(-) diff --git a/scripts/remove b/scripts/remove index e5deb31..6dabec1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -3,43 +3,96 @@ #================================================= # GENERIC START #================================================= - # IMPORT GENERIC HELPERS +#================================================= + +source _common.sh source /usr/share/yunohost/helpers -# Load common variables and helpers -source ./_common.sh +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --weight=1 + +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) #================================================= # STANDARD REMOVE #================================================= +# REMOVE SERVICE INTEGRATION IN YUNOHOST +#================================================= -# Stop gogs -systemctl stop "$app".service +# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) +if ynh_exec_warn_less yunohost service status $app >/dev/null +then + ynh_script_progression --message="Removing $app service integration..." --weight=1 + yunohost service remove $app +fi -# Drop MySQL database and user -ynh_mysql_drop_db "$dbname" 2>/dev/null -ynh_mysql_drop_user "$dbuser" 2>/dev/null +#================================================= +# STOP AND REMOVE SERVICE +#================================================= +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 -# Retrieve domain from app settings -domain=$(ynh_app_setting_get "$app" domain) +# Remove the dedicated systemd config +ynh_remove_systemd_config + +#================================================= +# REMOVE THE MYSQL DATABASE +#================================================= +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 + +#================================================= +# REMOVE APP MAIN DIR +#================================================= +ynh_script_progression --message="Removing app main directory..." --time --weight=3 + +# Remove the app directory securely +ynh_secure_remove --file="$final_path" + +#================================================= +# REMOVE VARIOUS FILES +#================================================= -# Delete app directory and configurations -ynh_secure_remove "$final_path" ynh_secure_remove "$DATADIR" + ynh_secure_remove "/var/log/$app" +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 + # Remove the app-specific logrotate config ynh_remove_logrotate -# Remove nginx config +#================================================= +# REMOVE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 + +# Remove the dedicated nginx config ynh_remove_nginx_config -# Remove gogs user and data -ynh_system_user_delete $app +#================================================= +# REMOVE DEDICATED USER +#================================================= +ynh_script_progression --message="Removing the dedicated system user..." --weight=1 -# Remove init script -ynh_remove_systemd_config +# Delete a system user +ynh_system_user_delete --username=$app -# Remove monitor -yunohost service remove "$app" \ No newline at end of file +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Removal of $app completed" --last From 7482a6be327ee6d0ebaf113aca3711ba1ee88ac2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 11 Oct 2020 23:52:45 +0200 Subject: [PATCH 05/96] Update README.md --- README.md | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/README.md b/README.md index 4f3af24..9dfcb2b 100644 --- a/README.md +++ b/README.md @@ -31,19 +31,6 @@ For the new install just install gitea by this command: sudo yunohost app install -l Gitea https://github.com/YunoHost-Apps/gitea_ynh ``` -## Requirements -A functional instance of [YunoHost](https://yunohost.org) - -## Installation -From the command-line: - -`sudo yunohost app install -l Gogs https://github.com/YunoHost-Apps/gogs_ynh` - -## Upgrade -From the command-line: - -`sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/gogs_ynh gogs` - ## 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: @@ -64,16 +51,6 @@ Host domain.tld port 2222 # change this with the port you use ``` -## Info on upgrading from the old package version (gogs <0.9.xx) -Previous versions of this package used to build Gogs from sources instead of using the pre-compiled binary. It also left data in many places which was not good. The upgrade tries to take care of moving everything to the right place **BUT it's strongly advised to do a backup of your repositories and of the Gogs directory before the update**. Your avatars and issue attachments files may be lost in the process. - -Also, in some cases, Gogs will not restart properly during the update. If so, you can rerun the update safely or try to start Gogs with `sudo systemctl restart gogs.service`. - -Sources and issues of the old package can be found [here](https://github.com/YunoHost-Apps/gogs_ynh_old/) - - -- [YunoHost forum thread](https://forum.yunohost.org/t/gogs-package-an-awesome-github-alternative/1127) - Architecture: this package is compatible with amd64, i386 and arm. The package will try to detect it with the command uname -m and fail if it can't detect the architecture. If that happens please open an issue describing your hardware and the result of the command `uname -m`. ## Private Mode From b210eb4a09218f5d311765136625718551646460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Nov 2020 22:59:36 +0100 Subject: [PATCH 06/96] Update manifest.json --- manifest.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index f25402e..a503649 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,4 @@ { - "package_format": 1, "name": "Gogs", "id": "gogs", "packaging_format": 1, @@ -7,9 +6,9 @@ "en": "Lightweight git forge", "fr": "Forge git légère" }, + "version": "0.11.66~ynh1", "url": "http://gogs.io", "license": "MIT", - "version": "0.11.66~ynh1", "maintainer": { "name": "Josué Tille", "email": "josue@tille.ch" @@ -24,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 2.7.12" + "yunohost": ">= 3.8.1" }, "arguments": { "install" : [ @@ -60,7 +59,7 @@ "name": "is_public", "type": "boolean", "ask": { - "en": "Is it a public site ?", + "en": "Is it a public site?", "fr": "Est-ce un site public ?" }, "default": true From 8ae491b0e854fee4c9122c211c13604dcd6fe41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Nov 2020 23:08:23 +0100 Subject: [PATCH 07/96] Update README.md --- README.md | 78 +++++++++++++++++++++++-------------------------------- 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index 1e22aa8..9c6944f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ -# Gogs package for YunoHost - -Gogs is a self-hosted Git service written in Go. Alternative to Github. -- [Gogs website](http://gogs.io) - -[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://ci-apps.yunohost.org/jenkins/job/gogs%20%28Community%29/lastBuild/consoleFull) +# Gogs for YunoHost +[![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) [![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=gogs) # IMPORTANT INFORMATION @@ -12,6 +8,20 @@ Gogs is a self-hosted Git service written in Go. Alternative to Github. **Note that this package will not be longer be maintened by the actual maintener. The idea is to migrate to [gitea](https://github.com/YunoHost-Apps/gitea_ynh) which is more featured.** +## Overview +Gogs is a self-hosted Git service written in Go. Alternative to Github. + +**Shipped version:** 0.11.66 + +## Screenshots + +![](https://gogs.io/img/screenshots/2.png) + + +## Demo + +* [Official demo](https://try.gogs.io/user/login) + For the old install you can migrate to gitea easly by juste upgrading your actuall gogs instance with the gitea source by this command: ``` sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/gitea_ynh gogs @@ -27,19 +37,6 @@ For the new install just install gitea by this command: sudo yunohost app install -l Gitea https://github.com/YunoHost-Apps/gitea_ynh ``` -## Requirements -A functional instance of [YunoHost](https://yunohost.org) - -## Installation -From the command-line: - -`sudo yunohost app install -l Gogs https://github.com/YunoHost-Apps/gogs_ynh` - -## Upgrade -From the command-line: - -`sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/gogs_ynh gogs` - ## 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: @@ -65,39 +62,28 @@ Previous versions of this package used to build Gogs from sources instead of usi Also, in some cases, Gogs will not restart properly during the update. If so, you can rerun the update safely or try to start Gogs with `sudo systemctl restart gogs.service`. -Sources and issues of the old package can be found [here](https://github.com/YunoHost-Apps/gogs_ynh_old/) -## Info -Gogs v0.11.66 +#### Supported architectures -- [YunoHost forum thread](https://forum.yunohost.org/t/gogs-package-an-awesome-github-alternative/1127) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/gogs%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/gogs/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/gogs%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/gogs/) -Architecture: this package is compatible with amd64, i386 and arm. The package will try to detect it with the command uname -m and fail if it can't detect the architecture. If that happens please open an issue describing your hardware and the result of the command `uname -m`. +## Links -## 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. + * Report a bug: https://github.com/YunoHost-Apps/gogs_ynh/issues + * App website: http://gogs.io + * Upstream app repository: https://github.com/gogs/gogs + * YunoHost website: https://yunohost.org/ -## Issue +--- -Any issue is welcome here : https://github.com/YunoHost-Apps/gogs_ynh/issues +## Developer info -## License -Gogs is published under the MIT License: -https://github.com/gogits/gogs/blob/master/LICENSE - -This package is published under the MIT License. - - -## Developper info -Please do your pull requests to the `dev` branch. - -Test or upgrade to dev version: -```bash -sudo su - admin -git clone -b dev https://github.com/YunoHost-Apps/gogs_ynh -# to install -sudo yunohost app install -l Gogs /home/admin/gogs_ynh -# to upgrade -sudo yunohost app upgrade -f /home/admin/gogs_ynh gogs +Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gogs_ynh/tree/testing). +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug +or +sudo yunohost app upgrade gogs -u https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug ``` From b0dd390f9d2042df08f2a844ad81176a3e86dc16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Nov 2020 23:10:09 +0100 Subject: [PATCH 08/96] Update README.md --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9c6944f..7afdd81 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,11 @@ [![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) [![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=gogs) -# IMPORTANT INFORMATION +> *This package allows you to install Gogs quickly and simply on a YunoHost server. +If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* -**Note that this package will not be longer be maintened by the actual maintener. -The idea is to migrate to [gitea](https://github.com/YunoHost-Apps/gitea_ynh) which is more featured.** +> :warning: **Note that this package will not be longer be maintened by the actual maintener. +> The idea is to migrate to [gitea](https://github.com/YunoHost-Apps/gitea_ynh) which is more featured.** ## Overview Gogs is a self-hosted Git service written in Go. Alternative to Github. From 299913f64c5632b47a422117510946bf2f13cd56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Nov 2020 23:12:19 +0100 Subject: [PATCH 09/96] Update arm.src --- conf/arm.src | 6 ------ 1 file changed, 6 deletions(-) diff --git a/conf/arm.src b/conf/arm.src index 7c882e3..af22379 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,11 +1,5 @@ SOURCE_URL=https://github.com/gogits/gogs/releases/download/v0.11.79/raspi2_armv6.zip SOURCE_SUM=a7d17f6dc542fd2d88f884271bca9c62729fbd725fdb310616b2987dba382631 -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=zip -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true From 048dc5fdf1d8070cd86b655b654e7a815e23f207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Nov 2020 23:12:43 +0100 Subject: [PATCH 10/96] Update i386.src --- conf/i386.src | 6 ------ 1 file changed, 6 deletions(-) diff --git a/conf/i386.src b/conf/i386.src index abf6148..da1dc46 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,11 +1,5 @@ SOURCE_URL=https://github.com/gogits/gogs/releases/download/v0.11.79/linux_386.zip SOURCE_SUM=ad1a89eb01723a4b289b7b8773fd018f78b0dad801101f27c1af0f2d649edeeb -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=zip -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true From f3827df3690abaf49d270de0695ec9751ac42a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 3 Nov 2020 23:13:06 +0100 Subject: [PATCH 11/96] Update x86-64.src --- conf/x86-64.src | 6 ------ 1 file changed, 6 deletions(-) diff --git a/conf/x86-64.src b/conf/x86-64.src index cd8f52b..94bb3a0 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,11 +1,5 @@ SOURCE_URL=https://github.com/gogits/gogs/releases/download/v0.11.79/linux_amd64.zip SOURCE_SUM=85f60494de63e6c4af16faba9bc739eb7c9e5477de1f16d11c6665495141162f -# (Optional) Program to check the integrity (sha256sum, md5sum...) -# default: sha256 SOURCE_SUM_PRG=sha256sum -# (Optional) Archive format -# default: tar.gz SOURCE_FORMAT=zip -# (Optional) Put false if sources are directly in the archive root -# default: true SOURCE_IN_SUBDIR=true From 9818bda151ded179a61c552d44404b5dcc6fd5d2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 18 Nov 2020 17:59:20 +0100 Subject: [PATCH 12/96] Fix --- check_process | 11 ----- manifest.json | 4 +- scripts/change_url | 13 +++-- scripts/install | 120 +++++++++++++++++++++++++++++++++++++++------ scripts/restore | 32 +++++++++--- scripts/upgrade | 13 +++-- 6 files changed, 149 insertions(+), 44 deletions(-) diff --git a/check_process b/check_process index e03f6ef..d60ae23 100644 --- a/check_process +++ b/check_process @@ -16,21 +16,10 @@ upgrade=1 from_commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 backup_restore=1 multi_instance=1 - incorrect_path=0 port_already_use=1 (6000) change_url=1 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto - # https://github.com/YunoHost-Apps/gogs_ynh/blob/master/conf/login_source.sql - Level 4=1 Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 ;;; Upgrade options ; commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab name=Before multi_instance and refactoring diff --git a/manifest.json b/manifest.json index 0994575..d4d8617 100644 --- a/manifest.json +++ b/manifest.json @@ -6,9 +6,9 @@ "en": "Lightweight git forge", "fr": "Forge git légère" }, + "version": "0.12.3~ynh1", "url": "http://gogs.io", "license": "MIT", - "version": "0.12.3~ynh1", "maintainer": { "name": "Josué Tille", "email": "josue@tille.ch" @@ -23,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 3.8.1" + "yunohost": ">= 4.0.0" }, "arguments": { "install" : [ diff --git a/scripts/change_url b/scripts/change_url index fb02f6c..36c742a 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,21 +1,24 @@ #!/bin/bash #================================================= -# GENERIC START +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS #================================================= -# IMPORT GENERIC HELPERS +source _common.sh source /usr/share/yunohost/helpers # Exit if an error occurs during the execution of the script ynh_abort_if_errors -# Import common cmd -source ./_common.sh - +#================================================= # RETRIEVE ARGUMENTS +#================================================= + old_domain=$YNH_APP_OLD_DOMAIN domain=$YNH_APP_NEW_DOMAIN + path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'}) app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/install b/scripts/install index b97b0a9..89da145 100644 --- a/scripts/install +++ b/scripts/install @@ -3,15 +3,25 @@ #================================================= # GENERIC START #================================================= - # IMPORT GENERIC HELPERS +#================================================= + +source _common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors -# Load common variables and helpers -source ./_common.sh +#================================================= +# RETRIEVE ARGUMENTS FROM THE MANIFEST +#================================================= # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN @@ -19,6 +29,9 @@ path_url=$(ynh_normalize_url_path $YNH_APP_ARG_PATH) admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +app=$YNH_APP_INSTANCE_NAME + + # Check domain/path availability ynh_webpath_available $domain $path_url || ynh_die "$domain is not available as domain, please use an other domain." ynh_webpath_register $app $domain $path_url @@ -57,36 +70,115 @@ test getent passwd "$app" &>/dev/null || \ useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ ynh_die "Unable to create $app system account" +#================================================= +# CREAT DIRECTORIES +#================================================= + # create needed directories -create_dir +mkdir -p "$final_path/data" +mkdir -p "$final_path/custom/conf/auth.d" +mkdir -p "$DATA_PATH/avatars" +mkdir -p "$DATA_PATH/attachments" +mkdir -p "/var/log/$app" + +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=3 + +ynh_setup_source --dest_dir=$final_path $architecture + +#================================================= +# MODIFY A CONFIG FILE +#================================================= + +cp ../conf/app.ini "$final_path/custom/conf" +cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" + +if [ "$path_url" = "/" ] +then + ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +else + ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" +fi + +ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$dbpass" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$dbuser" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" + +if [[ "$is_public" = '1' ]] +then + ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" +else + ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" +fi + +ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/custom/conf/auth.d/ldap.conf" + +ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" +ynh_store_file_checksum --file="$final_path/custom/conf/auth.d/ldap.conf" + -# Install Gogs -ynh_setup_source $final_path $architecture -# Configure gogs with app.ini file -config_gogs # Configure init script ynh_add_systemd_config +#================================================= +# CONFIGURE NGINX +#================================================= # Modify Nginx configuration file and copy it to Nginx conf directory -config_nginx +if [ "$path_url" != "/" ] +then + ynh_replace_string --match_string="^#sub_path_only" --replace_string="" --target_file="../conf/nginx.conf" +fi + ynh_add_nginx_config #================================================= # GENERIC FINALIZATION #================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +chown -R $app:$app "$final_path" +chown -R $app:$app "/home/$app" +chown -R $app:$app "/var/log/$app" +chmod u=rwX,g=rX,o= "$final_path" +chmod u=rwX,g=rX,o= "/home/$app" +chmod u=rwX,g=rX,o= "/var/log/$app" -# Set permissions -set_permission # Unprotect root from SSO if public set_access_settings -# Add Gogs to YunoHost's monitored services +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + yunohost service add "$app" --log "/var/log/$app/$app.log" -# Configure logrotate +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 + ynh_use_logrotate "/var/log/$app" -# Reload services +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=1 + ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/restore b/scripts/restore index f135ead..4fd1ad7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -3,21 +3,37 @@ #================================================= # GENERIC START #================================================= - # IMPORT GENERIC HELPERS +#================================================= + +#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +ynh_clean_setup () { + #### Remove this function if there's nothing to clean before calling the remove script. + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors -# Load common variables and helpers -source ../settings/scripts/_common.sh +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --weight=1 + +app=$YNH_APP_INSTANCE_NAME + +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path) +dbpass=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +admin=$(ynh_app_setting_get --app=$app --key=adminusername) + -# Retrieve old app settings -domain=$(ynh_app_setting_get "$app" domain) -path_url=$(ynh_app_setting_get "$app" path) -dbpass=$(ynh_app_setting_get "$app" mysqlpwd) -admin=$(ynh_app_setting_get "$app" adminusername) # Check domain/path availability with app helper ynh_webpath_available $domain $path_url || ynh_die "$domain is not available as domain, please use an other domain." diff --git a/scripts/upgrade b/scripts/upgrade index 483f6b4..03b953b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,17 +3,22 @@ #================================================= # GENERIC START #================================================= - # IMPORT GENERIC HELPERS +#================================================= + +source _common.sh source /usr/share/yunohost/helpers # Exit if an error occurs during the execution of the script ynh_abort_if_errors -# Load common variables and helpers -source ./_common.sh +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --weight=1 + +app=$YNH_APP_INSTANCE_NAME -# Retrieve app settings domain=$(ynh_app_setting_get "$app" domain) path_url=$(ynh_normalize_url_path $(ynh_app_setting_get "$app" path)) dbpass=$(ynh_app_setting_get "$app" mysqlpwd) From 3a2be9d683431f0956b5b0b4c9e8939d47a8db4d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 08:45:49 +0100 Subject: [PATCH 13/96] Fix linter warnings --- check_process | 10 ------ scripts/backup | 2 +- scripts/change_url | 2 +- scripts/experimental_helper.sh | 61 ---------------------------------- scripts/install | 2 +- scripts/remove | 1 - scripts/restore | 1 - scripts/upgrade | 1 - 8 files changed, 3 insertions(+), 77 deletions(-) delete mode 100644 scripts/experimental_helper.sh diff --git a/check_process b/check_process index 14429cb..a62c0f4 100644 --- a/check_process +++ b/check_process @@ -21,17 +21,7 @@ port_already_use=1 (6000) change_url=1 ;;; Levels - Level 1=auto - Level 2=auto - Level 3=auto - # https://github.com/YunoHost-Apps/gogs_ynh/blob/master/conf/login_source.sql - Level 4=1 Level 5=auto - Level 6=auto - Level 7=auto - Level 8=0 - Level 9=0 - Level 10=0 ;;; Upgrade options ; commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab name=Before multi_instance and refactoring diff --git a/scripts/backup b/scripts/backup index 772fae0..aef132b 100644 --- a/scripts/backup +++ b/scripts/backup @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ../settings/scripts/experimental_helper.sh + source ../settings/scripts/_common.sh # Retrieve app settings diff --git a/scripts/change_url b/scripts/change_url index c85fa31..883baf6 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Import common cmd -source ./experimental_helper.sh + source ./_common.sh # RETRIEVE ARGUMENTS diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh deleted file mode 100644 index 600a653..0000000 --- a/scripts/experimental_helper.sh +++ /dev/null @@ -1,61 +0,0 @@ -# Delete a file checksum from the app settings -# -# $app should be defined when calling this helper -# -# usage: ynh_remove_file_checksum file -# | arg: file - The file for which the checksum will be deleted -ynh_delete_file_checksum () { - local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_' - ynh_app_setting_delete $app $checksum_setting_name -} - -# Start or restart a service and follow its booting -# -# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name] -# -# | arg: Line to match - The line to find in the log to attest the service have finished to boot. -# | arg: Log file - The log file to watch -# | arg: Service name -# /var/log/$app/$app.log will be used if no other log is defined. -# | arg: Timeout - The maximum time to wait before ending the watching. Defaut 300 seconds. -ynh_check_starting () { - local line_to_match="$1" - local service_name="${4:-$app}" - local app_log="${2:-/var/log/$service_name/$service_name.log}" - local timeout=${3:-300} - - ynh_clean_check_starting () { - # Stop the execution of tail. - kill -s 15 $pid_tail 2>&1 - ynh_secure_remove "$templog" 2>&1 - } - - echo "Starting of $service_name" >&2 - systemctl stop $service_name - local templog="$(mktemp)" - # Following the starting of the app in its log - tail -F -n0 "$app_log" > "$templog" & - # Get the PID of the tail command - local pid_tail=$! - systemctl start $service_name - - local i=0 - for i in `seq 1 $timeout` - do - # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout - if grep --quiet "$line_to_match" "$templog" - then - echo "The service $service_name has correctly started." >&2 - break - fi - echo -n "." >&2 - sleep 1 - done - if [ $i -eq $timeout ] - then - echo "The service $service_name didn't fully started before the timeout." >&2 - fi - - echo "" - ynh_clean_check_starting -} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 76586ee..d2a8f2f 100644 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ./experimental_helper.sh + source ./_common.sh # Retrieve arguments diff --git a/scripts/remove b/scripts/remove index 681dd01..e5deb31 100644 --- a/scripts/remove +++ b/scripts/remove @@ -8,7 +8,6 @@ source /usr/share/yunohost/helpers # Load common variables and helpers -source ./experimental_helper.sh source ./_common.sh #================================================= diff --git a/scripts/restore b/scripts/restore index 27b6ee5..f135ead 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ../settings/scripts/experimental_helper.sh source ../settings/scripts/_common.sh # Retrieve old app settings diff --git a/scripts/upgrade b/scripts/upgrade index 82d0b6d..483f6b4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers ynh_abort_if_errors # Load common variables and helpers -source ./experimental_helper.sh source ./_common.sh # Retrieve app settings From 520fad9304b2f0549166f56a1b08a318d5402405 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 08:56:54 +0100 Subject: [PATCH 14/96] Fix back-up script --- scripts/backup | 70 ++++++++++++++++++++++++++++++++++++++----------- scripts/install | 2 +- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/scripts/backup b/scripts/backup index aef132b..490a4b0 100644 --- a/scripts/backup +++ b/scripts/backup @@ -3,36 +3,76 @@ #================================================= # GENERIC START #================================================= - # IMPORT GENERIC HELPERS +#================================================= + +source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +ynh_clean_setup () { + true +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors -# Load common variables and helpers +#================================================= +# LOAD SETTINGS +#================================================= +ynh_print_info --message="Loading installation settings..." -source ../settings/scripts/_common.sh +app=$YNH_APP_INSTANCE_NAME # Retrieve app settings -domain=$(ynh_app_setting_get "$app" domain) +domain=$(ynh_app_setting_get --app=$app --key=domain) + +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." #================================================= # STANDARD BACKUP STEPS #================================================= -# Copy the app source files -ynh_backup "$final_path" +ynh_backup --src_path="$final_path" -# Copy the data files -ynh_backup "$DATADIR" +#================================================= +# BACKUP DATA FILES +#================================================= -# Copy the conf files -ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" -ynh_backup "/etc/systemd/system/${app}.service" +ynh_backup --src_path="$DATADIR" -# Backup logs -ynh_backup "/var/log/$app" +#================================================= +# BACKUP THE NGINX CONFIGURATION +#================================================= -# Dump the database -ynh_mysql_dump_db "$dbname" > ./db.sql \ No newline at end of file +ynh_backup --src_path="/etc/nginx/conf.d/${domain}.d/${app}.conf" + +#================================================= +# BACKUP SYSTEMD +#================================================= + +ynh_backup --src_path="/etc/systemd/system/${app}.service" + +#================================================= +# BACKUP VARIOUS FILES +#================================================= + +ynh_backup --src_path="/var/log/$app" + +#================================================= +# BACKUP THE MYSQL DATABASE +#================================================= +ynh_print_info --message="Backing up the MySQL database..." + +ynh_mysql_dump_db "$dbname" > ./db.sql + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/install b/scripts/install index d2a8f2f..6838126 100644 --- a/scripts/install +++ b/scripts/install @@ -90,4 +90,4 @@ yunohost service add "$app" --log "/var/log/$app/$app.log" ynh_use_logrotate "/var/log/$app" # Reload services -ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" +ynh_clean_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" From 5251631f03ab1a56aac6a4d54da89c5c7d1355bb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 09:20:50 +0100 Subject: [PATCH 15/96] fix --- scripts/_common.sh | 5 +-- scripts/install | 86 +++++++++++++++++++++++++++++++--------------- 2 files changed, 59 insertions(+), 32 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ae6de87..89ea043 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -2,10 +2,7 @@ # SET ALL CONSTANTS #================================================= -app=$YNH_APP_INSTANCE_NAME -dbname=$app -dbuser=$app -final_path="/opt/$app" + DATADIR="/home/$app" REPO_PATH="$DATADIR/repositories" DATA_PATH="$DATADIR/data" diff --git a/scripts/install b/scripts/install index 89da145..d679a9e 100644 --- a/scripts/install +++ b/scripts/install @@ -25,44 +25,68 @@ ynh_abort_if_errors # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN -path_url=$(ynh_normalize_url_path $YNH_APP_ARG_PATH) +path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME +#================================================= +# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS +#================================================= +ynh_script_progression --message="Validating installation parameters..." --weight=1 -# Check domain/path availability -ynh_webpath_available $domain $path_url || ynh_die "$domain is not available as domain, please use an other domain." -ynh_webpath_register $app $domain $path_url +final_path=/opt/$app +test ! -e "$final_path" || ynh_die --message="This path already contains a folder" + +# Register (book) web path +ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url -# Check user parameter -ynh_user_exists "$admin" \ - || ynh_die "The chosen admin user does not exist." -# Check Final Path availability -test ! -e "$final_path" || ynh_die "This path already contains a folder" # Generate random password and key -dbpass=$(ynh_string_random) + key=$(ynh_string_random) -# Find available ports -port=$(ynh_find_port 6000) -# Store Settings -ynh_app_setting_set $app mysqlpwd $dbpass -ynh_app_setting_set $app adminusername $admin -ynh_app_setting_set $app is_public $is_public -ynh_app_setting_set $app secret_key $key -ynh_app_setting_set $app web_port $port + +#================================================= +# STORE SETTINGS FROM MANIFEST +#================================================= +ynh_script_progression --message="Storing installation settings..." --weight=1 + +ynh_app_setting_set --app=$app --key=mysqlpwd --value=$dbpass +ynh_app_setting_set --app=$app --key=adminusername --value=$admin +ynh_app_setting_set --app=$app --key=is_public --value=$is_public +ynh_app_setting_set --app=$app --key=secret_key --value=$key +ynh_app_setting_set --app=$app --key=web_port --value=$port #================================================= # STANDARD MODIFICATIONS #================================================= +# FIND AND OPEN A PORT +#================================================= +ynh_script_progression --message="Configuring firewall..." --weight=1 -# Initialize database and store mysql password for upgrade -ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass" +# Find an available port +port=$(ynh_find_port --port=6000) +ynh_app_setting_set --app=$app --key=port --value=$port + +#================================================= +# CREATE A MYSQL DATABASE +#================================================= +ynh_script_progression --message="Creating a MySQL database..." --weight=1 + +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 + + +dbpass=$(ynh_string_random) #to be changed +#================================================= +# STANDARD MODIFICATIONS +#================================================= # Add users # We can't use the official helper because we need to set the shell for the login @@ -130,14 +154,12 @@ ynh_store_file_checksum --file="$final_path/custom/conf/auth.d/ldap.conf" ynh_add_systemd_config #================================================= -# CONFIGURE NGINX +# NGINX CONFIGURATION #================================================= -# Modify Nginx configuration file and copy it to Nginx conf directory -if [ "$path_url" != "/" ] -then - ynh_replace_string --match_string="^#sub_path_only" --replace_string="" --target_file="../conf/nginx.conf" -fi - ynh_add_nginx_config +ynh_script_progression --message="Configuring nginx web server..." --weight=1 + +# Create a dedicated nginx config +ynh_add_nginx_config #================================================= # GENERIC FINALIZATION @@ -175,7 +197,15 @@ ynh_use_logrotate "/var/log/$app" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" + +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT From 2400eee2b1a962d1a6ec32eabc2c58346ffd9782 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 09:28:52 +0100 Subject: [PATCH 16/96] Fix --- conf/nginx.conf | 11 ++++++----- scripts/_common.sh | 36 +----------------------------------- scripts/change_url | 2 +- scripts/install | 7 +++---- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 6 files changed, 14 insertions(+), 48 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 4aca76b..2521185 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,16 +1,17 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { + + # Force https + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + proxy_pass http://localhost:__PORT__/; proxy_set_header Host $host; proxy_buffering off; fastcgi_param REMOTE_USER $remote_user; client_max_body_size 200M; - # Force https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } diff --git a/scripts/_common.sh b/scripts/_common.sh index 89ea043..6176b97 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -120,38 +120,4 @@ ynh_check_starting () { local app_log="${2:-/var/log/$service_name/$service_name.log}" local timeout=${3:-300} - ynh_clean_check_starting () { - # Stop the execution of tail. - kill -s 15 $pid_tail 2>&1 - ynh_secure_remove "$templog" 2>&1 - } - - echo "Starting of $service_name" >&2 - systemctl stop $service_name - local templog="$(mktemp)" - # Following the starting of the app in its log - tail -F -n0 "$app_log" > "$templog" & - # Get the PID of the tail command - local pid_tail=$! - systemctl start $service_name - - local i=0 - for i in `seq 1 $timeout` - do - # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout - if grep --quiet "$line_to_match" "$templog" - then - echo "The service $service_name has correctly started." >&2 - break - fi - echo -n "." >&2 - sleep 1 - done - if [ $i -eq $timeout ] - then - echo "The service $service_name didn't fully started before the timeout." >&2 - fi - - echo "" - ynh_clean_check_starting -} + \ No newline at end of file diff --git a/scripts/change_url b/scripts/change_url index 36c742a..b7998fe 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -22,7 +22,7 @@ domain=$YNH_APP_NEW_DOMAIN path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'}) app=$YNH_APP_INSTANCE_NAME -dbpass=$(ynh_app_setting_get "$app" mysqlpwd) +db_pwd=$(ynh_app_setting_get "$app" mysqlpwd) admin=$(ynh_app_setting_get "$app" adminusername) key=$(ynh_app_setting_get "$app" secret_key) port=$(ynh_app_setting_get "$app" web_port) diff --git a/scripts/install b/scripts/install index d679a9e..26e6d8c 100644 --- a/scripts/install +++ b/scripts/install @@ -81,9 +81,8 @@ 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 +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) - -dbpass=$(ynh_string_random) #to be changed #================================================= # STANDARD MODIFICATIONS #================================================= @@ -127,8 +126,8 @@ else fi ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$dbpass" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$dbuser" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" diff --git a/scripts/restore b/scripts/restore index 4fd1ad7..5222e54 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,7 +30,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -dbpass=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin=$(ynh_app_setting_get --app=$app --key=adminusername) diff --git a/scripts/upgrade b/scripts/upgrade index 03b953b..75dbcaf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,7 +21,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get "$app" domain) path_url=$(ynh_normalize_url_path $(ynh_app_setting_get "$app" path)) -dbpass=$(ynh_app_setting_get "$app" mysqlpwd) +db_pwd=$(ynh_app_setting_get "$app" mysqlpwd) admin=$(ynh_app_setting_get "$app" adminusername) key=$(ynh_app_setting_get "$app" secret_key) is_public=$(ynh_app_setting_get "$app" is_public) @@ -87,7 +87,7 @@ fi # Remove old authentification mecanisme, actually the registry in the database has been replaced by a config file if [[ ! -e "$final_path/custom/conf/auth.d/ldap.conf" ]] then - ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" <<< "DELETE FROM login_source WHERE name = 'Yunohost LDAP';" + ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" <<< "DELETE FROM login_source WHERE name = 'Yunohost LDAP';" mkdir -p "$final_path/custom/conf/auth.d" fi From 7d2369f8dfce140ccda56cfd8c200ce6c53a92f3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 09:33:27 +0100 Subject: [PATCH 17/96] Fix --- scripts/_common.sh | 2 +- scripts/install | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6176b97..f0f9832 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -119,5 +119,5 @@ ynh_check_starting () { local service_name="${4:-$app}" local app_log="${2:-/var/log/$service_name/$service_name.log}" local timeout=${3:-300} - +} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 26e6d8c..c694fdb 100644 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,6 @@ key=$(ynh_string_random) #================================================= ynh_script_progression --message="Storing installation settings..." --weight=1 -ynh_app_setting_set --app=$app --key=mysqlpwd --value=$dbpass ynh_app_setting_set --app=$app --key=adminusername --value=$admin ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=secret_key --value=$key From 73bf03bc6a26c984634aedc89a90d97fdc71b751 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 09:37:34 +0100 Subject: [PATCH 18/96] Update install --- scripts/install | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/install b/scripts/install index c694fdb..dc7d763 100644 --- a/scripts/install +++ b/scripts/install @@ -42,14 +42,10 @@ test ! -e "$final_path" || ynh_die --message="This path already contains a folde # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url - - # Generate random password and key key=$(ynh_string_random) - - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= @@ -58,7 +54,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=adminusername --value=$admin ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=secret_key --value=$key -ynh_app_setting_set --app=$app --key=web_port --value=$port #================================================= # STANDARD MODIFICATIONS From ec197bf6429dfcf22b8f24f2f8ee1add00649cc6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 09:46:58 +0100 Subject: [PATCH 19/96] Update install --- scripts/install | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index dc7d763..caa39f0 100644 --- a/scripts/install +++ b/scripts/install @@ -103,6 +103,8 @@ mkdir -p "/var/log/$app" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 +ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path $architecture #================================================= From 707d9f796b1dc3f5c7a2aa66b1db02c5e3bbf94b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 09:56:25 +0100 Subject: [PATCH 20/96] fix --- check_process | 12 +++++------- scripts/install | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/check_process b/check_process index d60ae23..d68c2c9 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,9 @@ ;; General ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" (DOMAIN) + path="/path" (PATH) + admin="john" (USER) + is_public=1 (PUBLIC|public=1|private=0) ; Checks pkg_linter=1 setup_sub_dir=1 @@ -12,11 +12,9 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab - upgrade=1 from_commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 backup_restore=1 multi_instance=1 - port_already_use=1 (6000) + port_already_use=1 change_url=1 ;;; Levels Level 5=auto diff --git a/scripts/install b/scripts/install index caa39f0..fc7e0a5 100644 --- a/scripts/install +++ b/scripts/install @@ -36,7 +36,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= ynh_script_progression --message="Validating installation parameters..." --weight=1 -final_path=/opt/$app +final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path @@ -51,7 +51,9 @@ key=$(ynh_string_random) #================================================= 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=adminusername --value=$admin +ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=secret_key --value=$key @@ -77,6 +79,15 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#================================================= +# 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 +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir=$final_path $architecture + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -98,15 +109,6 @@ mkdir -p "$DATA_PATH/avatars" mkdir -p "$DATA_PATH/attachments" mkdir -p "/var/log/$app" -#================================================= -# 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 -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$final_path $architecture - #================================================= # MODIFY A CONFIG FILE #================================================= From 715e6ee32b5376f59a70ac563903be9beebab469 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 10:09:41 +0100 Subject: [PATCH 21/96] Fix --- conf/{arm.src => armv7.src} | 0 scripts/_common.sh | 33 ++++++++++++++++++++++++++++++++- scripts/install | 3 ++- 3 files changed, 34 insertions(+), 2 deletions(-) rename conf/{arm.src => armv7.src} (100%) diff --git a/conf/arm.src b/conf/armv7.src similarity index 100% rename from conf/arm.src rename to conf/armv7.src diff --git a/scripts/_common.sh b/scripts/_common.sh index f0f9832..d95bb40 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,16 +10,47 @@ DATA_PATH="$DATADIR/data" # Detect the system architecture to download the right tarball # NOTE: `uname -m` is more accurate and universal than `arch` # See https://en.wikipedia.org/wiki/Uname +ynh_detect_arch(){ + local architecture if [ -n "$(uname -m | grep 64)" ]; then architecture="x86-64" elif [ -n "$(uname -m | grep 86)" ]; then architecture="i386" elif [ -n "$(uname -m | grep arm)" ]; then - architecture="arm" + architecture="armv7" else ynh_die "Unable to detect your achitecture, please open a bug describing \ your hardware and the result of the command \"uname -m\"." 1 fi +} + + +# Check the architecture +# +# example: architecture=$(ynh_detect_arch) +# +# usage: ynh_detect_arch +# +# Requires YunoHost version 2.2.4 or higher. +# ynh_detect_arch(){ +# local architecture +# if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then +# architecture="arm64" +# elif [ -n "$(uname -m | grep 86)" ]; then +# architecture="i386" +# elif [ -n "$(uname -m | grep 64)" ]; then +# architecture="x86-64" +# elif [ -n "$(uname -m | grep armv7)" ]; then +# architecture="armv7" +# elif [ -n "$(uname -m | grep armv6)" ]; then +# architecture="armv6" +# elif [ -n "$(uname -m | grep armv5)" ]; then +# architecture="armv5" +# else +# architecture="unknown" +# fi +# echo $architecture +# } #================================================= # DEFINE ALL COMMON FONCTIONS diff --git a/scripts/install b/scripts/install index fc7e0a5..ae7ee3a 100644 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC +architecture=$(ynh_detect_arch) app=$YNH_APP_INSTANCE_NAME @@ -86,7 +87,7 @@ ynh_script_progression --message="Setting up source files..." --weight=3 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$final_path $architecture +ynh_setup_source --dest_dir=$final_path --source_id="$architecture" #================================================= # STANDARD MODIFICATIONS From b8ff995b62a0ef8f61cd671df7c12c669abf02cd Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 10:22:05 +0100 Subject: [PATCH 22/96] Update _common.sh --- scripts/_common.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d95bb40..20fa5a2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -12,16 +12,17 @@ DATA_PATH="$DATADIR/data" # See https://en.wikipedia.org/wiki/Uname ynh_detect_arch(){ local architecture -if [ -n "$(uname -m | grep 64)" ]; then - architecture="x86-64" -elif [ -n "$(uname -m | grep 86)" ]; then - architecture="i386" -elif [ -n "$(uname -m | grep arm)" ]; then - architecture="armv7" -else - ynh_die "Unable to detect your achitecture, please open a bug describing \ - your hardware and the result of the command \"uname -m\"." 1 -fi + if [ -n "$(uname -m | grep 64)" ]; then + architecture="x86-64" + elif [ -n "$(uname -m | grep 86)" ]; then + architecture="i386" + elif [ -n "$(uname -m | grep arm)" ]; then + architecture="armv7" + else + ynh_die "Unable to detect your achitecture, please open a bug describing \ + your hardware and the result of the command \"uname -m\"." 1 + fi + echo $architecture } From f714d51c3fa53b2eb5ea1195a4b86ddbfad28973 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 10:40:14 +0100 Subject: [PATCH 23/96] fix --- scripts/_common.sh | 4 ++-- scripts/install | 32 +++++++++++++++++++------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 20fa5a2..e3c14e2 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -21,8 +21,8 @@ ynh_detect_arch(){ else ynh_die "Unable to detect your achitecture, please open a bug describing \ your hardware and the result of the command \"uname -m\"." 1 - fi - echo $architecture + fi + echo $architecture } diff --git a/scripts/install b/scripts/install index ae7ee3a..82cd81f 100644 --- a/scripts/install +++ b/scripts/install @@ -89,6 +89,24 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path --source_id="$architecture" +#================================================= +# CREAT DIRECTORIES +#================================================= + +mkdir -p "/home/$app" + +DATADIR="/home/$app" + +REPO_PATH="/home/$app/repositories" +DATA_PATH="/home/$app/data" + +# create needed directories +mkdir -p "$final_path/data" +mkdir -p "$final_path/custom/conf/auth.d" +mkdir -p "/home/$app/data/avatars" +mkdir -p "/home/$app/data/attachments" +mkdir -p "/var/log/$app" + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -96,20 +114,9 @@ ynh_setup_source --dest_dir=$final_path --source_id="$architecture" # Add users # We can't use the official helper because we need to set the shell for the login test getent passwd "$app" &>/dev/null || \ - useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + useradd -d "/home/$app" --system --user-group "$app" --shell /bin/bash || \ ynh_die "Unable to create $app system account" -#================================================= -# CREAT DIRECTORIES -#================================================= - -# create needed directories -mkdir -p "$final_path/data" -mkdir -p "$final_path/custom/conf/auth.d" -mkdir -p "$DATA_PATH/avatars" -mkdir -p "$DATA_PATH/attachments" -mkdir -p "/var/log/$app" - #================================================= # MODIFY A CONFIG FILE #================================================= @@ -172,7 +179,6 @@ chmod u=rwX,g=rX,o= "$final_path" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" - # Unprotect root from SSO if public set_access_settings From 92212e99e85052c9a12fec7ce3e2626c67a5051a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 10:49:08 +0100 Subject: [PATCH 24/96] fix --- scripts/install | 2 +- scripts/remove | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 82cd81f..22a574a 100644 --- a/scripts/install +++ b/scripts/install @@ -207,7 +207,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index 6dabec1..d31ed84 100644 --- a/scripts/remove +++ b/scripts/remove @@ -63,9 +63,9 @@ ynh_secure_remove --file="$final_path" # REMOVE VARIOUS FILES #================================================= -ynh_secure_remove "$DATADIR" +ynh_secure_remove --file="/home/$app" -ynh_secure_remove "/var/log/$app" +ynh_secure_remove --file="/var/log/$app" #================================================= # REMOVE LOGROTATE CONFIGURATION From 4c23496c3aea9efe704e542d89631b2ba5462116 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:02:28 +0100 Subject: [PATCH 25/96] Fix --- conf/app.ini | 2 +- conf/ldap.conf | 2 +- conf/nginx.conf | 2 +- conf/systemd.service | 2 +- scripts/install | 8 +------- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 5a08d74..f32f401 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -9,7 +9,7 @@ RUN_MODE = prod PROTOCOL = http DOMAIN = __DOMAIN__ ROOT_URL = https://__URL__/ -HTTP_ADDR = 0.0.0.0 +HTTP_ADDR = 127.0.0.1 HTTP_PORT = __PORT__ ; Permission for unix socket UNIX_SOCKET_PERMISSION = 666 diff --git a/conf/ldap.conf b/conf/ldap.conf index 52ea4a3..6d811d3 100644 --- a/conf/ldap.conf +++ b/conf/ldap.conf @@ -6,7 +6,7 @@ name = Yunohost LDAP is_activated = true [config] -host = localhost +host = 127.0.0.1 port = 389 # 0 - Unencrypted, 1 - LDAPS, 2 - StartTLS security_protocol = 0 diff --git a/conf/nginx.conf b/conf/nginx.conf index 2521185..89c46de 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,7 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - 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/conf/systemd.service b/conf/systemd.service index e237439..df646e1 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -16,7 +16,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=/home/__APP__ -ExecStart=/opt/__APP__/gogs web +ExecStart=__FINAL_PATH__/gogs web Restart=always Environment=USER=__APP__ HOME=/home/__APP__ diff --git a/scripts/install b/scripts/install index 22a574a..97ff93d 100644 --- a/scripts/install +++ b/scripts/install @@ -43,10 +43,6 @@ test ! -e "$final_path" || ynh_die --message="This path already contains a folde # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url -# Generate random password and key - -key=$(ynh_string_random) - #================================================= # STORE SETTINGS FROM MANIFEST #================================================= @@ -135,7 +131,7 @@ ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" @@ -153,8 +149,6 @@ ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" ynh_store_file_checksum --file="$final_path/custom/conf/auth.d/ldap.conf" - - # Configure init script ynh_add_systemd_config From fdb47fde5dfce303e3bc74744ee934c238d59369 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:06:54 +0100 Subject: [PATCH 26/96] Update install --- scripts/install | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 97ff93d..b814429 100644 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,6 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=adminusername --value=$admin ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=is_public --value=$is_public -ynh_app_setting_set --app=$app --key=secret_key --value=$key #================================================= # STANDARD MODIFICATIONS @@ -76,6 +75,14 @@ ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 + +# Create a system user +ynh_system_user_create --username=$app --home_dir=$final_path + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= From ac1a1187806dd6d54e641ce02aafd4b054ab8148 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:09:54 +0100 Subject: [PATCH 27/96] Update install --- scripts/install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index b814429..5d4ccc0 100644 --- a/scripts/install +++ b/scripts/install @@ -114,11 +114,11 @@ mkdir -p "/var/log/$app" # STANDARD MODIFICATIONS #================================================= -# Add users -# We can't use the official helper because we need to set the shell for the login -test getent passwd "$app" &>/dev/null || \ - useradd -d "/home/$app" --system --user-group "$app" --shell /bin/bash || \ - ynh_die "Unable to create $app system account" +# # Add users +# # We can't use the official helper because we need to set the shell for the login +# test getent passwd "$app" &>/dev/null || \ +# useradd -d "/home/$app" --system --user-group "$app" --shell /bin/bash || \ +# ynh_die "Unable to create $app system account" #================================================= # MODIFY A CONFIG FILE From f2bf6d2faf454b8e9b43cd75e7b5d2a7bd6cb78f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:13:01 +0100 Subject: [PATCH 28/96] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index df646e1..0f08a9d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -16,7 +16,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=/home/__APP__ -ExecStart=__FINAL_PATH__/gogs web +ExecStart=/var/www/gogs/gogs web Restart=always Environment=USER=__APP__ HOME=/home/__APP__ From 98ea08576077b7355abafbc53ac7a7985f05d3f9 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:16:48 +0100 Subject: [PATCH 29/96] Fix --- conf/app.ini | 2 +- conf/ldap.conf | 2 +- conf/nginx.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index f32f401..5a08d74 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -9,7 +9,7 @@ RUN_MODE = prod PROTOCOL = http DOMAIN = __DOMAIN__ ROOT_URL = https://__URL__/ -HTTP_ADDR = 127.0.0.1 +HTTP_ADDR = 0.0.0.0 HTTP_PORT = __PORT__ ; Permission for unix socket UNIX_SOCKET_PERMISSION = 666 diff --git a/conf/ldap.conf b/conf/ldap.conf index 6d811d3..52ea4a3 100644 --- a/conf/ldap.conf +++ b/conf/ldap.conf @@ -6,7 +6,7 @@ name = Yunohost LDAP is_activated = true [config] -host = 127.0.0.1 +host = localhost port = 389 # 0 - Unencrypted, 1 - LDAPS, 2 - StartTLS security_protocol = 0 diff --git a/conf/nginx.conf b/conf/nginx.conf index 89c46de..5b83c4d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,7 +6,7 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__PORT__/; + proxy_pass http://localhost:__PORT__; proxy_set_header Host $host; proxy_buffering off; fastcgi_param REMOTE_USER $remote_user; From 8134c875c897ae289639fa730fb5458de380d8cf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:22:58 +0100 Subject: [PATCH 30/96] fix --- conf/nginx.conf | 18 ++++++++++++------ scripts/_common.sh | 33 --------------------------------- 2 files changed, 12 insertions(+), 39 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5b83c4d..cf3b636 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -5,12 +5,18 @@ location __PATH__/ { if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - - proxy_pass http://localhost:__PORT__; - proxy_set_header Host $host; - proxy_buffering off; - fastcgi_param REMOTE_USER $remote_user; - client_max_body_size 200M; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + rewrite ^__PATH__/gogs/(.*) /$1 break; + rewrite ^__PATH__/gogs$ /$1 break; + proxy_pass http://localhost:__PORT__; + proxy_read_timeout 90; + + client_max_body_size 200M; # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/scripts/_common.sh b/scripts/_common.sh index e3c14e2..6849d61 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -2,11 +2,6 @@ # SET ALL CONSTANTS #================================================= - -DATADIR="/home/$app" -REPO_PATH="$DATADIR/repositories" -DATA_PATH="$DATADIR/data" - # Detect the system architecture to download the right tarball # NOTE: `uname -m` is more accurate and universal than `arch` # See https://en.wikipedia.org/wiki/Uname @@ -25,34 +20,6 @@ ynh_detect_arch(){ echo $architecture } - -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. -# ynh_detect_arch(){ -# local architecture -# if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then -# architecture="arm64" -# elif [ -n "$(uname -m | grep 86)" ]; then -# architecture="i386" -# elif [ -n "$(uname -m | grep 64)" ]; then -# architecture="x86-64" -# elif [ -n "$(uname -m | grep armv7)" ]; then -# architecture="armv7" -# elif [ -n "$(uname -m | grep armv6)" ]; then -# architecture="armv6" -# elif [ -n "$(uname -m | grep armv5)" ]; then -# architecture="armv5" -# else -# architecture="unknown" -# fi -# echo $architecture -# } - #================================================= # DEFINE ALL COMMON FONCTIONS #================================================= From 1eede7976859e1071cfdaa4f7057640a1b75ac2b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:23:52 +0100 Subject: [PATCH 31/96] Update upgrade --- scripts/upgrade | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 75dbcaf..9bb1f10 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,7 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= @@ -23,7 +22,6 @@ domain=$(ynh_app_setting_get "$app" domain) path_url=$(ynh_normalize_url_path $(ynh_app_setting_get "$app" path)) db_pwd=$(ynh_app_setting_get "$app" mysqlpwd) admin=$(ynh_app_setting_get "$app" adminusername) -key=$(ynh_app_setting_get "$app" secret_key) is_public=$(ynh_app_setting_get "$app" is_public) port=$(ynh_app_setting_get "$app" web_port) From 65353785cce8d85f0c89a0fbf068bba95a61b5c2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 20 Nov 2020 11:25:30 +0100 Subject: [PATCH 32/96] Update manifest.json --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index d4d8617..3a5a8e2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "gogs", "packaging_format": 1, "description": { - "en": "Lightweight git forge", - "fr": "Forge git légère" + "en": "Lightweight Git forge", + "fr": "Forge Git légère" }, "version": "0.12.3~ynh1", "url": "http://gogs.io", From 33baffdb2e01ed8d746864c691ae95208a94b586 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 14:08:58 +0100 Subject: [PATCH 33/96] Update restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 5222e54..b094263 100644 --- a/scripts/restore +++ b/scripts/restore @@ -64,7 +64,7 @@ ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ./db.sql # Restore systemd files systemctl daemon-reload -systemctl enable "$app".service +systemctl enable "$app".service --quiet #================================================= # GENERIC FINALIZATION From 224225a7adfe76983853a2971c979c7a915e55bf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 14:12:04 +0100 Subject: [PATCH 34/96] Fix --- check_process | 7 +------ conf/systemd.service | 5 ++--- manifest.json | 4 ++-- scripts/install | 4 ++-- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/check_process b/check_process index d68c2c9..744f63e 100644 --- a/check_process +++ b/check_process @@ -16,10 +16,5 @@ multi_instance=1 port_already_use=1 change_url=1 -;;; Levels - Level 5=auto ;;; Upgrade options - ; commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab - name=Before multi_instance and refactoring - ; commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 - name=From V0.10.18 + diff --git a/conf/systemd.service b/conf/systemd.service index 0f08a9d..e9cac24 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,9 +6,8 @@ After=mysql.service After=slapd.service [Service] -# Modify these two values and uncomment them if you have -# repos with lots of files and get an HTTP error 500 because -# of that +# Modify these two values and uncomment them if you have repos +# with lots of files and get an HTTP error 500 because of that ### #LimitMEMLOCK=infinity #LimitNOFILE=65535 diff --git a/manifest.json b/manifest.json index 3a5a8e2..cbb8d81 100644 --- a/manifest.json +++ b/manifest.json @@ -10,8 +10,8 @@ "url": "http://gogs.io", "license": "MIT", "maintainer": { - "name": "Josué Tille", - "email": "josue@tille.ch" + "name": "", + "email": "" }, "previous_maintainers": { "name": "tostaki", diff --git a/scripts/install b/scripts/install index 5d4ccc0..580937b 100644 --- a/scripts/install +++ b/scripts/install @@ -188,7 +188,7 @@ set_access_settings #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "$app" --log "/var/log/$app/$app.log" +yunohost service add "$app" --log="/var/log/$app/$app.log" #================================================= # SETUP LOGROTATE @@ -208,7 +208,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload From 90d8a28cf6314e6ff3b231d716b029fec3a12597 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 14:40:38 +0100 Subject: [PATCH 35/96] fix --- scripts/backup | 10 +-- scripts/install | 19 +++-- scripts/restore | 3 - scripts/upgrade | 180 ++++++++++++++++++++++++++++-------------------- 4 files changed, 124 insertions(+), 88 deletions(-) diff --git a/scripts/backup b/scripts/backup index 318a30c..aa34e44 100644 --- a/scripts/backup +++ b/scripts/backup @@ -35,28 +35,28 @@ ynh_print_info --message="Declaring files to be backed up..." # BACKUP THE APP MAIN DIR #================================================= -ynh_backup "$final_path" +ynh_backup --src_path="$final_path" # Copy the data files -ynh_backup "$DATADIR" +ynh_backup --src_path="/home/$app" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" +ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP SYSTEMD #================================================= -ynh_backup "/etc/systemd/system/${app}.service" +ynh_backup --src_path="/etc/systemd/system/$app.service" #================================================= # BACKUP VARIOUS FILES #================================================= -ynh_backup "/var/log/$app" +ynh_backup --src_path="/var/log/$app" #================================================= # BACKUP THE MYSQL DATABASE diff --git a/scripts/install b/scripts/install index 580937b..d126627 100644 --- a/scripts/install +++ b/scripts/install @@ -155,14 +155,13 @@ ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" ynh_store_file_checksum --file="$final_path/custom/conf/auth.d/ldap.conf" - # Configure init script ynh_add_systemd_config #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -180,9 +179,6 @@ chmod u=rwX,g=rX,o= "$final_path" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" -# Unprotect root from SSO if public -set_access_settings - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -205,6 +201,19 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +#================================================= +# SETUP SSOWAT +#================================================= +ynh_script_progression --message="Configuring SSOwat..." --weight=1 + +# Make app public if necessary or protect it +if [ $is_public -eq 1 ] +then + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" +fi + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/restore b/scripts/restore index b094263..ae5913a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. true } # Exit if an error occurs during the execution of the script @@ -33,8 +32,6 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin=$(ynh_app_setting_get --app=$app --key=adminusername) - - # Check domain/path availability with app helper ynh_webpath_available $domain $path_url || ynh_die "$domain is not available as domain, please use an other domain." diff --git a/scripts/upgrade b/scripts/upgrade index 9bb1f10..f1f6f20 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,105 +18,135 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME -domain=$(ynh_app_setting_get "$app" domain) -path_url=$(ynh_normalize_url_path $(ynh_app_setting_get "$app" path)) -db_pwd=$(ynh_app_setting_get "$app" mysqlpwd) -admin=$(ynh_app_setting_get "$app" adminusername) -is_public=$(ynh_app_setting_get "$app" is_public) -port=$(ynh_app_setting_get "$app" web_port) +domain=$(ynh_app_setting_get --app=$app --key=domain) +path_url=$(ynh_app_setting_get --app=$app --key=path) +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +admin=$(ynh_app_setting_get --app=$app --key=adminusername) +is_public=$(ynh_app_setting_get --app=$app --key=is_public) +port=$(ynh_app_setting_get --app=$app --key=web_port) + +#================================================= +# CHECK VERSION +#================================================= + +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 # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { + # Restore it if the upgrade fails ynh_restore_upgradebackup } - -# Stop service -systemctl stop "$app".service +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors #================================================= -# MIGRATION FROM OLD VERSION +# STANDARD UPGRADE STEPS #================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 -# Update settings is_public to new standard -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set $app is_public 1 # Fixe is_public en booléen - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set $app is_public 0 - is_public=0 -fi - -if [[ $port == "" ]] -then - port=$(ynh_find_port 6000) - ynh_app_setting_set $app web_port $port -fi - -# handle upgrade from old package installation -# this test that /etc/gogs exist since this was used in the old package -# but not in the new -# this code will be removed in the future -if [ -d "/etc/gogs" ] -then - # create needed directories if not already created - create_dir - - # move repositories to new dir - old_repo_path=$(ynh_app_setting_get "$app" repopath) - mv "${old_repo_path:-/home/yunohost.app/gogs}"/* "$REPO_PATH" || true # Avoid if the directory is empty - # cleanup old dir and conf - ynh_secure_remove /opt/gogs - ynh_secure_remove /etc/gogs - ynh_secure_remove /opt/gogs_src - - # create needed directories if not already created - create_dir -fi -# end of old package upgrade - -# test if user gogs is locked because of an old installation of the package. -# if it's blocked, unlock it to allow ssh usage with git -if [[ $(grep "$app" /etc/shadow | cut -d: -f2) == '!' ]] -then - usermod -p '*' "$app" -fi - -# Remove old authentification mecanisme, actually the registry in the database has been replaced by a config file -if [[ ! -e "$final_path/custom/conf/auth.d/ldap.conf" ]] -then - ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" <<< "DELETE FROM login_source WHERE name = 'Yunohost LDAP';" - mkdir -p "$final_path/custom/conf/auth.d" -fi +ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # STANDARD UPGRADE STEPS #================================================= # Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 -ynh_secure_remove "/opt/gogs/templates" +ynh_secure_remove "/opt/$app/templates" -# Install Gogs -ynh_setup_source $final_path $architecture +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Setting up source files..." --weight=3 -# Configure gogs with app.ini file -config_gogs +ynh_app_setting_set --app=$app --key=final_path --value=$final_path +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir=$final_path --source_id="$architecture" -# Configure init script +ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" +ynh_backup_if_checksum_is_different "$final_path/custom/conf/auth.d/ldap.conf" + +cp ../conf/app.ini "$final_path/custom/conf" +cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" + +if [ "$path_url" = "/" ] +then + ynh_replace_string "__URL__" "$domain" "$final_path/custom/conf/app.ini" +else + ynh_replace_string "__URL__" "$domain${path_url%/}" "$final_path/custom/conf/app.ini" +fi + +ynh_replace_string "__REPOS_PATH__" "$REPO_PATH" "$final_path/custom/conf/app.ini" +ynh_replace_string "__DB_PASSWORD__" "$dbpass" "$final_path/custom/conf/app.ini" +ynh_replace_string "__DB_USER__" "$dbuser" "$final_path/custom/conf/app.ini" +ynh_replace_string "__DOMAIN__" "$domain" "$final_path/custom/conf/app.ini" +ynh_replace_string "__KEY__" "$key" "$final_path/custom/conf/app.ini" +ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" +ynh_replace_string "__PORT__" $port "$final_path/custom/conf/app.ini" +ynh_replace_string "__APP__" $app "$final_path/custom/conf/app.ini" + +if [[ "$is_public" = '1' ]] +then + ynh_replace_string "__PRIVATE_MODE__" "false" "$final_path/custom/conf/app.ini" +else + ynh_replace_string "__PRIVATE_MODE__" "true" "$final_path/custom/conf/app.ini" +fi + +ynh_replace_string "__ADMIN__" "$admin" "$final_path/custom/conf/auth.d/ldap.conf" + +ynh_store_file_checksum "$final_path/custom/conf/app.ini" +ynh_store_file_checksum "$final_path/custom/conf/auth.d/ldap.conf" + +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 + +# Create a dedicated systemd config ynh_add_systemd_config -# Modify Nginx configuration file and copy it to Nginx conf directory -config_nginx +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config #================================================= -# GENERIC FINALIZATION +# SECURE FILES AND DIRECTORIES #================================================= -# Unprotect root from SSO if public -set_access_settings +chown -R $app:$app "$final_path" +chown -R $app:$app "/home/$app" +chown -R $app:$app "/var/log/$app" +chmod u=rwX,g=rX,o= "$final_path" +chmod u=rwX,g=rX,o= "/home/$app" +chmod u=rwX,g=rX,o= "/var/log/$app" -# Set permissions -set_permission +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -# Reload services -ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" +yunohost service add "$app" --log="/var/log/$app/$app.log" + +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Upgrade of $app completed" --last From 6839f6e2e5d1a2e3cbeab22424dcf8ff7054d3d6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 14:47:29 +0100 Subject: [PATCH 36/96] Fix --- scripts/install | 2 +- scripts/restore | 94 +++++++++++++++++++++++++++++++++---------------- scripts/upgrade | 5 ++- 3 files changed, 68 insertions(+), 33 deletions(-) diff --git a/scripts/install b/scripts/install index d126627..43591ed 100644 --- a/scripts/install +++ b/scripts/install @@ -184,7 +184,7 @@ chmod u=rwX,g=rX,o= "/var/log/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "$app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log" #================================================= # SETUP LOGROTATE diff --git a/scripts/restore b/scripts/restore index ae5913a..e7f68dc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,50 +32,82 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin=$(ynh_app_setting_get --app=$app --key=adminusername) -# Check domain/path availability with app helper -ynh_webpath_available $domain $path_url || ynh_die "$domain is not available as domain, please use an other domain." +#================================================= +# CHECK IF THE APP CAN BE RESTORED +#================================================= +ynh_script_progression --message="Validating restoration parameters..." --weight=2 -# Check user parameter -ynh_user_exists "$admin" \ - || ynh_die "The chosen admin user does not exist." - -# Check Final Path availability -test ! -e "$final_path" || ynh_die "This path already contains a folder" +ynh_webpath_available --domain=$domain --path_url=$path_url \ + || ynh_die --message="Path not available: ${domain}${path_url}" +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS #================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX configuration..." -# Add users -# We can't use the official helper because we need to set the shell for the login -test getent passwd "$app" &>/dev/null || \ - useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ - ynh_die "Unable to create $app system account" +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -# Restore all files -ynh_restore +#================================================= +# RESTORE THE APP MAIN DIR +#================================================= +ynh_script_progression --message="Restoring $app main directory..." --weight=10 -# Create and restore the database -ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass" -ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ./db.sql +ynh_restore_file --origin_path="$final_path" -# Restore systemd files -systemctl daemon-reload -systemctl enable "$app".service --quiet +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app + +#================================================= +# RESTORE THE MYSQL DATABASE +#================================================= +ynh_script_progression --message="Restoring the MySQL database..." --time --weight=1 + +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 +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + +#================================================= +# RESTORE SYSTEMD +#================================================= +ynh_script_progression --message="Restoring the systemd configuration..." --weight=5 + +ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +systemctl enable $app.service --quiet + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." + +yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log" + +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" #================================================= # GENERIC FINALIZATION #================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -# Set permissions -set_permission +ynh_systemd_action --service_name=nginx --action=reload -# Configure logrotate -ynh_use_logrotate "/var/log/$app" +#================================================= +# END OF SCRIPT +#================================================= -# Add Gogs to YunoHost's monitored services -yunohost service add "$app" --log /var/log/"$app"/"$app".log - -# Reload services -systemctl reload nginx.service -ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index f1f6f20..324e007 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,9 @@ 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=adminusername) is_public=$(ynh_app_setting_get --app=$app --key=is_public) @@ -136,7 +139,7 @@ chmod u=rwX,g=rX,o= "/var/log/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "$app" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log" #================================================= # RELOAD NGINX From e8fb1af2f885e7950325e8e858cb7d6820cdae37 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 14:50:47 +0100 Subject: [PATCH 37/96] Fix --- scripts/_common.sh | 8 -------- scripts/remove | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6849d61..cbb0fd4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -32,14 +32,6 @@ create_dir() { mkdir -p "/var/log/$app" } -config_nginx() { - if [ "$path_url" != "/" ] - then - ynh_replace_string "^#sub_path_only" "" "../conf/nginx.conf" - fi - ynh_add_nginx_config -} - config_gogs() { ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" ynh_backup_if_checksum_is_different "$final_path/custom/conf/auth.d/ldap.conf" diff --git a/scripts/remove b/scripts/remove index d31ed84..6f49832 100644 --- a/scripts/remove +++ b/scripts/remove @@ -80,7 +80,7 @@ ynh_remove_logrotate #================================================= ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= From 1ee87a1c1de0b2d3d10e3b4ca6c817d29fcf0ef6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 14:56:01 +0100 Subject: [PATCH 38/96] Fix --- scripts/install | 4 ++-- scripts/upgrade | 39 ++++++++++++++++++++++++--------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index 43591ed..24955c5 100644 --- a/scripts/install +++ b/scripts/install @@ -163,7 +163,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=1 -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -191,7 +191,7 @@ yunohost service add $app --description="Lightweight Git forge" --log="/var/log/ #================================================= ynh_script_progression --message="Configuring log rotation..." --weight=1 -ynh_use_logrotate "/var/log/$app" +ynh_use_logrotate #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 324e007..daf7ab1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,23 +86,23 @@ else ynh_replace_string "__URL__" "$domain${path_url%/}" "$final_path/custom/conf/app.ini" fi -ynh_replace_string "__REPOS_PATH__" "$REPO_PATH" "$final_path/custom/conf/app.ini" -ynh_replace_string "__DB_PASSWORD__" "$dbpass" "$final_path/custom/conf/app.ini" -ynh_replace_string "__DB_USER__" "$dbuser" "$final_path/custom/conf/app.ini" -ynh_replace_string "__DOMAIN__" "$domain" "$final_path/custom/conf/app.ini" -ynh_replace_string "__KEY__" "$key" "$final_path/custom/conf/app.ini" -ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" -ynh_replace_string "__PORT__" $port "$final_path/custom/conf/app.ini" -ynh_replace_string "__APP__" $app "$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" if [[ "$is_public" = '1' ]] then - ynh_replace_string "__PRIVATE_MODE__" "false" "$final_path/custom/conf/app.ini" + ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" else - ynh_replace_string "__PRIVATE_MODE__" "true" "$final_path/custom/conf/app.ini" + ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" fi -ynh_replace_string "__ADMIN__" "$admin" "$final_path/custom/conf/auth.d/ldap.conf" +ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/custom/conf/auth.d/ldap.conf" ynh_store_file_checksum "$final_path/custom/conf/app.ini" ynh_store_file_checksum "$final_path/custom/conf/auth.d/ldap.conf" @@ -110,7 +110,7 @@ ynh_store_file_checksum "$final_path/custom/conf/auth.d/ldap.conf" #================================================= # SETUP SYSTEMD #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Create a dedicated systemd config ynh_add_systemd_config @@ -118,7 +118,7 @@ ynh_add_systemd_config #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config @@ -127,6 +127,7 @@ ynh_add_nginx_config # SECURE FILES AND DIRECTORIES #================================================= +# Set permissions to app files chown -R $app:$app "$final_path" chown -R $app:$app "/home/$app" chown -R $app:$app "/var/log/$app" @@ -137,14 +138,22 @@ chmod u=rwX,g=rX,o= "/var/log/$app" #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log" +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=1 + +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" + #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload From 1f8dc8a12aed806696f00b06db7b2b5d2ab5abed Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 15:04:29 +0100 Subject: [PATCH 39/96] Fix --- conf/nginx.conf | 3 ++- scripts/restore | 1 + scripts/upgrade | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index cf3b636..5d086cb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,6 +6,7 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } + proxy_pass http://127.0.0.1:__PORT__; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -13,7 +14,7 @@ location __PATH__/ { rewrite ^__PATH__/gogs/(.*) /$1 break; rewrite ^__PATH__/gogs$ /$1 break; - proxy_pass http://localhost:__PORT__; + proxy_read_timeout 90; client_max_body_size 200M; diff --git a/scripts/restore b/scripts/restore index e7f68dc..fa9f062 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,6 +29,7 @@ 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_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin=$(ynh_app_setting_get --app=$app --key=adminusername) diff --git a/scripts/upgrade b/scripts/upgrade index daf7ab1..5e0b9e8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,7 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin=$(ynh_app_setting_get --app=$app --key=adminusername) is_public=$(ynh_app_setting_get --app=$app --key=is_public) port=$(ynh_app_setting_get --app=$app --key=web_port) +architecture=$(ynh_detect_arch) #================================================= # CHECK VERSION From 75626e35fe5bcb889616709ed88ba77701c6d2cb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 15:08:51 +0100 Subject: [PATCH 40/96] Fix --- scripts/install | 6 +++--- scripts/remove | 2 +- scripts/restore | 2 ++ scripts/upgrade | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 24955c5..c13dfed 100644 --- a/scripts/install +++ b/scripts/install @@ -67,7 +67,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --weight=1 +ynh_script_progression --message="Creating a MySQL database..." --weight=3 db_name=$(ynh_sanitize_dbid --db_name=$app) db_user=$db_name @@ -161,7 +161,7 @@ ynh_add_systemd_config #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config @@ -196,7 +196,7 @@ ynh_use_logrotate #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=3 # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" diff --git a/scripts/remove b/scripts/remove index 6f49832..3384e84 100644 --- a/scripts/remove +++ b/scripts/remove @@ -54,7 +54,7 @@ ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=3 +ynh_script_progression --message="Removing app main directory..." --weight=3 # Remove the app directory securely ynh_secure_remove --file="$final_path" diff --git a/scripts/restore b/scripts/restore index fa9f062..b6201a9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,6 +30,8 @@ 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=adminusername) diff --git a/scripts/upgrade b/scripts/upgrade index 5e0b9e8..c2cc614 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,7 @@ ynh_abort_if_errors #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" From f5cfd9534e21f928d759baa7a9cbabb82d7e4904 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 15:23:22 +0100 Subject: [PATCH 41/96] Fix --- README.md | 20 ++---- scripts/change_url | 160 ++++++++++++++++++++++++++++++++++++++------- scripts/install | 2 +- scripts/remove | 2 +- scripts/restore | 9 ++- scripts/upgrade | 3 + 6 files changed, 149 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 9dfcb2b..d4c686a 100644 --- a/README.md +++ b/README.md @@ -11,25 +11,15 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Gogs is a self-hosted Git service written in Go. Alternative to Github. -## Info **Shipped version:** 0.12.3 -# IMPORTANT INFORMATION +## Screenshots -For the old install you can migrate to gitea easly by juste upgrading your actuall gogs instance with the gitea source by this command: -``` -sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/gitea_ynh gogs -``` -**Note that this command contains some risk of data lost. So it's important to make a backup of the app before the install.** -To make a backup you can use this command: -``` -sudo yunohost backup create --debug --apps gogs -``` +![](https://gogs.io/img/screenshots/2.png) -For the new install just install gitea by this command: -``` -sudo yunohost app install -l Gitea https://github.com/YunoHost-Apps/gitea_ynh -``` +## Demo + +* [Official demo](https://try.gogs.io/user/login) ## 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: diff --git a/scripts/change_url b/scripts/change_url index b7998fe..0f9668f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -9,46 +9,156 @@ source _common.sh source /usr/share/yunohost/helpers -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS #================================================= old_domain=$YNH_APP_OLD_DOMAIN -domain=$YNH_APP_NEW_DOMAIN +old_path=$YNH_APP_OLD_PATH + +new_domain=$YNH_APP_NEW_DOMAIN +new_path=$YNH_APP_NEW_PATH -path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'}) app=$YNH_APP_INSTANCE_NAME -db_pwd=$(ynh_app_setting_get "$app" mysqlpwd) -admin=$(ynh_app_setting_get "$app" adminusername) -key=$(ynh_app_setting_get "$app" secret_key) -port=$(ynh_app_setting_get "$app" web_port) -is_public=$(ynh_app_setting_get "$app" is_public) +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --time --weight=1 + +# Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +# Add settings here as needed by your application +#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) + +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --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 #================================================= +# STOP SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 -# Change the domain for nginx -if [ "$old_domain" != "$domain" ] +ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 + +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 - # Delete file checksum for the old conf file location - ynh_delete_file_checksum "/etc/nginx/conf.d/$old_domain.d/$app.conf" - - mv "/etc/nginx/conf.d/$old_domain.d/$app.conf" "/etc/nginx/conf.d/$domain.d/$app.conf" - - # Store file checksum for the new config file location - ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf" + # 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 -config_nginx +# 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 -# Update gogs config -config_gogs +#================================================= +# SPECIFIC MODIFICATIONS +#================================================= +REPO_PATH="/home/$app/repositories" +DATA_PATH="/home/$app/data" -# RELOAD services -ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" -sleep 1 \ No newline at end of file +cp ../conf/app.ini "$final_path/custom/conf" +cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" + +if [ "$path_url" = "/" ] +then + ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +else + ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" +fi + +ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" + +if [[ "$is_public" = '1' ]] +then + ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" +else + ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" +fi + +ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/custom/conf/auth.d/ldap.conf" + +ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" + +#================================================= +# GENERIC FINALISATION +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --time --weight=1 + +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" + +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --time --last diff --git a/scripts/install b/scripts/install index c13dfed..e45194f 100644 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors diff --git a/scripts/remove b/scripts/remove index 3384e84..a0bbe42 100644 --- a/scripts/remove +++ b/scripts/remove @@ -28,7 +28,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) +# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service integration..." --weight=1 diff --git a/scripts/restore b/scripts/restore index b6201a9..d57cdd5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,6 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -15,7 +14,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_clean_setup () { - true + ynh_clean_check_starting } # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -72,7 +71,7 @@ ynh_system_user_create --username=$app #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --time --weight=1 +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 @@ -89,14 +88,14 @@ systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" diff --git a/scripts/upgrade b/scripts/upgrade index c2cc614..8719960 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -70,6 +70,9 @@ ynh_secure_remove "/opt/$app/templates" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 +REPO_PATH="/home/$app/repositories" +DATA_PATH="/home/$app/data" + ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path --source_id="$architecture" From e8ca959fd3cad51190dfaf2da3f5907150233268 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 15:37:51 +0100 Subject: [PATCH 42/96] Fix --- conf/systemd.service | 5 +---- scripts/change_url | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index e9cac24..d25a978 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,9 +1,6 @@ [Unit] Description=Gogs (Go Git Service) -After=syslog.target -After=network.target -After=mysql.service -After=slapd.service +After=syslog.target network.target mysql.service slapd.service [Service] # Modify these two values and uncomment them if you have repos diff --git a/scripts/change_url b/scripts/change_url index 0f9668f..852e1ab 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,11 +28,7 @@ ynh_script_progression --message="Loading installation settings..." --time --wei # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) - -# Add settings here as needed by your application -#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) +port=$(ynh_app_setting_get --app=$app --key=web_port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From 9942c3406f63487d51259ae2bf7698fb3170268d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 6 Dec 2020 15:53:56 +0100 Subject: [PATCH 43/96] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index e45194f..825482a 100644 --- a/scripts/install +++ b/scripts/install @@ -172,9 +172,9 @@ ynh_add_nginx_config # SECURE FILES AND DIRECTORIES #================================================= -chown -R $app:$app "$final_path" -chown -R $app:$app "/home/$app" -chown -R $app:$app "/var/log/$app" +chown -R $app: "$final_path" +chown -R $app: "/home/$app" +chown -R $app: "/var/log/$app" chmod u=rwX,g=rX,o= "$final_path" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" From e947bf2a7f575d84ea41fb3cb7b6edae8d207072 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Dec 2020 23:34:14 +0100 Subject: [PATCH 44/96] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index d25a978..cae79f0 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -12,7 +12,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=/home/__APP__ -ExecStart=/var/www/gogs/gogs web +ExecStart=__FINALPATH__/gogs web Restart=always Environment=USER=__APP__ HOME=/home/__APP__ From cc878ea07a58a6571a64954e7577b0b059d18e4e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Dec 2020 23:35:55 +0100 Subject: [PATCH 45/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4c686a..c8137d3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Gogs for YunoHost [![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) -[![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=gogs) +[![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)* From 4695d907ba6454d0bdba6798d545dd64e5940404 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Dec 2020 23:42:57 +0100 Subject: [PATCH 46/96] Update nginx.conf --- conf/nginx.conf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5d086cb..3c8eff4 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -6,17 +6,17 @@ location __PATH__/ { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__PORT__; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://127.0.0.1:__PORT__/; + proxy_set_header Host $host; + proxy_buffering off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; - rewrite ^__PATH__/gogs/(.*) /$1 break; - rewrite ^__PATH__/gogs$ /$1 break; - - proxy_read_timeout 90; + #rewrite ^__PATH__/gogs/(.*) /$1 break; + #rewrite ^__PATH__/gogs$ /$1 break; + #proxy_read_timeout 90; client_max_body_size 200M; # Include SSOWAT user panel. From ed8432731ac8d7a123755e83495c40db39774845 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Dec 2020 23:52:57 +0100 Subject: [PATCH 47/96] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 8719960..31e14e7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,7 +26,7 @@ db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) admin=$(ynh_app_setting_get --app=$app --key=adminusername) is_public=$(ynh_app_setting_get --app=$app --key=is_public) -port=$(ynh_app_setting_get --app=$app --key=web_port) +port=$(ynh_app_setting_get --app=$app --key=port) architecture=$(ynh_detect_arch) #================================================= From 1540e359829ea5e4f42517deff772a1829fb03cb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Dec 2020 23:53:18 +0100 Subject: [PATCH 48/96] Fix --- scripts/change_url | 14 +++++++------- scripts/install | 2 -- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 852e1ab..e50aa0f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +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) @@ -33,7 +33,7 @@ port=$(ynh_app_setting_get --app=$app --key=web_port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --time --weight=1 +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 @@ -68,14 +68,14 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf @@ -142,14 +142,14 @@ ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --time --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload @@ -157,4 +157,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 825482a..58dcdab 100644 --- a/scripts/install +++ b/scripts/install @@ -209,8 +209,6 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. ynh_permission_update --permission "main" --add "visitors" fi From 94c671c567558020cda59bda2c34349f35ef0a80 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Dec 2020 23:54:49 +0100 Subject: [PATCH 49/96] Fix --- check_process | 1 - scripts/change_url | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/check_process b/check_process index 744f63e..67035eb 100644 --- a/check_process +++ b/check_process @@ -17,4 +17,3 @@ port_already_use=1 change_url=1 ;;; Upgrade options - diff --git a/scripts/change_url b/scripts/change_url index e50aa0f..896239c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,7 +28,7 @@ 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=web_port) +port=$(ynh_app_setting_get --app=$app --key=port) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From e4556f3ef0d2468f5d743b756f454ee9a335c5b5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 29 Dec 2020 23:55:21 +0100 Subject: [PATCH 50/96] Update nginx.conf --- conf/nginx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 3c8eff4..d2fd210 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,7 +13,7 @@ location __PATH__/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - #rewrite ^__PATH__/gogs/(.*) /$1 break; + #wrewrite ^__PATH__/gogs/(.*) /$1 break; #rewrite ^__PATH__/gogs$ /$1 break; #proxy_read_timeout 90; From 975afd3b65a7ad0b8c86bd8dda11c7710b304734 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 30 Dec 2020 14:16:37 +0100 Subject: [PATCH 51/96] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c8137d3..6be8552 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -Gogs is a self-hosted Git service written in Go. Alternative to Github. +Gogs is a self-hosted Git service written in Go. Alternative to GitHub. **Shipped version:** 0.12.3 @@ -22,7 +22,7 @@ Gogs is a self-hosted Git service written in Go. Alternative to Github. * [Official demo](https://try.gogs.io/user/login) ## 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: +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 @@ -34,7 +34,7 @@ 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`: +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 From c8f90e385bad7566f7f8698a593875539bee6aac Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 30 Dec 2020 15:07:15 +0100 Subject: [PATCH 52/96] Fix --- conf/nginx.conf | 4 ++-- scripts/backup | 6 ++++++ scripts/change_url | 17 +++++++++-------- scripts/restore | 8 +++++++- scripts/upgrade | 6 +++--- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d2fd210..5c003bb 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -13,8 +13,8 @@ location __PATH__/ { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - #wrewrite ^__PATH__/gogs/(.*) /$1 break; - #rewrite ^__PATH__/gogs$ /$1 break; + #wrewrite ^__PATH__/gogs/(.*) /$1 break; + #rewrite ^__PATH__/gogs$ /$1 break; #proxy_read_timeout 90; client_max_body_size 200M; diff --git a/scripts/backup b/scripts/backup index aa34e44..b9bc0ec 100644 --- a/scripts/backup +++ b/scripts/backup @@ -58,6 +58,12 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/var/log/$app" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/change_url b/scripts/change_url index 896239c..e8c9218 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,6 +29,7 @@ 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) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -112,19 +113,19 @@ cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" if [ "$path_url" = "/" ] then - ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" + ynh_replace_string --match_string="__URL__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini" else - ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" + ynh_replace_string --match_string="__URL__" --replace_string="$new_domain${new_path%/}" --target_file="$final_path/custom/conf/app.ini" fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" if [[ "$is_public" = '1' ]] then diff --git a/scripts/restore b/scripts/restore index d57cdd5..b699b72 100644 --- a/scripts/restore +++ b/scripts/restore @@ -32,7 +32,7 @@ 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=adminusername) +admin=$(ynh_app_setting_get --app=$app --key=admin) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -99,6 +99,12 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 31e14e7..336d457 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,7 @@ 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=adminusername) +admin=$(ynh_app_setting_get --app=$app --key=admin) is_public=$(ynh_app_setting_get --app=$app --key=is_public) port=$(ynh_app_setting_get --app=$app --key=port) architecture=$(ynh_detect_arch) @@ -85,9 +85,9 @@ cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" if [ "$path_url" = "/" ] then - ynh_replace_string "__URL__" "$domain" "$final_path/custom/conf/app.ini" + ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" else - ynh_replace_string "__URL__" "$domain${path_url%/}" "$final_path/custom/conf/app.ini" + ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" fi ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" From 5a16b67a8393be21310ce67149ab8c66a8a7bb01 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 30 Dec 2020 16:04:25 +0100 Subject: [PATCH 53/96] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 58dcdab..f654017 100644 --- a/scripts/install +++ b/scripts/install @@ -175,7 +175,7 @@ ynh_add_nginx_config chown -R $app: "$final_path" chown -R $app: "/home/$app" chown -R $app: "/var/log/$app" -chmod u=rwX,g=rX,o= "$final_path" +#chmod u=rwX,g=rX,o= "$final_path" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" From 5b54dc4938c72c16cae81d95ba350853695bb1a1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 3 Apr 2021 23:44:42 +0200 Subject: [PATCH 54/96] Fix --- manifest.json | 18 +----------------- scripts/install | 3 +-- scripts/upgrade | 1 - 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/manifest.json b/manifest.json index cbb8d81..8c75d13 100644 --- a/manifest.json +++ b/manifest.json @@ -23,45 +23,29 @@ "mysql" ], "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "arguments": { "install" : [ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Gogs", - "fr": "Choisissez un domaine pour Gogs" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Gogs", - "fr": "Choisissez un chemin pour Gogs" - }, "example": "/gogs", "default": "/gogs" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose the Gogs administrator (must be an existing YunoHost user)", - "fr": "Choisissez l'administrateur de Gogs (doit être un utilisateur YunoHost existant)" - }, "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public site?", - "fr": "Est-ce un site public ?" - }, "default": true } ] diff --git a/scripts/install b/scripts/install index f654017..f6efc51 100644 --- a/scripts/install +++ b/scripts/install @@ -51,7 +51,6 @@ 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=adminusername --value=$admin ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS @@ -209,7 +208,7 @@ ynh_script_progression --message="Configuring SSOwat..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - ynh_permission_update --permission "main" --add "visitors" + ynh_permission_update --permission="main" --add="visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 336d457..d3d3b99 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,6 @@ 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) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) port=$(ynh_app_setting_get --app=$app --key=port) architecture=$(ynh_detect_arch) From b9c6ab427f6d6cd1ff23bb459763c30822758c4c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 23 Apr 2021 07:57:08 +0200 Subject: [PATCH 55/96] Fix --- conf/app.ini | 6 +++--- scripts/_common.sh | 9 +++------ scripts/install | 8 +++----- scripts/upgrade | 10 ++++------ 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 5a08d74..7e6a99a 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -162,9 +162,9 @@ DSA = 1024 ; Either "mysql", "postgres" or "sqlite3", you can connect to TiDB with MySQL protocol DB_TYPE = mysql HOST = 127.0.0.1:3306 -NAME = __DB_USER__ -USER = __DB_USER__ -PASSWD = __DB_PASSWORD__ +NAME = __DB_NAME__ +USER = __DB_NAME__ +PASSWD = __DB_PWD__ ; For "postgres" only, either "disable", "require" or "verify-full" SSL_MODE = disable ; For "sqlite3" and "tidb", use absolute path when you start as service diff --git a/scripts/_common.sh b/scripts/_common.sh index cbb0fd4..624dae9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -34,10 +34,8 @@ create_dir() { config_gogs() { ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" - ynh_backup_if_checksum_is_different "$final_path/custom/conf/auth.d/ldap.conf" cp ../conf/app.ini "$final_path/custom/conf" - cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" if [ "$path_url" = "/" ] then @@ -47,8 +45,8 @@ config_gogs() { fi ynh_replace_string "__REPOS_PATH__" "$REPO_PATH" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_PASSWORD__" "$dbpass" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_USER__" "$dbuser" "$final_path/custom/conf/app.ini" + ynh_replace_string "__DB_PWD__" "$dbpass" "$final_path/custom/conf/app.ini" + ynh_replace_string "__DB_NAME__" "$dbuser" "$final_path/custom/conf/app.ini" ynh_replace_string "__DOMAIN__" "$domain" "$final_path/custom/conf/app.ini" ynh_replace_string "__KEY__" "$key" "$final_path/custom/conf/app.ini" ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" @@ -62,10 +60,9 @@ config_gogs() { ynh_replace_string "__PRIVATE_MODE__" "true" "$final_path/custom/conf/app.ini" fi - ynh_replace_string "__ADMIN__" "$admin" "$final_path/custom/conf/auth.d/ldap.conf" + ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" ynh_store_file_checksum "$final_path/custom/conf/app.ini" - ynh_store_file_checksum "$final_path/custom/conf/auth.d/ldap.conf" } set_permission() { diff --git a/scripts/install b/scripts/install index f6efc51..6cabfed 100644 --- a/scripts/install +++ b/scripts/install @@ -124,7 +124,6 @@ mkdir -p "/var/log/$app" #================================================= cp ../conf/app.ini "$final_path/custom/conf" -cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" if [ "$path_url" = "/" ] then @@ -134,8 +133,8 @@ else fi ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" @@ -149,10 +148,9 @@ else ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" fi -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/custom/conf/auth.d/ldap.conf" +ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" -ynh_store_file_checksum --file="$final_path/custom/conf/auth.d/ldap.conf" # Configure init script ynh_add_systemd_config diff --git a/scripts/upgrade b/scripts/upgrade index d3d3b99..32c4383 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,10 +77,8 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_setup_source --dest_dir=$final_path --source_id="$architecture" ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" -ynh_backup_if_checksum_is_different "$final_path/custom/conf/auth.d/ldap.conf" cp ../conf/app.ini "$final_path/custom/conf" -cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" if [ "$path_url" = "/" ] then @@ -90,8 +88,8 @@ else fi ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" @@ -105,10 +103,10 @@ else ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" fi -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/custom/conf/auth.d/ldap.conf" + +ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" ynh_store_file_checksum "$final_path/custom/conf/app.ini" -ynh_store_file_checksum "$final_path/custom/conf/auth.d/ldap.conf" #================================================= # SETUP SYSTEMD From d81f42a5be2b35eef93658f8426993dd05308457 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 17 May 2021 09:45:06 +0200 Subject: [PATCH 56/96] Fix --- check_process | 8 ++++---- manifest.json | 2 +- scripts/_common.sh | 8 ++++---- scripts/install | 12 +++++++----- scripts/upgrade | 12 ++++++++++++ 5 files changed, 28 insertions(+), 14 deletions(-) diff --git a/check_process b/check_process index 67035eb..f10ca2f 100644 --- a/check_process +++ b/check_process @@ -1,9 +1,9 @@ ;; General ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - admin="john" (USER) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + admin="john" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 diff --git a/manifest.json b/manifest.json index 8c75d13..db9ffaf 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.4" }, "arguments": { "install" : [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 624dae9..b04dd7b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -45,8 +45,8 @@ config_gogs() { fi ynh_replace_string "__REPOS_PATH__" "$REPO_PATH" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_PWD__" "$dbpass" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_NAME__" "$dbuser" "$final_path/custom/conf/app.ini" + ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/custom/conf/app.ini" + ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/custom/conf/app.ini" ynh_replace_string "__DOMAIN__" "$domain" "$final_path/custom/conf/app.ini" ynh_replace_string "__KEY__" "$key" "$final_path/custom/conf/app.ini" ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" @@ -75,9 +75,9 @@ set_permission() { } set_access_settings() { - if [ "$is_public" = '1' ] + if [ $is_public -eq 1 ] then - ynh_app_setting_set $app unprotected_uris "/" + ynh_permission_update --permission="main" --add="visitors" else # For an access to the git server by https in private mode we need to allow the access to theses URL : # - "DOMAIN/PATH/USER/REPOSITORY/info/refs" diff --git a/scripts/install b/scripts/install index 6cabfed..077d7fe 100644 --- a/scripts/install +++ b/scripts/install @@ -203,11 +203,13 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= ynh_script_progression --message="Configuring SSOwat..." --weight=1 -# Make app public if necessary or protect it -if [ $is_public -eq 1 ] -then - ynh_permission_update --permission="main" --add="visitors" -fi +set_access_settings + +# # Make app public if necessary or protect it +# if [ $is_public -eq 1 ] +# then +# ynh_permission_update --permission="main" --add="visitors" +# fi #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 32c4383..75b7251 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,6 +34,18 @@ architecture=$(ynh_detect_arch) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= From 1bc7799952f9565f0dfa91acf9aa139bd022dda1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 25 Jun 2021 18:42:27 +0200 Subject: [PATCH 57/96] Fix --- check_process | 1 - scripts/install | 16 ++++++++-------- scripts/upgrade | 17 ++++++++--------- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/check_process b/check_process index f10ca2f..8466b7b 100644 --- a/check_process +++ b/check_process @@ -14,6 +14,5 @@ upgrade=1 backup_restore=1 multi_instance=1 - port_already_use=1 change_url=1 ;;; Upgrade options diff --git a/scripts/install b/scripts/install index 077d7fe..eaa8fef 100644 --- a/scripts/install +++ b/scripts/install @@ -132,14 +132,14 @@ else ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" if [[ "$is_public" = '1' ]] then diff --git a/scripts/upgrade b/scripts/upgrade index 75b7251..d5566f3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,14 +99,14 @@ else ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" if [[ "$is_public" = '1' ]] then @@ -115,7 +115,6 @@ else ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" fi - ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" ynh_store_file_checksum "$final_path/custom/conf/app.ini" From 88d70db2dfca6469bedd2f697f8f8b4f26dc886b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 14 Aug 2021 23:09:55 +0200 Subject: [PATCH 58/96] fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index eaa8fef..3c4ffe7 100644 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." --weight=1 +ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port port=$(ynh_find_port --port=6000) diff --git a/scripts/upgrade b/scripts/upgrade index d5566f3..6f1aba4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,7 +74,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= # Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 -ynh_secure_remove "/opt/$app/templates" +ynh_secure_remove --file="/opt/$app/templates" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE From 4b2f7ab0dc4d66c541847dd8fcd1c4c7a6f46ab1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 14 Aug 2021 23:15:18 +0200 Subject: [PATCH 59/96] Update install --- scripts/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 3c4ffe7..c2d959d 100644 --- a/scripts/install +++ b/scripts/install @@ -91,6 +91,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path --source_id="$architecture" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # CREAT DIRECTORIES #================================================= @@ -169,10 +173,8 @@ ynh_add_nginx_config # SECURE FILES AND DIRECTORIES #================================================= -chown -R $app: "$final_path" chown -R $app: "/home/$app" chown -R $app: "/var/log/$app" -#chmod u=rwX,g=rX,o= "$final_path" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" From 61dd2fed3c9281d7b7704b1acce2e28e64e2c9d0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 14 Aug 2021 23:17:26 +0200 Subject: [PATCH 60/96] Fix --- scripts/restore | 20 ++++++++++++-------- scripts/upgrade | 6 ++++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/scripts/restore b/scripts/restore index b699b72..ff9ef4a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -53,6 +53,14 @@ ynh_script_progression --message="Restoring the NGINX configuration..." 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 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -60,13 +68,9 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=10 ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE MYSQL DATABASE @@ -97,7 +101,7 @@ yunohost service add $app --description="Lightweight Git forge" --log="/var/log/ #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="HTTP Server listening" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 6f1aba4..0f31634 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,6 +88,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path --source_id="$architecture" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" cp ../conf/app.ini "$final_path/custom/conf" @@ -140,10 +144,8 @@ ynh_add_nginx_config #================================================= # Set permissions to app files -chown -R $app:$app "$final_path" chown -R $app:$app "/home/$app" chown -R $app:$app "/var/log/$app" -chmod u=rwX,g=rX,o= "$final_path" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" From 9f455f999a5a645f0fc4faa6f341df0ab228a29a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 6 Nov 2021 19:10:24 +0100 Subject: [PATCH 61/96] Fix --- conf/app.ini | 2 +- manifest.json | 6 ++---- scripts/backup | 12 ++++++------ scripts/install | 38 ++++++++++++++++++-------------------- scripts/remove | 3 ++- scripts/restore | 15 +++++++-------- scripts/upgrade | 43 +++++++++++++++++++++++-------------------- 7 files changed, 59 insertions(+), 60 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 7e6a99a..70cac47 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -163,7 +163,7 @@ DSA = 1024 DB_TYPE = mysql HOST = 127.0.0.1:3306 NAME = __DB_NAME__ -USER = __DB_NAME__ +USER = __DB_USER__ PASSWD = __DB_PWD__ ; For "postgres" only, either "disable", "require" or "verify-full" SSL_MODE = disable diff --git a/manifest.json b/manifest.json index db9ffaf..5bebb5d 100644 --- a/manifest.json +++ b/manifest.json @@ -29,8 +29,7 @@ "install" : [ { "name": "domain", - "type": "domain", - "example": "domain.org" + "type": "domain" }, { "name": "path", @@ -40,8 +39,7 @@ }, { "name": "admin", - "type": "user", - "example": "johndoe" + "type": "user" }, { "name": "is_public", diff --git a/scripts/backup b/scripts/backup index b9bc0ec..24f4cef 100644 --- a/scripts/backup +++ b/scripts/backup @@ -46,6 +46,12 @@ ynh_backup --src_path="/home/$app" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# BACKUP LOGROTATE +#================================================= + +ynh_backup --src_path="/etc/logrotate.d/$app" + #================================================= # BACKUP SYSTEMD #================================================= @@ -58,12 +64,6 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/var/log/$app" -#================================================= -# BACKUP LOGROTATE -#================================================= - -ynh_backup --src_path="/etc/logrotate.d/$app" - #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index c2d959d..9058155 100644 --- a/scripts/install +++ b/scripts/install @@ -96,22 +96,27 @@ chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" #================================================= -# CREAT DIRECTORIES +# CREATE DATA DIRECTORY #================================================= +ynh_script_progression --message="Creating a data directory..." --weight=1 -mkdir -p "/home/$app" +datadir=/home/yunohost.app/$app +ynh_app_setting_set --app=$app --key=datadir --value=$datadir -DATADIR="/home/$app" +mkdir -p $datadir + +chmod 750 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" REPO_PATH="/home/$app/repositories" -DATA_PATH="/home/$app/data" +DATA_PATH="/home/yunohost.app/$app/data" # create needed directories mkdir -p "$final_path/data" mkdir -p "$final_path/custom/conf/auth.d" -mkdir -p "/home/$app/data/avatars" -mkdir -p "/home/$app/data/attachments" -mkdir -p "/var/log/$app" +mkdir -p "/home/yunohost.app/$app/data/avatars" +mkdir -p "/home/yunohost.app/$app/data/attachments" #================================================= # STANDARD MODIFICATIONS @@ -138,7 +143,8 @@ fi ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" @@ -170,13 +176,12 @@ ynh_add_nginx_config #================================================= # GENERIC FINALIZATION #================================================= -# SECURE FILES AND DIRECTORIES +# SETUP LOGROTATE #================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 -chown -R $app: "/home/$app" -chown -R $app: "/var/log/$app" -chmod u=rwX,g=rX,o= "/home/$app" -chmod u=rwX,g=rX,o= "/var/log/$app" +# Use logrotate to manage application logfile(s) +ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST @@ -185,13 +190,6 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Lightweight Git forge" --log="/var/log/$app/$app.log" -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 - -ynh_use_logrotate - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index a0bbe42..d729e03 100644 --- a/scripts/remove +++ b/scripts/remove @@ -21,6 +21,7 @@ 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) #================================================= # STANDARD REMOVE @@ -63,7 +64,7 @@ ynh_secure_remove --file="$final_path" # REMOVE VARIOUS FILES #================================================= -ynh_secure_remove --file="/home/$app" +ynh_secure_remove --file="$datadir" ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index ff9ef4a..df3061c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,8 +39,6 @@ admin=$(ynh_app_setting_get --app=$app --key=admin) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -ynh_webpath_available --domain=$domain --path_url=$path_url \ - || ynh_die --message="Path not available: ${domain}${path_url}" test ! -d $final_path \ || ynh_die --message="There is already a directory: $final_path " @@ -89,6 +87,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -103,12 +108,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/logrotate.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0f31634..b50a68a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,8 @@ 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) architecture=$(ynh_detect_arch) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) + #================================================= # CHECK VERSION @@ -34,18 +36,6 @@ architecture=$(ynh_detect_arch) upgrade_type=$(ynh_check_app_version_changed) -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# Cleaning legacy permissions -if ynh_legacy_permissions_exists; then - ynh_legacy_permissions_delete_all - - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -60,6 +50,18 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # STANDARD UPGRADE STEPS #================================================= @@ -82,7 +84,7 @@ ynh_secure_remove --file="/opt/$app/templates" ynh_script_progression --message="Setting up source files..." --weight=3 REPO_PATH="/home/$app/repositories" -DATA_PATH="/home/$app/data" +DATA_PATH="$datadir/data" ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src @@ -105,7 +107,8 @@ fi ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" @@ -140,14 +143,14 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - ynh_add_nginx_config #================================================= -# SECURE FILES AND DIRECTORIES +# GENERIC FINALIZATION #================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 -# Set permissions to app files -chown -R $app:$app "/home/$app" -chown -R $app:$app "/var/log/$app" -chmod u=rwX,g=rX,o= "/home/$app" -chmod u=rwX,g=rX,o= "/var/log/$app" +# Use logrotate to manage application logfile(s) +ynh_use_logrotate #================================================= # INTEGRATE SERVICE IN YUNOHOST From 4b97838bb9d577143605cc8b0c6149956ec856d4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 6 Nov 2021 23:42:14 +0100 Subject: [PATCH 62/96] Fix --- manifest.json | 2 +- scripts/install | 20 ++++++++------------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/manifest.json b/manifest.json index 5bebb5d..e951f15 100644 --- a/manifest.json +++ b/manifest.json @@ -23,7 +23,7 @@ "mysql" ], "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.2.8" }, "arguments": { "install" : [ diff --git a/scripts/install b/scripts/install index 9058155..d98a247 100644 --- a/scripts/install +++ b/scripts/install @@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ynh_clean_check_starting -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -49,7 +46,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url 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=adminusername --value=$admin +ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= @@ -72,7 +69,6 @@ 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 -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #================================================= # CREATE DEDICATED USER @@ -109,7 +105,7 @@ chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" -REPO_PATH="/home/$app/repositories" +REPO_PATH="/home/yunohost.app/$app/repositories" DATA_PATH="/home/yunohost.app/$app/data" # create needed directories @@ -203,13 +199,13 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= ynh_script_progression --message="Configuring SSOwat..." --weight=1 -set_access_settings +#set_access_settings -# # Make app public if necessary or protect it -# if [ $is_public -eq 1 ] -# then -# ynh_permission_update --permission="main" --add="visitors" -# fi +# Make app public if necessary or protect it +if [ $is_public -eq 1 ] +then + ynh_permission_update --permission="main" --add="visitors" +fi #================================================= # RELOAD NGINX From 96154e08ba3f339cc62d85ac7ebf73747f46b839 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 6 Nov 2021 23:44:53 +0100 Subject: [PATCH 63/96] Fix --- scripts/restore | 4 ---- scripts/upgrade | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/restore b/scripts/restore index df3061c..05b4726 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,9 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ynh_clean_check_starting -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -31,7 +28,6 @@ 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) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b50a68a..f226a6f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,7 +83,7 @@ ynh_secure_remove --file="/opt/$app/templates" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -REPO_PATH="/home/$app/repositories" +REPO_PATH="$datadir/repositories" DATA_PATH="$datadir/data" ynh_app_setting_set --app=$app --key=final_path --value=$final_path From 89b0788b7ba42c3fd30a2aa97ca7834b72d06640 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 6 Nov 2021 23:50:58 +0100 Subject: [PATCH 64/96] Update systemd.service --- conf/systemd.service | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index cae79f0..81f88b7 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,18 +3,46 @@ Description=Gogs (Go Git Service) After=syslog.target network.target mysql.service slapd.service [Service] -# Modify these two values and uncomment them if you have repos -# with lots of files and get an HTTP error 500 because of that -### -#LimitMEMLOCK=infinity -#LimitNOFILE=65535 Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=/home/__APP__ +WorkingDirectory=/home/yunohost.app/__APP__ ExecStart=__FINALPATH__/gogs web Restart=always -Environment=USER=__APP__ HOME=/home/__APP__ +Environment=USER=__APP__ HOME=/home/yunohost.app/__APP__ + +[Install] +WantedBy=multi-user.target + +# Sandboxing options to harden security +# Depending on specificities of your service/app, you may need to tweak these +# .. but this should be a good baseline +# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html +NoNewPrivileges=yes +PrivateTmp=yes +PrivateDevices=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 +RestrictNamespaces=yes +RestrictRealtime=yes +DevicePolicy=closed +ProtectSystem=full +ProtectControlGroups=yes +ProtectKernelModules=yes +ProtectKernelTunables=yes +LockPersonality=yes +SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap + +# Denying access to capabilities that should not be relevant for webapps +# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html +CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD +CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE +CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT +CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK +CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM +CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG +CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE +CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW +CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG [Install] WantedBy=multi-user.target From ff5ac5421c9c90fde93bf69433e8063fca7ac3bb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 6 Nov 2021 23:52:38 +0100 Subject: [PATCH 65/96] Update nginx.conf --- conf/nginx.conf | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 5c003bb..f443e57 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,16 +9,10 @@ location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__/; proxy_set_header Host $host; proxy_buffering off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + fastcgi_param REMOTE_USER $remote_user; + client_max_body_size 200M; proxy_set_header X-Forwarded-Proto $scheme; - #wrewrite ^__PATH__/gogs/(.*) /$1 break; - #rewrite ^__PATH__/gogs$ /$1 break; - - #proxy_read_timeout 90; - client_max_body_size 200M; - # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; } From 55f899af0f18ae83a6a2e03ce8b81f36c8d2b7b7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 6 Nov 2021 23:53:43 +0100 Subject: [PATCH 66/96] Update check_process --- check_process | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check_process b/check_process index 8466b7b..e8e753c 100644 --- a/check_process +++ b/check_process @@ -12,7 +12,10 @@ setup_private=1 setup_public=1 upgrade=1 + #upgrade=1 from_commit=3 backup_restore=1 multi_instance=1 change_url=1 ;;; Upgrade options + ; commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099 + name=First package version From 9e368ac107abba39edf91d028135e1679fe2ac74 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 08:47:53 +0100 Subject: [PATCH 67/96] Update install --- scripts/install | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index d98a247..4f85511 100644 --- a/scripts/install +++ b/scripts/install @@ -114,6 +114,7 @@ mkdir -p "$final_path/custom/conf/auth.d" mkdir -p "/home/yunohost.app/$app/data/avatars" mkdir -p "/home/yunohost.app/$app/data/attachments" + #================================================= # STANDARD MODIFICATIONS #================================================= @@ -179,6 +180,9 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate +chown -R $app:$app "/var/log/$app" +chmod u=rwX,g=rX,o= "/var/log/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= From f032c3ef67f466877e0b61b7966c2b9a2797858a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 08:58:19 +0100 Subject: [PATCH 68/96] fix --- scripts/restore | 3 +++ scripts/upgrade | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/restore b/scripts/restore index 05b4726..4693d7c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -90,6 +90,9 @@ ynh_script_progression --message="Restoring the logrotate configuration..." --we ynh_restore_file --origin_path="/etc/logrotate.d/$app" +chown -R $app:$app "/var/log/$app" +chmod u=rwX,g=rX,o= "/var/log/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f226a6f..6d0adca 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -152,6 +152,9 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) ynh_use_logrotate +chown -R $app:$app "/var/log/$app" +chmod u=rwX,g=rX,o= "/var/log/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= From 2cab12d1613772621429d425b255df9dfccd5082 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 09:17:22 +0100 Subject: [PATCH 69/96] Fix --- scripts/backup | 8 ++++++-- scripts/restore | 14 ++++++++++++++ scripts/upgrade | 1 - 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/backup b/scripts/backup index 24f4cef..dc499f5 100644 --- a/scripts/backup +++ b/scripts/backup @@ -25,6 +25,7 @@ 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) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -37,8 +38,11 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$final_path" -# Copy the data files -ynh_backup --src_path="/home/$app" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +ynh_backup --src_path="$datadir" --is_big #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 4693d7c..bee368f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,6 +29,7 @@ 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) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -66,6 +67,19 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$datadir" --not_mandatory + +mkdir -p $datadir + +chmod 750 "$datadir" +chmod -R o-rwx "$datadir" +chown -R $app:www-data "$datadir" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 6d0adca..b54a3ed 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,7 +29,6 @@ port=$(ynh_app_setting_get --app=$app --key=port) architecture=$(ynh_detect_arch) datadir=$(ynh_app_setting_get --app=$app --key=datadir) - #================================================= # CHECK VERSION #================================================= From 09f4e5819d3d403bea0a17e50264e0ce8aeeb4cc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 10:32:50 +0100 Subject: [PATCH 70/96] Fix --- check_process | 6 +++--- conf/systemd.service | 2 +- doc/DESCRIPTION.md | 0 doc/DISCLAIMER.md | 0 manifest.json | 7 +++++++ scripts/install | 15 +-------------- 6 files changed, 12 insertions(+), 18 deletions(-) create mode 100644 doc/DESCRIPTION.md create mode 100644 doc/DISCLAIMER.md diff --git a/check_process b/check_process index e8e753c..375685c 100644 --- a/check_process +++ b/check_process @@ -12,10 +12,10 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=1 from_commit=3 + #upgrade=1 from_commit= backup_restore=1 multi_instance=1 change_url=1 ;;; Upgrade options - ; commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099 - name=First package version + ; commit= + name= diff --git a/conf/systemd.service b/conf/systemd.service index 81f88b7..ea676ee 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,6 +1,6 @@ [Unit] Description=Gogs (Go Git Service) -After=syslog.target network.target mysql.service slapd.service +After=syslog.target network.target mysql.service slapd.service redis.service [Service] Type=simple diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..e69de29 diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md new file mode 100644 index 0000000..e69de29 diff --git a/manifest.json b/manifest.json index e951f15..3345c93 100644 --- a/manifest.json +++ b/manifest.json @@ -8,6 +8,13 @@ }, "version": "0.12.3~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" + }, "license": "MIT", "maintainer": { "name": "", diff --git a/scripts/install b/scripts/install index 4f85511..d5a4ad4 100644 --- a/scripts/install +++ b/scripts/install @@ -114,17 +114,6 @@ mkdir -p "$final_path/custom/conf/auth.d" mkdir -p "/home/yunohost.app/$app/data/avatars" mkdir -p "/home/yunohost.app/$app/data/attachments" - -#================================================= -# STANDARD MODIFICATIONS -#================================================= - -# # Add users -# # We can't use the official helper because we need to set the shell for the login -# test getent passwd "$app" &>/dev/null || \ -# useradd -d "/home/$app" --system --user-group "$app" --shell /bin/bash || \ -# ynh_die "Unable to create $app system account" - #================================================= # MODIFY A CONFIG FILE #================================================= @@ -201,9 +190,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --weight=1 - -#set_access_settings +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary or protect it if [ $is_public -eq 1 ] From 264726f099d1570de1048d4a474e4d6e738ec58c Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 7 Nov 2021 09:32:58 +0000 Subject: [PATCH 71/96] Auto-update README --- README.md | 82 +++++++++++++--------------------------------------- README_fr.md | 39 +++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 62 deletions(-) create mode 100644 README_fr.md diff --git a/README.md b/README.md index da5a6b6..1271cf1 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,33 @@ + + # Gogs for YunoHost [![Integration level](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/gogs.maintain.svg) -[![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=gogs) +[![Install Gogs with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gogs) -> *This package allows you to install Gogs quickly and simply on a YunoHost server. +*[Lire ce readme en français.](./README_fr.md)* + +> *This package allows you to install Gogs quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* -> :warning: **Note that this package will not be longer be maintened by the actual maintener. -> The idea is to migrate to [gitea](https://github.com/YunoHost-Apps/gitea_ynh) which is more featured.** - ## Overview -Gogs is a self-hosted Git service written in Go. Alternative to Github. -**Shipped version:** 0.11.66 +Lightweight Git forge -## Screenshots +**Shipped version:** 0.12.3~ynh1 -![](https://gogs.io/img/screenshots/2.png) +**Demo:** https://try.gogs.io/user/login +## Documentation and resources -## Demo - -* [Official demo](https://try.gogs.io/user/login) - -For the old install you can migrate to gitea easly by juste upgrading your actuall gogs instance with the gitea source by this command: -``` -sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/gitea_ynh gogs -``` -**Note that this command contains some risk of data lost. So it's important to make a backup of the app before the install.** -To make a backup you can use this command: -``` -sudo yunohost backup create --debug --apps gogs -``` - -For the new install just install gitea by this command: -``` -sudo yunohost app install -l Gitea https://github.com/YunoHost-Apps/gitea_ynh -``` - -## 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 -``` - -Architecture: this package is compatible with amd64, i386 and arm. The package will try to detect it with the command uname -m and fail if it can't detect the architecture. If that happens please open an issue describing your hardware and the result of the command `uname -m`. - -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/gogs%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/gogs/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/gogs%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/gogs/) - - -## Links - - * Report a bug: https://github.com/YunoHost-Apps/gogs_ynh/issues - * App website: http://gogs.io - * Upstream app repository: https://github.com/gogs/gogs - * YunoHost website: https://yunohost.org/ - ---- +* Official app website: http://gogs.io +* Official admin documentation: https://gogs.io/docs +* Upstream app code repository: https://github.com/gogs/gogs +* YunoHost documentation for this app: https://yunohost.org/app_gogs +* Report a bug: https://github.com/YunoHost-Apps/gogs_ynh/issues ## Developer info @@ -83,3 +39,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/gogs_ynh/tree/testing or sudo yunohost app upgrade gogs -u https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug ``` + +**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..45a4359 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,39 @@ +# Gogs pour YunoHost + +[![Niveau d'intégration](https://dash.yunohost.org/integration/gogs.svg)](https://dash.yunohost.org/appci/app/gogs) ![](https://ci-apps.yunohost.org/ci/badges/gogs.status.svg) ![](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)* +*[Lire ce readme en français.](./README_fr.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.* + +## Vue d'ensemble + +Forge Git légère + +**Version incluse :** 0.12.3~ynh1 + +**Démo :** https://try.gogs.io/user/login + +## Documentations et ressources + +* Site officiel de l'app : http://gogs.io +* Documentation officielle de l'admin : https://gogs.io/docs +* Dépôt de code officiel de l'app : https://github.com/gogs/gogs +* Documentation YunoHost pour cette app : https://yunohost.org/app_gogs +* Signaler un bug : https://github.com/YunoHost-Apps/gogs_ynh/issues + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gogs_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/gogs_ynh/tree/testing --debug +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 :** https://yunohost.org/packaging_apps \ No newline at end of file From 31a7d2db2d574e90d4f8ee4de74a15a6b3f583f6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 10:33:42 +0100 Subject: [PATCH 72/96] Update restore --- scripts/restore | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/restore b/scripts/restore index bee368f..e96e040 100644 --- a/scripts/restore +++ b/scripts/restore @@ -104,9 +104,6 @@ ynh_script_progression --message="Restoring the logrotate configuration..." --we ynh_restore_file --origin_path="/etc/logrotate.d/$app" -chown -R $app:$app "/var/log/$app" -chmod u=rwX,g=rX,o= "/var/log/$app" - #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= From 16fe33fca527b8dacd3b19b5e3c43b0435319827 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 10:34:33 +0100 Subject: [PATCH 73/96] Update restore --- scripts/restore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/restore b/scripts/restore index e96e040..561b280 100644 --- a/scripts/restore +++ b/scripts/restore @@ -104,6 +104,10 @@ ynh_script_progression --message="Restoring the logrotate configuration..." --we ynh_restore_file --origin_path="/etc/logrotate.d/$app" +ynh_restore_file --origin_path="/var/log/$app" +chown -R $app:$app "/var/log/$app" +chmod u=rwX,g=rX,o= "/var/log/$app" + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= From c528ef72758a7957bcd4a24c72e5f41777d4b11e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 10:35:21 +0100 Subject: [PATCH 74/96] Fix --- scripts/change_url | 2 +- scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index e8c9218..9bcf390 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -145,7 +145,7 @@ ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index d5a4ad4..cb8ceca 100644 --- a/scripts/install +++ b/scripts/install @@ -185,7 +185,7 @@ yunohost service add $app --description="Lightweight Git forge" --log="/var/log/ ynh_script_progression --message="Starting a systemd service..." --weight=3 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index b54a3ed..19d38f2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -167,7 +167,7 @@ yunohost service add $app --description="Lightweight Git forge" --log="/var/log/ ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX From ef0d79ad8abe178b1cabcac8f5e199fbd70f3a18 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 12:30:23 +0100 Subject: [PATCH 75/96] Fix --- conf/app.ini | 360 ++++----------------------------------------- scripts/change_url | 25 ++-- scripts/install | 4 +- scripts/upgrade | 52 +++---- 4 files changed, 69 insertions(+), 372 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 70cac47..e419893 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -1,353 +1,75 @@ -; App name that shows on every page title -APP_NAME = Gogs: Go Git Service -; The name of the system user that runs Gogs +;https://github.com/gogits/gogs/blob/master/conf/app.ini +APP_NAME = Gogs RUN_USER = __APP__ -; Either "dev", "prod" or "test" RUN_MODE = prod [server] -PROTOCOL = http DOMAIN = __DOMAIN__ -ROOT_URL = https://__URL__/ -HTTP_ADDR = 0.0.0.0 HTTP_PORT = __PORT__ -; Permission for unix socket -UNIX_SOCKET_PERMISSION = 666 -; Local (DMZ) URL for Gogs workers (such as SSH update) accessing web service. -; In most cases you do not need to change the default value. -; Alter it only if your SSH server node is not the same as HTTP node. -LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/ -; Disable SSH feature when not available -DISABLE_SSH = false -; Whether use builtin SSH server or not. -START_SSH_SERVER = false -; Domain name to be exposed in SSH clone URL -SSH_DOMAIN = %(DOMAIN)s -; Port number to be exposed in SSH clone URL -SSH_PORT = 22 -; Network interface builtin SSH server listens on -SSH_LISTEN_HOST = 0.0.0.0 -; Port number builtin SSH server listens on -SSH_LISTEN_PORT = %(SSH_PORT)s -; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'. -SSH_ROOT_PATH = -; Indicate whether to rewrite authorized_keys at start, ignored when use builtin SSH server -REWRITE_AUTHORIZED_KEYS_AT_START = false -; Choose the ciphers to support for SSH connections -SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, arcfour256, arcfour128 -; Directory to create temporary files when test publick key using ssh-keygen, -; default is system temporary directory. -SSH_KEY_TEST_PATH = -; Path to ssh-keygen, default is 'ssh-keygen' and let shell find out which one to call. -SSH_KEYGEN_PATH = ssh-keygen -; Indicate whether to check minimum key size with corresponding type -MINIMUM_KEY_SIZE_CHECK = false -; Disable CDN even in "prod" mode +ROOT_URL = https://__URL__/ +HTTP_ADDR = 127.0.0.1 OFFLINE_MODE = false -DISABLE_ROUTER_LOG = false -; Generate steps: -; $ ./gogs cert -ca=true -duration=8760h0m0s -host=myhost.example.com -; -; Or from a .pfx file exported from the Windows certificate store (do -; not forget to export the private key): -; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys -; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes -CERT_FILE = custom/https/cert.pem -KEY_FILE = custom/https/key.pem -; Allowed TLS version values: SSL30, TLS10, TLS11, TLS12 -TLS_MIN_VERSION = TLS10 - -; Upper level of template and static file path -; default is the path where Gogs is executed -STATIC_ROOT_PATH = -; Default path for App data +DISABLE_SSH = false +SSH_PORT = 22 APP_DATA_PATH = __DATA_PATH__ -; Application level GZIP support -ENABLE_GZIP = false -; Landing page for non-logged users, can be "home" or "explore" LANDING_PAGE = explore [repository] -; Root path for storing repositories's data, default is "~//gogs-repositories" ROOT = __REPOS_PATH__ -; The script type server supports, sometimes could be "sh" -SCRIPT_TYPE = bash -; Default ANSI charset for an unrecognized charset -ANSI_CHARSET = -; Force every new repository to be private FORCE_PRIVATE = false -; Global maximum creation limit of repository per user, -1 means no limit -MAX_CREATION_LIMIT = -1 -; Mirror sync queue length, increase if mirror syncing starts hanging -MIRROR_QUEUE_LENGTH = 1000 -; Patch test queue length, increase if pull request patch testing starts hanging -PULL_REQUEST_QUEUE_LENGTH = 1000 -; Preferred Licenses to place at the top of the list -; Name must match file name in conf/license or custom/conf/license -PREFERRED_LICENSES = Apache License 2.0,MIT License -; Disable ability to interact with repositories by HTTP protocol -DISABLE_HTTP_GIT = false -; Enable ability to migrate repository by local path -ENABLE_LOCAL_PATH_MIGRATION = false -; Concurrency is used to retrieve commits information. This variable define -; the maximum number of tasks that can be run at the same time. Usually, the -; value depend of how many CPUs (cores) you have. If the value is set to zero -; or under, GOGS will automatically detect the number of CPUs your system have -COMMITS_FETCH_CONCURRENCY = 0 -; Enable render mode for raw file -ENABLE_RAW_FILE_RENDER_MODE = false - -[repository.editor] -; List of file extensions that should have line wraps in the CodeMirror editor. -; Separate extensions with a comma. To line wrap files without extension, just put a comma -LINE_WRAP_EXTENSIONS = .txt,.md,.markdown,.mdown,.mkd, -; Valid file modes that have a preview API associated with them, such as api/v1/markdown. -; Separate values by commas. Preview tab in edit mode won't show if the file extension doesn't match -PREVIEWABLE_FILE_MODES = markdown - -[repository.upload] -; Enable repository file uploads. -ENABLED = true -; Path to temporarily store uploads (default path gets cleaned by Gogs in every start) -TEMP_PATH = data/tmp/uploads -; File types that are allowed to be uploaded, e.g. image/jpeg|image/png. Leave empty means allow any file type -ALLOWED_TYPES = -; Maximum size of each file in MB -FILE_MAX_SIZE = 3 -; Maximum number of files per upload -MAX_FILES = 5 - -; Attachment settings for releases -[release.attachment] -; Whether attachments are enabled. Defaults to `true` -ENABLED = true -; Path for attachments. Defaults to `data/attachments` -PATH = data/attachments -; One or more allowed types, e.g. image/jpeg|image/png -ALLOWED_TYPES = */* -; Max size of each file. Defaults to 32MB -MAX_SIZE = 32 -; Max number of files per upload. Defaults to 10 -MAX_FILES = 10 - -[markdown] -; Enable hard line break extension -ENABLE_HARD_LINE_BREAK = false -; List of custom URL-Schemes that are allowed as links when rendering Markdown -; for example git,magnet -CUSTOM_URL_SCHEMES = -; List of file extensions that should be rendered/edited as Markdown -; Separate extensions with a comma. To render files w/o extension as markdown, just put a comma -FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd - -[smartypants] -ENABLED = false -FRACTIONS = true -DASHES = true -LATEX_DASHES = true -ANGLED_QUOTES = true - -[http] -; Value for Access-Control-Allow-Origin header, default is not to present -ACCESS_CONTROL_ALLOW_ORIGIN = - -; Define allowed algorithms and their minimum key length (use -1 to disable a type) -[ssh.minimum_key_sizes] -ED25519 = 256 -ECDSA = 256 -RSA = 2048 -DSA = 1024 [database] -; Either "mysql", "postgres" or "sqlite3", you can connect to TiDB with MySQL protocol DB_TYPE = mysql HOST = 127.0.0.1:3306 NAME = __DB_NAME__ USER = __DB_USER__ PASSWD = __DB_PWD__ -; For "postgres" only, either "disable", "require" or "verify-full" SSL_MODE = disable -; For "sqlite3" and "tidb", use absolute path when you start as service PATH = data/gogs.db -[admin] -; Disable regular (non-admin) users to create organizations -DISABLE_REGULAR_ORG_CREATION = false - [security] INSTALL_LOCK = true -; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!! SECRET_KEY = __KEY__ -; Auto-login remember days -LOGIN_REMEMBER_DAYS = 7 -COOKIE_USERNAME = gogs_awesome -COOKIE_REMEMBER_NAME = gogs_incredible -COOKIE_SECURE = false -; Reverse proxy authentication header name of user name REVERSE_PROXY_AUTHENTICATION_USER = REMOTE_USER -; Enable to set cookie to indicate user login status -ENABLE_LOGIN_STATUS_COOKIE = false -LOGIN_STATUS_COOKIE_NAME = login_status [service] -ACTIVE_CODE_LIVE_MINUTES = 180 -RESET_PASSWD_CODE_LIVE_MINUTES = 180 -; User need to confirm e-mail for registration REGISTER_EMAIL_CONFIRM = false -; Does not allow register and admin create account only -DISABLE_REGISTRATION = true -; User must sign in to view anything. -REQUIRE_SIGNIN_VIEW = __PRIVATE_MODE__ -; Mail notification -ENABLE_NOTIFY_MAIL = true -; More detail: https://github.com/gogits/gogs/issues/165 -ENABLE_REVERSE_PROXY_AUTHENTICATION = true -ENABLE_REVERSE_PROXY_AUTO_REGISTERATION = true -; Enable captcha validation for registration -ENABLE_CAPTCHA = false - -[webhook] -; Types are enabled for users to use, can be "gogs", "slack", "discord", "dingtalk" -TYPES = gogs, slack, discord, dingtalk -; Hook task queue length, increase if webhook shooting starts hanging -QUEUE_LENGTH = 1000 -; Deliver timeout in seconds -DELIVER_TIMEOUT = 15 -; Allow insecure certification -SKIP_TLS_VERIFY = false -; Number of history information in each page -PAGING_NUM = 10 +ENABLE_NOTIFY_MAIL = true +DISABLE_REGISTRATION = true +ENABLE_CAPTCHA = false +REQUIRE_SIGNIN_VIEW = false +ENABLE_REVERSE_PROXY_AUTHENTICATION = false +ENABLE_REVERSE_PROXY_AUTO_REGISTERATION = false [mailer] ENABLED = true -; Buffer length of channel, keep it as it is if you don't know what it is. -SEND_BUFFER_LEN = 100 -; Prefix prepended to the subject line -SUBJECT_PREFIX = `[%(APP_NAME)s] ` -; Mail server -; Gmail: smtp.gmail.com:587 -; QQ: smtp.qq.com:465 -; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used. HOST = 127.0.0.1:25 -; Disable HELO operation when hostname are different. -DISABLE_HELO = -; Custom hostname for HELO operation, default is from system. -HELO_HOSTNAME = -; Do not verify the certificate of the server. Only use this for self-signed certificates +FROM = "Gitea" SKIP_VERIFY = true -; Use client certificate -USE_CERTIFICATE = false -CERT_FILE = custom/mailer/cert.pem -KEY_FILE = custom/mailer/key.pem -; Mail from address, RFC 5322. This can be just an email address, or the `"Name" ` format -FROM = "Gogs" -; Mailer user name and password -USER = -PASSWD = -; Use text/plain as format of content -USE_PLAIN_TEXT = false - -[cache] -; Either "memory", "redis", or "memcache", default is "memory" -ADAPTER = memory -; For "memory" only, GC interval in seconds, default is 60 -INTERVAL = 60 -; For "redis" and "memcache", connection host address -; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 -; memcache: `127.0.0.1:11211` -HOST = [session] -; Either "memory", "file", or "redis", default is "memory" PROVIDER = memory -; Provider config options -; memory: not have any config yet -; file: session file path, e.g. `data/sessions` -; redis: network=tcp,addr=:6379,password=macaron,db=0,pool_size=100,idle_timeout=180 -; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table` -PROVIDER_CONFIG = data/sessions -; Session cookie name -COOKIE_NAME = i_like_gogits -; If you use session in https only, default is false -COOKIE_SECURE = false -; Enable set cookie, default is true -ENABLE_SET_COOKIE = true -; Session GC time interval, default is 3600 -GC_INTERVAL_TIME = 3600 -; Session life time, default is 86400 -SESSION_LIFE_TIME = 86400 -; Cookie name for CSRF -CSRF_COOKIE_NAME = _csrf [picture] -; Path to store user uploaded avatars AVATAR_UPLOAD_PATH = __DATA_PATH__/avatars -; Chinese users can choose "duoshuo" -; or a custom avatar source, like: http://cn.gravatar.com/avatar/ -GRAVATAR_SOURCE = gravatar -; This value will be forced to be true in offline mode. -DISABLE_GRAVATAR = false -; Federated avatar lookup uses DNS to discover avatar associated -; with emails, see https://www.libravatar.org -; This value will be forced to be false in offline mode or Gravatar is disbaled. -ENABLE_FEDERATED_AVATAR = false -; Attachment settings for issues -[attachment] -; Whether attachments are enabled. Defaults to `true` -ENABLED = true -; Path for attachments. Defaults to `data/attachments` -PATH = __DATA_PATH__/attachments -; One or more allowed types, e.g. image/jpeg|image/png -ALLOWED_TYPES = image/jpeg|image/png -; Max size of each file. Defaults to 4MB -MAX_SIZE = 4 -; Max number of files per upload. Defaults to 5 -MAX_FILES = 5 - -[time] -; Specifies the format for fully outputed dates. Defaults to RFC1123 -; Special supported values are ANSIC, UnixDate, RubyDate, RFC822, RFC822Z, RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Kitchen, Stamp, StampMilli, StampMicro and StampNano -; For more information about the format see http://golang.org/pkg/time/#pkg-constants -FORMAT = - -; General settings of loggers [log] +MODE = file +LEVEL = Info ROOT_PATH = /var/log/__APP__ -; Can be "console" and "file", default is "console" -; Use comma to separate multiple modes, e.g. "console, file" -MODE = file -; Buffer length of channel, keep it as it is if you don't know what it is. -BUFFER_LEN = 100 -; Either "Trace", "Info", "Warn", "Error", "Fatal", default is "Trace" -LEVEL = Warn -; For "console" mode only -[log.console] -; leave empty to inherit -LEVEL = +REDIRECT_MACARON_LOG= true +MACARON = file -; For "file" mode only -[log.file] -; leave empty to inherit -LEVEL = -; This enables automated log rotate (switch of following options) -LOG_ROTATE = true -; Segment log daily -DAILY_ROTATE = true -; Max size shift of single file, default is 28 means 1 << 28, 256MB -MAX_SIZE_SHIFT = 28 -; Max line number of single file -MAX_LINES = 1000000 -; Expired days of log file (delete after max days) -MAX_DAYS = 7 +ROUTER_LOG_LEVEL = Warn +ROUTER = file + +ENABLE_ACCESS_LOG = Warn +ACCESS = file + +ENABLE_XORM_LOG = Warn +XORM = file -; For "slack" mode only -[log.slack] -; leave empty to inherit -LEVEL = -; Webhook URL -URL = [log.discord] ; leave empty to inherit @@ -357,26 +79,6 @@ URL = ; Username displayed in webhook USERNAME = %(APP_NAME)s -[log.xorm] -; Enable file rotation -ROTATE = true -; Rotate every day -ROTATE_DAILY = true -; Rotate once file size excesses x MB -MAX_SIZE = 100 -; Maximum days to keep logger files -MAX_DAYS = 3 - -[cron] -; Enable running cron tasks periodically. -ENABLED = true -; Run cron tasks when Gogs starts. -RUN_AT_START = false - -; Update mirrors -[cron.update_mirrors] -SCHEDULE = @every 10m - ; Repository health check [cron.repo_health_check] SCHEDULE = @every 24h @@ -385,18 +87,6 @@ TIMEOUT = 60s ; see more on http://git-scm.com/docs/git-fsck/1.7.5 ARGS = -; Check repository statistics -[cron.check_repo_stats] -RUN_AT_START = true -SCHEDULE = @every 24h - -; Cleanup repository archives -[cron.repo_archive_cleanup] -RUN_AT_START = false -SCHEDULE = @every 24h -; Time duration to check if archive should be cleaned -OLDER_THAN = 24h - [git] ; Disables highlight of added and removed changes DISABLE_DIFF_HIGHLIGHT = false diff --git a/scripts/change_url b/scripts/change_url index 9bcf390..7be71d8 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,6 +30,10 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 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) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -105,8 +109,8 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -REPO_PATH="/home/$app/repositories" -DATA_PATH="/home/$app/data" +REPO_PATH="/home/yunohost.app/$app/repositories" +DATA_PATH="/home/yunohost.app/$app/data" cp ../conf/app.ini "$final_path/custom/conf" cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" @@ -118,14 +122,15 @@ else ynh_replace_string --match_string="__URL__" --replace_string="$new_domain${new_path%/}" --target_file="$final_path/custom/conf/app.ini" fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" if [[ "$is_public" = '1' ]] then diff --git a/scripts/install b/scripts/install index cb8ceca..79bdc35 100644 --- a/scripts/install +++ b/scripts/install @@ -26,6 +26,7 @@ path_url=$YNH_APP_ARG_PATH admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC architecture=$(ynh_detect_arch) +key=$(ynh_string_random) app=$YNH_APP_INSTANCE_NAME @@ -48,6 +49,7 @@ 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 +ynh_app_setting_set --app=$app --key=secret_key --value=$key #================================================= # STANDARD MODIFICATIONS @@ -132,7 +134,7 @@ ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --targ ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" +ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" diff --git a/scripts/upgrade b/scripts/upgrade index 19d38f2..1e42611 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -87,43 +87,43 @@ DATA_PATH="$datadir/data" ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$final_path --source_id="$architecture" +ynh_setup_source --dest_dir=$final_path --source_id="$architecture" --keep="$final_path/custom/conf/app.ini $final_path/custom/conf/auth.d/ldap.conf" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" +#ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" -cp ../conf/app.ini "$final_path/custom/conf" +# cp ../conf/app.ini "$final_path/custom/conf" -if [ "$path_url" = "/" ] -then - ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -else - ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" -fi +# if [ "$path_url" = "/" ] +# then +# ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +# else +# ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" +# fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" -if [[ "$is_public" = '1' ]] -then - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" -else - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" -fi +# if [[ "$is_public" = '1' ]] +# then +# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" +# else +# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" +# fi -ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" +#ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" -ynh_store_file_checksum "$final_path/custom/conf/app.ini" +#ynh_store_file_checksum "$final_path/custom/conf/app.ini" #================================================= # SETUP SYSTEMD From 3f294ab7c8d34e00611c7d0ae53e547b3f331a35 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 12:38:44 +0100 Subject: [PATCH 76/96] Update app.ini --- conf/app.ini | 111 --------------------------------------------------- 1 file changed, 111 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index e419893..dc80699 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -71,118 +71,7 @@ ENABLE_XORM_LOG = Warn XORM = file -[log.discord] -; leave empty to inherit -LEVEL = -; Webhook URL -URL = -; Username displayed in webhook -USERNAME = %(APP_NAME)s -; Repository health check -[cron.repo_health_check] -SCHEDULE = @every 24h -TIMEOUT = 60s -; Arguments for command 'git fsck', e.g. "--unreachable --tags" -; see more on http://git-scm.com/docs/git-fsck/1.7.5 -ARGS = - -[git] -; Disables highlight of added and removed changes -DISABLE_DIFF_HIGHLIGHT = false -; Max number of lines allowed of a single file in diff view -MAX_GIT_DIFF_LINES = 1000 -; Max number of characters of a line allowed in diff view -MAX_GIT_DIFF_LINE_CHARACTERS = 500 -; Max number of files shown in diff view -MAX_GIT_DIFF_FILES = 100 -; Arguments for command 'git gc', e.g. "--aggressive --auto" -; see more on http://git-scm.com/docs/git-gc/1.7.5 -GC_ARGS = - -; Operation timeout in seconds -[git.timeout] -MIGRATE = 600 -MIRROR = 300 -CLONE = 300 -PULL = 300 -GC = 60 - -[mirror] -; Default interval in hours between each check -DEFAULT_INTERVAL = 8 - -[api] -; Max number of items will response in a page -MAX_RESPONSE_ITEMS = 50 - -[ui] -; Number of repositories that are showed in one explore page -EXPLORE_PAGING_NUM = 20 -; Number of issues that are showed in one page -ISSUE_PAGING_NUM = 10 -; Number of maximum commits showed in one activity feed -FEED_MAX_COMMIT_NUM = 5 -; Value of "theme-color" meta tag, used by Android >= 5.0 -; An invalid color like "none" or "disable" will have the default style -; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android -THEME_COLOR_META_TAG = `#ff5343` -; Max size in bytes of files to be displayed (default is 8MB) -MAX_DISPLAY_FILE_SIZE = 8388608 - -[ui.admin] -; Number of users that are showed in one page -USER_PAGING_NUM = 50 -; Number of repos that are showed in one page -REPO_PAGING_NUM = 50 -; Number of notices that are showed in one page -NOTICE_PAGING_NUM = 25 -; Number of organization that are showed in one page -ORG_PAGING_NUM = 50 - -[ui.user] -; Number of repos that are showed in one page -REPO_PAGING_NUM = 15 -; Number of news feeds that are showed in one page -NEWS_FEED_PAGING_NUM = 20 -; Number of commits that are showed in one page -COMMITS_PAGING_NUM = 30 - -[i18n] -LANGS = en-US,zh-CN,zh-HK,zh-TW,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL,bg-BG,it-IT,fi-FI,tr-TR,cs-CZ,sr-SP,sv-SE,ko-KR,gl-ES,uk-UA,en-GB,hu-HU,sk-SK,id-ID,fa-IR,vi-VN -NAMES = English,简体中文,繁體中文(香港),繁體中文(臺灣),Deutsch,français,Nederlands,latviešu,русский,日本語,español,português do Brasil,polski,български,italiano,suomi,Türkçe,čeština,српски,svenska,한국어,galego,українська,English (United Kingdom),Magyar,Slovenčina,Indonesian,Persian,Vietnamese - -; Used for datetimepicker -[i18n.datelang] -en-US = en -zh-CN = zh -zh-HK = zh-TW -zh-TW = zh-TW -de-DE = de -fr-FR = fr -nl-NL = nl -lv-LV = lv -ru-RU = ru -ja-JP = ja -es-ES = es -pt-BR = pt-BR -pl-PL = pl -bg-BG = bg -it-IT = it -fi-FI = fi -tr-TR = tr -cs-CZ = cs-CZ -sr-SP = sr -sv-SE = sv -ko-KR = ko -gl-ES = gl -uk-UA = uk -en-GB = en-GB -hu-HU = hu -sk-SK = sk -id-ID = id -fa-IR = fa -vi-VN = vi ; Extension mapping to highlight class ; e.g. .toml=ini From 00a10200f5f9936a93005cecf093ca950a91817c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 12:39:07 +0100 Subject: [PATCH 77/96] Update app.ini --- conf/app.ini | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index dc80699..2ca5365 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -69,17 +69,3 @@ ACCESS = file ENABLE_XORM_LOG = Warn XORM = file - - - - -; Extension mapping to highlight class -; e.g. .toml=ini -[highlight.mapping] - -[other] -SHOW_FOOTER_BRANDING = false -; Show version information about Gogs and Go in the footer -SHOW_FOOTER_VERSION = true -; Show time of template execution in the footer -SHOW_FOOTER_TEMPLATE_LOAD_TIME = true From a64aea16973d501e0131b7958f332254d47b0469 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 12:42:15 +0100 Subject: [PATCH 78/96] add screenshot --- .gitattributes | 17 ----------- .gitignore | 50 --------------------------------- doc/screenshots/screenshot.png | Bin 0 -> 70387 bytes 3 files changed, 67 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore create mode 100644 doc/screenshots/screenshot.png diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index bdb0cab..0000000 --- a/.gitattributes +++ /dev/null @@ -1,17 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 30af0b5..0000000 --- a/.gitignore +++ /dev/null @@ -1,50 +0,0 @@ -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# ========================= -# Operating System Files -# ========================= - -# OSX -# ========================= - -.DS_Store -.AppleDouble -.LSOverride - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# From kateproject -.kateproject -.kateproject.d -.directory - -*.tar.gz diff --git a/doc/screenshots/screenshot.png b/doc/screenshots/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..dd5463355a14a5c76e360e1e474ef232196ad19c GIT binary patch literal 70387 zcmb6AXIN8Rus#l>Jb+5GP^62f^xmWd6qG8x_uhLaKtQD_RgjJZBhq`95N)4j?|MJH`%CtIJz5!Sq{?;ZqN|o(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Nv}NA#N;1e;jRS2I;*{S*13YyhaF`-D+>}jxQ)VFrp)L_j**V7_N9H z#=w2pl&Zhg6CKz*&FOnL$Lxw0X+wo(sBEVB20F%yY?{qoj`#NP;3E)bD~)68eO=b9 zg_gA-+z!F;!eXcA?&NFC7uj^*!tcJjQcTQh(r4vBV|N_fwa79TW;;|^9?|Jl!tDln45DuF{O1P4z6QRa@A}{I zc2>Nfk)h23SfC)$^dLOD__hlunD`k7XZlQ*eP8IpOx+3_87xEW;awq&j)~!pE?b^+ z-)o>bHQ0u`Da@j&K(I=mnn3vZjm%1=uicKKvR5g%oTJLl>PP0n0QCj}4S8ZbeP_F3 zP?%+d*~<4h{3}=~LJDs@m(6F+;3%PLI#J%B{tir?c6-BzaIgi6+vF6o}K|aXb-cJ7*b literal 0 HcmV?d00001 From 95f8bc62d2f65faf9e2bf074ad8777724ac248da Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 7 Nov 2021 11:42:20 +0000 Subject: [PATCH 79/96] Auto-update README --- README.md | 4 ++++ README_fr.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 1271cf1..3d9876a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ Lightweight Git forge **Demo:** https://try.gogs.io/user/login +## Screenshots + +![](./doc/screenshots/screenshot.png) + ## Documentation and resources * Official app website: http://gogs.io diff --git a/README_fr.md b/README_fr.md index 45a4359..90c2860 100644 --- a/README_fr.md +++ b/README_fr.md @@ -17,6 +17,10 @@ Forge Git légère **Démo :** https://try.gogs.io/user/login +## Captures d'écran + +![](./doc/screenshots/screenshot.png) + ## Documentations et ressources * Site officiel de l'app : http://gogs.io From bff9280ee39411f176ef8987bcb9d16ab72ccb4f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 12:47:35 +0100 Subject: [PATCH 80/96] Fix --- doc/DESCRIPTION.md | 1 + doc/DESCRIPTION_fr.md | 1 + 2 files changed, 2 insertions(+) create mode 100644 doc/DESCRIPTION_fr.md diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index e69de29..9299456 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -0,0 +1 @@ +Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its particularity is that it is light and can run on an ARM card, which makes it suitable for self-hosting. Gogs has a web interface similar to that of GitHub. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md new file mode 100644 index 0000000..9c5e9cb --- /dev/null +++ b/doc/DESCRIPTION_fr.md @@ -0,0 +1 @@ +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. \ No newline at end of file From 8162f5050974bc728b393e645b82dc03f30fed09 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sun, 7 Nov 2021 11:47:42 +0000 Subject: [PATCH 81/96] 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 3d9876a..63828d7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Lightweight Git forge +Gogs (Go Git Service) is a git-based multiplatform forge written in Go. Its particularity is that it is light and can run on an ARM card, which makes it suitable for self-hosting. Gogs has a web interface similar to that of GitHub. **Shipped version:** 0.12.3~ynh1 diff --git a/README_fr.md b/README_fr.md index 90c2860..40ae0d1 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Forge Git légère +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.3~ynh1 From 7a8297a10a5b017f10fd5f257b3f98cc023902f0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 15:29:45 +0100 Subject: [PATCH 82/96] fix --- scripts/change_url | 1 + scripts/install | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 7be71d8..047b901 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,6 +34,7 @@ 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) +is_public=$(ynh_app_setting_get --app=$app --key=is_public) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP diff --git a/scripts/install b/scripts/install index 79bdc35..542855e 100644 --- a/scripts/install +++ b/scripts/install @@ -50,6 +50,7 @@ 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 ynh_app_setting_set --app=$app --key=secret_key --value=$key +ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS From e0194b94964dde53daa3aedbfe227076298e2c94 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 15:44:01 +0100 Subject: [PATCH 83/96] Update install --- scripts/install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 542855e..cc4085a 100644 --- a/scripts/install +++ b/scripts/install @@ -108,14 +108,14 @@ chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" -REPO_PATH="/home/yunohost.app/$app/repositories" -DATA_PATH="/home/yunohost.app/$app/data" +REPO_PATH="$datadir/repositories" +DATA_PATH="$datadir/data" # create needed directories mkdir -p "$final_path/data" mkdir -p "$final_path/custom/conf/auth.d" -mkdir -p "/home/yunohost.app/$app/data/avatars" -mkdir -p "/home/yunohost.app/$app/data/attachments" +mkdir -p "$datadir/data/avatars" +mkdir -p "$datadir/data/attachments" #================================================= # MODIFY A CONFIG FILE @@ -127,7 +127,7 @@ if [ "$path_url" = "/" ] then ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" else - ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" + ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url}" --target_file="$final_path/custom/conf/app.ini" fi ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" From 8ef998c9cff8cecbb02d5c897d8ce9746346c6e4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 7 Nov 2021 15:44:13 +0100 Subject: [PATCH 84/96] Update install --- scripts/install | 55 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index cc4085a..ed3548e 100644 --- a/scripts/install +++ b/scripts/install @@ -121,35 +121,58 @@ mkdir -p "$datadir/data/attachments" # MODIFY A CONFIG FILE #================================================= -cp ../conf/app.ini "$final_path/custom/conf" if [ "$path_url" = "/" ] then - ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" + url="$domain" else - ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url}" --target_file="$final_path/custom/conf/app.ini" + url="$domain${path_url}" fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" - if [[ "$is_public" = '1' ]] then - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" + private_mode="false" else - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" + private_mode="true" fi +ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini" + +chmod 400 "$final_path/custom/conf/app.ini" +chown $app:$app "$final_path/custom/conf/app.ini" + + + + +# cp ../conf/app.ini "$final_path/custom/conf" + +# if [ "$path_url" = "/" ] +# then +# ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +# else +# ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url}" --target_file="$final_path/custom/conf/app.ini" +# fi + +# ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" +# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" + +# if [[ "$is_public" = '1' ]] +# then +# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" +# else +# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" +# fi + ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" -ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" +#ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" # Configure init script ynh_add_systemd_config From 119ce3cee0dfe6872eb79411173db61440373a4b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 21:09:13 +0100 Subject: [PATCH 85/96] Fix --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index ed3548e..e49b339 100644 --- a/scripts/install +++ b/scripts/install @@ -108,8 +108,8 @@ chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:www-data "$datadir" -REPO_PATH="$datadir/repositories" -DATA_PATH="$datadir/data" +repo_path="$datadir/repositories" +data_path="$datadir/data" # create needed directories mkdir -p "$final_path/data" diff --git a/scripts/upgrade b/scripts/upgrade index 1e42611..51f0df3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,8 +82,8 @@ ynh_secure_remove --file="/opt/$app/templates" #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -REPO_PATH="$datadir/repositories" -DATA_PATH="$datadir/data" +repo_path="$datadir/repositories" +data_path="$datadir/data" ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src From 4bad3631e77a7dcdae42ed17df17a720d14c62a3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 21:22:23 +0100 Subject: [PATCH 86/96] Update app.ini --- conf/app.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 2ca5365..93388be 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -11,11 +11,11 @@ HTTP_ADDR = 127.0.0.1 OFFLINE_MODE = false DISABLE_SSH = false SSH_PORT = 22 -APP_DATA_PATH = __DATA_PATH__ +APP_DATA_PATH = __DATADIR/data LANDING_PAGE = explore [repository] -ROOT = __REPOS_PATH__ +ROOT = __DATADIR__/repositories FORCE_PRIVATE = false [database] @@ -51,7 +51,7 @@ SKIP_VERIFY = true PROVIDER = memory [picture] -AVATAR_UPLOAD_PATH = __DATA_PATH__/avatars +AVATAR_UPLOAD_PATH = __DATADIR__/data/avatars [log] MODE = file From ed87f1ed25ea39f07312a1c432ff47d391578b76 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 21:48:50 +0100 Subject: [PATCH 87/96] fix --- scripts/_common.sh | 103 +++++++-------------------------------------- scripts/install | 41 +----------------- scripts/restore | 2 +- scripts/upgrade | 32 -------------- 4 files changed, 18 insertions(+), 160 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b04dd7b..f8db05b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,5 +1,19 @@ +#!/bin/bash + #================================================= -# SET ALL CONSTANTS +# COMMON VARIABLES +#================================================= + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS #================================================= # Detect the system architecture to download the right tarball @@ -23,89 +37,4 @@ ynh_detect_arch(){ #================================================= # DEFINE ALL COMMON FONCTIONS #================================================= - -create_dir() { - mkdir -p "$final_path/data" - mkdir -p "$final_path/custom/conf/auth.d" - mkdir -p "$DATA_PATH/avatars" - mkdir -p "$DATA_PATH/attachments" - mkdir -p "/var/log/$app" -} - -config_gogs() { - ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" - - cp ../conf/app.ini "$final_path/custom/conf" - - if [ "$path_url" = "/" ] - then - ynh_replace_string "__URL__" "$domain" "$final_path/custom/conf/app.ini" - else - ynh_replace_string "__URL__" "$domain${path_url%/}" "$final_path/custom/conf/app.ini" - fi - - ynh_replace_string "__REPOS_PATH__" "$REPO_PATH" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_PWD__" "$db_pwd" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DB_NAME__" "$db_name" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DOMAIN__" "$domain" "$final_path/custom/conf/app.ini" - ynh_replace_string "__KEY__" "$key" "$final_path/custom/conf/app.ini" - ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" - ynh_replace_string "__PORT__" $port "$final_path/custom/conf/app.ini" - ynh_replace_string "__APP__" $app "$final_path/custom/conf/app.ini" - - if [[ "$is_public" = '1' ]] - then - ynh_replace_string "__PRIVATE_MODE__" "false" "$final_path/custom/conf/app.ini" - else - ynh_replace_string "__PRIVATE_MODE__" "true" "$final_path/custom/conf/app.ini" - fi - - ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" - - ynh_store_file_checksum "$final_path/custom/conf/app.ini" -} - -set_permission() { - chown -R $app:$app "$final_path" - chown -R $app:$app "/home/$app" - chown -R $app:$app "/var/log/$app" - chmod u=rwX,g=rX,o= "$final_path" - chmod u=rwX,g=rX,o= "/home/$app" - chmod u=rwX,g=rX,o= "/var/log/$app" -} - -set_access_settings() { - if [ $is_public -eq 1 ] - then - ynh_permission_update --permission="main" --add="visitors" - else - # For an access to the git server by https in private mode we need to allow the access to theses URL : - # - "DOMAIN/PATH/USER/REPOSITORY/info/refs" - # - "DOMAIN/PATH/USER/REPOSITORY/git-upload-pack" - # - "DOMAIN/PATH/USER/REPOSITORY/git-receive-pack" - - excaped_domain=${domain//'.'/'%.'} - excaped_domain=${excaped_domain//'-'/'%-'} - excaped_path=${path_url//'.'/'%.'} - excaped_path=${excaped_path//'-'/'%-'} - ynh_app_setting_set $app skipped_regex "$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-receive%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-upload%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/info/refs" - fi -} - - -# Start or restart a service and follow its booting -# -# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name] -# -# | arg: Line to match - The line to find in the log to attest the service have finished to boot. -# | arg: Log file - The log file to watch -# | arg: Service name -# /var/log/$app/$app.log will be used if no other log is defined. -# | arg: Timeout - The maximum time to wait before ending the watching. Defaut 300 seconds. -ynh_check_starting () { - local line_to_match="$1" - local service_name="${4:-$app}" - local app_log="${2:-/var/log/$service_name/$service_name.log}" - local timeout=${3:-300} -} - \ No newline at end of file + \ No newline at end of file diff --git a/scripts/install b/scripts/install index e49b339..5adcd3c 100644 --- a/scripts/install +++ b/scripts/install @@ -121,19 +121,11 @@ mkdir -p "$datadir/data/attachments" # MODIFY A CONFIG FILE #================================================= - if [ "$path_url" = "/" ] then url="$domain" else - url="$domain${path_url}" -fi - -if [[ "$is_public" = '1' ]] -then - private_mode="false" -else - private_mode="true" + url="$domain${path_url%/}" fi ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini" @@ -141,39 +133,8 @@ ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/co chmod 400 "$final_path/custom/conf/app.ini" chown $app:$app "$final_path/custom/conf/app.ini" - - - -# cp ../conf/app.ini "$final_path/custom/conf" - -# if [ "$path_url" = "/" ] -# then -# ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -# else -# ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url}" --target_file="$final_path/custom/conf/app.ini" -# fi - -# ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" - -# if [[ "$is_public" = '1' ]] -# then -# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" -# else -# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" -# fi - ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" -#ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" - # Configure init script ynh_add_systemd_config diff --git a/scripts/restore b/scripts/restore index 561b280..bf6b898 100644 --- a/scripts/restore +++ b/scripts/restore @@ -44,7 +44,7 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." +ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 51f0df3..12041e4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -93,38 +93,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" - -# cp ../conf/app.ini "$final_path/custom/conf" - -# if [ "$path_url" = "/" ] -# then -# ynh_replace_string --match_string="__URL__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -# else -# ynh_replace_string --match_string="__URL__" --replace_string="$domain${path_url%/}" --target_file="$final_path/custom/conf/app.ini" -# fi - -# ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__KEY__" --replace_string="$(ynh_string_random)" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" - -# if [[ "$is_public" = '1' ]] -# then -# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" -# else -# ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" -# fi - -#ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" - -#ynh_store_file_checksum "$final_path/custom/conf/app.ini" - #================================================= # SETUP SYSTEMD #================================================= From bc6f1437e00b1766aed27270e59e353d30a4c55b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 21:51:33 +0100 Subject: [PATCH 88/96] Update app.ini --- conf/app.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/app.ini b/conf/app.ini index 93388be..061c412 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -11,7 +11,7 @@ HTTP_ADDR = 127.0.0.1 OFFLINE_MODE = false DISABLE_SSH = false SSH_PORT = 22 -APP_DATA_PATH = __DATADIR/data +APP_DATA_PATH = __DATADIR__/data LANDING_PAGE = explore [repository] From f3d867640692d5dcf975e721c23c741dd6868c82 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 21:58:32 +0100 Subject: [PATCH 89/96] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index f8db05b..8b60cc4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -28,7 +28,7 @@ ynh_detect_arch(){ elif [ -n "$(uname -m | grep arm)" ]; then architecture="armv7" else - ynh_die "Unable to detect your achitecture, please open a bug describing \ + ynh_die --message "Unable to detect your achitecture, please open a bug describing \ your hardware and the result of the command \"uname -m\"." 1 fi echo $architecture From c7a9841a987d807b9057bb0f4b1faa154947b0af Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 22:06:26 +0100 Subject: [PATCH 90/96] fix --- scripts/_common.sh | 5 ----- scripts/upgrade | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8b60cc4..bc051ba 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -33,8 +33,3 @@ ynh_detect_arch(){ fi echo $architecture } - -#================================================= -# DEFINE ALL COMMON FONCTIONS -#================================================= - \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 12041e4..0577d3c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -75,16 +75,13 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= # Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 -ynh_secure_remove --file="/opt/$app/templates" +ynh_secure_remove --file="$final_path/templates" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression --message="Setting up source files..." --weight=3 -repo_path="$datadir/repositories" -data_path="$datadir/data" - ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir=$final_path --source_id="$architecture" --keep="$final_path/custom/conf/app.ini $final_path/custom/conf/auth.d/ldap.conf" From 1d7286c34ac1e77179f6b3749e8b0b66a1ba2252 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 22:07:44 +0100 Subject: [PATCH 91/96] Update install --- scripts/install | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/install b/scripts/install index 5adcd3c..e4cb228 100644 --- a/scripts/install +++ b/scripts/install @@ -50,7 +50,6 @@ 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 ynh_app_setting_set --app=$app --key=secret_key --value=$key -ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # STANDARD MODIFICATIONS From 795df0d2b1685bb6ee03dde67f8c0dca349162df Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 22:52:42 +0100 Subject: [PATCH 92/96] Update remove --- scripts/remove | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index d729e03..2a6e9d4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -61,10 +61,15 @@ ynh_script_progression --message="Removing app main directory..." --weight=3 ynh_secure_remove --file="$final_path" #================================================= -# REMOVE VARIOUS FILES +# REMOVE DATA DIR #================================================= -ynh_secure_remove --file="$datadir" +# 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 + ynh_secure_remove --file="$datadir" +fi ynh_secure_remove --file="/var/log/$app" From eb1dc82b7ea474005d313e4218923f5d3b02116a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 23:04:19 +0100 Subject: [PATCH 93/96] Update change_url --- scripts/change_url | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 047b901..6f57408 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -110,39 +110,22 @@ fi #================================================= # SPECIFIC MODIFICATIONS #================================================= -REPO_PATH="/home/yunohost.app/$app/repositories" -DATA_PATH="/home/yunohost.app/$app/data" - -cp ../conf/app.ini "$final_path/custom/conf" -cp ../conf/ldap.conf "$final_path/custom/conf/auth.d/ldap.conf" if [ "$path_url" = "/" ] then - ynh_replace_string --match_string="__URL__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini" + url="$new_domain" else - ynh_replace_string --match_string="__URL__" --replace_string="$new_domain${new_path%/}" --target_file="$final_path/custom/conf/app.ini" + url="$new_domain${new_path%/}" fi -ynh_replace_string --match_string="__REPOS_PATH__" --replace_string="$REPO_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__KEY__" --replace_string="$key" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__DATA_PATH__" --replace_string="$DATA_PATH" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/custom/conf/app.ini" +domain=$new_domain -if [[ "$is_public" = '1' ]] -then - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="false" --target_file="$final_path/custom/conf/app.ini" -else - ynh_replace_string --match_string="__PRIVATE_MODE__" --replace_string="true" --target_file="$final_path/custom/conf/app.ini" -fi +ynh_add_config --template="../conf/app.ini" --destination="$final_path/custom/conf/app.ini" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/custom/conf/auth.d/ldap.conf" +chmod 400 "$final_path/custom/conf/app.ini" +chown $app:$app "$final_path/custom/conf/app.ini" -ynh_store_file_checksum --file="$final_path/custom/conf/app.ini" +ynh_add_config --template="../conf/ldap.conf" --destination="$final_path/custom/conf/auth.d/ldap.conf" #================================================= # GENERIC FINALISATION From 0b4c9bad4ad1cf54416e7d84b8a3dccda89b09db Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 8 Nov 2021 23:05:30 +0100 Subject: [PATCH 94/96] Update change_url --- scripts/change_url | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/change_url b/scripts/change_url index 6f57408..957d1d1 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,7 +34,6 @@ 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) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From 66f021fe6b2654d0d4a03882a1c512408b8dbd90 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 9 Nov 2021 07:31:31 +0100 Subject: [PATCH 95/96] Update change_url --- scripts/change_url | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/change_url b/scripts/change_url index 957d1d1..3c3015d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,6 +34,7 @@ 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) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP From 47598ffd1cb8f2f8304078dcc138ecdea628a102 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 21 Nov 2021 21:30:21 +0100 Subject: [PATCH 96/96] Remove http->https redirect in nginx conf, now handled by yunohost core --- conf/nginx.conf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f443e57..fe4b9f3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,6 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Force https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } proxy_pass http://127.0.0.1:__PORT__/; proxy_set_header Host $host;