Skip to content

Commit 6f95982

Browse files
committed
Removed AWS Integration
Added Finalize feature for Team Leaders
1 parent 95f4108 commit 6f95982

20 files changed

+56
-349
lines changed

AUTHORS.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ OTHER CONTRIBUTORS
1010
Kian Mirjalali <[email protected]>
1111
Eqbal Sarjami <[email protected]>
1212
Mohammadreza Montazeri <[email protected]>
13+
14+
OTHER CONTRIBUTORS [ioi-2019-baku]
15+
16+
Emil Abbasov <[email protected]>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The IOI Translation System provides a web interface for translating the tasks (p
55
into various languages during the International Olympiads in Informatics.
66
The system has been developed and first used in the IOI 2017 in Tehran, Iran.
77

8-
This fork, used in IOI 2018, contains AWS S3 support for the file storage and CMS integration.
8+
This fork, used in IOI 2019 Baku.
99

1010
Features
1111
--------
@@ -27,7 +27,7 @@ Deployment
2727

2828
ioi-translation is designed to be deployed on a Docker-compatible container platform. PostgreSQL and Redis are required for persistent storage and session store, respectively. Deployment behind reverse proxy such as nginx is recommended.
2929

30-
See `docker-compose.yml` for example deployment configurations (Note that `docker-compose.yml` in this repository is for development and not intended for use in production deployment). For the actual deployment in IOI 2018, refer to <https://github.com/jcioi/ioi-htc> (especially [ECS and nginx configuration](https://github.com/jcioi/ioi-htc/blob/master/hako/translation-prd.jsonnet) and [CMS integration](https://github.com/jcioi/ioi-htc/blob/master/itamae/cookbooks/ioi-cms-import-statement-worker/files/usr/bin/ioi-cms-import-statement-worker.rb))
30+
See `docker-compose.yml` for example deployment configurations (Note that `docker-compose.yml` in this repository is for development and not intended for use in production deployment). For the actual deployment in IOI 2019, refer to <https://github.com/ioi-2019>.
3131

3232

3333
Development Installation
@@ -40,7 +40,7 @@ You can install the translation system in just three steps:
4040
3. Run `docker-compose up -d`.
4141

4242
At this point, you will have a copy of the translation system up
43-
and running at `http://your_server_address:8000/`.
43+
and running at `http://your_server_address:9000/`.
4444
You may optionally perform the following tasks:
4545

4646
* To create essential data for the system such as admin users and groups,

Translation/settings.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@
166166
},
167167
'loggers': {
168168
'django': {
169-
'handlers': os.environ.get('LOG_HANDLERS', 'stderr').split(','),
169+
'handlers': os.environ.get('LOG_HANDLERS', 'stderr').split(','), #show errors
170+
# 'handlers': ['file', 'sentry'], #not show errors
170171
'level': 'DEBUG',
171172
'propagate': True,
172173
},
@@ -196,12 +197,3 @@
196197
STATIC_ROOT = os.path.join(BASE_DIR, "static/")
197198
HOST_URL = 'http://127.0.0.1:9000/'
198199

199-
if 'S3_BUCKET' in os.environ:
200-
DEFAULT_FILE_STORAGE = 'trans.s3storage.S3Storage'
201-
AWS_STORAGE_BUCKET_NAME = os.environ['S3_BUCKET']
202-
AWS_S3_REGION_NAME = os.environ.get('S3_REGION')
203-
AWS_DEFAULT_ACL = 'private'
204-
205-
SQS_QUEUE_NAME = os.environ.get('SQS_QUEUE_NAME')
206-
SQS_REGION_NAME = os.environ.get('SQS_REGION_NAME')
207-

buildspec.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

data/countries.csv

Lines changed: 0 additions & 88 deletions
This file was deleted.

data/languages.csv

Lines changed: 0 additions & 51 deletions
This file was deleted.

data/users.csv

Lines changed: 0 additions & 89 deletions
This file was deleted.

docker-compose.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
- postgres
1212
- redis
1313
environment:
14-
SECRET_KEY: 'secret_key_for_development_2969b4b149439648a52aa663bd740a4f'
14+
SECRET_KEY: 'secret_key_for_development_3969b4b149439648a52aa663bd740a4f'
1515
SESSION_COOKIE_SECURE: 0
1616
DB_HOST: postgres
1717
DB_USER: &db_user postgres
@@ -20,14 +20,8 @@ services:
2020
REDIS_HOST: redis
2121
REDIS_DB: 1
2222
GUNICORN_WORKERS: 2
23-
PRINT_SYSTEM_URL: http://print.ioi18.net
24-
# S3_BUCKET: ioi18-translation-files-dev
25-
# S3_REGION: ap-northeast-1
26-
# SQS_QUEUE_NAME: cms-statement-dev
27-
# SQS_REGION_NAME: ap-northeast-1
28-
# AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}'
29-
# AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}'
30-
# AWS_SESSION_TOKEN: '${AWS_SESSION_TOKEN}'
23+
PRINT_SYSTEM_URL: http://localhost
24+
3125

3226
nginx:
3327
restart: always
@@ -38,6 +32,7 @@ services:
3832
- app
3933
volumes:
4034
- ioi_static:/usr/src/app/static/:ro
35+
- ioi_media:/usr/src/app/media/:ro
4136

4237
postgres:
4338
restart: always

docker-entrypoint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ if [[ $# -eq 0 ]]; then
2121
python3 manage.py migrate
2222

2323
echo "Starting Gunicorn"
24-
exec /usr/local/bin/gunicorn Translation.wsgi:application -w "${GUNICORN_WORKERS:-1}" -b :9000
24+
25+
# For using docker in development settings, add `--reload` option below to the execution line of gunicorn
26+
exec /usr/local/bin/gunicorn Translation.wsgi:application --reload -w "${GUNICORN_WORKERS:-1}" -b :9000
2527
fi
2628

2729
exec "$@"

nginx/conf.d/ioi.conf

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ server {
1111
location /static {
1212
alias /usr/src/app/static;
1313
}
14-
14+
location /media {
15+
alias /usr/src/app/media;
16+
}
17+
1518
location / {
1619
proxy_set_header Host $host;
1720
proxy_set_header X-Real-IP $remote_addr;
@@ -21,14 +24,4 @@ server {
2124
}
2225

2326
include /etc/nginx/resolver;
24-
location /s3proxy {
25-
internal;
26-
set $s3url $upstream_http_location;
27-
28-
proxy_ssl_protocols TLSv1.2;
29-
proxy_set_header Authorization "";
30-
proxy_pass $s3url;
31-
32-
add_header Cache-Control "private, no-cache";
33-
}
3427
}

0 commit comments

Comments
 (0)