mirror of
https://github.com/YunoHost-Apps/codimd_ynh.git
synced 2024-09-03 18:16:32 +02:00
parent
7a9bf91705
commit
89967ef138
4 changed files with 16 additions and 17 deletions
|
@ -29,7 +29,7 @@
|
||||||
"addGoogleAnalytics": false
|
"addGoogleAnalytics": false
|
||||||
},
|
},
|
||||||
"db": {
|
"db": {
|
||||||
"username": "__DB_NAME__",
|
"username": "__DB_USER__",
|
||||||
"password": "__DB_PWD__",
|
"password": "__DB_PWD__",
|
||||||
"database": "__DB_NAME__",
|
"database": "__DB_NAME__",
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
pkg_dependencies="postgresql apt-transport-https libssl-dev"
|
pkg_dependencies="postgresql apt-transport-https libssl-dev"
|
||||||
|
|
||||||
nodejs_version=11
|
nodejs_version=12
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
|
|
@ -83,10 +83,10 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
||||||
|
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
db_user=$db_name
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
|
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -125,14 +125,13 @@ popd
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
ynh_script_progression --message="Modifying a config file..." --weight=1
|
||||||
|
|
||||||
path=${path_url:1}
|
|
||||||
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
|
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json"
|
||||||
chmod 600 $final_path/config.json
|
|
||||||
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc"
|
ynh_add_config --template="../conf/.sequelizerc.example" --destination="$final_path/.sequelizerc"
|
||||||
chmod 600 $final_path/.sequelizerc
|
|
||||||
|
|
||||||
|
chmod 600 $final_path/config.json
|
||||||
|
chmod 600 $final_path/.sequelizerc
|
||||||
chmod +x $final_path/app.js
|
chmod +x $final_path/app.js
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -146,7 +145,7 @@ ynh_add_systemd_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..."
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log"
|
yunohost service add $app --description="Collaborative Markdown notes" --log="/var/log/$app/$app.log"
|
||||||
|
|
||||||
|
|
|
@ -83,24 +83,24 @@ then
|
||||||
ynh_script_progression --message="Upgrading source files..." --weight=16
|
ynh_script_progression --message="Upgrading source files..." --weight=16
|
||||||
|
|
||||||
# Create a temporary directory
|
# Create a temporary directory
|
||||||
tmpdir="$(mktemp -d)"
|
#tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
# Backup the config file in the temp dir
|
# Backup the config file in the temp dir
|
||||||
cp -a "$final_path/config.json" "$tmpdir/config.json"
|
#cp -a "$final_path/config.json" "$tmpdir/config.json"
|
||||||
cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc"
|
#cp -a "$final_path/.sequelizerc" "$tmpdir/.sequelizerc"
|
||||||
|
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file=$final_path
|
#ynh_secure_remove --file=$final_path
|
||||||
|
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_setup_source --dest_dir=$final_path
|
ynh_setup_source --dest_dir=$final_path --keep="$final_path/config.json $final_path/.sequelizerc"
|
||||||
|
|
||||||
#Copy the admin saved settings from tmp directory to final path
|
#Copy the admin saved settings from tmp directory to final path
|
||||||
cp -a "$tmpdir/config.json" "$final_path/config.json"
|
#cp -a "$tmpdir/config.json" "$final_path/config.json"
|
||||||
cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc"
|
#cp -a "$tmpdir/.sequelizerc" "$final_path/.sequelizerc"
|
||||||
|
|
||||||
# Remove the tmp directory securely
|
# Remove the tmp directory securely
|
||||||
ynh_secure_remove --file="$tmpdir"
|
#ynh_secure_remove --file="$tmpdir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
|
|
Loading…
Add table
Reference in a new issue