Merge remote-tracking branch 'upstream/main'

This commit is contained in:
dullbananas 2023-06-13 13:43:56 +00:00
commit ddc32b2425
10 changed files with 321 additions and 230 deletions

View file

@ -1,3 +1,3 @@
# Contributing # Contributing
See [here](https://join-lemmy.org/docs/en/contributing/contributing.html) for contributing Instructions. See [here](https://join-lemmy.org/docs/en/contributors/01-overview.html) for contributing Instructions.

259
Cargo.lock generated
View file

@ -14,17 +14,16 @@ dependencies = [
[[package]] [[package]]
name = "activitypub_federation" name = "activitypub_federation"
version = "0.4.0" version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b52228e706f380074b0722dae97f9c8274264026dbd3aa16d20466758995b6f4" checksum = "f85cab86a72489b908adfeec61a4f104124b01784b9a5bb721c988727c363dad"
dependencies = [ dependencies = [
"activitystreams-kinds", "activitystreams-kinds",
"actix-rt",
"actix-web", "actix-web",
"anyhow", "anyhow",
"async-trait", "async-trait",
"background-jobs", "background-jobs",
"base64", "base64 0.21.2",
"bytes", "bytes",
"chrono", "chrono",
"derive_builder 0.12.0", "derive_builder 0.12.0",
@ -33,7 +32,7 @@ dependencies = [
"enum_delegate", "enum_delegate",
"futures-core", "futures-core",
"http", "http",
"http-signature-normalization", "http-signature-normalization 0.7.0",
"http-signature-normalization-reqwest", "http-signature-normalization-reqwest",
"httpdate", "httpdate",
"itertools", "itertools",
@ -53,9 +52,9 @@ dependencies = [
[[package]] [[package]]
name = "activitystreams-kinds" name = "activitystreams-kinds"
version = "0.2.1" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d014a4fb8828870b7b46bee6257b9a89d06188ae8d435381ba94f14c8c697d8" checksum = "e97dfe76efd8c0b113cc3580a6b5f4acba47662e3cfbbfcce081c9ac89798990"
dependencies = [ dependencies = [
"serde", "serde",
"url", "url",
@ -111,17 +110,17 @@ dependencies = [
[[package]] [[package]]
name = "actix-http" name = "actix-http"
version = "3.2.2" version = "3.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c83abf9903e1f0ad9973cc4f7b9767fd5a03a583f51a5b7a339e07987cd2724" checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74"
dependencies = [ dependencies = [
"actix-codec", "actix-codec",
"actix-rt", "actix-rt",
"actix-service", "actix-service",
"actix-tls", "actix-tls",
"actix-utils", "actix-utils",
"ahash", "ahash 0.8.3",
"base64", "base64 0.21.2",
"bitflags 1.3.2", "bitflags 1.3.2",
"bytes", "bytes",
"bytestring", "bytestring",
@ -141,6 +140,8 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
"sha1", "sha1",
"smallvec", "smallvec",
"tokio",
"tokio-util 0.7.4",
"tracing", "tracing",
] ]
@ -256,9 +257,9 @@ dependencies = [
[[package]] [[package]]
name = "actix-web" name = "actix-web"
version = "4.2.1" version = "4.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d48f7b6534e06c7bfc72ee91db7917d4af6afe23e7d223b51e68fffbb21e96b9" checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96"
dependencies = [ dependencies = [
"actix-codec", "actix-codec",
"actix-http", "actix-http",
@ -270,7 +271,7 @@ dependencies = [
"actix-tls", "actix-tls",
"actix-utils", "actix-utils",
"actix-web-codegen", "actix-web-codegen",
"ahash", "ahash 0.7.6",
"bytes", "bytes",
"bytestring", "bytestring",
"cfg-if", "cfg-if",
@ -298,9 +299,9 @@ dependencies = [
[[package]] [[package]]
name = "actix-web-codegen" name = "actix-web-codegen"
version = "4.1.0" version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fa9362663c8643d67b2d5eafba49e4cb2c8a053a29ed00a0bea121f17c76b13" checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9"
dependencies = [ dependencies = [
"actix-router", "actix-router",
"proc-macro2", "proc-macro2",
@ -335,14 +336,32 @@ dependencies = [
] ]
[[package]] [[package]]
name = "aho-corasick" name = "ahash"
version = "0.7.19" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
dependencies = [
"cfg-if",
"getrandom 0.2.8",
"once_cell",
"version_check",
]
[[package]]
name = "aho-corasick"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "android-tzdata"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]] [[package]]
name = "android_system_properties" name = "android_system_properties"
version = "0.1.5" version = "0.1.5"
@ -354,9 +373,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.66" version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
[[package]] [[package]]
name = "arrayvec" name = "arrayvec"
@ -460,8 +479,8 @@ dependencies = [
"actix-service", "actix-service",
"actix-tls", "actix-tls",
"actix-utils", "actix-utils",
"ahash", "ahash 0.7.6",
"base64", "base64 0.13.1",
"bytes", "bytes",
"cfg-if", "cfg-if",
"derive_more", "derive_more",
@ -604,13 +623,19 @@ version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "base64"
version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d"
[[package]] [[package]]
name = "bcrypt" name = "bcrypt"
version = "0.13.0" version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7e7c93a3fb23b2fdde989b2c9ec4dd153063ec81f408507f84c090cd91c6641" checksum = "a7e7c93a3fb23b2fdde989b2c9ec4dd153063ec81f408507f84c090cd91c6641"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"blowfish", "blowfish",
"getrandom 0.2.8", "getrandom 0.2.8",
"zeroize", "zeroize",
@ -722,7 +747,7 @@ version = "0.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db21780337b425f968a2c3efa842eeaa4fe53d2bcb1eb27d2877460a862fb0ab" checksum = "db21780337b425f968a2c3efa842eeaa4fe53d2bcb1eb27d2877460a862fb0ab"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"hound", "hound",
"image", "image",
"lodepng", "lodepng",
@ -750,13 +775,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "chrono" name = "chrono"
version = "0.4.23" version = "0.4.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5"
dependencies = [ dependencies = [
"android-tzdata",
"iana-time-zone", "iana-time-zone",
"js-sys", "js-sys",
"num-integer",
"num-traits", "num-traits",
"serde", "serde",
"time 0.1.44", "time 0.1.44",
@ -1490,13 +1515,13 @@ dependencies = [
[[package]] [[package]]
name = "displaydoc" name = "displaydoc"
version = "0.2.3" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.103", "syn 2.0.18",
] ]
[[package]] [[package]]
@ -1507,9 +1532,9 @@ checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257"
[[package]] [[package]]
name = "doku" name = "doku"
version = "0.20.0" version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "966b1227ac4d9d77f4d7e9507dd01c56ceaec6e35888661b54319123da47b159" checksum = "d018fadaf95088d2c12b66fe5b9d7c04a027b996c42a7b403b83fbd7a1c31531"
dependencies = [ dependencies = [
"doku-derive", "doku-derive",
"serde", "serde",
@ -1519,9 +1544,9 @@ dependencies = [
[[package]] [[package]]
name = "doku-derive" name = "doku-derive"
version = "0.20.0" version = "0.21.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "252ec56116f931b050b5d80512c2c76f4807a297dd95a93f37593dd7650868a5" checksum = "74073dd10495ce912909655131925b0459d49363751b93676148d843097fe825"
dependencies = [ dependencies = [
"darling 0.13.4", "darling 0.13.4",
"proc-macro2", "proc-macro2",
@ -1573,9 +1598,9 @@ dependencies = [
[[package]] [[package]]
name = "dyn-clone" name = "dyn-clone"
version = "1.0.9" version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
[[package]] [[package]]
name = "either" name = "either"
@ -1589,7 +1614,7 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34dd14c63662e0206599796cd5e1ad0268ab2b9d19b868d6050d688eba2bbf98" checksum = "34dd14c63662e0206599796cd5e1ad0268ab2b9d19b868d6050d688eba2bbf98"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"memchr", "memchr",
] ]
@ -1834,9 +1859,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]] [[package]]
name = "form_urlencoded" name = "form_urlencoded"
version = "1.1.0" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
dependencies = [ dependencies = [
"percent-encoding", "percent-encoding",
] ]
@ -1906,9 +1931,9 @@ dependencies = [
[[package]] [[package]]
name = "futures-core" name = "futures-core"
version = "0.3.25" version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
[[package]] [[package]]
name = "futures-executor" name = "futures-executor"
@ -2046,7 +2071,7 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [ dependencies = [
"ahash", "ahash 0.7.6",
] ]
[[package]] [[package]]
@ -2055,7 +2080,7 @@ version = "7.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"byteorder", "byteorder",
"flate2", "flate2",
"nom 7.1.1", "nom 7.1.1",
@ -2184,9 +2209,9 @@ dependencies = [
[[package]] [[package]]
name = "http" name = "http"
version = "0.2.8" version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
@ -2219,6 +2244,15 @@ dependencies = [
"httpdate", "httpdate",
] ]
[[package]]
name = "http-signature-normalization"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b95e3149194de5f3f9d5225bcc6a8677979f8ff8ce39c85654730ad4824f101e"
dependencies = [
"httpdate",
]
[[package]] [[package]]
name = "http-signature-normalization-actix" name = "http-signature-normalization-actix"
version = "0.6.1" version = "0.6.1"
@ -2228,9 +2262,9 @@ dependencies = [
"actix-http", "actix-http",
"actix-rt", "actix-rt",
"actix-web", "actix-web",
"base64", "base64 0.13.1",
"futures-util", "futures-util",
"http-signature-normalization", "http-signature-normalization 0.6.0",
"sha2", "sha2",
"thiserror", "thiserror",
"tokio", "tokio",
@ -2241,12 +2275,12 @@ dependencies = [
[[package]] [[package]]
name = "http-signature-normalization-reqwest" name = "http-signature-normalization-reqwest"
version = "0.7.1" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e309145e63e70307ab1f521fb6e354158f0255e572da21c9fd56940c5bd5d854" checksum = "3c382c69a07b21accae86298d520579403af6479b1cd1c389e3ee11f01d48627"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"http-signature-normalization", "http-signature-normalization 0.7.0",
"httpdate", "httpdate",
"reqwest", "reqwest",
"reqwest-middleware", "reqwest-middleware",
@ -2365,9 +2399,9 @@ dependencies = [
[[package]] [[package]]
name = "idna" name = "idna"
version = "0.3.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
dependencies = [ dependencies = [
"unicode-bidi", "unicode-bidi",
"unicode-normalization", "unicode-normalization",
@ -2524,7 +2558,7 @@ version = "8.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1aa4b4af834c6cfd35d8763d359661b90f2e45d8f750a0849156c7f4671af09c" checksum = "1aa4b4af834c6cfd35d8763d359661b90f2e45d8f750a0849156c7f4671af09c"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"pem", "pem",
"ring", "ring",
"serde", "serde",
@ -2551,7 +2585,7 @@ dependencies = [
"actix-web", "actix-web",
"anyhow", "anyhow",
"async-trait", "async-trait",
"base64", "base64 0.13.1",
"bcrypt", "bcrypt",
"captcha", "captcha",
"lemmy_api_common", "lemmy_api_common",
@ -2836,7 +2870,7 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eabca5e0b4d0e98e7f2243fb5b7520b6af2b65d8f87bcc86f2c75185a6ff243" checksum = "2eabca5e0b4d0e98e7f2243fb5b7520b6af2b65d8f87bcc86f2c75185a6ff243"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"email-encoding", "email-encoding",
"email_address", "email_address",
"fastrand", "fastrand",
@ -3336,15 +3370,15 @@ dependencies = [
[[package]] [[package]]
name = "once_cell" name = "once_cell"
version = "1.16.0" version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.10.42" version = "0.10.54"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"cfg-if", "cfg-if",
@ -3374,11 +3408,10 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.9.76" version = "0.9.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5230151e44c0f05157effb743e8d517472843121cf9243e8b81393edb5acd9ce" checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617"
dependencies = [ dependencies = [
"autocfg",
"cc", "cc",
"libc", "libc",
"pkg-config", "pkg-config",
@ -3615,14 +3648,14 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4" checksum = "03c64931a1a212348ec4f3b4362585eca7159d0d09cbdf4a7f74f02173596fd4"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
] ]
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
[[package]] [[package]]
name = "pest" name = "pest"
@ -3785,7 +3818,7 @@ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
"awc", "awc",
"base64", "base64 0.13.1",
"clap", "clap",
"color-eyre", "color-eyre",
"config", "config",
@ -3893,7 +3926,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c" checksum = "878c6cbf956e03af9aa8204b407b9cbf47c072164800aa918c516cd4b056c50c"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"byteorder", "byteorder",
"bytes", "bytes",
"fallible-iterator", "fallible-iterator",
@ -4242,13 +4275,13 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.7.1" version = "1.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
"regex-syntax", "regex-syntax 0.7.2",
] ]
[[package]] [[package]]
@ -4257,7 +4290,7 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
dependencies = [ dependencies = [
"regex-syntax", "regex-syntax 0.6.27",
] ]
[[package]] [[package]]
@ -4266,6 +4299,12 @@ version = "0.6.27"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244"
[[package]]
name = "regex-syntax"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
[[package]] [[package]]
name = "remove_dir_all" name = "remove_dir_all"
version = "0.5.3" version = "0.5.3"
@ -4277,11 +4316,11 @@ dependencies = [
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.11.12" version = "0.11.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55"
dependencies = [ dependencies = [
"base64", "base64 0.21.2",
"bytes", "bytes",
"encoding_rs", "encoding_rs",
"futures-core", "futures-core",
@ -4310,15 +4349,16 @@ dependencies = [
"url", "url",
"wasm-bindgen", "wasm-bindgen",
"wasm-bindgen-futures", "wasm-bindgen-futures",
"wasm-streams",
"web-sys", "web-sys",
"winreg", "winreg",
] ]
[[package]] [[package]]
name = "reqwest-middleware" name = "reqwest-middleware"
version = "0.2.0" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a1c03e9011a8c59716ad13115550469e081e2e9892656b0ba6a47c907921894" checksum = "4531c89d50effe1fac90d095c8b133c20c5c714204feee0bfc3fd158e784209d"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
@ -4380,7 +4420,7 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"bitflags 1.3.2", "bitflags 1.3.2",
"serde", "serde",
] ]
@ -4486,7 +4526,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13332fd1e9538328a80183b9c0bde0cd7065ad2c4405f56b855a51a0a37fffd4" checksum = "13332fd1e9538328a80183b9c0bde0cd7065ad2c4405f56b855a51a0a37fffd4"
dependencies = [ dependencies = [
"base64", "base64 0.13.1",
"hmac", "hmac",
"md-5", "md-5",
"percent-encoding", "percent-encoding",
@ -4604,9 +4644,9 @@ checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.147" version = "1.0.164"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
@ -4623,20 +4663,20 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.147" version = "1.0.164"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.103", "syn 2.0.18",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.87" version = "1.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"itoa", "itoa",
@ -4953,7 +4993,7 @@ version = "0.29.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebd844dfbd9969a9ef8430e954661de43edde353d65e987f935a328619698883" checksum = "ebd844dfbd9969a9ef8430e954661de43edde353d65e987f935a328619698883"
dependencies = [ dependencies = [
"ahash", "ahash 0.7.6",
"ast_node", "ast_node",
"better_scoped_tls", "better_scoped_tls",
"cfg-if", "cfg-if",
@ -5104,11 +5144,11 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]] [[package]]
name = "task-local-extensions" name = "task-local-extensions"
version = "0.1.3" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4167afbec18ae012de40f8cf1b9bf48420abb390678c34821caa07d924941cc4" checksum = "ba323866e5d033818e3240feeb9f7db2c4296674e4d9e16b97b7bf8f490434e8"
dependencies = [ dependencies = [
"tokio", "pin-utils",
] ]
[[package]] [[package]]
@ -5156,22 +5196,22 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.37" version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.37" version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.103", "syn 2.0.18",
] ]
[[package]] [[package]]
@ -5417,7 +5457,7 @@ checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a"
dependencies = [ dependencies = [
"async-stream", "async-stream",
"async-trait", "async-trait",
"base64", "base64 0.13.1",
"bytes", "bytes",
"futures-core", "futures-core",
"futures-util", "futures-util",
@ -5449,7 +5489,7 @@ dependencies = [
"async-stream", "async-stream",
"async-trait", "async-trait",
"axum", "axum",
"base64", "base64 0.13.1",
"bytes", "bytes",
"futures-core", "futures-core",
"futures-util", "futures-util",
@ -5847,9 +5887,9 @@ dependencies = [
[[package]] [[package]]
name = "unicode-bidi" name = "unicode-bidi"
version = "0.3.8" version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
[[package]] [[package]]
name = "unicode-id" name = "unicode-id"
@ -5907,12 +5947,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]] [[package]]
name = "url" name = "url"
version = "2.3.1" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"idna 0.3.0", "idna 0.4.0",
"percent-encoding", "percent-encoding",
"serde", "serde",
] ]
@ -6068,6 +6108,19 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
[[package]]
name = "wasm-streams"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078"
dependencies = [
"futures-util",
"js-sys",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.60" version = "0.3.60"

View file

@ -60,7 +60,7 @@ lemmy_routes = { version = "=0.17.1", path = "./crates/routes" }
lemmy_db_views = { version = "=0.17.1", path = "./crates/db_views" } lemmy_db_views = { version = "=0.17.1", path = "./crates/db_views" }
lemmy_db_views_actor = { version = "=0.17.1", path = "./crates/db_views_actor" } lemmy_db_views_actor = { version = "=0.17.1", path = "./crates/db_views_actor" }
lemmy_db_views_moderator = { version = "=0.17.1", path = "./crates/db_views_moderator" } lemmy_db_views_moderator = { version = "=0.17.1", path = "./crates/db_views_moderator" }
activitypub_federation = { version = "0.4.0", default-features = false, features = ["actix-web"] } activitypub_federation = { version = "0.4.1", default-features = false, features = ["actix-web"] }
diesel = "2.1.0" diesel = "2.1.0"
diesel_migrations = "2.1.0" diesel_migrations = "2.1.0"
diesel-async = "0.3.0" diesel-async = "0.3.0"
@ -78,7 +78,7 @@ reqwest = { version = "0.11.12", features = ["json", "blocking"] }
reqwest-middleware = "0.2.0" reqwest-middleware = "0.2.0"
reqwest-tracing = "0.4.0" reqwest-tracing = "0.4.0"
clokwerk = "0.3.5" clokwerk = "0.3.5"
doku = { version = "0.20.0", features = ["url-2"] } doku = { version = "0.21.1", features = ["url-2"] }
bcrypt = "0.13.0" bcrypt = "0.13.0"
chrono = { version = "0.4.22", features = ["serde"], default-features = false } chrono = { version = "0.4.22", features = ["serde"], default-features = false }
serde_json = { version = "1.0.87", features = ["preserve_order"] } serde_json = { version = "1.0.87", features = ["preserve_order"] }

View file

@ -129,6 +129,7 @@ Each Lemmy server can set its own moderation policy; appointing site-wide admins
- [lemmy-rust-client](https://github.com/LemmyNet/lemmy/tree/main/crates/api_common) - [lemmy-rust-client](https://github.com/LemmyNet/lemmy/tree/main/crates/api_common)
- [go-lemmy](https://gitea.arsenm.dev/Arsen6331/go-lemmy) - [go-lemmy](https://gitea.arsenm.dev/Arsen6331/go-lemmy)
- [Dart API client](https://github.com/LemmurOrg/lemmy_api_client) - [Dart API client](https://github.com/LemmurOrg/lemmy_api_client)
- [Lemmy-Swift-Client](https://github.com/rrainn/Lemmy-Swift-Client)
- [Reddit -> Lemmy Importer](https://github.com/rileynull/RedditLemmyImporter) - [Reddit -> Lemmy Importer](https://github.com/rileynull/RedditLemmyImporter)
- [lemmy-bot - Typescript library to make it easier to make bots for Lemmy](https://github.com/SleeplessOne1917/lemmy-bot) - [lemmy-bot - Typescript library to make it easier to make bots for Lemmy](https://github.com/SleeplessOne1917/lemmy-bot)

View file

@ -1,7 +1,6 @@
{ {
# settings related to the postgresql database # settings related to the postgresql database
database: { database: {
# Configure the database by specifying a URI # Configure the database by specifying a URI
# #
# This is the preferred method to specify database connection details since # This is the preferred method to specify database connection details since
@ -16,13 +15,14 @@
# #
# [0]: https://www.postgresql.org/docs/current/libpq-connect.html#id-1.7.3.8.3.6 # [0]: https://www.postgresql.org/docs/current/libpq-connect.html#id-1.7.3.8.3.6
uri: "postgresql:///lemmy?user=lemmy&host=/var/run/postgresql" uri: "postgresql:///lemmy?user=lemmy&host=/var/run/postgresql"
// or
# or
# Configure the database by specifying parts of a URI # Configure the database by specifying parts of a URI
# #
# Note that specifying the `uri` field should be preferred since it provides # Note that specifying the `uri` field should be preferred since it provides
# greater control over how the connection is made. This merely exists for # greater control over how the connection is made. This merely exists for
# backwards-compatibility. # backwards-compatibility.
{
# Username to connect to postgres # Username to connect to postgres
user: "string" user: "string"
# Password to connect to postgres # Password to connect to postgres
@ -33,7 +33,6 @@
port: 123 port: 123
# Name of the postgres database for lemmy # Name of the postgres database for lemmy
database: "string" database: "string"
}
# Maximum number of active sql connections # Maximum number of active sql connections
pool_size: 5 pool_size: 5
} }

View file

@ -31,13 +31,30 @@ use rss::{
}; };
use serde::Deserialize; use serde::Deserialize;
use std::{collections::BTreeMap, str::FromStr}; use std::{collections::BTreeMap, str::FromStr};
use strum::ParseError;
const RSS_FETCH_LIMIT: i64 = 20; const RSS_FETCH_LIMIT: i64 = 20;
#[derive(Deserialize)] #[derive(Deserialize)]
struct Params { struct Params {
sort: Option<String>, sort: Option<String>,
limit: Option<i64>,
page: Option<i64>,
}
impl Params {
fn sort_type(&self) -> Result<SortType, Error> {
let sort_query = self
.sort
.clone()
.unwrap_or_else(|| SortType::Hot.to_string());
SortType::from_str(&sort_query).map_err(ErrorBadRequest)
}
fn get_limit(&self) -> i64 {
self.limit.unwrap_or(RSS_FETCH_LIMIT)
}
fn get_page(&self) -> i64 {
self.page.unwrap_or(1)
}
} }
enum RequestType { enum RequestType {
@ -68,8 +85,16 @@ async fn get_all_feed(
info: web::Query<Params>, info: web::Query<Params>,
context: web::Data<LemmyContext>, context: web::Data<LemmyContext>,
) -> Result<HttpResponse, Error> { ) -> Result<HttpResponse, Error> {
let sort_type = get_sort_type(info).map_err(ErrorBadRequest)?; Ok(
Ok(get_feed_data(&context, ListingType::All, sort_type).await?) get_feed_data(
&context,
ListingType::All,
info.sort_type()?,
info.get_limit(),
info.get_page(),
)
.await?,
)
} }
#[tracing::instrument(skip_all)] #[tracing::instrument(skip_all)]
@ -77,8 +102,16 @@ async fn get_local_feed(
info: web::Query<Params>, info: web::Query<Params>,
context: web::Data<LemmyContext>, context: web::Data<LemmyContext>,
) -> Result<HttpResponse, Error> { ) -> Result<HttpResponse, Error> {
let sort_type = get_sort_type(info).map_err(ErrorBadRequest)?; Ok(
Ok(get_feed_data(&context, ListingType::Local, sort_type).await?) get_feed_data(
&context,
ListingType::Local,
info.sort_type()?,
info.get_limit(),
info.get_page(),
)
.await?,
)
} }
#[tracing::instrument(skip_all)] #[tracing::instrument(skip_all)]
@ -86,6 +119,8 @@ async fn get_feed_data(
context: &LemmyContext, context: &LemmyContext,
listing_type: ListingType, listing_type: ListingType,
sort_type: SortType, sort_type: SortType,
limit: i64,
page: i64,
) -> Result<HttpResponse, LemmyError> { ) -> Result<HttpResponse, LemmyError> {
let site_view = SiteView::read_local(context.pool()).await?; let site_view = SiteView::read_local(context.pool()).await?;
@ -93,7 +128,8 @@ async fn get_feed_data(
.pool(context.pool()) .pool(context.pool())
.listing_type(Some(listing_type)) .listing_type(Some(listing_type))
.sort(Some(sort_type)) .sort(Some(sort_type))
.limit(Some(RSS_FETCH_LIMIT)) .limit(Some(limit))
.page(Some(page))
.build() .build()
.list() .list()
.await?; .await?;
@ -125,8 +161,6 @@ async fn get_feed(
info: web::Query<Params>, info: web::Query<Params>,
context: web::Data<LemmyContext>, context: web::Data<LemmyContext>,
) -> Result<HttpResponse, Error> { ) -> Result<HttpResponse, Error> {
let sort_type = get_sort_type(info).map_err(ErrorBadRequest)?;
let req_type: String = req.match_info().get("type").unwrap_or("none").parse()?; let req_type: String = req.match_info().get("type").unwrap_or("none").parse()?;
let param: String = req.match_info().get("name").unwrap_or("none").parse()?; let param: String = req.match_info().get("name").unwrap_or("none").parse()?;
@ -143,16 +177,34 @@ async fn get_feed(
let builder = match request_type { let builder = match request_type {
RequestType::User => { RequestType::User => {
get_feed_user(context.pool(), &sort_type, &param, &protocol_and_hostname).await get_feed_user(
context.pool(),
&info.sort_type()?,
&info.get_limit(),
&info.get_page(),
&param,
&protocol_and_hostname,
)
.await
} }
RequestType::Community => { RequestType::Community => {
get_feed_community(context.pool(), &sort_type, &param, &protocol_and_hostname).await get_feed_community(
context.pool(),
&info.sort_type()?,
&info.get_limit(),
&info.get_page(),
&param,
&protocol_and_hostname,
)
.await
} }
RequestType::Front => { RequestType::Front => {
get_feed_front( get_feed_front(
context.pool(), context.pool(),
&jwt_secret, &jwt_secret,
&sort_type, &info.sort_type()?,
&info.get_limit(),
&info.get_page(),
&param, &param,
&protocol_and_hostname, &protocol_and_hostname,
) )
@ -173,18 +225,12 @@ async fn get_feed(
) )
} }
fn get_sort_type(info: web::Query<Params>) -> Result<SortType, ParseError> {
let sort_query = info
.sort
.clone()
.unwrap_or_else(|| SortType::Hot.to_string());
SortType::from_str(&sort_query)
}
#[tracing::instrument(skip_all)] #[tracing::instrument(skip_all)]
async fn get_feed_user( async fn get_feed_user(
pool: &DbPool, pool: &DbPool,
sort_type: &SortType, sort_type: &SortType,
limit: &i64,
page: &i64,
user_name: &str, user_name: &str,
protocol_and_hostname: &str, protocol_and_hostname: &str,
) -> Result<ChannelBuilder, LemmyError> { ) -> Result<ChannelBuilder, LemmyError> {
@ -196,7 +242,8 @@ async fn get_feed_user(
.listing_type(Some(ListingType::All)) .listing_type(Some(ListingType::All))
.sort(Some(*sort_type)) .sort(Some(*sort_type))
.creator_id(Some(person.id)) .creator_id(Some(person.id))
.limit(Some(RSS_FETCH_LIMIT)) .limit(Some(*limit))
.page(Some(*page))
.build() .build()
.list() .list()
.await?; .await?;
@ -217,6 +264,8 @@ async fn get_feed_user(
async fn get_feed_community( async fn get_feed_community(
pool: &DbPool, pool: &DbPool,
sort_type: &SortType, sort_type: &SortType,
limit: &i64,
page: &i64,
community_name: &str, community_name: &str,
protocol_and_hostname: &str, protocol_and_hostname: &str,
) -> Result<ChannelBuilder, LemmyError> { ) -> Result<ChannelBuilder, LemmyError> {
@ -227,7 +276,8 @@ async fn get_feed_community(
.pool(pool) .pool(pool)
.sort(Some(*sort_type)) .sort(Some(*sort_type))
.community_id(Some(community.id)) .community_id(Some(community.id))
.limit(Some(RSS_FETCH_LIMIT)) .limit(Some(*limit))
.page(Some(*page))
.build() .build()
.list() .list()
.await?; .await?;
@ -253,6 +303,8 @@ async fn get_feed_front(
pool: &DbPool, pool: &DbPool,
jwt_secret: &str, jwt_secret: &str,
sort_type: &SortType, sort_type: &SortType,
limit: &i64,
page: &i64,
jwt: &str, jwt: &str,
protocol_and_hostname: &str, protocol_and_hostname: &str,
) -> Result<ChannelBuilder, LemmyError> { ) -> Result<ChannelBuilder, LemmyError> {
@ -265,7 +317,8 @@ async fn get_feed_front(
.listing_type(Some(ListingType::Subscribed)) .listing_type(Some(ListingType::Subscribed))
.local_user(Some(&local_user)) .local_user(Some(&local_user))
.sort(Some(*sort_type)) .sort(Some(*sort_type))
.limit(Some(RSS_FETCH_LIMIT)) .limit(Some(*limit))
.page(Some(*page))
.build() .build()
.list() .list()
.await?; .await?;

View file

@ -43,8 +43,8 @@ pub fn send_email(
(email, port) (email, port)
}; };
// the message length before wrap, 78, is somewhat arbritary but looks good to me // use usize::MAX as the line wrap length, since lettre handles the wrapping for us
let plain_text = html2text::from_read(html.as_bytes(), 78); let plain_text = html2text::from_read(html.as_bytes(), usize::MAX);
let email = Message::builder() let email = Message::builder()
.from( .from(

View file

@ -33,5 +33,4 @@ RUN apk add libpq
# Copy resources # Copy resources
COPY --from=builder /app/lemmy_server /app/lemmy COPY --from=builder /app/lemmy_server /app/lemmy
EXPOSE 8536
CMD ["/app/lemmy"] CMD ["/app/lemmy"]

View file

@ -1,5 +1,11 @@
version: "3.3" version: "3.3"
x-logging: &default-logging
driver: "json-file"
options:
max-size: "50m"
max-file: 4
networks: networks:
# communication to web and clients # communication to web and clients
lemmyexternalproxy: lemmyexternalproxy:
@ -16,8 +22,9 @@ services:
- lemmyexternalproxy - lemmyexternalproxy
ports: ports:
# actual and only port facing any connection from outside # actual and only port facing any connection from outside
# Note, change the left number if port 80 is already in use on your system (or you want to run a reverse proxy outside this config) # Note, change the left number if port 1236 is already in use on your system
- "80:80" # You could use port 80 if you won't use a reverse proxy
- "1236:1236"
- "8536:8536" - "8536:8536"
volumes: volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro,Z - ./nginx.conf:/etc/nginx/nginx.conf:ro,Z
@ -25,6 +32,7 @@ services:
depends_on: depends_on:
- pictrs - pictrs
- lemmy-ui - lemmy-ui
logging: *default-logging
lemmy: lemmy:
# image: dessalines/lemmy:dev # image: dessalines/lemmy:dev
@ -49,6 +57,7 @@ services:
depends_on: depends_on:
- postgres - postgres
- pictrs - pictrs
logging: *default-logging
lemmy-ui: lemmy-ui:
image: dessalines/lemmy-ui:0.17.1 image: dessalines/lemmy-ui:0.17.1
@ -70,6 +79,7 @@ services:
depends_on: depends_on:
- lemmy - lemmy
restart: always restart: always
logging: *default-logging
pictrs: pictrs:
image: asonix/pictrs:0.4.0-beta.19 image: asonix/pictrs:0.4.0-beta.19
@ -93,6 +103,7 @@ services:
volumes: volumes:
- ./volumes/pictrs:/mnt:Z - ./volumes/pictrs:/mnt:Z
restart: always restart: always
logging: *default-logging
postgres: postgres:
image: postgres:15-alpine image: postgres:15-alpine
@ -128,3 +139,4 @@ services:
volumes: volumes:
- ./volumes/postgres:/var/lib/postgresql/data:Z - ./volumes/postgres:/var/lib/postgresql/data:Z
restart: always restart: always
logging: *default-logging

View file

@ -1,5 +1,29 @@
version: "3.3" version: "3.3"
x-ui-default: &ui-default
image: dessalines/lemmy-ui:0.17.3
# assuming lemmy-ui is cloned besides lemmy directory
# build:
# context: ../../../lemmy-ui
# dockerfile: dev.dockerfile
environment:
- LEMMY_UI_HTTPS=false
x-lemmy-default: &lemmy-default
image: lemmy-federation:latest
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
restart: always
x-postgres-default: &postgres-default
image: postgres:15-alpine
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
restart: always
services: services:
nginx: nginx:
image: nginx:1-alpine image: nginx:1-alpine
@ -28,153 +52,103 @@ services:
- ./volumes/pictrs_alpha:/mnt:Z - ./volumes/pictrs_alpha:/mnt:Z
lemmy-alpha-ui: lemmy-alpha-ui:
image: dessalines/lemmy-ui:0.17.1 <<: *ui-default
environment: environment:
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-alpha:8541 - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-alpha:8541
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8541 - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8541
- LEMMY_UI_HTTPS=false
depends_on: depends_on:
- lemmy-alpha - lemmy-alpha
lemmy-alpha: lemmy-alpha:
image: lemmy-federation:latest <<: *lemmy-default
volumes: volumes:
- ./lemmy_alpha.hjson:/config/config.hjson:Z - ./lemmy_alpha.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
depends_on: depends_on:
- postgres_alpha - postgres_alpha
restart: always
ports: ports:
- "8541:8541" - "8541:8541"
postgres_alpha: postgres_alpha:
image: postgres:15-alpine <<: *postgres-default
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
restart: always
volumes: volumes:
- ./volumes/postgres_alpha:/var/lib/postgresql/data:Z - ./volumes/postgres_alpha:/var/lib/postgresql/data:Z
lemmy-beta-ui: lemmy-beta-ui:
image: dessalines/lemmy-ui:0.17.1 <<: *ui-default
environment: environment:
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-beta:8551 - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-beta:8551
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8551 - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8551
- LEMMY_UI_HTTPS=false
depends_on: depends_on:
- lemmy-beta - lemmy-beta
lemmy-beta: lemmy-beta:
image: lemmy-federation:latest <<: *lemmy-default
volumes: volumes:
- ./lemmy_beta.hjson:/config/config.hjson:Z - ./lemmy_beta.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
depends_on: depends_on:
- postgres_beta - postgres_beta
restart: always
ports: ports:
- "8551:8551" - "8551:8551"
postgres_beta: postgres_beta:
image: postgres:15-alpine <<: *postgres-default
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
restart: always
volumes: volumes:
- ./volumes/postgres_beta:/var/lib/postgresql/data:Z - ./volumes/postgres_beta:/var/lib/postgresql/data:Z
lemmy-gamma-ui: lemmy-gamma-ui:
image: dessalines/lemmy-ui:0.17.1 <<: *ui-default
environment: environment:
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-gamma:8561 - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-gamma:8561
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8561 - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8561
- LEMMY_UI_HTTPS=false
depends_on: depends_on:
- lemmy-gamma - lemmy-gamma
lemmy-gamma: lemmy-gamma:
image: lemmy-federation:latest <<: *lemmy-default
volumes: volumes:
- ./lemmy_gamma.hjson:/config/config.hjson:Z - ./lemmy_gamma.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
depends_on: depends_on:
- postgres_gamma - postgres_gamma
restart: always
ports: ports:
- "8561:8561" - "8561:8561"
postgres_gamma: postgres_gamma:
image: postgres:15-alpine <<: *postgres-default
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
restart: always
volumes: volumes:
- ./volumes/postgres_gamma:/var/lib/postgresql/data:Z - ./volumes/postgres_gamma:/var/lib/postgresql/data:Z
# An instance with only an allowlist for beta # An instance with only an allowlist for beta
lemmy-delta-ui: lemmy-delta-ui:
image: dessalines/lemmy-ui:0.17.1 <<: *ui-default
environment: environment:
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-delta:8571 - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-delta:8571
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8571 - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8571
- LEMMY_UI_HTTPS=false
depends_on: depends_on:
- lemmy-delta - lemmy-delta
lemmy-delta: lemmy-delta:
image: lemmy-federation:latest <<: *lemmy-default
volumes: volumes:
- ./lemmy_delta.hjson:/config/config.hjson:Z - ./lemmy_delta.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
depends_on: depends_on:
- postgres_delta - postgres_delta
restart: always
ports: ports:
- "8571:8571" - "8571:8571"
postgres_delta: postgres_delta:
image: postgres:15-alpine <<: *postgres-default
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
restart: always
volumes: volumes:
- ./volumes/postgres_delta:/var/lib/postgresql/data:Z - ./volumes/postgres_delta:/var/lib/postgresql/data:Z
# An instance who has a blocklist, with lemmy-alpha blocked # An instance who has a blocklist, with lemmy-alpha blocked
lemmy-epsilon-ui: lemmy-epsilon-ui:
image: dessalines/lemmy-ui:0.17.1 <<: *ui-default
environment: environment:
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-epsilon:8581 - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-epsilon:8581
- LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8581 - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:8581
- LEMMY_UI_HTTPS=false
depends_on: depends_on:
- lemmy-epsilon - lemmy-epsilon
lemmy-epsilon: lemmy-epsilon:
image: lemmy-federation:latest <<: *lemmy-default
volumes: volumes:
- ./lemmy_epsilon.hjson:/config/config.hjson:Z - ./lemmy_epsilon.hjson:/config/config.hjson:Z
environment:
- RUST_BACKTRACE=1
- RUST_LOG="warn,lemmy_server=debug,lemmy_api=debug,lemmy_api_common=debug,lemmy_api_crud=debug,lemmy_apub=debug,lemmy_db_schema=debug,lemmy_db_views=debug,lemmy_db_views_actor=debug,lemmy_db_views_moderator=debug,lemmy_routes=debug,lemmy_utils=debug,lemmy_websocket=debug"
depends_on: depends_on:
- postgres_epsilon - postgres_epsilon
restart: always
ports: ports:
- "8581:8581" - "8581:8581"
postgres_epsilon: postgres_epsilon:
image: postgres:15-alpine <<: *postgres-default
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
restart: always
volumes: volumes:
- ./volumes/postgres_epsilon:/var/lib/postgresql/data:Z - ./volumes/postgres_epsilon:/var/lib/postgresql/data:Z