From 15adc21e1fb018caa8d189f9dacb44d40fc736cc Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 2 Oct 2020 14:16:40 +0200 Subject: [PATCH 01/14] Only search locally for Community::read_from_name and similar (ref #698) --- lemmy_apub/src/comment.rs | 4 ++++ lemmy_apub/src/inbox/community_inbox.rs | 11 +---------- lemmy_apub/src/post.rs | 4 ++++ lemmy_db/src/community.rs | 1 + lemmy_db/src/user.rs | 10 ++++++++-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lemmy_apub/src/comment.rs b/lemmy_apub/src/comment.rs index 4e5c173f8..459d0796c 100644 --- a/lemmy_apub/src/comment.rs +++ b/lemmy_apub/src/comment.rs @@ -35,6 +35,7 @@ use activitystreams::{ }; use actix_web::{body::Body, web, web::Path, HttpResponse}; use anyhow::Context; +use diesel::result::Error::NotFound; use itertools::Itertools; use lemmy_db::{ comment::{Comment, CommentForm}, @@ -68,6 +69,9 @@ pub async fn get_apub_comment( ) -> Result, LemmyError> { let id = info.comment_id.parse::()?; let comment = blocking(context.pool(), move |conn| Comment::read(conn, id)).await??; + if !comment.local { + return Err(NotFound.into()); + } if !comment.deleted { Ok(create_apub_response( diff --git a/lemmy_apub/src/inbox/community_inbox.rs b/lemmy_apub/src/inbox/community_inbox.rs index ee75fa005..6f5f1854e 100644 --- a/lemmy_apub/src/inbox/community_inbox.rs +++ b/lemmy_apub/src/inbox/community_inbox.rs @@ -11,7 +11,7 @@ use activitystreams::{ prelude::*, }; use actix_web::{web, HttpRequest, HttpResponse}; -use anyhow::{anyhow, Context}; +use anyhow::Context; use lemmy_db::{ community::{Community, CommunityFollower, CommunityFollowerForm}, user::User_, @@ -48,15 +48,6 @@ pub async fn community_inbox( }) .await??; - if !community.local { - return Err( - anyhow!( - "Received activity is addressed to remote community {}", - &community.actor_id - ) - .into(), - ); - } debug!( "Community {} received activity {:?}", &community.name, &activity diff --git a/lemmy_apub/src/post.rs b/lemmy_apub/src/post.rs index 8f5ffbcb8..efdfcfd6c 100644 --- a/lemmy_apub/src/post.rs +++ b/lemmy_apub/src/post.rs @@ -31,6 +31,7 @@ use activitystreams::{ use activitystreams_ext::Ext1; use actix_web::{body::Body, web, HttpResponse}; use anyhow::Context; +use diesel::result::Error::NotFound; use lemmy_db::{ community::Community, post::{Post, PostForm}, @@ -61,6 +62,9 @@ pub async fn get_apub_post( ) -> Result, LemmyError> { let id = info.post_id.parse::()?; let post = blocking(context.pool(), move |conn| Post::read(conn, id)).await??; + if !post.local { + return Err(NotFound.into()); + } if !post.deleted { Ok(create_apub_response(&post.to_apub(context.pool()).await?)) diff --git a/lemmy_db/src/community.rs b/lemmy_db/src/community.rs index 24cf7e32f..b4fa424a7 100644 --- a/lemmy_db/src/community.rs +++ b/lemmy_db/src/community.rs @@ -87,6 +87,7 @@ impl Community { pub fn read_from_name(conn: &PgConnection, community_name: &str) -> Result { use crate::schema::community::dsl::*; community + .filter(local) .filter(name.eq(community_name)) .first::(conn) } diff --git a/lemmy_db/src/user.rs b/lemmy_db/src/user.rs index 60fdebbba..42be672af 100644 --- a/lemmy_db/src/user.rs +++ b/lemmy_db/src/user.rs @@ -143,11 +143,17 @@ impl User_ { } pub fn find_by_username(conn: &PgConnection, username: &str) -> Result { - user_.filter(name.ilike(username)).first::(conn) + user_ + .filter(local) + .filter(name.ilike(username)) + .first::(conn) } pub fn find_by_email(conn: &PgConnection, from_email: &str) -> Result { - user_.filter(email.eq(from_email)).first::(conn) + user_ + .filter(local) + .filter(email.eq(from_email)) + .first::(conn) } pub fn get_profile_url(&self, hostname: &str) -> String { From e596ea6e3ab3f0ee8a583612dae8ea6553e97052 Mon Sep 17 00:00:00 2001 From: Nutomic Date: Fri, 2 Oct 2020 13:02:16 +0000 Subject: [PATCH 02/14] Add documentation for federation overview (fixes #774) (#1165) --- docs/src/SUMMARY.md | 1 + docs/src/contributing_apub_api_outline.md | 2 + docs/src/contributing_federation_overview.md | 127 +++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 docs/src/contributing_federation_overview.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index a2bf58569..020a9dc1b 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -17,6 +17,7 @@ - [Tests](contributing_tests.md) - [Federation Development](contributing_federation_development.md) - [Websocket/HTTP API](contributing_websocket_http_api.md) + - [Federation Overview](contributing_federation_overview.md) - [ActivityPub API Outline](contributing_apub_api_outline.md) - [Theming Guide](contributing_theming.md) - [Lemmy Council](lemmy_council.md) diff --git a/docs/src/contributing_apub_api_outline.md b/docs/src/contributing_apub_api_outline.md index e2776308f..4ee2636ed 100644 --- a/docs/src/contributing_apub_api_outline.md +++ b/docs/src/contributing_apub_api_outline.md @@ -1,5 +1,7 @@ # Activitypub API outline +**This document is completely outdated and doesn't reflect the current state of Lemmy at all** + - Start with the [reddit API](https://www.reddit.com/dev/api), and find [Activitypub vocab](https://www.w3.org/TR/activitystreams-vocabulary/) to match it. diff --git a/docs/src/contributing_federation_overview.md b/docs/src/contributing_federation_overview.md new file mode 100644 index 000000000..8ed544291 --- /dev/null +++ b/docs/src/contributing_federation_overview.md @@ -0,0 +1,127 @@ +# Federation + + +This document is targeted at people that are more or less familiar with ActivityStreams and ActivityPub protocols. It is meant provide a high-level overview of ActivityPub federation in Lemmy. If you are implementing ActivityPub yourself and want to be compatible with Lemmy, read our [ActivityPub API outline](contributing_apub_api_outline.md). + +## Documentation conventions + +To keep things simple, sometimes you will see things formatted like `Create/Note` or `Delete/Event` or `Undo/Follow`. The thing before the slash is the Activity, and the thing after the slash is the Object inside the Activity, in an `object` property. So these are to be read as follows: + +* `Create/Note`: a `Create` activity containing a `Note` in the `object` field +* `Delete/Event`: a `Delete` activity containing an `Event` in the `object` field +* `Undo/Follow`: an `Undo` activity containing a `Follow` in the `object` field + +In Lemmy we use some specific terms to refer to ActivityPub items. They are essentially our specific implementations of well-known ActivityPub concepts: + +- Community: `Group` +- User: `Person` +- Post: `Page` +- Comment: `Note` + +This document has three main sections: + +* __Federation philosophy__ lays out the general model of how this is intended to federate +* __User Activities__ describes which actions that a User can take to interact +* __Community Activities__ describes what the Community does in response to certain User actions + +## Federation philosophy + +The primary Actor in Lemmy is the Community. Each community resides on a single instance, and consists of a list of Posts and a list of followers. The primary interaction is that of a User sending a Post or Comment related activity to the Community inbox, which then announces it to all its followers. + +Each Community has a specific creator User, who is responsible for setting rules, appointing moderators, and removing content that violates the rules. + +Besides moderation on the community level, each instance has a set of administrator Users, who have the power to do site-wide removals and bans. + +Users follow Communities that they are interested in, in order to receive Posts and Comments. They also vote on Posts and Comments, as well as creating new ones. Comments are organised in a tree structure and commonly sorted by number of votes. Direct messages between Users are also supported. + +Users can not follow each other, and neither can Communities follow anything. + +Our federation implementation is already feature complete, but so far we haven't focused at all on complying with the ActivityPub spec. As such, Lemmy is likely not compatible with implementations which expect to send and receive valid activities. This is something we plan to fix in the near future. Check out [#698](https://github.com/LemmyNet/lemmy/issues/698) for an overview of our deviations. + +## User Activities + +### Follow a Community + +Each Community page has a "Follow" button. Clicking this triggers a `Follow` activity to be sent from the user to the Community inbox. The Community will automatically respond with an `Accept/Follow` activity to the user inbox. It will also add the user to its list of followers, and deliver any activities about Posts/Comments in the Community to the user. + +### Unfollow a Community + +After following a Community, the "Follow" button is replaced by "Unfollow". Clicking this sends an `Undo/Follow` activity to the Community inbox. The Community removes the User from its followers list and doesn't send any activities to it anymore. + +### Create a Post + +When a user creates a new Post in a given Community, it is sent as `Create/Page` to the Community +inbox. + +### Create a Comment + +When a new Comment is created for a Post, both the Post ID and the parent Comment ID (if it exists) +are written to the `in_reply_to` field. This allows assigning it to the correct Post, and building +the Comment tree. It is then sent to the Community inbox as `Create/Note` + +The origin instance also scans the Comment for any User mentions, and sends the `Create/Note` to +those Users as well. + +### Edit a Post + +Changes the content of an existing Post. Can only be done by the creating User. + +### Edit a Comment + +Changes the content of an existing Comment. Can only be done by the creating User. + +### Likes and Dislikes + +Users can like or dislike any Post or Comment. These are sent as `Like/Page`, `Dislike/Note` etc to the Community inbox. + +### Deletions + +The creator of a Post, Comment or Community can delete it. It is then sent to the Community followers. The item is then hidden from all users. + +### Removals + +Mods can remove Posts and Comments from their Communities. Admins can remove any Posts or Comments on the entire site. Communities can also be removed by admins. The item is then hidden from all users. + +Removals are sent to all followers of the Community, so that they also take effect there. The exception is if an admin removes an item from a Community which is hosted on a different instance. In this case, the removal only takes effect locally. + +### Revert a previous Action + +We don't delete anything from our database, just hide it from users. Deleted or removed Communities/Posts/Comments have a "restore" button. This button generates an `Undo` activity which sets the original delete/remove activity as object, such as `Undo/Remove/Post` or `Undo/Delete/Community`. + +Clicking on the upvote button of an already upvoted post/comment (or the downvote button of an already downvoted post/comment) also generates an `Undo`. In this case and `Undo/Like/Post` or `Undo/Dislike/Comment`. + +### Create private message + +User profiles have a "Send Message" button, which opens a dialog permitting to send a private message to this user. It is sent as a `Create/Note` to the user inbox. Private messages can only be directed at a single User. + +### Edit private message + +`Update/Note` changes the text of a previously sent message + +### Delete private message + +`Delete/Note` deletes a private message. + +### Restore private message + +`Undo/Delete/Note` reverts the deletion of a private message. + +## Community Activities + +The Community is essentially a bot, which will only do anything in reaction to actions from Users. The User who first created the Community becomes the first moderator, and can add additional moderators. In general, whenever the Community receives a valid activity in its inbox, that activity is forwarded to all its followers. + +### Accept follow + +If the Community receives a `Follow` activity, it automatically responds with `Accept/Follow`. It also adds the User to its list of followers. + +### Unfollow + +Upon receiving an `Undo/Follow`, the Community removes the User from its followers list. + +### Announce + +If the Community receives any Post or Comment related activity (Create, Update, Like, Dislike, Remove, Delete, Undo), it will Announce this to its followers. For this, an Announce is created with the Community as actor, and the received activity as object. Following instances thus stay updated about any actions in Communities they follow. + +### Delete Community + +If the creator or an admin deletes the Community, it sends a `Delete/Group` to all its followers. From 389e929c8e26b79aca1655773181a37044e359e7 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 3 Oct 2020 09:51:15 -0500 Subject: [PATCH 03/14] Fixing readme. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c534d54e..61facf6b2 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Front Page|Post ---|--- ![main screen](https://raw.githubusercontent.com/LemmyNet/lemmy/main/docs/img/main_screen.png)|![chat screen](https://raw.githubusercontent.com/LemmyNet/lemmy/main/docs/img/chat_screen.png) -[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), [Raddle](https://raddle.me), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse). +[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse). For a link aggregator, this means a user registered on one server can subscribe to forums on any other server, and can have discussions with users registered elsewhere. From 7cc5f53cad63a26bff8f4736e9a74d6c0a19c493 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 3 Oct 2020 09:53:48 -0500 Subject: [PATCH 04/14] Add line showing default ports for nginx. Fixes #1167 --- ansible/lemmy.yml | 1 + ansible/templates/nginx.conf | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ansible/lemmy.yml b/ansible/lemmy.yml index b4187158f..28179ba41 100644 --- a/ansible/lemmy.yml +++ b/ansible/lemmy.yml @@ -79,6 +79,7 @@ lemmy_docker_image: "dessalines/lemmy:{{ lookup('file', 'VERSION') }}" lemmy_docker_ui_image: "dessalines/lemmy-ui:{{ lookup('file', 'VERSION') }}" lemmy_port: "8536" + lemmy_ui_port: "1235" pictshare_port: "8537" iframely_port: "8538" diff --git a/ansible/templates/nginx.conf b/ansible/templates/nginx.conf index 7f13259ad..03b139bb0 100644 --- a/ansible/templates/nginx.conf +++ b/ansible/templates/nginx.conf @@ -57,6 +57,10 @@ server { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + # The default ports: + # lemmy_ui_port: 1235 + # lemmy_port: 8536 + set $proxpass "http://0.0.0.0:{{ lemmy_ui_port }}"; if ($http_accept = "application/activity+json") { set $proxpass "http://0.0.0.0:{{ lemmy_port }}"; From 04a4624f14b323c9b5b3108b46777f0962a9b3c0 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 3 Oct 2020 11:44:25 -0500 Subject: [PATCH 05/14] Changing default theme to browser from darkly. Fixes #1163 --- lemmy_api/src/user.rs | 2 +- lemmy_db/src/activity.rs | 2 +- lemmy_db/src/comment.rs | 2 +- lemmy_db/src/comment_view.rs | 2 +- lemmy_db/src/community.rs | 2 +- lemmy_db/src/moderator.rs | 4 ++-- lemmy_db/src/password_reset_request.rs | 2 +- lemmy_db/src/post.rs | 2 +- lemmy_db/src/post_view.rs | 2 +- lemmy_db/src/private_message.rs | 4 ++-- lemmy_db/src/user.rs | 4 ++-- lemmy_db/src/user_mention.rs | 4 ++-- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index 4324c9368..5374f0b2a 100644 --- a/lemmy_api/src/user.rs +++ b/lemmy_api/src/user.rs @@ -172,7 +172,7 @@ impl Perform for Register { admin: data.admin, banned: false, show_nsfw: data.show_nsfw, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Active as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/activity.rs b/lemmy_db/src/activity.rs index c3f0ab679..7a2da8239 100644 --- a/lemmy_db/src/activity.rs +++ b/lemmy_db/src/activity.rs @@ -108,7 +108,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/comment.rs b/lemmy_db/src/comment.rs index 398ea78bf..02c84187e 100644 --- a/lemmy_db/src/comment.rs +++ b/lemmy_db/src/comment.rs @@ -284,7 +284,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/comment_view.rs b/lemmy_db/src/comment_view.rs index a3358ac43..568083ce9 100644 --- a/lemmy_db/src/comment_view.rs +++ b/lemmy_db/src/comment_view.rs @@ -523,7 +523,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/community.rs b/lemmy_db/src/community.rs index 24cf7e32f..57227a08c 100644 --- a/lemmy_db/src/community.rs +++ b/lemmy_db/src/community.rs @@ -329,7 +329,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/moderator.rs b/lemmy_db/src/moderator.rs index 3edd4350f..fb74def08 100644 --- a/lemmy_db/src/moderator.rs +++ b/lemmy_db/src/moderator.rs @@ -420,7 +420,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), @@ -449,7 +449,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/password_reset_request.rs b/lemmy_db/src/password_reset_request.rs index 8a831a8db..20db73ec5 100644 --- a/lemmy_db/src/password_reset_request.rs +++ b/lemmy_db/src/password_reset_request.rs @@ -104,7 +104,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/post.rs b/lemmy_db/src/post.rs index 724c342c6..41401431b 100644 --- a/lemmy_db/src/post.rs +++ b/lemmy_db/src/post.rs @@ -353,7 +353,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/post_view.rs b/lemmy_db/src/post_view.rs index 8f606b226..247f53ac8 100644 --- a/lemmy_db/src/post_view.rs +++ b/lemmy_db/src/post_view.rs @@ -418,7 +418,7 @@ mod tests { admin: false, banned: false, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/private_message.rs b/lemmy_db/src/private_message.rs index 988d97d3b..4775ceba2 100644 --- a/lemmy_db/src/private_message.rs +++ b/lemmy_db/src/private_message.rs @@ -161,7 +161,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), @@ -190,7 +190,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/user.rs b/lemmy_db/src/user.rs index 83f0559ab..ee041ab65 100644 --- a/lemmy_db/src/user.rs +++ b/lemmy_db/src/user.rs @@ -191,7 +191,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), @@ -221,7 +221,7 @@ mod tests { published: inserted_user.published, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), diff --git a/lemmy_db/src/user_mention.rs b/lemmy_db/src/user_mention.rs index f35722cf9..79f93801a 100644 --- a/lemmy_db/src/user_mention.rs +++ b/lemmy_db/src/user_mention.rs @@ -100,7 +100,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), @@ -129,7 +129,7 @@ mod tests { published: None, updated: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), From 990987b1742fced9ab224d92808a9aa8de0e2526 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 4 Oct 2020 08:42:30 -0500 Subject: [PATCH 06/14] Improving administration page docs. Fixes #1160 --- docs/src/administration.md | 12 ++++++++++-- docs/src/administration_install_docker.md | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/src/administration.md b/docs/src/administration.md index 9851232d9..690b71596 100644 --- a/docs/src/administration.md +++ b/docs/src/administration.md @@ -1,3 +1,11 @@ -# Admin info +# Administration info -Information for Lemmy instance admins, and those who want to start an instance. +Information for Lemmy instance admins, and those who want to run a server. + +## Install + +Lemmy has two primary install methods, [docker](administration_install_docker.md), and [ansible](administration_install_ansible.md). Ansible simplifies deploying to a remote server, while docker is best for local testing. + +### Manual install + +Manual installs are *possible*, but not preferred, since Lemmy is dependent on other local services: The [lemmy-ui](https://github.com/LemmyNet/lemmy-ui), [a Postgresql Database](https://www.postgresql.org/), [pict-rs](https://git.asonix.dog/asonix/pict-rs/) for images, and [iframely](https://iframely.com/) for embeds. To see how these are wired together, look at the docker-compose.yml files. Due to the complexity of different systems, we will not support manual installs. diff --git a/docs/src/administration_install_docker.md b/docs/src/administration_install_docker.md index 311655a36..490fe1c01 100644 --- a/docs/src/administration_install_docker.md +++ b/docs/src/administration_install_docker.md @@ -25,15 +25,21 @@ Open up your `docker-compose.yml`, and make sure `LEMMY_EXTERNAL_HOST` for `lemm - LEMMY_HTTPS=false ``` +If you'd like a different database password, you should also change it in the `docker-compose.yml` **before** your first run. + After this, have a look at the [config file](administration_configuration.md) named `lemmy.hjson`, and adjust it, in particular the hostname, and possibly the db password. Then run: `docker-compose up -d` +You can access the lemmy-ui at `http://localhost:1235` + To make Lemmy available outside the server, you need to setup a reverse proxy, like Nginx. [A sample nginx config](https://raw.githubusercontent.com/LemmyNet/lemmy/main/ansible/templates/nginx.conf), could be setup with: ```bash wget https://raw.githubusercontent.com/LemmyNet/lemmy/main/ansible/templates/nginx.conf # Replace the {{ vars }} +# The default lemmy_port is 8536 +# The default lemmy_ui_port is 1235 sudo mv nginx.conf /etc/nginx/sites-enabled/lemmy.conf ``` From 4d0365bca396dd87e512984914ee7bb83e5ac065 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 4 Oct 2020 14:01:12 -0500 Subject: [PATCH 07/14] Replace gitlab with codeberg. Fixes #1171 --- README.md | 2 +- docs/src/contributing.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61facf6b2..53a477353 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ If you want to help with translating, take a look at [Weblate](https://weblate.y - [GitHub](https://github.com/LemmyNet/lemmy) - [Gitea](https://yerbamate.dev/LemmyNet/lemmy) -- [GitLab](https://gitlab.com/dessalines/lemmy) +- [Codeberg](https://codeberg.org/LemmyNet/lemmy) ## Credits diff --git a/docs/src/contributing.md b/docs/src/contributing.md index 02eb91774..e9c7b9ea1 100644 --- a/docs/src/contributing.md +++ b/docs/src/contributing.md @@ -6,7 +6,7 @@ Information about contributing to Lemmy, whether it is translating, testing, des - [GitHub (for issues and pull requests)](https://github.com/LemmyNet/lemmy) - [Gitea (only for pull requests)](https://yerbamate.dev/LemmyNet/lemmy) -- [GitLab (only code-mirror)](https://gitlab.com/dessalines/lemmy) +- [Codeberg](https://codeberg.org/LemmyNet/lemmy) ## Translating From 9b69c446e2273b86920798255bdb394df2aa9cd5 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 4 Oct 2020 15:44:26 -0500 Subject: [PATCH 08/14] Remove kubernetes. #842 --- README.md | 3 +- docker/k8s/db.yml | 48 ---------------- docker/k8s/lemmy.yml | 46 --------------- docker/k8s/pictshare.yml | 57 ------------------- docs/src/SUMMARY.md | 1 - docs/src/about_features.md | 2 +- docs/src/administration_install_kubernetes.md | 24 -------- 7 files changed, 2 insertions(+), 179 deletions(-) delete mode 100644 docker/k8s/db.yml delete mode 100644 docker/k8s/lemmy.yml delete mode 100644 docker/k8s/pictshare.yml delete mode 100644 docs/src/administration_install_kubernetes.md diff --git a/README.md b/README.md index 53a477353..98b412955 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Each Lemmy server can set its own moderation policy; appointing site-wide admins - Open source, [AGPL License](/LICENSE). - Self hostable, easy to deploy. - - Comes with [Docker](#docker), [Ansible](#ansible), [Kubernetes](#kubernetes). + - Comes with [Docker](#docker) and [Ansible](#ansible). - Clean, mobile-friendly interface. - Only a minimum of a username and password is required to sign up! - User avatar support. @@ -102,7 +102,6 @@ Each Lemmy server can set its own moderation policy; appointing site-wide admins - [Docker](https://dev.lemmy.ml/docs/administration_install_docker.html) - [Ansible](https://dev.lemmy.ml/docs/administration_install_ansible.html) -- [Kubernetes](https://dev.lemmy.ml/docs/administration_install_kubernetes.html) ## Lemmy Projects diff --git a/docker/k8s/db.yml b/docker/k8s/db.yml deleted file mode 100644 index 4b78a8c58..000000000 --- a/docker/k8s/db.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - lemmy.service: db - name: db -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - labels: - lemmy.service: db - spec: - containers: - - env: - - name: POSTGRES_DB - value: lemmy - - name: POSTGRES_PASSWORD - # example: very-good-password - value: CHANGE_ME - - name: POSTGRES_USER - value: lemmy - image: postgres:12-alpine - name: db - volumeMounts: - - mountPath: /var/lib/postgresql/data - name: db - restartPolicy: Always - volumes: - - name: db - persistentVolumeClaim: - claimName: db ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - labels: - lemmy.service: db - name: db -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi diff --git a/docker/k8s/lemmy.yml b/docker/k8s/lemmy.yml deleted file mode 100644 index 8e105d605..000000000 --- a/docker/k8s/lemmy.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - lemmy.service: lemmy - name: lemmy -spec: - replicas: 1 - template: - metadata: - labels: - lemmy.service: lemmy - spec: - containers: - - env: - - name: LEMMY_DATABASE_URL - # example: 'postgres://lemmy:password@db:5432/lemmy' - value: CHANGE_ME - - name: LEMMY_HOSTNAME - # example: 'lemmy.example.com' - value: CHANGE_ME - - name: LEMMY_JWT_SECRET - # example: 'very-super-good-secret' - value: CHANGE_ME - - name: LEMMY_FRONT_END_DIR - value: /app/dist - image: dessalines/lemmy:v0.2.0.1 - name: lemmy - ports: - - containerPort: 8536 - restartPolicy: Always ---- -apiVersion: v1 -kind: Service -metadata: - labels: - lemmy.service: lemmy - name: lemmy -spec: - ports: - - name: "8536" - port: 8536 - targetPort: 8536 - selector: - lemmy.service: lemmy diff --git a/docker/k8s/pictshare.yml b/docker/k8s/pictshare.yml deleted file mode 100644 index 1209e83ec..000000000 --- a/docker/k8s/pictshare.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - labels: - lemmy.service: pictshare - name: pictshare -spec: - replicas: 1 - strategy: - type: Recreate - template: - metadata: - labels: - lemmy.service: pictshare - spec: - containers: - - image: hascheksolutions/pictshare:latest - name: pictshare - ports: - - containerPort: 80 - volumeMounts: - - mountPath: /usr/share/nginx/html/data - name: pictshare - restartPolicy: Always - volumes: - - name: pictshare - persistentVolumeClaim: - claimName: pictshare ---- -apiVersion: v1 -kind: Service -metadata: - labels: - lemmy.service: pictshare - name: pictshare -spec: - ports: - - name: "8537" - port: 8537 - targetPort: 80 - selector: - lemmy.service: pictshare -status: ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - labels: - lemmy.service: pictshare - name: pictshare -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 020a9dc1b..8392635bf 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -8,7 +8,6 @@ - [Administration](administration.md) - [Install with Docker](administration_install_docker.md) - [Install with Ansible](administration_install_ansible.md) - - [Install with Kubernetes](administration_install_kubernetes.md) - [Configuration](administration_configuration.md) - [Backup and Restore](administration_backup_and_restore.md) - [Contributing](contributing.md) diff --git a/docs/src/about_features.md b/docs/src/about_features.md index 7c8d95a96..ebf712e59 100644 --- a/docs/src/about_features.md +++ b/docs/src/about_features.md @@ -2,7 +2,7 @@ - Open source, [AGPL License](/LICENSE). - Self hostable, easy to deploy. - - Comes with [Docker](#docker), [Ansible](#ansible), [Kubernetes](#kubernetes). + - Comes with [Docker](#docker) and [Ansible](#ansible). - Clean, mobile-friendly interface. - Only a minimum of a username and password is required to sign up! - User avatar support. diff --git a/docs/src/administration_install_kubernetes.md b/docs/src/administration_install_kubernetes.md deleted file mode 100644 index 729cb1558..000000000 --- a/docs/src/administration_install_kubernetes.md +++ /dev/null @@ -1,24 +0,0 @@ -# Kubernetes Installation - -You'll need to have an existing Kubernetes cluster and [storage class](https://kubernetes.io/docs/concepts/storage/storage-classes/). -Setting this up will vary depending on your provider. -To try it locally, you can use [MicroK8s](https://microk8s.io/) or [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/). - -Once you have a working cluster, edit the environment variables and volume sizes in `docker/k8s/*.yml`. -You may also want to change the service types to use `LoadBalancer`s depending on where you're running your cluster (add `type: LoadBalancer` to `ports)`, or `NodePort`s. -By default they will use `ClusterIP`s, which will allow access only within the cluster. See the [docs](https://kubernetes.io/docs/concepts/services-networking/service/) for more on networking in Kubernetes. - -**Important** Running a database in Kubernetes will work, but is generally not recommended. -If you're deploying on any of the common cloud providers, you should consider using their managed database service instead (RDS, Cloud SQL, Azure Databse, etc.). - -Now you can deploy: - -```bash -# Add `-n foo` if you want to deploy into a specific namespace `foo`; -# otherwise your resources will be created in the `default` namespace. -kubectl apply -f docker/k8s/db.yml -kubectl apply -f docker/k8s/pictshare.yml -kubectl apply -f docker/k8s/lemmy.yml -``` - -If you used a `LoadBalancer`, you should see it in your cloud provider's console. From 557d476001cd1e918ef27697cf9f800d05fcb208 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 4 Oct 2020 19:10:15 -0500 Subject: [PATCH 09/14] Password length check. Fixes #1087 --- lemmy_api/src/user.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lemmy_api/src/user.rs b/lemmy_api/src/user.rs index 4324c9368..17bb12093 100644 --- a/lemmy_api/src/user.rs +++ b/lemmy_api/src/user.rs @@ -117,6 +117,11 @@ impl Perform for Register { } } + // Password length check + if data.password.len() > 60 { + return Err(APIError::err("invalid_password").into()); + } + // Make sure passwords match if data.password != data.password_verify { return Err(APIError::err("passwords_dont_match").into()); From c348e788e4ce6eb0ff06b94d09a59975a5942a86 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 4 Oct 2020 19:57:35 -0500 Subject: [PATCH 10/14] Adding optional community_name field to search. Fixes #1057 --- api_tests/package.json | 4 ++-- api_tests/yarn.lock | 16 ++++++++-------- docs/src/contributing_websocket_http_api.md | 1 + lemmy_api/src/site.rs | 4 ++++ lemmy_db/src/post_view.rs | 4 ++-- lemmy_structs/src/site.rs | 1 + 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/api_tests/package.json b/api_tests/package.json index ec16cac66..5c7cd3eb7 100644 --- a/api_tests/package.json +++ b/api_tests/package.json @@ -12,9 +12,9 @@ "devDependencies": { "@types/jest": "^26.0.14", "jest": "^26.4.2", - "lemmy-js-client": "^1.0.13", + "lemmy-js-client": "^1.0.14", "node-fetch": "^2.6.1", - "ts-jest": "^26.4.0", + "ts-jest": "^26.4.1", "typescript": "^4.0.3" } } diff --git a/api_tests/yarn.lock b/api_tests/yarn.lock index e0def58b6..e1ee01ac3 100644 --- a/api_tests/yarn.lock +++ b/api_tests/yarn.lock @@ -2360,10 +2360,10 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== -lemmy-js-client@^1.0.13: - version "1.0.13" - resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-1.0.13.tgz#d0e1246129ade295faeec1fb4b2c7397d6947a19" - integrity sha512-Xz87cCswi/2pbDdApw9JIy8bDWRFGiGWO6IhehTytOAzf36dr4GYgsjTQTLjBX+s+BNYr8hE0+Sz4g9c+ynoJg== +lemmy-js-client@^1.0.14: + version "1.0.14" + resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-1.0.14.tgz#81a847dd0c7d97c83913f198717498c223dc371e" + integrity sha512-hiGxAnAD5RFmE8qHMBtYNNYD/UrfCZ5JzmVEH/i5Vg/v5i/ZVmebx20uWtRMmdSSy6s4GbW0w4niszLW6SaJ3Q== leven@^3.1.0: version "3.1.0" @@ -3382,10 +3382,10 @@ tr46@^2.0.2: dependencies: punycode "^2.1.1" -ts-jest@^26.4.0: - version "26.4.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.0.tgz#903c7827f3d3bc33efc2f91be294b164400c32e3" - integrity sha512-ofBzoCqf6Nv/PoWb/ByV3VNKy2KJSikamOBxvR3E6eVdIw10GwAXoyvMWXXjZJK2s6S27ZE8fI+JBTnGaovl6Q== +ts-jest@^26.4.1: + version "26.4.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-26.4.1.tgz#08ec0d3fc2c3a39e4a46eae5610b69fafa6babd0" + integrity sha512-F4aFq01aS6mnAAa0DljNmKr/Kk9y4HVZ1m6/rtJ0ED56cuxINGq3Q9eVAh+z5vcYKe5qnTMvv90vE8vUMFxomg== dependencies: "@types/jest" "26.x" bs-logger "0.x" diff --git a/docs/src/contributing_websocket_http_api.md b/docs/src/contributing_websocket_http_api.md index ca2cceba6..225db0bf7 100644 --- a/docs/src/contributing_websocket_http_api.md +++ b/docs/src/contributing_websocket_http_api.md @@ -921,6 +921,7 @@ Search types are `All, Comments, Posts, Communities, Users, Url` q: String, type_: String, community_id: Option, + community_name: Option, sort: String, page: Option, limit: Option, diff --git a/lemmy_api/src/site.rs b/lemmy_api/src/site.rs index 34bdd096e..6d504f267 100644 --- a/lemmy_api/src/site.rs +++ b/lemmy_api/src/site.rs @@ -357,6 +357,7 @@ impl Perform for Search { let limit = data.limit; let sort = SortType::from_str(&data.sort)?; let community_id = data.community_id; + let community_name = data.community_name.to_owned(); match type_ { SearchType::Posts => { posts = blocking(context.pool(), move |conn| { @@ -364,6 +365,7 @@ impl Perform for Search { .sort(&sort) .show_nsfw(true) .for_community_id(community_id) + .for_community_name(community_name) .search_term(q) .my_user_id(user_id) .page(page) @@ -412,6 +414,7 @@ impl Perform for Search { .sort(&sort) .show_nsfw(true) .for_community_id(community_id) + .for_community_name(community_name) .search_term(q) .my_user_id(user_id) .page(page) @@ -466,6 +469,7 @@ impl Perform for Search { .sort(&sort) .show_nsfw(true) .for_community_id(community_id) + .for_community_name(community_name) .url_search(q) .page(page) .limit(limit) diff --git a/lemmy_db/src/post_view.rs b/lemmy_db/src/post_view.rs index 8f606b226..128def96d 100644 --- a/lemmy_db/src/post_view.rs +++ b/lemmy_db/src/post_view.rs @@ -273,12 +273,10 @@ impl<'a> PostQueryBuilder<'a> { if let Some(for_community_id) = self.for_community_id { query = query.filter(community_id.eq(for_community_id)); - query = query.then_order_by(stickied.desc()); } if let Some(for_community_name) = self.for_community_name { query = query.filter(community_name.eq(for_community_name)); - query = query.then_order_by(stickied.desc()); } if let Some(url_search) = self.url_search { @@ -292,6 +290,8 @@ impl<'a> PostQueryBuilder<'a> { .or_filter(body.ilike(searcher)); } + query = query.then_order_by(stickied.desc()); + query = match self.sort { SortType::Active => query .then_order_by(hot_rank_active.desc()) diff --git a/lemmy_structs/src/site.rs b/lemmy_structs/src/site.rs index b82b325e3..3f185928b 100644 --- a/lemmy_structs/src/site.rs +++ b/lemmy_structs/src/site.rs @@ -23,6 +23,7 @@ pub struct Search { pub q: String, pub type_: String, pub community_id: Option, + pub community_name: Option, pub sort: String, pub page: Option, pub limit: Option, From 5a56c08c91064c06334064241cb96b707f3f3d49 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Fri, 2 Oct 2020 17:24:16 +0200 Subject: [PATCH 11/14] Update lemmy-ui version in docker-compose files on release (fixes #1164) --- docker/prod/deploy.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docker/prod/deploy.sh b/docker/prod/deploy.sh index 7d84738b2..81bfdab8e 100755 --- a/docker/prod/deploy.sh +++ b/docker/prod/deploy.sh @@ -1,10 +1,10 @@ #!/bin/sh set -e -git checkout main +#git checkout main # Creating the new tag new_tag="$1" -third_semver=$(echo $new_tag | cut -d "." -f 3) +#third_semver=$(echo $new_tag | cut -d "." -f 3) # Setting the version on the front end cd ../../ @@ -17,12 +17,16 @@ git add "ansible/VERSION" cd docker/prod || exit -# Changing the docker-compose prod +# Changing various references to the Lemmy version +sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../dev/docker-compose.yml +sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../federation/docker-compose.yml sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../prod/docker-compose.yml -sed -i "s/dessalines\/lemmy:.*/dessalines\/lemmy:$new_tag/" ../../ansible/templates/docker-compose.yml +sed -i "s/dessalines\/lemmy-ui:.*/dessalines\/lemmy-ui:$new_tag/" ../prod/docker-compose.yml sed -i "s/dessalines\/lemmy:v.*/dessalines\/lemmy:$new_tag/" ../travis/docker_push.sh + +git add ../dev/docker-compose.yml +git add ../federation/docker-compose.yml git add ../prod/docker-compose.yml -git add ../../ansible/templates/docker-compose.yml git add ../travis/docker_push.sh # The commit From 5e92fb47ededfd81efbd1b3ca6729606e7621564 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 5 Oct 2020 11:53:13 -0500 Subject: [PATCH 12/14] Changing one more darkly to browser. #1163 --- tests/integration_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 4edaefac5..f7b32151e 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -88,7 +88,7 @@ fn create_user(conn: &PgConnection, name: &str) -> User_ { updated: None, published: None, show_nsfw: false, - theme: "darkly".into(), + theme: "browser".into(), default_sort_type: SortType::Hot as i16, default_listing_type: ListingType::Subscribed as i16, lang: "browser".into(), From 9dc629406543e9ac5e0b1965c0b1599d7e9e0b0a Mon Sep 17 00:00:00 2001 From: Nutomic Date: Wed, 7 Oct 2020 16:08:03 +0000 Subject: [PATCH 13/14] Explain how federation works for admins, various doc updates (#1176) --- docs/src/SUMMARY.md | 1 + docs/src/administration_federation.md | 27 +++++++++++++++++++++ docs/src/contributing_docker_development.md | 4 +-- docs/src/contributing_local_development.md | 5 +++- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 docs/src/administration_federation.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 8392635bf..e00f5ced6 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -10,6 +10,7 @@ - [Install with Ansible](administration_install_ansible.md) - [Configuration](administration_configuration.md) - [Backup and Restore](administration_backup_and_restore.md) + - [Federation](administration_federation.md) - [Contributing](contributing.md) - [Docker Development](contributing_docker_development.md) - [Local Development](contributing_local_development.md) diff --git a/docs/src/administration_federation.md b/docs/src/administration_federation.md new file mode 100644 index 000000000..5dc0b1a2e --- /dev/null +++ b/docs/src/administration_federation.md @@ -0,0 +1,27 @@ +# Federation + +Note: ActivityPub federation is still under development. We recommend that you only enable it on test instances for now. + +To enable federation, change the setting `federation.enabled` to `true` in `lemmy.hjson`, and restart Lemmy. + +Federation does not start automatically, but needs to be triggered manually through the search. To do this you have to enter a reference to a remote object, such as: + +- `!main@dev.lemmy.ml` (Community) +- `@nutomic@dev.lemmy.ml` (User) +- `https://dev.lemmy.ml/c/programming` (Community) +- `https://dev.lemmy.ml/u/nutomic` (User) +- `https://dev.lemmy.ml/post/123` (Post) + +For an overview of how federation in Lemmy works on a technical level, check out our [Federation Overview](contributing_federation_overview.md). + +## Instance allowlist and blocklist + +The federation section of Lemmy's config has two variables `allowed_instances` and `blocked_instances`. These control which other instances Lemmy will federate with. Both settings take a comma separated list of domains, eg `dev.lemmy.ml, example.com`. You can either change those settings via `/admin`, or directly on the server filesystem. + +It is important to note that these settings only affect sending and receiving of data between instances. If allow federation with a certain instance, and then remove it from the allowlist, this will not affect previously federated data. These communities, users, posts and comments will still be shown. They will just not be updated anymore. And even if an instance is blocked, it can still fetch and display public data from your instance. + +By default, both `allowed_instances` and `blocked_instances` values are empty, which means that Lemmy will federate with every compatible instance. We do not recommend this, because the moderation tools are not yet ready to deal with malicious instances. + +What we do recommend is putting a list of trusted instances into `allowed_instances`, and only federating with those. Note that both sides need to add each other to their `allowed_instances` to allow two-way federation. + +Alternatively you can also use blocklist based federation. In this case, add the domains of instances you do *not* want to federate with. You can only set one of `allowed_instances` and `blocked_instances`, as setting both doesn't make sense. diff --git a/docs/src/contributing_docker_development.md b/docs/src/contributing_docker_development.md index 586055a06..b3f113337 100644 --- a/docs/src/contributing_docker_development.md +++ b/docs/src/contributing_docker_development.md @@ -11,8 +11,8 @@ git clone https://github.com/LemmyNet/lemmy ## Running ```bash -cd lemmy/docker/dev -sudo docker-compose up --no-deps --build +cd /docker/dev +./docker_update.sh ``` and go to http://localhost:1235. diff --git a/docs/src/contributing_local_development.md b/docs/src/contributing_local_development.md index 5f53d3374..ba3663c93 100644 --- a/docs/src/contributing_local_development.md +++ b/docs/src/contributing_local_development.md @@ -36,6 +36,9 @@ cargo build ### Get the front end source code ``` git clone https://github.com/LemmyNet/lemmy-ui.git +# get the translations +git submodule init +git submodule update ``` ### Setup postgresql @@ -78,7 +81,7 @@ yarn yarn dev ``` -and goto [localhost:1234](http://localhost:1234). Front end saves should rebuild the project. +and go to [localhost:1234](http://localhost:1234). Front end saves should rebuild the project. Note that this setup doesn't include image uploads or link previews (provided by pict-rs and iframely respectively). If you want to test those, you should use the From f00cfa005ef5070c98a19c066937e5d0b5f2e873 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 7 Oct 2020 11:09:56 -0500 Subject: [PATCH 14/14] Adding submodule update --remote --- docs/src/contributing_local_development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/contributing_local_development.md b/docs/src/contributing_local_development.md index ba3663c93..cf7049bdc 100644 --- a/docs/src/contributing_local_development.md +++ b/docs/src/contributing_local_development.md @@ -38,7 +38,7 @@ cargo build git clone https://github.com/LemmyNet/lemmy-ui.git # get the translations git submodule init -git submodule update +git submodule update --remote ``` ### Setup postgresql