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

except localhost, nothing else is working #8

Closed
changemenemo opened this issue Nov 11, 2016 · 15 comments
Closed

except localhost, nothing else is working #8

changemenemo opened this issue Nov 11, 2016 · 15 comments
Assignees

Comments

@changemenemo
Copy link

changemenemo commented Nov 11, 2016

hi,

except localhost, it's not working because your apacheserver is always resend result in localhost.
So I know that you certainly only want the usecase of a docker engine installed on the localmachine where you are working out but there are a lot more usecase;
For example, you can imagine someone working on a tablet or a phone to rapidly make changes to an html file and he want to test it. So because of your one usecase, he will have to connect to the online website to validate the modification he just did.
Other usercase, every windows computer doesn't allow to use docker because of the CPU which has not vt-x etc. ... And sometimes you don't have internet but just your intranet so it could be great if you could change it to make it work on 0.0.0.0 and not only localhost? if it is possible. If I had the time right now I would gladly do it myself but I will have to wat a few more weeks if I have to do it myself and it would be great if I could use it right now....

@magnetikonline
Copy link
Owner

Thanks for the issue post @boistordu - but I'm not quite sure I understand the problem here?

Since you're in a Docker container runtime listening on 0.0.0.0 won't help - as you still need to --publish the port back to the host with docker run.

Can you maybe provide a screenshot of what the issue is to help explain?

@changemenemo
Copy link
Author

well if I try the tool, when I entered something it will return to me a localhost address so not the adress of the server.... SO of course i would have a 404 error
nothing about ports here....

@magnetikonline
Copy link
Owner

Yeah I'm still not understanding. I just re-built the image from Dockerfile to check.

  • Run the image via ./run.sh
  • Visit http://127.0.0.1:8080/ on host.
  • Enter a URL - either local to your network or public internet. Local URL's will need to be resolvable via the container, so either a local DNS server in your network, or you might need to pass your /etc/hosts entries into the container at run time.
  • Page is validated.

I guess we might have a communication breakdown here?

@changemenemo
Copy link
Author

if you want to understand better I can pm you the adres and you can test by yourself

@changemenemo
Copy link
Author

changemenemo commented Nov 13, 2016

there are no interface on the host. the run command was
`'docker run --restart=always --network=accessed --name valid -p 45116:80 -p 45117:8080 -d magnetikonline/html5validator``
and so obviously it's no different as your run.

@magnetikonline
Copy link
Owner

So after that run line - if you visit http://127.0.01:45116/ what do you get?

@backflip
Copy link

backflip commented Nov 29, 2016

@magnetikonline, do you have an idea how I'd deploy this with now.sh? I can start it by simply running now, however, the form will redirect to localhost:8888 when submitting a URL with an HTML5 doctype: https://dockerhtml5validator-azybyqnlkf.now.sh. Same issue with now -p 8080:80 -p 8888:8888.

@changemenemo
Copy link
Author

@magnetikonline sorry for the delay of answer.
127.0.0.1 did you understand that it was on a local VPS my installation right? The goal is to not having it on localhost no 127.0.0.1 then.... so if I upload a file from remote host it will put the following adress: http://localhost:8888/html5/#file

for bug debugging purposes, I've installed docker on one of the workstation and as @backflip have said, your html code is redirecting to localhost:8888 which is unusable for docker of course! You have to use environment variable or something else to retain the port redirection and your code html have to point it with this variable.

@magnetikonline
Copy link
Owner

magnetikonline commented Dec 4, 2016

@boistordu right, so finally I understand what you're saying now.

(For others reading):

  • When submitting HTML to the validator, if the source is HTML5 the validator replays the validation against the HTML5 VNU validator.
  • Currently the setup here is hardcoded to that endpoint being localhost:8888/html5, which is fine locally, but if you were to install this publicly or listening on an alternative domain a redirection/replay to localhost:8888 isn't going to help you.

As you say, will probably need to solve this with an environment variable to inject an alternative hostname/port as the environment itself can't possibly work this hostname out itself, also:

  • Will probably need to avoid calling supervisord direct from Dockerfile - instead call a bash script that adjusts /etc/w3c/validator.conf with a given environment variable which is your desired public hostname. This could be baked into run.sh as an argument as well.
  • The adjustment would be to here before running Apache/HTML5 validator parts via supervisord https://github.com/w3c/markup-validator/blob/master/htdocs/config/validator.conf#L128.

I think I have given you the steps you need to solve this - so go at it! I might tackle this in the future if time allows, but for me personally - it's low use.

Thanks.

@magnetikonline
Copy link
Owner

@backflip seems your issue is very much related. Yeah I don't have a fix for now - short of hacking this:

https://github.com/magnetikonline/dockerhtml5validator/blob/master/resource/configure.sh#L82-L85

But that's not very flexible - so injecting a hostname/port via run.sh into the container which is then used to modify validator.conf before running services, would serve this better.

@magnetikonline
Copy link
Owner

I'll close this for now, as mentioned if I feel inspired I'll try to write an enhancement.

@magnetikonline magnetikonline self-assigned this Dec 4, 2016
@backflip
Copy link

backflip commented Dec 4, 2016

Hey @magnetikonline, I decided on exposing 8888 instead of 80 since I need the HTML5 validator only. Works like a charm.

@magnetikonline
Copy link
Owner

@backflip nice one.... yep, that would do the trick 💃

@changemenemo
Copy link
Author

May I ask you why you download the old validator too in place of just the new one? Since it is standalone with a webui

@changemenemo
Copy link
Author

Okey so the vnu is working as expected in standalone. This is your combination with something which is not maintained anymore which cause the problem: w3c/markup-validator#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants