home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 18 Apr 2020 19:23:56 +0000 (21:23 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 18 Apr 2020 19:23:56 +0000 (21:23 +0200)
buster/setup_scripts/setup_website.sh

index 9394a94820b1c77342d3e1b7da9ebd8ba6c87b4f..a6de75e6b013c51a9a531fecf17173dd1b8eb601 100755 (executable)
@@ -49,7 +49,7 @@ if [ "${init_state}" = "new" ]; then
 else
   cp "${config_tree_prefix}/setup_scripts/mirror_dir.sh" /home/plom/
   chmod a+w /var
-  if ["${init_state}" = "copy" ]; then
+  if [ "${init_state}" = "copy" ]; then
     su -lc "./mirror_dir.sh ${old_server} /var/repos" plom
   else
     su -lc "./mirror_dir.sh ${old_server} /var/public_repos" plom
@@ -73,9 +73,13 @@ if [ "${init_state}" = "upgrade" ]; then
 elif [ "${init_state}" = "new" ]; then
   su -lc "cd /var/repos && git init --bare website.git" plom
 fi
-# TODO: find out whether this can be part of cloned repo …?
 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'
@@ -128,7 +132,6 @@ systemctl enable plomlombot.service
 service plomlombot start
 
 # TODO:
-# - commit git-daemon-export-ok directly into the public repos; rename
-#   /home/plom/public_repos to /home/plom/repos
+# - rename /home/plom/public_repos to /home/plom/repos
 
 service nginx restart