Lemmy Development

"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearLE
Lemmy Development Zetaphor 1y ago 100%
We've received direction from Dessalines so we can progress to enable CSS customization
https://github.com/LemmyNet/lemmy-ui/pull/1361#issuecomment-1597450180

cross-posted from: https://zemmy.cc/post/26356 > There have been a number of ongoing conversations and PR's around trying to add semantics to the lemmy-ui markup to enable developers to more easily create custom themes, userscripts, and browser extensions. > > Up until now we've had no input from a maintainer, as they are rightfully heads down focused on shipping the 0.18 update. We now have direction on where we should be focusing our effort and to what extent the project will offer support for this: > > > ...I'm fine with adding something like this, with the **very bold caveat** that we as maintainers will not do custom theme support, and if class names change, and themes break, that is up to themers, not us. I've had to close so many issues on this repo for people asking me to do theming support for them, which I don't have time to do. > > This is great news for anyone who has been struggling with incredibly deep class selectors and general lack of specificity. There is further mention of switching UI frameworks in the future, so do expect that whatever you build today may break tomorrow. We're still in the very early days of the Lemmy maturity lifecycle, but it's encouraging to receive acknowledgement for this effort. > > Relevant links to the various efforts in addition to the post link: > > * [jsit's proof of concept for classes](https://github.com/LemmyNet/lemmy-ui/pull/1371) > > * [My PR to add classes and ID's (merged)](https://github.com/LemmyNet/lemmy-ui/pull/1327) > > * [djv's thread that started their (post linked) PR](https://github.com/LemmyNet/lemmy-ui/issues/1319) > > * [A thread from 2022 where Dessalines laid out their original motivations for resisting custom classes](https://github.com/LemmyNet/lemmy-ui/issues/863) >

1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearLE
Lemmy Development kephalos 1y ago 100%
Lemmy API: How to obtain the community ID

I want to write a simple Lemmy Command line client that posts to a community. There is https://join-lemmy.org/api/interfaces/CreatePost.html but it expects a community ID `community_id`, I would have expected that I can get the community ID by community name / or URL but `GetCommunity` does not seem to offer this https://join-lemmy.org/api/interfaces/GetCommunity.html#id Any ideas?

1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearLE
Lemmy Development Zetaphor 1y ago 100%
I'm working on adding more semantics to the UI markup to make theming easier
github.com

Looking for feedback! There is a distinct lack of semantic ID's and classes in the Lemmy UI. This makes everything from theming to userscripts unnecessarily difficult. I'm hoping to remedy that.

1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearLE
Lemmy Development Zetaphor 1y ago 100%
GitHub - rileynull/RedditLemmyImporter: 🔥 Anti-Reddit Aktion 🔥
https://github.com/rileynull/RedditLemmyImporter

cross-posted from: https://beehaw.org/post/485789 > What would folks think about using this tool to clone the existing subreddit? Losing the historical content would really suck. I make heavy use of subreddit search for solving technical problems. > > [rileynull/RedditLemmyImporter: 🔥 Anti-Reddit Aktion 🔥](https://github.com/rileynull/RedditLemmyImporter) > > > This project translates Reddit API responses into a PL/pgSQL script which loads the data into a Lemmy database. > > > > In other words, it takes Reddit posts/comments and puts them into Lemmy. > > PS I am a pretty newb person and last time I tried to do much with a db I didn't get very far so please no one rely on me to get this done. I will see about giving it a shot but given the short timelines might not get it in time.

1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearLE
Lemmy Development Zetaphor 1y ago 100%
Lemmy setup notes

Running on Fedora 38 Ran into multiple issues with SELinux Resolved by installing container-selinux and running restorecon ```bash dnf reinstall container-selinux restorecon /var/lib/docker ``` Was getting permission denied errors from sh while trying to add libpq to the container. Temporarily fixed with `setenforce Permissive`, need to add docker to audit2allow Need to install `postgresql-contrib` for pgcrypto extension

1
0
"Initials" by "Florian Körner", licensed under "CC0 1.0". / Remix of the original. - Created with dicebear.comInitialsFlorian Körnerhttps://github.com/dicebear/dicebearLE
Lemmy Development Zetaphor 1y ago 100%
(Crosspost) [Guide] Getting Lemmy Working on Docker

cross-posted from: https://lemmy.dcrich.net/post/1150 > Boy howdy, there are a lot of people coming to the matrix chat trying to figure out how to get lemmy working on docker who are stuck on the official documentation. This document is my guide on how I got Lemmy working. I'll also share what I don't have working yet to inspire further. > > Please feel free to steal anything you want from this and put it into [the official docs](https://github.com/LemmyNet/lemmy-docs/blob/main/src/en/administration/install_docker.md). I don't know the contributing policy and it sounds hard and I'm busy at the moment. > > Of note: I add a nginx container in this setup so that you don't have to do crazy hacks on your end for locations. If you already have an nginx reverse proxy that you are using, just use this one as a 2nd layer of nginx. There is low overhead, so don't worry about it. > > ## Setup > > For this guide, I'm requiring that you already have your own reverse proxy setup in place that can handle all the SSL termination. I'm doing this because I think that most people who are setting up Lemmy for the first time on Docker aren't setting up their first Docker container. > > Because I'm requiring that you setup your own SSL termination (caddy, ACME, Nginx Proxy Manager, etc.) before you begin, I will not talk further about https, certificates, or rotation. But before I do: Don't host a website in 2023 that doesn't serve content securely. Make sure that you get your stuff setup, including any certificate rotation. If you don't get this setup completed, I suggest that you shouldn't continue or host a public website. > > I also require that you be able to use docker-compose. > > ## Get Files > > Download [these 3 files](https://gist.github.com/Szeraax/73876ccb9599f70731f7eb8b967f4eaf) to your working directory from my github gist. You can download as zip or get them one at a time by scrolling down. > > ## Prepare Working Directory > > ~~~bash > mkdir -p volumes/pictrs > sudo chown -R 991:991 volumes/pictrs > ~~~ > > ## Edit Config Files > > * In the docker-compose.yml file, change the port, hostname, and database password. > * In the lemmy.hjson file, change the admin username/password, hostname, database password, and email settings. You can take out the entire email section if you want to. > * No changes to the nginx.conf file. > > ## Start It Up > Now you're ready to start the containers! > > You're pretty much good to go. Login to your lemmy instance. You should be able to use your docker host ip at your defined port OR via your reverse proxy lemmy domain host name. > > `docker-compose up` > > Watch the pretty log messages. > > You _should_ be able to curl your new admin user and get valid json back: `curl -H 'Accept: application/activity+json' https://lemmy.yourdomain.net/u/yourAdminUser` > > Press Ctrl+C if everything is working great and start it up as `docker-compose up -d` to make it a persistent running setup. > > ## Troubleshooting > > If you get the default nginx start page, it means that your nginx container isn't reading/following any nginx config file. Figure out why. Do you accidently have a blank directory created that is called nginx.conf instead of an actual file? Did you comment out the nginx.conf bind mount? > > > ## Update the Images > > In order to update the image to the latest release of lemmy, you have to manually go to your docker-compose file and edit the docker image tag to the latest version number. Then, you need to bring your container back up. Steps: > > 1. Edit the docker-compose.yml file image tags from 17.4 to whatever else comes out > 2. Run a docker-compose up which will update images as needed (I personally prefer to do a docker-compose down first, but that's personal preference): > > ~~~bash > docker-compose up > ~~~ > > Watch the pretty log messages. Press Ctrl+C if everything is working great and start it up as `docker-compose up -d` to make it a persistent running setup. > > ## Limitations > > I don't know anything about docker. I'm a docker noob. Please correct me for anything that you think is a bad idea. > > > Why are the docker tags for lemmy and lemmy-ui "latest" for arm64/v8? Shouldn't there be a latest-arm and a latest-x86 or something? Annoying that I have to pin my lemmy images to a specific version in docker. I would prefer to let them be set to 1 image that gets updated and have watchtower deal with updating the image on a schedule of my choosing. > > > ## Sources > I wouldn't be here without the matrix chat, https://join-lemmy.org/docs/en/administration/install_docker.html, and this post: https://lemmy.ml/post/1127760 > > > ## Reverse Proxies > There have been some suggested reverse proxy configs for Caddy and Apache! > > ### Caddy > Thanks to [@tmpod@lemmy.pt](https://lemmy.pt/u/tmpod) for [this caddyfile](https://paste.sr.ht/~tmpod/acd0e97901f7d29420f8454b0817698dcfa102ff): > > ~~~ > lemmy.tld { > header { > # Only connect to this site via HTTPS for the two years > Strict-Transport-Security max-age=63072000 > > # Various content security headers > Referrer-Policy same-origin > X-Content-Type-Options nosniff > X-Frame-Options DENY > X-XSS-Protection "1; mode=block" > # disable FLoC tracking > Permissions-Policy interest-cohort=() > > # Hide Caddy > -Server > } > > # Enable compression for JS/CSS/HTML bundle, for improved client load times. > # It might be nice to compress JSON, but leaving that out to protect against potential > # compression+encryption information leak attacks like BREACH. > @encode_mime { > header Content-Type text/css > header Content-Type application/javascript > header Content-Type image/svg+xml > } > encode @encode_mime gzip > > request_body { > max_size 8MB > } > > @pictshare_regexp path_regexp pictshare_regexp \/pictshare\/(.*) > redir @pictshare_regexp /pictrs/image/{re.pictshare_regexp.1} permanent > > # Supposedly better than having three different named matchers using standard matchers > # ¯\_(ツ)_/¯ > @backend ` > path('/api/*', '/pictrs/*', '/feeds/*', '/nodeinfo/*', '/.well-known/*') > || header({'Accept': 'application/*'}) > || method('POST') > ` > reverse_proxy @backend lemmy:8536 { > # This was needed because of a bug, but it probably has been fixed in the meanwhile. > # Will have to test later. > header_down -Transfer-Encoding > } > > reverse_proxy lemmy-ui:1234 > } > ~~~ > > > ### Apache > Here are a few apache configs you can draw from. > > The best apache config I've seen so far is by DeadCade [in the comments here](https://lemmy.dcrich.net/comment/1688). > > ~~~ > <VirtualHost *:443> > ServerName lemmy.deadca.de > SSLEngine on > ProxyRequests on > ProxyPreserveHost on > ProxyTimeout 600 > > SetEnv proxy-nokeepalive 1 > SetEnv proxy-sendchunked 1 > > <Location /> > Allow from all > ProxyPass http://127.0.0.1:(INTERNAL LEMMY PORT)/ > ProxyPassReverse http://127.0.0.1:(INTERNAL LEMMY PORT)/ > </Location> > > ErrorLog "ERROR LOG LOCATION" > CustomLog "ACCESS LOG LOCATION" common > > # Enable mod_rewrite (requires "a2enmod rewrite") > RewriteEngine on > > # WebSockets support (requires "a2enmod rewrite proxy_wstunnel") > RewriteCond %{HTTP:Upgrade} websocket [NC] > RewriteCond %{HTTP:Connection} upgrade [NC] > RewriteRule ^/?(.*) "ws://127.0.0.1:(INTERNAL LEMMY PORT)/$1" [P,L] > > SSLCertificateFile FULLCHAIN.PEM LOCATION > SSLCertificateKeyFile PRIVKEY.PEM LOCATION > Include /etc/letsencrypt/options-ssl-apache.conf > </VirtualHost> > ~~~ > > If you need another apache config, this was suggested by Samsonite (though, he knows that it needs cleaned up). Comment if you have suggestions for what to remove: > > ~~~ > <VirtualHost *:80> > ServerName mylemmydomain.com > RewriteEngine On > RewriteCond %{HTTPS} !=on > RewriteCond %{HTTP_HOST} !^(localhost|internallemmyip) > RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L] > > > </VirtualHost> > > <IfModule mod_ssl.c> > <VirtualHost *:443> > ServerName mylemmydomain.com > SSLEngine on > ProxyRequests On > ProxyPreserveHost On > ProxyTimeout 600 > > SSLCertificateFile /etc/letsencrypt/live/mylemmydomain.com/fullchain.pem > SSLCertificateKeyFile /etc/letsencrypt/live/mylemmydomain.com/privkey.pem > # ProxyPreserveHost On > > # Proxy pictshare > <Location "/pictshare"> > ProxyPass http://internallemmyip:8537/ > ProxyPassReverse http://internallemmyip:8537/ > </Location> > > # Proxy iframely > <Location "/iframely"> > ProxyPass http://internallemmyip:8061/ > ProxyPassReverse http://internallemmyip:8061/ > </Location> > > > # # Correctly proxy websocket traffic > RewriteEngine On > RewriteCond %{HTTP:Upgrade} websocket [NC] > RewriteRule /(.*) ws://internallemmyip:80/$1 [P,L] > # > # Proxy Lemmy > <Location "/"> > ProxyPass http://internallemmyip/ > ProxyPassReverse http://internallemmyip/ > </Location> > > ErrorLog /var/log/apache2/mylemmydomain-error.log > </VirtualHost> > </IfModule> > > ~~~

1
0