diff options
| author | Max Audron <audron@cocaine.farm> | 2021-05-16 00:31:24 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2021-05-16 00:31:24 +0200 |
| commit | bda302df12856879fd78efad1569135b1706973b (patch) | |
| tree | bca8e41eb6965c0cfcda2277cc13b0f949ca253a /src | |
| parent | add container build (diff) | |
add deployment stuff
Diffstat (limited to '')
| -rw-r--r-- | src/lib.rs | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -5,6 +5,8 @@ use anyhow::Result; use irc::client::prelude::*; +use tracing::info; + pub mod config; pub mod hooks; @@ -28,11 +30,17 @@ impl Bot { use std::fs; let config_str = fs::read_to_string(config_path)?; - let config: config::Config = toml::from_str(&config_str)?; + let mut config: config::Config = toml::from_str(&config_str)?; - let irc_config: Config = config.clone().into(); + match std::env::var("CATINATOR_PASSWORD") { + Ok(var) => { + info!("using password from env var"); + config.user.password = var + } + Err(_) => () + } - let irc_client = Client::from_config(irc_config.clone()).await?; + let irc_client = Client::from_config(config.clone().into()).await?; Ok(Bot { irc_client, config }) } |
