1
0
Fork
You've already forked website
0
No description
  • PHP 45.1%
  • JavaScript 17.4%
  • HTML 13%
  • CSS 11.4%
  • Python 8.7%
  • Other 4.4%
2026年06月20日 09:58:31 -05:00
controller add comment to honeypot functionality 2026年06月01日 14:17:11 -05:00
model refactor code to make it somewhat sensible ( #2 ) 2026年05月22日 21:03:02 +02:00
pandoc refactor code to make it somewhat sensible ( #2 ) 2026年05月22日 21:03:02 +02:00
public new update and name update 2026年06月20日 09:58:31 -05:00
site-data new update and name update 2026年06月20日 09:58:31 -05:00
sql refactor code to make it somewhat sensible ( #2 ) 2026年05月22日 21:03:02 +02:00
templates fix html error 2026年06月17日 12:47:15 -05:00
view refactor code to make it somewhat sensible ( #2 ) 2026年05月22日 21:03:02 +02:00
.gitignore add header 2024年03月17日 20:26:08 -05:00
compose.yaml fix cookie security 2026年05月20日 22:37:46 -05:00
Dockerfile refactor code to make it somewhat sensible ( #2 ) 2026年05月22日 21:03:02 +02:00
LICENSE update license and index page 2024年12月31日 13:33:45 -06:00
README.md update readme 2026年05月20日 22:38:08 -05:00

Website

"Abandon all hope, ye who enter here"

This mess of PHP spaghetti code is my personal website. You can visit it at https://jjanzen.ca. All content of the website is licensed under the MIT License.

Technology

The website is built using Docker to aid in configuration of various services needed to run the site. I place the site behind a reverse proxy using Caddy to serve requests for jjanzen.ca to the appropriate port. This is convenient for running a test instance of the site alongside the production instance (no, you can't access the test instance; it's behind a firewall).

Pages are written in Emacs Org Mode, which are converted into html using Pandoc. I also have an RSS feed for my blog posts generated by a Python script. I do not recommend using my RSS generator script. It works well enough for my needs, but it is very hacked together.

The actual site is hosted under a FrankenPHP container. Why FrankenPHP? It performs better than the PHP executable (which is really just for debug purposes anyway) and is easier to figure out with Docker than PHP-FPM. Why PHP? I really don't like JavaScript, but do want to have modular pages and interactive components. I suppose CGI scripts would work too, but PHP feels like a more sensible technology for this use case.

I had previously used Atabook as a guestbook system, but have since moved to a homemade guestbook built in PHP. Messages are stored in a PostgreSQL database. I have a simple system for approving messages to avoid losers on the Internet polluting the publicly viewable guestbook with garbage. Messages are placed into a pending state upon creation. I have a simple password-protected admin page where I can view all messages, set their approval status (or delete them), and write replies that will be displayed alongside the message. This is probably a good use-case for HTTP basic access authentication, but rolling my own felt nice and the security in my implementation is "good enough" so long as you're using HTTPS (which is enforced on my deployment). To directly interface with the database (this shouldn't ever really be necessary), I have a deployment of Adminer behind my firewall that I can use as a GUI for the PostgreSQL database when I'm connected to the same network as the server.

Deployment

Create a .env file with the following keys.

SERVER_NAME=http://jjanzen.ca # URL of the website
PORT=8080 # port the website is published on
POSGRES_PASSWORD= # password for the database
POSTGRES_VOLUME=/db_volume # location of the db files on the host machine
ADMINER_PORT=10000 # port to access db frontend
TIMEZONE=America/Winnipeg # set to the desired timezone for dates
ADMIN_PASS= # password for /admin.php
SECURE_COOKIES=true # set to false if not using https

Launch the website with docker compose up --build.