-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
Added web root feature #81
Conversation
Hi Marcin, thank you very much for the PR! I'll review the changes and test it locally today. |
Unfortunately these changes are breaking user script execution. Script itself is executed but application cannot get access to given process id. Error: There is no such problem when reverse proxy is disabled. Probably the issue here is with not properly set url for retrieving script output, but I cannot locate it. |
|
Hi @MarcinGmurczyk, I've checked your changes and from general perspective they look good. However, I think, that specifying web_root config is redundant in a script-server (using relative paths everything should work out of the box). I've tried to improve nginx conf, so it's responsible for URL substitution itself. Please see updated conf:
With these config changes and Script-server impovements in 1da9d86 commit, everything worked fine for me (login, redirect, execution, reading user input, etc.) I'm not nginx expert, so may be my configuration has some other issues. What do you think about this configuration? If it is fine and suits you, I'll put them in a wiki as an example for reverse proxy. |
Hi @bugy With your nginx conf reverse proxy is working great. One last thing that for sure need to be done here is set proper proxied url's for dynamic image sources. Please run script-server and hover mouse over cookie, the error here: Same error with search/clear images. Do you think you could fix these errors? |
Hi, thanks for reporting the problem with images. I've fixed it. PS in your codebase JS paths in index.html file are different from mine. Is it intended? |
Good catch, I've fixed JS paths in index.html. I believe reverse proxy is now available. It's entirely up to you :) |
Thanks for checking my fixes. Short information with nginx config is in a wiki. Since there are no remaining changes in PR, I'll just close it. |
Hi
I want to propose some changes in script so that reverse proxy functionality is possible for user. Link example is for nginx but feature is also avalaible in Apache.
Reverse proxy gives user ability to access web application through defined address. If user want access through WAN there is no need to open any ports on working machine so reverse proxy increases security.
Simple nginx conf for reverse proxy can looks like this
To enable reverse proxy user has to add variable "web_root" in conf.json, like that
{
"web_root" : "/script-server"
}
With reverse proxy set as in this example user can access web application in few ways (of course launcher.py must be running, through systemd, supervisor etc.):
localhost/script-server on local machine
192.168.0.XX/script-server on LAN machine
domain.com/script-server on WAN machine
I'm using reverse proxy on my machine with multiple applications, mainly because I do not need to open so many ports on router and also it is easier to remember some string instead of port number.
I want to stress out that I do not know Tornado, I did my best to make things works as intended. As fair as I know these changes does not broke any functionalities. All test are passing. It might be wise to get code review from someone who actually knows how reverse proxy should be implemented with Tornado.