My Life

Top-level Files of tip
Login

Top-level Files of tip

Files in the top-level directory from the latest check-in


mylife

My Life. On the Web. In your RSS reader.

Source code hosting

The canonical location for this project's source code is http://fossil.calmabiding.me/mylife/.

Feedback

If you'd like to chat about this project, you can contact me various ways that are listed on my website (powered by this project!): https://www.calmabiding.me

Prerequisites

Usage

lein run

Testing

Run lein fulltest to check everything. This command is also executed as part of the podman image build (see below).

To get into a continuous unit testing mode, run lein test-refresh.

The SSL test is really slow. If you aren't working with it, you can run SKIP_SSL=true lein test-refresh.

Hosting

I host mylife and its supporting infrastructure (source code, etc.) alongside a few other toy projects in two different places:

mylife is hosted all by itself on a remote server running alpine, since it is completely self-sufficient. I used bin/provision to set it up and bin/update-mylife to start it up. Since I already had a database I first copied the database files over to that machine.

The server is the smallest I could get. Costs $5/mo.

Every time I publish new code I can just run bin/update-mylife to upload and start the latest podman image that I build locally using bin/package. This also packages up a custom-built fossil binary that I host on my local server.

I run nginx, fossil, and some other toy projects that have their own package scripts (you can find them in the fossil repo) using bin/start

There are a couple of files I need in my home directory before running anything above. I set them up this way:

cp infra-env.template ~/.infra-env
cp mylife-env.template ~/.mylife-env

Then I edited those files and updated appropriate domain names and IP addresses.

I also backup my blog database and everything else using a cron job that runs bin/backup-mylife-db

One more thing.. SSL. I wrote a script called bin/run-certbot that I used to set up SSL. The first time you startup nginx it will check for SSL certs in $HOME/.certbot/letsencrypt and, if it finds them, it will wire up the fossil and coffeetime servers to use SSL. Otherwise it'll just setup the .well-known/acme-challenge stuff so you can then run the bin/run-certbot script.

It defaults to doing a dry run. If the dry run succeeds, you can follow the instructions the script gives you to generate the scripts for real.

Then run bin/start-nginx

I also have a cron job that basically runs bin/run-certbot and bin/start-nginx once a day.

If you know/like Docker, it should also work. The Containerfile at the root of the project drives container construction.

Podman idiosyncrasies

Linux

I have had no serious issues with using the default Podman installation in linux (PopOS). Though, I did have to edit /etc/containers/registries.conf to add this:

unqualified-search-registries = ["docker.io"]
This wasn't necessary on the default installation of Alpine.

MacOS

I haven't figured out how to make this work. If you want to use Mac OS as a container host, you'll likely need to use Docker.

WARNING

I don't make any attempts to maintain backwards compatibility because I'm the only person I know of using this software. If you are running this thing in production, please let me know so I can change my workflow to pay attention to your needs!

License

Copyright © 2024 Stephen Starkey

This program is free software: you can redistribute it and/or modify it 
under the terms of the GNU Affero General Public License as published by 
the Free Software Foundation, either version 3 of the License, or (at your 
option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License 
for more details.

You should have received a copy of the GNU Affero General Public License 
along with this program. If not, see <https://www.gnu.org/licenses/>.