-local hint="run before: ./vm_remote runit_configure nginx -- $site"
-assert "sudo getent passwd wiki-\"$site\" >/dev/null" hint
+hint="run before: remote/runit-configure nginx -- $site"
+assert "sudo test -f /etc/nginx/x509.d/\"$site\"/key.pem" hint
assert "sudo test -f ~wiki-$site/etc/ssh/id_rsa" hint
+sudo install -m 664 -o www -g www \
+ "$tool"/var/pub/x509/remorque."$local_domainname"/crt+ca.pem \
+ /etc/nginx/x509.d/"$site"/crt.pem
+
"$tool"/local/apt-get-install ikiwiki \
libsearch-xapian-perl
--disabled-login \
--disabled-password \
--group \
- --home /home/www/pub/"$site" \
+ --home /home/www/data/"$site" \
--shell /bin/false \
--system
"$tool"/local/adduser www-"$site" \
--disabled-login \
--disabled-password \
--group \
- --home /home/www/pub/"$site" \
+ --home /home/www/data/"$site" \
--shell /bin/false \
--system
sudo adduser fcgi-"$site" www-"$site"
sudo install -d -m 2770 -o wiki-"$site" -g wiki-"$site" \
/home/lhc/var/ikiwiki/remorque
-sudo install -d -m 2750 -o wiki-"$site" -g git \
- /home/git/hooks/lhc \
+sudo install -d -m 3771 -o git -g git \
+ /home/git/hooks/lhc
+sudo install -d -m 750 -o wiki-"$site" -g git \
/home/git/hooks/lhc/remorque
sudo install -m 771 -o git -g git /dev/stdin \
- /home/git/pub/lhc/remorque.git/hooks/post-update <<-EOF
+ /home/git/data/lhc/remorque.git/hooks/post-update <<-EOF
#!/bin/sh -efux
# The cd below is why we must use this script.
/home/lhc/var/ikiwiki/remorque/etc/ikiwiki.setup
sudo adduser wiki-"$site" www-"$site"
sudo install -d -m 2770 -o wiki-"$site" -g fcgi-"$site" \
- /home/www/pub/"$site"/cgi
+ /home/www/data/"$site"/cgi
cd /
sudo -u wiki-"$site" ikiwiki \
--verbose \
--setup /home/lhc/var/ikiwiki/remorque/etc/ikiwiki.setup \
--refresh \
--wrappers
+sudo chown wiki-"$site":www-"$site" \
+ /home/git/hooks/lhc/remorque/post-update.ikiwiki
+sudo chmod 6755 \
+ /home/git/hooks/lhc/remorque/post-update.ikiwiki
+
+sudo cat /etc/gitweb/gitweb.conf - <<-EOF |
+ \$export_ok = "lhc-remorque-export-ok";
+ \$favicon = "/gitweb/static/git-favicon.png";
+ \$home_link = "/";
+ \$home_link_str = 'Remorque';
+ \$home_text = "/etc/gitweb/lhc.home_text.html";
+ \$javascript = "/gitweb/static/gitweb.js";
+ \$logo = "/gitweb/static/git-logo.png";
+ \$my_uri = "/gitweb/";
+ \$my_url = "/gitweb/";
+ \$projects_list = "/etc/gitweb/lhc-remorque.projects.list";
+ \$site_footer = "/etc/gitweb/lhc.site_footer.html";
+ \$site_header = "/etc/gitweb/lhc.site_header.html";
+ \$site_name = "remorque.heureux-cyclage.org";
+ @stylesheets = ("/gitweb/static/gitweb.css");#
+ EOF
+sudo install -m 640 -o root -g fcgi-gitweb /dev/stdin \
+ /etc/gitweb/lhc-remorque.conf
+sudo install -m 640 -o root -g fcgi-gitweb \
+ "$tool"/etc/gitweb/lhc-remorque.home_text.html \
+ /etc/gitweb/lhc-remorque.home_text.html
+sudo install -m 640 -o root -g fcgi-gitweb /dev/stdin \
+ /etc/gitweb/lhc-remorque.projects.list <<-EOF
+ lhc/remorque.git
+ EOF