home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add basic guiltcards setup.
[config]
/
bullseye
/
setup_scripts
/
setup_website.sh
diff --git
a/bullseye/setup_scripts/setup_website.sh
b/bullseye/setup_scripts/setup_website.sh
index 45a52b5a2225fc5feee77028d10f883666948c51..d2dd5e87a94ba4d16a4a199bbb8bb60adf078cad 100755
(executable)
--- a/
bullseye/setup_scripts/setup_website.sh
+++ b/
bullseye/setup_scripts/setup_website.sh
@@
-5,8
+5,8
@@
if [ "$#" -ne 4 ] && [ "$#" -ne 5 ]; then
echo 'Need domain name and mail and key ID and init state and possibly old server IP as argument.'
false
fi
echo 'Need domain name and mail and key ID and init state and possibly old server IP as argument.'
false
fi
-if [ ! "$4" = "copy" ] && [ ! "$4" = "new" ]
&& [ ! "$4" = "upgrade" ]
; then
- echo "Need init state to be either 'copy' or 'new'
or 'upgrade'
"
+if [ ! "$4" = "copy" ] && [ ! "$4" = "new" ]; then
+ echo "Need init state to be either 'copy' or 'new'
.
"
false
fi
if [ ! "$4" = "new" ] && [ "$#" -ne 5 ]; then
false
fi
if [ ! "$4" = "new" ] && [ "$#" -ne 5 ]; then
@@
-19,8
+19,6
@@
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/bullseye"
./install_for_target.sh web website
# Install configs, set up firewall.
config_tree_prefix="${HOME}/config/bullseye"
./install_for_target.sh web website
@@
-69,17
+67,14
@@
ln -s /etc/nginx/sites-available/website.nginx /etc/nginx/sites-enabled/website.
rm -rf /var/www
mkdir /var/www
chown plom:plom /var/www
rm -rf /var/www
mkdir /var/www
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 plom@core.plomlompom.com:repos/website" plom
-elif [ "${init_state}" = "new" ]; then
+if [ "${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
# Add encryption key.
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
# Add encryption key.
-keyservers='
sks-keyservers.net/ keys.gnupg.net
'
+keyservers='
keyserver.ubuntu.com pgp.surf.nl pgp.rediris.es
'
set +e
while true; do
do_break=0
set +e
while true; do
do_break=0
@@
-105,8
+100,9
@@
chown -R plom:plom "${irclogs_dir}"
mkdir -p "${irclogs_pw_dir}"
chown -R plom:plom "${irclogs_pw_dir}"
if [ "${init_state}" = "new" ]; then
mkdir -p "${irclogs_pw_dir}"
chown -R plom:plom "${irclogs_pw_dir}"
if [ "${init_state}" = "new" ]; then
- # Handle the case that the repo is in the old pre-buster server setup –
- # even then, the URL should be the same.
+ # TODO investigate whether we can get rid of anything here
+ # Handle the case that the repo is in the old pre-buster server setup –
+ # even then, the URL should be the same.
su -lc "cd /var/repos && git clone --mirror https://plomlompom.com/repos/clone/plomlombot-irc" plom
su -lc "touch /var/repos/plomlombot-irc.git/git-daemon-export-ok" plom
cp "${config_tree_prefix}/other_files/plomlombot_hook_post-receive" /var/repos/plomlombot-irc.git/hooks/post-receive
su -lc "cd /var/repos && git clone --mirror https://plomlompom.com/repos/clone/plomlombot-irc" plom
su -lc "touch /var/repos/plomlombot-irc.git/git-daemon-export-ok" plom
cp "${config_tree_prefix}/other_files/plomlombot_hook_post-receive" /var/repos/plomlombot-irc.git/hooks/post-receive
@@
-122,10
+118,13
@@
else
su -lc "./mirror_dir.sh ${old_server} /home/plom/plomlombot_db" plom
rm /home/plom/mirror_dir.sh
su -lc "scp plom@${old_server}:.plomlombot ~" plom
su -lc "./mirror_dir.sh ${old_server} /home/plom/plomlombot_db" plom
rm /home/plom/mirror_dir.sh
su -lc "scp plom@${old_server}:.plomlombot ~" plom
- su -lc "ssh plom@${old_server} \"su -lc 'service plomlombot stop'\"" plom
+
# TODO
su -lc "ssh plom@${old_server} \"su -lc 'service plomlombot stop'\"" plom
fi
fi
-systemctl enable plomlombot.service
-service plomlombot start
+# TODO systemctl enable plomlombot.service
+# TODO service plomlombot start
+
+# Set up guiltcards.
+su -lc "git clone /var/repos/guiltcards" plom
# In the above step, we might have created a root-owned /var/www/html –
# fix this here.
# In the above step, we might have created a root-owned /var/www/html –
# fix this here.