From 8b811b73436e64fee016e2a8f18a6e49601287cf Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sun, 16 Apr 2017 16:12:21 +0200 Subject: [enh] Create user + administrator --- scripts/.fonctions | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/.fonctions') 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 -- cgit v1.2.3-70-g09d2