diff --git a/README.md b/README.md index 1d4f738..cc0c555 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,14 @@ mongoDB URI may also be specified. These options are all passed in as environment variables, but for your convenience, there is a config file that passes these in for you. +For your Google Apps token. Be sure your redirect URLs are correctly set. +Here is an example: + +![Example](http://i.imgur.com/njeMN9w.png) + +You can get a token from here: +[https://console.developers.google.com](https://console.developers.google.com) + No configuration is necessary for this if run in full stack mode as it will inherit it from the docker-compose configuration in the parent. @@ -102,3 +110,33 @@ another branch, and push to master only when it is stable. Our docker image can be found here: [Docker Hub hackad/nyu-vote](https://hub.docker.com/r/hackad/nyu-vote/) + +Running the first time +====================== + +The app ships with a user account called "devAdmin" which is the first superadmin. +When you first set this up you probably want to add your own NYU account to the +super user list and delete this devAdmin account. To do so: + +1. Open a Javascript Console in the browser and enter: + +``` +Meteor.loginWithPassword("devAdmin", "password") +``` + +Then check if it worked with + +``` +Meteor.user() +// You should see: +> User {_id: "jbqgxRC9FX9AdWPoc", profile: Object, emails: Array[1], username: "devAdmin", _dep: T…r.Dependency…} +``` + +2. Go to HOST/admin and go to Groups and Global Admins. Then +add the NetIds you want to both the Admins and Users of this list. +Check that it works by logging out, and logging back in with your +user and seeing if you can access HOST/admin + +3. Once you have verified that it is working from your user, you want to +click the "Delete Dev Superuser" button on the sidebar from the +HOST/admin page. If it worked, then the button will dissapear. diff --git a/client/stylesheets/style.css b/client/stylesheets/style.css index c175d8b..ff982c7 100644 --- a/client/stylesheets/style.css +++ b/client/stylesheets/style.css @@ -53,6 +53,10 @@ a { background: rgb(37, 42, 58); text-align: center; } + +#nav #delete-super-user { + color: orange; +} /* Show the "Menu" button on phones */ #nav .nav-menu-button { display: block; @@ -191,6 +195,16 @@ a { height: 40px; } +#content-wrapper { + padding-left: 10px; + padding-right: 10px; +} +#stugov-logo { + position: absolute; + left: 20px; + top: 20px; + max-width: 50%; +} /* * -- TABLET (AND UP) MEDIA QUERIES -- @@ -198,6 +212,9 @@ a { * of the mobile styles. */ @media (min-width: 40em) { + #stugov-logo { + max-width: 25%; + } /* Move the layout over so we can fit the nav + list in on the left */ #layout { diff --git a/client/views/admin/adminMaster.coffee b/client/views/admin/adminMaster.coffee index 0b212d6..adb0643 100644 --- a/client/views/admin/adminMaster.coffee +++ b/client/views/admin/adminMaster.coffee @@ -23,6 +23,8 @@ Template.adminMaster.helpers return "Group" username: () -> return Meteor.user()?.profile.name + superuserExists: () -> + return Meteor.users.findOne({username: "devAdmin"}) Template.adminMaster.events "click .login": (e) -> @@ -44,3 +46,12 @@ Template.adminMaster.events Meteor.logout(() -> window.location = "http://accounts.google.com/logout" ) + "click #delete-super-user": (e) -> + e.preventDefault() + if confirm("This removes the superuser account to which the password " + + "is public (whch is a security threat). " + + "This must be done before the app goes live but make " + + "sure you have added yourself to the global admins list first. " + + "instructions can be found at: https://github.com/hackAD/nyu-vote" + ) + Meteor.call("deleteSuperuser") diff --git a/client/views/admin/adminMaster.html b/client/views/admin/adminMaster.html index e96828f..ec43e39 100644 --- a/client/views/admin/adminMaster.html +++ b/client/views/admin/adminMaster.html @@ -15,6 +15,13 @@ class="switch-group {{#if isElections}}{{else}}bold{{/if}}"> Groups ({{groupsCount}}) + {{#if superuserExists}} +