From eabe291999e71c199dcc167834263017b26874d2 Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 25 May 2017 00:07:57 +0200 Subject: [fix] Restore dependencies --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index 3a2eeaf..e0969ee 100644 --- a/scripts/restore +++ b/scripts/restore @@ -67,7 +67,7 @@ sudo adduser $app --home /opt/$app --gecos "First Last,RoomNumber,WorkPhone,Home # Reinstall dependencies # Install debian package - ynh_package_install imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt-transport-https + ynh_package_install imagemagick libpq-dev libxml2-dev libxslt1-dev file curl apt-transport-https pkg-config libprotobuf-dev protobuf-compiler # Install redis package ynh_package_install redis-server redis-tools -- cgit v1.2.3-70-g09d2 From 77a80d633c49963e2de3c4f9f97b2afd6cc9f713 Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 25 May 2017 14:09:20 +0200 Subject: [fix] Nodejs 6 on restore --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index e0969ee..84828b1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -89,7 +89,7 @@ sudo adduser $app --home /opt/$app --gecos "First Last,RoomNumber,WorkPhone,Home # Install de Node.js pushd /opt - curl -sL https://deb.nodesource.com/setup_4.x | sudo bash - + curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - sudo apt-get -y install nodejs # Install Yarn -- cgit v1.2.3-70-g09d2 From 097bd9dec81c64fe8830a8fe7863451056e13def Mon Sep 17 00:00:00 2001 From: nemsia Date: Fri, 26 May 2017 21:20:07 +0200 Subject: Fix restore 1.4 (#38) * [fix] Remove db:setup * [enh] add install rben on restore * [enh] Remove asset:precompile and db:migrate on restore * [enh] bundle and yarn install on restore --- scripts/restore | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) (limited to 'scripts/restore') diff --git a/scripts/restore b/scripts/restore index 84828b1..5860e2c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,30 +35,30 @@ fi # Check configuration files nginx nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf" if [ -f $nginx_conf ]; then - ynh_die "The NGINX configuration already exists at '${nginx_conf}'. + ynh_die "The NGINX configuration already exists at '${nginx_conf}'. You should safely delete it before restoring this app." fi # Check configuration files php-fpm crontab_conf="/etc/cron.d/${app}" -if [ -f $crontab_conf ]; then - ynh_die "The CRONTAB configuration already exists at '${crontab_conf}'. +if [ -f $crontab_conf ]; then + ynh_die "The CRONTAB configuration already exists at '${crontab_conf}'. You should safely delete it before restoring this app." fi # Restore services web_systemd="/etc/systemd/system/${app}-web.service" if [ -f "${web_systemd}" ]; then - ynh_die "The MASTODON WEB configuration already exists at '${web_systemd}'. + ynh_die "The MASTODON WEB configuration already exists at '${web_systemd}'. You should safely delete it before restoring this app." fi sidekiq_systemd="/etc/systemd/system/${app}-sidekiq.service" if [ -f "${sidekiq_systemd}" ]; then - ynh_die "The MASTODON SIDEKIQ configuration already exists at '${sidekiq_systemd}'. + ynh_die "The MASTODON SIDEKIQ configuration already exists at '${sidekiq_systemd}'. You should safely delete it before restoring this app." fi streaming_systemd="/etc/systemd/system/${app}-streaming.service" if [ -f "${streaming_systemd}" ]; then - ynh_die "The MASTODON STREAMING configuration already exists at '${streaming_systemd}'. + ynh_die "The MASTODON STREAMING configuration already exists at '${streaming_systemd}'. You should safely delete it before restoring this app." fi @@ -97,7 +97,7 @@ sudo adduser $app --home /opt/$app --gecos "First Last,RoomNumber,WorkPhone,Home # Return to home popd - + # Restore sources & data sudo cp -a ./sources/. "$final_path" @@ -117,21 +117,23 @@ sudo su -c "psql" postgres <<< \ sudo su -c "psql" postgres <<< \ "update pg_database set datistemplate='true' where datname='template1';" +# Install rbenv +sudo su - $app <> ~/.profile +echo 'export PATH="/opt/mastodon/.rbenv/bin:/opt/mastodon/live/bin:$PATH"' >> ~/.bashrc +echo 'eval "\$(rbenv init -)"' >> ~/.profile +COMMANDS + # Create user for db postgresql ynh_psql_create_db_without_password "$app" # Setup database -sudo su - $app <