Skip to content
This repository was archived by the owner on May 10, 2023. It is now read-only.
Merged

Docs #13

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ARG GROUP_ID=1001
RUN set -ex; \
addgroup --gid $GROUP_ID --system containeruser; \
adduser --system --uid $USER_ID --gid $GROUP_ID containeruser; \
chown -R containeruser:containeruser /home/app
chown -R containeruser:containeruser /app

USER containeruser

Expand Down
2 changes: 2 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: node index.js
metrics: ./start_metrics.sh
80 changes: 59 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,69 @@ Organize hackaton ideas into a dashboard
Install
===========

I wrote a [blog post](http://zajdband.com/installing-hackdash) explaining the installation process. Also check the [wiki](https://github.com/danzajdband/hackdash/wiki) for more info and docs
Hackdash can now be run in a docker container - see an example [dokku app configuration using ansible](https://github.com/OpenUpSA/ansible-config/tree/master/apps/hackdash).

Alternatively, see a [blog post](http://zajdband.com/installing-hackdash) explaining the installation process to run it natively. Also check the [wiki](https://github.com/danzajdband/hackdash/wiki) for more info and docs

Development enviroment
----------------------

The quickest way to set up a local development environment is using docker-compose to manage the environment by running

docker-compose up

If you prefer to run it natively, refer to the blog post above, the config documentation below, and then run

yarn start

Once the images have been pulled/built and started, you should be able to visit it at http://localhost:3000 and see the prompt to create a new dashboard. Once you click in the dashboard name input, it will try and fail to prompt you to login.

To be able to login, create a `.env` file in the project root with the following config:

GITHUB_CLIENT_ID=
GITHUB_SECRET_KEY=
GITHUB_CALLBACK_URL=http://localhost:3000/auth/github/callback

For the values of CLIENT_ID and SECRET_KEY, [create a Github OAuth app](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app) with the above callback URL, and enter the ID and key values in the .ev file.

To apply the new environment variables to the running docker containers, stop them all and run `docker-compose up` again, or while they're running, run `docker-compose up -d` in another terminal.

You should now be able to login using your own github account via OAuth, and get redirected back to your local hackdash instance with a logged-in session. You can now create a dashboard and a project.


Config
======

In your `config.js`: We can chanage defaut values and configuration will be loaded form
`.env` file.

* `db`:
+ `url`: Overrides other db config. Full MongoDB URL. Override form environment variable `DB_URL`
+ `host` Override form environment variable `DB_HOST`
+ `port` Override form environment variable `DB_PORT`
* `host`: Your instance host (i.e. yourdomain.com) Override form environment variable `HOST`
* `port`: Your port (i.e. 3000) Override form environment variable `PORT`
* `session`: Your session key (it must be a secret string) Override form environment variable `SESSION`
* `title`: Instance title used in the html title tag and other headings. Override form environment variable `TITLE`
* `live`: Boolean (true, false) that enable/disable the live feed feature in yourdomain.com/live. Override form environment variable `LIVE`
* `mailer`: SMTP mail info to enable email notifications using nodemailer. Check out the [options](https://github.com/andris9/Nodemailer#setting-up-smtp) Override form environment variable `MAILER`
* `team`: An array of `user`.`_id` to be shown as Team on Landing Page.
* `maxQueryLimit`: a Number for the max amount of results at the landing page searchs. Override form environment variable `MAX_QUERY_LIMIT`
* `googleAnalytics`: the UA-XXXXXXXX-X code from Google Analytics. if not specified wont set the script. Override form environment variable `GOOGLE_ANALYTICS`
* `facebookAppId`: the Facebook App Id for share buttons. It will take first from keys.json, if not will use this one. Don't set it to not show FB share buttons. Override form environment variable `FCAEBOOK_APP_ID`
* `prerender`:
+ `enabled`: Boolean (true, false). Where the website would use the SEO Prerender. Override form environment variable `PREPENDER_ENABLE`
+ `db`: The Mongo URI of Cached Pages. Override form environment variable `PREPENDER_DB`
Configure by setting environment variables, setting values in a `.env` file, or by modifying `config.js`.

| Environment variable or .env key | config.js key | Required | Default | Description |
|----------------------------------|---------------|----------|---------|-------------|
| `DATABASE_URL` | `db.url` | Yes | | Overrides other db config. Full MongoDB URL. |
| `DB_HOST` | `db.host` | If DATABASE_URL not provided | | |
| `DB_PORT` | `db.port` | If DATABASE_URL not provided | | |
| `HOST` | `host` | Yes | | Your instance host (i.e. yourdomain.com) |
| `PORT` | `port` | No | $PORT or 3000 | Your port (i.e. 3000) |
| `SESSION` | `session` | Yes | | Your session key (it must be a secret string) |
| `TITLE` | `title`: Instance title used in the html title tag and other headings. |
| `LIVE` | `live` | No | true | Boolean (true, false) that enable/disable the live feed feature in yourdomain.com/live.
| `MAILER` | `mailer` | No | `null` | SMTP mail info to enable email notifications using nodemailer. Check out the [options](https://github.com/andris9/Nodemailer#setting-up-smtp) |
| | `team` | No | ? | An array of `user`.`_id` to be shown as Team on Landing Page. |
| `MAX_QUERY_LIMIT` | `maxQueryLimit` | No | 30 | a Number for the max amount of results at the landing page searchs. |
| `GOOGLE_ANALYTICS` | `googleAnalytics` | No | `UA-XXXXXXXX-X` | the UA-XXXXXXXX-X code from Google Analytics. if not specified wont set the script. |
| `FACEBOOK_APP_ID` | `facebookAppId` | No | `YYYYYYYYYYYY` | the Facebook App Id for share buttons. It will take first from keys.json, if not will use this one. Don't set it to not show FB share buttons. |
| `PRERENDER_ENABLE` | `prerender.enabled` | No | `false` | Boolean (true, false). Where the website would use the SEO Prerender.|
| `PRERENDER_DB` | `presender.db` | No | `"mongodb://localhost/prerender"` | The Mongo URI of Cached Pages. |

Authentication providers are configured using environment variables, .env file keys, or modifying `keys.js`.

| Environment variable or .env key | config.js key | Required | Default | Description |
|----------------------------------|---------------|----------|---------|-------------|
| `GITHUB_CLIENT_ID` | `github.clientID` | No | | [create a Github OAuth app](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app) |
| `GITHUB_SECRET_KEY` | `github.clientSecret` | No | | |
| `GITHUB_CALLBACK_URL` | `github.callbackURL` | No | `"fake"` | e.g. `http://localhost:3000/auth/github/callback` |

See code for more authentication options.


Running instances
=================
Expand Down
4 changes: 2 additions & 2 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module.exports = {
"live": process.env.LIVE || true,
"mailer": process.env.MAILER || null,
"prerender": {
"enabled": process.env.PREPENDER_ENABLE || false,
"db": process.env.PREPENDER_DB || "mongodb://localhost/prerender"
"enabled": process.env.PRERENDER_ENABLE || false,
"db": process.env.PRERENDER_DB || "mongodb://localhost/prerender"
},
"team": [
"516d1997b2951b02280000e1",
Expand Down