diff options
| -rw-r--r-- | README.md | 7 | ||||
| -rw-r--r-- | manifest.json | 4 | ||||
| -rw-r--r-- | scripts/install | 18 | ||||
| -rw-r--r-- | sources/source_dir | 1 | ||||
| -rw-r--r-- | sources/source_md5 | 1 | ||||
| -rw-r--r-- | sources/source_url | 1 |
6 files changed, 27 insertions, 5 deletions
@@ -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 ba8d7c0..806fec2 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 @@ -182,6 +185,21 @@ sudo yunohost service add mastodon-web sudo yunohost service add mastodon-sidekiq sudo yunohost service add mastodon-streaming +# Create user +sudo su - $app <<UCOMMANDS +pushd ~/live +RAILS_ENV=production bundle exec rails c +account = Account.create!(username: '$admin_mastodon') +user = User.create!(email: '$admin_mastodon@$domain', password: '$admin_pass', account: account) +UCOMMANDS + +# Create administrator & confirm user +sudo su - $app <<ACOMMANDS +pushd ~/live +RAILS_ENV=production bin/bundle exec rails mastodon:make_admin USERNAME=$admin_mastodon +RAILS_ENV=production bin/bundle exec rails mastodon:confirm_email USER_EMAIL=$admin_mastodon@$domain +ACOMMANDS + # Copy nginx config sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf 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 |
