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

[1.4.0rc4] Autologin via IP address & disabled access control is broken due to return to forcelogin view #3434

Closed
foosel opened this issue Jan 29, 2020 · 8 comments
Assignees
Milestone

Comments

@foosel
Copy link
Owner

@foosel foosel commented Jan 29, 2020

Looks like the auto logon feature is broken again.
image
Same wih IP:
image

nas@service-uplink:~$ cat .octoprint/config.yaml
accessControl:
    autologinAs: admin
    autologinLocal: true
    localNetworks:
    - 127.0.0.1/24
    - 192.168.1.0/24
    salt: TaRRqLPIYxxxxxxxxxxxxxxxxxxxxxx

Originally posted by @schnello in #3432 (comment)

@LMS0815

This comment has been minimized.

Copy link

@LMS0815 LMS0815 commented Jan 29, 2020

Can confirm issue appearing although user-management is disabled.
OctoPrint keeps asking for log in - same computer different browser (same IP address).

pi@OctoPrint:~/.octoprint $ cat ~/.octoprint/config.yaml
accessControl:
    enabled: false

foosel added a commit that referenced this issue Jan 29, 2020
We need to actually try to identify the user just like we used to do
with the forcelogin plugin. Just checking permissions will only work
if we already have a session.

Closes #3434
@foosel

This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Jan 29, 2020

Autologin and disabled access control situation should be fixed by the above commit, ready for 1.4.0rc5

@foosel foosel changed the title [1.4.0rc4] Autlogin via IP address is broken due to return to forcelogin view [1.4.0rc4] Autlogin via IP address & disabled access control is broken due to return to forcelogin view Jan 29, 2020
@schnello

This comment has been minimized.

Copy link

@schnello schnello commented Jan 29, 2020

@foosel
Thx for the quick fix.
I merge the fix at my local rep manually...
the good news:
Autologin works again and no password is required in my local network.

the bad new:
I needs a lot of time. A look into the log files shows some errors regarding "octoprint.util.net"
2020-01-29 15:45:20,268 - octoprint.server.util.flask - ERROR - Could not autologin user admin from None for networks IPSet(['127.0.0.0/24', '192.168.1.0/24', '::ffff:127.0.0.0/120', '::ffff:192.168.1.0/120']) Traceback (most recent call last): File "/home/nas/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/server/util/flask.py", line 594, in determine_user if netaddr.IPAddress(remote_address) in local_networks: File "/home/nas/OctoPrint/venv/local/lib/python2.7/site-packages/netaddr/ip/__init__.py", line 306, in __init__ 'address from %r' % addr) AddrFormatError: failed to detect a valid IP address from None 2020-01-29 15:45:20,272 - octoprint.util.net - ERROR - Error while trying to determine whether None is a local address Traceback (most recent call last): File "/home/nas/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/util/net.py", line 49, in is_lan_address address = unmap_v4_as_v6(address) File "/home/nas/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint/util/net.py", line 112, in unmap_v4_as_v6 if address.lower().startswith("::ffff:") and "." in address: AttributeError: 'NoneType' object has no attribute 'lower'

Note: This access was via an SSH Tunnel. I think that shouldn't make a difference. But will test it again at home.

@foosel

This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Jan 29, 2020

I take it you only merged the one commit referenced here? If so, also merge 010221a

@schnello

This comment has been minimized.

Copy link

@schnello schnello commented Jan 29, 2020

Oh my fail. Yes with 010221a all is fine

@CRCinAU

This comment has been minimized.

Copy link

@CRCinAU CRCinAU commented Jan 30, 2020

Can confirm login works again with user access control disabled after applying the following patches:

https://github.com/foosel/OctoPrint/commit/a88d95af77b721cac52f15092bd225773687dd79.patch
https://github.com/foosel/OctoPrint/commit/010221ab5b3b8e2e994897a9811e7bba4333c958.patch

Just had to modify the file path in the files to match the installed version.

@foosel foosel changed the title [1.4.0rc4] Autlogin via IP address & disabled access control is broken due to return to forcelogin view [1.4.0rc4] Autologin via IP address & disabled access control is broken due to return to forcelogin view Jan 30, 2020
@GitIssueBot

This comment has been minimized.

Copy link
Collaborator

@GitIssueBot GitIssueBot commented Feb 10, 2020

This issue has been mentioned on OctoPrint Community Forum. There might be relevant details there:

https://community.octoprint.org/t/login-screen-after-last-update-1-4-0rc4/16017/2

@foosel

This comment has been minimized.

Copy link
Owner Author

@foosel foosel commented Feb 11, 2020

1.4.0rc5 is released.

@foosel foosel closed this Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.