home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor fixes.
[config]
/
buster
/
setup_scripts
/
setup_website.sh
diff --git
a/buster/setup_scripts/setup_website.sh
b/buster/setup_scripts/setup_website.sh
index a6de75e6b013c51a9a531fecf17173dd1b8eb601..d1dc91d7b756907ebedf1aecbade35eed0812839 100755
(executable)
--- a/
buster/setup_scripts/setup_website.sh
+++ b/
buster/setup_scripts/setup_website.sh
@@
-19,6
+19,8
@@
gpg_key="$3"
init_state="$4"
old_server="$5"
init_state="$4"
old_server="$5"
+# NOTE: init_state=upgrade is for migration from older stretch server setup
+
# Install configs, set up firewall.
config_tree_prefix="${HOME}/config/buster"
./install_for_target.sh web website
# Install configs, set up firewall.
config_tree_prefix="${HOME}/config/buster"
./install_for_target.sh web website
@@
-69,17
+71,12
@@
mkdir /var/www
chown plom:plom /var/www
if [ "${init_state}" = "upgrade" ]; then
# This assumes the old core.plomlompom.com filesystem hierarchy.
chown plom:plom /var/www
if [ "${init_state}" = "upgrade" ]; then
# This assumes the old core.plomlompom.com filesystem hierarchy.
- su -lc "cd /var/repos && git clone --mirror
${old_server}
:repos/website" plom
+ su -lc "cd /var/repos && git clone --mirror
plom@core.plomlompom.com
:repos/website" plom
elif [ "${init_state}" = "new" ]; then
su -lc "cd /var/repos && git init --bare website.git" plom
fi
cp "${config_tree_prefix}/other_files/website_hook_post-receive" /var/repos/website.git/hooks/post-receive
su -lc 'cd /var/www && git clone /var/repos/website.git .' plom
elif [ "${init_state}" = "new" ]; then
su -lc "cd /var/repos && git init --bare website.git" plom
fi
cp "${config_tree_prefix}/other_files/website_hook_post-receive" /var/repos/website.git/hooks/post-receive
su -lc 'cd /var/www && git clone /var/repos/website.git .' plom
-# NOTE: There seems to be a bug that creates a root-owned /var/www/html on
-# init_state=copy for some reason, at least if website.git is an empty repo.
-# The following might fix this:
-mkdir -p /var/www/html
-chown -R plom:plom /var/www/html
# Add encryption key.
keyservers='sks-keyservers.net/ keys.gnupg.net'
# Add encryption key.
keyservers='sks-keyservers.net/ keys.gnupg.net'
@@
-127,10
+124,13
@@
else
su -lc "scp plom@${old_server}:.plomlombot ~" plom
su -lc "ssh plom@${old_server} \"su -lc 'service plomlombot stop'\"" plom
fi
su -lc "scp plom@${old_server}:.plomlombot ~" plom
su -lc "ssh plom@${old_server} \"su -lc 'service plomlombot stop'\"" plom
fi
-
systemctl enable plomlombot.service
service plomlombot start
systemctl enable plomlombot.service
service plomlombot start
+# In the above step, we might have created a root-owned /var/www/html –
+# fix this here.
+chown -R plom:plom /var/www/html
+
# TODO:
# - rename /home/plom/public_repos to /home/plom/repos
# TODO:
# - rename /home/plom/public_repos to /home/plom/repos