From f2c10ace7e445cd6afd0617b90d7d155c5529e54 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 4 Sep 2020 22:57:21 -0400 Subject: cgit support --- selfpublish.sh | 65 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 18 deletions(-) diff --git a/selfpublish.sh b/selfpublish.sh index 9de446c..b2bb375 100644 --- a/selfpublish.sh +++ b/selfpublish.sh @@ -52,7 +52,7 @@ control_file() cat <= 2.4.46), libssl1.1 (>= 1.1.1d), - fortune-mod, fortunes-min, curl + fortune-mod, fortunes-min, curl, cgit Description: selfpublish.sh dependency package This package depends on the dependencies of the selfpublish.sh script, and is installed by that @@ -214,7 +214,7 @@ wait_for_certificate_issuance() done } -install_apache_site() +install_apache_vhost() { if [ -e "$SITE_CONF" ] && ! force then @@ -248,6 +248,22 @@ install_self_to_site() fi } +write_cgit_config() +{ + cgit_scan_dir=$SITE_DIR/public_git/ + mkdir -p "$cgit_scan_dir" + line="scan-path=$cgit_scan_dir" + grep -xF "$line" /etc/cgitrc || printf '%s\n' "$line" >> /etc/cgitrc +} + +configure_apache_vhost() +{ + enable_apache_modules + install_self_to_site + install_header_to_site + write_cgit_config +} + install_header_to_site() { cat > "$SITE_DIR"/public_html/HEADER.html < - git repository: -
+ git repository: + + + +
git clone ssh://d@cryptonomic.net:public_html/selfpublish.sh/
- git repository browser: + git repository browser: + + +
- + upstream: https://git.cryptonomic.net/selfpublish.sh/
- this web server: -
+ + + + + this web server: + + + + - -
@@ -300,7 +330,7 @@ check_tls() curl -s -S -I https://"$1" >/dev/null } -equivocate +[ "$NO_APT" ] || equivocate APACHE_MODULES='status md rewrite ssl include cgi' APACHE_SITE_DIRS='logs public_html' @@ -320,17 +350,16 @@ esac if ! check_tls "$DOMAIN" || force then - equivocate - enable_apache_modules - install_apache_site - install_self_to_site + install_apache_vhost + configure_apache_vhost + systemctl restart apache2 wait_for_certificate_issuance "$DOMAIN" systemctl reload apache2 || systemctl restart apache2 else - enable_apache_modules - install_self_to_site - install_header_to_site + install_apache_vhost + configure_apache_vhost + systemctl reload apache2 || systemctl restart apache2 fi check_tls "$DOMAIN" -- cgit v1.2.3