Skip to content

Commit

Permalink
listmonk: remove
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Aug 11, 2024
1 parent 8eaca6a commit df1c44f
Show file tree
Hide file tree
Showing 12 changed files with 281 additions and 464 deletions.
460 changes: 270 additions & 190 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1.37", default-features = false, features = ["macros", "rt-multi-thread", "net", "fs", "sync", "time"] }
tokio = { version = "1.39", default-features = false, features = ["macros", "rt-multi-thread", "net", "fs", "sync", "time"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls-webpki-roots"], default-features = false }
axum = { version = "0.7", default-features = false, features = ["tokio", "http1", "json", "query","macros"] }
time = { version = "0.3", default-features = false, features = ["serde", "std", "formatting", "parsing"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] }
tower-http = { version = "0.5", default-features = false, features = ["cors", "fs"] }
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
serde_yaml = { version = "0.9", default-features = false }
clap = { version = "=4.4.18", features = ["derive", "env"] }
clap = { version = "4.5", features = ["derive", "env"] }
url = { version = "2.5", features = ["serde"], default-features = false }
serde_json = { version = "1.0" }
markdown = "1.0.0-alpha.17"
email_address = "0.2"
markdown = "1.0.0-alpha.19"
async-trait = "0.1"
tracing = "0.1"
anyhow = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

Expand Down
24 changes: 0 additions & 24 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,6 @@ pub(crate) struct Args {
)]
pub(crate) base_url: Url,

#[clap(
long,
env = "WEBSITE_CONTENT_API_LISTMONK_URL",
default_value = "http://localhost:8090/"
)]
pub(crate) listmonk_url: Url,

#[clap(
long,
env = "WEBSITE_CONTENT_API_LISTMONK_USER",
default_value = "listmonk"
)]
pub(crate) listmonk_user: String,

#[clap(
long,
env = "WEBSITE_CONTENT_API_LISTMONK_PASSWORD_FILE",
default_value = "/run/secret/listmonk"
)]
pub(crate) listmonk_password_file: PathBuf,

#[clap(long, env = "WEBSITE_CONTENT_API_LISTMONK_LISTS", default_value = "[]")]
pub(crate) listmonk_lists: String,

#[clap(
long,
env = "WEBSITE_CONTENT_API_PROMETHEUS_URL",
Expand Down
2 changes: 1 addition & 1 deletion src/blog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl Blog {

let body = if is_rst_file {
let mut buffer: Vec<u8> = Vec::new();
let parsed_rst = parse(&text)
let parsed_rst = parse(text)
.map_err(|e| {
eprintln!("cannot parse rst file {} with error {}", &file_name, e);
})
Expand Down
5 changes: 1 addition & 4 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ use std::sync::Arc;

use crate::lang::Language;
use serde::{Deserialize, Serialize};
use time::{Date, OffsetDateTime};

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
struct MyDate(Date);
use time::OffsetDateTime;

#[derive(Debug, Clone)]
pub(crate) struct EventHandler {
Expand Down
190 changes: 0 additions & 190 deletions src/lists.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::bird::Bird;
use crate::blog::Blog;
use crate::documents::Documents;
use crate::event::EventHandler;
use crate::lists::MailingLists;
use crate::peers::NetworkService;
use crate::routes::{route, ContentPaths};
use crate::state::FoundationState;
Expand All @@ -26,7 +25,6 @@ mod cache;
mod documents;
mod event;
mod lang;
mod lists;
mod peers;
mod routes;
mod state;
Expand Down Expand Up @@ -59,13 +57,6 @@ async fn main() -> anyhow::Result<()> {
.await?,
documents: Documents::load(&args.content_directory.join("documents")).await?,
team: Team::load(&args.content_directory.join("team")).await?,
lists: MailingLists::load(
&args.listmonk_url,
&args.listmonk_user,
&args.listmonk_password_file,
&args.listmonk_lists,
)
.await?,
stats: Stats::new(args.prometheus_url),
peers: NetworkService::new(
&args.content_directory.join("supporter"),
Expand Down
31 changes: 0 additions & 31 deletions src/routes/lists.rs

This file was deleted.

5 changes: 1 addition & 4 deletions src/routes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use std::path::PathBuf;

use crate::routes::bird::get_bird;
use axum::routing::{get, post};
use axum::routing::get;
use axum::Router;
use tower_http::services::ServeDir;

use crate::routes::blog::{find_keywords, find_post, list_posts};
use crate::routes::documents::list_documents;
use crate::routes::event::{find_event, list_all_events, list_future_events};
use crate::routes::lists::add_subscriber;
use crate::routes::peers::get_peers_and_supporter;
use crate::routes::team::get_team;
use crate::routes::text_blocks::find_text_block;
Expand All @@ -20,7 +19,6 @@ mod bird;
mod blog;
mod documents;
mod event;
mod lists;
mod peers;
mod stats;
mod team;
Expand Down Expand Up @@ -56,7 +54,6 @@ pub(crate) fn route(content_paths: &ContentPaths) -> Router<FoundationState> {
)
.route("/team/:lang", get(get_team))
.nest_service("/team/assets", ServeDir::new(&content_paths.team))
.route("/mailing_lists/:list", post(add_subscriber))
.route("/stats/traffic/:selection", get(get_traffic_stats))
.route("/stats/as112/:selection", get(get_as112_stats))
.route("/peers", get(get_peers_and_supporter))
Expand Down
Loading

0 comments on commit df1c44f

Please sign in to comment.