diff --git a/Cargo.lock b/Cargo.lock index 694e857..54efba0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -483,6 +483,22 @@ dependencies = [ "shlex", ] +[[package]] +name = "cf-turnstile" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3e7381ca451b439579a09feb1d41d4b07c0e903bf8c74602b9e95219c40e47b" +dependencies = [ + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "secrecy", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "cfg-expr" version = "0.15.8" @@ -638,6 +654,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1236,6 +1262,7 @@ dependencies = [ "hyper", "hyper-util", "rustls", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", @@ -1799,7 +1826,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -2592,12 +2619,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.2.0", +] + [[package]] name = "rustls-pemfile" version = "2.2.0" @@ -2660,6 +2700,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -2667,7 +2716,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.9.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags 2.9.0", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -2961,7 +3023,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.9.0", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -3056,6 +3118,7 @@ version = "0.1.0" dependencies = [ "axum", "axum-extra", + "cf-turnstile", "image", "mime_guess", "pathbufd", diff --git a/README.md b/README.md index a796e9e..5423b10 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ Your first start of Tetratto might be a little slow as it's going to download al In the directory you're running Tetratto from, you should create a `tetratto.toml` file. This file follows the configuration schema defined [here](https://trisuaso.github.io/tetratto/tetratto/config/struct.Config.html)! +Tetratto **requires** Cloudflare Turnstile for registrations. Testing keys are listed [here](https://developers.cloudflare.com/turnstile/troubleshooting/testing/). You can _technically_ disable the captcha by using the always passing, invisible keys. + ## Usage (as a user) Tetratto is very simple once you get the hang of it! At the top of the page (or bottom if you're on mobile), you'll see the navigation bar. Once logged in, you'll be able to access "Home", "Popular", and "Communities" from there! You can also press your profile picture (on the right) to view your own profile, settings, or log out! diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 430c007..129570c 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -29,3 +29,4 @@ reqwest = { version = "0.12.15", features = ["json", "stream"] } regex = "1.11.1" serde_json = "1.0.140" mime_guess = "2.0.5" +cf-turnstile = "0.2.0" diff --git a/crates/app/src/langs/en-US.toml b/crates/app/src/langs/en-US.toml index da55be7..6a6c1cc 100644 --- a/crates/app/src/langs/en-US.toml +++ b/crates/app/src/langs/en-US.toml @@ -48,6 +48,8 @@ version = "1.0.0" "communities:action.select" = "Select" "communities:label.create_new" = "Create new community" "communities:label.name" = "Name" +"communities:label.my_communities" = "My communities" +"communities:label.popular_communities" = "Popular communities" "communities:action.join" = "Join" "communities:action.cancel_request" = "Cancel request" "communities:action.leave" = "Leave" diff --git a/crates/app/src/public/css/style.css b/crates/app/src/public/css/style.css index 7c2ad8e..a62976e 100644 --- a/crates/app/src/public/css/style.css +++ b/crates/app/src/public/css/style.css @@ -149,6 +149,11 @@ article { } /* typo */ +ul, +ol { + margin-left: 1rem; +} + pre, code { font-family: "Jetbrains Mono", "Fire Code", monospace; diff --git a/crates/app/src/public/html/auth/register.html b/crates/app/src/public/html/auth/register.html index cf9ac54..d0054b2 100644 --- a/crates/app/src/public/html/auth/register.html +++ b/crates/app/src/public/html/auth/register.html @@ -1,6 +1,11 @@ {% extends "auth/base.html" %} {% block head %}