Compare commits

..

No commits in common. "cef5e8c19b2444570f88addf61ac9f9a97482422" and "676b81eca40cdae7d4362271c1d7f2faedccf803" have entirely different histories.

6 changed files with 11 additions and 45 deletions

View file

@ -1,3 +1,3 @@
[workspace]
resolver = "2"
members = ["acrate-core", "acrate-hostmeta", "acrate-inbox", "acrate-nodeinfo"]
members = ["acrate-core", "acrate-hostmeta", "acrate-nodeinfo"]

View file

@ -0,0 +1 @@
DROP TABLE nodeinfo;

View file

@ -0,0 +1,9 @@
CREATE TABLE nodeinfo (
nodeinfo_schema VARCHAR NOT NULL,
nodeinfo_href VARCHAR NOT NULL,
nodeinfo_data JSON NOT NULL,
last_updated TIMESTAMP NOT NULL,
PRIMARY KEY(nodeinfo_href)
);

View file

@ -1,12 +0,0 @@
[package]
name = "acrate-inbox"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1.0.93"
axum = "0.7.7"
log = "0.4.22"
micronfig = "0.3.0"
pretty_env_logger = "0.5.0"
tokio = { version = "1.41.1", features = ["macros", "net", "rt-multi-thread"] }

View file

@ -1,3 +0,0 @@
micronfig::config!(
ACRATE_INBOX_BIND_ADDRESS: String,
);

View file

@ -1,29 +0,0 @@
use anyhow::Context;
mod config;
#[tokio::main]
async fn main() -> anyhow::Result<std::convert::Infallible> {
pretty_env_logger::init();
log::debug!("Logging initialized!");
log::trace!("Creating Axum router...");
let app = axum::Router::new();
log::trace!("Axum router created successfully!");
log::trace!("Creating Tokio listener...");
let bind_address = config::ACRATE_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::debug!("Starting 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");
}