Skip to content

Commit 619ad51

Browse files
committed
chore: Split deployment scripts based on versions
1 parent f24d718 commit 619ad51

File tree

58 files changed

+1387
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1387
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
env
2+
*.retry
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[defaults]
2+
inventory = env/hosts.ini
3+
roles_path = roles
4+
host_key_checking = False
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
window.conf = {
2+
mode: '{{ app_mode | default('JUDGELS', true) }}',
3+
name: '{{ app_name }}',
4+
slogan: '{{ app_slogan }}',
5+
apiUrl: 'https://{{ nginx_domain_judgels_server_api }}/v2',
6+
welcomeBanner: {
7+
title: '{{ app_title }}',
8+
description: '{{ app_description }}',
9+
},
10+
{% if app_footer is defined %}
11+
footer: '{{ app_footer }}',
12+
{% endif %}
13+
{% if googleAnalytics_trackingId is defined %}
14+
googleAnalytics: {
15+
trackingId: '{{ googleAnalytics_trackingId }}',
16+
},
17+
{% endif %}
18+
{% if jophiel_auth_google_clientId is defined %}
19+
googleAuth: {
20+
clientId: '{{ jophiel_auth_google_clientId }}',
21+
},
22+
{% endif %}
23+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
server:
2+
applicationConnectors:
3+
- type: http
4+
port: 9007
5+
6+
logging:
7+
appenders:
8+
- type: console
9+
threshold: INFO
10+
logFormat: "%-5p [%d{ISO8601,UTC}] [%X{gradingJID:--}]: %m%n%rEx"
11+
- type: file
12+
logFormat: "%-5p [%d{ISO8601,UTC}] [%X{gradingJID:--}]: %m%n%rEx"
13+
currentLogFilename: var/log/judgels-grader.log
14+
archivedLogFilenamePattern: var/log/judgels-grader-%d.log.gz
15+
archivedFileCount: 14
16+
17+
judgels:
18+
baseDataDir: var/data
19+
20+
rabbitmq:
21+
host: {{ groups['core'][0] }}
22+
username: {{ rabbitmq_username }}
23+
password: {{ rabbitmq_password }}
24+
25+
gabriel:
26+
grading:
27+
gradingRequestQueueName: gabriel-grading-request
28+
numWorkerThreads: {{ gabriel_grading_numWorkerThreads }}
29+
30+
cache:
31+
cachedBaseDataDir: var/data
32+
serverBaseDataDir: {{ ansible_user }}@{{ groups['core'][0] }}:/opt/judgels/server/var/data
33+
rsyncIdentityFile: var/conf/judgels-grader
34+
35+
isolate:
36+
baseDir: /judgels/isolate
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
server:
2+
applicationConnectors:
3+
- type: http
4+
port: 9101
5+
6+
adminConnectors:
7+
- type: http
8+
port: 9111
9+
10+
requestLog:
11+
appenders:
12+
- type: file
13+
currentLogFilename: var/log/judgels-server-request.log
14+
archivedLogFilenamePattern: var/log/judgels-server-request-%d.log.gz
15+
archivedFileCount: 14
16+
17+
database:
18+
driverClass: com.mysql.jdbc.Driver
19+
url: jdbc:mysql://localhost/judgels?useSSL=false
20+
user: {{ db_username }}
21+
password: {{ db_password }}
22+
properties:
23+
charSet: UTF-8
24+
hibernate.dialect: org.hibernate.dialect.MySQL8Dialect
25+
hibernate.generate_statistics: false
26+
hibernate.query.plan_cache_max_size: 64
27+
hibernate.query.plan_parameter_metadata_max_size: 32
28+
29+
logging:
30+
appenders:
31+
- type: console
32+
threshold: INFO
33+
- type: file
34+
currentLogFilename: var/log/judgels-server.log
35+
archivedLogFilenamePattern: var/log/judgels-server-%d.log.gz
36+
archivedFileCount: 14
37+
38+
loggers:
39+
org.hibernate.type.BasicTypeRegistry:
40+
level: OFF
41+
42+
webSecurity:
43+
cors:
44+
allowedOrigins: https://{{ nginx_domain_judgels_client }}
45+
allowCredentials: true
46+
47+
judgels:
48+
baseDataDir: var/data
49+
50+
app:
51+
name: {{ app_name }}
52+
53+
{% if rabbitmq_username is defined %}
54+
rabbitmq:
55+
host: localhost
56+
username: {{ rabbitmq_username }}
57+
password: {{ rabbitmq_password }}
58+
{% endif %}
59+
60+
jophiel:
61+
auth:
62+
{% if jophiel_auth_google_clientId is defined %}
63+
google:
64+
clientId: {{ jophiel_auth_google_clientId }}
65+
{% endif %}
66+
67+
{% if jophiel_mailer_host is defined %}
68+
mailer:
69+
host: {{ jophiel_mailer_host }}
70+
port: {{ jophiel_mailer_port }}
71+
useSsl: {{ jophiel_mailer_useSsl }}
72+
username: {{ jophiel_mailer_username }}
73+
password: {{ jophiel_mailer_password }}
74+
sender: {{ jophiel_mailer_sender }}
75+
{% endif %}
76+
77+
{% if recaptcha_siteKey is defined %}
78+
recaptcha:
79+
siteKey: {{ recaptcha_siteKey }}
80+
secretKey: {{ recaptcha_secretKey }}
81+
{% endif %}
82+
83+
{% if jophiel_aws_accessKey is defined %}
84+
aws:
85+
accessKey: {{ jophiel_aws_accessKey }}
86+
secretKey: {{ jophiel_aws_secretKey }}
87+
s3BucketRegionId: {{ jophiel_aws_s3BucketRegionId }}
88+
cloudFrontBaseUrl: {{ jophiel_aws_cloudFrontBaseUrl }}
89+
{% endif %}
90+
91+
userAvatar:
92+
fs:
93+
type: {{ jophiel_userAvatar_fs_type | default('local', true) }}
94+
{% if jophiel_userAvatar_fs_type | default('local', true) != 'local' %}
95+
s3BucketName: {{ jophiel_userAvatar_fs_s3BucketName }}
96+
{% endif %}
97+
98+
userRegistration:
99+
enabled: {{ jophiel_userRegistration_enabled | default(false, true) }}
100+
{% if jophiel_userRegistration_enabled | default(false, true) %}
101+
useRecaptcha: {{ jophiel_userRegistration_useRecaptcha }}
102+
activationEmailTemplate:
103+
subject: {{ jophiel_userRegistration_activationEmailTemplate_subject }}
104+
body: {{ jophiel_userRegistration_activationEmailTemplate_body }}
105+
{% else %}
106+
useRecaptcha: false
107+
activationEmailTemplate:
108+
subject: UNUSED
109+
body: UNUSED
110+
{% endif %}
111+
112+
userResetPassword:
113+
enabled: {{ jophiel_userResetPassword_enabled | default(false, true) }}
114+
{% if jophiel_userResetPassword_enabled | default(false, true) %}
115+
requestEmailTemplate:
116+
subject: {{ jophiel_userResetPassword_requestEmailTemplate_subject }}
117+
body: {{ jophiel_userResetPassword_requestEmailTemplate_body }}
118+
resetEmailTemplate:
119+
subject: {{ jophiel_userResetPassword_resetEmailTemplate_subject }}
120+
body: {{ jophiel_userResetPassword_resetEmailTemplate_body }}
121+
{% else %}
122+
requestEmailTemplate:
123+
subject: UNUSED
124+
body: UNUSED
125+
resetEmailTemplate:
126+
subject: UNUSED
127+
body: UNUSED
128+
{% endif %}
129+
130+
superadmin:
131+
initialPassword: {{ jophiel_superadmin_initialPassword }}
132+
133+
session:
134+
maxConcurrentSessionsPerUser: {{ jophiel_session_maxConcurrentSessionsPerUser }}
135+
disableLogout: {{ jophiel_session_disableLogout }}
136+
137+
web:
138+
announcements: []
139+
140+
sandalphon:
141+
gabriel:
142+
gradingRequestQueueName: gabriel-grading-request
143+
gradingResponseQueueName: sandalphon-grading-response
144+
145+
uriel:
146+
gabriel:
147+
gradingRequestQueueName: gabriel-grading-request
148+
gradingResponseQueueName: uriel-grading-response
149+
150+
{% if uriel_aws_accessKey is defined %}
151+
aws:
152+
accessKey: {{ uriel_aws_accessKey }}
153+
secretKey: {{ uriel_aws_secretKey }}
154+
s3BucketRegionId: {{ uriel_aws_s3BucketRegionId }}
155+
{% endif %}
156+
157+
submission:
158+
fs:
159+
type: {{ uriel_submission_fs_type | default('local', true) }}
160+
{% if uriel_submission_fs_type | default('local', true) != 'local' %}
161+
s3BucketName: {{ uriel_submission_fs_s3BucketName }}
162+
{% endif %}
163+
164+
file:
165+
fs:
166+
type: {{ uriel_file_fs_type | default('local', true) }}
167+
{% if uriel_file_fs_type | default('local', true) != 'local' %}
168+
s3BucketName: {{ uriel_file_fs_s3BucketName }}
169+
{% endif %}
170+
171+
jerahmeel:
172+
gabriel:
173+
gradingRequestQueueName: gabriel-grading-request
174+
gradingResponseQueueName: jerahmeel-grading-response
175+
176+
{% if jerahmeel_aws_accessKey is defined %}
177+
aws:
178+
accessKey: {{ jerahmeel_aws_accessKey }}
179+
secretKey: {{ jerahmeel_aws_secretKey }}
180+
s3BucketRegionId: {{ jerahmeel_aws_s3BucketRegionId }}
181+
{% endif %}
182+
183+
submission:
184+
fs:
185+
type: {{ jerahmeel_submission_fs_type | default('local', true) }}
186+
{% if jerahmeel_submission_fs_type | default('local', true) != 'local' %}
187+
s3BucketName: {{ jerahmeel_submission_fs_s3BucketName }}
188+
{% endif %}
189+
190+
stats:
191+
enabled: {{ jerahmeel_stats_enabled | default(false, true) }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
upstream judgels_client {
2+
{% for host in groups['core'] %}
3+
server {{ host }}:5000;
4+
{% endfor %}
5+
}
6+
7+
server {
8+
listen 443 ssl;
9+
listen [::]:443 ssl;
10+
ssl_certificate /etc/letsencrypt/live/{{ domain.fqdn }}/fullchain.pem;
11+
ssl_certificate_key /etc/letsencrypt/live/{{ domain.fqdn }}/privkey.pem;
12+
include /etc/letsencrypt/options-ssl-nginx.conf;
13+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
14+
15+
server_name {{ domain.fqdn }};
16+
17+
location / {
18+
include proxy_params;
19+
proxy_pass http://judgels_client;
20+
proxy_set_header Connection "";
21+
proxy_http_version 1.1;
22+
proxy_buffering off;
23+
client_max_body_size 512M;
24+
}
25+
26+
location ^~ /.well-known/acme-challenge/ {
27+
root /var/lib/letsencrypt;
28+
default_type "text/plain";
29+
}
30+
}
31+
32+
server {
33+
listen 80;
34+
listen [::]:80;
35+
36+
server_name {{ domain.fqdn }};
37+
38+
location ^~ /.well-known/acme-challenge/ {
39+
root /var/lib/letsencrypt;
40+
default_type "text/plain";
41+
}
42+
43+
location / {
44+
return 301 https://$host$request_uri;
45+
}
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
upstream judgels_server_admin {
2+
{% for host in groups['core'] %}
3+
server {{ host }}:9101;
4+
{% endfor %}
5+
}
6+
7+
server {
8+
listen 443 ssl;
9+
listen [::]:443 ssl;
10+
ssl_certificate /etc/letsencrypt/live/{{ domain.fqdn }}/fullchain.pem;
11+
ssl_certificate_key /etc/letsencrypt/live/{{ domain.fqdn }}/privkey.pem;
12+
include /etc/letsencrypt/options-ssl-nginx.conf;
13+
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
14+
15+
server_name {{ domain.fqdn }};
16+
access_log off;
17+
18+
location / {
19+
include proxy_params;
20+
proxy_pass http://judgels_server_admin;
21+
proxy_set_header Connection "";
22+
proxy_http_version 1.1;
23+
proxy_buffering off;
24+
client_max_body_size 512M;
25+
26+
{% if domain.auth_basic_user != '' %}
27+
# HTTP basic authentication
28+
auth_basic "Authorized users only";
29+
auth_basic_user_file /etc/nginx/passwords/{{ domain.name }};
30+
{% endif %}
31+
}
32+
33+
location ^~ /.well-known/acme-challenge/ {
34+
root /var/lib/letsencrypt;
35+
default_type "text/plain";
36+
}
37+
}
38+
39+
server {
40+
listen 80;
41+
listen [::]:80;
42+
43+
server_name {{ domain.fqdn }};
44+
45+
location ^~ /.well-known/acme-challenge/ {
46+
root /var/lib/letsencrypt;
47+
default_type "text/plain";
48+
}
49+
50+
location / {
51+
return 301 https://$host$request_uri;
52+
}
53+
}

0 commit comments

Comments
 (0)