Rename to Fedimovies

This commit is contained in:
Rafael Caricio 2023-04-25 15:49:35 +02:00
parent 17d8c11726
commit b7fafe6458
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947
244 changed files with 494 additions and 758 deletions

230
Cargo.lock generated
View file

@ -930,6 +930,121 @@ dependencies = [
"instant", "instant",
] ]
[[package]]
name = "fedimovies"
version = "1.22.0"
dependencies = [
"actix-cors",
"actix-files",
"actix-web",
"actix-web-httpauth",
"anyhow",
"base64 0.13.1",
"blake2",
"chrono",
"ed25519",
"ed25519-dalek",
"env_logger",
"fedimovies-config",
"fedimovies-models",
"fedimovies-utils",
"hex",
"log",
"num_cpus",
"regex",
"reqwest",
"rsa",
"serde",
"serde_json",
"serial_test",
"sha2 0.9.9",
"siwe",
"thiserror",
"tokio",
"url 2.3.1",
"uuid",
]
[[package]]
name = "fedimovies-cli"
version = "1.22.0"
dependencies = [
"anyhow",
"clap",
"fedimovies",
"fedimovies-config",
"fedimovies-models",
"fedimovies-utils",
"log",
"tokio",
"uuid",
]
[[package]]
name = "fedimovies-config"
version = "1.22.0"
dependencies = [
"dotenv",
"fedimovies-utils",
"log",
"regex",
"rsa",
"serde",
"serde_yaml",
"thiserror",
"url 2.3.1",
]
[[package]]
name = "fedimovies-models"
version = "1.22.0"
dependencies = [
"chrono",
"deadpool",
"deadpool-postgres",
"fedimovies-utils",
"hex",
"log",
"postgres-protocol",
"postgres-types",
"postgres_query",
"postgres_query_macro",
"refinery",
"serde",
"serde_json",
"serial_test",
"thiserror",
"tokio",
"tokio-postgres",
"uuid",
]
[[package]]
name = "fedimovies-utils"
version = "1.22.0"
dependencies = [
"ammonia",
"base64 0.13.1",
"bs58",
"chrono",
"comrak",
"mime-sniffer",
"mime_guess",
"pem",
"rand 0.8.5",
"regex",
"rsa",
"rust-argon2",
"serde",
"serde_jcs",
"serde_json",
"sha2 0.9.9",
"thiserror",
"ulid",
"url 2.3.1",
"uuid",
]
[[package]] [[package]]
name = "ff" name = "ff"
version = "0.10.1" version = "0.10.1"
@ -1608,121 +1723,6 @@ dependencies = [
"windows-sys 0.45.0", "windows-sys 0.45.0",
] ]
[[package]]
name = "mitra"
version = "1.22.0"
dependencies = [
"actix-cors",
"actix-files",
"actix-web",
"actix-web-httpauth",
"anyhow",
"base64 0.13.1",
"blake2",
"chrono",
"ed25519",
"ed25519-dalek",
"env_logger",
"hex",
"log",
"mitra-config",
"mitra-models",
"mitra-utils",
"num_cpus",
"regex",
"reqwest",
"rsa",
"serde",
"serde_json",
"serial_test",
"sha2 0.9.9",
"siwe",
"thiserror",
"tokio",
"url 2.3.1",
"uuid",
]
[[package]]
name = "mitra-cli"
version = "1.22.0"
dependencies = [
"anyhow",
"clap",
"log",
"mitra",
"mitra-config",
"mitra-models",
"mitra-utils",
"tokio",
"uuid",
]
[[package]]
name = "mitra-config"
version = "1.22.0"
dependencies = [
"dotenv",
"log",
"mitra-utils",
"regex",
"rsa",
"serde",
"serde_yaml",
"thiserror",
"url 2.3.1",
]
[[package]]
name = "mitra-models"
version = "1.22.0"
dependencies = [
"chrono",
"deadpool",
"deadpool-postgres",
"hex",
"log",
"mitra-utils",
"postgres-protocol",
"postgres-types",
"postgres_query",
"postgres_query_macro",
"refinery",
"serde",
"serde_json",
"serial_test",
"thiserror",
"tokio",
"tokio-postgres",
"uuid",
]
[[package]]
name = "mitra-utils"
version = "1.22.0"
dependencies = [
"ammonia",
"base64 0.13.1",
"bs58",
"chrono",
"comrak",
"mime-sniffer",
"mime_guess",
"pem",
"rand 0.8.5",
"regex",
"rsa",
"rust-argon2",
"serde",
"serde_jcs",
"serde_json",
"sha2 0.9.9",
"thiserror",
"ulid",
"url 2.3.1",
"uuid",
]
[[package]] [[package]]
name = "native-tls" name = "native-tls"
version = "0.2.11" version = "0.2.11"

View file

@ -1,34 +1,34 @@
[package] [package]
name = "mitra" name = "fedimovies"
version = "1.22.0" version = "1.22.0"
description = "Federated micro-blogging platform and content subscription service" description = "Movies reviews and ratings for the fediverse"
license = "AGPL-3.0" license = "AGPL-3.0"
edition = "2021" edition = "2021"
rust-version = "1.68" rust-version = "1.68"
publish = false publish = false
default-run = "mitra" default-run = "fedimovies"
[workspace] [workspace]
members = [ members = [
".", ".",
"mitra-cli", "fedimovies-cli",
"mitra-config", "fedimovies-config",
"mitra-models", "fedimovies-models",
"mitra-utils", "fedimovies-utils",
] ]
default-members = [ default-members = [
".", ".",
"mitra-cli", "fedimovies-cli",
"mitra-config", "fedimovies-config",
"mitra-models", "fedimovies-models",
"mitra-utils", "fedimovies-utils",
] ]
[dependencies] [dependencies]
mitra-config = { path = "mitra-config" } fedimovies-config = { path = "fedimovies-config" }
mitra-models = { path = "mitra-models" } fedimovies-models = { path = "fedimovies-models" }
mitra-utils = { path = "mitra-utils" } fedimovies-utils = { path = "fedimovies-utils" }
# Used to handle incoming HTTP requests # Used to handle incoming HTTP requests
actix-cors = "0.6.4" actix-cors = "0.6.4"
@ -75,11 +75,11 @@ url = "2.2.2"
uuid = { version = "1.1.2", features = ["serde", "v4"] } uuid = { version = "1.1.2", features = ["serde", "v4"] }
[dev-dependencies] [dev-dependencies]
mitra-config = { path = "mitra-config", features = ["test-utils"] } fedimovies-config = { path = "fedimovies-config", features = ["test-utils"] }
mitra-models = { path = "mitra-models", features = ["test-utils"] } fedimovies-models = { path = "fedimovies-models", features = ["test-utils"] }
mitra-utils = { path = "mitra-utils", features = ["test-utils"] } fedimovies-utils = { path = "fedimovies-utils", features = ["test-utils"] }
serial_test = "0.7.0" serial_test = "0.7.0"
[features] [features]
production = ["mitra-config/production"] production = ["fedimovies-config/production"]

View file

@ -1,5 +1,5 @@
[package] [package]
name = "mitra-cli" name = "fedimovies-cli"
version = "1.22.0" version = "1.22.0"
license = "AGPL-3.0" license = "AGPL-3.0"
edition = "2021" edition = "2021"
@ -10,10 +10,10 @@ name = "mitractl"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]
mitra-config = { path = "../mitra-config" } fedimovies-config = { path = "../fedimovies-config" }
mitra-models = { path = "../mitra-models" } fedimovies-models = { path = "../fedimovies-models" }
mitra-utils = { path = "../mitra-utils" } fedimovies-utils = { path = "../fedimovies-utils" }
mitra = { path = ".." } fedimovies = { path = ".." }
# Used for catching errors # Used for catching errors
anyhow = "1.0.58" anyhow = "1.0.58"

View file

@ -2,16 +2,16 @@ use anyhow::Error;
use clap::Parser; use clap::Parser;
use uuid::Uuid; use uuid::Uuid;
use mitra::activitypub::{ use fedimovies::activitypub::{
actors::helpers::update_remote_profile, builders::delete_note::prepare_delete_note, actors::helpers::update_remote_profile, builders::delete_note::prepare_delete_note,
builders::delete_person::prepare_delete_person, fetcher::fetchers::fetch_actor, builders::delete_person::prepare_delete_person, fetcher::fetchers::fetch_actor,
fetcher::helpers::import_from_outbox, fetcher::helpers::import_from_outbox,
}; };
use mitra::admin::roles::{role_from_str, ALLOWED_ROLES}; use fedimovies::admin::roles::{role_from_str, ALLOWED_ROLES};
use mitra::media::{remove_files, remove_media, MediaStorage}; use fedimovies::media::{remove_files, remove_media, MediaStorage};
use mitra::validators::{emojis::EMOJI_LOCAL_MAX_SIZE, users::validate_local_username}; use fedimovies::validators::{emojis::EMOJI_LOCAL_MAX_SIZE, users::validate_local_username};
use mitra_config::Config; use fedimovies_config::Config;
use mitra_models::{ use fedimovies_models::{
attachments::queries::delete_unused_attachments, attachments::queries::delete_unused_attachments,
cleanup::find_orphaned_files, cleanup::find_orphaned_files,
database::DatabaseClient, database::DatabaseClient,
@ -32,7 +32,7 @@ use mitra_models::{
}, },
users::types::UserCreateData, users::types::UserCreateData,
}; };
use mitra_utils::{ use fedimovies_utils::{
crypto_rsa::{generate_rsa_key, serialize_private_key}, crypto_rsa::{generate_rsa_key, serialize_private_key},
datetime::{days_before_now, get_min_datetime}, datetime::{days_before_now, get_min_datetime},
passwords::hash_password, passwords::hash_password,

View file

@ -1,9 +1,9 @@
use clap::Parser; use clap::Parser;
use mitra::logger::configure_logger; use fedimovies::logger::configure_logger;
use mitra_config::parse_config; use fedimovies_config::parse_config;
use mitra_models::database::create_database_client; use fedimovies_models::database::create_database_client;
use mitra_models::database::migrate::apply_migrations; use fedimovies_models::database::migrate::apply_migrations;
mod cli; mod cli;
use cli::{Opts, SubCommand}; use cli::{Opts, SubCommand};

View file

@ -1,12 +1,12 @@
[package] [package]
name = "mitra-config" name = "fedimovies-config"
version = "1.22.0" version = "1.22.0"
license = "AGPL-3.0" license = "AGPL-3.0"
edition = "2021" edition = "2021"
rust-version = "1.68" rust-version = "1.68"
[dependencies] [dependencies]
mitra-utils = { path = "../mitra-utils" } fedimovies-utils = { path = "../fedimovies-utils" }
# Used to read .env files # Used to read .env files
dotenv = "0.15.0" dotenv = "0.15.0"

View file

@ -5,7 +5,7 @@ use rsa::RsaPrivateKey;
use serde::Deserialize; use serde::Deserialize;
use url::Url; use url::Url;
use mitra_utils::urls::normalize_url; use fedimovies_utils::urls::normalize_url;
use super::environment::Environment; use super::environment::Environment;
use super::federation::FederationConfig; use super::federation::FederationConfig;
@ -156,7 +156,7 @@ impl Instance {
#[cfg(feature = "test-utils")] #[cfg(feature = "test-utils")]
impl Instance { impl Instance {
pub fn for_test(url: &str) -> Self { pub fn for_test(url: &str) -> Self {
use mitra_utils::crypto_rsa::generate_weak_rsa_key; use fedimovies_utils::crypto_rsa::generate_weak_rsa_key;
Self { Self {
_url: Url::parse(url).unwrap(), _url: Url::parse(url).unwrap(),
actor_key: generate_weak_rsa_key().unwrap(), actor_key: generate_weak_rsa_key().unwrap(),
@ -173,7 +173,7 @@ impl Instance {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use mitra_utils::crypto_rsa::generate_weak_rsa_key; use fedimovies_utils::crypto_rsa::generate_weak_rsa_key;
#[test] #[test]
fn test_instance_url_https_dns() { fn test_instance_url_https_dns() {

View file

@ -4,7 +4,7 @@ use std::str::FromStr;
use rsa::RsaPrivateKey; use rsa::RsaPrivateKey;
use mitra_utils::{ use fedimovies_utils::{
crypto_rsa::{deserialize_private_key, generate_rsa_key, serialize_private_key}, crypto_rsa::{deserialize_private_key, generate_rsa_key, serialize_private_key},
files::{set_file_permissions, write_file}, files::{set_file_permissions, write_file},
}; };
@ -19,7 +19,7 @@ struct EnvConfig {
} }
#[cfg(feature = "production")] #[cfg(feature = "production")]
const DEFAULT_CONFIG_PATH: &str = "/etc/mitra/config.yaml"; const DEFAULT_CONFIG_PATH: &str = "/etc/fedimovies/config.yaml";
#[cfg(not(feature = "production"))] #[cfg(not(feature = "production"))]
const DEFAULT_CONFIG_PATH: &str = "config.yaml"; const DEFAULT_CONFIG_PATH: &str = "config.yaml";

View file

@ -1,12 +1,12 @@
[package] [package]
name = "mitra-models" name = "fedimovies-models"
version = "1.22.0" version = "1.22.0"
license = "AGPL-3.0" license = "AGPL-3.0"
edition = "2021" edition = "2021"
rust-version = "1.68" rust-version = "1.68"
[dependencies] [dependencies]
mitra-utils = { path = "../mitra-utils" } fedimovies-utils = { path = "../fedimovies-utils" }
# Used for working with dates # Used for working with dates
chrono = { version = "0.4.23", default-features = false, features = ["std", "serde"] } chrono = { version = "0.4.23", default-features = false, features = ["std", "serde"] }
@ -37,7 +37,7 @@ postgres_query_macro = { git = "https://github.com/nolanderc/rust-postgres-query
uuid = { version = "1.1.2", features = ["serde", "v4"] } uuid = { version = "1.1.2", features = ["serde", "v4"] }
[dev-dependencies] [dev-dependencies]
mitra-utils = { path = "../mitra-utils", features = ["test-utils"] } fedimovies-utils = { path = "../fedimovies-utils", features = ["test-utils"] }
serial_test = "0.7.0" serial_test = "0.7.0"

View file

@ -1,7 +1,7 @@
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use uuid::Uuid; use uuid::Uuid;
use mitra_utils::id::generate_ulid; use fedimovies_utils::id::generate_ulid;
use crate::cleanup::{find_orphaned_files, find_orphaned_ipfs_objects, DeletionQueue}; use crate::cleanup::{find_orphaned_files, find_orphaned_ipfs_objects, DeletionQueue};
use crate::database::{DatabaseClient, DatabaseError}; use crate::database::{DatabaseClient, DatabaseError};

View file

@ -3,7 +3,7 @@ use super::migrate::apply_migrations;
use tokio_postgres::config::Config; use tokio_postgres::config::Config;
use tokio_postgres::Client; use tokio_postgres::Client;
const DEFAULT_CONNECTION_URL: &str = "postgres://mitra:mitra@127.0.0.1:55432/mitra-test"; const DEFAULT_CONNECTION_URL: &str = "postgres://fedimovies:fedimovies@127.0.0.1:55432/fedimovies-test";
pub async fn create_test_database() -> Client { pub async fn create_test_database() -> Client {
let connection_url = let connection_url =

View file

@ -1,7 +1,7 @@
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use uuid::Uuid; use uuid::Uuid;
use mitra_utils::id::generate_ulid; use fedimovies_utils::id::generate_ulid;
use crate::cleanup::{find_orphaned_files, DeletionQueue}; use crate::cleanup::{find_orphaned_files, DeletionQueue};
use crate::database::{catch_unique_violation, DatabaseClient, DatabaseError}; use crate::database::{catch_unique_violation, DatabaseClient, DatabaseError};

View file

@ -1,6 +1,6 @@
use uuid::Uuid; use uuid::Uuid;
use mitra_utils::{caip2::ChainId, id::generate_ulid}; use fedimovies_utils::{caip2::ChainId, id::generate_ulid};
use crate::database::{catch_unique_violation, DatabaseClient, DatabaseError}; use crate::database::{catch_unique_violation, DatabaseClient, DatabaseError};

View file

@ -3,7 +3,7 @@ use postgres_protocol::types::{text_from_sql, text_to_sql};
use postgres_types::{accepts, private::BytesMut, to_sql_checked, FromSql, IsNull, ToSql, Type}; use postgres_types::{accepts, private::BytesMut, to_sql_checked, FromSql, IsNull, ToSql, Type};
use uuid::Uuid; use uuid::Uuid;
use mitra_utils::caip2::ChainId; use fedimovies_utils::caip2::ChainId;
use crate::database::{ use crate::database::{
int_enum::{int_enum_from_sql, int_enum_to_sql}, int_enum::{int_enum_from_sql, int_enum_to_sql},

View file

@ -263,7 +263,7 @@ pub async fn get_mention_notifications(
], ],
) )
.await?; .await?;
let mut notifications: Vec<Notification> = rows let notifications: Vec<Notification> = rows
.iter() .iter()
.map(Notification::try_from) .map(Notification::try_from)
.collect::<Result<_, _>>()?; .collect::<Result<_, _>>()?;

Some files were not shown because too many files have changed in this diff Show more