infra: dusting

This commit is contained in:
nemunaire 2018-12-06 03:48:53 +01:00
parent 93519e5f62
commit 8edc8e697c
5 changed files with 68 additions and 39 deletions

View File

@ -30,4 +30,4 @@ COPY admin/static/css/bootstrap.min.css frontend/static/css/glyphicon.css /srv/h
COPY frontend/static/fonts /srv/htdocs-admin/fonts
COPY admin/static/img /srv/htdocs-admin/img
COPY admin/static/views /srv/htdocs-admin/views
COPY admin/static/js/app.js frontend/static/js/angular.min.js admin/static/js/angular-resource.min.js frontend/static/js/angular-route.min.js frontend/static/js/angular-sanitize.min.js frontend/static/js/bootstrap.min.js frontend/static/js/d3.v3.min.js frontend/static/js/i18n frontend/static/js/jquery.min.js frontend/static/js/popper.min.js /srv/htdocs-admin/js/
COPY admin/static/js/app.js frontend/static/js/angular.min.js admin/static/js/angular-resource.min.js frontend/static/js/angular-route.min.js frontend/static/js/angular-sanitize.min.js frontend/static/js/bootstrap.min.js frontend/static/js/common.js frontend/static/js/d3.v3.min.js frontend/static/js/i18n frontend/static/js/jquery.min.js /srv/htdocs-admin/js/

View File

@ -6,6 +6,7 @@ WORKDIR /go/src/srs.epita.fr/fic-server/dashboard
ADD dashboard/*.go ./
ADD dashboard/api/*.go ./api/
ADD libfic ../libfic/
ADD settings ../settings/
RUN go get -d -v
@ -23,4 +24,8 @@ ENTRYPOINT ["/srv/dashboard", "--bind=:8082"]
VOLUME /srv/htdocs-dashboard/
COPY --from=gobuild /go/src/srs.epita.fr/fic-server/dashboard/dashboard /srv/dashboard
COPY dashboard/static /srv/htdocs-dashboard
COPY dashboard/static/index.html /srv/htdocs-dashboard/
COPY dashboard/static/css/bootstrap.min.css frontend/static/css/fic.css frontend/static/css/glyphicon.css /srv/htdocs-dashboard/css/
COPY frontend/static/fonts /srv/htdocs-dashboard/fonts
COPY frontend/static/img/ dashboard/static/img/logo-epita-bw.png /srv/htdocs-dashboard/img/
COPY dashboard/static/js/dashboard.js frontend/static/js/angular.min.js dashboard/static/js/angular-animate.min.js frontend/static/js/angular-route.min.js frontend/static/js/angular-sanitize.min.js frontend/static/js/bootstrap.min.js frontend/static/js/common.js frontend/static/js/d3.v3.min.js frontend/static/js/i18n frontend/static/js/jquery.min.js /srv/htdocs-dashboard/js/

View File

@ -53,6 +53,9 @@ server {
location /rank {
rewrite ^/.*$ /index.html;
}
location /rules {
rewrite ^/.*$ /index.html;
}
location /tags/ {
rewrite ^/.*$ /index.html;
}
@ -78,11 +81,6 @@ server {
expires epoch;
add_header Cache-Control no-cache;
}
location /public.json {
root /srv/TEAMS/_public/;
expires epoch;
add_header Cache-Control no-cache;
}
location /stats.json {
root /srv/TEAMS/;
expires epoch;
@ -98,13 +96,14 @@ server {
expires epoch;
add_header Cache-Control no-cache;
#if (!-f $document_root/../started) {
# rewrite ^/ /wait.json;
#}
if (!-f $document_root/../started) {
rewrite ^/ /wait.json;
}
}
location /settings.json {
root /srv/TEAMS/;
root /srv/SETTINGS/;
expires epoch;
add_header X-FIC-time $msec;
add_header Cache-Control no-cache;
}
location /teams.json {
@ -126,9 +125,8 @@ server {
return 403;
}
proxy_pass http://localhost:8081/admin/api/;
proxy_pass http://fic-admin:8081/admin/api/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -140,9 +138,8 @@ server {
return 403;
}
proxy_pass http://localhost:8081;
proxy_pass http://fic-admin:8081;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -154,9 +151,8 @@ server {
rewrite ^/submit/(.*)$ /submission/$team/$1 break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -168,9 +164,21 @@ server {
rewrite ^/submit/.*$ /chname/$team break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
}
location /registration {
#auth_basic "Secure Zone";
#auth_basic_user_file ficpasswd;
include /etc/nginx/auth.conf;
rewrite ^/registration /registration/$team break;
proxy_pass http://fic-frontend:8080;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -182,9 +190,8 @@ server {
rewrite ^/openhint/(.*)$ /openhint/$team/$1 break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
@ -196,19 +203,17 @@ server {
rewrite ^/wantchoices/(.*)$ /wantchoices/$team/$1 break;
proxy_pass http://localhost:8080/;
proxy_pass http://fic-frontend:8080/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
}
location = /events.json {
proxy_pass http://localhost:8081/api/events/;
proxy_pass http://fic-admin:8081/api/events/;
proxy_method GET;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host localhost;
proxy_redirect off;
proxy_cache STATIC;
proxy_cache_valid 3s;

View File

@ -36,9 +36,6 @@ server {
location = /index.html {
include fic-auth.conf;
}
location ~ ^/public[0-9].html {
rewrite ^ /public.html;
}
location = /welcome.html {
internal;
if ($http_accept ~ "^application/json") {
@ -109,11 +106,6 @@ server {
expires epoch;
add_header Cache-Control no-cache;
}
location ~ /public[0-9].json {
root /srv/TEAMS/public/;
expires epoch;
add_header Cache-Control no-cache;
}
location /stats.json {
root /srv/TEAMS/;
expires epoch;
@ -170,6 +162,15 @@ server {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
}
location /registration {
include fic-auth.conf;
rewrite ^/registration /registration/$team break;
proxy_pass http://frontend:8080;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
}
location /openhint/ {
include fic-auth.conf;

View File

@ -21,11 +21,12 @@ services:
links:
- mysql
volumes:
- ~/fic:/mnt/fic:ro
- /mnt/fic:/mnt/fic:ro
- dashboard:/srv/DASHBOARD
- files:/srv/FILES
- pki:/srv/PKI
- settings:/srv/SETTINGS
- teams:/srv/TEAMS
- teams:/srv/TEAMS:ro
command: --baseurl /admin/ -localimport /mnt/fic -localimportsymlink
depends_on:
- mysql
@ -41,9 +42,9 @@ services:
links:
- mysql
volumes:
- files:/srv/FILES
- files:/srv/FILES:ro
- teams:/srv/TEAMS
- settings:/srv/SETTINGS
- settings:/srv/SETTINGS:ro
- submissions:/srv/submissions
depends_on:
- mysql
@ -58,23 +59,39 @@ services:
ports:
- "8080:8080"
volumes:
- htdocs:/srv/htdocs-frontend
- htdocs:/srv/htdocs-frontend:ro
- files:/srv/FILES:ro
- teams:/srv/TEAMS:ro
- settings:/srv/SETTINGS
- settings:/srv/SETTINGS:ro
- submissions:/srv/submissions
depends_on:
- fic-backend
fic-dashboard:
build:
context: .
dockerfile: Dockerfile-dashboard
image: nemunaire/fic-dashboard:latest
ports:
- "8082:8082"
volumes:
- dashboard:/srv/DASHBOARD
- teams:/srv/TEAMS:ro
- settings:/srv/SETTINGS:ro
depends_on:
- fic-backend
front:
image: nginx:latest
ports:
- "8042:80"
volumes:
- /mnt/fic:/mnt/fic:ro
- ./configs/nginx-frontend-htpasswd.conf:/etc/nginx/conf.d/default.conf:ro
- ./configs/nginx-fic.conf:/etc/nginx/auth.conf:ro
- htdocs:/srv/htdocs-frontend:ro
- files:/srv/FILES:ro
- settings:/srv/SETTINGS:ro
- teams:/srv/TEAMS:ro
depends_on:
- fic-frontend
@ -82,6 +99,7 @@ services:
volumes:
mysql-data:
dashboard:
files:
htdocs:
pki: