Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove media server completely from an instance? #147

Closed
therealmaxmoon opened this issue Aug 9, 2023 · 9 comments
Closed

How to remove media server completely from an instance? #147

therealmaxmoon opened this issue Aug 9, 2023 · 9 comments
Labels
duplicate This issue or pull request already exists

Comments

@therealmaxmoon
Copy link

therealmaxmoon commented Aug 9, 2023

Because of copyright laws in my country, I could get in trouble, if someone uploads protected/illegal media on my server and I would like to remove it completely and only ask the users to use external image hosters (e.g. https://pic.infini.fr/ or https://img.tedomum.net/ )

Especially if there is evidence created (archive.org) that I hosted illegal media at the same time someone uploads it, is really critical.

Thanks a lot for your help :)

P.S.: Will previews from external websites still work?

@codyro
Copy link
Collaborator

codyro commented Aug 9, 2023

You can shut down/disable the pictrs container, which provides the image hosting for local instances. This will cause any media being uploaded to error out. I do not believe there is an option to turn it off entirely. It would be a good feature request (please double-check me first!).

You can turn off the container by doing the following:

docker stop $(docker ps | grep pictrs | awk '{print $NF}')

You may also want to consider removing/commenting out this portion of the docker-compose.yml file to prevent it from accidentally spinning up again in the future: https://github.com/LemmyNet/lemmy-ansible/blob/main/templates/docker-compose.yml#L51-L75

@therealmaxmoon
Copy link
Author

@codyro Thanks a lot for the really fast and useful response.

It works and if I figure out how to remove the "add image" button or to teach it to behave like the link button (insert markdown code into edit field), I guess it would be acceptable, because if people are seeing errors, even if they are produced by me, they might report it.

Would this be the same workaround for a completely new installation or is it possible to not install the media server at all? Like removing all blocks containing pictrs in lemmy.yml (ansible) and in the config.hjson?

It would be a good feature request (please double-check me first!).

I really would like to create a feature request, because I think there are many people having the same worries like me about hosting protected/illegal media.

What shall I do to create a correct feature request?

@codyro
Copy link
Collaborator

codyro commented Aug 9, 2023

@codyro Thanks a lot for the really fast and useful response.

My pleasure!

Would this be the same workaround for a completely new installation or is it possible to not install the media server at all? Like removing all blocks containing pictrs in lemmy.yml (ansible) and in the config.hjson?

You should be good by commenting out those lines in the templates/docker-compose.yml referenced above. While you could rip out all references of pictrs, I don't think the juice is worth the squeeze.

I really would like to create a feature request, because I think there are many people having the same worries like me about hosting protected/illegal media.

What shall I do to create a correct feature request?

While I am not the maintainer, I believe the best place would be in the primary project here: https://github.com/LemmyNet/lemmy/issues

@therealmaxmoon
Copy link
Author

therealmaxmoon commented Aug 9, 2023

I ran into trouble while installing a fresh instance having commented out all pictrs references.

A banner for the instance and images for the communities couldn't be set.

I guess a current workaround is to let pictrs be installed, but stop the server like you wrote above after setting up everything:

docker stop $(docker ps | grep pictrs | awk '{print $NF}')

and if the admins want to add an image to a community, they must to start pictrs again for a minute:

docker start $(docker ps | grep pictrs | awk '{print $NF}')

Do you know on how to deactivate the "add image" button? Since I am using docker, I feel like everything is behind closed doors and I can't edit it by myself.

@therealmaxmoon
Copy link
Author

While I am not the maintainer,

Hey @codyro I know you're not the maintainer, but I really want to ask you for a favor, because you might know the answer and it might not be a problem for a pro.

I figured out that if the media server is down, thumbnails of new posts (of users) will not be created, too, which is a bummer and that's why I have to keep the media server running.

For hours I am trying to figure out how to edit the tool bar to remove the "upload image" icon and functionality (see screenshot) and I even got into the docker container to look for anything that could be the tool bar with commands like this:

docker exec -it lemmyutopifyorg_lemmy-ui_1 find . -iname "*" | xargs grep "image" 2> /dev/null

I couldn't find anything, but translation files... :/

Can you tell me how to remove the "upload image" icon/functionality by hand, please, even if it is ugly and may be redone after an update?

I only have to restrict users to upload media directly and will start the instance asap. This is the only task on the todo list before upgrading to Debian 12 and going officially online with the Lemmy instance and it's driving me nuts.

Thank you for your help, I really appreciate it.

upload_image

@codyro
Copy link
Collaborator

codyro commented Aug 11, 2023

Unfortunately, I don't know off hand. If you look for the i18n translation key for the string upload image in the lemmy-ui project, there are only two hits, which may be an good place to start.

https://github.com/search?q=repo%3ALemmyNet%2Flemmy-ui%20upload_image&type=code

@therealmaxmoon
Copy link
Author

https://github.com/search?q=repo%3ALemmyNet%2Flemmy-ui%20upload_image&type=code

Thanks a lot for helping me! One of the files looks promising, but I really don't know how to find them in docker or if they even exist there or if a docker container only contains build resources and how to rebuild it, if I will find this file? :(

I asked the same question on Lemmy.ml, but it looks like no one knows how to do this exactly.

@dessalines
Copy link
Member

See also LemmyNet/lemmy#1118

@codyro
Copy link
Collaborator

codyro commented Sep 11, 2023

I am going to close this issue in favor of LemmyNet/lemmy#1118.

@codyro codyro closed this as completed Sep 11, 2023
@codyro codyro added the duplicate This issue or pull request already exists label Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants