From 3ee4ea6e7ac67f243efc4c6cf3a01bc15ed791cc Mon Sep 17 00:00:00 2001 From: nemsia Date: Tue, 11 Apr 2017 19:13:33 +0200 Subject: [PATCH 01/30] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6a1fe20..f562c63 100644 --- a/scripts/install +++ b/scripts/install @@ -198,7 +198,7 @@ sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming # restart 1 -sudo systemctl restart /etc/systemd/system/mastodon-*.service +#sudo systemctl restart /etc/systemd/system/mastodon-*.service # Re-Install bundle WHY ??? sudo su - $app < Date: Tue, 11 Apr 2017 19:55:43 +0200 Subject: [PATCH 02/30] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f562c63..1757147 100644 --- a/scripts/install +++ b/scripts/install @@ -207,7 +207,7 @@ bundle install MCOMMANDS # restart 2 -sudo systemctl restart /etc/systemd/system/mastodon-*.service +sudo systemctl restart mastodon-*.service # Copy nginx config sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf From 02a8d37a9e61c72e367602fea5f4ae653156eba1 Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 12 Apr 2017 10:23:48 +0200 Subject: [PATCH 03/30] Change secret generation --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 1757147..7e8e79c 100644 --- a/scripts/install +++ b/scripts/install @@ -150,9 +150,9 @@ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live # sudo sed -i "s@DB_PASS=@DB_PASS=${dbpass}@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" -sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" -sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" -sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" +sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" +sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(rake secret)@g" "${final_path}/live/.env.production" +sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" sudo sed -i "s@SMTP_SERVER=smtp.mailgun.org@SMTP_SERVER=localhost@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_FROM_ADDRESS=notifications@example.com,SMTP_FROM_ADDRESS='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" From 0b4926f563877fdee4385c53836e2b7afb904e39 Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 12 Apr 2017 11:05:22 +0200 Subject: [PATCH 04/30] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d5b174..139256f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Mastodon for YunoHost -[![Status](https://img.shields.io/badge/status-in_progress-yellow.svg?style=flat)](https://github.com/Snipees/couchpotato_ynh/milestones) +[![Status](https://img.shields.io/badge/status-in_progress-yellow.svg?style=flat)](https://github.com/magikcypress/mastodon_ynh/milestones) [![Yunohost version](https://img.shields.io/badge/yunohost-2.4.2_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) ## Mastodon c'est quoi ? From a29c1c23e075eaf20b4c5811ae2e7ecbc406bb02 Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 12 Apr 2017 11:15:21 +0200 Subject: [PATCH 05/30] [fix] services don't start --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 7e8e79c..a07a1df 100644 --- a/scripts/install +++ b/scripts/install @@ -198,11 +198,11 @@ sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming # restart 1 -#sudo systemctl restart /etc/systemd/system/mastodon-*.service +sudo systemctl restart mastodon-* # Re-Install bundle WHY ??? sudo su - $app < Date: Wed, 12 Apr 2017 11:45:20 +0200 Subject: [PATCH 06/30] update remove script --- scripts/remove | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/remove b/scripts/remove index c2316ad..5516a76 100644 --- a/scripts/remove +++ b/scripts/remove @@ -17,24 +17,25 @@ domain=$(ynh_app_setting_get "$app" domain) if [ -e "/etc/systemd/system/mastodon-web.service" ]; then echo "Delete systemd script" sudo systemctl stop mastodon-web.service - sudo rm "/etc/systemd/system/mastodon-web.service" sudo systemctl disable mastodon-web.service + sudo rm "/etc/systemd/system/mastodon-web.service" + fi # Stop mastodon-sidekiq if [ -e "/etc/systemd/system/mastodon-sidekiq.service" ]; then echo "Delete systemd script" sudo systemctl stop mastodon-sidekiq.service - sudo rm "/etc/systemd/system/mastodon-sidekiq.service" sudo systemctl disable mastodon-sidekiq.service + sudo rm "/etc/systemd/system/mastodon-sidekiq.service" fi # Stop mastodon-sidekiq if [ -e "/etc/systemd/system/mastodon-streaming.service" ]; then echo "Delete systemd script" sudo systemctl stop mastodon-sidekiq.streaming - sudo rm "/etc/systemd/system/mastodon-streaming.service" sudo systemctl disable mastodon-streaming.service + sudo rm "/etc/systemd/system/mastodon-streaming.service" fi # Delete service on Yunohost monitoring From d1326d35f602db92e62aa8df9934ca7fe0c6bbec Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 12 Apr 2017 12:19:18 +0200 Subject: [PATCH 07/30] Revert secret generation --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index a07a1df..6821b0c 100644 --- a/scripts/install +++ b/scripts/install @@ -150,9 +150,9 @@ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live # sudo sed -i "s@DB_PASS=@DB_PASS=${dbpass}@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" -sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" -sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(rake secret)@g" "${final_path}/live/.env.production" -sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" +sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" +sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" +sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" sudo sed -i "s@SMTP_SERVER=smtp.mailgun.org@SMTP_SERVER=localhost@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_FROM_ADDRESS=notifications@example.com,SMTP_FROM_ADDRESS='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" From e0f511c0ec8c5a2b0234a88e29304247fd1e3e0b Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 12 Apr 2017 16:41:12 +0200 Subject: [PATCH 08/30] Add SMTP SSL verify mode none --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 6821b0c..bed6830 100644 --- a/scripts/install +++ b/scripts/install @@ -156,6 +156,7 @@ sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za sudo sed -i "s@SMTP_SERVER=smtp.mailgun.org@SMTP_SERVER=localhost@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_FROM_ADDRESS=notifications@example.com,SMTP_FROM_ADDRESS='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" +sudo sed -i "s,#SMTP_OPENSSL_VERIFY_MODE=peer,SMTP_OPENSSL_VERIFY_MODE=none" "${final_path}/live/.env.production" # Create database # Preconfig CSS & JS From 19b6e656942fbaed81020a2e25e536495ad13cb5 Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 12 Apr 2017 21:38:06 +0200 Subject: [PATCH 09/30] [fix] smtp --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index bed6830..5b80bdb 100644 --- a/scripts/install +++ b/scripts/install @@ -156,7 +156,7 @@ sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za sudo sed -i "s@SMTP_SERVER=smtp.mailgun.org@SMTP_SERVER=localhost@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_FROM_ADDRESS=notifications@example.com,SMTP_FROM_ADDRESS='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" -sudo sed -i "s,#SMTP_OPENSSL_VERIFY_MODE=peer,SMTP_OPENSSL_VERIFY_MODE=none" "${final_path}/live/.env.production" +sudo sed -i "s@#SMTP_OPENSSL_VERIFY_MODE=peer@SMTP_OPENSSL_VERIFY_MODE=none@g" "${final_path}/live/.env.production" # Create database # Preconfig CSS & JS From da67043bc9b66bd1bdb4af7bc04709909949086b Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 13 Apr 2017 00:18:45 +0200 Subject: [PATCH 10/30] Try to fixing services --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 5b80bdb..70e9668 100644 --- a/scripts/install +++ b/scripts/install @@ -199,11 +199,11 @@ sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming # restart 1 -sudo systemctl restart mastodon-* +# sudo systemctl restart mastodon-* # Re-Install bundle WHY ??? sudo su - $app < Date: Thu, 13 Apr 2017 00:24:36 +0200 Subject: [PATCH 11/30] Don't remove ruby symb link --- scripts/remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 5516a76..ca98596 100644 --- a/scripts/remove +++ b/scripts/remove @@ -87,8 +87,8 @@ SECURE_REMOVE '/etc/cron.d/$app' SECURE_REMOVE '/etc/apt/sources.list.d/backports.list' SECURE_REMOVE '/etc/apt/sources.list.d/yarn.list' -# Delete ruby exec -sudo rm /usr/bin/ruby +# Delete ruby symb link +# sudo rm /usr/bin/ruby # Uninstall Yarn sudo npm uninstall yarn From 8ab42173657ef81ae73907dd2a78d0504ad8ad4f Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 13 Apr 2017 00:29:49 +0200 Subject: [PATCH 12/30] Upgrade script --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 771b98b..b15d9af 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,18 +32,19 @@ sudo sed -i "s@__PATH__@$app@g" ../conf/nginx.conf* sudo sed -i "s@__FINALPATH__@$final_path/@g" ../conf/nginx.conf* # Stop Mastodon Services -sudo systemctl stop /etc/systemd/system/mastodon-*.service +sudo systemctl stop mastodon-* # Update Mastodon sudo su - $app < Date: Thu, 13 Apr 2017 21:47:45 +0200 Subject: [PATCH 13/30] Clean --- scripts/install | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index aa60d97..d88984a 100644 --- a/scripts/install +++ b/scripts/install @@ -194,21 +194,6 @@ sudo yunohost service add mastodon-web sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming -<<<<<<< HEAD -# restart 1 -# sudo systemctl restart mastodon-* - -# Re-Install bundle WHY ??? -sudo su - $app <>>>>>> refs/remotes/magikcypress/master # Copy nginx config sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf sudo sed -i "s@__PATH__@$path@g" /etc/nginx/conf.d/$domain.d/$app.conf @@ -235,4 +220,4 @@ fi sudo yunohost app ssowatconf # Reload Nginx -sudo systemctl reload nginx \ No newline at end of file +sudo systemctl reload nginx From 710de17ad24a270fb9d003eb410b5a59f7b8feb1 Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 13 Apr 2017 23:14:58 +0200 Subject: [PATCH 14/30] Remove domain for smtp login --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index d88984a..409a64d 100644 --- a/scripts/install +++ b/scripts/install @@ -140,7 +140,7 @@ sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" -sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" +sudo sed -i "s@SMTP_LOGIN=,SMTP_LOGIN=${admin_mastodon}@g" "${final_path}/live/.env.production" sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production" sudo sed -i "s@SMTP_SERVER=smtp.mailgun.org@SMTP_SERVER=localhost@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_FROM_ADDRESS=notifications@example.com,SMTP_FROM_ADDRESS='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" From 834dad93f7984536f8277f20be590f9461649af9 Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 13 Apr 2017 23:18:01 +0200 Subject: [PATCH 15/30] Revert "Remove domain for smtp login" This reverts commit 710de17ad24a270fb9d003eb410b5a59f7b8feb1. --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 409a64d..d88984a 100644 --- a/scripts/install +++ b/scripts/install @@ -140,7 +140,7 @@ sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" -sudo sed -i "s@SMTP_LOGIN=,SMTP_LOGIN=${admin_mastodon}@g" "${final_path}/live/.env.production" +sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production" sudo sed -i "s@SMTP_SERVER=smtp.mailgun.org@SMTP_SERVER=localhost@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_FROM_ADDRESS=notifications@example.com,SMTP_FROM_ADDRESS='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" From 93524bf8447c9481ddf9527a4f97c826b72de4bc Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 13 Apr 2017 23:31:42 +0200 Subject: [PATCH 16/30] Change secret generation command --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index d88984a..109dc30 100644 --- a/scripts/install +++ b/scripts/install @@ -136,9 +136,9 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" -sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" -sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" -sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c32)@g" "${final_path}/live/.env.production" +sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" +sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(rake secret)@g" "${final_path}/live/.env.production" +sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production" From 531183868c354da94204da8b7468b93ce27438a5 Mon Sep 17 00:00:00 2001 From: nemsia Date: Fri, 14 Apr 2017 00:00:16 +0200 Subject: [PATCH 17/30] Change default path on manifest --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 22ce245..232ae17 100644 --- a/manifest.json +++ b/manifest.json @@ -38,8 +38,8 @@ "en": "Choose a path for Mastodon", "fr": "Choisissez un chemin pour Mastodon" }, - "example": "/mastodon", - "default": "/mastodon" + "example": "/", + "default": "/" }, { "name": "admin", From b865808ee8ad2ed44f52e8887b2688f07ed10ccf Mon Sep 17 00:00:00 2001 From: nemsia Date: Fri, 14 Apr 2017 14:27:08 +0200 Subject: [PATCH 18/30] Change secret generation command to 128bits --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 109dc30..8c16f33 100644 --- a/scripts/install +++ b/scripts/install @@ -136,9 +136,9 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" -sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" -sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(rake secret)@g" "${final_path}/live/.env.production" -sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(rake secret)@g" "${final_path}/live/.env.production" +sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" +sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" +sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production" From 8b811b73436e64fee016e2a8f18a6e49601287cf Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sun, 16 Apr 2017 16:12:21 +0200 Subject: [PATCH 19/30] [enh] Create user + administrator --- scripts/.fonctions | 7 +++++++ scripts/install | 24 +++++++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/scripts/.fonctions b/scripts/.fonctions index 0a148a6..8013e27 100644 --- a/scripts/.fonctions +++ b/scripts/.fonctions @@ -110,6 +110,13 @@ SETUP_SOURCE () { # Download source, decompress and copu into $final_path fi } +# Create user with special hack +CREATE_USER () { + sudo curl -kSs https://${domain}/auth/sign_up --cookie-jar cookie | grep csrf > token || true + token=$(sudo cat token | sed -n '/csrf-token/s/.*name="csrf-token"\s\+content="\([^"]\+\).*/\1/p') + sudo curl -kSs https://${domain}/auth --data "&user[account_attributes][username]=${admin_mastodon}&user[email]=${admin_mastodon}@${domain}&user[password]=${admin_pass}&user[password_confirmation]=${admin_pass}&authenticity_token=${token}" --cookie cookie +} + ### REMOVE SCRIPT REMOVE_NGINX_CONF () { # Delete nginx configuration diff --git a/scripts/install b/scripts/install index b78cb47..caeec25 100644 --- a/scripts/install +++ b/scripts/install @@ -188,8 +188,6 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf # Install crontab sudo cp ../conf/crontab_mastodon /etc/cron.d/$app sudo sed -i "s@__APP__@$app@g" /etc/cron.d/$app -# Restart crontab -sudo systemctl restart cron # Private or not if [ "$is_public" = "Yes" ]; @@ -208,4 +206,24 @@ fi sudo yunohost app ssowatconf # Reload Nginx -sudo systemctl reload nginx \ No newline at end of file +sudo systemctl reload nginx + +# all services start, please +sleep 30 + +# Mastodon need a user for creating an administator account +# rake create user is not up for the moment +# See PR: https://github.com/tootsuite/mastodon/pull/1482 +CREATE_USER + +# Create admin user +# Create confirm email +sudo su - $app < Date: Sun, 16 Apr 2017 23:59:55 +0200 Subject: [PATCH 20/30] Clean --- README.md | 4 ---- manifest.json | 13 ------------- scripts/install | 6 ------ 3 files changed, 23 deletions(-) diff --git a/README.md b/README.md index 6eca3ca..d66dc2c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ # Mastodon for YunoHost -<<<<<<< HEAD -[![Status](https://img.shields.io/badge/status-in_progress-yellow.svg?style=flat)](https://github.com/magikcypress/mastodon_ynh/milestones) -======= [![Latest Version](https://img.shields.io/badge/version-_--_-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases) [![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones) [![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies) [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE) ->>>>>>> refs/remotes/YunoHost-Apps/master [![Yunohost version](https://img.shields.io/badge/yunohost-2.4.2_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) [![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues) diff --git a/manifest.json b/manifest.json index de52a88..f4f245e 100644 --- a/manifest.json +++ b/manifest.json @@ -32,19 +32,6 @@ "example": "domain.org" }, { -<<<<<<< HEAD - "name": "path", - "type": "path", - "ask": { - "en": "Choose a path for Mastodon", - "fr": "Choisissez un chemin pour Mastodon" - }, - "example": "/", - "default": "/" - }, - { -======= ->>>>>>> refs/remotes/YunoHost-Apps/master "name": "admin", "type": "user", "ask": { diff --git a/scripts/install b/scripts/install index e18f16c..2a97c49 100644 --- a/scripts/install +++ b/scripts/install @@ -134,18 +134,12 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" -<<<<<<< HEAD -sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" -sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" -sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" -======= language="$(echo $language | head -c 2)" sudo sed -i "s@# DEFAULT_LOCALE=de@DEFAULT_LOCALE=${language}@g" "${final_path}/live/.env.production" sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" ->>>>>>> refs/remotes/YunoHost-Apps/master sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production" From abf04b0eee37d44367208d054da4ad1bbd48ba5a Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 17 Apr 2017 00:02:09 +0200 Subject: [PATCH 21/30] Clean --- scripts/install | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/install b/scripts/install index b0d1251..29eeae0 100644 --- a/scripts/install +++ b/scripts/install @@ -207,8 +207,6 @@ sudo yunohost app ssowatconf # Reload Nginx sudo systemctl reload nginx -<<<<<<< HEAD -======= # all services start, please sleep 30 @@ -229,4 +227,3 @@ ACOMMANDS # Restart crontab sudo systemctl restart cron ->>>>>>> refs/remotes/YunoHost-Apps/devel From 83ae4a69573db2c7f5ecb3878682ae0a2269eb1f Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 17 Apr 2017 00:26:26 +0200 Subject: [PATCH 22/30] Revert "Clean" This reverts commit f6848ea476bd4c9f3e8ffeee417c3fde2e968ffb. --- README.md | 4 ++++ manifest.json | 13 +++++++++++++ scripts/install | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/README.md b/README.md index d66dc2c..6eca3ca 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ # Mastodon for YunoHost +<<<<<<< HEAD +[![Status](https://img.shields.io/badge/status-in_progress-yellow.svg?style=flat)](https://github.com/magikcypress/mastodon_ynh/milestones) +======= [![Latest Version](https://img.shields.io/badge/version-_--_-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases) [![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones) [![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies) [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE) +>>>>>>> refs/remotes/YunoHost-Apps/master [![Yunohost version](https://img.shields.io/badge/yunohost-2.4.2_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) [![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues) diff --git a/manifest.json b/manifest.json index f4f245e..de52a88 100644 --- a/manifest.json +++ b/manifest.json @@ -32,6 +32,19 @@ "example": "domain.org" }, { +<<<<<<< HEAD + "name": "path", + "type": "path", + "ask": { + "en": "Choose a path for Mastodon", + "fr": "Choisissez un chemin pour Mastodon" + }, + "example": "/", + "default": "/" + }, + { +======= +>>>>>>> refs/remotes/YunoHost-Apps/master "name": "admin", "type": "user", "ask": { diff --git a/scripts/install b/scripts/install index 29eeae0..318d18a 100644 --- a/scripts/install +++ b/scripts/install @@ -134,12 +134,18 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" +<<<<<<< HEAD +sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" +sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" +sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" +======= language="$(echo $language | head -c 2)" sudo sed -i "s@# DEFAULT_LOCALE=de@DEFAULT_LOCALE=${language}@g" "${final_path}/live/.env.production" sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" +>>>>>>> refs/remotes/YunoHost-Apps/master sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production" From 734d4261fbb8f3e2f5a91390e446497d909f1e52 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 17 Apr 2017 14:25:25 +0200 Subject: [PATCH 23/30] Clean --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 0a402dc..7f1e5e1 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ # Mastodon for YunoHost -<<<<<<< HEAD -[![Status](https://img.shields.io/badge/status-in_progress-yellow.svg?style=flat)](https://github.com/magikcypress/mastodon_ynh/milestones) -======= [![Latest Version](https://img.shields.io/badge/version-_--_-green.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/releases) [![Status](https://img.shields.io/badge/status-testing-yellow.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/milestones) [![Dependencies](https://img.shields.io/badge/dependencies-includes-lightgrey.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh#dependencies) [![GitHub license](https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat)](https://raw.githubusercontent.com/YunoHost-Apps/mastodon_ynh/master/LICENSE) ->>>>>>> refs/remotes/YunoHost-Apps/master [![Yunohost version](https://img.shields.io/badge/yunohost-2.4.2_tested-orange.svg?style=flat)](https://github.com/YunoHost/yunohost) [![GitHub issues](https://img.shields.io/github/issues/YunoHost-Apps/mastodon_ynh.svg?style=flat)](https://github.com/YunoHost-Apps/mastodon_ynh/issues) From 133bb631eb68a7d328ae80289a0bd9e24553bd45 Mon Sep 17 00:00:00 2001 From: nemsia Date: Mon, 17 Apr 2017 23:10:15 +0200 Subject: [PATCH 24/30] clean --- scripts/upgrade | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4fc1143..534daf7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,35 +32,11 @@ sudo sed -i "s@__PATH__@$app@g" ../conf/nginx.conf* sudo sed -i "s@__FINALPATH__@$final_path/@g" ../conf/nginx.conf* # Stop Mastodon Services -<<<<<<< HEAD -sudo systemctl stop mastodon-* -======= sudo systemctl stop mastodon-*.service ->>>>>>> refs/remotes/YunoHost-Apps/master # Update Mastodon sudo su - $app <>>>>>> refs/remotes/YunoHost-Apps/master # Reload Nginx sudo systemctl reload nginx # Restart Mastodon -sudo systemctl start mastodon-*.service \ No newline at end of file +sudo systemctl start mastodon-*.service From 4ce5fbda58f84a5f3185ba6d7bf91b3ada2f0c95 Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 19 Apr 2017 23:16:02 +0200 Subject: [PATCH 25/30] Clean --- scripts/install | 6 ------ 1 file changed, 6 deletions(-) diff --git a/scripts/install b/scripts/install index 4637c3e..5c5dda9 100644 --- a/scripts/install +++ b/scripts/install @@ -132,18 +132,12 @@ sudo sed -i "s@DB_USER=postgres@DB_USER=${app}@g" "${final_path}/live/.env.produ sudo sed -i "s@DB_NAME=postgres@DB_NAME=${app}_production@g" "${final_path}/live/.env.production" sudo sed -i "s@LOCAL_DOMAIN=example.com@LOCAL_DOMAIN=${domain}@g" "${final_path}/live/.env.production" -<<<<<<< HEAD -sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" -sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" -sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n32 /dev/urandom | tr -dc -d 'A-Za-z0-9' | head -c128)@g" "${final_path}/live/.env.production" -======= language="$(echo $language | head -c 2)" sudo sed -i "s@# DEFAULT_LOCALE=de@DEFAULT_LOCALE=${language}@g" "${final_path}/live/.env.production" sudo sed -i "s@PAPERCLIP_SECRET=@PAPERCLIP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@SECRET_KEY_BASE=@SECRET_KEY_BASE=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" sudo sed -i "s@OTP_SECRET=@OTP_SECRET=$(head -n128 /dev/urandom | tr -dc -d 'a-z0-9' | head -c128)@g" "${final_path}/live/.env.production" ->>>>>>> refs/remotes/YunoHost-Apps/master sudo sed -i 's,SMTP_LOGIN=,SMTP_LOGIN='${admin_mastodon}'@'${domain}',' "${final_path}/live/.env.production" sudo sed -i "s@SMTP_PASSWORD=@SMTP_PASSWORD=${admin_pass}@g" "${final_path}/live/.env.production" From bcf1d5d3d4d763caa091309c7dee10d442a89141 Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 19 Apr 2017 23:18:56 +0200 Subject: [PATCH 26/30] Make public by default --- scripts/install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/install b/scripts/install index 5c5dda9..6b8ab4c 100644 --- a/scripts/install +++ b/scripts/install @@ -187,6 +187,9 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf sudo cp ../conf/crontab_mastodon /etc/cron.d/$app sudo sed -i "s@__APP__@$app@g" /etc/cron.d/$app +# Set app public +ynh_app_setting_set "$app" unprotected_uris "/" + # Reload SSOwat configuration sudo yunohost app ssowatconf From 625471149e277b0e27f8912153c624a52431954f Mon Sep 17 00:00:00 2001 From: nemsia Date: Wed, 19 Apr 2017 23:22:28 +0200 Subject: [PATCH 27/30] Clean --- manifest.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/manifest.json b/manifest.json index bccfc30..97ab963 100644 --- a/manifest.json +++ b/manifest.json @@ -32,19 +32,6 @@ "example": "domain.org" }, { -<<<<<<< HEAD - "name": "path", - "type": "path", - "ask": { - "en": "Choose a path for Mastodon", - "fr": "Choisissez un chemin pour Mastodon" - }, - "example": "/", - "default": "/" - }, - { -======= ->>>>>>> refs/remotes/YunoHost-Apps/master "name": "admin", "type": "user", "ask": { From c1ac899a6e388b045e35aebf1c7eaf9b654b0417 Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 20 Apr 2017 12:01:05 +0200 Subject: [PATCH 28/30] Remove Create User --- scripts/install | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/scripts/install b/scripts/install index a7db839..d0dd007 100644 --- a/scripts/install +++ b/scripts/install @@ -198,23 +198,3 @@ sudo yunohost app ssowatconf # Reload Nginx sudo systemctl reload nginx - -# all services start, please -sleep 30 - -# Mastodon need a user for creating an administator account -# rake create user is not up for the moment -# See PR: https://github.com/tootsuite/mastodon/pull/1482 -CREATE_USER - -# Create admin user -# Create confirm email -sudo su - $app < Date: Thu, 20 Apr 2017 12:02:28 +0200 Subject: [PATCH 29/30] Remove Create User --- scripts/.fonctions | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/scripts/.fonctions b/scripts/.fonctions index 20f9ea0..58f67a2 100644 --- a/scripts/.fonctions +++ b/scripts/.fonctions @@ -110,13 +110,6 @@ SETUP_SOURCE () { # Download source, decompress and copu into $final_path fi } -# Create user with special hack -CREATE_USER () { - sudo curl -kSs https://${domain}/auth/sign_up --cookie-jar cookie | grep csrf > token || true - token=$(sudo cat token | sed -n '/csrf-token/s/.*name="csrf-token"\s\+content="\([^"]\+\).*/\1/p') - sudo curl -kSs https://${domain}/auth --data "&user[account_attributes][username]=${admin_mastodon}&user[email]=${admin_mastodon}@${domain}&user[password]=${admin_pass}&user[password_confirmation]=${admin_pass}&authenticity_token=${token}" --cookie cookie -} - ### REMOVE SCRIPT REMOVE_NGINX_CONF () { # Delete nginx configuration @@ -260,4 +253,4 @@ ynh_secure_remove () { echo "$path_to_remove doesn't deleted because it's not exist." >&2 fi fi -} \ No newline at end of file +} From 7af1f88be44eba530d9f74480ba35a8756714f7f Mon Sep 17 00:00:00 2001 From: nemsia Date: Thu, 20 Apr 2017 15:10:35 +0200 Subject: [PATCH 30/30] Set public app on upgrade --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index c093caa..608974f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,5 +51,9 @@ COMMANDS # Reload Nginx sudo systemctl reload nginx + +# Set app public +ynh_app_setting_set "$app" unprotected_uris "/" + # Restart Mastodon sudo systemctl start mastodon-*.service