Welcome

· 2.6 min read · zhrexx
developmentblogging

Welcome to my blog

This is the first & fairly short blog post on this jb instance. It describes my idea of what jb should be/look like and how it came out.

The Idea

Initially i searched for a simple & robust blogging “engine” which allows to, post and see a result without 20 years of loading and with just the bare tools (like e.g ssh) and i found a pretty good “target” called prose.sh its good and i generally like it but a free limit of 25mb across all services (pgs.sh and prose.sh) kinda made me think that its to small for a person who plans to post much & upload images & files to it. So i thought why not write my own even simpler blog “engine”, the idea could fit into 2 lines: “be a super simple blog “engine” where you put a file into the ./posts/ directory and the engine picks it up and displays it (logically after compilation)“ but it was bigger and more descriptive

jb - just blog
Goals:
- super simple
- blazingly fast
- minimalistic
- dark-theme that dont makes your eyes bleed
How it should work:
- Serve a http server at 3003
  - it should serve ./public + ./posts and a auto-generated index.html with a post index
  - ./public should be served as a static file directory that contains images, files and etc. which are/or not referenced by blog posts allowing them to include content to them
  - ./posts is a bit different, it cant be served directly since it only contains YaMk (Yaml + Markdown) files which consist of 2 things: blog post metadata like title description author date and etc and the content of the blog post (the file is like in hugo like you have the yaml block at start of the file starting with --- and ending with ---)
  - the index just lists all blog posts
- Watch the posts and compile new "incoming" files to html and add to "blog-index"
its pretty simple
User's point of view:
- drops YaMk files into the "posts" directory
- reloads page & bam it displays
What the "service" dont should handle:
- getting tls certificates
  - the "serivice" should be used behind a reverse-proxy
- be complex
What the "service" should handle/do:
- Be comfortable to use for a user
- Allow full-keyboard-based navigation
- Let's the creator just write posts drop them and the "serive" handles everything else

Self-hosting

It was pretty simple:

  1. Get jb sources, compile for release
  2. mv target/release/jb /usr/local/bin/jb
  3. mkdir /var/lib/jb && chmod 777 /var/lib/jb
  4. create a new .service file (NOTE: if your server is not on a debian-based distro change nogroup -> nobody)
[Unit]
Description=JB Service
After=network.target

[Service]
Type=simple
User=nobody
Group=nogroup
WorkingDirectory=/var/lib/jb
ExecStart=/usr/local/bin/jb
Restart=on-failure
RestartSec=2
StateDirectory=jb
NoNewPrivileges=true
PrivateTmp=true

[Install]
WantedBy=multi-user.target
  1. at last systemctl daemon-reload && systemctl enable --now jb

Now you have a jb instance running at port 3003

Notes

  • if you like jb a contribution is welcome.
  • repo

← index