Skip to content

Commit

Permalink
Add dev template for Enketo
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqkhoja committed Oct 20, 2023
1 parent 565ac23 commit 5af1671
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions enketo.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ WORKDIR ${ENKETO_SRC_DIR}

COPY files/enketo/config.json.template ${ENKETO_SRC_DIR}/config/config.json.template
COPY files/enketo/config.json.template ${ENKETO_SRC_DIR}/config/config.json
COPY files/enketo/config.json.dev.template ${ENKETO_SRC_DIR}/config/config.json.dev.template
COPY files/enketo/start-enketo.sh ${ENKETO_SRC_DIR}/start-enketo.sh

RUN apt-get update && \
Expand Down
45 changes: 45 additions & 0 deletions files/enketo/config.json.dev.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"app name": "Enketo",
"base path": "-",
"encryption key": "s0m3v3rys3cr3tk3y",
"id length": 31,
"less secure encryption key": "this $3cr3t key is crackable",
"linked form and data server": {
"api key": "enketorules",
"authentication": {
"allow insecure transport": "true"
},
"name": "ODK Central",
"server url": "localhost:8989"
},
"ip filtering": {
"allowPrivateIPAddress": true,
"allowMetaIPAddress": false,
"allowIPAddressList": [],
"denyIPAddressList": []
},
"max processes": 1,
"logo": {
"source": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
"href": ""
},
"offline enabled": true,
"payload limit": "1mb",
"port": "8005",
"query parameter to pass to submission": "st",
"redis": {
"main": {
"host": "localhost",
"port": "6379"
},
"cache": {
"host": "localhost",
"port": "6379"
}
},
"support": {
"email": "[email protected]"
},
"text field character limit": 1000000,
"exclude non-relevant": true
}
4 changes: 4 additions & 0 deletions files/enketo/start-enketo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ envsubst '$DOMAIN $BASE_URL $SECRET $LESS_SECRET $API_KEY $SUPPORT_EMAIL' \
< "$CONFIG_PATH.template" \
> "$CONFIG_PATH"

if [ "$ENV" = "DEV" ]; then
cp "$CONFIG_PATH.dev.template" "$CONFIG_PATH"
fi

echo "starting pm2/enketo.."
exec pm2-runtime app.js -n enketo

0 comments on commit 5af1671

Please sign in to comment.