mirror of
https://github.com/YunoHost-Apps/grav_ynh.git
synced 2024-09-03 19:16:01 +02:00
Merge pull request #116 from YunoHost-Apps/testing
This commit is contained in:
commit
571cd80764
12 changed files with 185 additions and 38 deletions
28
README.md
28
README.md
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
|||
|
||||
# Grav for YunoHost
|
||||
|
||||
[![Integration level](https://dash.yunohost.org/integration/grav.svg)](https://dash.yunohost.org/appci/app/grav) ![](https://ci-apps.yunohost.org/ci/badges/grav.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/grav.maintain.svg)
|
||||
[![Integration level](https://dash.yunohost.org/integration/grav.svg)](https://dash.yunohost.org/appci/app/grav) ![Working status](https://ci-apps.yunohost.org/ci/badges/grav.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/grav.maintain.svg)
|
||||
[![Install Grav with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=grav)
|
||||
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
@ -17,42 +17,44 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
|
||||
A modern open source flat-file CMS
|
||||
|
||||
**Shipped version:** 1.7.33~ynh1
|
||||
**Shipped version:** 1.7.34~ynh1
|
||||
|
||||
**Demo:** https://getgrav.org/downloads/themes
|
||||
|
||||
## Screenshots
|
||||
|
||||
![](./doc/screenshots/grav.jpg)
|
||||
![Screenshot of Grav](./doc/screenshots/grav.jpg)
|
||||
|
||||
## Disclaimers / important information
|
||||
|
||||
* You can access the administration panel at `yourdomain.tld/path/admin`. Users created within YunoHost can log in, provided their were given the appropriate permissions:
|
||||
* To make users administrators, give them the `grav.admin` permission.
|
||||
* To allow users to log in, without extended rights, give them the `grav.user` permission.
|
||||
* Grav provides a command line interface. Refer to its documentation, but you will need to specifically call for the PHP version currently used for the app:
|
||||
* Go to your app's directory: `cd /var/www/grav` (or `grav__2`, etc. if you have multiple ones)
|
||||
* `php7.3 bin/grav ...` or `php7.3 bin/gpm ...`
|
||||
* Grav offers an SSH or SFTP access, which can be enabled in its YunoHost admin configuration panel.
|
||||
* You can thus use its GPM command line binary.
|
||||
Refer to is documentation, but bear in mind you need to call it by specifying the PHP version used by the app:
|
||||
`php7.3 bin/grav ...` or `php7.3 bin/gpm ...`
|
||||
* You can install plugins through the admin panel, or through the GPM.
|
||||
* If installing Grav at the root of a domain, bear in mind that paths starting by `/yunohost` are reserved.
|
||||
|
||||
## Documentation and resources
|
||||
|
||||
* Official app website: https://www.getgrav.org/
|
||||
* Official admin documentation: https://learn.getgrav.org
|
||||
* Upstream app code repository: https://github.com/getgrav/grav
|
||||
* YunoHost documentation for this app: https://yunohost.org/app_grav
|
||||
* Report a bug: https://github.com/YunoHost-Apps/grav_ynh/issues
|
||||
* Official app website: <https://www.getgrav.org/>
|
||||
* Official admin documentation: <https://learn.getgrav.org>
|
||||
* Upstream app code repository: <https://github.com/getgrav/grav>
|
||||
* YunoHost documentation for this app: <https://yunohost.org/app_grav>
|
||||
* Report a bug: <https://github.com/YunoHost-Apps/grav_ynh/issues>
|
||||
|
||||
## Developer info
|
||||
|
||||
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/grav_ynh/tree/testing).
|
||||
|
||||
To try the testing branch, please proceed like that.
|
||||
```
|
||||
|
||||
``` bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/grav_ynh/tree/testing --debug
|
||||
or
|
||||
sudo yunohost app upgrade grav -u https://github.com/YunoHost-Apps/grav_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||
|
|
34
README_fr.md
34
README_fr.md
|
@ -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.
|
||||
-->
|
||||
|
||||
# Grav pour YunoHost
|
||||
|
||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/grav.svg)](https://dash.yunohost.org/appci/app/grav) ![](https://ci-apps.yunohost.org/ci/badges/grav.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/grav.maintain.svg)
|
||||
[![Niveau d'intégration](https://dash.yunohost.org/integration/grav.svg)](https://dash.yunohost.org/appci/app/grav) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/grav.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/grav.maintain.svg)
|
||||
[![Installer Grav avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=grav)
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
|
||||
> *Ce package vous permet d'installer Grav 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.*
|
||||
|
@ -13,42 +17,44 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
|||
|
||||
Un CMS moderne basé sur des fichiers plats
|
||||
|
||||
**Version incluse :** 1.7.33~ynh1
|
||||
**Version incluse :** 1.7.34~ynh1
|
||||
|
||||
**Démo :** https://getgrav.org/downloads/themes
|
||||
|
||||
## Captures d'écran
|
||||
|
||||
![](./doc/screenshots/grav.jpg)
|
||||
![Capture d'écran de Grav](./doc/screenshots/grav.jpg)
|
||||
|
||||
## Avertissements / informations importantes
|
||||
|
||||
* Vous pouvez accéder au panneau d'adminstration à l'adresse `votredomaine.tld/votrechemin/admin`. Les utilisateurs créés dans YunoHost peuvent se connecter, à condition de leur avoir octroyé la permission adéquate:
|
||||
* `grav.admin` pour qu'ils soient administrateur de Grav ;
|
||||
* `grav.user` pour qu'ils puissent se connecter, mais sans droit étendu.
|
||||
* Grav dispose d'une interface par ligne de commande. Référez-vous à sa documentation, mais sachez que vous devrez préciser la version de PHP utilisée par l'app:
|
||||
* Allez dans le répertoire de Grav: `cd /var/www/grav` (ou `grav__2`, etc. si vous avez de multiples instances)
|
||||
* `php7.3 bin/grav ...` ou `php7.3 bin/gpm ...`
|
||||
* Grav offre un accès par SSH ou SFTP, activable dans le panneau de configuration de l'application dans l'administration de YunoHost.
|
||||
* Vous pouvez ainsi utiliser sa ligne de commande GPM.
|
||||
Référez-vous à sa documentation, mais sachez que vous devrez préciser la version de PHP utilisée par l'app:
|
||||
`php7.3 bin/grav ...` ou `php7.3 bin/gpm ...`
|
||||
* Vous pouvez installer les extensions soit via le panneau d'administration, soit via GPM.
|
||||
* Si vous installez Grav à la racin d'un domaine, sachez que les chemins d'accès commançant par `/yunohost` sont réservés.
|
||||
|
||||
## Documentations et ressources
|
||||
|
||||
* Site officiel de l'app : https://www.getgrav.org/
|
||||
* Documentation officielle de l'admin : https://learn.getgrav.org
|
||||
* Dépôt de code officiel de l'app : https://github.com/getgrav/grav
|
||||
* Documentation YunoHost pour cette app : https://yunohost.org/app_grav
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/grav_ynh/issues
|
||||
* Site officiel de l'app : <https://www.getgrav.org/>
|
||||
* Documentation officielle de l'admin : <https://learn.getgrav.org>
|
||||
* Dépôt de code officiel de l'app : <https://github.com/getgrav/grav>
|
||||
* Documentation YunoHost pour cette app : <https://yunohost.org/app_grav>
|
||||
* Signaler un bug : <https://github.com/YunoHost-Apps/grav_ynh/issues>
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
||||
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/grav_ynh/tree/testing).
|
||||
|
||||
Pour essayer la branche testing, procédez comme suit.
|
||||
```
|
||||
|
||||
``` bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/grav_ynh/tree/testing --debug
|
||||
ou
|
||||
sudo yunohost app upgrade grav -u https://github.com/YunoHost-Apps/grav_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>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.33/grav-update-v1.7.33.zip
|
||||
SOURCE_SUM=b4cdcc6d6d9a3efa0c4b12b2a4b26e49fe47a963d8896a80bdaf3cf166e4ac7b
|
||||
SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.34/grav-update-v1.7.34.zip
|
||||
SOURCE_SUM=9859ca81899a95bf4a88abe660fa6160458e63c8fb25aa3ac85abdda4973d494
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.33/grav-admin-v1.7.33.zip
|
||||
SOURCE_SUM=a8a04858689ce6a214c92cd62a22855f67dee069f034cc341802f29a7de03d75
|
||||
SOURCE_URL=https://github.com/getgrav/grav/releases/download/1.7.34/grav-admin-v1.7.34.zip
|
||||
SOURCE_SUM=2513b25074419dfdee2ce5d042df0576b6d83797e8341e761af919942473a42d
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
19
config_panel.toml
Normal file
19
config_panel.toml
Normal file
|
@ -0,0 +1,19 @@
|
|||
version = "1.0"
|
||||
|
||||
[main]
|
||||
name = "Grav configuration"
|
||||
|
||||
[main.sftp]
|
||||
name = "SSH and SFTP access"
|
||||
|
||||
[main.sftp.with_sftp]
|
||||
ask = "Do you need an SSH and SFTP access?"
|
||||
type = "boolean"
|
||||
default = false
|
||||
|
||||
[main.sftp.password]
|
||||
ask = "Set a password for the SSH and SFTP access"
|
||||
type = "password"
|
||||
optional = true
|
||||
visible = "with_sftp"
|
||||
help = "If a password already exists, leave blank and it will not be replaced."
|
|
@ -1,8 +1,9 @@
|
|||
* You can access the administration panel at `yourdomain.tld/path/admin`. Users created within YunoHost can log in, provided their were given the appropriate permissions:
|
||||
* To make users administrators, give them the `grav.admin` permission.
|
||||
* To allow users to log in, without extended rights, give them the `grav.user` permission.
|
||||
* Grav provides a command line interface. Refer to its documentation, but you will need to specifically call for the PHP version currently used for the app:
|
||||
* Go to your app's directory: `cd /var/www/grav` (or `grav__2`, etc. if you have multiple ones)
|
||||
* `php7.3 bin/grav ...` or `php7.3 bin/gpm ...`
|
||||
* Grav offers an SSH or SFTP access, which can be enabled in its YunoHost admin configuration panel.
|
||||
* You can thus use its GPM command line binary.
|
||||
Refer to is documentation, but bear in mind you need to call it by specifying the PHP version used by the app:
|
||||
`php7.3 bin/grav ...` or `php7.3 bin/gpm ...`
|
||||
* You can install plugins through the admin panel, or through the GPM.
|
||||
* If installing Grav at the root of a domain, bear in mind that paths starting by `/yunohost` are reserved.
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
* Vous pouvez accéder au panneau d'adminstration à l'adresse `votredomaine.tld/votrechemin/admin`. Les utilisateurs créés dans YunoHost peuvent se connecter, à condition de leur avoir octroyé la permission adéquate:
|
||||
* `grav.admin` pour qu'ils soient administrateur de Grav ;
|
||||
* `grav.user` pour qu'ils puissent se connecter, mais sans droit étendu.
|
||||
* Grav dispose d'une interface par ligne de commande. Référez-vous à sa documentation, mais sachez que vous devrez préciser la version de PHP utilisée par l'app:
|
||||
* Allez dans le répertoire de Grav: `cd /var/www/grav` (ou `grav__2`, etc. si vous avez de multiples instances)
|
||||
* `php7.3 bin/grav ...` ou `php7.3 bin/gpm ...`
|
||||
* Grav offre un accès par SSH ou SFTP, activable dans le panneau de configuration de l'application dans l'administration de YunoHost.
|
||||
* Vous pouvez ainsi utiliser sa ligne de commande GPM.
|
||||
Référez-vous à sa documentation, mais sachez que vous devrez préciser la version de PHP utilisée par l'app:
|
||||
`php7.3 bin/grav ...` ou `php7.3 bin/gpm ...`
|
||||
* Vous pouvez installer les extensions soit via le panneau d'administration, soit via GPM.
|
||||
* Si vous installez Grav à la racin d'un domaine, sachez que les chemins d'accès commançant par `/yunohost` sont réservés.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "A modern open source flat-file CMS",
|
||||
"fr": "Un CMS moderne basé sur des fichiers plats"
|
||||
},
|
||||
"version": "1.7.33~ynh1",
|
||||
"version": "1.7.34~ynh1",
|
||||
"url": "https://www.getgrav.org/",
|
||||
"upstream": {
|
||||
"license": "MIT",
|
||||
|
|
|
@ -13,3 +13,38 @@ pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mbstring php${
|
|||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
ynh_system_user_add_group() {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=uhs
|
||||
local -A args_array=([u]=username= [g]=groups=)
|
||||
local username
|
||||
local groups
|
||||
|
||||
# Manage arguments with getopts
|
||||
ynh_handle_getopts_args "$@"
|
||||
groups="${groups:-}"
|
||||
|
||||
local group
|
||||
for group in $groups; do
|
||||
usermod -a -G "$group" "$username"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
ynh_system_user_del_group() {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=uhs
|
||||
local -A args_array=([u]=username= [g]=groups=)
|
||||
local username
|
||||
local groups
|
||||
|
||||
# Manage arguments with getopts
|
||||
ynh_handle_getopts_args "$@"
|
||||
groups="${groups:-}"
|
||||
|
||||
local group
|
||||
for group in $groups; do
|
||||
gpasswd -d "$username" "$group"
|
||||
done
|
||||
}
|
||||
|
|
72
scripts/config
Normal file
72
scripts/config
Normal file
|
@ -0,0 +1,72 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC GETTERS FOR TOML SHORT KEY
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC VALIDATORS FOR TOML SHORT KEYS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC SETTERS FOR TOML SHORT KEYS
|
||||
#=================================================
|
||||
|
||||
set__password() {
|
||||
if [ "$password" == "" ]
|
||||
then
|
||||
ynh_app_setting_set --app=$app --key=password --value="$password"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
||||
ynh_app_config_validate() {
|
||||
_ynh_app_config_validate
|
||||
|
||||
if [ "${changed[with_sftp]}" == "true" ] && [ $with_sftp -eq 1 ] && [ "$password" == "" ]
|
||||
then
|
||||
ynh_die --message="You need to set a password to enable SSH and SFTP"
|
||||
fi
|
||||
}
|
||||
|
||||
ynh_app_config_apply() {
|
||||
_ynh_app_config_apply
|
||||
|
||||
if [ "${changed[with_sftp]}" == "true" ] && [ $with_sftp -eq 1 ]
|
||||
then
|
||||
ynh_system_user_add_group --username=$app --groups="sftp.app ssh.app"
|
||||
usermod --shell /bin/bash $app
|
||||
|
||||
if [ ! "$password" == "" ]
|
||||
then
|
||||
chpasswd <<< "${app}:${password}"
|
||||
fi
|
||||
elif [ "${changed[with_sftp]}" == "true" ] && [ $with_sftp -eq 0 ]
|
||||
then
|
||||
ynh_system_user_del_group --username=$app --groups="sftp.app ssh.app"
|
||||
usermod --shel /usr/sbin/nologin $app
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
ynh_app_config_run $1
|
|
@ -48,6 +48,8 @@ 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=admin --value=$admin
|
||||
ynh_app_setting_set --app=$app --key=language --value=$language
|
||||
ynh_app_setting_set --app=$app --key=with_sftp --value="false"
|
||||
ynh_app_setting_set --app=$app --key=password --value=$(ynh_string_random)
|
||||
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
|
|
|
@ -25,6 +25,9 @@ language=$(ynh_app_setting_get --app=$app --key=language)
|
|||
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
||||
|
||||
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp)
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
@ -79,6 +82,12 @@ if [ -z "$fpm_usage" ]; then
|
|||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
fi
|
||||
|
||||
# If with_sftp or password don't exist, create them
|
||||
if [ -z "$with_sftp" ] || [ -z "$password" ]; then
|
||||
ynh_app_setting_set --app=$app --key=with_sftp --value="false"
|
||||
ynh_app_setting_set --app=$app --key=password --value=$(ynh_string_random)
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue