<commit_before># HomeDash

An open source realtime dashboard to view/control all of your home automation toys.

## Run

HomeDash can be deployed with [Docker](https://docker.com) and [Docker Compose](https://docs.docker.com/compose/overview/). See [Docker install docs](https://docs.docker.com/engine/installation/) for your platform.

To launch an official prebuilt image of HomeDash, create a docker-compose.yml and add the following:

```yaml
homedash:
  image: jshimko/homedash:latest
  links:
    - mongo
  ports:
    - "80:3000"
  environment:
    MONGO_URL: "mongodb://mongo:27017/homedash"

mongo:
  image: mongo:latest
  command: mongod --storageEngine=wiredTiger
```

Now you can start the app and database by running the following command from the same directory as your `docker-compose.yml`.

```sh
docker-compose up -d
```

...and the app should be available at http://localhost

## Development

Before cloning this project to work with it locally or build from source, make sure you have installed all of the dependencies for your operating system. For more info, see the [install docs](docs/installation.md).

Once you've installed the dependencies for your OS, you're ready to download, build, and run HomeDash. Note that the instructions below are specifically for local development/testing. Docker should be used for production deployments. More production deployment details for various platforms coming soon.

### Install

```sh
git clone https://github.com/jshimko/home-dash.git

cd home-dash

meteor npm install
```

### Configure

**Default Settings**

Client side user creation is disabled, so you will need to set a default user (or users) in a `settings.json` file.  Note that `admin` is currently the only role with access to everything, so be sure to set that for your user. You can also import any application settings the same way.  If you run the app with a `settings.json` like below, it will create the default users (only if none exist) and the remaining settings will be inserted into the Settings collection (if the given field is not already defined in the database).

Once you've imported settings, you can run the app without your `settings.json` because your settings will now be saved in the database and can be viewed/updated at the `/settings` route.

**Example settings.json**

The latest example settings.json will always be available in the root of the app and will contain all currently supported values. It is recommended that you copy that into your own file and make sure to never commit it to source control (since it contains things like default passwords and API keys)

I recommend creating a settings file for development and one for production so you use different API keys in each environment.

```sh
# create a copy to modify from the provided example
cp settings.json settings.dev.json
```

Now open your new `settings.dev.json` file and add any desired users or settings.

```js
// settings.dev.json

{
  // Add as many users to the array as you'd like.
  // Note that they will only be created if there are 0 users in the database.
  "defaultUsers": [
    {
      "email": "<EMAIL>",
      "username": "admin",
      "password": "<PASSWORD>",
      "roles": ["admin"]
    },
    {
      "email": "<EMAIL>",
      "username": "admin2",
      "password": "<PASSWORD>",
      "roles": ["admin"]
    }
  ],

  // These are the currently available settings that
  // can be imported into the Settings collection.
  // Any other keys will be ignored.
  "siteTitle": "HomeDash",
  "adminEmail": "",
  "mailUrl": "",
  "lifxApiKey": "",
  "segmentKey": ""
}
```

### Run

```sh
# start the app and specify your settings file
meteor --settings settings.dev.json

# running on http://localhost:3000
```

You new user(s) will be created and your settings saved the database. Any subsequent app starts can simply be:

```sh
# start the app
meteor

# running on http://localhost:3000
```
<commit_msg>update readme header<commit_after># HomeDash

An open source realtime dashboard to view/control all of your home automation toys.

## Deploy

HomeDash can be deployed with [Docker](https://docker.com) and [Docker Compose](https://docs.docker.com/compose/overview/). See [Docker install docs](https://docs.docker.com/engine/installation/) for your platform.

To launch an official prebuilt image of HomeDash, create a docker-compose.yml and add the following:

```yaml
homedash:
  image: jshimko/homedash:latest
  links:
    - mongo
  ports:
    - "80:3000"
  environment:
    MONGO_URL: "mongodb://mongo:27017/homedash"

mongo:
  image: mongo:latest
  command: mongod --storageEngine=wiredTiger
```

Now you can start the app and database by running the following command from the same directory as your `docker-compose.yml`.

```sh
docker-compose up -d
```

...and the app should be available at http://localhost

## Development

Before cloning this project to work with it locally or build from source, make sure you have installed all of the dependencies for your operating system. For more info, see the [install docs](docs/installation.md).

Once you've installed the dependencies for your OS, you're ready to download, build, and run HomeDash. Note that the instructions below are specifically for local development/testing. Docker should be used for production deployments. More production deployment details for various platforms coming soon.

### Install

```sh
git clone https://github.com/jshimko/home-dash.git

cd home-dash

meteor npm install
```

### Configure

**Default Settings**

Client side user creation is disabled, so you will need to set a default user (or users) in a `settings.json` file.  Note that `admin` is currently the only role with access to everything, so be sure to set that for your user. You can also import any application settings the same way.  If you run the app with a `settings.json` like below, it will create the default users (only if none exist) and the remaining settings will be inserted into the Settings collection (if the given field is not already defined in the database).

Once you've imported settings, you can run the app without your `settings.json` because your settings will now be saved in the database and can be viewed/updated at the `/settings` route.

**Example settings.json**

The latest example settings.json will always be available in the root of the app and will contain all currently supported values. It is recommended that you copy that into your own file and make sure to never commit it to source control (since it contains things like default passwords and API keys)

I recommend creating a settings file for development and one for production so you use different API keys in each environment.

```sh
# create a copy to modify from the provided example
cp settings.json settings.dev.json
```

Now open your new `settings.dev.json` file and add any desired users or settings.

```js
// settings.dev.json

{
  // Add as many users to the array as you'd like.
  // Note that they will only be created if there are 0 users in the database.
  "defaultUsers": [
    {
      "email": "<EMAIL>",
      "username": "admin",
      "password": "<PASSWORD>",
      "roles": ["admin"]
    },
    {
      "email": "<EMAIL>",
      "username": "admin2",
      "password": "<PASSWORD>",
      "roles": ["admin"]
    }
  ],

  // These are the currently available settings that
  // can be imported into the Settings collection.
  // Any other keys will be ignored.
  "siteTitle": "HomeDash",
  "adminEmail": "",
  "mailUrl": "",
  "lifxApiKey": "",
  "segmentKey": ""
}
```

### Run

```sh
# start the app and specify your settings file
meteor --settings settings.dev.json

# running on http://localhost:3000
```

You new user(s) will be created and your settings saved the database. Any subsequent app starts can simply be:

```sh
# start the app
meteor

# running on http://localhost:3000
```

{'fraction_non_alphanumeric': 0.09134615384615384, 'fraction_numerical': 0.005313765182186235, 'mean_word_length': 3.852670349907919, 'pattern_counts': {'":': 28, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2027844', 'n_tokens_mistral': 2221, 'n_tokens_neox': 2110, 'n_words': 1048}