chore: bump versions, update comrak options
This commit is contained in:
parent
06e524ebea
commit
f06dc7e663
13 changed files with 1461 additions and 845 deletions
2123
Cargo.lock
generated
2123
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -14,7 +14,7 @@ members = [
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "upub-bin"
|
name = "upub-bin"
|
||||||
version = "0.4.0"
|
version = "0.4.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = [ "alemi <me@alemi.dev>" ]
|
authors = [ "alemi <me@alemi.dev>" ]
|
||||||
description = "Traits and types to handle ActivityPub objects"
|
description = "Traits and types to handle ActivityPub objects"
|
||||||
|
@ -34,8 +34,8 @@ tracing-subscriber = "0.3"
|
||||||
clap = { version = "4.5", features = ["derive"] }
|
clap = { version = "4.5", features = ["derive"] }
|
||||||
signal-hook = "0.3"
|
signal-hook = "0.3"
|
||||||
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
|
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
|
||||||
tokio = { version = "1.40", features = ["full"] } # TODO slim this down
|
tokio = { version = "1.43", features = ["full"] } # TODO slim this down
|
||||||
sea-orm = { version = "1.0", features = ["sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls"] }
|
sea-orm = { version = "1.1", features = ["sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls"] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
|
|
||||||
upub = { path = "upub/core" }
|
upub = { path = "upub/core" }
|
||||||
|
|
|
@ -15,11 +15,11 @@ readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
thiserror = "1"
|
thiserror = "2.0"
|
||||||
paste = "1.0"
|
paste = "1.0"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
serde_json = { version = "1", optional = true }
|
serde_json = { version = "1.0", optional = true }
|
||||||
sea-orm = { version = "1.0", optional = true, default-features = false }
|
sea-orm = { version = "1.1", optional = true, default-features = false }
|
||||||
reqwest = { version = "0.12", features = ["json"], optional = true }
|
reqwest = { version = "0.12", features = ["json"], optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
@ -14,13 +14,13 @@ readme = "README.md"
|
||||||
apb = { path = "../../apb/" }
|
apb = { path = "../../apb/" }
|
||||||
upub = { path = "../core" }
|
upub = { path = "../core" }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
serde_json = "1"
|
serde_json = "1.0"
|
||||||
sha256 = "1.5"
|
sha256 = "1.5"
|
||||||
uuid = { version = "1.10", features = ["v4"] }
|
uuid = { version = "1.11", features = ["v4"] }
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
||||||
clap = { version = "4.5", features = ["derive"] }
|
clap = { version = "4.5", features = ["derive"] }
|
||||||
sea-orm = "1.0"
|
sea-orm = "1.1"
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
mdhtml = { path = "../../utils/mdhtml/" }
|
mdhtml = { path = "../../utils/mdhtml/" }
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "upub"
|
name = "upub"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = [ "alemi <me@alemi.dev>" ]
|
authors = [ "alemi <me@alemi.dev>" ]
|
||||||
description = "core inner workings of upub"
|
description = "core inner workings of upub"
|
||||||
|
@ -11,7 +11,7 @@ readme = "README.md"
|
||||||
[lib]
|
[lib]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "1"
|
thiserror = "2.0"
|
||||||
async-recursion = "1.1"
|
async-recursion = "1.1"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
sha256 = "1.5" # TODO get rid of this and use directly sha2!!
|
sha256 = "1.5" # TODO get rid of this and use directly sha2!!
|
||||||
|
@ -20,9 +20,9 @@ hmac = "0.12"
|
||||||
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
||||||
base64 = "0.22"
|
base64 = "0.22"
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
uuid = { version = "1.10", features = ["v4"] }
|
uuid = { version = "1.11", features = ["v4"] }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1.0"
|
||||||
serde_default = "0.2"
|
serde_default = "0.2"
|
||||||
serde-inline-default = "0.2"
|
serde-inline-default = "0.2"
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
|
@ -31,7 +31,7 @@ httpsign = { path = "../../utils/httpsign/" }
|
||||||
mdhtml = { path = "../../utils/mdhtml/" }
|
mdhtml = { path = "../../utils/mdhtml/" }
|
||||||
jrd = "0.1"
|
jrd = "0.1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
sea-orm = { version = "1.0", features = ["macros"] }
|
sea-orm = { version = "1.1", features = ["macros"] }
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
apb = { path = "../../apb", features = ["unstructured", "orm", "did-core", "activitypub-miscellaneous-terms", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot"] }
|
apb = { path = "../../apb", features = ["unstructured", "orm", "did-core", "activitypub-miscellaneous-terms", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot"] }
|
||||||
# nodeinfo = "0.0.2" # the version on crates.io doesn't re-export necessary types to build the struct!!!
|
# nodeinfo = "0.0.2" # the version on crates.io doesn't re-export necessary types to build the struct!!!
|
||||||
|
|
|
@ -11,4 +11,4 @@ readme = "README.md"
|
||||||
[lib]
|
[lib]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sea-orm-migration = "1.0"
|
sea-orm-migration = "1.1"
|
||||||
|
|
|
@ -11,23 +11,23 @@ readme = "README.md"
|
||||||
[lib]
|
[lib]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "1"
|
thiserror = "2.0"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
sha256 = "1.5" # TODO ughhh
|
sha256 = "1.5" # TODO ughhh
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1.0"
|
||||||
upub = { path = "../core/" }
|
upub = { path = "../core/" }
|
||||||
jrd = "0.1"
|
jrd = "0.1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tokio = { version = "1.40", features = ["full"] } # TODO slim this down
|
tokio = { version = "1.43", features = ["full"] } # TODO slim this down
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
axum = { version = "0.7", features = ["multipart"] }
|
axum = { version = "0.8", features = ["multipart"] }
|
||||||
tower-http = { version = "0.5", features = ["cors", "trace"] }
|
tower-http = { version = "0.6", features = ["cors", "trace"] }
|
||||||
httpsign = { path = "../../utils/httpsign/", features = ["axum"] }
|
httpsign = { path = "../../utils/httpsign/", features = ["axum"] }
|
||||||
apb = { path = "../../apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot", "jsonld"] }
|
apb = { path = "../../apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot", "jsonld"] }
|
||||||
uriproxy = { path = "../../utils/uriproxy" }
|
uriproxy = { path = "../../utils/uriproxy" }
|
||||||
sea-orm = "1.0"
|
sea-orm = "1.1"
|
||||||
# nodeinfo = "0.0.2" # the version on crates.io doesn't re-export necessary types to build the struct!!!
|
# nodeinfo = "0.0.2" # the version on crates.io doesn't re-export necessary types to build the struct!!!
|
||||||
nodeinfo = { git = "https://codeberg.org/thefederationinfo/nodeinfo-rs", rev = "e865094804" }
|
nodeinfo = { git = "https://codeberg.org/thefederationinfo/nodeinfo-rs", rev = "e865094804" }
|
||||||
# mastodon
|
# mastodon
|
||||||
|
|
|
@ -82,7 +82,6 @@ impl Identity {
|
||||||
|
|
||||||
pub struct AuthIdentity(pub Identity);
|
pub struct AuthIdentity(pub Identity);
|
||||||
|
|
||||||
#[axum::async_trait]
|
|
||||||
impl<S> FromRequestParts<S> for AuthIdentity
|
impl<S> FromRequestParts<S> for AuthIdentity
|
||||||
where
|
where
|
||||||
upub::Context: FromRef<S>,
|
upub::Context: FromRef<S>,
|
||||||
|
|
|
@ -11,14 +11,14 @@ readme = "README.md"
|
||||||
[lib]
|
[lib]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "1"
|
thiserror = "2.0"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
serde_json = "1"
|
serde_json = "1.0"
|
||||||
sea-orm = "1.0"
|
sea-orm = "1.1"
|
||||||
regex = "1.10"
|
regex = "1.11"
|
||||||
chrono = { version = "0.4", features = ["serde"] }
|
chrono = { version = "0.4", features = ["serde"] }
|
||||||
tokio = { version = "1.40", features = ["full"] } # TODO slim this down
|
tokio = { version = "1.43", features = ["full"] } # TODO slim this down
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
apb = { path = "../../apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot"] }
|
apb = { path = "../../apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot"] }
|
||||||
mdhtml = { path = "../../utils/mdhtml/" }
|
mdhtml = { path = "../../utils/mdhtml/" }
|
||||||
|
|
|
@ -15,11 +15,11 @@ path = "lib.rs"
|
||||||
# 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
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
thiserror = "1"
|
thiserror = "2.0"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
base64 = "0.22"
|
base64 = "0.22"
|
||||||
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
||||||
axum = { version = "0.7", optional = true }
|
axum = { version = "0.8", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = []
|
default = []
|
||||||
|
|
|
@ -15,9 +15,9 @@ path = "lib.rs"
|
||||||
# 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
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
html5ever = "0.27"
|
html5ever = "0.27" # have to lock this because newer versions don't get &mut self anymore
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
comrak = { version = "0.23", optional = true }
|
comrak = { version = "0.33", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["markdown"]
|
default = ["markdown"]
|
||||||
|
|
|
@ -1,53 +1,59 @@
|
||||||
use html5ever::{tendril::SliceExt, tokenizer::{BufferQueue, TagKind, Token, TokenSink, TokenSinkResult, Tokenizer}};
|
use html5ever::{tendril::SliceExt, tokenizer::{BufferQueue, TagKind, Token, TokenSink, TokenSinkResult, Tokenizer}};
|
||||||
|
|
||||||
// TODO this drives me so mad!!! The #[non_exhaustive] attr on the underlying ___Options structs
|
const OPTIONS: comrak::Options<'static> = comrak::Options {
|
||||||
// makes it impossible to construct them with struct syntax! I need to use this BULLSHIT
|
extension: comrak::ExtensionOptions {
|
||||||
// builder pattern. And it's NOT CONST!!! I have to keep this shit heap allocated somewhere
|
strikethrough: true,
|
||||||
// because this thing is #[non_exhaustive]... oh i hate this so much
|
tagfilter: true,
|
||||||
fn options() -> &'static comrak::Options {
|
table: true,
|
||||||
static OPTIONS: std::sync::OnceLock<comrak::Options> = std::sync::OnceLock::new();
|
autolink: true,
|
||||||
OPTIONS.get_or_init(||
|
tasklist: false,
|
||||||
comrak::Options {
|
superscript: true,
|
||||||
extension: comrak::ExtensionOptionsBuilder::default()
|
header_ids: None,
|
||||||
.autolink(true)
|
footnotes: false,
|
||||||
.strikethrough(true)
|
description_lists: false,
|
||||||
.description_lists(false)
|
front_matter_delimiter: None,
|
||||||
.tagfilter(true)
|
multiline_block_quotes: true,
|
||||||
.table(true)
|
math_dollars: true,
|
||||||
.tasklist(false)
|
math_code: true,
|
||||||
.superscript(true)
|
wikilinks_title_after_pipe: false,
|
||||||
.header_ids(None)
|
wikilinks_title_before_pipe: false,
|
||||||
.footnotes(false)
|
underline: true,
|
||||||
.front_matter_delimiter(None)
|
subscript: true,
|
||||||
.multiline_block_quotes(true)
|
spoiler: true,
|
||||||
.math_dollars(true)
|
greentext: true,
|
||||||
.math_code(true)
|
// TODO use these two for cloaking?
|
||||||
.build()
|
image_url_rewriter: None,
|
||||||
.expect("error creating default markdown extension options"),
|
link_url_rewriter: None,
|
||||||
|
},
|
||||||
parse: comrak::ParseOptionsBuilder::default()
|
|
||||||
.smart(false)
|
parse: comrak::ParseOptions {
|
||||||
.default_info_string(None)
|
smart: false,
|
||||||
.relaxed_tasklist_matching(true)
|
default_info_string: None,
|
||||||
.relaxed_autolinks(false)
|
relaxed_tasklist_matching: true,
|
||||||
.build()
|
relaxed_autolinks: false,
|
||||||
.expect("erropr creating default markdown parse options"),
|
broken_link_callback: None,
|
||||||
|
},
|
||||||
render: comrak::RenderOptionsBuilder::default()
|
|
||||||
.hardbreaks(true)
|
render: comrak::RenderOptions {
|
||||||
.github_pre_lang(true)
|
hardbreaks: true,
|
||||||
.full_info_string(false)
|
github_pre_lang: true,
|
||||||
.width(120)
|
full_info_string: false,
|
||||||
.unsafe_(false)
|
width: 120,
|
||||||
.escape(true)
|
unsafe_: false,
|
||||||
.list_style(comrak::ListStyleType::Dash)
|
escape: true,
|
||||||
.sourcepos(false)
|
list_style: comrak::ListStyleType::Dash,
|
||||||
.escaped_char_spans(true)
|
sourcepos: false,
|
||||||
.build()
|
escaped_char_spans: true,
|
||||||
.expect("error creating default markdown render options"),
|
experimental_inline_sourcepos: false,
|
||||||
}
|
ignore_setext: true,
|
||||||
)
|
ignore_empty_links: false,
|
||||||
}
|
gfm_quirks: false,
|
||||||
|
prefer_fenced: true,
|
||||||
|
figure_with_caption: false,
|
||||||
|
tasklist_classes: false,
|
||||||
|
ol_width: 3,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
pub type Cloaker = Box<dyn Fn(&str) -> String>;
|
pub type Cloaker = Box<dyn Fn(&str) -> String>;
|
||||||
|
|
||||||
|
@ -74,7 +80,7 @@ impl Sanitizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn markdown(self, text: &str) -> String {
|
pub fn markdown(self, text: &str) -> String {
|
||||||
self.html(&comrak::markdown_to_html(text, options()))
|
self.html(&comrak::markdown_to_html(text, &OPTIONS))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn html(self, text: &str) -> String {
|
pub fn html(self, text: &str) -> String {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "upub-web"
|
name = "upub-web"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = [ "alemi <me@alemi.dev>" ]
|
authors = [ "alemi <me@alemi.dev>" ]
|
||||||
description = "web frontend for upub"
|
description = "web frontend for upub"
|
||||||
|
@ -19,14 +19,14 @@ tracing = "0.1"
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
tracing-subscriber-wasm = "0.1"
|
tracing-subscriber-wasm = "0.1"
|
||||||
console_error_panic_hook = "0.1"
|
console_error_panic_hook = "0.1"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1.0"
|
||||||
serde_default = "0.2"
|
serde_default = "0.2"
|
||||||
serde-inline-default = "0.2"
|
serde-inline-default = "0.2"
|
||||||
dashmap = "6.1"
|
dashmap = "6.1"
|
||||||
leptos = { version = "0.6", features = ["csr", "tracing"] }
|
leptos = { version = "0.6", features = ["csr", "tracing"] } # locked because upgrading is hell
|
||||||
leptos_router = { version = "0.6", features = ["csr"] }
|
leptos_router = { version = "0.6", features = ["csr"] } # locked because upgrading is hell
|
||||||
leptos-use = "0.13"
|
leptos-use = "0.15"
|
||||||
codee = { version = "0.2", features = ["json_serde"] }
|
codee = { version = "0.2", features = ["json_serde"] }
|
||||||
reqwest = { version = "0.12", features = ["json"] }
|
reqwest = { version = "0.12", features = ["json"] }
|
||||||
apb = { path = "../apb", features = ["unstructured", "activitypub-fe", "activitypub-counters", "litepub", "did-core"] }
|
apb = { path = "../apb", features = ["unstructured", "activitypub-fe", "activitypub-counters", "litepub", "did-core"] }
|
||||||
|
@ -37,4 +37,4 @@ chrono = { version = "0.4", features = ["serde"] }
|
||||||
jrd = "0.1"
|
jrd = "0.1"
|
||||||
tld = "2.36"
|
tld = "2.36"
|
||||||
web-sys = { version = "0.3", features = ["Screen"] }
|
web-sys = { version = "0.3", features = ["Screen"] }
|
||||||
regex = "1.10.6"
|
regex = "1.11"
|
||||||
|
|
Loading…
Reference in a new issue