mirror of
https://github.com/YunoHost-Apps/limesurvey_ynh.git
synced 2024-09-03 19:36:32 +02:00
[fix] Setup correctly db and disable old templates
This commit is contained in:
parent
770b3411e4
commit
f87a1babf7
3 changed files with 26 additions and 25 deletions
|
@ -9,7 +9,6 @@ INSERT INTO `lime_plugins` (`id`, `name`, `active`) VALUES
|
||||||
(9,'AuthLDAP',0);
|
(9,'AuthLDAP',0);
|
||||||
|
|
||||||
INSERT INTO `lime_permissions` (`id`, `entity`, `entity_id`, `uid`, `permission`, `create_p`, `read_p`, `update_p`, `delete_p`, `import_p`, `export_p`) VALUES
|
INSERT INTO `lime_permissions` (`id`, `entity`, `entity_id`, `uid`, `permission`, `create_p`, `read_p`, `update_p`, `delete_p`, `import_p`, `export_p`) VALUES
|
||||||
(1,'global',0,1,'superadmin',0,1,0,0,0,0),
|
|
||||||
(2,'global',0,2,'auth_ldap',0,1,0,0,0,0),
|
(2,'global',0,2,'auth_ldap',0,1,0,0,0,0),
|
||||||
(3,'global',0,2,'surveys',1,0,0,0,0,0);
|
(3,'global',0,2,'surveys',1,0,0,0,0,0);
|
||||||
|
|
||||||
|
@ -41,8 +40,6 @@ INSERT INTO `lime_plugin_settings` (`id`, `plugin_id`, `model`, `model_id`, `key
|
||||||
|
|
||||||
INSERT INTO `lime_settings_global` VALUES ('defaultlang','{{ language }}'),('AssetsVersion','2620');
|
INSERT INTO `lime_settings_global` VALUES ('defaultlang','{{ language }}'),('AssetsVersion','2620');
|
||||||
|
|
||||||
INSERT INTO `lime_users` VALUES (1,'{{ admin }}','9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08','Administrator',0,'{{ language }}','','default','default','default',NULL,1,'2017-02-02 01:03:08',NULL);
|
|
||||||
|
|
||||||
{% if is_public == "1" %}
|
{% if is_public == "1" %}
|
||||||
UPDATE `lime_plugin_settings` SET value='\"0\"' WHERE `id`=21;
|
UPDATE `lime_plugin_settings` SET value='\"0\"' WHERE `id`=21;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -18,7 +18,6 @@ set_permissions () {
|
||||||
|| echo "No file to modify"
|
|| echo "No file to modify"
|
||||||
#chown root: $final_path/application/config/config.php
|
#chown root: $final_path/application/config/config.php
|
||||||
chmod -R u+w $final_path/tmp
|
chmod -R u+w $final_path/tmp
|
||||||
chmod -R u+w $final_path/templates
|
|
||||||
chmod -R u+w $final_path/upload
|
chmod -R u+w $final_path/upload
|
||||||
chmod -R u+w $final_path/application/config/
|
chmod -R u+w $final_path/application/config/
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,13 @@ ynh_system_user_create $app
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SECURING FILES AND DIRECTORIES
|
||||||
|
#=================================================
|
||||||
|
# Set permissions
|
||||||
|
set_permissions
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -98,19 +105,14 @@ ynh_add_fpm_config
|
||||||
ynh_configure config.php "$final_path/application/config/config.php"
|
ynh_configure config.php "$final_path/application/config/config.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SQL CONFIG
|
# INSTALL
|
||||||
#=================================================
|
#=================================================
|
||||||
cp $final_path/installer/sql/create-mysql.sql ./structure.sql
|
ls_cli=$final_path/application/commands/console.php
|
||||||
ynh_replace_string "\`prefix_" "\`$prefix" ./structure.sql
|
fullname=$(ynh_user_get_info "$admin" "fullname")
|
||||||
mysql -u $db_user -p$db_pwd $db_user < ./structure.sql
|
mail=$(ynh_user_get_info "$admin" "mail")
|
||||||
ynh_configure data.sql ./data.sql
|
|
||||||
mysql -u $db_user -p$db_pwd $db_user < ./data.sql
|
|
||||||
|
|
||||||
#=================================================
|
# Permission should be correctly set before to do this
|
||||||
# Add nice themes
|
ynh_exec_as "$app" php $ls_cli install "$admin" "$(ynh_string_random 24)" "$fullname" "$mail"
|
||||||
#=================================================
|
|
||||||
ynh_setup_source "$final_path/upload/templates/libreform" libreform
|
|
||||||
#ynh_setup_source "$final_path/upload/templates/librepoll" librepoll
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CHECKSUM OF THE CONFIG FILE
|
# STORE THE CHECKSUM OF THE CONFIG FILE
|
||||||
|
@ -119,24 +121,27 @@ ynh_setup_source "$final_path/upload/templates/libreform" libreform
|
||||||
# Calculate and store the config file checksum into the app settings
|
# Calculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum "$final_path/application/config/config.php"
|
ynh_store_file_checksum "$final_path/application/config/config.php"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# LOAD SQL SPECIFIC CONFIG
|
||||||
|
#=================================================
|
||||||
|
ynh_configure data.sql ./data.sql
|
||||||
|
mysql -u $db_user -p$db_pwd $db_user < ./data.sql
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# Add nice themes
|
||||||
|
#=================================================
|
||||||
|
#ynh_setup_source "$final_path/upload/templates/libreform" libreform
|
||||||
|
#ynh_setup_source "$final_path/upload/templates/librepoll" librepoll
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALISATION
|
# GENERIC FINALISATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURING FILES AND DIRECTORIES
|
# SECURING FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
set_permissions
|
set_permissions
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# Randomize Password user
|
|
||||||
#=================================================
|
|
||||||
# Permission should be correctly set before to do this
|
|
||||||
ls_cli=$final_path/application/commands/console.php
|
|
||||||
set +x
|
|
||||||
ynh_exec_as "$app" php $ls_cli resetpassword "$admin" "$(ynh_string_random 24)"
|
|
||||||
set -x
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Reference in a new issue