boulderly

joined 1 year ago
MODERATOR OF
[–] [email protected] 1 points 1 year ago

Thanks I relocated this to the wiki. Hedgedocs was gone be too difficult to manage multiple contributors. https://wiki.lemmyadmin.site/home/PostgresMain#connect-to-the-database-in-the-docker-container

[–] [email protected] 0 points 1 year ago (1 children)

definitely, and since we've realized we're running the same images, it may not be a bad idea to team up around similar deployments. For instance I might as well standardize on the easy deploy project. I'm using ansible now but modified it to use ubergeek's arm64 images. might as well just use his whole project.

[–] [email protected] 4 points 1 year ago

yep had to do that was initially getting "too many redirects."

[–] [email protected] 5 points 1 year ago (1 children)

I've wondered the same and thought they might be new since my last visit?

[–] [email protected] 14 points 1 year ago (2 children)

I put this site behind cloudflare in response to this post. Other than having to change SSL/TLS encryption mode to Full, it seemed easy. I turned on bot fight mode and I'm using the managed WAF ruleset that comes with the free tier. Any configuration recommendations anywhere in the panel?

[–] [email protected] 3 points 1 year ago (2 children)

you both probably have 'show read posts' (or something similar) disabled under user settings.

[–] [email protected] 1 points 1 year ago (3 children)

I'm replying from the balcony of my cruise ship so I'm unable to give this response the detail it deserves. And, we'd need to decide this as a group. But essentially as my backup, if there's an incident requiring a prompt action and I'm unreachable, you'd have credentials to do the needful.

Maybe we use a shared spreadsheet to track instance statuses including an in/out status for the primary admin. So if there's a new vulnerability, it's unpatched on the instance and the primary is out, the backup or the backup to the backup handles it.

 

cross-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 and litely.scss from the lemmy-ui github repo as a starting point.

You'll notice that litely.scss is just importing variables.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, leave bootstrap at the end of the file path, as this is actually referring to the bootstrap.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!

[–] [email protected] 2 points 1 year ago

Thanks for writing this up. Saving it for when I need it!

2
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

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.

multiple, and different Mod leaves on a single instance result in user Sun Spider from a different instance being removed.

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

[–] [email protected] 2 points 1 year ago

btw - you can paste that link into search and it will return you a home instance link to click. So that's a decent work around for now. But I'm all for home instance link rewrites.

[–] [email protected] 4 points 1 year ago

you know you can easily scale up and down instance sizes on aws, or move your instance to, say oracle. I've done both of these. The Ansible installer makes it very easy to move. you just down your containers and copy over the volumes directory for the move.

With these options you can start small and free. It may take a while to grow to 100 users. A 2 vcpu 2GB ram t4g.small on aws seems more than adequate and there's a free trial through the end of the year. It's arm64 though so small changes to the ansible lemmy.yml. The free tier t2.micro at 1 cpu 1 GB ram seemed too small.

Oracle has an always free arm64 image with 4 cpu and 24 GB ram plus a generous boot disk and 200GB block storage so you might as well start there. It will probably last quite a while. Maybe all the way through 100 users. The only thing is while I know it's very easy to change your instance type on AWS, I haven't looked into it on Oracle. But again moving your instance is very easy.

[–] [email protected] 2 points 1 year ago

I agree and would support a feature request for lemmy-ui if not already in place for this one.

[–] [email protected] 3 points 1 year ago* (last edited 1 year ago) (1 children)

you probably need to update config.hjson inside inventory/host_vars/<instance_name> ??

locally, in the lemmy-ansible/inventory... directory.

 

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?)

sql query to all user subscriptions

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.

 

Register your interest here if you'd like to join a team of smaller instance admins backing each other up. So if it's the middle of the night or we're on vacation, someone we trust from the federation of small instance administrators can secure our sites if we're unavailable.

3
Lemmy Admin Wiki (wiki.lemmyadmin.site)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

free to read and edit: wiki.lemmyadmin.site Please add your tips!

view more: next ›