1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/facette_ynh.git synced 2024-09-03 18:36:02 +02:00
This commit is contained in:
ericgaspar 2021-07-26 22:58:05 +02:00
parent 0382b76c19
commit 53e2e56e9e
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 38 additions and 54 deletions

View file

@ -1,12 +1,8 @@
# See here for more informations
# https://github.com/YunoHost/package_check#syntax-check_process-file
;; Test complet
; Manifest
domain="domain.tld" (DOMAIN)
path="/" (PATH)
is_public=1 (PUBLIC|public=1|private=0)
domain="domain.tld"
path="/"
is_public=1
; Checks
pkg_linter=1
setup_sub_dir=0
@ -17,12 +13,7 @@
upgrade=1
backup_restore=1
multi_instance=1
incorrect_path=1
port_already_use=1
change_url=0
;;; Levels
# Level 5:
Level 5=auto
;;; Options
Email=
Notification=none

View file

@ -50,8 +50,8 @@ storage:
debug: false
### SQLite
driver: sqlite
path: var/data.db
#driver: sqlite
#path: var/data.db
### PostgreSQL
#driver: pgsql
@ -62,12 +62,12 @@ storage:
#password: ********
### MySQL
#driver: mysql
#host: localhost
#port: 3306
#dbname: facette
#user: facette
#password: ********
driver: mysql
host: localhost
port: 3306
dbname: __DB_NAME__
user: __DB_NAME__
password: __DB_PWD__
cache:
# Cache directory path

View file

@ -14,7 +14,7 @@
"email": "jrafi59_dev@srvmaison.fr.nf"
},
"requirements": {
"yunohost": ">= 4.0.0"
"yunohost": ">= 4.2.0"
},
"multi_instance": false,
"services": [
@ -26,29 +26,17 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for Facette",
"fr": "Choisissez un nom de domaine pour Facette"
},
"example": "example.com"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Facette only / is accepted",
"fr": "Choisissez un chemin pour Facette uniquement / est accepté"
},
"example": "/",
"default": "/"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": true
}
]

View file

@ -36,7 +36,6 @@ test ! -e "$final_path" || ynh_die --message="This path already contains a folde
# Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
@ -44,14 +43,13 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
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=is_public --value=$is_public
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# FIND AND OPEN A PORT
#=================================================
ynh_script_progression --message="Configuring firewall..." --weight=0
ynh_script_progression --message="Finding an available port..." --weight=0
# Find an available port
port=$(ynh_find_port --port=12003)
@ -64,6 +62,24 @@ ynh_script_progression --message="Installing dependencies..." --weight=9
ynh_install_app_dependencies $pkg_dependencies
#=================================================
# 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"
#=================================================
# CREATE A MYSQL DATABASE
#=================================================
ynh_script_progression --message="Creating a MySQL database..." --weight=1
db_name=$(ynh_sanitize_dbid --db_name=$app)
db_user=$db_name
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -74,6 +90,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
#=================================================
@ -81,27 +101,12 @@ ynh_setup_source --dest_dir=$final_path
# Create a dedicated nginx config
ynh_add_nginx_config
#=================================================
# CREATE DEDICATED USER
#=================================================
# Create a system user
ynh_system_user_create $app
#=================================================
# SPECIFIC SETUP
#=================================================
chown facette: /var/run/rrdcached
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chown -R root: $final_path
#=================================================
# SETUP LOGROTATE
#=================================================