dan-online / autopulse

💫 automated scanning tool that bridges media organizers such as Sonarr and Radarr with media servers such as Plex and Jellyfin
https://autopulse.dancodes.online
MIT License
127 stars 5 forks source link

feat: disable auth #92

Closed Cheezzhead closed 5 days ago

Cheezzhead commented 1 week ago

Description

First of all, thanks for this great app! I was initially planning on staying with Autoscan (at least until it wouldn't work anymore), but after testing out this project, it's the elegant UI that instantly convinced me to stay with this.

The only question I have is whether it's possible to disable authentication, for these reasons:

I'm willing to help out if necessary, just let me know!

Additional Information

No response

dan-online commented 1 week ago

Heya @Cheezzhead, that's no problem at all. I'm glad you like the app/UI! I'll open a quick pull request to add an "enabled" property to Auth, defaulted to true, so that you can disable it if need be.

dan-online commented 1 week ago

I think a separate PR too would be to add some env to ui with perhaps:

DEFAULT_SERVER_URL=<blah>
FORCE_SERVER_URL=false/true
DEFAULT_AUTH=user:pass
FORCE_AUTH=false/true

so for no auth:

FORCE_SERVER_URL=true
FORCE_AUTH=true
Cheezzhead commented 1 week ago

Looks awesome!

How would the DEFAULT_AUTH variable differ from the AUTOPULSE__AUTH__USERNAME and AUTOPULSE__AUTH__PASSWORD? Or would it just be a shorthand?

Edit: Tested it out with enabled: false, works like a charm. Thanks!

dan-online commented 1 week ago

Heya @Cheezzhead the extra envs would be for the UI, so that if you have a disabled auth, you wouldn't need to see the login page

vember31 commented 1 week ago

Heya @Cheezzhead the extra envs would be for the UI, so that if you have a disabled auth, you wouldn't need to see the login page

I think this would be fantastic! I love the idea of being able to set an env variable to disable auth on the UI, as well as set an env variable for the default server as well. I'm just using Autopulse locally with no traffic going outside of my LAN so not too worried about auth. Plus will only be using one server instance of Autopulse so being able to set a default server for the UI makes a lot of sense.

Thank you for all the work on this @dan-online 😊

dan-online commented 6 days ago

Hey @vember31 feel free to try out danonline/autopulse:ui-pr-101 with the env as specified in #101!

dan-online commented 5 days ago

All done @vember31 / @Cheezzhead. Let me know if you have any issues :)

vember31 commented 5 days ago

Thanks @dan-online !

I didn't get a chance to try it until just a moment ago (when it was merged into the main branch) but I might be doing it wrong? the UI kept giving me errors that it didn't seem to like the URL I provided & wouldn't start.

Is this the proper way to get it setup?

Is that what you'd expect for a no-auth setup?

I've since gone back to using auth & it works fine but I can reproduce the issue again if needed to help with any debugging :)

dan-online commented 5 days ago

Hey @vember31 just fixed the doc in https://github.com/dan-online/autopulse/commit/2def8869de7537026dc4ec0c957d0a04c8b785eb, essentially you just need:

FORCE_AUTH=true
FORCE_SERVER_URL=https://localhost:2875

# Optional
FORCE_USERNAME=admin
FORCE_PASSWORD=password
Cheezzhead commented 5 days ago

Works for me!

  autopulse-ui:
    image: danonline/autopulse:ui
    container_name: autopulse-ui
    # ...
    environment:
      ORIGIN: https://pulse.${DOMAIN}
      FORCE_SERVER_URL: http://autopulse:2875
      FORCE_AUTH: true

I first set the variables on the backend container instead of the ui because I hadn't had my coffee yet, just mentioning it in case anybody else makes the same mistake haha

vember31 commented 3 days ago

Thank you both! With these two env vars set + doing config with auth.enabled: false

FORCE_AUTH=true FORCE_SERVER_URL=https://localhost:2875

I was able to get it working as expected :)