Merge branch 'main' into invite_instances

invite_instances
Dessalines 2021-12-14 10:52:38 -05:00
commit a90d5a40d8
39 changed files with 379 additions and 630 deletions

544
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -46,28 +46,28 @@ lemmy_routes = { version = "=0.15.0-rc.4", path = "./crates/routes" }
diesel = "1.4.8"
diesel_migrations = "1.4.0"
chrono = { version = "0.4.19", features = ["serde"] }
serde = { version = "1.0.130", features = ["derive"] }
serde = { version = "1.0.131", features = ["derive"] }
actix = "0.12.0"
actix-web = { version = "4.0.0-beta.9", default-features = false, features = ["rustls"] }
actix-web = { version = "4.0.0-beta.14", default-features = false, features = ["rustls"] }
tracing = "0.1.29"
tracing-actix-web = { version = "0.5.0-beta.3", default-features = false }
tracing-actix-web = { version = "0.5.0-beta.5", default-features = false }
tracing-error = "0.2.0"
tracing-log = "0.1.2"
tracing-subscriber = { version = "0.3.2", features = ["env-filter"] }
strum = "0.21.0"
tracing-subscriber = { version = "0.3.3", features = ["env-filter"] }
strum = "0.23.0"
url = { version = "2.2.2", features = ["serde"] }
openssl = "0.10.36"
http-signature-normalization-actix = { version = "0.5.0-beta.10", default-features = false, features = ["sha-2"] }
tokio = { version = "1.12.0", features = ["sync"] }
anyhow = "1.0.44"
reqwest = { version = "0.11.4", features = ["json"] }
reqwest-middleware = "0.1.2"
openssl = "0.10.38"
http-signature-normalization-actix = { version = "0.5.0-beta.14", default-features = false, features = ["sha-2"] }
tokio = { version = "1.14.0", features = ["sync"] }
anyhow = "1.0.51"
reqwest = { version = "0.11.7", features = ["json"] }
reqwest-middleware = "0.1.3"
reqwest-tracing = "0.2.0"
activitystreams = "0.7.0-alpha.11"
actix-rt = { version = "2.2.0", default-features = false }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
activitystreams = "0.7.0-alpha.14"
actix-rt = { version = "2.5.0", default-features = false }
serde_json = { version = "1.0.72", features = ["preserve_order"] }
clokwerk = "0.3.5"
doku = "0.10.1"
doku = "0.10.2"
[dev-dependencies.cargo-husky]
version = "1.5.0"

View File

@ -1 +0,0 @@
0.13.3

View File

@ -1,53 +0,0 @@
version: '2.2'
services:
lemmy:
image: {{ lemmy_docker_image }}
ports:
- "127.0.0.1:8536:8536"
restart: always
environment:
- RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
volumes:
- ./lemmy.hjson:/config/config.hjson:ro
depends_on:
- postgres
- pictrs
lemmy-ui:
image: {{ lemmy_docker_ui_image }}
ports:
- "127.0.0.1:1235:1234"
restart: always
environment:
- LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_EXTERNAL_HOST={{ domain }}
- LEMMY_HTTPS=true
depends_on:
- lemmy
postgres:
image: postgres:12-alpine
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD={{ postgres_password }}
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
restart: always
pictrs:
image: asonix/pictrs:v0.2.6-r2
user: 991:991
ports:
- "127.0.0.1:8537:8080"
volumes:
- ./volumes/pictrs:/mnt
restart: always
mem_limit: 200m
postfix:
image: mwader/postfix-relay
environment:
- POSTFIX_myhostname={{ domain }}
restart: "always"

View File

@ -83,8 +83,8 @@
setup: {
# Username for the admin user
admin_username: "admin"
# Password for the admin user
admin_password: "my_passwd"
# Password for the admin user. It must be at least 10 characters.
admin_password: "my_passwd_longer_than_ten_characters"
# Name of the site (can be changed later)
site_name: "My Lemmy Instance"
# Email for the admin user (optional, can be omitted and set later through the website)

View File

@ -25,28 +25,28 @@ lemmy_websocket = { version = "=0.15.0-rc.4", path = "../websocket" }
diesel = "1.4.8"
bcrypt = "0.10.1"
chrono = { version = "0.4.19", features = ["serde"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.72", features = ["preserve_order"] }
serde = { version = "1.0.131", features = ["derive"] }
actix = "0.12.0"
actix-web = { version = "4.0.0-beta.9", default-features = false }
actix-rt = { version = "2.2.0", default-features = false }
actix-web = { version = "4.0.0-beta.14", default-features = false }
actix-rt = { version = "2.5.0", default-features = false }
rand = "0.8.4"
strum = "0.21.0"
strum_macros = "0.21.1"
strum = "0.23.0"
strum_macros = "0.23.1"
url = { version = "2.2.2", features = ["serde"] }
openssl = "0.10.36"
openssl = "0.10.38"
http = "0.2.5"
http-signature-normalization-actix = { version = "0.5.0-beta.10", default-features = false, features = ["sha-2"] }
http-signature-normalization-actix = { version = "0.5.0-beta.14", default-features = false, features = ["sha-2"] }
base64 = "0.13.0"
tokio = "1.12.0"
futures = "0.3.17"
itertools = "0.10.1"
tokio = "1.14.0"
futures = "0.3.18"
itertools = "0.10.3"
uuid = { version = "0.8.2", features = ["serde", "v4"] }
sha2 = "0.9.8"
async-trait = "0.1.51"
sha2 = "0.10.0"
async-trait = "0.1.52"
captcha = "0.0.8"
anyhow = "1.0.44"
thiserror = "1.0.29"
anyhow = "1.0.51"
thiserror = "1.0.30"
tracing = "0.1.29"
background-jobs = "0.11.0"
reqwest = { version = "0.11.4", features = ["json"] }
reqwest = { version = "0.11.7", features = ["json"] }

View File

@ -18,10 +18,10 @@ lemmy_db_views_moderator = { version = "=0.15.0-rc.4", path = "../db_views_moder
lemmy_db_views_actor = { version = "=0.15.0-rc.4", path = "../db_views_actor" }
lemmy_db_schema = { version = "=0.15.0-rc.4", path = "../db_schema" }
lemmy_utils = { version = "=0.15.0-rc.4", path = "../utils" }
serde = { version = "1.0.130", features = ["derive"] }
serde = { version = "1.0.131", features = ["derive"] }
diesel = "1.4.8"
actix-web = { version = "4.0.0-beta.9", default-features = false, features = ["cookies"] }
actix-web = { version = "4.0.0-beta.14", default-features = false, features = ["cookies"] }
chrono = { version = "0.4.19", features = ["serde"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
serde_json = { version = "1.0.72", features = ["preserve_order"] }
tracing = "0.1.29"
url = "2.2.2"

View File

@ -20,28 +20,28 @@ lemmy_websocket = { version = "=0.15.0-rc.4", path = "../websocket" }
diesel = "1.4.8"
bcrypt = "0.10.1"
chrono = { version = "0.4.19", features = ["serde"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.72", features = ["preserve_order"] }
serde = { version = "1.0.131", features = ["derive"] }
actix = "0.12.0"
actix-web = { version = "4.0.0-beta.9", default-features = false }
actix-rt = { version = "2.2.0", default-features = false }
actix-web = { version = "4.0.0-beta.14", default-features = false }
actix-rt = { version = "2.5.0", default-features = false }
tracing = "0.1.29"
rand = "0.8.4"
strum = "0.21.0"
strum_macros = "0.21.1"
strum = "0.23.0"
strum_macros = "0.23.1"
url = { version = "2.2.2", features = ["serde"] }
openssl = "0.10.36"
openssl = "0.10.38"
http = "0.2.5"
http-signature-normalization-actix = { version = "0.5.0-beta.10", default-features = false, features = ["sha-2"] }
http-signature-normalization-actix = { version = "0.5.0-beta.14", default-features = false, features = ["sha-2"] }
base64 = "0.13.0"
tokio = "1.12.0"
futures = "0.3.17"
itertools = "0.10.1"
tokio = "1.14.0"
futures = "0.3.18"
itertools = "0.10.3"
uuid = { version = "0.8.2", features = ["serde", "v4"] }
sha2 = "0.9.8"
async-trait = "0.1.51"
anyhow = "1.0.44"
thiserror = "1.0.29"
sha2 = "0.10.0"
async-trait = "0.1.52"
anyhow = "1.0.51"
thiserror = "1.0.30"
background-jobs = "0.11.0"
reqwest = { version = "0.11.4", features = ["json"] }
reqwest = { version = "0.11.7", features = ["json"] }
webmention = "0.4.0"

View File

@ -24,34 +24,34 @@ diesel = "1.4.8"
activitystreams-kinds = "0.1.2"
bcrypt = "0.10.1"
chrono = { version = "0.4.19", features = ["serde"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
serde = { version = "1.0.130", features = ["derive"] }
serde_with = "1.10.0"
serde_json = { version = "1.0.72", features = ["preserve_order"] }
serde = { version = "1.0.131", features = ["derive"] }
serde_with = "1.11.0"
actix = "0.12.0"
actix-web = { version = "4.0.0-beta.9", default-features = false }
actix-rt = { version = "2.2.0", default-features = false }
actix-web = { version = "4.0.0-beta.14", default-features = false }
actix-rt = { version = "2.5.0", default-features = false }
tracing = "0.1.29"
rand = "0.8.4"
strum = "0.21.0"
strum_macros = "0.21.1"
strum = "0.23.0"
strum_macros = "0.23.1"
url = { version = "2.2.2", features = ["serde"] }
percent-encoding = "2.1.0"
http = "0.2.5"
http-signature-normalization-actix = { version = "0.5.0-beta.10", default-features = false, features = ["server", "sha-2"] }
tokio = "1.12.0"
futures = "0.3.17"
itertools = "0.10.1"
http-signature-normalization-actix = { version = "0.5.0-beta.14", default-features = false, features = ["server", "sha-2"] }
tokio = "1.14.0"
futures = "0.3.18"
itertools = "0.10.3"
uuid = { version = "0.8.2", features = ["serde", "v4"] }
sha2 = "0.9.8"
async-trait = "0.1.51"
anyhow = "1.0.44"
thiserror = "1.0.29"
sha2 = "0.10.0"
async-trait = "0.1.52"
anyhow = "1.0.51"
thiserror = "1.0.30"
background-jobs = "0.11.0"
reqwest = { version = "0.11.4", features = ["json"] }
reqwest = { version = "0.11.7", features = ["json"] }
html2md = "0.2.13"
once_cell = "1.8.0"
[dev-dependencies]
serial_test = "0.5.1"
assert-json-diff = "2.0.1"
reqwest-middleware = "0.1.2"
reqwest-middleware = "0.1.3"

View File

@ -0,0 +1,18 @@
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://mycrowd.ca/schemas/litepub-0.1.jsonld",
{
"@language": "und"
}
],
"actor": "https://mycrowd.ca/users/kinetix",
"cc": [],
"id": "https://mycrowd.ca/activities/dab6a4d3-0db0-41ee-8aab-7bfa4929b4fd",
"object": "https://lemmy.ca/u/kinetix",
"state": "pending",
"to": [
"https://lemmy.ca/u/kinetix"
],
"type": "Follow"
}

View File

@ -2,7 +2,7 @@ use crate::{
http::{create_apub_response, create_apub_tombstone_response},
objects::comment::ApubComment,
};
use actix_web::{body::AnyBody, web, web::Path, HttpResponse};
use actix_web::{web, web::Path, HttpResponse};
use diesel::result::Error::NotFound;
use lemmy_api_common::blocking;
use lemmy_apub_lib::traits::ApubObject;
@ -21,7 +21,7 @@ pub(crate) struct CommentQuery {
pub(crate) async fn get_apub_comment(
info: Path<CommentQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let id = CommentId(info.comment_id.parse::<i32>()?);
let comment: ApubComment = blocking(context.pool(), move |conn| Comment::read(conn, id))
.await??

View File

@ -21,7 +21,7 @@ use crate::{
collections::group_followers::GroupFollowers,
},
};
use actix_web::{body::AnyBody, web, web::Payload, HttpRequest, HttpResponse};
use actix_web::{web, web::Payload, HttpRequest, HttpResponse};
use lemmy_api_common::blocking;
use lemmy_apub_lib::{object_id::ObjectId, traits::ApubObject};
use lemmy_db_schema::source::community::Community;
@ -40,7 +40,7 @@ pub(crate) struct CommunityQuery {
pub(crate) async fn get_apub_community_http(
info: web::Path<CommunityQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let community: ApubCommunity = blocking(context.pool(), move |conn| {
Community::read_from_name(conn, &info.community_name)
})
@ -98,7 +98,7 @@ pub(in crate::http) async fn receive_group_inbox(
pub(crate) async fn get_apub_community_followers(
info: web::Path<CommunityQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let community = blocking(context.pool(), move |conn| {
Community::read_from_name(conn, &info.community_name)
})
@ -112,7 +112,7 @@ pub(crate) async fn get_apub_community_followers(
pub(crate) async fn get_apub_community_outbox(
info: web::Path<CommunityQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let community = blocking(context.pool(), move |conn| {
Community::read_from_name(conn, &info.community_name)
})
@ -129,7 +129,7 @@ pub(crate) async fn get_apub_community_outbox(
pub(crate) async fn get_apub_community_moderators(
info: web::Path<CommunityQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let community: ApubCommunity = blocking(context.pool(), move |conn| {
Community::read_from_name(conn, &info.community_name)
})

View File

@ -7,7 +7,6 @@ use crate::{
insert_activity,
};
use actix_web::{
body::AnyBody,
web,
web::{Bytes, BytesMut, Payload},
HttpRequest,
@ -119,7 +118,7 @@ where
/// Convert the data to json and turn it into an HTTP Response with the correct ActivityPub
/// headers.
fn create_apub_response<T>(data: &T) -> HttpResponse<AnyBody>
fn create_apub_response<T>(data: &T) -> HttpResponse
where
T: Serialize,
{
@ -128,13 +127,13 @@ where
.json(WithContext::new(data))
}
fn create_json_apub_response(data: serde_json::Value) -> HttpResponse<AnyBody> {
fn create_json_apub_response(data: serde_json::Value) -> HttpResponse {
HttpResponse::Ok()
.content_type(APUB_JSON_CONTENT_TYPE)
.json(data)
}
fn create_apub_tombstone_response<T>(data: &T) -> HttpResponse<AnyBody>
fn create_apub_tombstone_response<T>(data: &T) -> HttpResponse
where
T: Serialize,
{
@ -155,7 +154,7 @@ pub struct ActivityQuery {
pub(crate) async fn get_activity(
info: web::Path<ActivityQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let settings = context.settings();
let activity_id = Url::parse(&format!(
"{}/activities/{}/{}",

View File

@ -11,7 +11,7 @@ use crate::{
objects::person::ApubPerson,
protocol::collections::person_outbox::PersonOutbox,
};
use actix_web::{body::AnyBody, web, web::Payload, HttpRequest, HttpResponse};
use actix_web::{web, web::Payload, HttpRequest, HttpResponse};
use lemmy_api_common::blocking;
use lemmy_apub_lib::traits::ApubObject;
use lemmy_db_schema::source::person::Person;
@ -30,7 +30,7 @@ pub struct PersonQuery {
pub(crate) async fn get_apub_person_http(
info: web::Path<PersonQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let user_name = info.into_inner().user_name;
// TODO: this needs to be able to read deleted persons, so that it can send tombstones
let person: ApubPerson = blocking(context.pool(), move |conn| {
@ -75,7 +75,7 @@ pub(in crate::http) async fn receive_person_inbox(
pub(crate) async fn get_apub_person_outbox(
info: web::Path<PersonQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let person = blocking(context.pool(), move |conn| {
Person::find_by_name(conn, &info.user_name)
})

View File

@ -2,7 +2,7 @@ use crate::{
http::{create_apub_response, create_apub_tombstone_response},
objects::post::ApubPost,
};
use actix_web::{body::AnyBody, web, HttpResponse};
use actix_web::{web, HttpResponse};
use diesel::result::Error::NotFound;
use lemmy_api_common::blocking;
use lemmy_apub_lib::traits::ApubObject;
@ -21,7 +21,7 @@ pub(crate) struct PostQuery {
pub(crate) async fn get_apub_post(
info: web::Path<PostQuery>,
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let id = PostId(info.post_id.parse::<i32>()?);
let post: ApubPost = blocking(context.pool(), move |conn| Post::read(conn, id))
.await??

View File

@ -4,6 +4,7 @@ pub mod post;
#[cfg(test)]
mod tests {
use crate::{
context::WithContext,
objects::tests::file_to_json_object,
protocol::{
activities::create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost},
@ -23,8 +24,12 @@ mod tests {
"assets/lemmy/activities/create_or_update/create_note.json",
);
file_to_json_object::<CreateOrUpdateComment>("assets/pleroma/activities/create_note.json");
file_to_json_object::<CreateOrUpdateComment>("assets/smithereen/activities/create_note.json");
file_to_json_object::<WithContext<CreateOrUpdateComment>>(
"assets/pleroma/activities/create_note.json",
);
file_to_json_object::<WithContext<CreateOrUpdateComment>>(
"assets/smithereen/activities/create_note.json",
);
file_to_json_object::<CreateOrUpdateComment>("assets/mastodon/activities/create_note.json");
file_to_json_object::<CreateOrUpdatePost>("assets/lotide/activities/create_page.json");

View File

@ -4,13 +4,17 @@ pub mod undo_follow;
#[cfg(test)]
mod tests {
use crate::protocol::{
activities::following::{
accept::AcceptFollowCommunity,
follow::FollowCommunity,
undo_follow::UndoFollowCommunity,
use crate::{
context::WithContext,
objects::tests::file_to_json_object,
protocol::{
activities::following::{
accept::AcceptFollowCommunity,
follow::FollowCommunity,
undo_follow::UndoFollowCommunity,
},
tests::test_parse_lemmy_item,
},
tests::test_parse_lemmy_item,
};
#[actix_rt::test]
@ -20,5 +24,7 @@ mod tests {
test_parse_lemmy_item::<UndoFollowCommunity>(
"assets/lemmy/activities/following/undo_follow.json",
);
file_to_json_object::<WithContext<FollowCommunity>>("assets/pleroma/activities/follow.json");
}
}

View File

@ -1,5 +1,5 @@
use serde::{Deserialize, Serialize};
use strum_macros::ToString;
use strum_macros::Display;
pub mod community;
pub mod create_or_update;
@ -8,7 +8,7 @@ pub mod following;
pub mod private_message;
pub mod voting;
#[derive(Clone, Debug, ToString, Deserialize, Serialize, PartialEq)]
#[derive(Clone, Debug, Display, Deserialize, Serialize, PartialEq)]
pub enum CreateOrUpdateType {
Create,
Update,

View File

@ -7,7 +7,7 @@ use lemmy_apub_lib::object_id::ObjectId;
use lemmy_utils::LemmyError;
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;
use strum_macros::ToString;
use strum_macros::Display;
use url::Url;
#[derive(Clone, Debug, Deserialize, Serialize)]
@ -26,7 +26,7 @@ pub struct Vote {
pub(crate) unparsed: Unparsed,
}
#[derive(Clone, Debug, ToString, Deserialize, Serialize)]
#[derive(Clone, Debug, Display, Deserialize, Serialize)]
pub enum VoteType {
Like,
Dislike,

View File

@ -18,6 +18,7 @@ pub struct Endpoints {
#[cfg(test)]
mod tests {
use crate::{
context::WithContext,
objects::tests::file_to_json_object,
protocol::{
objects::{chat_message::ChatMessage, group::Group, note::Note, page::Page, person::Person},
@ -33,11 +34,11 @@ mod tests {
test_parse_lemmy_item::<Note>("assets/lemmy/objects/note.json");
test_parse_lemmy_item::<ChatMessage>("assets/lemmy/objects/chat_message.json");
file_to_json_object::<Person>("assets/pleroma/objects/person.json");
file_to_json_object::<Note>("assets/pleroma/objects/note.json");
file_to_json_object::<ChatMessage>("assets/pleroma/objects/chat_message.json");
file_to_json_object::<WithContext<Person>>("assets/pleroma/objects/person.json");
file_to_json_object::<WithContext<Note>>("assets/pleroma/objects/note.json");
file_to_json_object::<WithContext<ChatMessage>>("assets/pleroma/objects/chat_message.json");
file_to_json_object::<Person>("assets/smithereen/objects/person.json");
file_to_json_object::<WithContext<Person>>("assets/smithereen/objects/person.json");
file_to_json_object::<Note>("assets/smithereen/objects/note.json");
file_to_json_object::<Person>("assets/mastodon/objects/person.json");

View File

@ -10,22 +10,22 @@ documentation = "https://join-lemmy.org/docs/en/index.html"
[dependencies]
lemmy_utils = { version = "=0.15.0-rc.4", path = "../utils" }
lemmy_apub_lib_derive = { version = "=0.15.0-rc.4", path = "../apub_lib_derive" }
activitystreams = "0.7.0-alpha.11"
serde = { version = "1.0.130", features = ["derive"] }
async-trait = "0.1.51"
activitystreams = "0.7.0-alpha.14"
serde = { version = "1.0.131", features = ["derive"] }
async-trait = "0.1.52"
url = { version = "2.2.2", features = ["serde"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
anyhow = "1.0.44"
reqwest = { version = "0.11.4", features = ["json"] }
reqwest-middleware = "0.1.2"
serde_json = { version = "1.0.72", features = ["preserve_order"] }
anyhow = "1.0.51"
reqwest = { version = "0.11.7", features = ["json"] }
reqwest-middleware = "0.1.3"
tracing = "0.1.29"
base64 = "0.13.0"
openssl = "0.10.36"
openssl = "0.10.38"
once_cell = "1.8.0"
http = "0.2.5"
sha2 = "0.9.8"
actix-web = { version = "4.0.0-beta.9", default-features = false }
http-signature-normalization-actix = { version = "0.5.0-beta.10", default-features = false, features = ["server", "sha-2"] }
http-signature-normalization-reqwest = { version = "0.3.0", default-features = false, features = ["sha-2", "middleware"] }
sha2 = "0.10.0"
actix-web = { version = "4.0.0-beta.14", default-features = false }
http-signature-normalization-actix = { version = "0.5.0-beta.14", default-features = false, features = ["server", "sha-2"] }
http-signature-normalization-reqwest = { version = "0.4.0", default-features = false, features = ["sha-2", "middleware"] }
background-jobs = "0.11.0"
diesel = "1.4.8"

View File

@ -11,9 +11,9 @@ documentation = "https://join-lemmy.org/docs/en/index.html"
proc-macro = true
[dev-dependencies]
trybuild = { version = "1.0.45", features = ["diff"] }
trybuild = { version = "1.0.53", features = ["diff"] }
[dependencies]
proc-macro2 = "1.0.29"
syn = "1.0.77"
quote = "1.0.9"
proc-macro2 = "1.0.33"
syn = "1.0.82"
quote = "1.0.10"

View File

@ -16,15 +16,15 @@ lemmy_apub_lib = { version = "=0.15.0-rc.4", path = "../apub_lib" }
diesel = { version = "1.4.8", features = ["postgres","chrono","r2d2","serde_json"] }
diesel_migrations = "1.4.0"
chrono = { version = "0.4.19", features = ["serde"] }
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
serde = { version = "1.0.131", features = ["derive"] }
serde_json = { version = "1.0.72", features = ["preserve_order"] }
url = { version = "2.2.2", features = ["serde"] }
diesel-derive-newtype = "0.1.2"
regex = "1.5.4"
once_cell = "1.8.0"
strum = "0.21.0"
strum_macros = "0.21.1"
sha2 = "0.9.8"
strum = "0.23.0"
strum_macros = "0.23.1"
sha2 = "0.10.0"
bcrypt = "0.10.1"
[dev-dependencies]

View File

@ -32,7 +32,7 @@ pub fn get_database_url_from_env() -> Result<String, VarError> {
env::var("LEMMY_DATABASE_URL")
}
#[derive(EnumString, ToString, Debug, Serialize, Deserialize, Clone, Copy)]
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
pub enum SortType {
Active,
Hot,
@ -46,7 +46,7 @@ pub enum SortType {
NewComments,
}
#[derive(EnumString, ToString, Debug, Serialize, Deserialize, Clone, Copy)]
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
pub enum ListingType {
All,
Local,
@ -54,7 +54,7 @@ pub enum ListingType {
Community,
}
#[derive(EnumString, ToString, Debug, Serialize, Deserialize, Clone, Copy)]
#[derive(EnumString, Display, Debug, Serialize, Deserialize, Clone, Copy)]
pub enum SearchType {
All,
Comments,

View File

@ -13,7 +13,7 @@ doctest = false
[dependencies]
lemmy_db_schema = { version = "=0.15.0-rc.4", path = "../db_schema" }
diesel = { version = "1.4.8", features = ["postgres","chrono","r2d2","serde_json"] }
serde = { version = "1.0.130", features = ["derive"] }
serde = { version = "1.0.131", features = ["derive"] }
tracing = "0.1.29"
url = "2.2.2"

View File

@ -13,4 +13,4 @@ doctest = false
[dependencies]
lemmy_db_schema = { version = "=0.15.0-rc.4", path = "../db_schema" }
diesel = { version = "1.4.8", features = ["postgres","chrono","r2d2","serde_json"] }
serde = { version = "1.0.130", features = ["derive"] }
serde = { version = "1.0.131", features = ["derive"] }

View File

@ -13,4 +13,4 @@ doctest = false
[dependencies]
lemmy_db_schema = { version = "=0.15.0-rc.4", path = "../db_schema" }
diesel = { version = "1.4.8", features = ["postgres","chrono","r2d2","serde_json"] }
serde = { version = "1.0.130", features = ["derive"] }
serde = { version = "1.0.131", features = ["derive"] }

View File

@ -20,19 +20,19 @@ lemmy_api_common = { version = "=0.15.0-rc.4", path = "../api_common" }
lemmy_apub = { version = "=0.15.0-rc.4", path = "../apub" }
diesel = "1.4.8"
actix = "0.12.0"
actix-web = { version = "4.0.0-beta.9", default-features = false, features = ["rustls"] }
actix-web-actors = { version = "4.0.0-beta.7", default-features = false }
actix-http = "3.0.0-beta.10"
sha2 = "0.9.8"
anyhow = "1.0.44"
actix-web = { version = "4.0.0-beta.14", default-features = false, features = ["rustls"] }
actix-web-actors = { version = "4.0.0-beta.8", default-features = false }
actix-http = "3.0.0-beta.15"
sha2 = "0.10.0"
anyhow = "1.0.51"
chrono = { version = "0.4.19", features = ["serde"] }
futures = "0.3.18"
reqwest = { version = "0.11.7", features = ["stream"] }
reqwest-middleware = "0.1.2"
rss = "1.10.0"
serde = { version = "1.0.130", features = ["derive"] }
reqwest-middleware = "0.1.3"
rss = "2.0.0"
serde = { version = "1.0.131", features = ["derive"] }
url = { version = "2.2.2", features = ["serde"] }
strum = "0.21.0"
strum = "0.23.0"
once_cell = "1.8.0"
tracing = "0.1.29"
tokio = { version = "1", features = ["sync"] }
tokio = { version = "1.14.0", features = ["sync"] }

View File

@ -27,7 +27,7 @@ use rss::{
ItemBuilder,
};
use serde::Deserialize;
use std::{collections::HashMap, str::FromStr};
use std::{collections::BTreeMap, str::FromStr};
use strum::ParseError;
#[derive(Deserialize)]
@ -49,8 +49,8 @@ pub fn config(cfg: &mut web::ServiceConfig) {
.route("/feeds/local.xml", web::get().to(get_local_feed));
}
static RSS_NAMESPACE: Lazy<HashMap<String, String>> = Lazy::new(|| {
let mut h = HashMap::new();
static RSS_NAMESPACE: Lazy<BTreeMap<String, String>> = Lazy::new(|| {
let mut h = BTreeMap::new();
h.insert(
"dc".to_string(),
rss::extension::dublincore::NAMESPACE.to_string(),
@ -109,7 +109,7 @@ async fn get_feed_data(
channel_builder.description(&site_desc);
}
let rss = channel_builder.build().map_err(|e| anyhow!(e))?.to_string();
let rss = channel_builder.build().to_string();
Ok(
HttpResponse::Ok()
.content_type("application/rss+xml")
@ -154,7 +154,7 @@ async fn get_feed(
.await?
.map_err(ErrorBadRequest)?;
let rss = builder.build().map_err(ErrorBadRequest)?.to_string();
let rss = builder.build().to_string();
Ok(
HttpResponse::Ok()
@ -373,17 +373,13 @@ fn build_item(
let dt = DateTime::<Utc>::from_utc(*published, Utc);
i.pub_date(dt.to_rfc2822());
i.comments(url.to_owned());
let guid = GuidBuilder::default()
.permalink(true)
.value(url)
.build()
.map_err(|e| anyhow!(e))?;
let guid = GuidBuilder::default().permalink(true).value(url).build();
i.guid(guid);
i.link(url.to_owned());
// TODO add images
let html = markdown_to_html(&content.to_string());
i.description(html);
Ok(i.build().map_err(|e| anyhow!(e))?)
Ok(i.build())
}
#[tracing::instrument(skip_all)]
@ -410,8 +406,7 @@ fn create_post_items(
let guid = GuidBuilder::default()
.permalink(true)
.value(&post_url)
.build()
.map_err(|e| anyhow!(e))?;
.build();
i.guid(guid);
let community_url = format!("{}/c/{}", protocol_and_hostname, p.community.name);
@ -439,8 +434,8 @@ fn create_post_items(
i.description(description);
i.dublin_core_ext(dc_extension.build().map_err(|e| anyhow!(e))?);
items.push(i.build().map_err(|e| anyhow!(e))?);
i.dublin_core_ext(dc_extension.build());
items.push(i.build());
}
Ok(items)

View File

@ -1,7 +1,4 @@
use actix_http::{
header::{HeaderName, HOST},
http::header::ACCEPT_ENCODING,
};
use actix_http::header::{HeaderName, ACCEPT_ENCODING, HOST};
use actix_web::{body::BodyStream, http::StatusCode, web::Data, *};
use anyhow::anyhow;
use futures::stream::{Stream, StreamExt};

View File

@ -1,4 +1,4 @@
use actix_web::{body::AnyBody, error::ErrorBadRequest, *};
use actix_web::{error::ErrorBadRequest, *};
use anyhow::anyhow;
use lemmy_api_common::blocking;
use lemmy_db_views::site_view::SiteView;
@ -15,7 +15,7 @@ pub fn config(cfg: &mut web::ServiceConfig) {
async fn node_info_well_known(
context: web::Data<LemmyContext>,
) -> Result<HttpResponse<AnyBody>, LemmyError> {
) -> Result<HttpResponse, LemmyError> {
let node_info = NodeInfoWellKnown {
links: vec![NodeInfoWellKnownLinks {
rel: Url::parse("http://nodeinfo.diaspora.software/ns/schema/2.0")?,

View File

@ -15,33 +15,33 @@ doctest = false
[dependencies]
regex = "1.5.4"
chrono = { version = "0.4.19", features = ["serde"] }
lettre = "0.10.0-rc.3"
lettre = "0.10.0-rc.4"
tracing = "0.1.29"
tracing-error = "0.2.0"
itertools = "0.10.1"
itertools = "0.10.3"
rand = "0.8.4"
percent-encoding = "2.1.0"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
thiserror = "1.0.29"
serde = { version = "1.0.131", features = ["derive"] }
serde_json = { version = "1.0.72", features = ["preserve_order"] }
thiserror = "1.0.30"
comrak = { version = "0.12.1", default-features = false }
once_cell = "1.8.0"
openssl = "0.10.36"
openssl = "0.10.38"
url = { version = "2.2.2", features = ["serde"] }
actix-web = { version = "4.0.0-beta.9", default-features = false, features = ["rustls"] }
actix-rt = { version = "2.2.0", default-features = false }
anyhow = "1.0.44"
reqwest = { version = "0.11.4", features = ["json"] }
reqwest-middleware = "0.1.2"
tokio = { version = "1.12.0", features = ["sync"] }
strum = "0.21.0"
strum_macros = "0.21.1"
futures = "0.3.17"
actix-web = { version = "4.0.0-beta.14", default-features = false, features = ["rustls"] }
actix-rt = { version = "2.5.0", default-features = false }
anyhow = "1.0.51"
reqwest = { version = "0.11.7", features = ["json"] }
reqwest-middleware = "0.1.3"
tokio = { version = "1.14.0", features = ["sync"] }
strum = "0.23.0"
strum_macros = "0.23.1"
futures = "0.3.18"
diesel = "1.4.8"
http = "0.2.5"
deser-hjson = "1.0.2"
smart-default = "0.6.0"
webpage = { version = "1.3.0", default-features = false, features = ["serde"] }
webpage = { version = "1.4.0", default-features = false, features = ["serde"] }
jsonwebtoken = "7.2.0"
doku = "0.10.1"
doku = "0.10.2"
uuid = { version = "0.8.2", features = ["serde", "v4"] }

View File

@ -165,8 +165,8 @@ pub struct SetupConfig {
/// Username for the admin user
#[doku(example = "admin")]
pub admin_username: String,
/// Password for the admin user
#[doku(example = "my_passwd")]
/// Password for the admin user. It must be at least 10 characters.
#[doku(example = "my_passwd_longer_than_ten_characters")]
pub admin_password: String,
/// Name of the site (can be changed later)
#[doku(example = "My Lemmy Instance")]

View File

@ -18,19 +18,19 @@ lemmy_api_common = { version = "=0.15.0-rc.4", path = "../api_common" }
lemmy_db_schema = { version = "=0.15.0-rc.4", path = "../db_schema" }
lemmy_db_views = { version = "=0.15.0-rc.4", path = "../db_views" }
lemmy_db_views_actor = { version = "=0.15.0-rc.4", path = "../db_views_actor" }
reqwest = { version = "0.11.4", features = ["json"] }
reqwest-middleware = "0.1.2"
reqwest = { version = "0.11.7", features = ["json"] }
reqwest-middleware = "0.1.3"
tracing = "0.1.29"
rand = "0.8.4"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.68", features = ["preserve_order"] }
serde = { version = "1.0.131", features = ["derive"] }
serde_json = { version = "1.0.72", features = ["preserve_order"] }
actix = "0.12.0"
anyhow = "1.0.44"
anyhow = "1.0.51"
diesel = "1.4.8"
background-jobs = "0.11.0"
tokio = "1.12.0"
strum = "0.21.0"
strum_macros = "0.21.1"
tokio = "1.14.0"
strum = "0.23.0"
strum_macros = "0.23.1"
chrono = { version = "0.4.19", features = ["serde"] }
actix-web = { version = "4.0.0-beta.9", default-features = false, features = ["rustls"] }
actix-web-actors = { version = "4.0.0-beta.7", default-features = false }
actix-web = { version = "4.0.0-beta.14", default-features = false, features = ["rustls"] }
actix-web-actors = { version = "4.0.0-beta.8", default-features = false }

View File

@ -97,7 +97,7 @@ where
Ok(serde_json::to_string(&response)?)
}
#[derive(EnumString, ToString, Debug, Clone)]
#[derive(EnumString, Display, Debug, Clone)]
pub enum UserOperation {
Login,
GetCaptcha,
@ -151,7 +151,7 @@ pub enum UserOperation {
BlockPerson,
}
#[derive(EnumString, ToString, Debug, Clone)]
#[derive(EnumString, Display, Debug, Clone)]
pub enum UserOperationCrud {
// Site
CreateSite,

View File

@ -49,7 +49,7 @@ services:
restart: always
pictrs:
image: asonix/pictrs:v0.2.6-r2
image: asonix/pictrs:0.3.0-beta.11
user: 991:991
volumes:
- ./volumes/pictrs:/mnt

View File

@ -22,7 +22,7 @@ services:
pictrs:
restart: always
image: asonix/pictrs:v0.2.6-r2
image: asonix/pictrs:0.3.0-beta.11
user: 991:991
volumes:
- ./volumes/pictrs_alpha:/mnt

View File

@ -14,7 +14,7 @@ services:
pictrs:
restart: always
image: asonix/pictrs:v0.2.6-r2
image: asonix/pictrs:0.3.0-beta.11
user: 991:991
volumes:
- ./volumes/pictrs:/mnt

View File

@ -37,7 +37,7 @@ services:
- lemmy
pictrs:
image: asonix/pictrs:v0.2.6-r2
image: asonix/pictrs:0.3.0-beta.11
ports:
- "127.0.0.1:8537:8080"
user: 991:991