There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

otl OP , to linux in lemmyverse: find communities from the command line
@otl@lemmy.sdf.org avatar

Oh that’s interesting - nice spotting.

The admin of lemmyworld said it’ll take time to remove them, but I don’t know why (there seems to be the functionality in the API)

Indeed. Looks like it’s just a matter of a big for loop over each community ID, POST /community/delete with body community_id=1234. Maybe I’ll try to see if it’s possible to get some action on removing them by sending over some Python script or something that does the job. Quick count shows almost 14%(!) of all communities indexed by lemmyverse are those junk communities:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">% lemmyverse . | wc -l
</span><span style="color:#323232;">  30376
</span><span style="color:#323232;">% lemmyverse enoweiooe | wc -l
</span><span style="color:#323232;">   4206
</span>
coys25 , to nostupidquestions in How does Lemmy decide what goes in the hot feed?

And this picture helps too: shows the decay in ranking scores for posts of different popularity (score) over time.

https://join-lemmy.org/docs/contributors/rank_algorithm.png

After a day or so, the curve flattens out. This probably explains why we keep seeing posts that are months old in “hot” - if not enough new material is being posted, after the first few pages of “hot”, posts that are 5 days old and 5 months old are essentially the same due to the exponential decay function that was chosen.

That page gives this equation:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">Rank = ScaleFactor * log(Max(1, 3 + Score)) / (Time + 2)^Gravity
</span><span style="color:#323232;">
</span><span style="color:#323232;">Score = Upvotes - Downvotes
</span><span style="color:#323232;">Time = time since submission (in hours)
</span><span style="color:#323232;">Gravity = Decay gravity, 1.8 is default
</span>

My guess is that the “gravity” parameter is the issue at the moment. Something is needed to make the decay less steep, so that really old posts aren’t making it up to the top of the feed.

There might be some way of tuning the gravity parameter dynamically based on how much content is being submitted, perhaps aiming for something like “the average age of the first 200 posts should be 10 days” (I made those numbers up, but the basic idea would be that the time decay should be steeper when lots of content is submitted and less steep when content is infrequent?)

coys25 , (edited ) to nostupidquestions in How does Lemmy decide what goes in the hot feed?

Can someone who knows PL/pgSQL help parse this line:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">return floor(10000*log(greatest(1,score+3)) / power(((EXTRACT(EPOCH FROM (timezone('utc',now()) - published))/3600) + 2), 1.8))::integer;
</span>

It seems to me that the issue might be that the function returns an integer. If the scaling factor is inadequately large, then floor() would return zero for tons of posts (any post where the equation inside floor() evaluates to less than one). All of those posts would have equivalent ranks. This could explain why we start seeing randomly sorted old posts after a certain score threshold. Maybe better not to round here or dramatically increase the scaling factor?

I’m not sure what the units of the post age would be in here, though. Probably hours based on the division by 3600? And is log() the natural log or base 10 by default?

In any case, something still must be going wrong. If I’m doing the math correctly, a post with a score of +25 should take approximately 203 hours (assuming log base 10) before it reaches a raw rank score of < 1 and gets floored to zero, joining all of the really old posts. So we should be seeing all posts from the last 8.5 days that had +25 scores before we see any of these really old posts… But that isn’t what’s happening.

A10 OP , to selfhosted in Anyone hosting pixelfed using docker?
@A10@kerala.party avatar

thanks for your reply. This is how it is defined in the docker compose file I used. AFAIK When using the internal network, the ports are exposed to an internal subnet and no port mapping is necessary.

<pre style="background-color:#ffffff;">
<span style="color:#323232;">  internal:
</span><span style="color:#323232;">    internal: true
</span><span style="color:#323232;">  external:
</span><span style="color:#323232;">    driver: bridge
</span>
Moc OP , (edited ) to nostupidquestions in Does anyone know how to solve incorrect_login when logging into Lemmy?

Interestingly, whenever I click the Verify Email URL in my email, it goes to a page that only has a header: “Verify Email”.

The URL endpoint responsible for validating the email also responds with a 404:

https://lemmy.world/api/v3/user/verify_email

Response body:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">{"error":"token_not_found"}
</span>

Issue persists across devices and browsers (Safari, Firefox, Chromium)

ptz , to selfhosted in Proxy to TCP port with real IP
@ptz@dubvee.org avatar

Is there any solution (program/Docker image) that will take a port, forward it to another host (or maybe another program listening on the host) that then modifies the traffic to contain the real source IP. The whole idea is that in the server logs I want to see people’s real IP addresses, not the server in the cloud private VPN IP.

Not that I’m aware of. Most methods require some kind of out-of-band way to send the client’s real IP to the server. e.g. X-Forwarded-For headers, Proxy Protocol, etc.

If your backend app supports proxy protocol, you may be able to use HAProxy in front on the VPS and use proxy protocol from there to the backend. Nginx may also support this for streams (I don’t recall if it does or not since I mainly use HAProxy for that).

Barring that, there is one more way, but it’s less clean.

You can use iptables on the VPS to do a prerouting DNAT port forward. The only catch to this is that the VPN endpoint that hosts the service must have its default gateway set to the VPN IP of the VPS, and you have to have a MASQUERADE rule so traffic from the VPN can route out of the VPS. I run two services in this configuration, and it works well.

<pre style="background-color:#ffffff;">
<span style="color:#323232;">iptables -t nat -A PREROUTING -d {VPS_PUBLIC_IP}/32 -p tcp -m tcp --dport {PORT} -j DNAT --to-destination {VPN_CLIENT_ADDRESS}
</span><span style="color:#323232;">iptables -t nat -A POSTROUTING -s {VPN_SUBNET}/24 -o eth0 -j MASQUERADE
</span>

Where eth0 is the internet-facing interface of your VPS.

Edit: One more catch to the port forward method. This forward happens before the traffic hits your firewall chain on the VPS, so you’d need to implement any firewalls on the backend server.

nickshanks OP , to selfhosted in Proxy to TCP port with real IP

Thank you so much for the quick and detailed reply, appreciate it!

Done all of the iptables stuff, just trying to change the default gateway on the server at home now:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">network:
</span><span style="color:#323232;">  version: 2
</span><span style="color:#323232;">  renderer: networkd
</span><span style="color:#323232;">  ethernets:
</span><span style="color:#323232;">    eth0:
</span><span style="color:#323232;">      dhcp4: true
</span><span style="color:#323232;">      routes:
</span><span style="color:#323232;">        - to: 0.0.0.0/0
</span><span style="color:#323232;">          via: <vps public ip>
</span>

Does the above netplan yaml look right? When it’s applied, I can’t access the internet or even the VPS public IP.

ptz , to selfhosted in Proxy to TCP port with real IP
@ptz@dubvee.org avatar

Forgot to ask: Is your server a VPN client to the VPS or a VPN server with the VPS as a client? In my config, the VPS is the VPN server.

Not sure about the netplan config (all my stuff is debian and uses oldschool /etc/network/interfaces), but you’d need logic like this:

Server is VPN client of the VPS:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">  routes:
</span><span style="color:#323232;">    # Ensure your VPS is reachable via your default gateway
</span><span style="color:#323232;">    - to: <vps public ip>
</span><span style="color:#323232;">      via:  <your local gateway>
</span><span style="color:#323232;">    # Route all other traffic via the VPS's VPN IP
</span><span style="color:#323232;">    - to: 0.0.0.0/0
</span><span style="color:#323232;">      via:  <vps vpn ip>
</span>

You may also need to explicitly add a route to your local subnet via your eth0 IP/dev. If the VPS is a client to the server at home, then I’m not sure if this would work or not.

Sorry this is so vague. I have this setup for 2 services, and they’re both inside Docker with their own networks and routing tables; I don’t have to make any accommodations on the host.

ptz , to selfhosted in Proxy to TCP port with real IP
@ptz@dubvee.org avatar

I’ve no experience with Zerotier, but I use a combo of WG and Openvpn. I use OpenVPN inside the Docker containers since it’s easier to containerize than WG.

Inside the Docker container, I have the following logic:

  1. supervisord starts openvpn along with the other services in the container (yeah, yeah, it’s not “the docker way” and I don’t care)
  2. OpenVPN is configured with an “up” and “down” script
  3. When OpenVPN completes the tunnel setup, it runs the up script which does the following:
<pre style="background-color:#ffffff;">
<span style="color:#323232;"># Get the current default route / Docker gateway IP
</span><span style="color:#323232;">export DOCKER_GW=$(ip route | grep default | cut -d' ' -f 3)
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Delete the default route so the VPN can replace it.
</span><span style="color:#323232;">ip route del default via $DOCKER_GW;
</span><span style="color:#323232;">
</span><span style="color:#323232;"># Add a static route through the Docker gateway only for the VPN server IP address
</span><span style="color:#323232;">ip route add $VPN_SERVER_IP via $DOCKER_GW; true
</span><span style="color:#323232;">ip route add $LAN_SUBNET via $DOCKER_GW; true
</span><span style="color:#323232;">
</span>

LAN_SUBNET is my local network (e.g. 192.168.0.1/24) and VPN_SERVER_IP is the public IP of the VPS (1.2.3.4/32). I pass those in as environment variables via docker-compose.

The VPN server pushes the default routes to the client (0.0.0.0/1 via <VPS VPN IP> and 128.0.0.0/1 via <VPS VPN IP>

Again, sorry this is all generic, but since you’re using different mechanisms, you’ll need to adapt the basic logic.

ptz , to selfhosted in Proxy to TCP port with real IP
@ptz@dubvee.org avatar

You may be able to do it through the client, yes, but I have it pushed from the server:

<pre style="background-color:#ffffff;">
nickshanks OP , to selfhosted in Proxy to TCP port with real IP

Okay, can we go back to those iptables commands?

<pre style="background-color:#ffffff;">
<span style="color:#323232;">iptables -t nat -A PREROUTING -d {VPS_PUBLIC_IP}/32 -p tcp -m tcp --dport {PORT} -j DNAT --to-destination {VPN_CLIENT_ADDRESS}
</span><span style="color:#323232;">iptables -t nat -A POSTROUTING -s {VPN_SUBNET}/24 -o eth0 -j MASQUERADE
</span>

Just to confirm, is the -o eth0 in the second command essentially the interface where all the traffic is coming in? I’ve setup a quick Wireguard VPN with Docker, setup the client so that it routes ALL traffic through the VPN. Doing something like curl ifconfig.me now shows the public IP of the VPS… this is good. But it seems like the iptables command aren’t working for me.

thank you Linux for giving a damn about Bluetooth headphones (feddit.de)

For context, LDAC is one of the few wireless audio codecs stamped Hi-Res by the Japan Audio Society and its encoder is open source since Android 8, so you can see just how long Windows is sleeping on this. I’m excited about the incoming next gen called LC3plus, my next pair is definitely gonna have that.

Holzkohlen , to linux in thank you Linux for giving a damn about Bluetooth headphones

Are you thinking of the standby timeout? Cause I get static on my speakers on any and all distros when no audio is playing. It always happens after 5 seconds of silence. Kinda infuriating that I have to do this on EVERY SINGLE DAMN INSTALL.

For Pulseaudio:
Quickfix (until reboot):

<pre style="background-color:#ffffff;">
<span style="color:#323232;">sudo su
</span><span style="color:#323232;">echo 0 > /sys/module/snd_hda_intel/parameters/power_save
</span>

permanent fix is to add the line:
options snd-hda-intel power_save=0
to the file /etc/modprobe.d/alsa-base.conf

For pipewire:
create folder /etc/wireplumber/main.lua.d/ if it does not exist
if you had to create it yourself just copy over the file from /usr/share/wireplumber/main.lua.d/50-alsa-config.lua
otherwise it probably is there already then just edit it
pretty much at the bottom there is a line that says “session.suspend-timout-seconds”
uncomment it and set its value to 0
then reboot

anders , to programmerhumor en-us

When your code works, but you don't know how
@programmerhumor

TheHalc ,

Just make sure to add comments like

<pre style="background-color:#ffffff;">
<span style="color:#323232;">//Magic, do not touch
</span>

To make sure no-one accidentally breaks the spell.

Dirk ,
@Dirk@lemmy.ml avatar
<pre style="background-color:#ffffff;">
<span style="color:#323232;">// Do not delete! Yes, it's not used anywhere in the code, but if it is removed
</span><span style="color:#323232;">// the application crashes and the error code is useless for debugging.
</span><span style="color:#323232;">let f = 'a';
</span>
QuaternionsRock , to programmerhumor in Alphabetically sorted months. But WHY?

Or shitty SQL.

<pre style="background-color:#ffffff;">
<span style="color:#323232;">SELECT MAX(day_of_month), month
</span><span style="color:#323232;">FROM why_does_this_table_exist
</span><span style="color:#323232;">GROUP BY month
</span>
little_cow OP , to world in China mandates that AI must follow “core values of socialism”

China considers it self to be so as the Modern CPC follows Xi Jinping thought which is defined by wikipedia as:

en.wikipedia.org/wiki/Xi_Jinping_Thought

“Xi Jinping Thought consists of a 14-point basic policy as follows:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">Ensuring Communist Party of China leadership over all forms of work in China.
</span><span style="color:#323232;">The Communist Party of China should take a people-centric approach for the public interest.
</span><span style="color:#323232;">The continuation of "comprehensive deepening of reforms".
</span><span style="color:#323232;">Adopting new science-based ideas for "innovative, coordinated, green, open and shared development".
</span><span style="color:#323232;">Following "socialism with Chinese characteristics" with "people as the masters of the country".
</span><span style="color:#323232;">Governing China with the Rule of Law.
</span><span style="color:#323232;">"Practise socialist core values", including Marxism–Leninism and socialism with Chinese characteristics.
</span><span style="color:#323232;">"Improving people's livelihood and well-being is the primary goal of development".
</span><span style="color:#323232;">Coexist well with nature with "energy conservation and environmental protection" policies and "contribute to global ecological safety".
</span><span style="color:#323232;">Strengthen the national security of China.
</span><span style="color:#323232;">The Communist Party of China should have "absolute leadership over" China's People's Liberation Army.
</span><span style="color:#323232;">Promoting the one country, two systems system for Hong Kong and Macau with a future of "complete national reunification" and to follow the One-China principle and 1992 Consensus for Taiwan.
</span><span style="color:#323232;">Establish a common destiny between the Chinese people and other peoples around the world with a "peaceful international environment".
</span><span style="color:#323232;">Improve party discipline in the Communist Party of China
</span>

In economic matters, Xi Jinping thought highlights the historical importance of state-owned enterprises.”

Gork , to gaming in What's the most toxic game community you know of?

The only appropriate response to that is

<pre style="background-color:#ffffff;">
<span style="color:#323232;">git: 'gud' is not a git command. See 'git --help'.
</span>

Distro hoppers, how do you manage your config files?

I am currently trying to keep track of my config files in a repo to be able to get the configa back together easily if/when I change distro, but I am not sure if that’s the best way or if I should be using some tool to help me since I some programs keep preferences in other directories other then $HOME (at least I think so)....

madcow , to linux in Distro hoppers, how do you manage your config files?

I really like the simplicity of this workflow by StreakyCobra on HN (explained as a blog post here):

I use:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">git init --bare $HOME/.myconf
</span><span style="color:#323232;">alias config='/usr/bin/git --git-dir=$HOME/.myconf/ --work-tree=$HOME'
</span><span style="color:#323232;">config config status.showUntrackedFiles no
</span>

where my ~/.myconf directory is a git bare repository. Then any file within the home folder can be versioned with normal commands like:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">config status
</span><span style="color:#323232;">config add .vimrc
</span><span style="color:#323232;">config commit -m "Add vimrc"
</span><span style="color:#323232;">config add .config/redshift.conf
</span><span style="color:#323232;">config commit -m "Add redshift config"
</span><span style="color:#323232;">config push
</span><span style="color:#323232;">And so one…
</span>

No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation.

jjjalljs , to programmerhumor in Programming Languages

It has a lot of gotchas and an unstable ecosystem.

A lot of basic stuff is confusing of weird. How do you loop over an object? There’s like five ways. How do you declare a function? There are two very different ways that behave differently, and the new one has like five variations in its syntax that can throw you.

Here’s an example of something that continues to bother me:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">const foo = "hello";
</span><span style="color:#323232;">const bar = { foo: "world"}
</span>

What do you think bar looks like? If you thought it had a key of “hello” and a value of “world”, that’s sensible but wrong. It has a key of “foo”. Object keys don’t need to be quoted in JavaScript. If you want the key to be a variable you have to write it like { [foo] : “world” }. Which looks like a list.

There’s a lot of this kind of stuff in the language. Small things that once you know you can work around, but are still weird, annoying, and prone to causing errors.

The standard library historically hasn’t been very good. This has lead to many libraries being maintained by the community. But the community is fickle, and the quality of libraries is not guaranteed.

The standard library was bad at some basic operations, so underscore was created. But then someone made lodash, and most people (but not everyone!) moved to it. But then the standard library caught up some more, so maybe you don’t need either? When you start working on a new-to-you project you don’t know what you’re going to get.

Dates were a mess so momentjs got big, but now that’s deprecated. Move to datefns, which has a completely different interface.

Node releases a new major version every six months. Every six months! Python has been on major version 3 for years and has no plans for a version 4, for comparison. The constant version releases is a potential source for headaches.

In my experience many libraries are kind of fast and loose with major releases, too. It can be a pain to keep up, especially if you have peer deps.

The debugger is kind of bad. Sometimes it will pause but you typically can’t like treat it like a repl. Python’s, for comparison, blows it out of the water.

Many things are async in JavaScript. Sometimes you don’t expect a particular call to be async or you forget, and you have a bad time. The async/await keywords were a godsend. The giant stack of “then…then…then…” was not fun. Combine with the weak debugger and you have an extra bad time. I bet there are a lot of console.log(“code is here”) debug calls out in the wild because of this.

For your actual front end view layer, react is the current hotness. But older projects are still out there with angular, backbone, probably some with just jQuery. React isn’t terrible but how long is it going to be king? What breaking changes are they going to put out in the next version? The ecosystem is unstable.

Also redux kind of sucks. Not a fan of global variables. I think the community has moved on from redux though? Again, the ecosystem is unstable.

In my experience there are many developers who only know JavaScript, and they want to use it for everything. It is the dungeons and dragons of languages. Much like how it is frustrating when your friends want to run a cyberpunk murder mystery in Dungeons and Dragons, it can be frustrating when your team wants to write everything, even your backend, in JavaScript.

We had browser tests at one job. They’re a very synchronous thing. Open the browser, load the page, enter name and password, wait for login. We had all of this written in python working fine, but people wanted to switch to a JavaScript toolset. Sorry, I mean they wanted to switch to JavaScript but there were three different browser testing tools the different teams wanted to use. Because the javascript ecosystem is like that. After a more candid talk with one of the guys I knew personally, he admitted it wasn’t because JavaScript was the best tool but rather he didn’t want to use python.

I can’t authoritatively say this is typical, but in my experience I’ve had a lot of resistance from JavaScript devs using other languages. Again, I think it’s like DND. DND is a unnecessarily complicated game full of exceptions and gotchas. If that’s what you learn first, you probably think everything is like that, and why would you want to go through that again? But of the popular languages/games, javascript/DND are exceptional for their weirdness.

In fact, thinking about it for more than a minute, my current team lead is a JavaScript main and he’s great. Super willing to learn other languages and has never been pushy. So it’s definitely not everyone.

The stack traces tend to be kind of bad. In production shit is probably minified so you might get “error on line 1, column 4737373”. In other contexts you may get a few hundred lines of node_modules to sift through before finding your actual code.

At least jest and (react) testing library aren’t bad. Mocha + chai were annoying. Enzyme is not great. Again, things change rapidly. You might join a company and find they’re still using mocha and enzyme, and switching never gets prioritized. If JavaScript made things better without breaking changes or swapping to an entirely new toolset it wouldn’t be a serious problem, but the standard mode seems to be “fuck it let’s make an entirely new tool”.

The lack of type hints isn’t great. You can use typescript but that’s a whole new set of stuff you have to set up. Python also doesn’t have types but they managed to add them as an option without making us switch to like TypeThon. But that’s not the JavaScript way. If you’re not making a breaking change are you really doing JavaScript?

I could go on, but my cat is getting up to some bullshit and I need to see what he’s screaming about. Probably not JavaScript.

tldr:

  • standard library kind of bad
  • ecosystem unstable and of variable quality
  • unpleasant personal experiences with JavaScript developers wanting to use it for everything
masterspace , to programmerhumor in Programming Languages

better syntax

<pre style="background-color:#ffffff;">
<span style="color:#323232;">Lol I was listening and intently considering what you had to say until this 
</span><span style="color:#323232;">  point.
</span>
DrDeadCrash , to technology in Every time you click on this link, it will send you to a random Web 1.0 website
<pre style="background-color:#ffffff;">
<span style="color:#323232;"># Created by WebMap 1.0
</span><span style="color:#323232;"># Wednesday, August 30, 1995 at 2:16 AM
</span><span style="color:#323232;"># Format: NCSA
</span><span style="color:#323232;">#
</span><span style="color:#323232;">
</span><span style="color:#323232;">rect /INDEX/index.html 0,0 75,18
</span><span style="color:#323232;">rect /SEARCH/index.html 75,0 135,18
</span><span style="color:#323232;">rect /index.html 135,0 260,18
</span><span style="color:#323232;">rect /US/OJ/index.html 260,0 470,18
</span>

Wow

urda , to programmerhumor in When you have to update the server
@urda@lebowski.social avatar

Real talk I’ve been using this I’ve mashed together:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">update_brew() {
</span><span style="color:#323232;">    bold=$(tput bold);
</span><span style="color:#323232;">    normal=$(tput sgr0);
</span><span style="color:#323232;">    brew --version &&
</span><span style="color:#323232;">    echo "${bold} > brew update${normal}" &&
</span><span style="color:#323232;">    brew update &&
</span><span style="color:#323232;">    echo "${bold} > brew upgrade${normal}" &&
</span><span style="color:#323232;">    brew upgrade &&
</span><span style="color:#323232;">    echo "${bold} > brew autoremove${normal}" &&
</span><span style="color:#323232;">    brew autoremove &&
</span><span style="color:#323232;">    echo "${bold} > brew cleanup${normal}" &&
</span><span style="color:#323232;">    brew cleanup &&
</span><span style="color:#323232;">    echo "${bold} > brew doctor${normal}" &&
</span><span style="color:#323232;">    brew doctor;
</span><span style="color:#323232;">}
</span>
silenium_dev , to programmerhumor in Personally I prefer `throw new nullpointerexception`

Fun fact: there’s a shorter way to throw a NullPointerException:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">throw null;
</span>

Because throw throws a NPE if the parameter is null

theRealBassist , to selfhosted in Hosting Lemmy with Traefik as a reverse proxy

Figured I’d ask to see if you know if this method is still working? I have mine setup very nearly identically to what you have here, and I have corrected my lemmy.hjson to have the correct hostname and password for the database. The only changes I have made thus far is to remove the HTTP redirection, and to change things like me cert resolver, the Lemmy version, and other small corrections.

However, all I am getting is a gateway timeout when I try to visit the url I have setup. Do you have any idea why this might be? I’ll provide my docker-compose below.

<pre style="background-color:#ffffff;">
<span style="color:#323232;">version: "3.7"
</span><span style="color:#323232;">
</span><span style="color:#323232;">services:
</span><span style="color:#323232;">  web:
</span><span style="color:#323232;">    image: dessalines/lemmy:latest
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    logging:
</span><span style="color:#323232;">      driver: journald
</span><span style="color:#323232;">      options:
</span><span style="color:#323232;">        tag: "{{.Name}}[{{.ID}}]"
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /mnt/lemmy/lemmy.hjson:/config/config.hjson
</span><span style="color:#323232;">    depends_on:
</span><span style="color:#323232;">      - db
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmy
</span><span style="color:#323232;">      - traefik_default
</span><span style="color:#323232;">    labels:
</span><span style="color:#323232;">      - traefik.enable=true
</span><span style="color:#323232;">      - traefik.http.routers.https_lemmy.rule=Host(`lem.domain.tld`) && (PathPrefix(`/api`, `/pictrs`, `/feeds`, `/nodeinfo`, `/.well-known`) || Method(`POST`) || HeadersRegexp(`Accept`, `^[Aa]pplication/.*`))
</span><span style="color:#323232;">      - traefik.http.routers.https_lemmy.entrypoints=https
</span><span style="color:#323232;">      - traefik.http.routers.https_lemmy.tls.certresolver=myresolver
</span><span style="color:#323232;">  web-frontend:
</span><span style="color:#323232;">    image: dessalines/lemmy-ui:latest
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - LEMMY_UI_LEMMY_INTERNAL_HOST=web:8536
</span><span style="color:#323232;">      - LEMMY_UI_LEMMY_EXTERNAL_HOST=localhost:1236
</span><span style="color:#323232;">      - LEMMY_HTTPS=true
</span><span style="color:#323232;">    depends_on:
</span><span style="color:#323232;">      - web
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    logging:
</span><span style="color:#323232;">      driver: journald
</span><span style="color:#323232;">      options:
</span><span style="color:#323232;">        tag: "{{.Name}}[{{.ID}}]"
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmy
</span><span style="color:#323232;">      - traefik_default
</span><span style="color:#323232;">    labels:
</span><span style="color:#323232;">      - traefik.enable=true
</span><span style="color:#323232;">      - traefik.http.routers.https_lemmy_static.rule=Host(`lem.domain.tld`)
</span><span style="color:#323232;">      - traefik.http.routers.https_lemmy_static.entrypoints=https
</span><span style="color:#323232;">      - traefik.http.routers.https_lemmy_static.tls.certresolver=myresolver
</span><span style="color:#323232;">  db:
</span><span style="color:#323232;">    image: postgres:15-alpine
</span><span style="color:#323232;">    hostname: db
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - POSTGRES_USER=lemmy
</span><span style="color:#323232;">      - POSTGRES_PASSWORD=LONGstringOFcharacters
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /mnt/lemmy/db:/var/lib/postgresql/data
</span><span style="color:#323232;">      - ./customPostgresql.conf:/etc/postgresql.conf
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    logging:
</span><span style="color:#323232;">      driver: journald
</span><span style="color:#323232;">      options:
</span><span style="color:#323232;">        tag: "{{.Name}}[{{.ID}}]"
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - lemmy
</span><span style="color:#323232;">
</span><span style="color:#323232;">networks:
</span><span style="color:#323232;">  traefik_default:
</span><span style="color:#323232;">    external: true
</span><span style="color:#323232;">  lemmy:
</span><span style="color:#323232;">    driver: bridge
</span><span style="color:#323232;">volumes:
</span><span style="color:#323232;">  db:
</span><span style="color:#323232;">
</span>
tom OP , to selfhosted in Hosting Lemmy with Traefik as a reverse proxy

In one of the updates, I noticed in the traefik dashboard that traefik was forwarding to a different port. So I added the following label in my web labels:

<pre style="background-color:#ffffff;">
<span style="color:#323232;">      - traefik.http.services.web-lemmy.loadbalancer.server.port=8536
</span>

You might need to change the web-lemmy part to whatever the traefik service is named in your config.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines