Dialtone is an un-imagined Activity Pub service.
Find a file
2023-02-26 15:14:58 -05:00
dialtone a bunch of lints 2023-02-01 10:52:23 -05:00
dialtone_axum tests for c2s send to outbox 2023-02-26 15:14:58 -05:00
dialtone_bots a bunch of lints 2023-02-01 10:52:23 -05:00
dialtone_ccli_util debuging http signature. changing usage of actor use statements 2023-01-16 16:04:20 -05:00
dialtone_common support for c2s on collection handlers get and post 2023-02-12 18:55:41 -05:00
dialtone_ctrl a bunch of lints 2023-02-01 10:52:23 -05:00
dialtone_reqwest tests for c2s send to outbox 2023-02-26 15:14:58 -05:00
dialtone_sqlx tests for c2s send to outbox 2023-02-26 15:14:58 -05:00
dialtone_sqlx_macros a bunch of lints 2023-02-01 10:52:23 -05:00
dialtone_test_util a bunch of lints 2023-02-01 10:52:23 -05:00
dialtone_yew send to outbox 2023-02-24 09:37:25 -05:00
.gitignore restructuring from dt to dialtone 2022-07-02 10:47:42 -04:00
Cargo.lock work on sending activity pub 2023-02-04 11:31:25 -05:00
Cargo.toml switch from rustcrypto to openssl 2023-01-21 11:22:34 -05:00
CHANGELOG.md work on actor placard and listing 2022-07-05 15:31:01 -04:00
LICENSE-APACHE uniforming the license, README and toml files 2022-07-02 08:25:58 -04:00
LICENSE-MIT uniforming the license, README and toml files 2022-07-02 08:25:58 -04:00
Makefile.toml initial cargo make to create tgz files 2022-12-26 11:46:10 -05:00
README.md dt_ctrl can now manage the database directly 2022-12-26 17:00:37 -05:00
release.toml changelog and cargo release stuff 2022-07-03 09:31:13 -04:00

dialtone

Dialtone is an un-imagined Activity Pub system. What does "un-imagined" mean? Basically, there is no intent to silo this software into a specific vertical "marketplace". Instead, emergent use cases will be addressed.

This software is under active, initial development and is far from feature complete or ready for use.

Current release: 0.0.0

Goals

  1. Multi-tenant. A single stack should support multiple instances or sites.
  2. Multi-personality. Allow users to have multiple actors.
  3. Multi-ownership. Allow multiple users to own the same actors.
  4. Do it as much as possible in Rust. Yeah, some things may require bash scripts, but there is a certain level of ease when everything is in Rust.
  5. Let's try to stay away from nightly. Rust has been out for awhile now, it should be doable without experimental features.
  6. Should work on Raspberry Pi and other small computers so people can run instances in their homes.

Creating a Database via Docker

To create the docker pg database server:

mkdir $HOME/var
docker create --name dt_pg \
	-p 5432:5432 \
        -e "POSTGRES_USER=dt_admin" \
        -e "POSTGRES_DB=dt" \
        -e "POSTGRES_PASSWORD=supersecret" \
        -e "PGDATA=/var/lib/postgresql/data/pgdata" \
        -v $HOME/var:/var/lib/postgresql/data \
        postgres:13.1

Start the database server:

docker start dt_pg

If the need arises to connect to the database server via the Postgres CLI:

docker exec -it dt_pg psql -e -U dt_admin dt 

Install Cargo Make

cargo make is used to orchestrate complex flows.

Install it with:

cargo install --force cargo-make

Install System Tools

If you are using an Ubuntu system, you can install system tools with:

cargo make install_tools

If not, you'll need to install your systems equivalents of pkg-config, libssl-dev, and tar. Additionally, you'll need to explicitly run the cargo make install_tools command in the 'dialtone_yew' directory.

Build and Run Tests

To build and run tests, use the default 'cargo make' makefile:

cargo make

Dialtone Server Configuration

Dialtone server configuration is set via environment variables. For ease of use, environment variables are also read from a .env file in the current directory or any parent directory of the current directory.

Create an .env file in the current directory or a parent directory like such:

# Rust logging level
RUST_LOG="dialtone_axum=trace,tower_http=trace,sqlx=debug" 

# Postgres database URL
DATABASE_URL=postgres://dt_admin:supersecret@localhost/dt 

# JWT Secret
JWT_SECRET=secret

# Directory where media is stored.
MEDIA=/home/YOURDIR/var/dialtone/media

# Base for local media.
LOCAL_MEDIA_BASE="file:///home/YOURDIR/var/dialtone/media" 

# Log SQL statements. Set to true for debugging DB problems.
LOG_STATEMENTS=false

Initialize Database

Create the Postgres database on the Postgres server:

cargo run --bin dt_ctrl database create

Create the schema:

cargo run --bin dt_ctrl database migrate

Create a Test Site

Once a database is setup and the schema is created (see above), you can create a site by running the following command and answering all the questions:

cargo run --bin dt_ctrl site create

Then, start the server (in the foreground):

cargo run --bin dt_server

View Site Locally

To view a local site (perhaps for development purposes), execute the following in a seperate terminal:

cd dialtone_yew
trunk serve --open

Local Image Loading

To use the LOCAL_MEDIA_BASE override in the environment variables for local development, your browser will need to be configured for access to local resources. For Firefox, this can be done in the About:Config page with the following settings:

"capability.policy.policynames" => "localfilelinks"
"capability.policy.localfilelinks.sites" => "http://127.0.0.1:8080"
"capability.policy.localfilelinks.checkloaduri.enabled" => "allAccess"

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.