Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a way to disable SSL completely #182

Closed
wants to merge 10 commits into from
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
SSL_TYPE=selfsign|letsencrypt|customssl
DOMAIN=local|your.domain.com
SYSADMIN_EMAIL=administrator@email.com
HTTP_PORT=80
HTTPS_PORT=443
2 changes: 1 addition & 1 deletion client
Submodule client updated 223 files
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ services:
- /data/transfer:/data/transfer
environment:
- DOMAIN=${DOMAIN}
- SYSADMIN_EMAIL=${SYSADMIN_EMAIL}
command: [ "./wait-for-it.sh", "postgres:5432", "--", "./start-odk.sh" ]
restart: always
nginx:
Expand All @@ -50,15 +51,15 @@ services:
- DOMAIN=${DOMAIN}
- CERTBOT_EMAIL=${SYSADMIN_EMAIL}
ports:
- "80:80"
- "443:443"
- "${HTTP_PORT}:80"
- "${HTTPS_PORT}:443"
healthcheck:
test: [ "CMD-SHELL", "nc -z localhost 443 || exit 1" ]
restart: always

pyxform:
container_name: pyxform
image: 'getodk/pyxform-http:v1.0.0'
image: 'getodk/pyxform-http:v1.3.3'
restart: always

secrets:
Expand Down
24 changes: 12 additions & 12 deletions docs/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
</script>
</head>
<body>
<div class="news-item">
<span class="item-date">2020/12/28</span>
<a href="https://forum.getodk.org/t/odk-central-v1-1/31766/2" target="_blank">
ODK Central v1.1.1
</a>
</div>
<div class="news-item">
<span class="item-date">2020/12/23</span>
<a href="https://forum.getodk.org/t/odk-central-v1-1/31766" target="_blank">
ODK Central v1.1
</a>
</div>
<div class="news-item">
<span class="item-date">2020/08/21</span>
<a href="https://forum.getodk.org/t/odk-central-v1-0/29368" target="_blank">
Expand All @@ -32,17 +44,5 @@
ODK Central v0.8
</a>
</div>
<div class="news-item">
<span class="item-date">2019/12/03</span>
<a href="https://forum.getodk.org/t/odk-central-v0-7/23657" target="_blank">
ODK Central v0.7
</a>
</div>
<div class="news-item">
<span class="item-date">2019/08/15</span>
<a href="https://forum.getodk.org/t/odk-central-v0-6-beta/21489" target="_blank">
ODK Central v0.6 Beta
</a>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion enketo.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM enketo/enketo-express:2.3.12
FROM enketo/enketo-express:2.5.6

ENV ENKETO_SRC_DIR=/srv/src/enketo_express
WORKDIR ${ENKETO_SRC_DIR}
Expand Down
2 changes: 1 addition & 1 deletion files/enketo/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
},
"support": {
"email": "errors@getodk.org"
"email": "support@getodk.org"
},
"text field character limit": 1000000
}
8 changes: 7 additions & 1 deletion files/nginx/odk-setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DHPATH=/etc/dh/nginx.pem
if [ ! -e "$DHPATH" ]
if [ ! -e "$DHPATH" ] && [ "$SSL_TYPE" != "none" ]
then
echo "diffie hellman private key does not exist; creating.."
openssl dhparam -out "$DHPATH" 2048
Expand All @@ -25,6 +25,12 @@ if [ "$SSL_TYPE" = "letsencrypt" ]
then
echo "starting nginx with certbot.."
/bin/bash /scripts/entrypoint.sh
elif [ "$SSL_TYPE" = "none" ]
then
perl -i -ne 's/listen 443.*/listen 80;/; print if ! /ssl_/' /etc/nginx/conf.d/odk.conf
rm -f /etc/nginx/conf.d/certbot.conf
echo "starting insecure nginx without certbot (no SSL, potential security issue: SSL should always be active).."
nginx -g "daemon off;"
else
echo "starting nginx without certbot.."
nginx -g "daemon off;"
Expand Down
3 changes: 2 additions & 1 deletion files/service/config.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"apiKey": "${ENKETO_API_KEY}"
},
"env": {
"domain": "https://${DOMAIN}"
"domain": "https://${DOMAIN}",
"sysadminAccount": "${SYSADMIN_EMAIL}"
},
"external": {
"sentry": {
Expand Down
2 changes: 1 addition & 1 deletion files/service/scripts/start-odk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_PATH=/usr/odk/config/local.json
echo "generating local service configuration.."
/bin/bash -c "ENKETO_API_KEY=$(cat /etc/secrets/enketo-api-key) envsubst '\$DOMAIN:\$ENKETO_API_KEY' < /usr/share/odk/config.json.template > $CONFIG_PATH"
/bin/bash -c "ENKETO_API_KEY=$(cat /etc/secrets/enketo-api-key) envsubst '\$DOMAIN:\$SYSADMIN_EMAIL:\$ENKETO_API_KEY' < /usr/share/odk/config.json.template > $CONFIG_PATH"

echo "running migrations.."
node -e 'const { withDatabase, migrate } = require("./lib/model/database"); withDatabase(require("config").get("default.database"))(migrate);'
Expand Down
2 changes: 1 addition & 1 deletion server
Submodule server updated 63 files
+1 −0 .gitignore
+5 −5 CONTRIBUTING.md
+4 −3 config/default.json
+151 −7 docs/api.md
+6 −5 lib/bin/backup.js
+8 −4 lib/data/briefcase.js
+96 −0 lib/data/odata-filter.js
+11 −1 lib/data/schema.js
+8 −1 lib/data/submission.js
+2 −2 lib/http/endpoint.js
+1 −1 lib/http/middleware.js
+1 −2 lib/http/preprocessors.js
+1 −0 lib/http/service.js
+1 −1 lib/model/instance/client-audit.js
+7 −0 lib/model/instance/form-partial.js
+2 −0 lib/model/instance/form.js
+1 −1 lib/model/instance/submission-attachment.js
+2 −2 lib/model/instance/submission-def.js
+2 −2 lib/model/instance/submission.js
+25 −0 lib/model/migrations/20200930-01-add-backup-run-verb.js
+17 −0 lib/model/migrations/20201117-01-remove-deleted-actor-assignments-again.js
+19 −0 lib/model/migrations/20201207-01-harmonize-submitter-id-columns.js
+17 −8 lib/model/query/blobs.js
+6 −2 lib/model/query/client-audits.js
+16 −2 lib/model/query/forms.js
+2 −0 lib/model/query/projects.js
+4 −2 lib/model/query/submission-attachments.js
+3 −0 lib/model/query/submission-defs.js
+15 −7 lib/model/query/submissions.js
+8 −6 lib/outbound/mail.js
+6 −5 lib/outbound/odata.js
+5 −2 lib/resources/app-users.js
+160 −0 lib/resources/backup.js
+1 −1 lib/resources/config.js
+4 −0 lib/resources/forms.js
+1 −1 lib/resources/odata.js
+62 −21 lib/resources/submissions.js
+8 −2 lib/task/fs.js
+21 −3 lib/task/task.js
+9 −0 lib/util/db.js
+3 −2 lib/util/http.js
+9 −0 lib/util/problem.js
+16 −4 lib/util/sentry.js
+196 −187 package-lock.json
+5 −4 package.json
+11 −0 test/integration/api/app-users.js
+27 −0 test/integration/api/backup.js
+15 −16 test/integration/api/forms.js
+203 −0 test/integration/api/odata.js
+19 −0 test/integration/api/projects.js
+290 −5 test/integration/api/submissions.js
+21 −3 test/integration/other/encryption.js
+2 −2 test/integration/other/transactions.js
+15 −9 test/integration/setup.js
+15 −1 test/integration/task/task.js
+15 −15 test/integration/worker/worker.js
+68 −0 test/unit/data/odata-filter.js
+18 −0 test/unit/data/schema.js
+1 −1 test/unit/http/endpoint.js
+3 −3 test/unit/http/preprocessors.js
+16 −0 test/unit/model/instance/form-partial.js
+1 −1 test/util/crypto-odk.js
+1 −1 test/util/google-mock.js