-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlivedemo_setup.sh
36 lines (33 loc) · 1.19 KB
/
livedemo_setup.sh
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
# Prepare
cp -r p_example p
cp .env.example .env
# set your own config & secrets
# vim .env
# for example
sed -i.bak "s|^COOKIE_SECRET=.*|COOKIE_SECRET=\"$(openssl rand -base64 32)\"|" .env
sed -i.bak 's|^ADMIN_PASSWORD=.*|ADMIN_PASSWORD=\"SilentPress\"|' .env
sed -i.bak 's/^PORT=.*/PORT=8082/' .env
# Install dependencies
(cd silent && git stash -u)
git submodule update --init --recursive
(cd silent && git apply ../silent.patch)
go mod download
# Add a cron job to recover ./p contents
# How to create a cron job using Bash automatically without the interactive editor?
# https://stackoverflow.com/questions/878600/how-to-create-a-cron-job-using-bash-automatically-without-the-interactive-editor
(crontab -l ; echo "*/3 * * * * cd ~/m/i/silentpress && cp -r p_example/** p/") | crontab -
# Cron line explaination
# * * * * * "command to be executed"
# - - - - -
# | | | | |
# | | | | ----- Day of week (0 - 7) (Sunday=0 or 7)
# | | | ------- Month (1 - 12)
# | | --------- Day of month (1 - 31)
# | ----------- Hour (0 - 23)
# ------------- Minute (0 - 59)
# Start or restart later..
gspp
(cd silent && git stash -u)
git submodule update --init --recursive
(cd silent && git apply ../silent.patch)
./pm2.sh