From 55ae3bb2736dfc65866c776990c34b43418170de Mon Sep 17 00:00:00 2001 From: Jonathan Elias Caicedo Date: Fri, 29 Sep 2017 21:23:11 -0400 Subject: [PATCH] Update README.md with clarifications; add make-admin.sh script (#73) --- README.md | 22 ++++++++++++---------- example_database/make-admin.sh | 6 ++++++ 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 example_database/make-admin.sh diff --git a/README.md b/README.md index 66bb716dd..b53bbb536 100644 --- a/README.md +++ b/README.md @@ -10,20 +10,22 @@ Check it out in action at [shuttles.rpi.edu](https://shuttles.rpi.edu). 2. Ensure your `$GOPATH` is set correctly, and is apart of your `$PATH` 3. Run `go get github.com/wtg/shuttletracker` 4. Install `govendor` by running `go get -u github.com/kardianos/govendor` -5. Run `govendor sync` -6. Ensure you have NPM, Bower, and MongoDB installed. -7. Run `bower install` inside the Shuttle Tracker directory (`$GOPATH/src/github.com/wtg/shuttletracker`) to install dependencies listed in bower.json -8. Rename `conf.json.sample` to `conf.json` -9. Edit conf.json with the following: +5. Switch to the Shuttle Tracker directory (`$GOPATH/src/github.com/wtg/shuttletracker`) +6. Run `govendor sync` +7. Ensure you have NPM, Bower, and MongoDB installed. +8. Run `bower install` inside the Shuttle Tracker directory (`$GOPATH/src/github.com/wtg/shuttletracker`) to install dependencies listed in bower.json +9. Rename `conf.json.sample` to `conf.json` +10. Edit conf.json with the following: * `DataFeed`: API with tracking information from iTrak... For RPI, this is a unique API URL that we can get data from. It's currently private, and we will only share it with authorized members for now. * `UpdateInterval`: Number of seconds between each request to the data feed - * `MongoUrl`: Url where MongoDB is located + * `MongoUrl`: URL where MongoDB is located * `MongoPort`: Port where MongoDB is bound (default is 27017) -10. Start MongoDB, and ensure it is running, and listening on port 27017 (or whichever port you defined in `MongoPort` within `conf.json`) -11. Add data to your database. Example DBs are provided in `example_database`, as well as a simple import/export script to setup the database for you. +11. Start MongoDB, and ensure it is running, and listening on port 27017 (or whichever port you defined in `MongoPort` within `conf.json`) +12. Add data to your database. Example DBs are provided in `example_database`, as well as a simple import/export script to setup the database for you. - If using an example database, you might need to check the name of the imported database, and change `MongoUrl` accordingly. -12. Start the app by running `go run main.go` in the project root directory. -13. Visit http://localhost:8080/ to view the tracking application and http://localhost:8080/admin to view the administration panel +13. Start the app by running `go run main.go` in the project root directory. +14. You can optionally add yourself as an administrator by using the `make-admin` script in the example_database folder, passing it your RCS ID as the first argument. +14. Visit http://localhost:8080/ to view the tracking application and http://localhost:8080/admin to view the administration panel ## Configuration diff --git a/example_database/make-admin.sh b/example_database/make-admin.sh new file mode 100644 index 000000000..73fbfddab --- /dev/null +++ b/example_database/make-admin.sh @@ -0,0 +1,6 @@ +#! /bin/bash +mongo << EOF +use shuttle_tracking +db.users.insert( {'name': "$1"} ); +quit() +EOF \ No newline at end of file