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]
|
||||
name = "upub-bin"
|
||||
version = "0.4.0"
|
||||
version = "0.4.2"
|
||||
edition = "2021"
|
||||
authors = [ "alemi <me@alemi.dev>" ]
|
||||
description = "Traits and types to handle ActivityPub objects"
|
||||
|
@ -34,8 +34,8 @@ tracing-subscriber = "0.3"
|
|||
clap = { version = "4.5", features = ["derive"] }
|
||||
signal-hook = "0.3"
|
||||
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
|
||||
tokio = { version = "1.40", features = ["full"] } # TODO slim this down
|
||||
sea-orm = { version = "1.0", features = ["sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls"] }
|
||||
tokio = { version = "1.43", features = ["full"] } # TODO slim this down
|
||||
sea-orm = { version = "1.1", features = ["sqlx-sqlite", "sqlx-postgres", "runtime-tokio-rustls"] }
|
||||
futures = "0.3"
|
||||
|
||||
upub = { path = "upub/core" }
|
||||
|
|
|
@ -15,11 +15,11 @@ readme = "README.md"
|
|||
|
||||
[dependencies]
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
thiserror = "1"
|
||||
thiserror = "2.0"
|
||||
paste = "1.0"
|
||||
tracing = "0.1"
|
||||
serde_json = { version = "1", optional = true }
|
||||
sea-orm = { version = "1.0", optional = true, default-features = false }
|
||||
serde_json = { version = "1.0", optional = true }
|
||||
sea-orm = { version = "1.1", optional = true, default-features = false }
|
||||
reqwest = { version = "0.12", features = ["json"], optional = true }
|
||||
|
||||
[features]
|
||||
|
|
|
@ -14,13 +14,13 @@ readme = "README.md"
|
|||
apb = { path = "../../apb/" }
|
||||
upub = { path = "../core" }
|
||||
tracing = "0.1"
|
||||
serde_json = "1"
|
||||
serde_json = "1.0"
|
||||
sha256 = "1.5"
|
||||
uuid = { version = "1.10", features = ["v4"] }
|
||||
uuid = { version = "1.11", features = ["v4"] }
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
||||
clap = { version = "4.5", features = ["derive"] }
|
||||
sea-orm = "1.0"
|
||||
sea-orm = "1.1"
|
||||
futures = "0.3"
|
||||
mdhtml = { path = "../../utils/mdhtml/" }
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "upub"
|
||||
version = "0.4.1"
|
||||
version = "0.4.2"
|
||||
edition = "2021"
|
||||
authors = [ "alemi <me@alemi.dev>" ]
|
||||
description = "core inner workings of upub"
|
||||
|
@ -11,7 +11,7 @@ readme = "README.md"
|
|||
[lib]
|
||||
|
||||
[dependencies]
|
||||
thiserror = "1"
|
||||
thiserror = "2.0"
|
||||
async-recursion = "1.1"
|
||||
async-trait = "0.1"
|
||||
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
|
||||
base64 = "0.22"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
uuid = { version = "1.10", features = ["v4"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
uuid = { version = "1.11", features = ["v4"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
serde_default = "0.2"
|
||||
serde-inline-default = "0.2"
|
||||
toml = "0.8"
|
||||
|
@ -31,7 +31,7 @@ httpsign = { path = "../../utils/httpsign/" }
|
|||
mdhtml = { path = "../../utils/mdhtml/" }
|
||||
jrd = "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"] }
|
||||
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!!!
|
||||
|
|
|
@ -11,4 +11,4 @@ readme = "README.md"
|
|||
[lib]
|
||||
|
||||
[dependencies]
|
||||
sea-orm-migration = "1.0"
|
||||
sea-orm-migration = "1.1"
|
||||
|
|
|
@ -11,23 +11,23 @@ readme = "README.md"
|
|||
[lib]
|
||||
|
||||
[dependencies]
|
||||
thiserror = "1"
|
||||
thiserror = "2.0"
|
||||
rand = "0.8"
|
||||
sha256 = "1.5" # TODO ughhh
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
upub = { path = "../core/" }
|
||||
jrd = "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"] }
|
||||
axum = { version = "0.7", features = ["multipart"] }
|
||||
tower-http = { version = "0.5", features = ["cors", "trace"] }
|
||||
axum = { version = "0.8", features = ["multipart"] }
|
||||
tower-http = { version = "0.6", features = ["cors", "trace"] }
|
||||
httpsign = { path = "../../utils/httpsign/", features = ["axum"] }
|
||||
apb = { path = "../../apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot", "jsonld"] }
|
||||
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 = { git = "https://codeberg.org/thefederationinfo/nodeinfo-rs", rev = "e865094804" }
|
||||
# mastodon
|
||||
|
|
|
@ -82,7 +82,6 @@ impl Identity {
|
|||
|
||||
pub struct AuthIdentity(pub Identity);
|
||||
|
||||
#[axum::async_trait]
|
||||
impl<S> FromRequestParts<S> for AuthIdentity
|
||||
where
|
||||
upub::Context: FromRef<S>,
|
||||
|
|
|
@ -11,14 +11,14 @@ readme = "README.md"
|
|||
[lib]
|
||||
|
||||
[dependencies]
|
||||
thiserror = "1"
|
||||
thiserror = "2.0"
|
||||
tracing = "0.1"
|
||||
async-trait = "0.1"
|
||||
serde_json = "1"
|
||||
sea-orm = "1.0"
|
||||
regex = "1.10"
|
||||
serde_json = "1.0"
|
||||
sea-orm = "1.1"
|
||||
regex = "1.11"
|
||||
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"] }
|
||||
apb = { path = "../../apb", features = ["unstructured", "orm", "activitypub-fe", "activitypub-counters", "litepub", "ostatus", "toot"] }
|
||||
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
|
||||
|
||||
[dependencies]
|
||||
thiserror = "1"
|
||||
thiserror = "2.0"
|
||||
tracing = "0.1"
|
||||
base64 = "0.22"
|
||||
openssl = "0.10" # TODO handle pubkeys with a smaller crate
|
||||
axum = { version = "0.7", optional = true }
|
||||
axum = { version = "0.8", optional = true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
|
|
@ -15,9 +15,9 @@ path = "lib.rs"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
html5ever = "0.27"
|
||||
html5ever = "0.27" # have to lock this because newer versions don't get &mut self anymore
|
||||
tracing = "0.1"
|
||||
comrak = { version = "0.23", optional = true }
|
||||
comrak = { version = "0.33", optional = true }
|
||||
|
||||
[features]
|
||||
default = ["markdown"]
|
||||
|
|
|
@ -1,53 +1,59 @@
|
|||
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
|
||||
// makes it impossible to construct them with struct syntax! I need to use this BULLSHIT
|
||||
// builder pattern. And it's NOT CONST!!! I have to keep this shit heap allocated somewhere
|
||||
// because this thing is #[non_exhaustive]... oh i hate this so much
|
||||
fn options() -> &'static comrak::Options {
|
||||
static OPTIONS: std::sync::OnceLock<comrak::Options> = std::sync::OnceLock::new();
|
||||
OPTIONS.get_or_init(||
|
||||
comrak::Options {
|
||||
extension: comrak::ExtensionOptionsBuilder::default()
|
||||
.autolink(true)
|
||||
.strikethrough(true)
|
||||
.description_lists(false)
|
||||
.tagfilter(true)
|
||||
.table(true)
|
||||
.tasklist(false)
|
||||
.superscript(true)
|
||||
.header_ids(None)
|
||||
.footnotes(false)
|
||||
.front_matter_delimiter(None)
|
||||
.multiline_block_quotes(true)
|
||||
.math_dollars(true)
|
||||
.math_code(true)
|
||||
.build()
|
||||
.expect("error creating default markdown extension options"),
|
||||
const OPTIONS: comrak::Options<'static> = comrak::Options {
|
||||
extension: comrak::ExtensionOptions {
|
||||
strikethrough: true,
|
||||
tagfilter: true,
|
||||
table: true,
|
||||
autolink: true,
|
||||
tasklist: false,
|
||||
superscript: true,
|
||||
header_ids: None,
|
||||
footnotes: false,
|
||||
description_lists: false,
|
||||
front_matter_delimiter: None,
|
||||
multiline_block_quotes: true,
|
||||
math_dollars: true,
|
||||
math_code: true,
|
||||
wikilinks_title_after_pipe: false,
|
||||
wikilinks_title_before_pipe: false,
|
||||
underline: true,
|
||||
subscript: true,
|
||||
spoiler: true,
|
||||
greentext: true,
|
||||
// TODO use these two for cloaking?
|
||||
image_url_rewriter: None,
|
||||
link_url_rewriter: None,
|
||||
},
|
||||
|
||||
parse: comrak::ParseOptionsBuilder::default()
|
||||
.smart(false)
|
||||
.default_info_string(None)
|
||||
.relaxed_tasklist_matching(true)
|
||||
.relaxed_autolinks(false)
|
||||
.build()
|
||||
.expect("erropr creating default markdown parse options"),
|
||||
parse: comrak::ParseOptions {
|
||||
smart: false,
|
||||
default_info_string: None,
|
||||
relaxed_tasklist_matching: true,
|
||||
relaxed_autolinks: false,
|
||||
broken_link_callback: None,
|
||||
},
|
||||
|
||||
render: comrak::RenderOptionsBuilder::default()
|
||||
.hardbreaks(true)
|
||||
.github_pre_lang(true)
|
||||
.full_info_string(false)
|
||||
.width(120)
|
||||
.unsafe_(false)
|
||||
.escape(true)
|
||||
.list_style(comrak::ListStyleType::Dash)
|
||||
.sourcepos(false)
|
||||
.escaped_char_spans(true)
|
||||
.build()
|
||||
.expect("error creating default markdown render options"),
|
||||
}
|
||||
)
|
||||
}
|
||||
render: comrak::RenderOptions {
|
||||
hardbreaks: true,
|
||||
github_pre_lang: true,
|
||||
full_info_string: false,
|
||||
width: 120,
|
||||
unsafe_: false,
|
||||
escape: true,
|
||||
list_style: comrak::ListStyleType::Dash,
|
||||
sourcepos: false,
|
||||
escaped_char_spans: true,
|
||||
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>;
|
||||
|
||||
|
@ -74,7 +80,7 @@ impl Sanitizer {
|
|||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "upub-web"
|
||||
version = "0.4.1"
|
||||
version = "0.4.2"
|
||||
edition = "2021"
|
||||
authors = [ "alemi <me@alemi.dev>" ]
|
||||
description = "web frontend for upub"
|
||||
|
@ -19,14 +19,14 @@ tracing = "0.1"
|
|||
tracing-subscriber = "0.3"
|
||||
tracing-subscriber-wasm = "0.1"
|
||||
console_error_panic_hook = "0.1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
serde_default = "0.2"
|
||||
serde-inline-default = "0.2"
|
||||
dashmap = "6.1"
|
||||
leptos = { version = "0.6", features = ["csr", "tracing"] }
|
||||
leptos_router = { version = "0.6", features = ["csr"] }
|
||||
leptos-use = "0.13"
|
||||
leptos = { version = "0.6", features = ["csr", "tracing"] } # locked because upgrading is hell
|
||||
leptos_router = { version = "0.6", features = ["csr"] } # locked because upgrading is hell
|
||||
leptos-use = "0.15"
|
||||
codee = { version = "0.2", features = ["json_serde"] }
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
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"
|
||||
tld = "2.36"
|
||||
web-sys = { version = "0.3", features = ["Screen"] }
|
||||
regex = "1.10.6"
|
||||
regex = "1.11"
|
||||
|
|
Loading…
Reference in a new issue