@boulderly
@lemmyadmin.sitecross-posted from: https://tkohhh.social/post/4829
Unfortunately, the official documentation on theming lemmy is severely lacking. I made some progress on getting it figured out today, so I wanted to share that with you all.
This is by no means meant to be an exhaustive guide, but my hope is that it will at least get you going. I'm sure that I will say things that are incorrect, so please correct me if you know better!
Background
Lemmy uses Bootstrap-compatible theming. As far as I can tell, this means that it uses a pre-defined set of CSS classes. This is important because if you provide a CSS file that doesn't have all of the correct classes defined, it will break the layout of your lemmy.
Your custom CSS needs to be saved in the bind mount for your lemmy-ui container. If you followed the install instructions on join-lemmy.org, the location will be
/lemmy/volumes/lemmy-ui/extra_themes/
.Prerequisites
In order to generate the correct CSS, you need a couple of things:
- your customized Bootstrap variables, saved in an scss file
- the Bootstrap scss files
- the SASS compiler
Let's go through each of these (last to first):
The SASS compiler
The SASS compiler needs to be installed on the machine you will use to generate your CSS files (it doesn't NEED to be the computer that lemmy is installed on, but it can be). Follow the install instructions relevant to you. I used the "Install Anywhere (Standalone)" instructions and installed SASS on the Ubuntu machine that is running my lemmy instance.
The Bootstrap scss files
These files need to be saved on the same machine as the SASS compiler. The Bootstrap download page has a button to download the source files ("Download source"). This will give you a zip folder, so unzip it. Within the unzipped files, the only directory you need to keep is
/bootstrap-5.3.0/scss
. Save that folder in a place that makes sense for you. I put it in my home directory, so the path looks like~/bootstrap-5.3.0/scss
. You'll need to reference this directory when you're creating your custom scss file.Your customized Bootstrap variables, saved in an scss file
This is the fun part... you define your Bootstrap variables. I'm still a little unclear on which version of Bootstrap lemmy is using (and therefore which variables are valid), so I chose to start with one of lemmy's default themes as a starting point. I grabbed
_variables.litely.scss
andlitely.scss
from the lemmy-ui github repo as a starting point.You'll notice that
litely.scss
is just importingvariables.litely
as well as the Bootstrap scss files. You'll need to change the path of the Bootstrap scss files to the path where you saved your copy of the files. However, leavebootstrap
at the end of the file path, as this is actually referring to thebootstrap.scss
file within the Bootstrap scss directory.Generating the CSS file
Once you have all of the prerequisites satisfied, you can generate your CSS files using the SASS compiler. Go to the directory where your customized scss file(s) are saved, and run this command (you added the SASS install directory to your PATH, right??):
sass [inputfile.scss] [outputfile.css]
This will generate a CSS file. However, pay attention, as there might be errors. If so, fix the errors until you can run SASS without any errors.
Finally, drop the generated CSS file into your "extra_themes" directory. You'll now see your theme show up in the list of themes on your profile (it'll be the filename of your CSS file).
And that's it! I hope somebody finds this helpful. Please let me know if there's anything I can clarify!
https://github.com/LemmyNet/lemmy-docs/pull/249/files
A collection of notes that will hopefully be useful to any other admins attempting to scale horizontally
This image shows multiple attempts by now mod to leave. They go through the are you sure prompts and say yes but remain as a mod. Modlog image shows an unassociated user from a different instance is removed instead. That same user is removed when a different local mod tries to leave as mod. An admin from another instance reports they see removal of person_id 92 as well when their local tries to leave as mod.
If I check the request it shows person_id 92. {"community_id":3,"person_id":92,"added":false,"auth":"ey..."}
If I lookup person.id 92 in my db it shows the user referenced in the image, not my local user who was trying to leave as mod.
92 | sunspider | Sun-Spider
Could we add officially supported Arm containers?
Oracle has a pretty generous always free service with Arm; 4 Arm vcpu, 24Gb RAM: https://www.oracle.com/cloud/free/#always-free
AWS has a pretty good free trial to the end of the year: https://aws.amazon.com/ec2/instance-types/t4/
I think it's generally true that Arm is more efficient and better for the environment.
There are 3rd party Arm images available and I'm running instances with these on AWS and Oracle, but they are not updated as frequently as the official images: https://hub.docker.com/r/masquernya/lemmy/tags
I know if I'm asking I should be ready to help, and I am. But this isn't something I know how to do.
Hi every lemmy. I've just stood up a couple new instances and I've been hanging out in the Admin chat over at https://matrix.to/#/#lemmy-support-general:discuss.online. Someone there asked if they could view subscriptions so I wrote and shared the sql query. (could I have done better on the joins with 2 joins to instance?)
And that's when I realized what an invasion of privacy that is. Maybe there's an easier way to do it but could we add optional support for user key pairs, so that if I associated a public key with my account, everything related to me in the db gets hashed with that key? Then I provide my private key at login?
I say optional because I know that's hard for a lot of folks. But maybe there's a way to make it easier with something like letsencrypt at sign up so it would be trivial for everyone to do it.. Or maybe there's a way to do it globally with a central key common to all instances, perhaps paired with instance specific keys?
I understand there's other aspects of user activity that would be best made private to so this could also work, say for votes or whatever else.
https://docs.google.com/spreadsheets/d/1q5wu_ePIPE9CwXoAOZ9t2659JtZIxpg3WYIxl2Waaxg/edit?usp=sharing
Sheet1 Lemmy Instance,Instance Admin Profile,Matrix User,Need Backup Admin,Willing to be a Backup Admin,Availability (UTC) <a href="http://boulder.ly/">boulder.ly</a>,<a href="https://boulder.ly/u/jbernardini">https://boulder.ly/u/jbernardini</a>,@0ll0l0l00ll000l0:matrix.org,Y,Y,1PM - 5AM UTC <a...