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} &&\ echo \"KEY='${key}'\" >> ${env_file} &&\
cd ${cms_folder} &&\ cd ${cms_folder} &&\
npm init -y &&\ npm init -y &&\
npx directus bootstrap" $username npx directus bootstrap --skipAdminInit" $username
session="directus" session="directus"
su -c "tmux new-session -d -s ${session} &&\ su -c "tmux new-session -d -s ${session} &&\
tmux send-keys -t ${session} \"cd /home/${username}/${cms_folder} && npx directus start\" C-m" $username 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}') admin_role_uuid=$(echo $(mariadb -u directus -p${db_directus_password} \
echo -e "${PURPLE}${BOLD}${admin_role_uuid}${RESET}" -e "select id from directus.directus_roles where name='Administrator'") | awk '{print $2}')
cd "/home/${username}/${cms_folder}" su -c "cd "/home/${username}/${cms_folder}" &&\
npx directus users create --email "${directus_admin_email}" --password "${directus_admin_password}" --role "${admin_role_uuid}" npx directus users create --email \"${directus_admin_email}\" \
--password \"${directus_admin_password}\" --role \"${admin_role_uuid}\"" $username
caddyfile="/etc/caddy/Caddyfile" caddyfile="/etc/caddy/Caddyfile"
echo "cms.${domain_name} {" >> $caddyfile echo "cms.${domain_name} {" >> $caddyfile
echo "reverse_proxy ${ip}:${port}" >> $caddyfile echo "reverse_proxy ${ip}:${port}" >> $caddyfile
echo "log file /home/val/caddy.log" >> $caddyfile
echo "}" >> $caddyfile echo "}" >> $caddyfile
caddy fmt $caddyfile -w caddy fmt $caddyfile -w
caddy reload -c $caddyfile caddy reload -c $caddyfile