Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Update to version 0.9.5 with the last commit (#16)
Browse files Browse the repository at this point in the history
* try to update source to 0.9.5

* try to update source to 0.9.5

* refactoring and try to update version

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try to debug

* try update garradin

* try the upgrade without php7.2

* try to debug

* try to debug

* try to debug

* try to debug

* add hooks to copy file config.dist.php in config.local.php with good options

* add hooks to copy file config.dist.php in config.local.php with good options

* try again to correct values

* try again to correct values

* try again to correct values

* change the upgrade file

* change the upgrade file

* try to backup sql for the upgrade

* try to save sqlite bdd since upgarade

* try to save sqlite bdd since upgarade

* try to save sqlite bdd since upgarade

* make the upgrade with backup of the bdd

* syntax error on file backup

* syntax error on file backup

* change the hook post_upgrade

* change the hook post_upgrade

* delete folder hooks and update the scripts install and upgrade

* correct url for backup file config.local.php

* correct url for backup files

* correct url for backup files

* delete the backup of config.local.php because this file must be edited with this upgrade

* delete the backup of config.local.php because this file must be edited with this upgrade

* change the script backup

* change the script backup

* add a missing bracket in script restore

* prepare package_check

* prepare package_check

* delete php.ini not used and add the values (commented) on php_fpm.conf

* delete sudo for bash commands

* remove file script jenkins

* syntax error

* try ro change PATH nginx.conf

* the garrdin must be insstalled on a sub-domain, back to put the correct path

* try to delete slash at the end of PATH in nginx.conf

* change path_url in config.local.php for sripts install and upgrade

* change also the path for change_url

* change also the path for change_url

* change also the path for change_url

* change also the path for change_url

* change also the path for change_url

* change also the path for change_url

* change also the path for change_url

* change also the path for change_url

* try to debug upgrade

* error syntax

* chnage the code in upgrade to look for exist or not file association.bdd

* try to debug update script conditions

* try change install and update to debug scripts

* try to debug update script conditions

* try to debug update script conditions

* try to debug update script conditions

* check_url available for check_package

* try to make better check_packages dependencies

* try to make better check_packages dependencies

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* try to make possible install on root path and change url from or to root path

* come back to precedent config por nginx

* just a test to watch if it is possible like this install on root path

* come back to this code, have not found how to install on root path with this version

* but back check_up as origin

* add a search for nginx.conf

* try change nginx.conf and how to add a line on config.local.php

* try change nginx.conf and how to add a line on config.local.php

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* change install

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* try change nginx.conf

* success, change check_path

* few change to delete blanks

* delete sudo not need on install

* comment ynh_delete_file_checksum in common.sh

* delete ynh_delete_file_checksum in common.sh

* delete sudo on upgrade, no need

* put condition in install and update for config.local.php

* put condition in install and update for config.local.php

* try to save secret key if exist on update

* try to save secret key if exist on update

* try to save secret key if exist on update

* try to save secret key if exist on update

* try to keep secret key script on install

* back to previous version

* try to keep secret key script on install

* try to keep secret key script on install

* try create secret key script on install

* create secret key script on install

* put same lenght for secret key then the example in config.dist.php script for install

* try to debug slash for root directory in install and upgrade

* try to debug slash for root directory in cahnge_url

* try to debug slash for root directory in change_url

* try to debug slash for root directory in change_url

* try to put clean upgrade script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* try to debug change_url script

* change manifest

* change url debug

* change Readme

* change url debug

* change url debug

* add a line in config.local.php for domain in change_url script

* add a line in config.local.php for domain in change_url script

* add a line in config.local.php for domain in change_url script

* add a lines for doamin in config.local.php in change_url install and upgrade script

* comme back to previous version

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* sripts modified, try to resolve change url

* remove file_checksum md5 not needed

* cleaning syntax
  • Loading branch information
rodinux committed Apr 11, 2020
1 parent f1b1b2c commit b7d2aba
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 221 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -11,17 +11,17 @@ site de garradin : http://garradin.eu
[![Integration level](https://dash.yunohost.org/integration/garradin.svg)](https://ci-apps.yunohost.org/jenkins/job/garradin%20%28Community%29/lastBuild/consoleFull)<br>
[![Install Garradin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=garradin)

## Installation :
## Installation :
- CLI
`sudo yunohost app install https://github.com/Yunohost-Apps/garradin_ynh`

- À travers l'interface d'administration

### TODO list :
- Backup de la base de donnée SQlite (AIDE REQUISE) ?
### TODO list :
- Permissions de certains fichiers sensibles ?

#### Problèmes / Avertissements :
- le système SSO n'est pas implémenté, ni l'installation directe. L'utilisateur admin devra créer son compte avec le formulaire de création de compte qu'il trouvera à la fin de l'installation. Plusieurs raisons m'ont poussé à ne pas implémenter le SSO :
#### Problèmes / Avertissements :
- le système SSO n'est pas implémenté, ni l'installation directe. L'utilisateur admin devra créer son compte avec le formulaire de création de compte qu'il trouvera à la fin de l'installation. Plusieurs raisons m'ont poussé à ne pas implémenter le SSO :
- Le SSO n'est pas implémenté dans l'app originale.
- Avoir 150+ utilisateurs dans Yunohost n'est pas très pratique, ni très sécurisé, et revient en fin de compte à centraliser les services.
- Ce formulaire laisse le choix à l'administrateur de choisir les modalités de création de son compte. On pourrait peut-être me reprocher de ne pas avoir intégré ce formulaire dans le formulaire d'installation que l'utilisateur remplit avant l'installation de ce paquet. Il est vrai que j'aurais pu mettre les ~dix champs qui compose le formulaire de Garradin, mais je ne trouvais pas cela très pratique.
Expand Down
8 changes: 4 additions & 4 deletions check_process
@@ -1,4 +1,4 @@
;; Test complet
; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
path="/path" (PATH)
Expand All @@ -15,16 +15,16 @@
multi_instance=1
incorrect_path=1
port_already_use=0
change_url=0
change_url=1
;;; Levels
Level 1=auto
Level 2=auto
Level 3=auto
Level 4=na
Level 4=na
# l'utilisateur est à créer. LDAP non supporté par le paquet de base (obligation d'utiliser de MySql)
Level 5=auto
Level 6=auto
Level 7=auto
Level 8=0
Level 9=0
Level 10=0
Level 10=0
4 changes: 2 additions & 2 deletions conf/app.src
@@ -1,5 +1,5 @@
SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.2.tar.bz2
SOURCE_SUM=d0a95b0aea2b2001dcd30088f6ebddf65f7a4fce5db2aaa3359c3692b1ded0e9
SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.5.tar.bz2
SOURCE_SUM=48f8d62d8c86b3aef2d090b2a7d04873c9642d6efc451389f58a5d6e89d89612
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.bz2
SOURCE_IN_SUBDIR=true
Expand Down
47 changes: 18 additions & 29 deletions conf/nginx.conf
@@ -1,38 +1,27 @@
location __PATH__ {

# Path to source
alias __FINALPATH__/www/ ;
# Path to source
alias __FINALPATH__/www/ ;

if ($scheme = http) {
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}

# Example PHP configuration (remove if not used)
index index.php;

# Common parameter to increase upload size limit in conjuction with dedicated php-fpm file
#client_max_body_size 50M;

try_files $uri $uri/ index.php;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php5-fpm-__NAME__.sock;

# If you don't use a dedicated fpm config for your app,
# use a general fpm pool.
# This is to be used INSTEAD of line above
# Don't forget to adjust scripts install/upgrade/remove/backup accordingly
#
#fastcgi_pass unix:/var/run/php5-fpm.sock;
}

fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# Example PHP configuration (remove if not used)
index index.php /_route.php;
try_files $uri $uri/ index.php /_route.php;

location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
# PHP configuration end

# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
}
41 changes: 26 additions & 15 deletions conf/php-fpm.conf
Expand Up @@ -30,21 +30,21 @@ group = __USER__
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /var/run/php5-fpm-__NAMETOCHANGE__.sock
listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock

; Set listen(2) backlog. A value of '-1' means unlimited.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 128

; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0660
listen.owner = www-data
listen.group = www-data
;listen.mode = 0660

; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
Expand Down Expand Up @@ -117,7 +117,7 @@ pm.max_spare_servers = 3
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
Expand Down Expand Up @@ -170,7 +170,7 @@ pm.max_requests = 500
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
Expand Down Expand Up @@ -283,7 +283,7 @@ pm.max_requests = 500
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
Expand All @@ -298,40 +298,40 @@ pm.max_requests = 500
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"

; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/log/nginx/__NAMETOCHANGE__.slow.log

; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 5s

; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_terminate_timeout = 1d

; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024

; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0

; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
Expand All @@ -356,7 +356,7 @@ catch_workers_output = yes
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5

; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
Expand All @@ -370,7 +370,7 @@ catch_workers_output = yes
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
Expand All @@ -390,3 +390,14 @@ catch_workers_output = yes
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

; Common values to change to increase file upload limit
; php_value[upload_max_filesize] = 50M
; php_value[post_max_size] = 50M
; php_valuemail.add_x_header = Off

; Other common parameters
; php_value[max_execution_time] = 600
; php_value[max_input_time] = 300
; php_value[memory_limit] = 256M
; php_value[short_open_tag] = On
10 changes: 0 additions & 10 deletions conf/php-fpm.ini

This file was deleted.

6 changes: 3 additions & 3 deletions manifest.json
Expand Up @@ -3,13 +3,13 @@
"id": "garradin",
"packaging_format": 1,
"requirements": {
"yunohost": ">= 2.7.2"
"yunohost": ">=3.5.0"
},
"description": {
"en": "Software to manage association",
"fr": "Logiciel libre de gestion d'association"
},
"version": "0.9.2~ynh1",
"version": "0.9.5~ynh3",
"url": "http://garradin.eu/a-propos/",
"license": "GPL-3.0-or-later",
"maintainer": {
Expand All @@ -19,7 +19,7 @@
"multi_instance": true,
"services": [
"nginx",
"php5-fpm"
"php7.0-fpm"
],
"arguments": {
"install" : [
Expand Down
17 changes: 7 additions & 10 deletions scripts/_common.sh
@@ -1,13 +1,10 @@
#!/bin/bash

#=================================================
# COMMON VARIABLES
#=================================================

# dependencies used by the app
pkg_dependencies="php7.0-sqlite3"

# ============= FUTURE YUNOHOST HELPER =============
# Delete a file checksum from the app settings
#
# $app should be defined when calling this helper
#
# usage: ynh_remove_file_checksum file
# | arg: file - The file for which the checksum will be deleted
ynh_delete_file_checksum () {
local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_'
ynh_app_setting_delete $app $checksum_setting_name
}
37 changes: 15 additions & 22 deletions scripts/backup
Expand Up @@ -6,12 +6,8 @@
# IMPORT GENERIC HELPERS
#=================================================

if [ ! -e _common.sh ]; then
# Get the _common.sh file if it's not in the current directory
cp ../settings/scripts/_common.sh ./_common.sh
chmod a+rx _common.sh
fi
source _common.sh
#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers

#=================================================
Expand All @@ -24,40 +20,37 @@ ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --time --weight=1

app=$YNH_APP_INSTANCE_NAME

final_path=$(ynh_app_setting_get $app final_path)
domain=$(ynh_app_setting_get $app domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)

#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Backing up the main app directory..." --time --weight=1

ynh_backup "$final_path"
ynh_backup --src_path="$final_path"

#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1

ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"

#=================================================
# BACKUP THE PHP-FPM CONFIGURATION
#=================================================
ynh_script_progression --message="Backing up php-fpm configuration..." --time --weight=1

ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf"

# Backup directory location for the app from where the script is executed and
# which will be compressed afterward
backup_dir=$YNH_APP_BACKUP_DIR

# Backup sources & data
ynh_backup "/var/www/$app" "sources"

# Copy Nginx conf
sudo mkdir -p ./conf
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" "conf/nginx.conf"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last

0 comments on commit b7d2aba

Please sign in to comment.