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

Image links broken when proxied through apache - Authentic theme v 12 #165

Closed
KDocProf opened this issue May 11, 2015 · 28 comments
Closed

Comments

@KDocProf
Copy link

Hi,

I run Webmin behind an apapche proxy so that I can access like this:

https://myrealdomain.com/webmin

As soon as I upgraded to version 12 of authentic-theme, All of the image links were broken

As an example. On the Webmin configuration page, all of the image source links are coming up as:

src="/images/modules/webmin/.... 

instead of:

src="/webmin/images/modules/webmin/.... 

This same problem applies everywhere I've looked so far. As another example, on the System Information page, the pie charts are missing.

@iliajie
Copy link
Collaborator

iliajie commented May 11, 2015

Hmm. I see. Can you please open DevTools in Chrome/Firefox (F12) and debug on right page <body> tag. What is the data-webprefix value there?

@KDocProf
Copy link
Author

Hi and Thanks for responding!
Here's the body tag from inside the iframe on the right (with the information page highlighted in the debugger):

<body data-webprefix="/webmin" data-current-product="webmin">

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

I have hard time reproducing it. Can you provide more info/screenshots with DevTools pannel open so I could understand? Do you run Webmin using minserv or apache?

@KDocProf
Copy link
Author

HI Again,

I am running Webmin using miniserv and then accessing through an Apache Reverse Proxy.

Here is the relevant piece of the Apache config (and yes, the obligatory config statements are in place in the ssl.conf file to enable proxying https):

ProxyRequests Off

<Location "/webmin/">
    ProxyPass https://127.0.0.1:10000/
    ProxyPassReverse https://127.0.0.1:10000/
</Location>


<Proxy *>
    allow from all
</Proxy>

I also have these two lines in /etc/webmin/config:

webminprefixnoredir=1
webprefix=/webmin

Here are two screenshots that show what is happening since I upgraded to Authentic-theme v 12:

webmin_sysinfo

webmin_configuration

I hope this helps!

Thank You

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

That is enough information to have tondebug it for me, I guess.

OK, I will take a closer look when I get to my PC but so far can you change webprefix= to null value and restart Webmin?

Are you doing it to have no port settings in URL? Doing so makes your Webmin dependent on Apache web-server which is not very good, I think?

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

...ahh, ok. I think my recommendation wouldn't help. I think I know what is happening.. Will contact you later.

@brandom
Copy link

brandom commented May 12, 2015

Shouldn't image links be relative?

/images/modules/webmin/advanced.gif
images/modules/webmin/advanced.gif 

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

No, I redirect all links to my theme to manage images.

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

I will make end extension to try to load images from module's dir for backward compatibility.

@brandom
Copy link

brandom commented May 12, 2015

Yeah, you're right. I forgot I could just test it in Chrome dev tools. Relative does not work either with my similar setup using a nginx proxy and serving under a subdirectory.

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

I know why it's not working. Please join authentic theme room, I will be there in about 3 hours.

[email protected]

You can register free jabber XMPP account at jabbers.im.

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

Please be kind testing it with updated js:

https://rostovtsev.ru/pub/src/authentic/12.00-patches/issue165/default.min.js

It's practically from new release (will be ready in few days) but it should fix your issue.

If problem persists, clear browser's cache and restart Webmin. Even more click refresh button in System Information Page.

Then, if still there is a problem, try adding trailing slash, so make a webprefix=/webmin/ and then see.

When it works, try also testing now only charts at the screen but autocomplete (in search bar) features and all possible other things, while at the same time looking at the console for possible errors.

I did all of the work theoretically without a chance to test it in real situation (it's harmless but might not work).

Waiting for your soon reply.

Thanks!

@brandom
Copy link

brandom commented May 12, 2015

The js above does fix the broken charts, however reloading sysinfo and packages still does not work. I was able to fix it but I don't want to submit a PR for that because the change was made in the minified source.

If you would like to add the unminified source js and css files to the repo I can submit a PR to add a build process using gulp to produce a single js and css file to speed up the load time.

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

Does autocomple work? Does Virtualmin links work? Back button works in Webmin?

I think I know why it doesn't work.. I will not be able to add unminified version because it's almost the same as minified for the only difference that it has funky comments that only I can read :) I think I will add just formatted minified version later, so people could just submit some code.

However if you don't mind posting some changes that you've done and those that work, just post few lines here - I will get it.

Thanks! ;)

@brandom
Copy link

brandom commented May 12, 2015

I don't use Virtualmin to test it, but back button and autocomplete is working.

Minified code is really hard to hack on and the diffs aren't very useful. Funky comments are fine! A build process would make it a lot easier for others to get involved, but if you aren't looking for PRs on the core code that's fine too.

As for my changes to default.min.js I followed your lead and tracked down the rest of the instances of

('iframe[name="page"]').attr("src",window.parent.$__source_host_complete+$webprefix+

and replaced it with

('iframe[name="page"]').attr("src",$webprefix_full+`

and it fixed the remaining issues I mentioned above.

@iliajie
Copy link
Collaborator

iliajie commented May 12, 2015

Yes, that's the thing, I guess! I will test it in the morning. For me, there is no difference really when reading beautified minified version and not properly commented src. Probably, one day, when I have time, I will make src ready for others but just not right now!

Thank you!!

@brandom
Copy link

brandom commented May 12, 2015

Awesome! I look forward to it. Great theme, keep up the good work. I look forward to v13.

@iliajie
Copy link
Collaborator

iliajie commented May 13, 2015

Guys, it was a nightmare to make things work together, meaning Server Indexes module and Proxy stuff.

Now everything should be working!??!? Could you please be kind checking??
https://rostovtsev.ru/pub/src/authentic/12.00-patches/issue165/2/default.min.js

Please click all over, refresh sysinfo couple of times, use autocomplete and etc.

Thanks for your help!!

Waiting for your test results!

@brandom
Copy link

brandom commented May 13, 2015

Everything looks good on Webmin. I have a subdomain proxy installation at home and a subdir installation at work. Both have been tested with this latest js.

@iliajie
Copy link
Collaborator

iliajie commented May 13, 2015

Awesome! So good to hear, it worked!! 👍 Thanks, pal! Keep in touch in Authentic Room.If you have interesting feature requests, you could discuss it there!

@brandom
Copy link

brandom commented May 13, 2015

How do I access it? http://jabbers.im/ just gives me "Hellow World."

@iliajie
Copy link
Collaborator

iliajie commented May 13, 2015

Which OS you using as desktop?

@brandom
Copy link

brandom commented May 13, 2015

OS X Yosemite

@iliajie
Copy link
Collaborator

iliajie commented May 13, 2015

I see. iOS has inbuilt messenger. Start it, add XMPP (Jabber) account, enter an id, like [email protected], choose yourself a password and tick a box to create new account on server. - You're done. 20 seconds deal! Then, join a room on [email protected]. Same could be done on the phone. If you use Android, the best is Conversations https://play.google.com/store/apps/details?id=eu.siacs.conversations&hl=en

@brandom
Copy link

brandom commented May 13, 2015

There is no option to create a new account in iMessages. I went to https://register.jabber.org/ which has "temporarily disabled" account registration since June 2013 and wants me to go to https://xmpp.net/ which is only a server directory. Why not use something more straight forward like IRC?

@iliajie
Copy link
Collaborator

iliajie commented May 13, 2015

It's more secure to use XMPP, probably just hitting go, should create new account, unless those iMessenger developers are completely ..., well you know. Pidgin - is a great one.

@KDocProf
Copy link
Author

If you are using Mac OS X, than install "Adium" and create the account from within Adium. That worked for me.

@iliajie
Copy link
Collaborator

iliajie commented May 14, 2015

It will be fully fixed in version 13. Thanks for reporting!

@iliajie iliajie closed this as completed May 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants