README.md 3.06 KB
Newer Older
1
# Telemersive Router
bruggisser florian - fbruggis's avatar
bruggisser florian - fbruggis committed
2

3
4
5
*Telemersive Router* contains the telemersive-broker and the telemersive-manager.

The third component of the *Telemersive Router*, the telemersive-switchboard, is maintained in a different [repo](https://gitlab.zhdk.ch/telemersion/telemersive-switchboard).
6
7

## Installation
8
9
10
11

Install first the [telemersive-switchboard](https://gitlab.zhdk.ch/telemersion/telemersive-switchboard).

To install the *Telemersive Router* on an instance clone the github repository into the installation directory (for example `/opt/telemersive-router`).
12
13

```
14
git clone https://gitlab.zhdk.ch/telemersion/telemersive-router
15
16
```

Florian Bruggisser's avatar
Florian Bruggisser committed
17
Important for the installation is that first the broker is installed and second the manager.
18
19

### Broker
20
21
22
23
24
25

To install the mosquitto broker as a service (Debian with systemd) use the following command:

```bash
sudo ./broker-service-install.sh
```
26
27
28
29
30
31
32
33
34
35
### Manager

Installs the manager together with NPM if it is not installed already.

```bash
sudo ./manager-service-install.sh
```

## Configuration

maybites's avatar
maybites committed
36
### Change Credentials
37

maybites's avatar
maybites committed
38
#### Broker
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

```bash
cd broker
```

Edit the `users.pwd`:

```
manager:password
peer:password
```

To encryp the passwords, run the following script:

```bash
./encrypt-userlist.sh
```

maybites's avatar
maybites committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#### Manager

```bash
cd manager
```

Copy `access.js.template` to `access.js` and adjust credentials:

```
module.exports.broker_url = 'telemersive.zhdk.ch';
module.exports.broker_port = 3883;
module.exports.switch_port = 3591;
module.exports.user = 'manager';
module.exports.pwd = 'manager';
```

73
74
75
76
77
78
79
80
81
## Update

To update please first stop the service to not break the running service and later start it again.

### Manager

To update to a newer version change to the manager directory and update the npm project:

```bash
Florian Bruggisser's avatar
Florian Bruggisser committed
82
git pull
83
84
85
cd manager
npm install
```
86
87
88

## Usage

89
### Broker
90
91
92
93
94
95
96
97
98
99
100

To test the mosquitto broker it is possible to run it without service installation:

```bash
./broker-run.sh
```

#### Service

```bash
# start service
101
sudo systemctl start telemersive-broker.service
102

maybites's avatar
maybites committed
103
# stop service
104
sudo systemctl stop telemersive-broker.service
105
106

# restart service
107
sudo systemctl restart telemersive-broker.service
108
109

# enable service (auto-start on restart)
110
sudo systemctl enable telemersive-broker.service
111
112

# disbale service
113
sudo systemctl disable telemersive-broker.service
114
115

# show status
116
sudo systemctl status telemersive-broker.service
117
118
119
```

### Manager
120
121
122
123
124
125
126
127
128
129
130
131
132

To run the manager without the service use the following script:

```bash
./manager-run.sh
```

#### Service

```bash
# start service
sudo systemctl start telemersive-manager.service

maybites's avatar
maybites committed
133
# stop service
134
135
136
137
138
139
140
141
142
143
144
145
146
147
sudo systemctl stop telemersive-manager.service

# restart service
sudo systemctl restart telemersive-manager.service

# enable service (auto-start on restart)
sudo systemctl enable telemersive-manager.service

# disbale service
sudo systemctl disable telemersive-manager.service

# show status
sudo systemctl status telemersive-manager.service
```
148
149
150

## Uninstall

151
### Broker
152
153
154

```bash
sudo ./broker-service-uninstall.sh
155
156
157
158
159
160
161
162
163
164
165
```

### Manager

```bash
sudo ./manager-service-uninstall.sh.sh
```

## Credits

- Florian Bruggisser
maybites's avatar
maybites committed
166
- Martin Fröhlich