A simple orgmode HTTP server written with Tornado
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Macoy Madson d1aa2a29d9 Update code styles 4 years ago
content Updated styles, added home functionality 4 years ago
renderedContent Output rendered content to separate folder 5 years ago
templates Added first pass code styling, content type 4 years ago
webResources Update code styles 4 years ago
.gitignore Initial commit 5 years ago
ContentConverter.py Added metadata and date sorting, updated readme 4 years ago
Generate_Certificates.sh Use 2048 bit RSA keys for OpenSSL 1.1.1 4 years ago
LICENSE Initial commit 5 years ago
ReadMe.org Added metadata and date sorting, updated readme 4 years ago
RedirectToHttpsServer.py Added HTTPS Redirect server 4 years ago
SimpleBlogServer.py Added date to blog post, styles adjustments 4 years ago
WordPressXmlToOrgMode.py Added wordpress XML to HTML converter 5 years ago


Simple Org Blog

This project is meant to be a quick-and-dirty blog based on org-mode formatted documents.

You can put your .org files in content/ and it will be rendered into renderedContent within fifteen minutes, or immediately after starting the server.



This project requires Python 3.

1. Install Python dependencies

The server is powered by tornado. I use orgparse to parse org document properties. pandoc is used for converting org files into html files.

  pip3 install tornado orgparse

2. Install pandoc

How to install Pandoc.

For Ubuntu:

  sudo apt install pandoc

This will be used to convert .org files into .html.

3. Generate SSL keys

  openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout certificates/server_jupyter_based.crt.key -out certificates/server_jupyter_based.crt.pem

If you have a domain name, you should use Certbot to generate your certificates. These won't pop the security warning like the self-signing ones will.

4. Run the server

python3 SimpleBlogServer.py

If you want to redirect all HTTP visits to the blog server (which is HTTPS only), also run the redirect server:

python3 RedirectToHttpsServer.py

5. Trust the certificate

Open your browser and visit https://localhost:8888.

Your web browser should complain that the website's owner cannot be verified. This is a security measure for SSL related to the certificate. Because we made the certificate ourselves, the browser doesn't know whether to trust the certificate, because there is no signing authority.

You can safely click Advanced and add the certificate as trustworthy, because you've signed the certificate and trust yourself :).

If you want to get rid of this, you'll need to get a signing authority like LetsEncrypt to generate your certificate.

Deploying on the internet

I used Amazon AWS Lightsail to host this server for my personal blog:

  1. Create an Ubuntu machine. I used the lowest spec ($3.50/month option) because I don't expect much traffic

  2. Open up port 80 and 443 in the Lightsail Network configuration page

  3. Use the Amazon SSH stuff to start setting up the machine

  4. sudo apt update && sudo apt upgrade is necessary to install Python and such

  5. Use Certbot to generate certificates

  6. Modify SimpleBlogServer port to be port 443 (HTTPS default)

  7. Follow the /code/macoy/simple-org-blog/src/commit/d1aa2a29d99f51907b84b46f705846d7310927ec/Setup section normally

  8. Use SCP to copy content from local machine into Amazon content/