directus tmux et caddy 14

This commit is contained in:
Valentin 2024-02-24 21:55:20 +01:00
parent 605cefe2b0
commit 4486a57079
1 changed files with 7 additions and 7 deletions

View File

@ -256,22 +256,22 @@ if [[ "$answer" == "y" ]]; then
echo \"KEY='${key}'\" >> ${env_file} &&\
cd ${cms_folder} &&\
npm init -y &&\
npx directus bootstrap" $username
npx directus bootstrap --skipAdminInit" $username
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}"
admin_role_uuid=$(echo $(mariadb -u directus -p${db_directus_password} \
-e "select id from directus.directus_roles where name='Administrator'") | awk '{print $2}')
su -c "cd "/home/${username}/${cms_folder}" &&\
npx directus users create --email \"${directus_admin_email}\" \
--password \"${directus_admin_password}\" --role \"${admin_role_uuid}\"" $username
caddyfile="/etc/caddy/Caddyfile"
echo "cms.${domain_name} {" >> $caddyfile
echo "reverse_proxy ${ip}:${port}" >> $caddyfile
echo "log file /home/val/caddy.log" >> $caddyfile
echo "}" >> $caddyfile
caddy fmt $caddyfile -w
caddy reload -c $caddyfile