https://github.com/rikhuijzer/fx
https://github.com/rikhuijzer/fx
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rikhuijzer/fx
- Owner: rikhuijzer
- License: mit
- Created: 2025-04-13T09:49:55.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-04-25T07:37:43.000Z (9 months ago)
- Last Synced: 2025-04-25T07:40:44.633Z (9 months ago)
- Language: Rust
- Homepage: https://fx.huijzer.xyz
- Size: 127 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-selfhosted - fx - Micro-blog tool offering built-in syntax highlighting, mobile publishing and more (alternative to Twitter, Bluesky). `MIT` `Docker` (Software / Blogging Platforms)
- awesome-selfhosted - fx - Micro-blog tool offering built-in syntax highlighting, mobile publishing and more (alternative to Twitter, Bluesky). `MIT` `Docker` (Software / Blogging Platforms)
- awesome-selfhosted - fx - Micro-blog tool offering built-in syntax highlighting, mobile publishing and more (alternative to Twitter, Bluesky). `MIT` `Docker` (Software / Blogging Platforms)
- awesome-selfhosted - fx - Micro-blog tool offering built-in syntax highlighting, mobile publishing and more (alternative to Twitter, Bluesky). `MIT` `Docker` (Software / Blogging Platforms)
- awesome-selfhosted - fx - Micro-blog tool offering built-in syntax highlighting, mobile publishing and more (alternative to Twitter, Bluesky). `MIT` `Docker` (Software / Blogging Platforms)
README
# fx [![build status]][actions] [![docker svg]][docker]
[build status]: https://img.shields.io/github/actions/workflow/status/rikhuijzer/fx/ci.yml?branch=main
[actions]: https://github.com/rikhuijzer/fx/actions?query=branch%3Amain
[docker svg]: https://img.shields.io/badge/docker-%230db7ed.svg?logo=docker&logoColor=white
[docker]: https://hub.docker.com/repository/docker/rikhuijzer/fx
A (micro)blogging server that you can self-host.
## Features
- 🚀 Low costs due to small footprint (only a few MB of memory are required).
- 📝 Write posts in Markdown.
- 📱 Publish and edit from mobile device.
- 📁 Upload files and images to embed them in posts.
- 🔒 Automatically backup to plain text files, see [Backup](#backup).
## Background
What made sites like Twitter nice was that it was easy to quickly write something down and later be able to find it back.
For example, say you have just read a nice blog post and want to remember it for later, you could just tweet it.
However, X (formerly Twitter) and most other social media platforms have been locking this down.
Most posts can now only be viewed when you are logged in.
Furthermore, the X algorithm also discourages adding [links in posts](https://x.com/TheBubbleBubble/status/1849818873018610090) so as a user you are incentivized to not add links.
I think this is a sad development since links are an essential part of the internet.
## Installation
Via Docker Compose:
```yml
services:
fx:
image: 'rikhuijzer/fx:main'
container_name: 'fx'
environment:
FX_USERNAME: 'john'
FX_DOMAIN: 'example.com'
env_file:
# Contains `FX_PASSWORD=""`.
- 'FX_PASSWORD.env'
ports:
- '3000:3000'
volumes:
# Stores the SQLite database.
- './data:/data:rw'
restart: 'unless-stopped'
```
## API
### Backup
You can backup your site to plain text files with the following shell script:
```bash
#!/usr/bin/env bash
set -euxo pipefail
ARCHIVE_PATH="all.tar.xz"
curl \
-H "Authorization: Bearer $FX_PASSWORD" \
https://$DOMAIN/api/download/all.tar.xz > "$ARCHIVE_PATH"
tar --verbose -xf "$ARCHIVE_PATH"
rm "$ARCHIVE_PATH"
```
where `$FX_PASSWORD` is the admin password (as set via the `FX_PASSWORD` environment variable) and `$DOMAIN` is the domain of your site (for example, `example.com`).
Assuming this file is named `backup.sh` and executable (`chmod +x backup.sh`), you can run a backup in a GitHub Actions workflow with the following YAML:
```yml
name: ci
on:
schedule:
- cron: '24 0,6,12,18 * * *'
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
backup:
permissions:
contents: write
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: ./backup.sh
env:
FX_PASSWORD: ${{ secrets.FX_PASSWORD }}
- if: github.event_name != 'pull_request'
run: |
if [ -n "$(git status --porcelain)" ]; then
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
git add .
git commit -m '[bot] backup'
git push
fi
```
This will backup your site every 6 hours.
An example backup repository is [here](https://github.com/rikhuijzer/fx-backup).
### Update
You can update the `about` text via:
```bash
curl \
-X PUT \
-H "Authorization: Bearer $FX_PASSWORD" \
https://$DOMAIN/api/settings/about \
-d "Some text"
```