-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Not working on server ipaddress #1467
Comments
@geordin So for a little background, this is due to the content security policy that is a best practice to prevent Cross Site Scripting (XSS) attacks. Here is some information about it The content security policy defines what scripts can be loaded safely from what domains. Since you're running behind nginx with a separate domain from where you're loading the scripts, I think the browser triggering this warning. You need to edit So if you're loading the script ENV.contentSecurityPolicy = {
'connect-src': "'self'",
'default-src': "'self'",
'frame-src': "'self'",
'img-src': "'self' filesystem: data: blob:",
'script-src': "'self' '*.mydomain.com' 'unsafe-inline' 'unsafe-eval'",
'style-src': "'self' 'unsafe-inline'"
}; Let me know any other questions or how you've got this setup. |
I have tried the same, but still not working. That error message gone now. But when we enter the logins, the page will hang for 3,4 sec and then prompting the logins again. Please help us to solve the issue. |
@geordin Is there any output in the console/network tab of your browser? We probably need a little more information about how you're running it and some additional error details. If you're not super familiar with it, if you're part of the slack group here: https://hospitalrun-slackin.herokuapp.com/ |
I am starting the app using the command "ember serve -H 0.0.0.0" as root. The following messages showing at the console output. =========================== Build successful (39312ms) – Serving on http://0.0.0.0:4200/ Slowest Nodes (totalTime => 5% ) | Total (avg)
|
That's the app output, what about anything in the browser console (F12 to view in most browsers) ? You might want to look at the nginx config files in the hospitalrun-server repository and make your config similar to that, as here we also use a nginx reverse proxy to serve the frontend: Note that the frontend is on port 3000 in that config. For yours, if it's just the frontend, it would be 4200. Also note that this config is for https. |
Hereby providing the the console out put from browser.The source list for Content Security Policy directive 'script-src' contains an invalid source: ''192.168.10.173''. It will be ignored. (anonymous) @ ember-cli-live-reload.js:7 exports.Connector.Connector.connect @ livereload.js:76
|
I believe you are getting an error because you're trying to access via an ip address, but you're not using https. on the server itself, you can access via "localhost:4200" without needing https, but accessing via any ip address, from either the server itself (such as http://0.0.0.0:4200) or another computer will give the error you got: "error registering service worker:SecurityError: Only secure origins are allowed" unless you access over https. also the content security policy error is still there. It is for livereload script as I expected, but I'd focus on the above issue first. for the content security policy error, it looks like the way you entered the IP address in the config is not being accepted, maybe it wants the :7020 at the end. |
Currently am using nginx reverse proxy with self signed SSL certificate. Messages displayed on browser console is given below. =============================
|
You could also try using https://github.com/HospitalRun/hospitalrun-server which is intended for server deployments. |
Yes, I have tried hospitalrun-server now. But the npm start command stuck on the below message. Loading raml proxy - this may take a while... Please help. |
If you're using hospitalrun-server, you don't have to run npm at all (and you don't have to run frontend separately either, frontend is part of the server package). The instructions for hospitalrun-server are here: https://github.com/HospitalRun/hospitalrun-server/blob/master/DEPLOYMENT_GUIDE.md Also you might want to join the Slack at https://hospitalrun-slackin.herokuapp.com/ and join the #troubleshooting channel. |
Can we run hospitalrun-server without docker? |
https://github.com/HospitalRun/hospitalrun-server/blob/master/README.md There's an "Alternative Installation" listed here but I have no experience with it, and it seems like it'd be pretty much the same as what you were doing before. |
I have tried docker installation but one of the container not starting. 0d1821ff6354 hospitalrun "/bin/sh -c ./entr..." About an hour ago Exited (0) 13 seconds agoWhile checking the logs, errid: 'non_200',
|
I see that error when I start up docker, but everything still works for me, so it may not be the cause of your problem. you should be able to see a log message right when the hospitalrun container exits that says something like "container exiting" and I would try to see what happens immediately before that message. |
The messages logged before exiting the container is given below.Aug 13 17:55:25 ubuntu kernel: [24688.629499] br-b7ae83a7b89d: port 1(vethf4a3bf0) entered disabled state
|
sorry but I haven't seen those errors before. |
Anybody tried hospitalrun-frontend without docker?? |
I have installed hospitalrun-frontend without docker and is working fine in localhost. How can I make it public. Anybody please help. |
@geordin - Let's pause for a moment to figure out what you're trying to accomplish, because I think this conversation got a little off-track. Are you:
Assuming it's number 1, there are two ways really of running the application:
|
I am trying to use Hospital Run as an application. Please let me know the steps to follow for both.
|
@geordin: you can download the app from here: https://github.com/HospitalRun/hospitalrun-frontend/releases/ If you click the download link for the version of operating system you're running (IE Windows 32 or 64 bit) The server setup steps are outlined here: https://github.com/HospitalRun/hospitalrun-server/blob/master/DEPLOYMENT_GUIDE.md These are more complicated, but I'd be happy to help. You can also chime in on slack: https://hospitalrun-slackin.herokuapp.com/ |
I have tried the same, but still one docker container not getting up. Can you please let me know the exact environment that required for this app. Like OS type, version. etc. |
I need to run hospitalrun application in a a server and need to access the same publicly. Please share the the code and install steps since I am facing the above issues currently. |
@geordin we discovered the same problems as you (with raml etc.). We are trying to stabilize the docker environment in HospitalRun/hospitalrun-server#119. Please, hold on:) |
Please notify once its sorted. |
Hello, Is this resolved? |
Added new fixes to hospitalrun-server today. You should be good to update your code and try again. If there are further issues, please make a new issue in the hospitalrun-server repo, as this one is closed. |
hospitalrun-frontend is configured with nginx as reverse proxy. But the login is not working. While checking the backed we are getting the below given error.
========================
Content Security Policy violation:
referrer": "",
"violated-directive": "script-src",
"effective-directive": "script-src",
"original-policy": "connect-src 'self' ws://localhost:7020 ws://0.0.0.0:7020 ws://undefined:7020 http://localhost:4200; default-src 'self'; frame-src 'self'; img-src 'self' filesystem: data: blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' localhost:7020 0.0.0.0:7020 undefined:7020; style-src 'self' 'unsafe-inline'; font-src 'self'; media-src 'self'; report-uri http://localhost:4200/csp-report;",
"disposition": "report"
Please help.
The text was updated successfully, but these errors were encountered: