{"id":18625459,"url":"https://github.com/domapic/domapic-controller","last_synced_at":"2025-11-03T20:30:25.645Z","repository":{"id":57214923,"uuid":"139040349","full_name":"domapic/domapic-controller","owner":"domapic","description":"Controller for Domapic systems","archived":false,"fork":false,"pushed_at":"2019-05-02T08:03:37.000Z","size":712,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-04T20:35:34.862Z","etag":null,"topics":["accessories","api","automatism","controller","domapic","domotic","events","framework","home-automation","iot","iot-platform","microservices","opensource","pluggable","raspberry-pi","rest","sockets","swagger-ui","user-interface","web"],"latest_commit_sha":null,"homepage":"https://www.domapic.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/domapic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-28T15:59:54.000Z","updated_at":"2019-06-11T07:17:41.000Z","dependencies_parsed_at":"2022-09-12T11:12:34.455Z","dependency_job_id":null,"html_url":"https://github.com/domapic/domapic-controller","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fdomapic-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fdomapic-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fdomapic-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fdomapic-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domapic","download_url":"https://codeload.github.com/domapic/domapic-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239007958,"owners_count":19567007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessories","api","automatism","controller","domapic","domotic","events","framework","home-automation","iot","iot-platform","microservices","opensource","pluggable","raspberry-pi","rest","sockets","swagger-ui","user-interface","web"],"created_at":"2024-11-07T04:34:35.946Z","updated_at":"2025-11-03T20:30:25.598Z","avatar_url":"https://github.com/domapic.png","language":"JavaScript","readme":"![Domapic][domapic-logo-image]\n\n# Domapic Controller\n\n\u003e Controller for Domapic systems\n\n[![Build status][travisci-image]][travisci-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url] [![js-standard-style][standard-image]][standard-url]\n\n[![NPM dependencies][npm-dependencies-image]][npm-dependencies-url] [![Last commit][last-commit-image]][last-commit-url] \u003c!-- [![Last release][release-image]][release-url] --\u003e\n\n[![NPM downloads][npm-downloads-image]][npm-downloads-url] [![Website][website-image]][website-url] [![License][license-image]][license-url]\n\n---\n\n## Table of Contents\n\n* [Introduction](#introduction)\n* [Prerequisites](#prerequisites)\n* [Quick Start](#quick-start)\n\t* [Installation](#installation)\n\t* [Start the server](#start-the-server)\n\t* [Display logs](#display-logs)\n\t* [Get API Key to connect Domapic Services](#get-api-key-to-connect-domapic-services)\n\t* [Stop and restart](#stop-and-restart)\n* [Options](#options)\n* [Security](#security)\n\n---\n\n## Introduction\n\nController server for Domapic domotic systems.\n\nConnect all your Domapic Modules and control them with a single application. \u003c!-- and program them to interact automatically using the provided web interface\nInstall Domapic plugins to connect Domapic with other domotic systems or online services. --\u003e\n\n__NOTE: The next schema includes some Domapic pieces that are still not released. The Domapic Cloud plugin, mobile apps and Alexa plugin will be available soon.__\n\n![Domapic system example][domapic-example-image]\n\n\u003e Above, an example of two modules in a [Domapic System][website-url]. Now, the relay can be controlled using the web or mobile applications, or interacting with [\"Alexa\"][alexa-url] or [\"HomeKit\"][homekit-url]. _Automatisms can be configured in the [Domapic Controller Web UI][domapic-controller-url] to make the [_Phillips Hue_][hue-url] bulb be switched off automatically when the relay bulb is switched on, for example. (Automatisms feature is still in development)_\n\n## Prerequisites\n\nDomapic controller is built with Node.js, and uses MongoDB as database, so, first of all, you need to have installed them in your system:\n- [Installing Node.js and npm](https://nodejs.org/es/download/package-manager/)\n- [Installing MongoDB](https://docs.mongodb.com/manual/installation/)\n\n## Quick start\n\n### Installation\n\nInstall Domapic-controller globally using npm:\n\n```bash\nnpm i domapic-controller -g --production\n```\n\n### Start the server\n\n```bash\ndomapic-controller start\n```\n\nThe controller process will be started at background (using [PM2][pm2-url] as manager). Now you can browse to [http://localhost:3000](http://localhost:3000) to check that the server has started successfully.\n\nThe Domapic Controller Web User interface will be available at that url. If you are loading the web interface from localhost, login is not necessary because authentication is disabled by default for the 172.0.0.1 IP. If not, use the \"admin\" user with \"admin\" password. Remember to add your own administrator user and delete the default one.\n\n![Swagger example][domapic-controller-ui-example-image]\n\n\u003e Note that, with basic options, server will be started over `http` protocol, and security will be disabled for localhost requests. Read about all [options](#options) and [security](#security) to start the controller with stricter security options.\n\n### Display logs\n\n```bash\ndomapic-controller logs\n```\n\nThis command will display last logs of server, and will continue displaying logs until CTRL-C is pressed.\n\nServer logs are saved too into a daily file. These files are rotated automatically and only last ten days files are kept. You´ll find these files in the `~/.domapic/domapic-controller/logs` folder.\n\nServer logs are managed by [PM2][pm2-url] too, so, it is recommended to install [_PM2 log rotate_][pm2-log-rotate-url] to avoid pm2 logs file growing too much.\n\n### Get API Key to connect Domapic Services\n\nChecking the server log you´ll find something like:\n\n```text\n2018-09-29 19:35:55.042: [controller] [info] Connected to database \"mongodb://localhost:27017/domapic\"\n2018-09-29 19:35:56.855: [controller] [info] \n-----------------------------------------------------------------\nUse the next api key to register services: 6hka5b0jnT9HOMJjUNquqOLneFGxYYtfOygguKoACUIviRvTJLV4IzglcybePQLB\n-----------------------------------------------------------------\n2018-09-29 19:35:56.885: [controller] [info] Server started and listening at port 3000\n```\n\nCopy the provided api key and place it in a safe place, and use it later when starting your Domapic Services (plugins or modules), in order to allow them to automatically register themself into the controller and connect with it.\n\n### Stop and restart\n\n```bash\ndomapic-controller stop\n```\n\nThis command will stop the server, and, if you used the `--save` option when you started it for first time, you´ll be able to start it again with same settings simply executing:\n\n```bash\ndomapic-controller start\n```\n\nIf you want your server to be started automatically on system reload, use the `pm2 startup` and `pm2 save` commands:\n\n```bash\npm2 startup\npm2 save\n```\n\n## Options\n\n### Help\n\nUse the next command to display help with detailed information about all available commands and options:\n\n```shell\n# Display all available commands:\ndomapic-controller --help\n\n# Display all options for an specific command (domapic-controller [command] --help):\ndomapic-controller start --help\n\n```\n\n### Start command options:\n\noption | description | default\n--- | --- | ---\n`--name` | Custom service instance name. Name can be defined too as first argument. Default is \"domapic-controller\" | -\n`--db` | MongoDB connection uri | mongodb://localhost:27017/domapic\n`--port` | Http port used | 3000\n`--hostName` | Hostname for the server | -\n`--sslCert` | Path to an ssl certificate | -\n`--sslKey` | Path to an ssl key | - \n`--authDisabled` | Array of IPs or CIDR IP ranges with authentication disabled | ['127.0.0.1', '::1/128']\n`--auth` | If false, authentication will be disabled for all origins | true\n`--secret` | Secret to be used in authentication encoding | -\n`--color` | Use ANSI colors in traces | true\n`--logLevel` | Tracing level. Choices are 'log', 'trace', 'debug', 'info', 'warn' and 'error' | info\n`--path` | Path to be used as home path, instead of user´s default (.domapic folder will be created inside) | ~\n`--saveConfig` | Save current options for next execution (except `name` and `path`) | false\n`--rejectUntrusted` | Reject untrusted ssl certificates when making requests to modules or plugins | false\n\nExample of setting options from command line:\n```shell\ndomapic-controller start --name=fooName --authDisabled=192.168.1.128/25 --logLevel=debug --color=false\n```\n\n## Security\n\nThe Domapic Controller can be securized in order to expose it from local network to internet, and act as a remote controller for all your local network Domapic Services.\n\nFollow the next steps to securize your Controller before exposing it to the internet:\n\n* __Setup an administrator user:__\n\t\n\t\u003e The Controller is distributed with a default administrator user, which name is \"admin\", and password is \"admin\". Delete it and setup your own administrator user.\n\n\tYou can use both the web user interface or the command line interface in order to remove the user:\n\n\t```\n\tdomapic-controller user remove admin\n\t```\n\n\t```\n\tdomapic-controller user add\n\t```\n\n\tYou will be prompted for user name, role, email and password. Using your real email will allow you to use OAuth to login at Domapic Cloud and access to your controller through it.\n\n* __Enable ssl:__\n\t\n\tEnable ssl for your Controller Server generating an SSL certificate. Use options `--sslCert` and `--sslKey` to define the paths to each file, and remember to use the `--save` option to store that settings for next server restarts. From now, your server will start using *https* instead of *http*.\n\n* __Provide a custom secret for JWT authentication:__\n\t\n\tDomapic controller provides two methods of authentication, jwt and api keys. The first one will be used by allowed human users to access to the provided web user interface (still in development). Provide a custom secret using the `--secret` option to make this method securer. Remember to use the `--save` option to store the secret for next restarts.\n\n* __Disable the authentication whitelist:__\n\t\n\tAuthentication can be disabled for desired IPs or IP ranges using the `--authDisabled` option, or for all origins using the `--auth=false` option. By default, authentication is disabled only for the 172.0.0.1 IP in order to make easier the first configuration, but you can disable it for your whole your local network, etc. *Because of security reasons, this is not recommended*, take into account that users accessing to the controller with authentication disabled will have equivalent permissions to an user with \"admin\" role. Use always the built-in api keys method to identify your Domapic Services.\n\tIf you want to force the authentication requirement even for localhost, use the `--authDisabled` as a flag, without specifying any IP.\n\n[domapic-logo-image]: http://domapic.com/assets/domapic-logo.png\n[domapic-example-image]: http://domapic.com/assets/domapic-schema-example_01.png\n[domapic-controller-ui-example-image]: http://domapic.com/assets/domapic-controller-ui-screenshots.jpg\n\n[coveralls-image]: https://coveralls.io/repos/github/domapic/domapic-controller/badge.svg\n[coveralls-url]: https://coveralls.io/github/domapic/domapic-controller\n[travisci-image]: https://travis-ci.com/domapic/domapic-controller.svg?branch=master\n[travisci-url]: https://travis-ci.com/domapic/domapic-controller\n[last-commit-image]: https://img.shields.io/github/last-commit/domapic/domapic-controller.svg\n[last-commit-url]: https://github.com/domapic/domapic-controller/commits\n[license-image]: https://img.shields.io/npm/l/domapic-controller.svg\n[license-url]: https://github.com/domapic/domapic-controller/blob/master/LICENSE\n[npm-downloads-image]: https://img.shields.io/npm/dm/domapic-controller.svg\n[npm-downloads-url]: https://www.npmjs.com/package/domapic-controller\n[npm-dependencies-image]: https://img.shields.io/david/domapic/domapic-controller.svg\n[npm-dependencies-url]: https://david-dm.org/domapic/domapic-controller\n[quality-gate-image]: https://sonarcloud.io/api/project_badges/measure?project=domapic-controller\u0026metric=alert_status\n[quality-gate-url]: https://sonarcloud.io/dashboard?id=domapic-controller\n[release-image]: https://img.shields.io/github/release-date/domapic/domapic-controller.svg\n[release-url]: https://github.com/domapic/domapic-controller/releases\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[standard-url]: http://standardjs.com/\n\n[website-image]: https://img.shields.io/website-up-down-green-red/http/domapic.com.svg?label=domapic.com\n[website-url]: http://domapic.com/\n\n[pm2-log-rotate-url]: https://github.com/keymetrics/pm2-logrotate\n[pm2-url]: http://pm2.keymetrics.io/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomapic%2Fdomapic-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomapic%2Fdomapic-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomapic%2Fdomapic-controller/lists"}