Skip to content

[Bug]: Wrong configuration triggers setup-page and allows user/password overrideΒ #840

@ralf31337

Description

@ralf31337

πŸ” Bug Summary

When a hostname of paperless cannot be resolved it redirects the user to the setup-page allowing admin password override even if it already exists.

πŸ“– Description

isConfigured() fails on network/config errors (lines 250-328 in services/setupService.js):

  • If the Paperless URL cannot be resolved, validateConfig() throws an error
  • After retries, isConfigured() returns false
    Middleware redirects to setup (lines 177-178 in routes/setup.js):
    if (!isConfigured && (!process.env.PAPERLESS_AI_INITIAL_SETUP || process.env.PAPERLESS_AI_INITIAL_SETUP === 'no') && !req.path.startsWith('/setup')) { return res.redirect('/setup'); }

When isConfigured() is false, it redirects to /setup even if users already exist

πŸ”„ Steps to Reproduce

  1. Configure system
  2. Change paperless hostname
  3. Access Paperless-AI
  4. You get redirected to /setup

βœ… Expected Behavior

Access to /setup must always be with authentication, except if no user is configured.

❌ Actual Behavior

/setup is accessible without authentication

🏷️ Paperless-AI Version

3.0.9

πŸ“œ Docker Logs

n/a

πŸ“œ Paperless-ngx Logs

n/a

πŸ–ΌοΈ Screenshots of your settings page

No response

πŸ–₯️ Desktop Environment

Other

πŸ’» OS Version

not relevant

🌐 Browser

Firefox

πŸ”’ Browser Version

No response

🌐 Mobile Browser

No response

πŸ“ Additional Information

  • I have checked existing issues and this is not a duplicate
  • I have tried debugging this issue on my own
  • I can provide a fix and submit a PR
  • I am sure that this problem is affecting everyone, not only me
  • I have provided all required information above

πŸ“Œ Extra Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions