mirror of
https://github.com/YunoHost-Apps/movim_ynh.git
synced 2024-09-03 19:46:19 +02:00
parent
466b1a2b08
commit
8f402943c9
6 changed files with 21 additions and 33 deletions
|
@ -3,10 +3,10 @@
|
|||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/path" (PATH)
|
||||
admin="john" (USER)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
admin="john"
|
||||
is_public=1
|
||||
password="phrasedepasse"
|
||||
language="fr"
|
||||
port=9537 (PORT)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
"email": ""
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.1.7"
|
||||
"yunohost": ">= 4.2.4"
|
||||
},
|
||||
"multi_instance": false,
|
||||
"services": [
|
||||
|
|
|
@ -9,6 +9,8 @@ pkg_dependencies="postgresql postgresql-contrib apt-transport-https"
|
|||
|
||||
YNH_PHP_VERSION="7.3"
|
||||
|
||||
YNH_COMPOSER_VERSION="2.0.13"
|
||||
|
||||
extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-imagick php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-pgsql php${YNH_PHP_VERSION}-xml"
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -132,32 +132,22 @@ ynh_store_file_checksum --file="$final_path/config/db.inc.php"
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring Composer..." --weight=1
|
||||
|
||||
pushd $final_path
|
||||
export COMPOSER_HOME=$final_path
|
||||
ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php${phpversion} -- --version="1.10.16" --install-dir="$final_path" \
|
||||
&& php${phpversion} composer.phar install --no-interaction --quiet
|
||||
popd
|
||||
ynh_install_composer
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring a systemd service..." --weight=12
|
||||
|
||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service
|
||||
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service
|
||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service
|
||||
ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service
|
||||
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
# Set-up database and configuration
|
||||
# SET-UP DATABASE AND CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring database..." --weight=1
|
||||
|
||||
cache_dir="/home/$app"
|
||||
ynh_script_progression --message="Configuring Movim..." --weight=1
|
||||
|
||||
# Create cachedir folder
|
||||
cache_dir="/home/yunohost.app/$app"
|
||||
mkdir -p $cache_dir
|
||||
chown -R $app $cache_dir
|
||||
|
||||
|
@ -172,9 +162,9 @@ popd
|
|||
# SET PERMISSIONS
|
||||
#=================================================
|
||||
|
||||
chown -R $app:www-data $final_path
|
||||
chown -R $app $final_path/src/Movim/
|
||||
chmod u+rwx $final_path
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
|
|
@ -73,8 +73,9 @@ ynh_system_user_create --username=$app
|
|||
#=================================================
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app:www-data $final_path
|
||||
chown -R $app $final_path/src/Movim/
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
|
|
|
@ -128,9 +128,9 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
|
|||
# SET PERMISSIONS
|
||||
#=================================================
|
||||
|
||||
chown -R $app:www-data $final_path
|
||||
chown -R $app $final_path/src/Movim/Bootstrap.php
|
||||
chmod u+rwx $final_path
|
||||
chmod 750 "$final_path"
|
||||
chmod -R o-rwx "$final_path"
|
||||
chown -R $app:www-data "$final_path"
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
|
@ -145,7 +145,7 @@ yunohost service add $app --description="Responsive web-based XMPP client" --log
|
|||
ynh_script_progression --message="Installing Composer..." --weight=1
|
||||
|
||||
pushd "$final_path"
|
||||
ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php$phpversion -- --version="1.10.16" --install-dir="$final_path" \
|
||||
ynh_exec_warn_less ynh_install_composer \
|
||||
&& php$phpversion composer.phar config --global discard-changes true --quiet \
|
||||
&& php$phpversion composer.phar update --no-interaction --quiet \
|
||||
&& php$phpversion composer.phar movim:migrate --quiet
|
||||
|
@ -156,11 +156,6 @@ popd
|
|||
#=================================================
|
||||
ynh_script_progression --message="Upgrading systemd configuration..." --weight=5
|
||||
|
||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service
|
||||
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service
|
||||
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service
|
||||
ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service
|
||||
|
||||
ynh_add_systemd_config
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue