Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Chart access when hosted on remote server? #345

Closed
shanehull opened this issue Jun 30, 2017 · 3 comments
Closed

Chart access when hosted on remote server? #345

shanehull opened this issue Jun 30, 2017 · 3 comments
Labels

Comments

@shanehull
Copy link

Hi,

Should I be able to access the html chart if Zenbot is hosted on a DigitalOcean server?

I'm getting nothing using the url it outputs after a sim.

I've searched around but can only find issues related to 3.x.

@shanehull
Copy link
Author

Worked it out! It's just outputted to the folder - no web server!

Ps. it would be sweet to get some documentation on setting up nginx with ssl to the simulations directory for anyone running remotely. I'm in the process of getting my head around it. Can share once I do.

@nedievas
Copy link
Contributor

nedievas commented Jun 30, 2017

I have simple solution:
Install ws
start from zenbot folder: ws -p 8080 -d simulations/
on your browser write http://<external IP>:8080 of your zenbot server.

@shanehull
Copy link
Author

shanehull commented Jul 1, 2017

Thanks @nedievas .
I ended up setting up nginx over ssl with authentication after all. It works a treat.

I created a cert with certbot using certbot certonly --standalone -d subdomain.example.com.

Installed nginx .
Created a htpasswd using: printf "username:`openssl passwd -apr1`\n" >> /etc/nginx/.htpasswd

Then, edited the /etc/nginx/sites-enabled/default file to contain of the following:

   listen 80;
   listen [::]:80;
   server_name subdomain.mydomain.me;
   return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl;
    listen [::]:443 ssl;
    root /root/zenbot/simulations;

    ssl_certificate                 /etc/letsencrypt/live/subdomain.mydomain.me/fullchain.pem;
    ssl_certificate_key             /etc/letsencrypt/live/subdomain.mydomain.me/privkey.pem;
    add_header                      Strict-Transport-Security "max-age=31536000";

            autoindex on;
            auth_basic "Restricted Content";
            auth_basic_user_file /etc/nginx/.htpasswd;
}

Run systemctl restart nginx.service and that's it!

Result:
screen shot 2017-07-01 at 11 27 08 am

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

No branches or pull requests

4 participants