directus tmux et caddy 13
This commit is contained in:
parent
6da3674985
commit
605cefe2b0
12
install.sh
12
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
|
||||
|
|
Loading…
Reference in New Issue