toddsundsted / ktistec

Single user ActivityPub (https://www.w3.org/TR/activitypub/) server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ktistec

Ktistec is an ActivityPub (https://www.w3.org/TR/activitypub/) server. It is intended for individual users, not farms of users, although support for additional users will be added in the future. It is designed to have few runtime dependencies -- for example, it uses SQLite as its database, instead of PostgreSQL + Redis + etc. It is licensed under the AGPLv3.

Ktistec powers Epiktistes, my low-volume home in the Fediverse. If you want to talk to me, I'm @toddsundsted@epiktistes.com.

Features

Text and images

Ktistec is intended for writing and currently supports the minimum viable set of tools for that purpose.

Text formatting options include bold, italic, strikethrough, code (inline and block), superscript/subscript, headers, blockquotes with nested indentation, and both bullet and numeric lists.

Ktistec supports inline placement of images, with ActivityPub image attachments used for compatibility with non-Ktistec servers.

Drafts posts

Meaningful writing is an iterative process so Ktistec supports draft posts. Draft posts aren't visible in your timeline until you publish them.

Threaded replies

Threaded replies make it easier to follow discussions with lots of posts.

In a distributed, federated system, it's not uncommon for threads to be incomplete. Someone you follow shares a reply to a post—you see the shared reply but not the original post. Threads with incomplete history are now noted as such, and you can fetch the missing posts from the top of the thread.

@-mention and #-hashtag autocomplete

Ktistec automatically converts @-mentions and #-hashtags into links, and to encourage hands-on-the-keyboard composition, Ktistec supports autocompletion.

Control over comment visibility

Ktistec promotes healthy dialog. Ktistec allows you to control which replies to your posts are public, and visible to anonymous users, and which are private.

Pretty URLs

Assign pretty (canonical) URLs to posts, both for SEO and as helpful mnemonics for users (and yourself).

Followers/following

The Fediverse is a distributed social network. You can follow other users on other servers from your timeline or by searching for them by name. Ktistec is also compatible with the "remote follow" protocol used by Mastodon and others.

Content discovery

In addition to following other users, you can follow threads, hashtags and even mentions. When posts arrive for content you follow, a notification is added to your notifications. Because running a single user instance can be lonely, Ktistec also proactively (and gently) fetches relevant content from other servers.

To make navigation and discovery easier, post details pages now have labels with links to internal hashtag and mention index pages.

Content filtering

Content filters prevent undesirable content from appearing in your timeline and notifications. Filter terms match on the text of a post (ignoring any markup). Wildcards are supported.

Blocking

Ktistec gives you control over what you see. Blocking authors and posts removes them and their content from your timeline.

Metrics

Ktistec tracks metrics about how the instance is performing. Right now, the only metric is inbox and outbox volume per account, but the machinery is in place to do much more.

Tasks

View currently running tasks. Tasks, in Ktistec, are background jobs that deliver content, fetch content, and perform other housekeeping chores.

Prerequisites

To run an instance of Ktistec as part of the Fediverse, you'll need a server with a fixed hostname. In the Fediverse, users are identified by (and content is addressed to) a hostname and a username.

Building

You must compile the Ktistec server executable from its source code. You will need to install a recent release of the Crystal programming language. Ktistec requires at least SQLite3 version 3.35.0 (but see notes on Sqlite3 compatibility).

To obtain the source code, clone the Ktistec Github repo.

If you intend to do development on the server, check out the main branch. In addition to Crystal, you'll also need Node.js and Webpack to build the JS and CSS assets from source.

If you just want to build and run the server, check out the dist branch.

To compile the server:

$ crystal build src/ktistec/server.cr

If you're developing on the main branch, build the assets next (skip this step if you're on the dist branch--the latest JS and CSS assets are already built for you):

$ npm run build

Run the compiled executable:

$ LOG_LEVEL=INFO ./server

The first time the server runs it will run the database migrations necessary to create the database. This should only take a few seconds, maximum. When the server is ready to accept connections you will see something like:

Ktistec is ready to lead at http://0.0.0.0:3000

You can now connect to and configure the server.

SQLite3 Compatibility

The following SQLite3 versions are known to have bugs that cause problems for Ktistec:

Ktistec Version Issue
3.39.x problems with bloom filters and recursive queries link
3.40.x problems with bloom filters and recursive queries link

Running Tests

If you change the code, you should run the tests:

$ crystal spec

Usage

The server runs on port 3000. If you're planning on running it in production, you should put Nginx or Apache in front of it. Don't forget your SSL certificate!

When you run Ktistec for the first time, you'll need to name the server and create the primary user.

Ktistec needs to know the host name of its home on the internet. The server host name is a part of every users's identity in the Fediverse. My identity is "toddsundsted@epiktistes.com". The host name is "epiktistes.com" and other federated servers, and users, know to send posts and other content to me there.

Give the server a site name, too.

After you name the server, you create the primary user. Ktistec currently supports only one user. This is intentional -- one of Ktistec's design goals is to promote a more fully distributed Fediverse.

At a minimum, you need to specify the user's username, password and timezone. You can use a single character for the username if you want, but you'll need six characters, including letters, numbers and symbols, for the password. timezone is any valid IANA time zone database string (e.g. "America/New_York").

Display name and summary are optional.

Once these steps are done, you're running!

Contributors

Copyright and License

Ktistec ActivityPub Server Copyright (C) 2021, 2022, 2023, 2024 Todd Sundsted

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/).

About

Single user ActivityPub (https://www.w3.org/TR/activitypub/) server.

License:GNU Affero General Public License v3.0


Languages

Language:Crystal 96.8%Language:JavaScript 1.4%Language:HTML 1.0%Language:Less 0.8%Language:Dockerfile 0.1%