[GH-ISSUE #18] Password protection #231

Closed
opened 2026-03-15 02:34:40 +03:00 by kerem · 2 comments
Owner

Originally created by @diwu1989 on GitHub (Dec 31, 2014).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/18

I would like to run this on my server, can you implement password protection?

Simple http password would work

Originally created by @diwu1989 on GitHub (Dec 31, 2014). Original GitHub issue: https://github.com/asapach/peerflix-server/issues/18 I would like to run this on my server, can you implement password protection? Simple http password would work
kerem closed this issue 2026-03-15 02:34:45 +03:00
Author
Owner

@asapach commented on GitHub (Jan 2, 2015):

I think it's really out of scope of this project. If you would like to make your server publicly available on the web, you should put a reverse proxy server in front of peerflix-server, enable SSL and basic auth. Here's my nginx config that I use on my Ubuntu 14.04 server (as mentioned here):

server {
        listen 443;
        server_name <your host name>;
        keepalive_timeout 15m;

        ssl on;
        ssl_certificate /etc/nginx/ssl/server.crt;
        ssl_certificate_key /etc/nginx/ssl/server.key;

        ssl_session_timeout 15m;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
        ssl_prefer_server_ciphers on;

        location / {
                proxy_pass http://localhost:9000;
                proxy_http_version 1.1;
                auth_basic "peerflix server";
                auth_basic_user_file /etc/nginx/.htpasswd;
        }

        location /socket.io/ {
                proxy_pass http://localhost:9000/socket.io/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }
}

You can follow this guide on how to enable SSL: https://www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-nginx-for-ubuntu-14-04
And this guide on how to enable basic http authentication: https://www.digitalocean.com/community/tutorials/how-to-set-up-http-authentication-with-nginx-on-ubuntu-12-10
This config also enables websocket proxy for the socket.io endpoint.

I would also recommend to set up peerflix-server as a daemon (using upstart or similar init system) - you can see my config here: #10

<!-- gh-comment-id:68544769 --> @asapach commented on GitHub (Jan 2, 2015): I think it's really out of scope of this project. If you would like to make your server publicly available on the web, you should put a reverse proxy server in front of peerflix-server, enable SSL and basic auth. Here's my nginx config that I use on my Ubuntu 14.04 server (as mentioned [here](https://github.com/asapach/peerflix-server/issues/9#issuecomment-58811595)): ``` server { listen 443; server_name <your host name>; keepalive_timeout 15m; ssl on; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; ssl_session_timeout 15m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; ssl_prefer_server_ciphers on; location / { proxy_pass http://localhost:9000; proxy_http_version 1.1; auth_basic "peerflix server"; auth_basic_user_file /etc/nginx/.htpasswd; } location /socket.io/ { proxy_pass http://localhost:9000/socket.io/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } ``` You can follow this guide on how to enable SSL: https://www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-nginx-for-ubuntu-14-04 And this guide on how to enable basic http authentication: https://www.digitalocean.com/community/tutorials/how-to-set-up-http-authentication-with-nginx-on-ubuntu-12-10 This config also enables websocket proxy for the socket.io endpoint. I would also recommend to set up peerflix-server as a daemon (using `upstart` or similar init system) - you can see my config here: #10
Author
Owner

@asapach commented on GitHub (Apr 13, 2015):

see #34

<!-- gh-comment-id:92494159 --> @asapach commented on GitHub (Apr 13, 2015): see #34
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/peerflix-server#231
No description provided.