From 09f59cec8bf996634696ea03231458ba3b83eade Mon Sep 17 00:00:00 2001 From: nemsia Date: Sat, 29 Apr 2017 21:43:36 +0200 Subject: [PATCH 1/3] [fix] Restore dump with psql --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 70b876b..1340796 100644 --- a/scripts/restore +++ b/scripts/restore @@ -102,7 +102,7 @@ RAILS_ENV=production bin/bundle exec rails assets:precompile RCOMMANDS # restore database -sudo pg_dump mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql +sudo psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql # Create symlink for ruby sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true @@ -131,4 +131,4 @@ sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming # Reload services -sudo systemctl reload nginx \ No newline at end of file +sudo systemctl reload nginx From 6bd9e8e2220aeb0fed654240b72745ebca341d1e Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sun, 30 Apr 2017 03:00:02 +0200 Subject: [PATCH 2/3] [enh] Create user & administrator after install --- README.md | 7 +++++++ manifest.json | 4 ++-- scripts/install | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f1e5e1..1b295c4 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,10 @@ After installation, you can create an account manually on Mastodon from your bro You can't install Mastodon in subdirectory, you must use a domain or subdomain for this application. It seems important to close the inscriptions for your Mastodon, so that it remains a private body. We invite you to block remote malicious instances from the administration interface. You can also add text on your home page. + +## TODO + +- [x] Fix upgrade +- [x] [Create automatic user](https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Administration-guide.md#creating-users-while-registration-is-closed) +- [ ] Fix restore +- [ ] Install from a release \ No newline at end of file diff --git a/manifest.json b/manifest.json index c8d1a89..8b93539 100644 --- a/manifest.json +++ b/manifest.json @@ -44,8 +44,8 @@ "name": "passwd", "type": "password", "ask": { - "en": "Enter password of this administrator", - "fr": "Ajouter le mot de passe pour cette administrateur" + "en": "Enter password of this administrator ≥ 8 character", + "fr": "Ajouter le mot de passe pour cette administrateur ≥ 8 charactères" }, "example": "adminpassword" }, diff --git a/scripts/install b/scripts/install index 5d1e75e..f5522df 100644 --- a/scripts/install +++ b/scripts/install @@ -33,6 +33,9 @@ ynh_app_setting_set $app admin $admin_mastodon ynh_app_setting_set $app pass $admin_pass ynh_app_setting_set $app language $language +[[ ${#admin_pass} -gt 8 ]] || ynh_die \ +"The password is too weak, it must be longer than 8 characters" + # Create user unix sudo adduser $app --home /opt/$app --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password --disabled-login @@ -178,6 +181,21 @@ sudo yunohost service add mastodon-web sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming +# Create user +sudo su - $app < Date: Sun, 30 Apr 2017 05:05:10 +0200 Subject: [PATCH 3/3] [fix] Delete source file (useless) --- sources/source_dir | 1 - sources/source_md5 | 1 - sources/source_url | 1 - 3 files changed, 3 deletions(-) delete mode 100644 sources/source_dir delete mode 100644 sources/source_md5 delete mode 100644 sources/source_url diff --git a/sources/source_dir b/sources/source_dir deleted file mode 100644 index e582ada..0000000 --- a/sources/source_dir +++ /dev/null @@ -1 +0,0 @@ -mastodon-1.1.2 \ No newline at end of file diff --git a/sources/source_md5 b/sources/source_md5 deleted file mode 100644 index bd6d5ab..0000000 --- a/sources/source_md5 +++ /dev/null @@ -1 +0,0 @@ -c10055d4250e51eaaf16c78a50390839 mastodon-1.1.2.zip \ No newline at end of file diff --git a/sources/source_url b/sources/source_url deleted file mode 100644 index 7638312..0000000 --- a/sources/source_url +++ /dev/null @@ -1 +0,0 @@ -https://github.com/tootsuite/mastodon/archive/v1.1.2.zip \ No newline at end of file