mirror of
https://github.com/versia-pub/activitypub.git
synced 2026-03-13 02:49:17 +01:00
[feat]: initial migration
This commit is contained in:
parent
ed912004b8
commit
99304aa53a
12 changed files with 1474 additions and 243 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -5,8 +5,6 @@ use clap::Parser;
|
|||
use database::Database;
|
||||
use http::{http_get_user, http_post_user_inbox, webfinger};
|
||||
use objects::person::DbUser;
|
||||
use redis::{AsyncCommands, Client, ErrorKind, RedisError, RedisResult};
|
||||
use redis_macros::{FromRedisValue, ToRedisArgs};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
|
|
@ -64,18 +62,6 @@ async fn main() -> actix_web::Result<(), anyhow::Error> {
|
|||
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
|
||||
|
||||
let server_url = env::var("LISTEN").unwrap_or("127.0.0.1:8080".to_string());
|
||||
let redis_url = env::var("REDIS_URL").unwrap_or("redis://localhost:6379/".to_string());
|
||||
|
||||
let redis_client = redis::Client::open(redis_url)?;
|
||||
let mut con = redis_client
|
||||
.get_multiplexed_async_connection()
|
||||
.await
|
||||
.map_err(|_| {
|
||||
RedisError::from((
|
||||
ErrorKind::InvalidClientConfig,
|
||||
"Cannot connect to redis. Try starting a redis-server process or container.",
|
||||
))
|
||||
})?;
|
||||
|
||||
let local_user = DbUser::new(
|
||||
env::var("FEDERATED_DOMAIN")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue