From 3eee0a24e2518c63f600986a8911265f9f66fcfc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 19 Mar 2019 23:33:34 +0100 Subject: update install --- scripts/install | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) (limited to 'scripts/install') diff --git a/scripts/install b/scripts/install index f234e78..819296b 100644 --- a/scripts/install +++ b/scripts/install @@ -8,6 +8,7 @@ source _common.sh source /usr/share/yunohost/helpers +source ynh_install_ruby #================================================= # MANAGE SCRIPT FAILURE @@ -149,32 +150,14 @@ chown -R "$app": "$final_path" #================================================= # SPECIFIC SETUP #================================================= -# ... +# INSTALLING RUBY #================================================= -# TODO: try to use ynh_install_ruby from https://github.com/YunoHost-Apps/Experimental_helpers -# Install de rbenv -( - cd $final_path/.rbenv - src/configure && make -C src - - echo "export PATH=\"$final_path/.rbenv/bin:$final_path/live/bin:\$PATH\" -eval \"\$(rbenv init -)\"" > $final_path/.profile - echo "export PATH=\"$final_path/.rbenv/bin:$final_path/live/bin:\$PATH\"" > $final_path/.bashrc -) - -# Install ruby-build -( - exec_as "$app" $final_path/.rbenv/bin/rbenv install 2.6.0 || true - exec_as "$app" $final_path/.rbenv/bin/rbenv global 2.6.0 || true - exec_as "$app" $final_path/.rbenv/versions/2.6.0/bin/ruby -v -) +ynh_install_ruby --ruby_version=2.6.0 -# Create symlink for ruby -rm /usr/bin/ruby || true -ln -s $final_path/.rbenv/versions/2.6.0/bin/ruby /usr/bin/ruby || true - -# Adjust Mastodon config +#================================================= +# MODIFY A CONFIG FILE +#================================================= cp -a $final_path/live/.env.production.sample $final_path/live/.env.production ynh_replace_string "REDIS_HOST=redis" "REDIS_HOST=127.0.0.1" "${final_path}/live/.env.production" @@ -202,16 +185,25 @@ ynh_replace_string "SMTP_FROM_ADDRESS=notifications@example.com" "SMTP_FROM_ADDR ynh_replace_string "#SMTP_AUTH_METHOD=plain" "SMTP_AUTH_METHOD=none" "${final_path}/live/.env.production" ynh_replace_string "#SMTP_OPENSSL_VERIFY_MODE=peer" "SMTP_OPENSSL_VERIFY_MODE=none" "${final_path}/live/.env.production" -# Preconfig CSS & JS -# Install Mastodon -# Give right permission for the app +#================================================= +# STORE THE CONFIG FILE CHECKSUM +#================================================= + +# Calculate and store the config file checksum into the app settings +ynh_store_file_checksum "${final_path}/live/.env.production" + +#================================================= +# INSTALLING MASTODON +#================================================= +ynh_print_info "Installing Mastodon..." + chown -R "$app": "$final_path" ( cd "$final_path/live" su mastodon <