Skip to content

Commit

Permalink
Add separate docker-compose.yml for Microft-Core (client)
Browse files Browse the repository at this point in the history
Client is not integrated into main compose file to be able to start server and client separately.
  • Loading branch information
starze committed Jul 17, 2020
1 parent c129836 commit 694ee75
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 6 deletions.
55 changes: 49 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Heavily based on the original repo by Dimitris Karakasilis (jimmykarily) at http

## Goal

Deploy an offline home assistant server as easely as possible.
Deploy an offline home assistant server as easily as possible.

## Why

Expand All @@ -21,22 +21,65 @@ The project that is closer to the desired result is Mycroft (https://mycroft.ai/
- Internet connection to download docker images and dependencies
- A good CPU, STT AND TTS are very CPU intensive. (Using a (nvidia/CUDA ?) GPU would speed up the process a lot but I don't know if it works with this setup yet.)

## Getting started
## Prepare configuration

Edit and complete :
Edit and complete:

- config.env
- config_external_accounts.env
- .env
- `config.env`
- `config_external_accounts.env`
- `.env`

The .env file is only used to build the images, but the variable it contains must have the same value as the one in `config.env`.

To generate all needed passwords in `./generated` you can run:
```sh
./setup.sh (only needed once)
```


If you do not have a valid domain you can use a fake one like `asdf.asdf` as `MICROFT_DOMAIN`.

Then you should edit your `/etc/hosts` to something like that:
```
127.0.0.1 sso.asdf.asdf
127.0.0.1 account.asdf.asdf
127.0.0.1 api.asdf.asdf
127.0.0.1 market.asdf.asdf
127.0.0.1 home.asdf.asdf
127.0.0.1 asdf.asdf
```

## Start Mycroft-Backend

```sh
docker-compose up -d
```
And everything is ready to go. The setup phase can take a while.

Now you should be able to access your very own Selene Backend (i.e. browse to `https://home.asdf.asdf`)


## Start Mycroft-Core (client)

```sh
cd ./client
docker-compose up -d
```

The host-connections of `./client/storage/mycroft.conf` are linked to the backend docker containers. If you want to start the client on a different machine you need to adjust these ones and the network link in `./client/docker-compose.yml`.

## Register Device and enjoy your personal assistant

During first startup, Mycroft-Core should tell you a pairing code. Browse to `https://home.asdf.asdf` and register your client.

After the registration you should be able to talk to Mycroft and even access Backend-APIs like WolframAlpha (if you registered a valid API-Key).


## Security hint

The reverse proxy of Microft-Backend currently uses a self-signed certificate so we needed to disable client side SSL-Verification. If you are using a reverse proxy delivering a valid certificate we strongly recommend you to re-enable SSL-Verification.

To enable SSL-Verification you simply need to remove the entire `entrypoint` section in `./client/docker-compose.yml` and rebuild the container.

## Development

Expand Down
27 changes: 27 additions & 0 deletions client/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'
services:
mycroft:
image: mycroftai/docker-mycroft
restart: "on-failure"
volumes:
- ./storage:/root/.mycroft
- ${XDG_RUNTIME_DIR}/pulse/:${XDG_RUNTIME_DIR}/pulse/
- ${HOME}/.config/pulse/:/root/.config/pulse/
environment:
PULSE_SERVER: "unix:${XDG_RUNTIME_DIR}/pulse/native"
ports:
- "8181:8181"
devices:
- "/dev/snd:/dev/snd"
entrypoint:
- bash
- -c
# Deactivate ssl verification to communicate with servers having a self signed certificate
- "sed -i 's/data=data, json=json_body, timeout=(3.05, 15)/data=data, json=json_body, timeout=(3.05, 15), verify=False/' /opt/mycroft/mycroft/api/__init__.py &&
/opt/mycroft/startup.sh
"

networks:
default:
external:
name: mycroft_offline_web
15 changes: 15 additions & 0 deletions client/storage/mycroft.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"max_allowed_core_version": 20.2,
"server": {
"url": "https://selene-ui-proxy",
"version": "v1",
"update": true,
"metrics": false
},
"stt": {
"module": "deepspeech_server",
"deepspeech_server": {
"uri": "http://deepspeech:8080/stt"
}
}
}

0 comments on commit 694ee75

Please sign in to comment.