make radicale setup vpned
authorIan Kelling <ian@iankelling.org>
Mon, 3 Apr 2017 03:55:09 +0000 (20:55 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 3 Apr 2017 03:55:09 +0000 (20:55 -0700)
distro-end
radicale-setup

index 202f85fee2c6ea401a23a872715fa884bf9051de..dde7a1026206449daf0f6affa9828b9424e3e84d 100755 (executable)
@@ -299,6 +299,24 @@ EOF
         acme-tiny-wrapper mail.iankelling.org
         sgo openvpn
         tu /etc/hosts <<<"10.8.0.4 mail.iankelling.org"
+        domain=cal.iankelling.org
+        acme-tiny-wrapper $domain
+        apache-site -f 10.8.0.4:5232 - $domain <<'EOF'
+#https://httpd.apache.org/docs/2.4/mod/mod_authn_core.html#authtype
+        <Directory "/var/www/cal.iankelling.org/html">
+                Options +FollowSymLinks +Multiviews +Indexes
+                AllowOverride None
+                AuthType basic
+                AuthName "Authentication Required"
+                # setup one time, with root:www-data, 640
+                AuthUserFile "/etc/caldav-htpasswd"
+                Require valid-user
+        </Directory>
+EOF
+        # nginx version of above would be:
+        # auth_basic "Not currently available";
+        # auth_basic_user_file /etc/nginx/caldav/htpasswd;
+
 
 
         echo "$0: $(date): ending now)"
index 826ddb92f91b9940afad82a72f914318868477c7..a2cbbd8163507bfc2e49e69ff8fe185c886fd7b2 100755 (executable)
@@ -2,6 +2,7 @@
 
 [[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
 
+
 # davdroid setup instructions at the bottom
 
 # main docs:
@@ -22,17 +23,9 @@ pi nginx python-dulwich radicale
 # after it gets created, per the git docs.
 lnf -T /o/radicale /var/lib/radicale
 
-acme-tiny -n cal.iank.pw
-
 # from https://www.williamjbowman.com/blog/2015/07/24/setting-up-webdav-caldav-and-carddav-servers/
-mkdir /etc/nginx/caldav
-touch /etc/nginx/caldav/htpasswd
-chmod 640 /etc/nginx/caldav/htpasswd
-chgrp www-data /etc/nginx/caldav/htpasswd
-nginx-site -f 5232 - cal.iank.pw <<'EOF'
-    auth_basic "Not currently available";
-    auth_basic_user_file /etc/nginx/caldav/htpasswd;
-EOF
+
+# more config is for li in distro-end
 
 # coment in this file says this is needed for it to run on startup
 sed -ri 's/^\s*#+\s*(ENABLE_RADICALE\s*=\s*yes\s*)/\1/' /etc/default/radicale
@@ -45,7 +38,7 @@ setini() {
 }
 
 # comments say default is 0.0.0.0:5232
-setini hosts 127.0.0.1:5232 server
+setini hosts 10.8.0.1:5232 server
 
 # davdroid from f-droid. username ian,
 # url https://iank.pw/radicale/ian.