Spike, see: https://www.pivotaltracker.com/n/projects/1519297
To run this web server:
- Fork and/or clone this repo
- Ensure you have
postgresql
installed and running on localhost - Execute
bundle install
- If you have a problem installing
pg
, try runningsudo env ARCHFLAGS='-arch x86_64' gem install pg
- Create a file called
.env
in the project root,
- You can run
cp .env.example .env
- Populate the
GITHUB_CLIENT_ID
andGITHUB_CLIENT_SECRET
with your own Github App configurations - Instructions on how to do this here
- Look at an example configuration below
- If you are running this for the first time, run
rake db:create
- Execute
rake db:migrate
- Execute
rails s
- The rails server should now be running on http://localhost:3000
To set initial admin:
- First, sign into your application at http://localhost:3000
- On the command line in your project root, you can run
rake super_admin:help
to show all super_admin instructions
169-231-82-184:anacapa-github-prototype johndoe$ rake super_admin:help
to list all users rake super_admin:list_users
to list all admins rake super_admin:list_admins
to list all non-admins rake super_admin:list_non_admins
to make a user an admin rake super_admin:grant_admin_permission[< user's id >]
to revoke admin privleges rake super_admin:revoke_admin_permission[< user's id >]
- To make yourself an admin, first find yourself by running
rake super_admin:list_users
169-231-82-184:anacapa-github-prototype johndoe$ rake super_admin:list_users
+---------------------+----------+----+----------+
| email | name | id | is_admin |
+---------------------+----------+----+----------+
| [email protected] | John Doe | 1 | false |
+---------------------+----------+----+----------+
1 row in set
For syntax of how to grant or revoke admin privs, type rake super_admin:help
- Find the
id
corresponding to your user and runrake super_admin:grant_admin_permission[<what you found>]
169-231-82-184:anacapa-github-prototype johndoe$ rake super_admin:grant_admin_permission[1]
+---------------------+----------+----+----------+
| email | name | id | is_admin |
+---------------------+----------+----+----------+
| [email protected] | John Doe | 1 | true |
+---------------------+----------+----+----------+
1 row in set
169-231-82-184:anacapa-github-prototype johndoe$
- You should now see a link to "Admin Panel" when you sign in to your website.
If you have a postgres database console prompt:
\l
to list databases\dt
to list tables in current database\connect
database-name to change database