This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will delete this post on this instance and on all federated instances, and it cannot be undone. Are you certain you want to delete this post?
This action will block this actor and hide all of their past and future posts. Are you certain you want to block this actor?
This action will block this object. Are you certain you want to block this object?
Are you sure you want to delete the OAuth client [Client Name]? This action cannot be undone and will revoke all access tokens for this client.
Are you sure you want to revoke the OAuth token [Token ID]? This action cannot be undone and will immediately revoke access for this token.
#ktistec 160 hashtags


this chart shows inbound activitypub messages to my server. over time fediverse instances seem to receive increasing numbers of messages, many not addressed to anyone on the instance, so this represents an increase in that passive traffic, replies to other people's posts, as well as announcements/boosts/shares.
n.b. you can see all of the inbound messages to your ktistec server on the /everything endpoint.

among other improvements, document how rules work.
it's now possible to customize how ktistec processes ActivityPub inbound and outbound activities without having to write crystal language and recompile the server.

i'm still making lots of small changes/improvements to ktistec: upgrading dependencies, fixing bugs, and cleaning up. i'm laying the foundation for improvements to the experience of reading posts on your ktistec instance—a reactive user interface with streaming updates/notifications, the ability to follow arbitrary collections of objects, and a timeline that can flexibly highlight content you find interesting (vs. displaying posts in chronological order). underpinning all of this is a flexible, scriptable, rule-based language for customizing the experience.

ktistec uses sqlite as its datastore. it’s a smart idea to back up the sqlite database periodically. unfortunately you can’t just copy the database file, at least while the server is running.
this article explains how to make a backup safely, and how to set up automatic, scheduled backups with cron.


dynamic rules (configurable at run time rather than compile time) will soon be merged into the main branch of ktistec. the current rules define handling of notifications (which activities result in notifications to the user) and the timeline (which activities end up in the user's timeline).
by default, posts that mention other users but not you won't show up in your timeline. but maybe you want to see them in your timeline. now you can change the rules so that you can!
rules for handling the inbox, outbox and collections in general will be coming soon...

next up on ktistec...
i'm writing a simple tdop/pratt parser for rules, now. i've done it before for other projects, with more complicated grammars, and imo they're easier to understand and extend than lr/ll parsers. douglas crockford popularized them in a post a while back—writing a javascript parser in javascript.

status update on ktistec...
commits 831dce60 to aa608699 reimplement notifications and timeline management as declarative rules rather than procedural logic. this is the culmination of work announced a while back. here's a sample of what the code looks like now:
rule "create" do
condition var("activity"), IsAddressedTo, var("actor")
condition CreateActivity, var("activity"), object: var("object")
any Mention, var("mention"), subject: var("object"), href: var("actor").iri
none Notification, owner: var("actor"), activity: var("activity")
assert Notification, owner: var("actor"), activity: var("activity")
end
rule "announce" do
condition var("activity"), IsAddressedTo, var("actor")
condition AnnounceActivity, var("activity"), object: var("object")
condition Object, var("object"), attributed_to: var("actor")
none Notification, owner: var("actor"), activity: var("activity")
assert Notification, owner: var("actor"), activity: var("activity")
end
...the first rule says, if an object (post) mentions the actor (you) and a notification doesn't already exist, create one. the second rule says, if someone announces (shares/boosts) an object (post) attributed to the actor (you) and a notification doesn't already exist, create one.
the implementation took three steps: 1) implement a simple, generic rules engine called school, 2) implement logic in ktistec to make it possible to expose the object model and records in the database as facts in the rules engine, 3) reimplement the rules. there was plenty of yak-shaving, too—the preceding ~15-20 commits were fixing things that were in the way. (my usual heuristic assumes 25% refactoring existing code and 75% developing new code, but in this case it was 75%/25% in the other direction.)
while not trivial, rules are easier to reason about than code. toward the end of the project i realized that i wasn't adding replies addressed to me to the timeline (they were only visible in a thread). i was able to fix that defect with a small modification to the rules.
the goal is to make rules modifiable by the user at runtime so that users can customize their ktistec instance without having to rebuild it. the next step toward that end is a simple rules definition language and parser.

if you're wondering what's going on with ktistec, i'm currently focused on creating a general purpose rules engine in crystal called school, and rewriting the internal logic using rules. ultimately adding/removing/changing rules will be something that users can do dynamically using a simple domain-specific language or user interface, and ktistec will become a highly customizable tool for connecting to the fediverse.

new project sunday... the school rules engine.
i'm going to rewrite all of the logic for handling fediverse activities in kistec as rules, and then expose a simple ui for managing those rules so that users can more easily customize their instance. want to change what shows up in the timeline? no problem!