forked from dtaivpp/ghost-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·36 lines (28 loc) · 1.06 KB
/
bootstrap.sh
File metadata and controls
executable file
·36 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash -
# Check if root mysql password file exists and if not create and fill it.
if [[ ! -e ./secrets/MYSQL_ROOT_PASSWORD.txt ]]; then
mkdir -p secrets
openssl rand -base64 20 >> ./secrets/MYSQL_ROOT_PASSWORD.txt
fi
# Check if user mysql password file exists and if not create and fill it.
if [[ ! -e ./secrets/MYSQL_PASSWORD.txt ]]; then
openssl rand -base64 20 >> ./secrets/MYSQL_PASSWORD.txt
fi
# Create empty files for Cloudflare and SMTP password. To be filled in by the user
touch ./secrets/CLOUDFLARE_TOKEN.txt
touch ./secrets/SMTP_PASS.txt
# Create a .env file with all the necessary parameters
if [[ ! -e .env ]]; then
echo """
# Change the domain to your website or localhost if testing.
URL=<https://yourdomain.com>
# Could be any user youd like
MYSQL_USER=ghostdb
# SMTP - Mail from is an address you have permissions to mail from. Below is just a demo.
# SMTP User - Username provided by your SMTP service
MAIL_FROM=noreply@<mail.yourdomain.com>
SMTP_USER=
# Set between production and development
DEPLOYMENT=development
""" >> .env
fi