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

Theme: IPv6 connection #649

Closed
henrikx opened this issue Jan 15, 2017 · 46 comments
Closed

Theme: IPv6 connection #649

henrikx opened this issue Jan 15, 2017 · 46 comments
Labels

Comments

@henrikx
Copy link

henrikx commented Jan 15, 2017

REPOST: I think you misunderstood me in the previous thread. What I meant to say was when I switched to Gray theme and back to Authentic I got the same error. Everything seems to work fine with the default Gray theme.

It seems like when it is hosted on ipv6 some parts of the theme just stops working:

*On the dashboard the status numbers (cpu usage, disk usage and all those) just don't show up (https://puu.sh/tno00/e8fe886053.png)
*The theme settings manager doesn't show. (https://puu.sh/tnono/37a375dc23.png)

This only happens when I'm connected to webmin via IPv6*. This is a fresh install so I'm pretty sure this isn't a configuration error on my end.

*Debian 8
*Firefox 50.1
*Host a server on IPv6 to reproduce and connect with IPv6, without using a domain name.

EDIT: *This only happens when both a domain name is not used and the address is IPv6. (When the URL host is an IPv6 address).

@iliajie
Copy link
Collaborator

iliajie commented Jan 15, 2017

I don't think how it could be the theme issue.

I will try to reproduce it and get back to you a bit later.

@iliajie iliajie changed the title Theme not working correctly when Webmin is hosted on ipv6 Theme: IPv6 connection Jan 15, 2017
@henrikx
Copy link
Author

henrikx commented Jan 16, 2017

I want to add that if the site is accessed via a domain (while still using ipv6), it seems to work correctly, which makes this even weirder. So this only happens if the server is connected directly with an ipv6 address instead of domain.

@iliajie
Copy link
Collaborator

iliajie commented Jan 16, 2017

While I will debug it a bit later I have no idea how and why it would be related to the theme. Are you sure that it doesn't work in old themes? System Information Page in old themes is different but uses the same mechanism. Make sure that percent signs are also present when you switch themes.

@iliajie
Copy link
Collaborator

iliajie commented Jan 18, 2017

What are the errors in the console?

@henrikx
Copy link
Author

henrikx commented Jan 18, 2017

This is the only one:
17:16:26.209 TypeError: g.data(...) is undefined 1 parent.min.js:6:3061 __si__bg_upd_exec/<.success/< https://[2a06:e88x:150x:11x::1337]/unauthenticated/js/parent.min.js:6:3061 .each https://[[2a06:e88x:150x:11x::1337]/unauthenticated/js/bundle.min.js:2:2923 __si__bg_upd_exec/<.success https://[[2a06:e88x:150x:11x::1337]/unauthenticated/js/parent.min.js:6:1768 bv.Callbacks/l https://[[2a06:e88x:150x:11x::1337]/unauthenticated/js/bundle.min.js:2:28806 bv.Callbacks/k.fireWith https://[[2a06:e88x:150x:11x::1337]/unauthenticated/js/bundle.min.js:2:29588 H https://[[2a06:e88x:150x:11x::1337]/unauthenticated/js/bundle.min.js:2:79951 .send/f/< https://[[2a06:e88x:150x:11x::1337]/unauthenticated/js/bundle.min.js:2:82281 (part of ip switched out with "x" for censor)

@iliajie
Copy link
Collaborator

iliajie commented Jan 18, 2017

Did you try Chrome, out of curiosity? Did you try Incognito Mode?

@henrikx
Copy link
Author

henrikx commented Jan 18, 2017

Tried! Same result.

@iliajie
Copy link
Collaborator

iliajie commented Jan 21, 2017

Are you using proxy?

@henrikx
Copy link
Author

henrikx commented Jan 21, 2017

Not on my computer or network. Via IPv6 the connection to the server goes directly to webmin, but for IPv4 it goes via an nginx reverse proxy, which forwards the request to Webmin's IPv6 address. This set up works correctly however. It does not matter if the request comes from IPv6 or not, it only happens when both no domain name was used and the connection was on IPv6. (When the URL host is an IPv6 address.)

@iliajie
Copy link
Collaborator

iliajie commented Jan 21, 2017

I would need your setup to reproduce the problem.

@henrikx
Copy link
Author

henrikx commented Jan 21, 2017

Nope, you can completely ignore the nginx setup because it is only for v4 compatability, which I normally don't use. Otherwise this setup is completely stock. Do you lack IPv6 for testing? Otherwise, what do you lack to be unable to reproduce?

@henrikx
Copy link
Author

henrikx commented Feb 6, 2017

Any news?

@iliajie
Copy link
Collaborator

iliajie commented Feb 6, 2017

I can't reproduce the problem yet.

@henrikx
Copy link
Author

henrikx commented Feb 6, 2017

Yeah, but why? Is there any specific reason?

@iliajie
Copy link
Collaborator

iliajie commented Feb 6, 2017

I was working a lot of time on different parts of the theme. I will come back to your issue a bit later.

@henrikx
Copy link
Author

henrikx commented Feb 6, 2017

Okay, thanks!

@iliajie
Copy link
Collaborator

iliajie commented Mar 4, 2017

I don't see the ports in your error message above, are you running behind proxy?

@henrikx
Copy link
Author

henrikx commented Mar 4, 2017

It doesn't show any ports because Webmin is running on default https port (443).
It's not running behind a proxy, if accessed over ipv6 (which it is in this case).

@henrikx
Copy link
Author

henrikx commented Mar 4, 2017

Just noticed something in the address in the error message https://[[2a06:e88x:150x:11x::1337]
Notice how there are two "[" marks where there should only be one.

@iliajie
Copy link
Collaborator

iliajie commented Mar 4, 2017

What is the output of /etc/webmin/config?

You made miniserv to run on 443 and want a browser to open it as regular https connection with out the port?

@henrikx
Copy link
Author

henrikx commented Mar 4, 2017

I'm not sure if I know what you mean, but here's the output.

user@server:~$ cat /etc/webmin/config
by_view=0
passwd_cindex=2
find_pid_command=ps auwwwx | grep NAME | grep -v grep | awk '{ print $2 }'
passwd_uindex=0
tempdelete_days=7
path=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
passwd_pindex=1
passwd_mindex=4
ld_env=LD_LIBRARY_PATH
passwd_file=/etc/shadow
os_type=debian-linux
os_version=8
real_os_type=Debian Linux
real_os_version=8
lang=en.UTF-8
log=1
referers_none=1
md5pass=1
theme=authentic-theme
product=webmin
webprefix=

Here's also miniserv.conf

user@server:~$ sudo cat /etc/webmin/miniserv.conf
port=443
root=/usr/share/webmin
mimetypes=/usr/share/webmin/mime.types
addtype_cgi=internal/cgi
realm=Webmin Server
logfile=/var/webmin/miniserv.log
errorlog=/var/webmin/miniserv.error
pidfile=/var/webmin/miniserv.pid
logtime=168
ppath=
ssl=1
no_ssl2=1
no_ssl3=1
no_tls1=1
no_tls1_1=1
ssl_honorcipherorder=1
no_sslcompression=1
env_WEBMIN_CONFIG=/etc/webmin
env_WEBMIN_VAR=/var/webmin
atboot=1
logout=/etc/webmin/logout-flag
listen=10000
denyfile=.pl$
log=1
blockhost_failures=5
blockhost_time=60
syslog=1
ipv6=1
session=1
premodules=WebminCore
server=MiniServ/1.831
userfile=/etc/webmin/miniserv.users
keyfile=/etc/webmin/miniserv.pem
passwd_file=/etc/shadow
passwd_uindex=0
passwd_pindex=1
passwd_cindex=2
passwd_mindex=4
passwd_mode=0
preroot=authentic-theme
passdelay=1
cipher_list_def=1
failed_script=/etc/webmin/failed.pl
logout_script=/etc/webmin/logout.pl
login_script=/etc/webmin/login.pl
sudo=1
sockets=
no_resolv_myname=0
bind=2a06:e88x:150x:11x::1337
certfile=/etc/webmin/miniserv.cert
extracas=
ssl_redirect=0
no_tls1_2=

@iliajie
Copy link
Collaborator

iliajie commented Mar 4, 2017

I still have a feeling that it's not the theme related.

At first glance, why do you have port=443 and listen=10000 set at the same time?

What happens if you try to access your page using:

https://[2a06:e88x:150x:11x::1337]:443, does it change anything?

@henrikx
Copy link
Author

henrikx commented Mar 4, 2017

If I type https://[2a06:e88x:150x:11x::1337]:443 the browser removes :443 from the URL, because it is the default port for https and isn't needed. Looking at console again it looks like the extra [ there was just a paste error from me (sorry about that). The listen option is the port which Webmin will listen to broadcasts from Virtualmin, Cloudmin and other Webmin installs I think, due to the option in the GUI being labeled Listen for broadcasts on UDP port.

@iliajie
Copy link
Collaborator

iliajie commented Mar 4, 2017

What if you set the port to 1234 for example and try using:

https://[2a06:e88x:150x:11x::1337]:1234 instead, what do you get?

@henrikx
Copy link
Author

henrikx commented Mar 4, 2017

It just gives me the same error in console (with the extra port number specified). Here's one line:
__si__bg_upd_exec/<.success https://[2a06:e88x:150x:11x::133x]:1234/unauthenticated/js/parent.min.js:6:1768 and the same visual error with no Authentic Theme things showing up.
Here's a full picture: https://puu.sh/uucz0/68f0f2dad5.png

@iliajie
Copy link
Collaborator

iliajie commented Mar 4, 2017

I think I know what could be causing it.

The cause of the issue could be the browser's extensions. Try either incognito mode, or for instance, Chrome to double check. I remember there were issues like this, that were caused by browser's extensions (Add-ons).

@henrikx
Copy link
Author

henrikx commented Mar 4, 2017

It's not.
Here it is in IE: https://puu.sh/uucXY/bfbcec4407.png

@iliajie
Copy link
Collaborator

iliajie commented Mar 4, 2017

Tried Firefox incognito mode, I suppose?

@henrikx
Copy link
Author

henrikx commented Mar 4, 2017

Firefox in incognito mode loads all the addons I have (cuz settings lol), but yeah I've tried it. I've also tried it in Chrome stock. Same result in all browsers.

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

I have logged it as IPv6. Yes, there are problems on XHR requests. I will try to fix it upon 18.40 release.

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

However, I must admit that everything works great over IPv6 when not using proxy and connecting directly.

Your connection is proxied most likely.

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

I have made some testing and sure now that it was noting to do with the theme. Please read: webmin/webmin#505

@iliajie iliajie closed this as completed Mar 5, 2017
@henrikx
Copy link
Author

henrikx commented Mar 5, 2017

Why do you keep ignoring me when I tell you the connection is NOT via a proxy. I have told you this more than once now. Look at the response headers:

Connection: close
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; frame-src 'self'; child-src 'self'
Content-Type: text/html; Charset=UTF-8
Date: Sun, 5 Mar 2017 16:33:57 GMT
Server: MiniServ/1.831
Set-Cookie: redirect=0; path=/
X-Frame-Options: SAMEORIGIN

If you look in the Server header you can see it comes from Webmin and not nginx or any other proxy.

@henrikx
Copy link
Author

henrikx commented Mar 5, 2017

To eliminate any suspicion towards SSL, I tried to disable that, but I got the same result. I honestly cannot see how this could be a problem with my setup. It might very well be a problem with Webmin and not the theme though, but as this only happens when using Authentic Theme I thought the best place to put the issue was here.

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

Oh, man. I didn't expect that. After signing in using IPv6 address only (without domain) I could reproduce all that you're saying for all XHR calls. (like dashboard and theme configuration, and other).

Very surprising.

I'll work on it now as I see the problem..

@iliajie iliajie reopened this Mar 5, 2017
@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

I got the reason why. Fixing it...

@henrikx
Copy link
Author

henrikx commented Mar 5, 2017

That's great! Was it related to the theme only or Webmin as a whole?

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

It was related to the bugged library for parsing URLs..

$_url.attr("path") returns "/sysinfo.cgi" on IPv4 and the IPv6 address itself on IPv6 connections. (hard to believe)

I didn't expect that happeing.. You can run $_url.attr("path") on the console to see what I mean. This is very hard to grasp unless you know what is going on.

Thank you very much for reporting. It's not related to the proxy, you're right!!

@henrikx
Copy link
Author

henrikx commented Mar 5, 2017

Oh yeah that's really weird! Thanks for looking into it and I'm glad I could help. :)

@iliajie iliajie closed this as completed Mar 5, 2017
@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

Please give it a try. It's checked.

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

I'm really glad to get rid of that old library. It should work now.

Please report here if you find any bugs!

@henrikx
Copy link
Author

henrikx commented Mar 5, 2017

Did you upload the webmin theme file or do I have to clone the repo?

@iliajie
Copy link
Collaborator

iliajie commented Mar 5, 2017

Just clone it.

iliajie pushed a commit that referenced this issue Mar 6, 2017
@henrikx
Copy link
Author

henrikx commented Mar 7, 2017

Works great now! Thanks :D

@iliajie
Copy link
Collaborator

iliajie commented Mar 8, 2017

You're welcome.

iliajie pushed a commit that referenced this issue May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants