Compare commits
5 Commits
487d7084c3
...
1210f7038a
| Author | SHA1 | Date | |
|---|---|---|---|
| 1210f7038a | |||
| f9ab7284a3 | |||
| 100865c923 | |||
| b8c1710a83 | |||
| 215b8cd41d |
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -2034,7 +2034,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "letterbox"
|
name = "letterbox"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"build-info-build",
|
"build-info-build",
|
||||||
@ -2393,7 +2393,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "notmuch"
|
name = "notmuch"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"log",
|
"log",
|
||||||
@ -2983,7 +2983,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "procmail2notmuch"
|
name = "procmail2notmuch"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
]
|
]
|
||||||
@ -3750,7 +3750,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server"
|
name = "server"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ammonia",
|
"ammonia",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@ -3835,7 +3835,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shared"
|
name = "shared"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"build-info",
|
"build-info",
|
||||||
"notmuch",
|
"notmuch",
|
||||||
|
|||||||
4
dev.sh
4
dev.sh
@ -1,7 +1,7 @@
|
|||||||
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"
|
||||||
tmux new-session -d -s letterbox-dev
|
tmux new-session -d -s letterbox-dev
|
||||||
tmux rename-window web
|
tmux rename-window web
|
||||||
tmux send-keys "cd web; trunk serve -w ../shared -w ../notmuch -w ./" C-m
|
tmux send-keys "cd web; trunk serve -w ../.git -w ../shared -w ../notmuch -w ./" C-m
|
||||||
tmux new-window -n server
|
tmux new-window -n server
|
||||||
tmux send-keys "cd server; cargo watch -c -x run -w ../shared -w ../notmuch -w ./" C-m
|
tmux send-keys "cd server; cargo watch -c -x run -w ../.git -w ../shared -w ../notmuch -w ./" C-m
|
||||||
tmux attach -d -t letterbox-dev
|
tmux attach -d -t letterbox-dev
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "notmuch"
|
name = "notmuch"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "procmail2notmuch"
|
name = "procmail2notmuch"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "server"
|
name = "server"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "server"
|
default-run = "server"
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ use crate::{
|
|||||||
Attachment, Body, DispositionType, Email, EmailThread, Header, Html, Message, PlainText,
|
Attachment, Body, DispositionType, Email, EmailThread, Header, Html, Message, PlainText,
|
||||||
Tag, Thread, ThreadSummary, UnhandledContentType,
|
Tag, Thread, ThreadSummary, UnhandledContentType,
|
||||||
},
|
},
|
||||||
linkify_html, sanitize_html,
|
linkify_html, InlineStyle, SanitizeHtml, Transformer,
|
||||||
};
|
};
|
||||||
|
|
||||||
const TEXT_PLAIN: &'static str = "text/plain";
|
const TEXT_PLAIN: &'static str = "text/plain";
|
||||||
@ -169,17 +169,29 @@ pub async fn thread(
|
|||||||
};
|
};
|
||||||
|
|
||||||
Body::Html(Html {
|
Body::Html(Html {
|
||||||
html: format!(
|
html: {
|
||||||
|
let body_tranformers: Vec<Box<dyn Transformer>> = vec![
|
||||||
|
Box::new(InlineStyle),
|
||||||
|
Box::new(SanitizeHtml {
|
||||||
|
cid_prefix: &cid_prefix,
|
||||||
|
base_url: &base_url,
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
let mut html = linkify_html(&text.trim_matches('\n'));
|
||||||
|
for t in body_tranformers.iter() {
|
||||||
|
if t.should_run(&None, &html) {
|
||||||
|
html = t.transform(&None, &html).await?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
format!(
|
||||||
r#"<p class="view-part-text-plain">{}</p>"#,
|
r#"<p class="view-part-text-plain">{}</p>"#,
|
||||||
// Trim newlines to prevent excessive white space at the beginning/end of
|
// Trim newlines to prevent excessive white space at the beginning/end of
|
||||||
// presenation. Leave tabs and spaces incase plain text attempts to center a
|
// presenation. Leave tabs and spaces incase plain text attempts to center a
|
||||||
// header on the first line.
|
// header on the first line.
|
||||||
sanitize_html(
|
html
|
||||||
&linkify_html(&text.trim_matches('\n')),
|
)
|
||||||
&cid_prefix,
|
},
|
||||||
&base_url
|
|
||||||
)?
|
|
||||||
),
|
|
||||||
content_tree: if debug_content_tree {
|
content_tree: if debug_content_tree {
|
||||||
render_content_type_tree(&m)
|
render_content_type_tree(&m)
|
||||||
} else {
|
} else {
|
||||||
@ -187,8 +199,27 @@ pub async fn thread(
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Body::Html(Html { html, content_tree }) => Body::Html(Html {
|
Body::Html(Html {
|
||||||
html: sanitize_html(&html, &cid_prefix, &base_url)?,
|
mut html,
|
||||||
|
content_tree,
|
||||||
|
}) => Body::Html(Html {
|
||||||
|
html: {
|
||||||
|
let body_tranformers: Vec<Box<dyn Transformer>> = vec![
|
||||||
|
// TODO: this breaks things like emails from calendar
|
||||||
|
//Box::new(InlineStyle),
|
||||||
|
Box::new(SanitizeHtml {
|
||||||
|
cid_prefix: &cid_prefix,
|
||||||
|
base_url: &base_url,
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
for t in body_tranformers.iter() {
|
||||||
|
if t.should_run(&None, &html) {
|
||||||
|
html = t.transform(&None, &html).await?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
html
|
||||||
|
},
|
||||||
|
|
||||||
content_tree: if debug_content_tree {
|
content_tree: if debug_content_tree {
|
||||||
render_content_type_tree(&m)
|
render_content_type_tree(&m)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "shared"
|
name = "shared"
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
use build_info::{BuildInfo, VersionControl};
|
||||||
use notmuch::SearchSummary;
|
use notmuch::SearchSummary;
|
||||||
use build_info::{VersionControl,BuildInfo};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
@ -40,10 +40,6 @@ pub fn build_version(bi:fn()->&'static BuildInfo) -> String {
|
|||||||
return String::new();
|
return String::new();
|
||||||
};
|
};
|
||||||
let mut s = vec!["-".to_string(), git.commit_short_id.clone()];
|
let mut s = vec!["-".to_string(), git.commit_short_id.clone()];
|
||||||
if git.dirty {
|
|
||||||
s.push(".+".to_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(branch) = &git.branch {
|
if let Some(branch) = &git.branch {
|
||||||
s.push(format!(" ({branch})"));
|
s.push(format!(" ({branch})"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
version = "0.0.6"
|
version = "0.0.7"
|
||||||
name = "letterbox"
|
name = "letterbox"
|
||||||
repository = "https://github.com/seed-rs/seed-quickstart"
|
repository = "https://github.com/seed-rs/seed-quickstart"
|
||||||
authors = ["Bill Thiede <git@xinu.tv>"]
|
authors = ["Bill Thiede <git@xinu.tv>"]
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
.PHONY: all
|
|
||||||
APP=letterbox
|
|
||||||
|
|
||||||
# Build in release mode and push to minio for serving.
|
|
||||||
all:
|
|
||||||
trunk build --release
|
|
||||||
mc mirror m/$(APP)/ /tmp/$(APP)-$(shell date +%s)
|
|
||||||
mc mirror --overwrite --remove dist/ m/$(APP)/
|
|
||||||
Loading…
x
Reference in New Issue
Block a user