Compare commits
No commits in common. "5a746dd7b24db22b7538d985af6cde19ba245e3d" and "b0bb31bba0cd32ba2efedb9f2ca39998b2c5e818" have entirely different histories.
5a746dd7b2
...
b0bb31bba0
9 changed files with 4 additions and 71 deletions
|
@ -11,7 +11,6 @@
|
|||
<sourceFolder url="file://$MODULE_DIR$/acrate_rd/tests" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/acrate_mime/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/acrate_rdserver/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/acrate_apub_inbox/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/acrate_database/tests" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["acrate_database", "acrate_rd", "acrate_nodeinfo", "acrate_rdserver", "acrate_apub_inbox"]
|
||||
members = ["acrate_database", "acrate_rd", "acrate_nodeinfo", "acrate_rdserver"]
|
||||
|
|
|
@ -27,7 +27,6 @@ Federation database
|
|||
### Binaries
|
||||
|
||||
- `acrate_rdserver`: Resource descriptor web server
|
||||
- `acrate_apub_inbox`: ActivityPub inbox web server
|
||||
|
||||
### Extra
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
[package]
|
||||
name = "acrate_apub_inbox"
|
||||
version = "0.3.0"
|
||||
authors = ["Stefano Pigozzi <me@steffo.eu>"]
|
||||
edition = "2021"
|
||||
description = "ActivityPub inbox web server for the acrate project"
|
||||
repository = "https://forge.steffo.eu/unimore/tirocinio-canali-steffo-acrate"
|
||||
license = "EUPL-1.2"
|
||||
keywords = ["activitypub", "apub", "federation"]
|
||||
categories = ["web-programming"]
|
||||
|
||||
[dependencies]
|
||||
acrate_database = { path = "../acrate_database", features = ["connect"] }
|
||||
anyhow = "1.0.93"
|
||||
axum = { version = "0.7.7", features = ["macros"] }
|
||||
log = { version = "0.4.22", features = ["std", "max_level_trace", "release_max_level_debug"] }
|
||||
micronfig = "0.3.0"
|
||||
minijinja = "2.5.0"
|
||||
pretty_env_logger = "0.5.0"
|
||||
serde = { version = "1.0.215", features = ["derive"] }
|
||||
serde_json = "1.0.132"
|
||||
tokio = { version = "1.41.1", features = ["macros", "net", "rt-multi-thread"] }
|
||||
mediatype = { version = "0.19.18", features = ["serde"] }
|
||||
|
||||
[lints.clippy]
|
||||
tabs-in-doc-comments = "allow"
|
|
@ -1,3 +0,0 @@
|
|||
micronfig::config!(
|
||||
ACRATE_APUB_INBOX_BIND_ADDRESS: String,
|
||||
);
|
|
@ -1,36 +0,0 @@
|
|||
use std::sync::Arc;
|
||||
use anyhow::Context;
|
||||
use axum::Extension;
|
||||
|
||||
mod config;
|
||||
mod route;
|
||||
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<std::convert::Infallible> {
|
||||
pretty_env_logger::init();
|
||||
log::debug!("Logging initialized!");
|
||||
|
||||
log::trace!("Creating Minijinja environment...");
|
||||
let mut mj = minijinja::Environment::<'static>::new();
|
||||
|
||||
log::trace!("Creating Axum router...");
|
||||
let app = axum::Router::new()
|
||||
.layer(Extension(Arc::new(mj)));
|
||||
log::trace!("Axum router created successfully!");
|
||||
|
||||
log::trace!("Creating Tokio listener...");
|
||||
let bind_address = config::ACRATE_APUB_INBOX_BIND_ADDRESS();
|
||||
let listener = tokio::net::TcpListener::bind(bind_address)
|
||||
.await
|
||||
.context("failed to bind listener to address")?;
|
||||
log::trace!("Tokio listener bound to: {bind_address}");
|
||||
|
||||
log::info!("Starting apub_inbox web server...");
|
||||
axum::serve(listener, app)
|
||||
.await
|
||||
.context("server exited with error")?;
|
||||
|
||||
log::error!("Server exited with no error, panicking.");
|
||||
panic!("server exited with no error");
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
micronfig::config!(
|
||||
ACRATE_RDSERVER_BIND_ADDRESS: String,
|
||||
ACRATE_WEBFINGER_BIND_ADDRESS: String,
|
||||
);
|
||||
|
|
|
@ -26,13 +26,13 @@ async fn main() -> anyhow::Result<std::convert::Infallible> {
|
|||
log::trace!("Axum router created successfully!");
|
||||
|
||||
log::trace!("Creating Tokio listener...");
|
||||
let bind_address = config::ACRATE_RDSERVER_BIND_ADDRESS();
|
||||
let bind_address = config::ACRATE_WEBFINGER_BIND_ADDRESS();
|
||||
let listener = tokio::net::TcpListener::bind(bind_address)
|
||||
.await
|
||||
.context("failed to bind listener to address")?;
|
||||
log::trace!("Tokio listener bound to: {bind_address}");
|
||||
|
||||
log::info!("Starting rdserver web server...");
|
||||
log::info!("Starting server...");
|
||||
axum::serve(listener, app)
|
||||
.await
|
||||
.context("server exited with error")?;
|
||||
|
|
Loading…
Reference in a new issue