aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranmol <github@datamol.org>2019-01-22 16:56:49 +0530
committeranmol <github@datamol.org>2019-01-22 16:56:49 +0530
commit41d7f8700d2ffb66148fb99dd19c7ea4afc6c197 (patch)
tree99525ede33de42c07185b68a1d389b611e646daf
parentf281b053c8984bf3c7e1507b7e43088e440019d9 (diff)
downloadmastodon_ynh-41d7f8700d2ffb66148fb99dd19c7ea4afc6c197.tar.gz
mastodon_ynh-41d7f8700d2ffb66148fb99dd19c7ea4afc6c197.tar.bz2
mastodon_ynh-41d7f8700d2ffb66148fb99dd19c7ea4afc6c197.zip
Fix account creation
-rw-r--r--scripts/install9
1 files changed, 3 insertions, 6 deletions
diff --git a/scripts/install b/scripts/install
index 7859db8..3680b03 100644
--- a/scripts/install
+++ b/scripts/install
@@ -25,7 +25,6 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
admin_mastodon=$YNH_APP_ARG_ADMIN
admin_mastodon_mail=$(ynh_user_get_info $admin_mastodon 'mail')
-admin_pass=$(ynh_string_random 24)
language=$YNH_APP_ARG_LANGUAGE
port_web=$(ynh_find_port 3000)
port_stream=$(ynh_find_port 4000)
@@ -234,17 +233,15 @@ systemctl start "$app-web.service" "$app-sidekiq.service" "$app-streaming.servic
# Create user
(
cd "$final_path/live"
- su mastodon <<CREATEUSER
-RAILS_ENV=production $final_path/.rbenv/versions/2.6.0/bin/bundle exec rails c
-account = Account.create!(username: '$admin_mastodon')
-user = User.create!(email: '$admin_mastodon_mail', password: '$admin_pass', account: account)
-CREATEUSER
su mastodon <<SETADMIN
+( RAILS_ENV=production bin/tootctl accounts create '$admin_mastodon' --email='$admin_mastodon_mail' > acc.txt )
RAILS_ENV=production bin/tootctl accounts modify $admin_mastodon --confirm
RAILS_ENV=production bin/tootctl accounts modify $admin_mastodon --role admin
SETADMIN
)
+admin_pass=$( cd $final_path/live && tail -1 acc.txt | head -1 | cut -c 15- )
+(cd $final_path/live && rm -f acc.txt)
#=================================================
# GENERIC FINALIZATION
#=================================================