diff --git a/.gitignore b/.gitignore index 789dd83..376bb46 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target blogdor.db secrets +.env diff --git a/blogdor.service b/blogdor.service index d26e44a..186dfdd 100644 --- a/blogdor.service +++ b/blogdor.service @@ -7,7 +7,8 @@ Requires=network-online.target Type=exec User=blogdor Group=blogdor -ExecStart=/var/lib/blogdor/blogdor -e /var/lib/blogdor/.env +EnvironmentFile=/var/lib/blogdor/.env +ExecStart=/var/lib/blogdor/blogdor TimeoutStopSec=5s LimitNOFILE=1048576 LimitNPROC=512 diff --git a/sample-dot-env b/sample-dot-env new file mode 100644 index 0000000..ee903a5 --- /dev/null +++ b/sample-dot-env @@ -0,0 +1,8 @@ +DATABASE_URL=sqlite://blogdor.db +DATABASE_FILE=./blogdor.db +ZULIP_TOKEN=a_token +ZULIP_URL=http://localhost:8000 +BLOGDOR_TO_ZULIP_EMAIL=blogdor-incoming-bot@zulip-host +ZULIP_TO_BLOGDOR_EMAIL=blogdor-outgoing-bot@zulip-host +ZULIP_CHANNEL=35 +BLOGDOR_TOKEN=another_token diff --git a/src/lib.rs b/src/lib.rs index 14fd0fd..422333f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -304,9 +304,10 @@ async fn check_feed( feed_url: url.clone(), title: post .title + .clone() .map(|t| t.content) .unwrap_or("Blogdor Says: NO POST TITLE".to_string()), - published: post.published.unwrap_or(now), + published: post.posted().unwrap_or(now), received: now, feed_description: feed.description.to_owned().map(|d| d.content), body: post.content.and_then(|c| {