mirror of
https://github.com/YunoHost-Apps/grocy_ynh.git
synced 2024-09-03 19:25:54 +02:00
Add headers (#13)
This commit is contained in:
parent
c71476b2dd
commit
b0aed70573
9 changed files with 76 additions and 43 deletions
|
@ -1,15 +1,10 @@
|
|||
# See here for more information
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
|
||||
# Move this file from check_process.default to check_process when you have filled it.
|
||||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
admin="john" (USER)
|
||||
language="fr" (LANGUAGE)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
admin="john"
|
||||
language="fr"
|
||||
is_public=1
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=0
|
||||
|
|
|
@ -8,6 +8,8 @@ location / {
|
|||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
more_set_headers "X-Content-Type-Options: nosniff";
|
||||
|
||||
index index.php;
|
||||
|
||||
try_files $uri __PATH__/index.php;
|
||||
|
|
9
doc/DISCLAIMER.md
Normal file
9
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
## Configuration
|
||||
|
||||
Default login
|
||||
* user: **admin**
|
||||
* password: **admin**
|
||||
|
||||
## Limitations
|
||||
|
||||
:warning: For now, Grocy must be installed in a root domain or subdirectory.
|
9
doc/DISCLAIMER_fr.md
Normal file
9
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
## Configuration
|
||||
|
||||
Connexion par défaut
|
||||
* utilisateur : **admin**
|
||||
* mot de passe : **admin**
|
||||
|
||||
## Limitations
|
||||
|
||||
:warning: Pour l'instant, Grocy doit être installé dans un domaine racine ou un sous-domaine.
|
BIN
doc/screenshots/stock-en.png
Normal file
BIN
doc/screenshots/stock-en.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 120 KiB |
|
@ -7,14 +7,20 @@
|
|||
"fr": "Solution Web de gestion d'épicerie et de gestion de la maison"
|
||||
},
|
||||
"version": "3.0.1~ynh2",
|
||||
"url": "https://github.com/grocy/grocy",
|
||||
"url": "https://grocy.info",
|
||||
"upstream": {
|
||||
"license": "MIT",
|
||||
"website": "https://grocy.info/",
|
||||
"demo": "https://en.demo.grocy.info/stockoverview",
|
||||
"code": "https://github.com/grocy/grocy"
|
||||
},
|
||||
"license": "MIT",
|
||||
"maintainer": {
|
||||
"name": "",
|
||||
"email": ""
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.1.7"
|
||||
"yunohost": ">= 4.2.4"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
|
|
|
@ -47,6 +47,14 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain
|
|||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=language --value=$language
|
||||
|
||||
#=================================================
|
||||
# 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"
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
#=================================================
|
||||
|
@ -56,6 +64,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
|||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$final_path"
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -64,14 +76,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=10
|
|||
# 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
|
||||
#=================================================
|
||||
|
@ -87,11 +91,8 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
|||
|
||||
ynh_add_config --template="../conf/config-dist.php" --destination="$final_path/data/config.php"
|
||||
|
||||
#=================================================
|
||||
# STORE THE CONFIG FILE CHECKSUM
|
||||
#=================================================
|
||||
|
||||
ynh_store_file_checksum --file="$final_path/data/config.php"
|
||||
chmod 400 "$final_path/data/config.php"
|
||||
chown $app "$final_path/data/config.php"
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
@ -100,9 +101,9 @@ ynh_store_file_checksum --file="$final_path/data/config.php"
|
|||
#=================================================
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chmod o-rwx $final_path
|
||||
chmod -R 755 $final_path/data
|
||||
# chown -R $app: $final_path
|
||||
# chmod o-rwx $final_path
|
||||
# chmod -R 755 $final_path/data
|
||||
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
|
|
|
@ -46,6 +46,14 @@ test ! -d $final_path \
|
|||
|
||||
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
@ -53,13 +61,9 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=5
|
|||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
|
||||
#=================================================
|
||||
# RECREATE THE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
|
||||
|
||||
# Create the dedicated user (if not existing)
|
||||
ynh_system_user_create --username=$app
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
|
@ -75,10 +79,10 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
|||
# RESTORE USER RIGHTS
|
||||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app: $final_path
|
||||
chmod o-rwx $final_path
|
||||
chmod -R 755 $final_path/data
|
||||
# # Restore permissions on app files
|
||||
# chown -R $app: $final_path
|
||||
# chmod o-rwx $final_path
|
||||
# chmod -R 755 $final_path/data
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
|
|
|
@ -87,6 +87,10 @@ then
|
|||
#ynh_secure_remove --file="$tmpdir"
|
||||
fi
|
||||
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -117,14 +121,17 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
|||
|
||||
ynh_add_config --template="../conf/config-dist.php" --destination="$final_path/data/config.php"
|
||||
|
||||
chmod 400 "$final_path/data/config.php"
|
||||
chown $app "$final_path/data/config.php"
|
||||
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
# Set permissions to app files
|
||||
chown -R $app: $final_path
|
||||
chmod o-rwx $final_path
|
||||
chmod -R 755 $final_path/data
|
||||
# chown -R $app: $final_path
|
||||
# chmod o-rwx $final_path
|
||||
# chmod -R 755 $final_path/data
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
|
|
Loading…
Add table
Reference in a new issue