Because of copyright laws in my country, I want to get rid of the option to upload images on my instance.

I thought it would be the fastest way to just remove the “upload image” icon from the tool bar. But it’s harder than I thought, because I can’t find it…

I’ve installed Lemmy with ansible and it runs with docker containers.

How can I get rid of this icon or even better, the function to upload an image?

I already tried to stop the pictr container, but this avoids uploading icons/banner for communites and thumbnails for new posts will not be generated, which is a no go.

I only want to get rid of the upload option while creating a new post.

Thanks a lot for your help :)

  • @WontonSoup@lemmy.world
    link
    fedilink
    English
    69 months ago

    Use the inspect button in your browser and you can pinpoint it in the html which will help you pinpoint it in the actual component.

    Be aware though this isn’t shutting off functionality. Just hiding the functionality. People could still upload directly though api calls

    • maxmoonOP
      link
      English
      19 months ago

      That’s what I did, but to be honest I can’t find any HTML files in the docker container or in /srv/lemmy.

      Where exactly can I find the html file?

      I tried following command:

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

      The problem is, that I could only find translation files, but no html files.

      • @WontonSoup@lemmy.world
        link
        fedilink
        English
        29 months ago

        I have no idea how the app is built I hate to say, Ive never looked at it. Was just giving some general advice. If I get some time I’ll dig a bit sounds fun

        • maxmoonOP
          link
          English
          19 months ago

          It would be really cool to know someone who actually knows what he’s doing :) On github someone gave me a good hint were to find this button, but how I actually can find it in a docker container is a riddle for me?

  • @melonpunk@lemmy.world
    link
    fedilink
    English
    2
    edit-2
    9 months ago

    This will hide the button from display so it cannot be clicked on.

    document.querySelector("[data-tippy-content='upload image']").style.display = "none";

    • maxmoonOP
      link
      19 months ago

      What exactly should I do with this command? Where should I put it in?

      • @melonpunk@lemmy.world
        link
        fedilink
        English
        19 months ago

        To test it you can just put it into the browser console (F12), but adding it to an instance will require it to be added to a javascript file that’s loaded and run on page open.

        It’s not the most ideal way of removing the feature, but it depends on what you’re needing your instance to do. If it’s just a personal instance, then I guess you could just run this line via a browser extension such as Greasemonkey, which would remove it in your client browser (not on the instance itself).

        • maxmoonOP
          link
          19 months ago

          No, it will be a public instance. If it would be a private instance, I would trust myself to not upload illegal content :D

          But there exactly do you put this file in?

          I have the docker container running and can access it, but I don’t know which file should be edited to do this?

          • @WhoRoger@lemmy.world
            link
            fedilink
            English
            49 months ago

            You know, people will still be able to use apps like Jerboa, or alternative frontends, and not even know you disabled the button on one frontend.

            You either need to disable the functionality altogether, or honestly not run a public instance if you can’t offer pretty essential things like image upload.

            • maxmoonOP
              link
              19 months ago

              I know that it will still work with another frontend, but at least people on my site will not use it anymore and if people don’t even know how to remove the cosmetics of an instance, do you really think it’s a good idea to ask how to remove the functionality?

              But if you know it, can you please tell me how to disable image uploads on an instance?