Compare commits
No commits in common. "develop" and "main" have entirely different histories.
|
@ -1,2 +0,0 @@
|
|||
[alias]
|
||||
t="test -- --test-threads=1"
|
|
@ -1,8 +1,11 @@
|
|||
[package]
|
||||
name = "mastodon-image-uploader-bot"
|
||||
version = "0.3.1"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
|
||||
[alias]
|
||||
test = "cargo test -- --test-threads=1"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
|
|
|
@ -10,13 +10,13 @@ spec:
|
|||
spec:
|
||||
containers:
|
||||
- name: bot-job
|
||||
image: git.fai.st/fedi-image-bot/mastodon-image-uploader-bot:v1.0.0
|
||||
image: git.fai.st/fedi-image-bot/mastodon-image-uploader-bot:latest
|
||||
volumeMounts:
|
||||
- name: config-toml
|
||||
mountPath: /app/config.toml
|
||||
mountPath: /app/
|
||||
readOnly: true
|
||||
- name: mastodon-token
|
||||
mountPath: /app/mastodon-data.toml
|
||||
mountPath: /app/
|
||||
readOnly: true
|
||||
restartPolicy: Never
|
||||
volumes:
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
use async_std;
|
||||
use log;
|
||||
use mastodon_async::entities::visibility::Visibility;
|
||||
use mastodon_async::helpers::{cli, toml as masto_toml};
|
||||
use mastodon_async::prelude::*;
|
||||
use reqwest;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashSet;
|
||||
use std::io::{Cursor, Write};
|
||||
use std::process::exit;
|
||||
use std::time::Duration;
|
||||
use toml;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct AccountUpdate {
|
||||
|
@ -172,7 +176,7 @@ fn set_url_as_posted(config: &Config, url: &String) -> DynResult<()> {
|
|||
.write(true)
|
||||
.append(true) // This is needed to append to file
|
||||
.open(&config.files.posted)?; //.expect("Cannot open posted file"); // Maybe we should retry just in case
|
||||
writeln!(file, "{}", url)?; //.expect("Cannot write to posted file"); // maybe we should retry tbh
|
||||
write!(file, "{}\n", url)?; //.expect("Cannot write to posted file"); // maybe we should retry tbh
|
||||
log::info!("Set url {} as posted", url);
|
||||
Ok(())
|
||||
}
|
||||
|
@ -280,7 +284,7 @@ mod tests {
|
|||
let client = reqwest::Client::new();
|
||||
let config = get_config();
|
||||
let account = get_account(&config).await;
|
||||
let msg = "Test!".to_string();
|
||||
let msg = format!("Test!");
|
||||
|
||||
let status = post(&account, &msg, Visibility::Direct).await.unwrap();
|
||||
let response = client
|
||||
|
|
Loading…
Reference in New Issue