Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dtu-enote
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enote
dtu-enote
Commits
19a08ef4
Commit
19a08ef4
authored
Mar 21, 2019
by
iaibrys
Browse files
Options
Downloads
Patches
Plain Diff
Add filemanager
parent
22686fdb
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#152
passed
Mar 21, 2019
Stage: build
Stage: release
Stage: deploy
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
erb/default.conf.erb
+91
-0
91 additions, 0 deletions
erb/default.conf.erb
erb/docker-build.sh.erb
+3
-1
3 additions, 1 deletion
erb/docker-build.sh.erb
erb/docker-compose-enote.yml.erb
+32
-1
32 additions, 1 deletion
erb/docker-compose-enote.yml.erb
generate.rb
+6
-0
6 additions, 0 deletions
generate.rb
with
132 additions
and
2 deletions
erb/default.conf.erb
+
91
−
0
View file @
19a08ef4
...
...
@@ -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
#
...
...
This diff is collapsed.
Click to expand it.
erb/docker-build.sh.erb
+
3
−
1
View file @
19a08ef4
...
...
@@ -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
%>
This diff is collapsed.
Click to expand it.
erb/docker-compose-enote.yml.erb
+
32
−
1
View file @
19a08ef4
...
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
generate.rb
+
6
−
0
View file @
19a08ef4
...
...
@@ -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
|
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment