Skip to content
Snippets Groups Projects
Commit 19a08ef4 authored by iaibrys's avatar iaibrys
Browse files

Add filemanager

parent 22686fdb
Branches
No related tags found
No related merge requests found
Pipeline #152 passed
......@@ -147,6 +147,97 @@ server {
}
<% end %>
<% if enabled_features[:filemanager] %>
#
# filemanager
#
upstream filemanager {
least_conn;
server filemanager:5000 weight=10 max_fails=3 fail_timeout=30s;
}
server {
listen 8443 ssl;
server_name filemanager<%= enote_domain_suffix %>;
access_log /var/log/nginx/access-filemanager<%= enote_domain_suffix %>.log;
error_log /var/log/nginx/error-filemanager<%= enote_domain_suffix %>.log info;
# sets the domain[s] that this vhost server requests for
ssl_certificate <%= ssl_certificates["filemanager#{enote_domain_suffix}"][:cert] %>;
ssl_certificate_key <%= ssl_certificates["filemanager#{enote_domain_suffix}"][:key] %>;
proxy_ssl_ciphers HIGH:!aNULL:!MD5;
# proxy_ssl_trusted_certificate /etc/ssl/data/certs/trusted_ca_cert.crt;
# Set the max size for file uploads to 50Mb
client_max_body_size 50M;
#proxy_ssl_verify on;
#proxy_ssl_verify_depth 2;
proxy_ssl_session_reuse on;
location /askbot {
return 404;
break;
}
location /php-myadmin {
return 404;
break;
}
location /myadmin {
return 404;
break;
}
location /wp-admin {
return 404;
break;
}
location /wp-content {
return 404;
break;
}
# doc root
root /data/filemanager-public;
location / {
location ~ ^/(assets|images|vendor|font|fonts)/ {
gzip_static on;
add_header Cache-Control public;
expires 4w;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";
gzip_comp_level 6;
gzip_types application/x-javascript text/css image/x-icon image/png image/jpeg image/gif;
add_header proxy_served_static gzip;
break;
}
# If the file exists as a static file serve it directly without
# running all the other rewite tests on it
if (-f $request_filename) {
add_header proxy_served_static raw;
break;
}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_pass http://filemanager;
}
}
<% end %>
#
# Course
#
......
......@@ -25,5 +25,7 @@ docker build --tag enote/dtu-enote-website:latest --tag <%= @docker_registry%>/e
docker build --tag enote/dtu-enote/proxy:latest --tag <%= @docker_registry%>/enote/dtu-enote/proxy:latest <%= @src_root %>/dtu-enote
<% if enabled_features[:filemanager] %>
docker build --tag enote/filemanager:latest --tag <%= @docker_registry%>/enote/filemanager:latest <%= @src_root %>/filemanager
<% end %>
......@@ -69,8 +69,8 @@ services:
- redis:redis
volumes:
- <%= @data_root %>/config:/data/config
- <%= @gen_root %>/deployment-info.yaml:/data/env_config/deployment-info.yaml
- <%= @data_root %>/cndumper:/data/user_config
- <%= @gen_root %>/deployment-info.yaml:/data/env_config/deployment-info.yaml
- <%= @data_root %>/quiz-assets:/data/quiz-assets # assets (images) for the quizzes themselves
- <%= @data_root %>/quiz-public:/data/quiz-public # assets for the quiz web-app
- <%= @data_root %>/quiz-keys:/data/quiz-keys # keys for the course github repos for the quizzes
......@@ -86,6 +86,36 @@ services:
<% end %>
<% if enabled_features[:filemanager] %>
filemanager:
container_name: filemanager
image: <%= @docker_registry %>/enote/filemanager<%= ':' + @docker_version_tag %>
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
<% if public_server %>
expose:
- "5000"
<% else %>
ports:
- "5000:5000"
<% end %>
volumes:
- <%= @data_root %>/config:/data/config
- <%= @data_root %>/cndumper:/data/user_config
- <%= @data_root %>/content:/content
- <%= @data_root %>/filemanager-public:/public
- <%= @log_root %>/filemanager:/app/log
environment:
DTU_FILEMANAGER_ROOT: '/content'
TZ: '<%= timezone %>'
networks:
- revproxynet
<% end %>
<% if enabled_features[:getpdf] %>
get-pdf:
container_name: get-pdf
......@@ -236,6 +266,7 @@ services:
- <%= @data_root %>/quiz-public/:/data/quiz-public
- <%= @data_root %>/quiz-assets/:/data/quiz-assets
- <%= @data_root %>/website-public/:/data/website-public
- <%= @data_root %>/filemanager-public/:/data/filemanager-public
- <%= @data_root %>/content/:/data/content
- <%= @data_root %>/root/:/var/www
networks:
......
......@@ -28,6 +28,7 @@ default_enabled_features = {
:sharelatex => true,
:quiz => true,
:course_website => true,
:filemanager => true,
}
limits = {
:sharelatex => {
......@@ -86,6 +87,7 @@ def generate_expected_images(features)
:sharelatex => ['enote/dtu-enote-sharelatex', 'enote/dtu-enote-mongodb', 'redis'],
:getpdf => ['enote/dtu-enote-getpdf'],
:course_website => ['enote/dtu-enote-website', 'redis'],
:filemanager => 'enote/filemanager',
}[feature]
end.reject(&:nil?).flatten.uniq
end
......@@ -136,6 +138,9 @@ if enabled_features[:sharelatex]
enabled_features[:sharelatexdb] = true
end
if enabled_features[:filemanager]
ssl_certificates["filemanager#{enote_domain_suffix}"] = default_cert("filemanager")
end
# form hashes from the head commit in each depedent branch to bust the caches
git_hashes = {
......@@ -207,6 +212,7 @@ TEMPLATES = %w[erb/docker-compose-enote.yml.erb
erb/docker-check.sh.erb
erb/default.conf.erb]
TEMPLATES.each do |template|
puts "Generating #{template}"
root = File.basename(template, '.erb')
tmp = ERB.new File.read(template), nil, "%"
File.open(File.join(@gen_root, root), "w") do |f|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment