Skip to content

izkluxcvy/tinyap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

210 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyAP

micro-blogging software built on ActivityPub, part of the Fediverse.

NoJS, Fast, Lightweight.

Demo: @alice@tinyap.izkluxcvy.foo

Features

  • Federate with remote users
  • Create text note
  • Follow, Reply, Mention, Like, Boost, Undo them
  • Block domain
  • Tiny memory usage
  • Tiny web UI
  • Mastodon-compatible API

Memory usage

Real memory usage of tinyap.izkluxcvy.foo

$ watch -n 360 'echo $(date "+%F %T"),$(cat /sys/fs/cgroup/system.slice/tinyap.service/memory.current) >> memory.csv'

memory usage

(Note that Argon2 password hasher costs 19MB memory)

Tested clients

Requirements

  • Rust (for building from source)
  • SQLite or PostgreSQL
  • HttpS

Installation

Debian package

Download .deb package(features: sqlite, web, api) from Releases

Install TinyAP

$ sudo apt install ./tinyap_amd64.deb
$ tinyap --version

Configure and run

$ sudo vi /etc/tinyap/config.yaml
$ sudo systemctl enable --now tinyap.service

Build from source

Clone git repo.

$ git clone --depth 1 https://github.com/izkluxcvy/tinyap.git
$ cd tinyap

Create database.

$ # for SQLite
$ sqlite3 tinyap.db < schema.sql

$ # for PostgreSQL
$ psql -U postgres -c "CREATE DATABASE tinyap"
$ sed -e "s/INTEGER PRIMARY KEY AUTOINCREMENT/BIGSERIAL PRIMARY KEY/g" schema.sql | psql -U postgres -d tinyap

Configure your config.yaml.

$ vi config.yaml

Build and run

$ cargo build --release --features=sqlite,web,api

$ mv target/release/tinyap ./
$ cargo clean

$ ./tinyap --help
$ ./tinyap serve

For Linux/glibc, MALLOC_MMAP_THRESHOLD_=131072 environment variable can suppress memory fragmentation.

Build feature flags:

  • mimalloc: use mimalloc for memory allocator instead of system allocator
  • sqlite: use SQLite for DB (must be exclusive with postgres)
  • postgres: use PostgreSQL for DB
  • web: text-based tiny Web UI
  • api: mastodon-compatible API
  • tls: tinyap as a TLS termination

Config file path

You can place in ./config.yaml or /etc/tinyap/config.yaml or $TINYAP_CONFIG

$ TINYAP_CONFIG=/path/to/config.yaml ./tinyap serve

Customizing Web UI

templates/

HTML with Jinja template format.

Loaded once when server starts.

static/

Static files like style.css.

Loaded on each access to /static/xxx.xx.

About

Tiny ActivityPub Micro-blogging

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors