summaryrefslogtreecommitdiffstats
path: root/content/posts/WIP-org-agenda-online
diff options
context:
space:
mode:
Diffstat (limited to 'content/posts/WIP-org-agenda-online')
-rw-r--r--content/posts/WIP-org-agenda-online/index.org57
1 files changed, 57 insertions, 0 deletions
diff --git a/content/posts/WIP-org-agenda-online/index.org b/content/posts/WIP-org-agenda-online/index.org
index d6bb88d..b571517 100644
--- a/content/posts/WIP-org-agenda-online/index.org
+++ b/content/posts/WIP-org-agenda-online/index.org
@@ -18,3 +18,60 @@ use it. This isn't a deal breaker, but there were often times when I
want to check my agenda where I wasn't already in Emacs. In these
cases I had to open Emacs and pull up the agenda. This can feel a
little clunky for something I may check a dozen times every day.
+
+The solution I came up with was a way to automatically generate and
+export an HTML version of my agenda every 15 minutes on my server, in
+a place where I can see it on all my devices. They are also password
+protected so that strangers on the internet can't see my agenda.
+
+The heart of this system is a small set of scripts I wrote called
+[[https://github.com/dantecatalfamo/agenda-html][agenda-html]], which let you export a fully fontified view of the org
+agenda to HTML without having to open Emacs in a terminal. This means
+it can be easily scripted. For convenience it also has an option to
+export a text-only version.
+
+My org mode files are synchronized between my machines using a
+self-hosted [[https://nextcloud.com/][Nextcloud]] instance. This means that I have access to all
+my up to date org documents on a remote machine, which will come in
+handy very soon.
+
+To start setting up my automatically updating agenda, I first clone
+[[https://github.com/dantecatalfamo/agenda-html][agenda-html]] onto the server which hosts my Nextcloud.
+
+I set the input files to the location of the org files I want included
+inside of the Nextcloud storage directory. This would typically be
+somewhere like =/var/www/nextcloud/data/<user>/files/Org=. I set the
+output for HTML and text to be =/var/www/html/agenda/agenda.html= and
+=/var/www/html/agenda/agenda.txt= respectively.
+
+I then put the =/agenda/= path behind basic auth in =nginx=.
+
+To do this I downloaded =apache2-utils= for the =htpasswd= tool and
+used it to generate an =htpasswd= file at =/etc/nginx/htpasswd=.
+
+#+begin_src sh
+htpasswd -c /etc/nginx/htpasswd <user>
+#+end_src
+
+I then opened the site's nginx config file in my text editor and
+added this line.
+
+#+begin_src conf
+location /agenda {
+ auth_basic "Agenda Files";
+ auth_basic_user_file /etc/nginx/htpasswd;
+}
+#+end_src
+
+Then I reloaded =nginx= using the command =nginx -s reload=.
+
+Finally I edit root's crontab file to run =agenda-html.sh= every 15
+minutes, using this line.
+
+#+begin_src conf
+*/15 * * * * /root/agenda-html/agenda-html.sh
+#+end_src
+
+Now every 15 minutes the latest version of my org files are pulled
+from my Nextcloud storage and exported as an agenda, which I can
+view from any device, and even set as the new tab page in my browser.