From 126e2085fdb42390742e1ca7a899c26b3669c39a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 18 Jan 2020 12:38:50 -0500 Subject: [PATCH 1/4] Update donation section. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f9daa66cd..dca799132 100644 --- a/README.md +++ b/README.md @@ -133,12 +133,16 @@ nano inventory # enter your server, domain, contact email ansible-playbook lemmy.yml --become ``` -## Support +## Support / Donate Lemmy is free, open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project. - [Support on Patreon](https://www.patreon.com/dessalines). -- [Sponsor List](https://dev.lemmy.ml/sponsors). +- [List of Sponsors](https://dev.lemmy.ml/sponsors). +- Soon to add either liberapay or opencollective. + +### Crypto + - bitcoin: `1Hefs7miXS5ff5Ck5xvmjKjXf5242KzRtK` - ethereum: `0x400c96c96acbC6E7B3B43B1dc1BB446540a88A01` - monero: `41taVyY6e1xApqKyMVDRVxJ76sPkfZhALLTjRvVKpaAh2pBd4wv9RgYj1tSPrx8wc6iE1uWUfjtQdTmTy2FGMeChGVKPQuV` From e859080632a2252169bf12a0e3d96e24da4d5381 Mon Sep 17 00:00:00 2001 From: Felix Date: Sat, 18 Jan 2020 13:14:50 +0100 Subject: [PATCH 2/4] Add Code of Conduct --- CODE_OF_CONDUCT.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..b350ddbb9 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,35 @@ +# Code of Conduct + +- We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic. +- Please avoid using overtly sexual aliases or other nicknames that might detract from a friendly, safe and welcoming environment for all. +- Please be kind and courteous. There’s no need to be mean or rude. +- Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer. +- Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works. +- We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term “harassment” as including the definition in the Citizen Code of Conduct; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don’t tolerate behavior that excludes people in socially marginalized groups. +- Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the Lemmy moderation team immediately. Whether you’re a regular contributor or a newcomer, we care about making this community a safe place for you and we’ve got your back. +- Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome. + +[**Message the Moderation Team on Mastodon**](https://mastodon.social/@LemmyDev) + +[**Email The Moderation Team**](mailto:contact@lemmy.ml) + +## Moderation + +These are the policies for upholding our community’s standards of conduct. If you feel that a thread needs moderation, please contact the Lemmy moderation team . + +1. Remarks that violate the Lemmy standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.) +2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed. +3. Moderators will first respond to such remarks with a warning. +4. If the warning is unheeded, the user will be “kicked,” i.e., kicked out of the communication channel to cool off. +5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded. +6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology. +7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, in private. Complaints about bans in-channel are not allowed. +8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others. + +In the Lemmy community we strive to go the extra step to look out for each other. Don’t just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they’re off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely. + +And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make others comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust. + +The enforcement policies listed above apply to all official Lemmy venues; including git repositories under [github.com/dessalines/lemmy](https://github.com/dessalines/lemmy) and [yerbamate.dev/dessalines/lemmy](https://yerbamate.dev/dessalines/lemmy), the [Matrix channel](https://matrix.to/#/!BZVTUuEiNmRcbFeLeI:matrix.org?via=matrix.org&via=privacytools.io&via=permaweb.io); and all instances under lemmy.ml. For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion. + +Adapted from the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct), which is based on the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/). From 0a409bc9be48d4b44cf71e5c38231e9aeaee601b Mon Sep 17 00:00:00 2001 From: Felix Date: Sun, 19 Jan 2020 12:32:02 +0100 Subject: [PATCH 3/4] Use actual structs for nodeinfo --- server/src/routes/nodeinfo.rs | 87 +++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 24 deletions(-) diff --git a/server/src/routes/nodeinfo.rs b/server/src/routes/nodeinfo.rs index 509e3404a..75568608e 100644 --- a/server/src/routes/nodeinfo.rs +++ b/server/src/routes/nodeinfo.rs @@ -1,3 +1,4 @@ +extern crate lazy_static; use crate::db::site_view::SiteView; use crate::version; use crate::Settings; @@ -6,7 +7,7 @@ use actix_web::web; use actix_web::HttpResponse; use diesel::r2d2::{ConnectionManager, Pool}; use diesel::PgConnection; -use serde_json::json; +use serde::Serialize; pub fn config(cfg: &mut web::ServiceConfig) { cfg @@ -15,14 +16,13 @@ pub fn config(cfg: &mut web::ServiceConfig) { } async fn node_info_well_known() -> HttpResponse { - let json = json!({ - "links": { - "rel": "http://nodeinfo.diaspora.software/ns/schema/2.0", - "href": format!("https://{}/nodeinfo/2.0.json", Settings::get().hostname), - } - }); - - HttpResponse::Ok().json(json) + let node_info = NodeInfoWellKnown { + links: NodeInfoWellKnownLinks { + rel: "http://nodeinfo.diaspora.software/ns/schema/2.0".to_string(), + href: format!("https://{}/nodeinfo/2.0.json", Settings::get().hostname), + }, + }; + HttpResponse::Ok().json(node_info) } async fn node_info( @@ -35,29 +35,68 @@ async fn node_info( Err(_) => return Err(format_err!("not_found")), }; let protocols = if Settings::get().federation_enabled { - vec!["activitypub"] + vec!["activitypub".to_string()] } else { vec![] }; - Ok(json!({ - "version": "2.0", - "software": { - "name": "lemmy", - "version": version::VERSION, + Ok(NodeInfo { + version: "2.0".to_string(), + software: NodeInfoSoftware { + name: "lemmy".to_string(), + version: version::VERSION.to_string(), }, - "protocols": protocols, - "usage": { - "users": { - "total": site_view.number_of_users + protocols, + usage: NodeInfoUsage { + users: NodeInfoUsers { + total: site_view.number_of_users, }, - "localPosts": site_view.number_of_posts, - "localComments": site_view.number_of_comments, - "openRegistrations": site_view.open_registration, - } - })) + local_posts: site_view.number_of_posts, + local_comments: site_view.number_of_comments, + open_registrations: site_view.open_registration, + }, + }) }) .await .map(|json| HttpResponse::Ok().json(json)) .map_err(|_| HttpResponse::InternalServerError())?; Ok(res) } + +#[derive(Serialize)] +struct NodeInfoWellKnown { + links: NodeInfoWellKnownLinks, +} + +#[derive(Serialize)] +struct NodeInfoWellKnownLinks { + rel: String, + href: String, +} + +#[derive(Serialize)] +struct NodeInfo { + version: String, + software: NodeInfoSoftware, + protocols: Vec, + usage: NodeInfoUsage, +} + +#[derive(Serialize)] +struct NodeInfoSoftware { + name: String, + version: String, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct NodeInfoUsage { + users: NodeInfoUsers, + local_posts: i64, + local_comments: i64, + open_registrations: bool, +} + +#[derive(Serialize)] +struct NodeInfoUsers { + total: i64, +} From 3edd75ed43c6e65614bd341a0478353d0988bae9 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 19 Jan 2020 09:20:10 -0500 Subject: [PATCH 4/4] Fixing a css sizing style. --- ui/assets/css/main.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/assets/css/main.css b/ui/assets/css/main.css index eb98adc1a..dcc55f194 100644 --- a/ui/assets/css/main.css +++ b/ui/assets/css/main.css @@ -41,7 +41,11 @@ height: auto; } -.md-div h1,h2,h3,h4,h5 { +.md-div h1, +.md-div h2, +.md-div h3, +.md-div h4, +.md-div h5 { font-size:1.171875rem; }