-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure-instance.sh
executable file
·56 lines (46 loc) · 1.35 KB
/
configure-instance.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
set -e
set -x
pushd /srv/phabricator/phabricator
if [ -e /config/script.pre ]; then
echo "Applying pre-configuration script..."
/config/script.pre
else
echo "+++++ MISSING CONFIGURATION +++++"
echo ""
echo "You must specify a preconfiguration script for "
echo "this Docker image. To do so: "
echo ""
echo " 1) Create a 'script.pre' file in a directory "
echo " called 'config', somewhere on the host. "
echo ""
echo " 2) Run this Docker instance again with "
echo " -v path/to/config:/config passed as an "
echo " argument."
echo ""
echo "+++++ BOOT FAILED! +++++"
exit 1
fi
./bin/config set phd.user phab-daemon
./bin/config set diffusion.ssh-user git
popd
pushd /srv/phabricator/phabricator
if [ -e /config/authorized_keys ]; then
echo "Copying authorized_keys file into place"
mkdir -p /root/.ssh/
cp /config/authorized_keys /root/.ssh/
chmod 600 /root/.ssh/authorized_keys
fi
if [ -e /config/script.post ]; then
echo "Applying post-configuration script..."
/config/script.post
fi
if [ -e /config/cert.pem ]; then
if [ -e /config/cert.key ]; then
echo "Enabling SSL due to presence of certificates!"
cp /etc/nginx/nginx-ssl.conf.org /etc/nginx/nginx.conf
fi
else
cp /etc/nginx/nginx.conf.org /etc/nginx/nginx.conf
fi
popd