2024-05-02 19:29:32 +02:00
|
|
|
//! The ActivityPuppy social media server.
|
|
|
|
//!
|
|
|
|
//! This crate contains the implementation of the ActivityPuppy's server binary. Also see the library,
|
|
|
|
//! [`puppy`], and the other two major components: [`store`] for persistence and [`fetch`] for the
|
|
|
|
//! federation implementation.
|
|
|
|
//!
|
|
|
|
//! [`store`]: puppy::store
|
|
|
|
//! [`fetch`]: puppy::fetch
|
2024-04-28 23:40:37 +02:00
|
|
|
#![feature(try_blocks, yeet_expr)]
|
|
|
|
|
2024-05-02 19:29:32 +02:00
|
|
|
use puppy::{config::Config, Context};
|
2024-04-28 23:40:37 +02:00
|
|
|
|
2024-05-02 19:29:32 +02:00
|
|
|
mod sig;
|
|
|
|
mod api;
|
2024-04-16 20:57:07 +02:00
|
|
|
|
2024-05-02 19:29:32 +02:00
|
|
|
/// Starts up the whole shebang.
|
2024-04-16 20:57:07 +02:00
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
2024-05-02 19:29:32 +02:00
|
|
|
// TODO: load the config from a file or something.
|
2024-04-28 23:40:37 +02:00
|
|
|
let config = Config {
|
|
|
|
ap_domain: "test.piss-on.me".to_string(),
|
|
|
|
wf_domain: "test.piss-on.me".to_string(),
|
2024-05-02 19:29:32 +02:00
|
|
|
state_dir: ".state".to_string(),
|
2024-04-28 23:40:37 +02:00
|
|
|
port: 1312,
|
|
|
|
};
|
2024-05-02 19:29:32 +02:00
|
|
|
let context = Context::load(config).unwrap();
|
|
|
|
// Start the web server
|
|
|
|
api::start(context).await.unwrap();
|
2024-04-16 20:57:07 +02:00
|
|
|
}
|