From 6bd9e8e2220aeb0fed654240b72745ebca341d1e Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sun, 30 Apr 2017 03:00:02 +0200 Subject: [PATCH] [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 <