1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/getsimple_ynh.git synced 2024-09-03 18:36:25 +02:00

Merge pull request #2 from YunoHost-Apps/testing

Upgrade
This commit is contained in:
Éric Gaspar 2022-07-29 08:27:25 +02:00 committed by GitHub
commit baf326b834
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 367 additions and 74 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -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.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -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)

107
.github/workflows/updater.sh vendored Normal file
View file

@ -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 <<EOT > 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

49
.github/workflows/updater.yml vendored Normal file
View file

@ -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 <yunohost-bot@users.noreply.github.com>'
author: 'yunohost-bot <yunohost-bot@users.noreply.github.com>'
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

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# GetSimple for YunoHost # 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) [![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)* *[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 - Simple Theme Customization
- Designed For the Small-Site Market - Designed For the Small-Site Market
**Shipped version:** 3.3.16~ynh1 **Shipped version:** 3.3.16~ynh2
**Demo:** https://demo.example.com **Demo:** https://demo.example.com
## Screenshots ## Screenshots
![](./doc/screenshots/screenshot_editpage.png) ![Screenshot of GetSimple](./doc/screenshots/screenshot_editpage.png)
## Disclaimers / important information ## Disclaimers / important information
@ -40,21 +40,22 @@ From a web browser, navigate to the folder where you just uploaded GetSimple to.
## Documentation and resources ## Documentation and resources
* Official app website: http://get-simple.info/ * Official app website: <http://get-simple.info>
* Official admin documentation: http://get-simple.info/wiki/fr:start * Official admin documentation: <http://get-simple.info/wiki/fr:start>
* Upstream app code repository: https://github.com/GetSimpleCMS/GetSimpleCMS * Upstream app code repository: <https://github.com/GetSimpleCMS/GetSimpleCMS>
* YunoHost documentation for this app: https://yunohost.org/app_getsimple * YunoHost documentation for this app: <https://yunohost.org/app_getsimple>
* Report a bug: https://github.com/YunoHost-Apps/getsimple_ynh/issues * Report a bug: <https://github.com/YunoHost-Apps/getsimple_ynh/issues>
## Developer info ## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing). 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. To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug
or or
sudo yunohost app upgrade getsimple -u https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug 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 **More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,10 +1,14 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# GetSimple pour YunoHost # 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) [![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)* *[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. > *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.* 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 - Simple Theme Customization
- Designed For the Small-Site Market - Designed For the Small-Site Market
**Version incluse :** 3.3.16~ynh1 **Version incluse :** 3.3.16~ynh2
**Démo :** https://demo.example.com **Démo :** https://demo.example.com
## Captures d'écran ## Captures d'écran
![](./doc/screenshots/screenshot_editpage.png) ![Capture d'écran de GetSimple](./doc/screenshots/screenshot_editpage.png)
## Avertissements / informations importantes ## Avertissements / informations importantes
@ -36,21 +40,22 @@ From a web browser, navigate to the folder where you just uploaded GetSimple to.
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : http://get-simple.info/ * Site officiel de l'app : <http://get-simple.info>
* Documentation officielle de l'admin : http://get-simple.info/wiki/fr:start * 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 * Dépôt de code officiel de l'app : <https://github.com/GetSimpleCMS/GetSimpleCMS>
* Documentation YunoHost pour cette app : https://yunohost.org/app_getsimple * Documentation YunoHost pour cette app : <https://yunohost.org/app_getsimple>
* Signaler un bug : https://github.com/YunoHost-Apps/getsimple_ynh/issues * Signaler un bug : <https://github.com/YunoHost-Apps/getsimple_ynh/issues>
## Informations pour les développeurs ## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing). 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. Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade getsimple -u https://github.com/YunoHost-Apps/getsimple_ynh/tree/testing --debug 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 **Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -1,7 +1,7 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
path="/path/admin" path="/path"
is_public=1 is_public=1
language="en_US" language="en_US"
admin="john" admin="john"
@ -21,7 +21,3 @@
;;; Options ;;; Options
Email= Email=
Notification=none 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&

View file

@ -2,7 +2,7 @@
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/ ; alias __FINALPATH__/;
index index.php; index index.php;

View file

@ -61,7 +61,7 @@ define('GSDONOTPING', 1);
#define('GSEDITOROPTIONS', ''); #define('GSEDITOROPTIONS', '');
# Set email from address # 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 # Autosave within edit.php. Value is the autosave interval in seconds
#define('GSAUTOSAVE', 900); #define('GSAUTOSAVE', 900);
@ -71,7 +71,7 @@ define('GSDONOTPING', 1);
# Set PHP locale # Set PHP locale
# http://php.net/manual/en/function.setlocale.php # http://php.net/manual/en/function.setlocale.php
etlocale(LC_ALL, 'en_US'); setlocale(LC_ALL, '__LANGUAGE__');
# Define default timezone of server, accepts php timezone string # Define default timezone of server, accepts php timezone string
# valid timeszones can be found here http://www.php.net/manual/en/timezones.php # 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 # GS can format its xml files before saving them if you require human readable source for them
# define('GSFORMATXML',true); # define('GSFORMATXML',true);
?> ?>

View file

@ -6,11 +6,11 @@
"en": "Flatfile CMS that works fast and efficient", "en": "Flatfile CMS that works fast and efficient",
"fr": "Flatfile CMS that works fast and efficient" "fr": "Flatfile CMS that works fast and efficient"
}, },
"version": "3.3.16~ynh1", "version": "3.3.16~ynh2",
"url": "http://get-simple.info/", "url": "http://get-simple.info",
"upstream": { "upstream": {
"license": "GPL-3.0", "license": "GPL-3.0",
"website": "http://get-simple.info/", "website": "http://get-simple.info",
"demo": "https://demo.example.com", "demo": "https://demo.example.com",
"admindoc": "http://get-simple.info/wiki/fr:start", "admindoc": "http://get-simple.info/wiki/fr:start",
"code": "https://github.com/GetSimpleCMS/GetSimpleCMS" "code": "https://github.com/GetSimpleCMS/GetSimpleCMS"
@ -26,10 +26,10 @@
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.4-fpm" "php7.3-fpm"
], ],
"arguments": { "arguments": {
"install" : [ "install": [
{ {
"name": "domain", "name": "domain",
"type": "domain" "type": "domain"
@ -44,6 +44,29 @@
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"default": true "default": true
},
{
"name": "language",
"type": "string",
"ask": {
"en": "Choose the application language",
"fr": "Choisissez la langue de l'application"
},
"choices": [
"de_DE",
"en_US",
"fr_FR",
"nl_NL"
],
"default": "fr_FR"
},
{
"name": "admin",
"type": "user"
},
{
"name": "password",
"type": "password"
} }
] ]
} }

View file

@ -4,9 +4,8 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
YNH_PHP_VERSION="7.4" # 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"
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"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script

View file

@ -14,7 +14,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
### Remove this function if there's nothing to clean before calling the remove script.
true true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -27,12 +26,15 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH path_url=$YNH_APP_ARG_PATH
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
language=en_US language=$YNH_APP_ARG_LANGUAGE
timezone="$(cat /etc/timezone)" admin=$YNH_APP_ARG_ADMIN
phpversion=$YNH_PHP_VERSION password=$YNH_APP_ARG_PASSWORD
app=$YNH_APP_INSTANCE_NAME 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 # 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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url 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=language --value=$language
ynh_app_setting_set --app=$app --key=admin --value=$admin
#================================================= #=================================================
# INSTALL DEPENDENCIES # 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 # 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"
mv ../sources/lang/* $final_path/admin/lang
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$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 # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -99,15 +92,44 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_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 # ADD A CONFIGURATION
#================================================= #=================================================
# ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_script_progression --message="Adding a configuration file..." --weight=1
# ynh_add_config --template="../conf/temp.gsconfig.php" --destination="$final_path/gsconfig.php" ynh_add_config --template="../conf/temp.gsconfig.php" --destination="$final_path/gsconfig.php"
# chmod 655 "$final_path/gsconfig.php" chmod 400 "$final_path/gsconfig.php"
# chown $app:$app "$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 # SETUP SSOWAT
@ -117,6 +139,8 @@ ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
# Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission="main" --add="visitors" ynh_permission_update --permission="main" --add="visitors"
fi fi

View file

@ -19,6 +19,8 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
#================================================= #=================================================

View file

@ -15,7 +15,6 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
#### Remove this function if there's nothing to clean before calling the remove script.
true true
} }
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
@ -43,13 +42,6 @@ test ! -d $final_path \
#================================================= #=================================================
# STANDARD RESTORATION STEPS # 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 # 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" 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 # GENERIC FINALIZATION
#================================================= #=================================================

View file

@ -21,9 +21,12 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
language=$(ynh_app_setting_get --app=$app --key=language) language=$(ynh_app_setting_get --app=$app --key=language)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
timezone="$(cat /etc/timezone)"
#================================================= #=================================================
# CHECK VERSION # CHECK VERSION
#================================================= #=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed) upgrade_type=$(ynh_check_app_version_changed)
@ -58,21 +61,13 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src # 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 fi
chmod 750 "$final_path" chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$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 # UPGRADE DEPENDENCIES
#================================================= #=================================================
@ -88,6 +83,29 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_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/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
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================