Skip to content

Commit cc61a90

Browse files
prandlaveluca93
authored andcommitted
Set listen addresses in sample config to 127.0.0.1
When in docker, these are replaced with 0.0.0.0 to allow access from outside docker.
1 parent 1ccdfc1 commit cc61a90

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ RUN sudo pip3 install --break-system-packages .
4949

5050
RUN sudo python3 prerequisites.py --yes --cmsuser=cmsuser install
5151

52-
RUN sudo sed 's|/cmsuser:your_password_here@localhost:5432/cmsdb"|/postgres@testdb:5432/cmsdbfortesting"|' ./config/cms.conf.sample \
52+
RUN sed 's|/cmsuser:your_password_here@localhost:5432/cmsdb"|/postgres@testdb:5432/cmsdbfortesting"|' ./config/cms.conf.sample \
5353
| sudo tee /usr/local/etc/cms-testdb.conf
54-
RUN sudo sed 's|/cmsuser:your_password_here@localhost:5432/cmsdb"|/postgres@devdb:5432/cmsdb"|' ./config/cms.conf.sample \
54+
RUN sed -e 's|/cmsuser:your_password_here@localhost:5432/cmsdb"|/postgres@devdb:5432/cmsdb"|' -e 's/127.0.0.1/0.0.0.0/' ./config/cms.conf.sample \
5555
| sudo tee /usr/local/etc/cms-devdb.conf
56+
RUN sed 's/127.0.0.1/0.0.0.0/' ./config/cms.ranking.conf.sample | sudo tee /usr/local/etc/cms.ranking.conf
5657

5758
ENV LANG C.UTF-8
5859

config/cms.conf.sample

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@
102102
"_section": "ContestWebServer",
103103

104104
"_help": "Listening HTTP addresses and ports for the CWSs listed above",
105-
"_help": "in core_services. If you access them through a proxy (acting",
106-
"_help": "as a load balancer) running on the same host you could put",
107-
"_help": "127.0.0.1 here for additional security.",
108-
"contest_listen_address": [""],
105+
"_help": "in core_services. By default only listens on localhost, meaning",
106+
"_help": "you need a separate reverse proxy to access it from the web.",
107+
"_help": "Set to empty string to allow connecting from anywhere.",
108+
"contest_listen_address": ["127.0.0.1"],
109109
"contest_listen_port": [8888],
110110

111111
"_help": "Login cookie duration in seconds. The duration is refreshed",
@@ -139,10 +139,11 @@
139139

140140
"_section": "AdminWebServer",
141141

142-
"_help": "Listening HTTP address and port for the AWS. If you access",
143-
"_help": "it through a proxy running on the same host you could put",
144-
"_help": "127.0.0.1 here for additional security.",
145-
"admin_listen_address": "0.0.0.0",
142+
"_help": "Listening HTTP address and port for the AWS. By default only",
143+
"_help": "listens on localhost, meaning you need a separate reverse proxy",
144+
"_help": "to access it from the web. Set to empty string to allow",
145+
"_help": "connecting from anywhere.",
146+
"admin_listen_address": "127.0.0.1",
146147
"admin_listen_port": 8889,
147148

148149
"_help": "Login cookie duration for admins in seconds.",

config/cms.ranking.conf.sample

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"_help": "There is no way to put comments in a JSON file; the",
33
"_help": "fields starting with '_' are meant to be comments.",
44

5-
"_help": "Listening address for RankingWebServer.",
5+
"_help": "Listening address for RankingWebServer. By default only",
6+
"_help": "listens on localhost, meaning you need a separate reverse proxy",
7+
"_help": "to access it from the web. Set to empty string to allow",
8+
"_help": "connecting from anywhere.",
69
"bind_address": "127.0.0.1",
710

811
"_help": "Listening port for RankingWebServer.",

0 commit comments

Comments
 (0)