cahya commited on
Commit
acc0179
1 Parent(s): c1616ad

add authentication

Browse files
Files changed (3) hide show
  1. Dockerfile +1 -0
  2. default +5 -0
  3. htpasswd +1 -0
Dockerfile CHANGED
@@ -28,5 +28,6 @@ COPY --chown=user:user ./requirements.txt /home/user/requirements.txt
28
  RUN pip install --no-cache-dir --upgrade -r /home/user/requirements.txt
29
  COPY --chown=user:user ./app /home/user/app
30
  COPY ./default /etc/nginx/sites-available
 
31
  EXPOSE 7860
32
  CMD ["/bin/sh", "/home/user/app/start.sh"]
 
28
  RUN pip install --no-cache-dir --upgrade -r /home/user/requirements.txt
29
  COPY --chown=user:user ./app /home/user/app
30
  COPY ./default /etc/nginx/sites-available
31
+ COPY ./htpasswd /etc/nginx
32
  EXPOSE 7860
33
  CMD ["/bin/sh", "/home/user/app/start.sh"]
default CHANGED
@@ -62,6 +62,11 @@ server {
62
  }
63
 
64
  location /console/ {
 
 
 
 
 
65
  proxy_http_version 1.1;
66
  proxy_set_header Host $host;
67
  proxy_set_header X-Real-IP $remote_addr;
 
62
  }
63
 
64
  location /console/ {
65
+ auth_basic "Console";
66
+ auth_basic_user_file "/etc/nginx/htpasswd";
67
+ proxy_set_header X-WEBAUTH-USER $remote_user;
68
+ proxy_set_header Authorization "";
69
+
70
  proxy_http_version 1.1;
71
  proxy_set_header Host $host;
72
  proxy_set_header X-Real-IP $remote_addr;
htpasswd ADDED
@@ -0,0 +1 @@
 
 
1
+ user:$2y$05$cI0ThiNYxpt.6Wfd4gxAMOrvzMqcTgEDINS7cv1fxBeOrxgEFmyjS