Error fixes
This commit is contained in:
parent
8f09feb0fc
commit
c4fc33bc50
10
src/email.rs
10
src/email.rs
|
@ -1,10 +1,12 @@
|
||||||
use crate::config_spec::{CfgField, CfgGroup};
|
use std::error::Error;
|
||||||
|
|
||||||
|
use lettre::{Message, SmtpTransport, Transport};
|
||||||
use lettre::message::{header, SinglePart};
|
use lettre::message::{header, SinglePart};
|
||||||
use lettre::transport::smtp::authentication::Credentials;
|
use lettre::transport::smtp::authentication::Credentials;
|
||||||
use lettre::{Message, SmtpTransport, Transport};
|
|
||||||
use std::error::Error;
|
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
use crate::config_spec::{CfgField, CfgGroup};
|
||||||
|
|
||||||
pub const CONFIG: CfgGroup<'static> = CfgGroup {
|
pub const CONFIG: CfgGroup<'static> = CfgGroup {
|
||||||
name: "email",
|
name: "email",
|
||||||
description: "Sending emails.",
|
description: "Sending emails.",
|
||||||
|
@ -24,7 +26,7 @@ pub const CONFIG: CfgGroup<'static> = CfgGroup {
|
||||||
description: "Password for authenticating with the mail server.",
|
description: "Password for authenticating with the mail server.",
|
||||||
},
|
},
|
||||||
CfgField::Default {
|
CfgField::Default {
|
||||||
key: "sender",
|
key: "from",
|
||||||
default: "Plenumsbot <plenum-bot@berlin.ccc.de>",
|
default: "Plenumsbot <plenum-bot@berlin.ccc.de>",
|
||||||
description: "Email address to use for \"From:\".",
|
description: "Email address to use for \"From:\".",
|
||||||
},
|
},
|
||||||
|
|
30
src/main.rs
30
src/main.rs
|
@ -1,3 +1,17 @@
|
||||||
|
use std::borrow::Cow;
|
||||||
|
use std::env;
|
||||||
|
use std::error::Error;
|
||||||
|
|
||||||
|
use chrono::{Datelike, Local, NaiveDate, Weekday};
|
||||||
|
use clap::{Arg, Command};
|
||||||
|
use regex::Regex;
|
||||||
|
use reqwest::blocking::Client;
|
||||||
|
|
||||||
|
use config_spec::{CfgField, CfgGroup, CfgSpec};
|
||||||
|
use email::{Email, SimpleEmail};
|
||||||
|
use hedgedoc::HedgeDoc;
|
||||||
|
use key_value::KeyValueStore as KV;
|
||||||
|
|
||||||
// Dies ist der Plenumsbot vom Chaos Computer Club Berlin.
|
// Dies ist der Plenumsbot vom Chaos Computer Club Berlin.
|
||||||
/*
|
/*
|
||||||
Plenumsbot
|
Plenumsbot
|
||||||
|
@ -34,29 +48,15 @@ future improvements:
|
||||||
*/
|
*/
|
||||||
// Import other .rs files as modules
|
// Import other .rs files as modules
|
||||||
mod key_value;
|
mod key_value;
|
||||||
use key_value::KeyValueStore as KV;
|
|
||||||
mod config_spec;
|
mod config_spec;
|
||||||
use config_spec::{CfgField, CfgGroup, CfgSpec};
|
|
||||||
mod template;
|
mod template;
|
||||||
|
|
||||||
pub mod variables_and_settings;
|
pub mod variables_and_settings;
|
||||||
|
|
||||||
mod email;
|
mod email;
|
||||||
use email::{Email, SimpleEmail};
|
|
||||||
mod hedgedoc;
|
mod hedgedoc;
|
||||||
use hedgedoc::HedgeDoc;
|
|
||||||
mod mediawiki;
|
mod mediawiki;
|
||||||
|
|
||||||
use std::borrow::Cow;
|
|
||||||
use std::env;
|
|
||||||
use std::error::Error;
|
|
||||||
|
|
||||||
use chrono::{Datelike, Local, NaiveDate, Weekday};
|
|
||||||
use clap::{Arg, Command};
|
|
||||||
use regex::Regex;
|
|
||||||
|
|
||||||
use reqwest::blocking::Client;
|
|
||||||
|
|
||||||
const FALLBACK_TEMPLATE: &str = variables_and_settings::FALLBACK_TEMPLATE;
|
const FALLBACK_TEMPLATE: &str = variables_and_settings::FALLBACK_TEMPLATE;
|
||||||
|
|
||||||
/* ***** Config Spec ***** */
|
/* ***** Config Spec ***** */
|
||||||
|
@ -217,7 +217,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
let top_anzahl: i32 = 0; // Muss noch gecodet werden
|
let top_anzahl: i32 = 0; // Muss noch gecodet werden
|
||||||
let yesterday_was_plenum = true; // Das ist nur zu Testzwecken, kommt noch weg
|
let yesterday_was_plenum = true; // Das ist nur zu Testzwecken, kommt noch weg
|
||||||
|
|
||||||
let auth_result = mediawiki::get_login_token(&Client::new(), &config.get("wiki-http-user").expect("HTML User not found DB!"), &config.get("wiki-http-pass").expect("HTML Password not found DB!"))?;
|
let auth_result = mediawiki::get_login_token(&Client::new(), &config.get("wiki-http-user").expect("HTTP User not found DB!"), &config.get("wiki-http-password").expect("HTTP Password not found DB!"))?;
|
||||||
println!("---AUTH RESULT:---\n{}\n-----------", auth_result);
|
println!("---AUTH RESULT:---\n{}\n-----------", auth_result);
|
||||||
// TEMPORÄR ENDE
|
// TEMPORÄR ENDE
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
use crate::config_spec::{CfgField, CfgGroup};
|
|
||||||
use pandoc::{PandocError, PandocOutput};
|
|
||||||
use reqwest;
|
|
||||||
use reqwest::blocking::Client;
|
|
||||||
use reqwest::tls;
|
|
||||||
use serde::Deserialize;
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
|
use pandoc::{PandocError, PandocOutput};
|
||||||
|
use reqwest;
|
||||||
|
use reqwest::blocking::Client;
|
||||||
|
use serde::Deserialize;
|
||||||
|
|
||||||
|
use crate::config_spec::{CfgField, CfgGroup};
|
||||||
|
|
||||||
pub const CONFIG: CfgGroup<'static> = CfgGroup {
|
pub const CONFIG: CfgGroup<'static> = CfgGroup {
|
||||||
name: "wiki",
|
name: "wiki",
|
||||||
description: "API Settings for Mediawiki",
|
description: "API Settings for Mediawiki",
|
||||||
|
|
Loading…
Reference in a new issue