Restore recourse forum from recovered file-history snapshots

2264215 · gmorell · 2026-12-02 15:55

143 files +7705 -1877
Message
{commit_body(@commit)}

Files changed

modified .dockerignore
+3 −7
@@ -1,11 +1,7 @@
1 1 target/
2 −**/target/
3 −.git/
4 −.idea/
5 −.vscode/
6 2 assets/node_modules/
7 3 assets/f/css/app.css
8 4 assets/f/js/app.js
9 −README.md
10 −Justfile
11 −cargo-generate.toml
5 +assets/f/webfonts/
6 +.git/
7 +.idea/
modified Cargo.toml
+25 −32
@@ -3,61 +3,54 @@ members = [".", "migration"]
3 3
4 4 [workspace.dependencies]
5 5 sea-orm = { version = "1.1.1", features = ["sqlx-postgres", "runtime-tokio-rustls", "macros", "with-chrono", "with-uuid"] }
6 −chrono = { version = "0.4", features = ["serde"] }
7 −uuid = { version = "1", features = ["v4", "v7", "serde"] }
6 +chrono = { version = "0.4.38", features = ["serde"] }
7 +uuid = { version = "1.11.0", features = ["v4", "v7", "serde"] }
8 8 serde = { version = "1.0", features = ["derive"] }
9 9
10 10 [package]
11 11 name = "recourse"
12 12 version = "0.1.0"
13 13 edition = "2024"
14 +default-run = "recourse"
14 15
15 16 [lib]
16 17 name = "recourse"
17 18 path = "src/lib.rs"
18 19
19 −[dependencies]
20 −# Web
21 −axum = "0.8.5"
22 −axum-htmx = { version = "0.7.0", features = ["tokio"] }
23 −tower-http = { version = "0.6", features = ["fs", "trace"] }
24 −tokio = { version = "1", features = ["full"] }
20 +[[bin]]
21 +name = "recourse"
22 +path = "src/main.rs"
25 23
26 −# Templating
27 −minijinja = { version = "2.10", features = ["loader", "builtins", "json", "urlencode"] }
24 +[dependencies]
25 +# Web stack
26 +axum = { version = "0.8.5", features = ["multipart"] }
27 +tokio = { version = "1.47.1", features = ["full"] }
28 +tower-http = { version = "0.6.6", features = ["fs", "trace"] }
29 +tracing = "0.1.41"
30 +tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
31 +log = "0.4.28"
32 +anyhow = "1.0.100"
33 +minijinja = { version = "2.10.2", features = ["loader", "builtins", "json", "urlencode"] }
28 34 minijinja-embed = "2.12"
29 −
30 −# Observability
31 −log = "0.4"
32 −tracing = "0.1"
33 −tracing-subscriber = { version = "0.3", features = ["env-filter"] }
35 +axum-htmx = { version = "0.7.0", features = ["tokio"] }
34 36 axum-prometheus = "0.9.0"
35 37 metrics-process = "2.4.0"
38 +serde = { workspace = true }
39 +serde_json = "1.0.145"
36 40
37 −# Errors
38 −anyhow = "1.0"
39 −thiserror = "2.0"
40 −
41 −# Database
41 +# Database + auth
42 42 sea-orm = { workspace = true }
43 43 chrono = { workspace = true }
44 44 uuid = { workspace = true }
45 −serde = { workspace = true }
46 −serde_json = "1.0"
45 +argon2 = { version = "0.5", features = ["std"] }
47 46 migration = { path = "./migration" }
48 47
49 −# Auth
50 −argon2 = { version = "0.5", features = ["std"] }
48 +# Markdown rendering for post bodies
49 +pulldown-cmark = "0.12"
50 +ammonia = "4"
51 51
52 −# CLI (registration-token, queue-worker)
52 +# CLI (registration-token binary)
53 53 clap = { version = "4.5", features = ["derive"] }
54 54
55 −# Queue (RabbitMQ)
56 −lapin = "2.5"
57 −futures-util = "0.3"
58 −
59 55 [build-dependencies]
60 56 minijinja-embed = "2.12"
61 −
62 −[dev-dependencies]
63 −tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
modified Dockerfile
+33 −31

Click to load diff…

modified Justfile
+54 −31

Click to load diff…

modified README.md
+36 −111

Click to load diff…

modified assets/.gitignore
+1 −1

Click to load diff…

added assets/README.md
+21 −0

Click to load diff…

modified assets/f/js/src.js
+8 −22

Click to load diff…

modified assets/package.json
+5 −3

Click to load diff…

modified assets/tailwind.config.js
+83 −91

Click to load diff…

modified build.rs
+3 −3

Click to load diff…

modified compose.yml
+15 −39

Click to load diff…

modified migration/src/lib.rs
+26 −2

Click to load diff…

modified migration/src/m20240101_000001_create_auth_tables.rs
+53 −56

Click to load diff…

added migration/src/m20240101_000002_create_forum_tables.rs
+180 −0

Click to load diff…

deleted migration/src/m20240101_000002_create_notes.rs
+0 −70

Click to load diff…

added migration/src/m20240101_000003_add_user_staff.rs
+40 −0

Click to load diff…

added migration/src/m20240101_000004_post_edits_and_soft_delete.rs
+125 −0

Click to load diff…

added migration/src/m20240101_000005_topic_soft_delete.rs
+38 −0

Click to load diff…

added migration/src/m20240101_000006_category_parent.rs
+62 −0

Click to load diff…

added migration/src/m20240101_000007_user_preferred_sort.rs
+40 −0

Click to load diff…

added migration/src/m20240101_000008_user_avatar.rs
+38 −0

Click to load diff…

added migration/src/m20240101_000009_bookmarks.rs
+64 −0

Click to load diff…

added migration/src/m20240101_000010_watches_and_notifications.rs
+85 −0

Click to load diff…

added migration/src/m20240101_000011_reactions.rs
+106 −0

Click to load diff…

added migration/src/m20240101_000012_tags.rs
+66 −0

Click to load diff…

added migration/src/m20240101_000013_user_trust_level.rs
+40 −0

Click to load diff…

added migration/src/m20240101_000014_category_min_trust.rs
+37 −0

Click to load diff…

added src/auth/api_tokens.rs
+91 −0

Click to load diff…

modified src/auth/mod.rs
+4 −0

Click to load diff…

modified src/auth/password.rs
+28 −21

Click to load diff…

modified src/auth/tokens.rs
+63 −54

Click to load diff…

modified src/auth/users.rs
+104 −65

Click to load diff…

added src/avatar.rs
+74 −0

Click to load diff…

added src/bin/manage.rs
+267 −0

Click to load diff…

deleted src/bin/queue-worker.rs
+0 −33

Click to load diff…

deleted src/bin/registration-token.rs
+0 −85

Click to load diff…

deleted src/bin/webservice.rs
+0 −135

Click to load diff…

added src/category_tree.rs
+281 −0

Click to load diff…

modified src/config.rs
+33 −30

Click to load diff…

renamed src/entities/notes.rs → src/entities/api_tokens.rs
+6 −5

Click to load diff…

added src/entities/bookmarks.rs
+46 −0

Click to load diff…

added src/entities/categories.rs
+36 −0

Click to load diff…

added src/entities/category_watches.rs
+34 −0

Click to load diff…

modified src/entities/mod.rs
+13 −3

Click to load diff…

added src/entities/notifications.rs
+29 −0

Click to load diff…

added src/entities/post_reactions.rs
+23 −0

Click to load diff…

added src/entities/post_revisions.rs
+53 −0

Click to load diff…

added src/entities/posts.rs
+64 −0

Click to load diff…

modified src/entities/prelude.rs
+14 −1

Click to load diff…

added src/entities/reaction_types.rs
+20 −0

Click to load diff…

modified src/entities/registration_tokens.rs
+2 −2

Click to load diff…

added src/entities/tags.rs
+18 −0

Click to load diff…

added src/entities/topic_tags.rs
+33 −0

Click to load diff…

added src/entities/topics.rs
+66 −0

Click to load diff…

modified src/entities/users.rs
+15 −8

Click to load diff…

added src/handlers/api_tokens.rs
+128 −0

Click to load diff…

modified src/handlers/auth.rs
+217 −131

Click to load diff…

added src/handlers/avatar.rs
+99 −0

Click to load diff…

added src/handlers/bookmarks.rs
+169 −0

Click to load diff…

added src/handlers/categories.rs
+361 −0

Click to load diff…

added src/handlers/forum.rs
+1058 −0

Click to load diff…

modified src/handlers/mod.rs
+32 −28

Click to load diff…

deleted src/handlers/notes.rs
+0 −125

Click to load diff…

added src/handlers/notifications.rs
+351 −0

Click to load diff…

added src/handlers/posts.rs
+248 −0

Click to load diff…

added src/handlers/reactions.rs
+381 −0

Click to load diff…

added src/handlers/tags.rs
+187 −0

Click to load diff…

modified src/lib.rs
+20 −23

Click to load diff…

added src/main.rs
+219 −0

Click to load diff…

added src/markdown.rs
+42 −0

Click to load diff…

modified src/middleware/auth.rs
+115 −37

Click to load diff…

modified src/middleware/mod.rs
+1 −1

Click to load diff…

deleted src/queue/consumer.rs
+0 −115

Click to load diff…

deleted src/queue/messages.rs
+0 −9

Click to load diff…

deleted src/queue/mod.rs
+0 −16

Click to load diff…

deleted src/queue/publisher.rs
+0 −62

Click to load diff…

added src/timeutil.rs
+53 −0

Click to load diff…

added src/trust.rs
+133 −0

Click to load diff…

deleted src/workers/example.rs
+0 −31

Click to load diff…

deleted src/workers/mod.rs
+0 −3

Click to load diff…

added templates/_avatar.html
+11 −0

Click to load diff…

deleted templates/_feature_workers.html
+0 −11

Click to load diff…

added templates/_index.html
+38 −0

Click to load diff…

added templates/_notif_badge.html
+1 −0

Click to load diff…

added templates/_notif_item.html
+23 −0

Click to load diff…

modified templates/_theme_toggle.html
+4 −4

Click to load diff…

added templates/admin/categories.html
+57 −0

Click to load diff…

added templates/admin/category_form.html
+80 −0

Click to load diff…

added templates/admin/reactions.html
+55 −0

Click to load diff…

added templates/api_tokens/created.html
+28 −0

Click to load diff…

added templates/api_tokens/list.html
+64 −0

Click to load diff…

modified templates/auth/invites.html
+19 −10

Click to load diff…

modified templates/auth/login.html
+17 −8

Click to load diff…

modified templates/auth/profile.html
+70 −31

Click to load diff…

modified templates/auth/register.html
+30 −15

Click to load diff…

added templates/bookmarks.html
+35 −0

Click to load diff…

added templates/forum/_bookmark_button.html
+5 −0

Click to load diff…

added templates/forum/_post.html
+53 −0

Click to load diff…

added templates/forum/_reactions.html
+8 −0

Click to load diff…

added templates/forum/_topic_list.html
+45 −0

Click to load diff…

added templates/forum/_watch_button.html
+5 −0

Click to load diff…

added templates/forum/category.html
+50 −0

Click to load diff…

added templates/forum/home.html
+51 −0

Click to load diff…

added templates/forum/new_topic.html
+43 −0

Click to load diff…

added templates/forum/topic.html
+88 −0

Click to load diff…

added templates/forum/topic_deleted.html
+15 −0

Click to load diff…

modified templates/index.html
+2 −73

Click to load diff…

deleted templates/notes/_queued_blurb.html
+0 −5

Click to load diff…

deleted templates/notes/_status.html
+0 −17

Click to load diff…

deleted templates/notes/list.html
+0 −44

Click to load diff…

deleted templates/notes/show.html
+0 −21

Click to load diff…

added templates/notifications.html
+22 −0

Click to load diff…

added templates/ok.html
+5 −0

Click to load diff…

added templates/posts/edit.html
+28 −0

Click to load diff…

added templates/posts/history.html
+27 −0

Click to load diff…

added templates/reactions.html
+24 −0

Click to load diff…

modified templates/root.html
+82 −29

Click to load diff…

added templates/search.html
+21 −0

Click to load diff…

added templates/tag.html
+13 −0

Click to load diff…

added templates/tags.html
+18 −0

Click to load diff…

modified tests/templates.rs
+50 −87

Click to load diff…

Parents: 7f67051