From 09deb19ac3c9733e4e0984512b7e6c1a8f79cb2e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 15 May 2022 23:28:26 +0200 Subject: [PATCH 1/6] Fix --- check_process | 2 +- conf/systemd.service | 45 -------------------------------------------- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 conf/systemd.service diff --git a/check_process b/check_process index 8362c16..0470266 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,7 @@ ;; Test complet ; Manifest domain="domain.tld" - path="/path" + path="/path/admin" is_public=1 language="en_US" admin="john" diff --git a/conf/systemd.service b/conf/systemd.service deleted file mode 100644 index 31e9da3..0000000 --- a/conf/systemd.service +++ /dev/null @@ -1,45 +0,0 @@ -[Unit] -Description=Small description of the service -After=network.target - -[Service] -Type=simple -User=__APP__ -Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/script -StandardOutput=append:/var/log/__APP__/__APP__.log -StandardError=inherit - -# 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 c69603d8ec32deef9505aabc89d35f8b2c4c1bd9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 28 Jul 2022 01:09:46 +0200 Subject: [PATCH 2/6] Apply example_ynh --- .github/ISSUE_TEMPLATE.md | 55 +++++++++ .github/PULL_REQUEST_TEMPLATE.md | 16 +++ .github/workflows/updater.sh | 107 ++++++++++++++++++ .github/workflows/updater.yml | 49 ++++++++ check_process | 6 +- conf/nginx.conf | 2 +- conf/temp.gsconfig.php | 6 +- manifest.json | 29 ++++- scripts/_common.sh | 5 +- scripts/backup | 1 - scripts/install | 56 ++++++--- scripts/remove | 2 + scripts/restore | 15 ++- scripts/upgrade | 28 +++-- .../app/admin}/lang/de_DE.php | 0 .../app/admin}/lang/fr_FR.php | 0 .../app/admin}/lang/nl_NL.php | 0 17 files changed, 326 insertions(+), 51 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/updater.sh create mode 100644 .github/workflows/updater.yml rename sources/{ => extra_files/app/admin}/lang/de_DE.php (100%) rename sources/{ => extra_files/app/admin}/lang/fr_FR.php (100%) mode change 100755 => 100644 rename sources/{ => extra_files/app/admin}/lang/nl_NL.php (100%) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..2729a6b --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,55 @@ +--- +name: Bug report +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. + +--- + +**How to post a meaningful bug report** +1. *Read this whole template first.* +2. *Determine if you are on the right place:* + - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* +3. *Delete the italic comments as you write over them below, and remove this guide.* +--- + +### Describe the bug + +*A clear and concise description of what the bug is.* + +### Context + +- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* +- YunoHost version: x.x.x +- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* + - If yes, please explain: +- Using, or trying to install package version/branch: +- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* + +### Steps to reproduce + +- *If you performed a command from the CLI, the command itself is enough. For example:* + ```sh + sudo yunohost app install the_app + ``` +- *If you used the webadmin, please perform the equivalent command from the CLI first.* +- *If the error occurs in your browser, explain what you did:* + 1. *Go to '...'* + 2. *Click on '...'* + 3. *Scroll down to '...'* + 4. *See error* + +### Expected behavior + +*A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* + +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + +*If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh new file mode 100644 index 0000000..cddea17 --- /dev/null +++ b/.github/workflows/updater.sh @@ -0,0 +1,107 @@ +#!/bin/bash + +#================================================= +# PACKAGE UPDATING HELPER +#================================================= + +# This script is meant to be run by GitHub Actions +# The YunoHost-Apps organisation offers a template Action to run this script periodically +# Since each app is different, maintainers can adapt its contents so as to perform +# automatic actions when a new upstream release is detected. + +#================================================= +# FETCHING LATEST RELEASE AND ITS ASSETS +#================================================= + +# Fetching information +current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') +repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') +# Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) +version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) +assets="https://github.com/GetSimpleCMS/GetSimpleCMS/archive/refs/tags/$version.tar.gz" + +# Later down the script, we assume the version has only digits and dots +# Sometimes the release name starts with a "v", so let's filter it out. +# You may need more tweaks here if the upstream repository has different naming conventions. +if [[ ${version:0:1} == "v" || ${version:0:1} == "V" ]]; then + version=${version:1} +fi + +# Setting up the environment variables +echo "Current version: $current_version" +echo "Latest release from upstream: $version" +echo "VERSION=$version" >> $GITHUB_ENV +echo "REPO=$repo" >> $GITHUB_ENV +# For the time being, let's assume the script will fail +echo "PROCEED=false" >> $GITHUB_ENV + +# Proceed only if the retrieved version is greater than the current one +if ! dpkg --compare-versions "$current_version" "lt" "$version" ; then + echo "::warning ::No new version available" + exit 0 +# Proceed only if a PR for this new version does not already exist +elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY.git ci-auto-update-v$version ; then + echo "::warning ::A branch already exists for this update" + exit 0 +fi + +#================================================= +# UPDATE SOURCE FILES +#================================================= + +# Let's download source tarball +asset_url=$assets + +echo "Handling asset at $asset_url" + +src="app" + +# Create the temporary directory +tempdir="$(mktemp -d)" + +# Download sources and calculate checksum +filename=${asset_url##*/} +curl --silent -4 -L $asset_url -o "$tempdir/$filename" +checksum=$(sha256sum "$tempdir/$filename" | head -c 64) + +# Delete temporary directory +rm -rf $tempdir + +# Get extension +if [[ $filename == *.tar.gz ]]; then + extension=tar.gz +else + extension=${filename##*.} +fi + +# Rewrite source file +cat < conf/$src.src +SOURCE_URL=$asset_url +SOURCE_SUM=$checksum +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=$extension +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true +EOT +echo "... conf/$src.src updated" + +#================================================= +# SPECIFIC UPDATE STEPS +#================================================= + +# Any action on the app's source code can be done. +# The GitHub Action workflow takes care of committing all changes after this script ends. + +#================================================= +# GENERIC FINALIZATION +#================================================= + +# Replace new version in manifest +echo "$(jq -s --indent 4 ".[] | .version = \"$version~ynh1\"" manifest.json)" > manifest.json + +# No need to update the README, yunohost-bot takes care of it + +# The Action will proceed only if the PROCEED environment variable is set to true +echo "PROCEED=true" >> $GITHUB_ENV +exit 0 diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false diff --git a/check_process b/check_process index 0470266..064eb37 100644 --- a/check_process +++ b/check_process @@ -1,7 +1,7 @@ ;; Test complet ; Manifest domain="domain.tld" - path="/path/admin" + path="/path" is_public=1 language="en_US" admin="john" @@ -21,7 +21,3 @@ ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& diff --git a/conf/nginx.conf b/conf/nginx.conf index 549b52a..d9fdc4e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/ ; + alias __FINALPATH__/; index index.php; diff --git a/conf/temp.gsconfig.php b/conf/temp.gsconfig.php index bff157f..4e3fe46 100644 --- a/conf/temp.gsconfig.php +++ b/conf/temp.gsconfig.php @@ -61,7 +61,7 @@ define('GSDONOTPING', 1); #define('GSEDITOROPTIONS', ''); # Set email from address -#define('GSFROMEMAIL', 'noreply@get-simple.info'); +#define('GSFROMEMAIL', 'noreply@__DOMAIN__'); # Autosave within edit.php. Value is the autosave interval in seconds #define('GSAUTOSAVE', 900); @@ -71,7 +71,7 @@ define('GSDONOTPING', 1); # Set PHP locale # http://php.net/manual/en/function.setlocale.php -etlocale(LC_ALL, '__LANGUAGE__'); +setlocale(LC_ALL, '__LANGUAGE__'); # Define default timezone of server, accepts php timezone string # valid timeszones can be found here http://www.php.net/manual/en/timezones.php @@ -127,4 +127,4 @@ define('GSNOAPACHECHECK', true); # GS can format its xml files before saving them if you require human readable source for them # define('GSFORMATXML',true); -?> \ No newline at end of file +?> diff --git a/manifest.json b/manifest.json index 672a9db..f96cbdd 100644 --- a/manifest.json +++ b/manifest.json @@ -6,11 +6,11 @@ "en": "Flatfile CMS that works fast and efficient", "fr": "Flatfile CMS that works fast and efficient" }, - "version": "3.3.16~ynh1", - "url": "http://get-simple.info/", + "version": "3.3.16~ynh2", + "url": "http://get-simple.info", "upstream": { "license": "GPL-3.0", - "website": "http://get-simple.info/", + "website": "http://get-simple.info", "demo": "https://demo.example.com", "admindoc": "http://get-simple.info/wiki/fr:start", "code": "https://github.com/GetSimpleCMS/GetSimpleCMS" @@ -26,10 +26,10 @@ "multi_instance": true, "services": [ "nginx", - "php7.4-fpm" + "php7.3-fpm" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -52,8 +52,25 @@ "en": "Choose the application language", "fr": "Choisissez la langue de l'application" }, - "choices": ["de_DE", "en_US", "fr_FR", "nl_NL"], + "choices": [ + "de_DE", + "en_US", + "fr_FR", + "nl_NL" + ], "default": "fr_FR" + }, + { + "name": "admin", + "type": "user" + }, + { + "name": "password", + "type": "password", + "help": { + "en": "Use the help field to add an information for the admin about this question.", + "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." + } } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 4af8641..bdb3d3a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,8 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.4" - -pkg_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-xml" +# dependencies used by the app +pkg_dependencies="php$YNH_DEFAULT_PHP_VERSION-xml php$YNH_DEFAULT_PHP_VERSION-curl php$YNH_DEFAULT_PHP_VERSION-gd php$YNH_DEFAULT_PHP_VERSION-zip php$YNH_DEFAULT_PHP_VERSION-xml" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 2efaa42..9b12047 100755 --- a/scripts/backup +++ b/scripts/backup @@ -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 diff --git a/scripts/install b/scripts/install index 5757c3f..f0ef46b 100755 --- a/scripts/install +++ b/scripts/install @@ -14,7 +14,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 @@ -28,11 +27,14 @@ domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE -timezone="$(cat /etc/timezone)" -phpversion=$YNH_PHP_VERSION +admin=$YNH_APP_ARG_ADMIN +password=$YNH_APP_ARG_PASSWORD app=$YNH_APP_INSTANCE_NAME +timezone="$(cat /etc/timezone)" +email=$(ynh_user_get_info --username=$admin --key="mail") + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -52,6 +54,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=path --value=$path_url ynh_app_setting_set --app=$app --key=language --value=$language +ynh_app_setting_set --app=$app --key=admin --value=$admin #================================================= # INSTALL DEPENDENCIES @@ -77,20 +80,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" -mv ../sources/lang/* $final_path/admin/lang - chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -99,15 +92,44 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config + +#================================================= +# SPECIFIC SETUP #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/temp.gsconfig.php" --destination="$final_path/temp.gsconfig.php" +ynh_add_config --template="../conf/temp.gsconfig.php" --destination="$final_path/gsconfig.php" -# chmod 655 "$final_path/temp.gsconfig.php" -# chown $app:$app "$final_path/temp.gsconfig.php" +chmod 400 "$final_path/gsconfig.php" +chown $app:$app "$final_path/gsconfig.php" + +#================================================= +# SETUP APPLICATION WITH CURL +#================================================= +ynh_script_progression --message="Setuping application with CURL..." + +# Set the app as temporarily public for curl call +ynh_script_progression --message="Configuring SSOwat..." +# Making the app public for curl +ynh_permission_update --permission="main" --add="visitors" + +# Installation with curl +ynh_script_progression --message="Finalizing installation..." +ynh_local_curl "/admin/install.php" "lang=$language" "continue=continue" +ynh_local_curl "/admin/setup.php" "siteurl=https://$domain$path_url" "lang=$language" "sitename=YunoHost" "user=$admin" "email=$email" "submitted=submitted" +ynh_local_curl "/admin/support.php" "updated=2" + +# Remove the public access +ynh_permission_update --permission="main" --remove="visitors" #================================================= # SETUP SSOWAT @@ -117,6 +139,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary 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 diff --git a/scripts/remove b/scripts/remove index 89ee8eb..765a213 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +#================================================= +# STANDARD REMOVE #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index c85fc6b..e20d9eb 100755 --- 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 @@ -43,13 +42,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -86,6 +78,13 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b39ba75..8925452 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,6 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -65,14 +66,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -88,6 +81,25 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config + +#================================================= +# SPECIFIC UPGRADE +#================================================= +# UPDATE A CONFIG FILE +#================================================= +ynh_script_progression --message="Updating a configuration file..." + +ynh_add_config --template="../conf/temp.gsconfig.php" --destination="$final_path/temp.gsconfig.php" + +#================================================= +# GENERIC FINALIZATION #================================================= # RELOAD NGINX #================================================= diff --git a/sources/lang/de_DE.php b/sources/extra_files/app/admin/lang/de_DE.php similarity index 100% rename from sources/lang/de_DE.php rename to sources/extra_files/app/admin/lang/de_DE.php diff --git a/sources/lang/fr_FR.php b/sources/extra_files/app/admin/lang/fr_FR.php old mode 100755 new mode 100644 similarity index 100% rename from sources/lang/fr_FR.php rename to sources/extra_files/app/admin/lang/fr_FR.php diff --git a/sources/lang/nl_NL.php b/sources/extra_files/app/admin/lang/nl_NL.php similarity index 100% rename from sources/lang/nl_NL.php rename to sources/extra_files/app/admin/lang/nl_NL.php From 34ef0f21bb814f87ec4f5462f7d9e62142ea7d4b Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 27 Jul 2022 23:09:51 +0000 Subject: [PATCH 3/6] Auto-update README --- README.md | 21 +++++++++++---------- README_fr.md | 27 ++++++++++++++++----------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 837d179..91e2ca3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # GetSimple for YunoHost -[![Integration level](https://dash.yunohost.org/integration/getsimple.svg)](https://dash.yunohost.org/appci/app/getsimple) ![](https://ci-apps.yunohost.org/ci/badges/getsimple.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/getsimple.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/getsimple.svg)](https://dash.yunohost.org/appci/app/getsimple) ![Working status](https://ci-apps.yunohost.org/ci/badges/getsimple.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/getsimple.maintain.svg) [![Install GetSimple with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=getsimple) *[Lire ce readme en français.](./README_fr.md)* @@ -26,13 +26,13 @@ GetSimple is an XML based, stand-alone, fully independent and lite Content Manag - Simple Theme Customization - Designed For the Small-Site Market -**Shipped version:** 3.3.16~ynh1 +**Shipped version:** 3.3.16~ynh2 **Demo:** https://demo.example.com ## Screenshots -![](./doc/screenshots/screenshot_editpage.png) +![Screenshot of GetSimple](./doc/screenshots/screenshot_editpage.png) ## Disclaimers / important information @@ -40,21 +40,22 @@ From a web browser, navigate to the folder where you just uploaded GetSimple to. ## Documentation and resources -* Official app website: http://get-simple.info/ -* Official admin documentation: http://get-simple.info/wiki/fr:start -* Upstream app code repository: https://github.com/GetSimpleCMS/GetSimpleCMS -* YunoHost documentation for this app: https://yunohost.org/app_getsimple -* Report a bug: https://github.com/YunoHost-Apps/getsimple_ynh/issues +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug or sudo yunohost app upgrade getsimple -u https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 5e5411f..604a47b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # GetSimple pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/getsimple.svg)](https://dash.yunohost.org/appci/app/getsimple) ![](https://ci-apps.yunohost.org/ci/badges/getsimple.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/getsimple.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/getsimple.svg)](https://dash.yunohost.org/appci/app/getsimple) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/getsimple.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/getsimple.maintain.svg) [![Installer GetSimple avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=getsimple) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer GetSimple 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.* @@ -22,13 +26,13 @@ GetSimple is an XML based, stand-alone, fully independent and lite Content Manag - Simple Theme Customization - Designed For the Small-Site Market -**Version incluse :** 3.3.16~ynh1 +**Version incluse :** 3.3.16~ynh2 **Démo :** https://demo.example.com ## Captures d'écran -![](./doc/screenshots/screenshot_editpage.png) +![Capture d'écran de GetSimple](./doc/screenshots/screenshot_editpage.png) ## Avertissements / informations importantes @@ -36,21 +40,22 @@ From a web browser, navigate to the folder where you just uploaded GetSimple to. ## Documentations et ressources -* Site officiel de l'app : http://get-simple.info/ -* Documentation officielle de l'admin : http://get-simple.info/wiki/fr:start -* Dépôt de code officiel de l'app : https://github.com/GetSimpleCMS/GetSimpleCMS -* Documentation YunoHost pour cette app : https://yunohost.org/app_getsimple -* Signaler un bug : https://github.com/YunoHost-Apps/getsimple_ynh/issues +* Site officiel de l'app : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug ou sudo yunohost app upgrade getsimple -u https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From 51937c613e84fb974a4c59b630e611fe7db4e646 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 28 Jul 2022 02:45:17 +0200 Subject: [PATCH 4/6] Update upgrade --- scripts/upgrade | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 8925452..d70a8ab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,8 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) language=$(ynh_app_setting_get --app=$app --key=language) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +timezone="$(cat /etc/timezone)" + #================================================= # CHECK VERSION #================================================= From 89e7b0f435409821bdd78d24d898aa0bb46dc914 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 28 Jul 2022 02:45:19 +0200 Subject: [PATCH 5/6] Update manifest.json --- manifest.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index f96cbdd..1a75109 100644 --- a/manifest.json +++ b/manifest.json @@ -66,11 +66,7 @@ }, { "name": "password", - "type": "password", - "help": { - "en": "Use the help field to add an information for the admin about this question.", - "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - } + "type": "password" } ] } From 7864b9a68af92c0653f96a4856f113f4a90d944c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 28 Jul 2022 14:34:29 +0200 Subject: [PATCH 6/6] Update upgrade --- scripts/upgrade | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d70a8ab..b3070f0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,7 +61,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + ynh_setup_source --dest_dir="$final_path" --keep="gsconfig.php data/ backups/" fi chmod 750 "$final_path" @@ -98,7 +98,11 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="../conf/temp.gsconfig.php" --destination="$final_path/temp.gsconfig.php" +ynh_add_config --template="../conf/temp.gsconfig.php" --destination="$final_path/gsconfig.php" + +chmod 400 "$final_path/gsconfig.php" +chown $app:$app "$final_path/gsconfig.php" +ynh_local_curl "/admin/support.php" "updated=2" #================================================= # GENERIC FINALIZATION