1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/glpi_ynh.git synced 2024-09-03 20:36:21 +02:00
This commit is contained in:
liberodark 2019-06-30 20:06:41 +02:00
parent 5d64e9bb34
commit 52018b2dbd

View file

@ -95,11 +95,7 @@ ynh_print_info "Installing dependencies..."
### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script
### - And the section "UPGRADE DEPENDENCIES" in the upgrade script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script
#ynh_install_app_dependencies postgresql ruby-dev zlib1g-dev libpq-dev #ynh_install_app_dependencies postgresql
#ynh_print_info "Installing Rails & Bunlder..."
#gem install rails:5.2.2 bundler:2.0.1
#================================================= #=================================================
# CREATE A POSTGRESQL DATABASE # CREATE A POSTGRESQL DATABASE
@ -119,8 +115,8 @@ db_name=$(ynh_sanitize_dbid $app)
db_pwd=$(ynh_string_random 8) db_pwd=$(ynh_string_random 8)
ynh_app_setting_set $app db_name $db_name ynh_app_setting_set $app db_name $db_name
ynh_app_setting_set $app db_pwd $db_pwd ynh_app_setting_set $app db_pwd $db_pwd
ynh_psql_test_if_first_run ynh_mysql_test_if_first_run
ynh_psql_create_db $db_name $db_name $db_pwd ynh_mysql_create_db $db_name $db_name $db_pwd
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER
@ -142,32 +138,14 @@ ynh_setup_source "$final_path"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_print_info "Install Redmine Conffiguration..." #ynh_print_info "Install Redmine Conffiguration..."
cp -a ../conf/database.example.yml $final_path/config/database.yml #cp -a ../conf/database.example.yml $final_path/config/database.yml
#ynh_replace_string "2.5.3" "2.3.3" "/opt/redmine/Gemfile" #ynh_replace_string "2.5.3" "2.3.3" "/opt/redmine/Gemfile"
ynh_replace_string "yunouser" "$db_name" "$final_path/config/database.yml" #ynh_replace_string "yunouser" "$db_name" "$final_path/config/database.yml"
ynh_replace_string "yunopass" "$db_pwd" "$final_path/config/database.yml" #ynh_replace_string "yunopass" "$db_pwd" "$final_path/config/database.yml"
ynh_replace_string "yunobase" "$db_name" "$final_path/config/database.yml" #ynh_replace_string "yunobase" "$db_name" "$final_path/config/database.yml"
#=================================================
# COMPILE REDMINE
#=================================================
ynh_print_info "Compile Redmine..."
pushd $final_path
bundle install --without development test rmagick
RAILS_ENV=production bin/rake generate_secret_token
RAILS_ENV=production bin/rake db:migrate
popd
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_add_systemd_config
systemctl enable $app.service
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
@ -205,7 +183,7 @@ ynh_add_nginx_config
### that really need such authorization. ### that really need such authorization.
# Set permissions to app files # Set permissions to app files
chown -R $app:$app $final_path chgrp www-data $final_path/{config,files,files/_{dumps,sessions,cron,graphs,lock,plugins,tmp,rss,uploads,pictures,log}}
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
@ -218,5 +196,4 @@ if [ $is_public -eq 1 ]; then
fi fi
# Reload services # Reload services
systemctl start $app.service
systemctl reload nginx systemctl reload nginx