mirror of
https://github.com/OMGeeky/twba.uploader.git
synced 2026-01-06 02:59:33 +01:00
get it to work on the server with docker
This commit is contained in:
@@ -27,7 +27,7 @@ impl<USER: EasyString> CustomFlowDelegate<USER> {
|
||||
}
|
||||
}
|
||||
impl<USER: EasyString> InstalledFlowDelegate for CustomFlowDelegate<USER> {
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(self))]
|
||||
fn redirect_uri(&self) -> Option<&str> {
|
||||
if !(&crate::CONF.google.local_auth_redirect) {
|
||||
let url = "https://game-omgeeky.de:7443/googleapi/auth";
|
||||
@@ -48,7 +48,7 @@ impl<USER: EasyString> InstalledFlowDelegate for CustomFlowDelegate<USER> {
|
||||
}
|
||||
}
|
||||
impl<USER: EasyString> CustomFlowDelegate<USER> {
|
||||
#[tracing::instrument]
|
||||
#[tracing::instrument(skip(self, url, need_code))]
|
||||
async fn present_user_url(&self, url: &str, need_code: bool) -> StdResult<String, String> {
|
||||
let user: String = self
|
||||
.user
|
||||
@@ -114,6 +114,10 @@ async fn get_auth_code() -> Result<String> {
|
||||
break;
|
||||
}
|
||||
|
||||
println!(
|
||||
"sleeping for {} second before trying again",
|
||||
crate::CONF.google.auth_file_read_timeout
|
||||
);
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(
|
||||
crate::CONF.google.auth_file_read_timeout,
|
||||
))
|
||||
|
||||
15
src/main.rs
15
src/main.rs
@@ -11,6 +11,19 @@ pub mod prelude;
|
||||
lazy_static! {
|
||||
pub(crate) static ref CONF: Conf = Conf::builder()
|
||||
.env()
|
||||
.file(
|
||||
std::env::var("TWBA_CONFIG")
|
||||
.map(|v| {
|
||||
dbg!(&v);
|
||||
info!("using {} as primary config source after env", v);
|
||||
v
|
||||
})
|
||||
.unwrap_or_else(|x| {
|
||||
dbg!(x);
|
||||
error!("could not get config location from env");
|
||||
"./settings.toml".to_string()
|
||||
})
|
||||
)
|
||||
.file("./settings.toml")
|
||||
.file(shellexpand::tilde("~/twba/config.toml").into_owned())
|
||||
.load()
|
||||
@@ -39,7 +52,7 @@ async fn run() -> Result<()> {
|
||||
let x = &CONF.google;
|
||||
debug!("{:?}", x);
|
||||
|
||||
trace!("creating db-connection");
|
||||
trace!("creating db-connection with db url: {}", &CONF.db_url);
|
||||
let db = local_db::open_database(Some(&CONF.db_url)).await?;
|
||||
trace!("migrating db");
|
||||
local_db::migrate_db(&db).await?;
|
||||
|
||||
Reference in New Issue
Block a user