From 605cefe2b0f95802673be6ff18d69c3e179db66b Mon Sep 17 00:00:00 2001 From: Valentin Date: Sat, 24 Feb 2024 21:44:37 +0100 Subject: [PATCH] directus tmux et caddy 13 --- install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index f7af7c7..58d008a 100644 --- a/install.sh +++ b/install.sh @@ -254,20 +254,20 @@ if [[ "$answer" == "y" ]]; then echo \"DB_PASSWORD='${db_directus_password}'\" >> ${env_file} &&\ echo \"SECRET='${secret}'\" >> ${env_file} &&\ echo \"KEY='${key}'\" >> ${env_file} &&\ - echo \"ADMIN_EMAIL='${directus_admin_email}'\" >> ${env_file} &&\ - echo \"ADMIN_PASSWORD='${directus_admin_password}'\" >> ${env_file} &&\ - echo \"CORS_ENABLED='true'\" >> ${env_file} &&\ - echo \"CORS_ORIGIN='true'\" >> ${env_file} &&\ cd ${cms_folder} &&\ npm init -y &&\ npx directus bootstrap" $username -# chown -R caddy:caddy "/home/${username}/${cms_folder}" - session="directus" su -c "tmux new-session -d -s ${session} &&\ tmux send-keys -t ${session} \"cd /home/${username}/${cms_folder} && npx directus start\" C-m" $username + admin_role_uuid=$(echo $(mariadb -u directus -p${db_directus_password} -e "select id from directus.directus_roles where name='Administrator'") | awk '{print $2}') + echo -e "${PURPLE}${BOLD}${admin_role_uuid}${RESET}" + + cd "/home/${username}/${cms_folder}" + npx directus users create --email "${directus_admin_email}" --password "${directus_admin_password}" --role "${admin_role_uuid}" + caddyfile="/etc/caddy/Caddyfile" echo "cms.${domain_name} {" >> $caddyfile echo "reverse_proxy ${ip}:${port}" >> $caddyfile