Giter Club home page Giter Club logo

pkb's Introduction

pkb โ€” Personal Knowledge Base

pkb is a small Rust application that allows you to efficiently publish a collection of Markdown files. I run my instance at linkedlist.org.

Build Status

Configuration

  • Copy the Rocket.sample.toml file to Rocket.toml and fill in your own details
  • Link the directory with your Markdown files in it. E.g. ln -s ~/Dropbox/My\ Markdown\ Files pages
  • Start the server, cargo run and visit http://127.0.0.1:8000/pages
  • You should create Markdown file called home.md. This file will be shown as the homepage: http://127.0.0.1:8000

Deployment

  1. Build a release binary: cargo build --release --locked, it will be created at target/release/pkb.
  2. Copy the binary, public directory, and your Rocket.toml to your server (this assumes your build machine and server are binary compatible).

History

pkb was originally implemented in 2015 as a Ruby on Rails application. The ruby branch contains the code before it was rewritten in Rust in 2022.

pkb's People

Contributors

dependabot[bot] avatar wezm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pkb's Issues

missing field `pages_path`

I cloned the repo, copied Rocket.sample.toml to Rocket.toml, created a folder called pages with a file called home.md and ran cargo run.

After compilation I got:

Error: Failed to extract valid configuration.
   >> missing field `pages_path`
thread 'main' panicked at src/web.rs:81:47:
no settings in state

Did I do something incorrectly?

$ rustc -vV
rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 17.0.6

Rewrite in Rust

Rails 5 (which pkb currently uses) does not support Ruby 3 and newer releases of Alpine Linux, which host the site have moved to 3.x. Constantly chasing upgrades for a site that should largely just sit there and do its thing is a waste of my time. At some point I want to rebuild the site in Rust since Rust applications largely continue to build with newer versions of the compiler due to a commitment to stability.

Smarter handling of Last-Modified

Currently (in the Rust version) the Last-Modified header is set to the mtime of the document. A failure mode here is if a new version of the application is deployed that alters the way pages are rendered requests with If-Modified-Since will still be considered fresh. Seems like Last-Modified should be set to max(page_mtime, build_date) where build date is a timestamp set when the binary was compiled.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.