Create workspace and move mitractl to a separate crate
This commit is contained in:
parent
203582f801
commit
42329328ec
7 changed files with 62 additions and 15 deletions
|
@ -13,6 +13,9 @@ indent_size = 2
|
||||||
[*.yaml]
|
[*.yaml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.toml]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
max_line_length = off
|
max_line_length = off
|
||||||
|
|
13
Cargo.lock
generated
13
Cargo.lock
generated
|
@ -1709,7 +1709,6 @@ dependencies = [
|
||||||
"blake2",
|
"blake2",
|
||||||
"bs58",
|
"bs58",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
|
||||||
"comrak",
|
"comrak",
|
||||||
"deadpool",
|
"deadpool",
|
||||||
"deadpool-postgres",
|
"deadpool-postgres",
|
||||||
|
@ -1751,6 +1750,18 @@ dependencies = [
|
||||||
"web3",
|
"web3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mitra-cli"
|
||||||
|
version = "1.10.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"clap",
|
||||||
|
"log",
|
||||||
|
"mitra",
|
||||||
|
"tokio",
|
||||||
|
"uuid",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "monero"
|
name = "monero"
|
||||||
version = "0.17.2"
|
version = "0.17.2"
|
||||||
|
|
12
Cargo.toml
12
Cargo.toml
|
@ -9,6 +9,16 @@ rust-version = "1.56"
|
||||||
publish = false
|
publish = false
|
||||||
default-run = "mitra"
|
default-run = "mitra"
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
members = [
|
||||||
|
".",
|
||||||
|
"mitra-cli",
|
||||||
|
]
|
||||||
|
default-members = [
|
||||||
|
".",
|
||||||
|
"mitra-cli",
|
||||||
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Used to handle incoming HTTP requests
|
# Used to handle incoming HTTP requests
|
||||||
actix-cors = "0.6.2"
|
actix-cors = "0.6.2"
|
||||||
|
@ -25,8 +35,6 @@ base64 = "0.13.0"
|
||||||
bs58 = "0.4.0"
|
bs58 = "0.4.0"
|
||||||
# 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"] }
|
||||||
# Used to build admin CLI tool
|
|
||||||
clap = { version = "3.2.18", default-features = false, features = ["std", "derive"] }
|
|
||||||
# Used for parsing markdown
|
# Used for parsing markdown
|
||||||
comrak = { version = "0.15.0", default-features = false }
|
comrak = { version = "0.15.0", default-features = false }
|
||||||
# Used for pooling database connections
|
# Used for pooling database connections
|
||||||
|
|
24
mitra-cli/Cargo.toml
Normal file
24
mitra-cli/Cargo.toml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
[package]
|
||||||
|
name = "mitra-cli"
|
||||||
|
version = "1.10.0"
|
||||||
|
license = "AGPL-3.0"
|
||||||
|
edition = "2021"
|
||||||
|
rust-version = "1.56"
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "mitractl"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
mitra = { path = ".." }
|
||||||
|
|
||||||
|
# Used for catching errors
|
||||||
|
anyhow = "1.0.58"
|
||||||
|
# Used to build admin CLI tool
|
||||||
|
clap = { version = "3.2.18", default-features = false, features = ["std", "derive"] }
|
||||||
|
# Used for logging
|
||||||
|
log = "0.4.14"
|
||||||
|
# Async runtime
|
||||||
|
tokio = { version = "1.17.0", features = ["macros"] }
|
||||||
|
# Used to work with UUIDs
|
||||||
|
uuid = "1.1.2"
|
|
@ -2,20 +2,20 @@ use anyhow::{anyhow, Error};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::activitypub::{
|
use mitra::activitypub::{
|
||||||
actors::helpers::update_remote_profile,
|
actors::helpers::update_remote_profile,
|
||||||
builders::delete_note::prepare_delete_note,
|
builders::delete_note::prepare_delete_note,
|
||||||
builders::delete_person::prepare_delete_person,
|
builders::delete_person::prepare_delete_person,
|
||||||
fetcher::fetchers::fetch_actor,
|
fetcher::fetchers::fetch_actor,
|
||||||
};
|
};
|
||||||
use crate::config::Config;
|
use mitra::config::Config;
|
||||||
use crate::database::DatabaseClient;
|
use mitra::database::DatabaseClient;
|
||||||
use crate::ethereum::{
|
use mitra::ethereum::{
|
||||||
signatures::generate_ecdsa_key,
|
signatures::generate_ecdsa_key,
|
||||||
sync::save_current_block_number,
|
sync::save_current_block_number,
|
||||||
utils::key_to_ethereum_address,
|
utils::key_to_ethereum_address,
|
||||||
};
|
};
|
||||||
use crate::models::{
|
use mitra::models::{
|
||||||
attachments::queries::delete_unused_attachments,
|
attachments::queries::delete_unused_attachments,
|
||||||
cleanup::find_orphaned_files,
|
cleanup::find_orphaned_files,
|
||||||
emojis::helpers::get_emoji_by_name,
|
emojis::helpers::get_emoji_by_name,
|
||||||
|
@ -41,11 +41,11 @@ use crate::models::{
|
||||||
set_user_password,
|
set_user_password,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use crate::monero::{
|
use mitra::monero::{
|
||||||
helpers::check_expired_invoice,
|
helpers::check_expired_invoice,
|
||||||
wallet::create_monero_wallet,
|
wallet::create_monero_wallet,
|
||||||
};
|
};
|
||||||
use crate::utils::{
|
use mitra::utils::{
|
||||||
crypto_rsa::{
|
crypto_rsa::{
|
||||||
generate_rsa_key,
|
generate_rsa_key,
|
||||||
serialize_private_key,
|
serialize_private_key,
|
|
@ -1,11 +1,13 @@
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
use mitra::cli::{Opts, SubCommand};
|
|
||||||
use mitra::config::parse_config;
|
use mitra::config::parse_config;
|
||||||
use mitra::database::create_database_client;
|
use mitra::database::create_database_client;
|
||||||
use mitra::database::migrate::apply_migrations;
|
use mitra::database::migrate::apply_migrations;
|
||||||
use mitra::logger::configure_logger;
|
use mitra::logger::configure_logger;
|
||||||
|
|
||||||
|
mod cli;
|
||||||
|
use cli::{Opts, SubCommand};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
let opts: Opts = Opts::parse();
|
let opts: Opts = Opts::parse();
|
|
@ -1,6 +1,5 @@
|
||||||
pub mod activitypub;
|
pub mod activitypub;
|
||||||
pub mod atom;
|
pub mod atom;
|
||||||
pub mod cli;
|
|
||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod database;
|
pub mod database;
|
||||||
mod errors;
|
mod errors;
|
||||||
|
@ -13,9 +12,9 @@ pub mod job_queue;
|
||||||
mod json_signatures;
|
mod json_signatures;
|
||||||
pub mod logger;
|
pub mod logger;
|
||||||
pub mod mastodon_api;
|
pub mod mastodon_api;
|
||||||
mod models;
|
pub mod models;
|
||||||
mod monero;
|
pub mod monero;
|
||||||
pub mod nodeinfo;
|
pub mod nodeinfo;
|
||||||
mod utils;
|
pub mod utils;
|
||||||
pub mod webfinger;
|
pub mod webfinger;
|
||||||
pub mod web_client;
|
pub mod web_client;
|
||||||
|
|
Loading…
Reference in a new issue