mirror of
https://github.com/YunoHost-Apps/xwiki_ynh.git
synced 2024-09-03 20:36:11 +02:00
Store config file in /etc and not in source dir
This commit is contained in:
parent
6728620a5d
commit
7798d0f123
5 changed files with 34 additions and 22 deletions
|
@ -133,7 +133,7 @@ xwiki.tags=1
|
|||
# xwiki.store.rollbackattachmentwithdocuments=1
|
||||
|
||||
#-# The path to the hibernate configuration file.
|
||||
# xwiki.store.hibernate.path=/WEB-INF/hibernate.cfg.xml
|
||||
xwiki.store.hibernate.path=/etc/__APP__/hibernate.cfg.xml
|
||||
|
||||
#-# Allow or disable custom mapping for particular XClasses. Custom mapping may increase the performance of certain
|
||||
#-# queries when large number of objects from particular classes are used in the wiki.
|
||||
|
|
|
@ -22,16 +22,16 @@ fi
|
|||
enable_super_admin() {
|
||||
super_admin_pwd=$(ynh_string_random)
|
||||
super_admin_config="xwiki.superadminpassword=$super_admin_pwd"
|
||||
ynh_add_config --template=xwiki.cfg --destination="$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
chmod 400 "$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
chown "$app:$app" "$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki.cfg
|
||||
chmod 400 /etc/$app/xwiki.cfg
|
||||
chown "$app:$app" /etc/$app/xwiki.cfg
|
||||
}
|
||||
|
||||
disable_super_admin() {
|
||||
super_admin_config='#'
|
||||
ynh_add_config --template=xwiki.cfg --destination="$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
chmod 400 "$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
chown "$app:$app" "$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki.cfg
|
||||
chmod 400 /etc/$app/xwiki.cfg
|
||||
chown "$app:$app" /etc/$app/xwiki.cfg
|
||||
}
|
||||
|
||||
install_exension() {
|
||||
|
@ -113,11 +113,32 @@ wait_for_flavor_install() {
|
|||
done
|
||||
}
|
||||
|
||||
install_source() {
|
||||
ynh_setup_source --dest_dir="$install_dir" --full_replace=1
|
||||
ynh_setup_source --dest_dir="$install_dir"/webapps/xwiki/WEB-INF/lib/ --source_id=jdbc
|
||||
ynh_setup_source --dest_dir="$install_dir"/xq_tool --source_id=xq_tool
|
||||
|
||||
ynh_secure_remove --file="$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
ynh_secure_remove --file="$install_dir"/webapps/xwiki/WEB-INF/xwiki.properties
|
||||
|
||||
ln -s /var/log/"$app" "$install_dir"/logs
|
||||
ln -s /etc/$app/xwiki.cfg "$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
ln -s /etc/$app/xwiki.properties "$install_dir"/webapps/xwiki/WEB-INF/xwiki.properties
|
||||
}
|
||||
|
||||
add_config() {
|
||||
ynh_add_config --template=hibernate.cfg.xml --destination=/etc/$app/hibernate.cfg.xml
|
||||
ynh_add_config --template=xwiki.cfg --destination=/etc/$app/xwiki.cfg
|
||||
ynh_add_config --template=xwiki.properties --destination=/etc/$app/xwiki.properties
|
||||
}
|
||||
|
||||
set_permissions() {
|
||||
chmod -R u+rwX,o-rwx "$install_dir"
|
||||
chown -R "$app:$app" "$install_dir"
|
||||
|
||||
chmod -R u=rwX,g=rX,o= /etc/$app
|
||||
chown -R "$app:$app" /etc/$app
|
||||
|
||||
chown "$app:$app" -R /var/log/$app
|
||||
chmod u=rwX,g=rX,o= -R /var/log/$app
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service"
|
|||
# BACKUP DATA
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$data_path" --is_big=1
|
||||
ynh_backup --src_path="$data_dir" --is_big=1
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MYSQL DATABASE
|
||||
|
|
|
@ -23,13 +23,11 @@ if [ -n "$(ls -A $data_dir)" ]; then
|
|||
fi
|
||||
|
||||
mkdir -p /var/log/"$app"
|
||||
ln -s /var/log/"$app" "$install_dir"/logs
|
||||
mkdir -p /etc/$app
|
||||
|
||||
ynh_script_progression --message='Setting up source files...' --weight=1
|
||||
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
ynh_setup_source --dest_dir="$install_dir"/webapps/xwiki/WEB-INF/lib/ --source_id=jdbc
|
||||
ynh_setup_source --dest_dir="$install_dir"/xq_tool --source_id=xq_tool
|
||||
install_source
|
||||
|
||||
#=================================================
|
||||
# SYSTEM CONFIGURATION
|
||||
|
@ -49,10 +47,7 @@ yunohost service add "$app" --description=XWiki --log="/var/log/$app/$app.log"
|
|||
#=================================================
|
||||
ynh_script_progression --message='Adding a configuration file...' --weight=1
|
||||
|
||||
ynh_add_config --template=hibernate.cfg.xml --destination="$install_dir"/webapps/xwiki/WEB-INF/hibernate.cfg.xml
|
||||
ynh_add_config --template=xwiki.cfg --destination="$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
ynh_add_config --template=xwiki.properties --destination="$install_dir"/webapps/xwiki/WEB-INF/xwiki.properties
|
||||
|
||||
add_config
|
||||
set_permissions
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -30,10 +30,8 @@ ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$
|
|||
|
||||
if [ "$upgrade_type" == UPGRADE_APP ]
|
||||
then
|
||||
ynh_setup_source --dest_dir="$install_dir"
|
||||
install_source
|
||||
fi
|
||||
ynh_setup_source --dest_dir="$install_dir"/webapps/xwiki/WEB-INF/lib/ --source_id=jdbc
|
||||
ynh_setup_source --dest_dir="$install_dir"/xq_tool --source_id=xq_tool
|
||||
|
||||
#=================================================
|
||||
# REAPPLY SYSTEM CONFIGURATIONS
|
||||
|
@ -53,9 +51,7 @@ yunohost service add "$app" --description=XWiki --log="/var/log/$app/$app.log"
|
|||
#=================================================
|
||||
ynh_script_progression --message='Adding a configuration file...' --weight=1
|
||||
|
||||
ynh_add_config --template=hibernate.cfg.xml --destination="$install_dir"/webapps/xwiki/WEB-INF/hibernate.cfg.xml
|
||||
ynh_add_config --template=xwiki.cfg --destination="$install_dir"/webapps/xwiki/WEB-INF/xwiki.cfg
|
||||
ynh_add_config --template=xwiki.properties --destination="$install_dir"/webapps/xwiki/WEB-INF/xwiki.properties
|
||||
add_config
|
||||
|
||||
enable_super_admin
|
||||
set_permissions
|
||||
|
|
Loading…
Add table
Reference in a new issue