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

index 60e288e957a8c189da3a8a1e20df8c3e58d1c573..a119b160dc4a26a9c985ca7c71cf155a1559d786 100755 (executable)
@@ -14,4 +14,4 @@ read -p'Hit Enter when you are done.' ignore
 rm /home/plom/prepare_to_meet_server.sh
 cp "${config_tree_prefix}/setup_scripts/mirror_dir.sh" /home/plom/
 su -lc "./mirror_dir.sh ${old_server} /home/plom/borg" plom
 rm /home/plom/prepare_to_meet_server.sh
 cp "${config_tree_prefix}/setup_scripts/mirror_dir.sh" /home/plom/
 su -lc "./mirror_dir.sh ${old_server} /home/plom/borg" plom
-rm /home/plom/{prepare_to_meet_server,mirror_dir}.sh
+rm /home/plom/mirror_dir.sh
index a6de75e6b013c51a9a531fecf17173dd1b8eb601..a29bd4ab63bdb8e11660cd9615d4ea074742ad4d 100755 (executable)
@@ -75,11 +75,6 @@ elif [ "${init_state}" = "new" ]; then
 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
 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 +122,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