Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

A stripped down ODK server for receiving form data from ODK collect and storing it as static files, either in the local filesystem or on Github / Amazon S3

Notifications You must be signed in to change notification settings

gmaclennan/node-odk-aggregate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ODK-to-Github

WARNING: This is not ready for production. This is not yet tested. Play with it, send any modifications as a pull request.

This small node.js app can publish submissions from ODK Aggregate to a Github repository. Submissions will be stored as raw JSON as received from ODK Aggregate, in a folder named as the Form ID.

To deploy to Heroku:

git clone https://github.com/digidem/odk-to-github.git
cd odk-to-github
heroku login
npm install
heroku create
git push heroku master

You will need to create a token/password for authentication between ODK Aggregate and ODK-to-Github. You can choose a long password or generate a random string:

openssl rand -base64 32

Or use another method

You will also need a to create a Github Personal Access token from the account you want to use to update your repository. Add both these tokens to Heroku:

heroku config:set ODK_TOKEN=THE_TOKEN_YOU_CREATED_ABOVE
heroku config:set GITHUB_TOKEN=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN

Create a repo in github to store the form entries, make sure the user that you created the access token for has commit rights to that repo. In ODK Aggregate admin add a publish server:

Publish to: Z-ALPHA JSON Server Url to publish to: https://HEROKU_APP_ID.herokuapp.com/GITHUB_USER_NAME/REPO_NAME/BRANCH (branch will probably be master) Authentication token: THE_TOKEN_YOU_CREATED_ABOVE

That's it. When you submit a new form to ODK, it should appear in your Github repo. Note that Heroku free apps will go into idle after 60 mins without inactivity. This might cause publishing from ODK to fail - I have not tested this yet.

About

A stripped down ODK server for receiving form data from ODK collect and storing it as static files, either in the local filesystem or on Github / Amazon S3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published