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 348c194
Show file tree
Hide file tree
Showing 13 changed files with 281 additions and 504 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
40 changes: 0 additions & 40 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,42 +30,6 @@ in
'';
};
};
listmonk = {
host = lib.mkOption {
type = lib.types.str;
default = "http://127.0.0.1";
description = ''
At which host is listmonk listening
'';
};
port = lib.mkOption {
type = lib.types.port;
default = 8081;
description = ''
At which port is listmonk listening
'';
};
user = lib.mkOption {
type = lib.types.str;
default = "admin";
description = ''
username of listmonk user
'';
};
passwordFile = lib.mkOption {
type = lib.types.path;
description = ''
path from where the user password can be read
'';
};
allowed_lists = lib.mkOption {
type = lib.types.listOf lib.types.int;
default = [ ];
description = ''
list of allowed mailing list ids
'';
};
};
logLevel = lib.mkOption {
type = lib.types.str;
default = "info";
Expand Down Expand Up @@ -96,10 +60,6 @@ in
WEBSITE_CONTENT_API_LISTEN_ADDR = "${cfg.http.host}:${toString cfg.http.port}";
WEBSITE_CONTENT_API_CONTENT_DIRECTORY = "${pkgs.website-content}/content/";
WEBSITE_CONTENT_API_BASE_URL = cfg.url;
WEBSITE_CONTENT_API_LISTMONK_URL = "${cfg.listmonk.host}:${toString cfg.listmonk.port}";
WEBSITE_CONTENT_API_LISTMONK_USER = cfg.listmonk.user;
WEBSITE_CONTENT_API_LISTMONK_PASSWORD_FILE = "%d/listmonk_pw";
WEBSITE_CONTENT_API_LISTMONK_LISTS = "${builtins.toJSON cfg.listmonk.allowed_lists}";
WEBSITE_CONTENT_API_PROMETHEUS_URL = cfg.prometheusUrl;
WEBSITE_CONTENT_API_IXP_MANAGER_URL = cfg.ixpManagerUrl;
};
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
Loading

0 comments on commit 348c194

Please sign in to comment.