1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/libreto_ynh.git synced 2024-09-03 19:36:14 +02:00

Merge pull request #13 from YunoHost-Apps/testing

Testing
This commit is contained in:
Alexandre Aubin 2021-11-29 15:26:33 +01:00 committed by GitHub
commit ce19369d87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 255 additions and 167 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)

View file

@ -1,60 +1,42 @@
<!--
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.
-->
# Libreto for YunoHost
[![Integration level](https://dash.yunohost.org/integration/libreto.svg)](https://dash.yunohost.org/appci/app/libreto) ![](https://ci-apps.yunohost.org/ci/badges/libreto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/libreto.maintain.svg)
[![Install Libreto with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreto)
> *This package allow you to install Libreto quickly and simply on a YunoHost server.
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
*[Lire ce readme en français.](./README_fr.md)*
> *This package allows you to install Libreto 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
Libreto let you aggregate your pad (Etherpad lite) to create a kind of wiki easily.
**Shipped version:** 0.0.20180605
Libreto is a collaborative etherpad-based notebook. It can become a mini-site, the synopsis of a workshop or the support for writing a collective book.
**Shipped version:** 0.0.20180605~ynh3
**Demo:** https://libreto.net
## Screenshots
![Home page of Libreto](img/home.png)
![Usage of Libreto](img/menu.png)
![](./doc/screenshots/home.png)
![](./doc/screenshots/menu.png)
## Demo
## Documentation and resources
* [Official demo](https://libreto.net)
* Official app website: https://libreto.net
* Upstream app code repository: https://github.com/Ventricule/libreto
* YunoHost documentation for this app: https://yunohost.org/app_libreto
* Report a bug: https://github.com/YunoHost-Apps/libreto_ynh/issues
## Configuration
## Developer info
No configuration needed.
## Documentation
* Official documentation: https://github.com/Ventricule/libreto
## YunoHost specific features
#### Multi-users support
Libreto has no user management, but YunoHost allow you to decide if this app is public or not.
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/libreto%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/libreto/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/libreto%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/libreto/)
## Limitations
Only app instances with a valid certificate and allowing to be included in Frame could be used.
## Links
* Report a bug: https://github.com/YunoHost-Apps/libreto_ynh/issues
* App website: http://libreto.net/
* Upstream app repository: https://github.com/Ventricule/libreto
* YunoHost website: https://yunohost.org/
---
## Developers info
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/libreto_ynh/tree/testing).
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/libreto_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
@ -62,3 +44,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/libreto_ynh/tree/test
or
sudo yunohost app upgrade libreto -u https://github.com/YunoHost-Apps/libreto_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

44
README_fr.md Normal file
View file

@ -0,0 +1,44 @@
# Libreto pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/libreto.svg)](https://dash.yunohost.org/appci/app/libreto) ![](https://ci-apps.yunohost.org/ci/badges/libreto.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/libreto.maintain.svg)
[![Installer Libreto avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=libreto)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer Libreto 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
Libreto est un carnet de note collaboratif fondé sur etherpad. Il peut devenir un mini-site, le carnet de bord d'un workshop ou le support de rédaction d'un livre collectif.
**Version incluse :** 0.0.20180605~ynh3
**Démo :** https://libreto.net
## Captures d'écran
![](./doc/screenshots/home.png)
![](./doc/screenshots/menu.png)
## Documentations et ressources
* Site officiel de l'app : https://libreto.net
* Dépôt de code officiel de l'app : https://github.com/Ventricule/libreto
* Documentation YunoHost pour cette app : https://yunohost.org/app_libreto
* Signaler un bug : https://github.com/YunoHost-Apps/libreto_ynh/issues
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/libreto_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/libreto_ynh/tree/testing --debug
ou
sudo yunohost app upgrade libreto -u https://github.com/YunoHost-Apps/libreto_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,8 +1,8 @@
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
domain="domain.tld"
etherpad_instance="https://annuel2.framapad.org"
is_public=1 (PUBLIC|public=1|private=0)
is_public=1
creation_open=1
; Checks
pkg_linter=1
@ -12,10 +12,14 @@
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=f6fcb8686cec30da2a7b9e5ba12d6c5b295528d8
backup_restore=1
multi_instance=1
port_already_use=0
change_url=1
;;; Options
Email=ljf+libreto_ynh@reflexlibre.net
Notification=down
;;; Upgrade options
; commit=f6fcb8686cec30da2a7b9e5ba12d6c5b295528d8
name=Merge pull request #7 from YunoHost-Apps/testing
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&

View file

@ -28,13 +28,6 @@ $providers = array(
'markdown' => false,
'html' => true,
),
'factor' => array(
'name' => "Factor",
'url' => "https://factor.cc/pad",
'default_text' => "Welcome to factor.cc Pad!",
'markdown' => false,
'html' => true,
),
'etherpad' => array(
'name' => "Etherpad.net",
'url' => "https://etherpad.net",
@ -61,7 +54,9 @@ $providers = array(
// CUSTOM_PROVIDER);
$options = array(
'name' => "Libreto",
'name' => "Libreto",
'root' => '__PATH__',
'use_subdomain' => false,
'default_provider' => "__PROVIDER__",
'providers' => $providers,
);

View file

@ -4,11 +4,6 @@ location __PATH__/ {
# Path to source
alias __FINALPATH__/ ;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php;
location __PATH__/libreto/assets/ {

1
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1 @@
Libreto is a collaborative etherpad-based notebook. It can become a mini-site, the synopsis of a workshop or the support for writing a collective book.

1
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1 @@
Libreto est un carnet de note collaboratif fondé sur etherpad. Il peut devenir un mini-site, le carnet de bord d'un workshop ou le support de rédaction d'un livre collectif.

0
doc/DISCLAIMER.md Normal file
View file

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View file

@ -3,11 +3,17 @@
"id": "libreto",
"packaging_format": 1,
"description": {
"en": "Aggregate your pads to create a wiki.",
"fr": "Agrégez vos pads pour créer un wiki."
"en": "Aggregate your pads to create a wiki",
"fr": "Agrégez vos pads pour créer un wiki"
},
"version": "0.0.20180605~ynh2",
"version": "0.0.20180605~ynh3",
"url": "https://libreto.net",
"upstream": {
"license": "GPL-3.0-or-later",
"website": "https://libreto.net",
"demo": "https://libreto.net",
"code": "https://github.com/Ventricule/libreto"
},
"license": "GPL-3.0-or-later",
"maintainer": {
"name": "ljf",
@ -15,23 +21,24 @@
"url": "https://reflexlibre.net"
},
"requirements": {
"yunohost": ">= 3.8.5"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [
"nginx",
"php7.0-fpm"
"php7.3-fpm"
],
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for Libreto",
"fr": "Choisissez un nom de domaine pour Libreto"
},
"example": "example.com"
"type": "domain"
},
{
"name": "path",
"type": "path",
"example": "/libreto",
"default": "/libreto"
},
{
"name": "etherpad_instance",
@ -51,10 +58,6 @@
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": {
"en": "If enabled, Libreto will be accessible by people who do not have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, Libreto sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."

View file

@ -27,7 +27,7 @@ app=$YNH_APP_INSTANCE_NAME
ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get $app final_path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP

View file

@ -25,7 +25,7 @@ ynh_abort_if_errors
#=================================================
domain=$YNH_APP_ARG_DOMAIN
path_url="/"
path_url=$YNH_APP_ARG_PATH
etherpad_instance=$YNH_APP_ARG_ETHERPAD_INSTANCE
is_public=$YNH_APP_ARG_IS_PUBLIC
creation_open=$YNH_APP_ARG_CREATION_OPEN
@ -50,9 +50,16 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
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=etherpad_instance --value=$etherpad_instance
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=creation_open --value=$creation_open
#=================================================
# 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"
#=================================================
# STANDARD MODIFICATIONS
#=================================================
@ -69,6 +76,10 @@ pushd "$final_path"
git submodule update --init --recursive --quiet
popd
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -77,14 +88,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user
ynh_system_user_create --username=$app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
@ -118,29 +121,15 @@ fi
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config.php"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chown -R root: $final_path
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1
ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ]
then
if [ $creation_open -eq 1 ]
then
ynh_app_setting_set $app skipped_uris "/"
else
ynh_app_setting_set $app skipped_regex "/[^/]+"
fi
ynh_permission_update --permission="main" --add="visitors"
fi
#=================================================

View file

@ -16,8 +16,8 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
@ -45,14 +45,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -37,18 +37,16 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=2
ynh_webpath_available $domain $path_url \
|| ynh_die "Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die "There is already a directory: $final_path "
test ! -d $final_path || ynh_die "There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE FILES
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
ynh_restore
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
@ -56,14 +54,25 @@ ynh_restore
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE USER RIGHTS
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring the app main directory..." --weight=1
# Restore permissions on app files
chown -R root: $final_path
ynh_restore_file --origin_path="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
#=================================================
# GENERIC FINALIZATION

View file

@ -15,12 +15,17 @@ source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path)
is_public=$(ynh_app_setting_get $app is_public)
final_path=$(ynh_app_setting_get $app final_path)
etherpad_instance=$(ynh_app_setting_get $app etherpad_instance)
creation_open=$(ynh_app_setting_get $app creation_open)
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)
etherpad_instance=$(ynh_app_setting_get --app=$app --key=etherpad_instance)
creation_open=$(ynh_app_setting_get --app=$app --key=creation_open)
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@ -35,20 +40,48 @@ 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
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
pushd "$final_path"
git checkout master
git pull --quiet
git checkout $COMMIT --quiet
git submodule update --init --recursive --quiet
popd
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=5
# Download, check integrity, uncompress and patch the source from app.src
pushd "$final_path"
git checkout master
git pull --quiet
git checkout $COMMIT --quiet
git submodule update --init --recursive --quiet
popd
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
@ -58,14 +91,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
#=================================================
# PHP-FPM CONFIGURATION
#=================================================
@ -81,31 +106,6 @@ ynh_backup_if_checksum_is_different "$final_path/config.php"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum "$final_path/config.php"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R root: $final_path
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
# Make app public if necessary
if [ $is_public -eq 1 ]
then
if [ $creation_open -eq 1 ]
then
ynh_app_setting_set $app skipped_uris "/"
else
ynh_app_setting_set $app skipped_regex "/[^/]+"
fi
fi
#=================================================
# RELOAD NGINX
#=================================================