Skip to content

Commit

Permalink
Merge pull request #109 from hcengineering/huly-v377-update
Browse files Browse the repository at this point in the history
  • Loading branch information
haiodo authored Dec 9, 2024
2 parents aeb970c + ef1eda1 commit 73c315e
Show file tree
Hide file tree
Showing 20 changed files with 335 additions and 129 deletions.
10 changes: 10 additions & 0 deletions .huly.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,14 @@ server {
rewrite ^/_rekoni(/.*)$ $1 break;
proxy_pass http://rekoni:4004/;
}

location /_stats {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

rewrite ^/_stats(/.*)$ $1 break;
proxy_pass http://stats:4900/;
}
}
2 changes: 1 addition & 1 deletion .template.huly.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HULY_VERSION=v0.6.295
HULY_VERSION=v0.6.377
DOCKER_NAME=huly

# The address of the host or server from which you will access your Huly instance.
Expand Down
66 changes: 66 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Huly Migration

## v0.6.377

### Fulltext Service

Fulltext search functionality has been extracted into a separate `fulltext` service. This service is now required to be running in order to use the fulltext search functionality.

Configuration:

```yaml
fulltext:
image: hardcoreeng/fulltext:${HULY_VERSION}
ports:
- 4700:4700
environment:
- SERVER_SECRET=${HULY_SECRET}
- DB_URL=mongodb://mongodb:27017
- FULLTEXT_DB_URL=http://elastic:9200
- ELASTIC_INDEX_NAME=huly_storage_index
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- REKONI_URL=http://rekoni:4004
- ACCOUNTS_URL=http://account:3000
- STATS_URL=http://stats:4900
restart: unless-stopped
```
Update the `transactor` service to use the new `fulltext` service:

```yaml
transactor:
...
environment:
...
- FULLTEXT_URL=http://fulltext:4700
# Remove the following lines
# - ELASTIC_URL=http://elastic:9200
# - ELASTIC_INDEX_NAME=huly_storage_index
# - REKONI_URL=http://rekoni:4004
```

### Statistics Service

New statistics service has been added. The serivce is responsible for collecting and storing statistics about the usage of the application.

Configuration:

```yaml
stats:
image: hardcoreeng/stats:${HULY_VERSION}
ports:
- 4900:4900
environment:
- PORT=4900
- SERVER_SECRET=${HULY_SECRET}
restart: unless-stopped
```

Other Huly services have been updated to use the new statistics service:

```yaml
...
environment:
- STATS_URL=http://stats:4900
...
```
40 changes: 27 additions & 13 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: ${DOCKER_NAME}
version: "3"
services:
nginx:
image: "nginx:1.21.3"
Expand Down Expand Up @@ -60,18 +61,14 @@ services:
- SERVER_PORT=3333
- SERVER_SECRET=${SECRET}
- SERVER_CURSOR_MAXTIMEMS=30000
- ELASTIC_URL=http://elastic:9200
- ELASTIC_INDEX_NAME=huly_storage_index
- DB_URL=mongodb://mongodb:27017
- MONGO_URL=mongodb://mongodb:27017
- METRICS_CONSOLE=false
- METRICS_FILE=metrics.txt
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- REKONI_URL=http://rekoni:4004
- FRONT_URL=http://localhost:8087
- ACCOUNTS_URL=http://account:3000
- FULLTEXT_URL=http://fulltext:4700
- STATS_URL=http://stats:4900
- LAST_NAME_FIRST=${LAST_NAME_FIRST:-true}
- UPLOAD_URL=http${SECURE:+s}://${HOST_ADDRESS}/files
restart: unless-stopped

collaborator:
Expand All @@ -81,7 +78,7 @@ services:
- SECRET=${SECRET}
- ACCOUNTS_URL=http://account:3000
- DB_URL=mongodb://mongodb:27017
- MONGO_URL=mongodb://mongodb:27017
- STATS_URL=http://stats:4900
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
restart: unless-stopped

Expand All @@ -95,6 +92,7 @@ services:
- TRANSACTOR_URL=ws://transactor:3333;ws${SECURE:+s}://${HOST_ADDRESS}/_transactor
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- FRONT_URL=http://front:8080
- STATS_URL=http://stats:4900
- MODEL_ENABLED=*
- ACCOUNTS_URL=http://localhost:3000
- ACCOUNT_PORT=3000
Expand All @@ -110,14 +108,9 @@ services:
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- MODEL_ENABLED=*
- ACCOUNTS_URL=http://account:3000
- NOTIFY_INBOX_ONLY=true
- STATS_URL=http://stats:4900
restart: unless-stopped

# THIS REQUIRES MANUAL SETUP
# https://docs.livekit.io/home/self-hosting/vm/
#love:
# image: hardcoreeng/love:${HULY_VERSION}
# restart: unless-stopped
front:
image: hardcoreeng/front:${HULY_VERSION}
environment:
Expand All @@ -129,6 +122,7 @@ services:
- CALENDAR_URL=http${SECURE:+s}://${HOST_ADDRESS}/_calendar
- GMAIL_URL=http${SECURE:+s}://${HOST_ADDRESS}/_gmail
- TELEGRAM_URL=http${SECURE:+s}://${HOST_ADDRESS}/_telegram
- STATS_URL=http${SECURE:+s}://${HOST_ADDRESS}/_stats
- UPLOAD_URL=/files
- ELASTIC_URL=http://elastic:9200
- COLLABORATOR_URL=ws${SECURE:+s}://${HOST_ADDRESS}/_collaborator
Expand All @@ -138,8 +132,28 @@ services:
- TITLE=${TITLE:-Huly Self Host}
- DEFAULT_LANGUAGE=${DEFAULT_LANGUAGE:-en}
- LAST_NAME_FIRST=${LAST_NAME_FIRST:-true}
- DESKTOP_UPDATES_CHANNEL=selfhost
restart: unless-stopped

fulltext:
image: hardcoreeng/fulltext:${HULY_VERSION}
environment:
- SERVER_SECRET=${SECRET}
- DB_URL=mongodb://mongodb:27017
- FULLTEXT_DB_URL=http://elastic:9200
- ELASTIC_INDEX_NAME=huly_storage_index
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- REKONI_URL=http://rekoni:4004
- ACCOUNTS_URL=http://account:3000
- STATS_URL=http://stats:4900
restart: unless-stopped

stats:
image: hardcoreeng/stats:${HULY_VERSION}
environment:
- PORT=4900
- SERVER_SECRET=${SECRET}
restart: unless-stopped
volumes:
db:
elastic:
Expand Down
20 changes: 5 additions & 15 deletions kube/account/account-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,13 @@ spec:
configMapKeyRef:
name: huly-config
key: FRONT_URL
- name: MINIO_ACCESS_KEY
- name: STATS_URL
value: http://stats
- name: STORAGE_CONFIG
valueFrom:
secretKeyRef:
name: huly-secret
key: MINIO_ACCESS_KEY
- name: MINIO_ENDPOINT
valueFrom:
configMapKeyRef:
name: huly-config
key: MINIO_ENDPOINT
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: huly-secret
key: MINIO_SECRET_KEY
key: STORAGE_CONFIG
- name: MODEL_ENABLED
value: '*'
- name: DB_URL
Expand All @@ -56,13 +48,11 @@ spec:
name: huly-secret
key: SERVER_SECRET
- name: TRANSACTOR_URL
value: ws://transactor:3333;ws://localhost:3333
- name: ENDPOINT_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: TRANSACTOR_URL
image: hardcoreeng/account:latest
image: hardcoreeng/account:v0.6.377
name: account
ports:
- containerPort: 3000
Expand Down
23 changes: 5 additions & 18 deletions kube/collaborator/collaborator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,21 @@ spec:
- env:
- name: ACCOUNTS_URL
value: http://account
- name: STATS_URL
value: http://stats
- name: COLLABORATOR_PORT
value: "3078"
- name: MINIO_ACCESS_KEY
- name: STORAGE_CONFIG
valueFrom:
secretKeyRef:
name: huly-secret
key: MINIO_ACCESS_KEY
- name: MINIO_ENDPOINT
valueFrom:
configMapKeyRef:
name: huly-config
key: MINIO_ENDPOINT
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
name: huly-secret
key: MINIO_SECRET_KEY
- name: MONGO_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: MONGO_URL
key: STORAGE_CONFIG
- name: SECRET
valueFrom:
secretKeyRef:
name: huly-secret
key: SERVER_SECRET
image: hardcoreeng/collaborator:latest
image: hardcoreeng/collaborator:v0.6.377
name: collaborator
ports:
- containerPort: 3078
Expand Down
6 changes: 3 additions & 3 deletions kube/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
data:
ACCOUNTS_URL: 'http://account.huly.example/'
COLLABORATOR_URL: 'ws://collaborator.huly.example/'
COLLABORATOR_API_URL: 'http://collaborator.huly.example/'
FRONT_URL: 'http://huly.example'
REKONI_URL: 'http://rekoni.huly.example/'
TRANSACTOR_URL: 'ws://transactor.huly.example/'
STATS_URL: 'http://stats.huly.example/'
TRANSACTOR_URL: 'ws://transactor;ws://transactor.huly.example/'
MINIO_ENDPOINT: 'minio'
MONGO_URL: 'mongodb://mongodb:27017'
ELASTIC_URL: 'http://elastic:9200/'
ELASTIC_URL: 'http://elastic:9200'
ELASTIC_INDEX_NAME: 'huly_storage_index'
3 changes: 1 addition & 2 deletions kube/config/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ metadata:
name: huly-secret
type: Opaque
stringData:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
SERVER_SECRET: secret
STORAGE_CONFIG: minio|minio?accessKey=minioadmin&secretKey=minioadmin
25 changes: 7 additions & 18 deletions kube/front/front-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ spec:
key: ACCOUNTS_URL
- name: CALENDAR_URL
value: http://calendar
- name: COLLABORATOR_API_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: COLLABORATOR_API_URL
- name: COLLABORATOR_URL
valueFrom:
configMapKeyRef:
Expand All @@ -42,21 +37,11 @@ spec:
key: ELASTIC_URL
- name: GMAIL_URL
value: http://gmail:8088
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
name: huly-secret
key: MINIO_ACCESS_KEY
- name: MINIO_ENDPOINT
valueFrom:
configMapKeyRef:
name: huly-config
key: MINIO_ENDPOINT
- name: MINIO_SECRET_KEY
- name: STORAGE_CONFIG
valueFrom:
secretKeyRef:
name: huly-secret
key: MINIO_SECRET_KEY
key: STORAGE_CONFIG
- name: MONGO_URL
valueFrom:
configMapKeyRef:
Expand All @@ -80,7 +65,11 @@ spec:
value: Huly Self Hosted
- name: UPLOAD_URL
value: /files
image: hardcoreeng/front:latest
- name: STATS_URL
value: http://stats
- name: DESKTOP_UPDATES_CHANNEL
value: selfhost
image: hardcoreeng/front:v0.6.377
name: front
ports:
- containerPort: 8080
Expand Down
59 changes: 59 additions & 0 deletions kube/fulltext/fulltext-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: fulltext
name: fulltext
spec:
replicas: 1
selector:
matchLabels:
app: fulltext
template:
metadata:
labels:
app: fulltext
spec:
containers:
- env:
- name: SERVER_SECRET
valueFrom:
secretKeyRef:
name: huly-secret
key: SERVER_SECRET
- name: DB_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: MONGO_URL
- name: FULLTEXT_DB_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: ELASTIC_URL
- name: ELASTIC_INDEX_NAME
valueFrom:
configMapKeyRef:
name: huly-config
key: ELASTIC_INDEX_NAME
- name: STORAGE_CONFIG
valueFrom:
secretKeyRef:
name: huly-secret
key: STORAGE_CONFIG
- name: REKONI_URL
value: http://rekoni
- name: ACCOUNTS_URL
value: http://account
- name: STATS_URL
value: http://stats
image: hardcoreeng/fulltext:v0.6.377
name: fulltext
ports:
- containerPort: 4700
hostPort: 4700
protocol: TCP
resources:
limits:
memory: "512M"
restartPolicy: Always
Loading

0 comments on commit 73c315e

Please sign in to comment.