Lemmy: Avatar upload broken with local docker development

Created on 3 Feb 2020  路  10Comments  路  Source: LemmyNet/lemmy

With local docker development, uploading an avatar makes a post request to http://localhost:8536/pictshare/api/upload.php, but the docker default pictshare port is http://localhost:8537. Not sure if I setup my environment incorrectly or how to fix.

pictshare
pictshare2

All 10 comments

This is correct, pictshare doesn't work without nginx. This is in the instructions on the readme.

Here's a sample config: https://github.com/dessalines/lemmy/blob/master/ansible/templates/nginx.conf

As an example of what I do locally I have this in the start of my lemmy.conf:

server {
        listen       8535;
        server_name  localhost;
...

So then I access it at http://localhost:8535

How do you have your ssl_certificate and ssl_certificate_key set up in your lemmy.conf?

Edit/Solved: Created self signed certificate and pointed to it in the conf.

Added a disclaimer to the readme.

Fyi this would be fixed with #371.

@Charleshthomasiii you don't need any ssl certs for development.

ok this is all nice and dandy, but what if people dont use nginx as a reverseproxy, i mean there are a plenthora of different reverse proxies out there.
HAproxy, caddy, traffik to name some of them. Is there a way to disable avatar upload in general ?

I think to use a different reverse proxy you would have to edit several yml files (lemmy/ansible/lemmy.yml, lemmy/ansible/templates/docker-compose.yml,lemmy/ansible/uninstall.yml, lemmy/docker/dev/docker-compose.yml, lemmy/docker/prod/docker-compose.yml).

As for disabling avatar uploading, a quick and dirty way could be to disable it on the front end in lemmy/ui/src/components/user.tsx, although that's not a good solution.

If you are deploying manually without ansible, the only thing you need to do is write the config for your reverse proxy, based on the nginx config file. And the docker-compose.yml if you use that.

There is no setting for disabling avatars site-wide, and I don't plan to make one. Its a user preference setting already.

I completely understand that you don't want to take it away on a side wide basis.

Was this page helpful?
0 / 5 - 0 ratings