SELFH-182: v7 support (#192)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev
2025-08-28 21:16:17 +07:00
committed by GitHub
parent 56bd65075c
commit 006762fc66
33 changed files with 566 additions and 138 deletions
+1 -1
View File
@@ -1 +1 @@
huly.conf
huly_v7.conf
+5 -2
View File
@@ -63,15 +63,18 @@ jobs:
run: |
echo 127.0.0.1 huly.example | sudo tee -a /etc/hosts
echo 127.0.0.1 account.huly.example | sudo tee -a /etc/hosts
echo 127.0.0.1 transactor.huly.example | sudo tee -a /etc/hosts
echo 127.0.0.1 collaborator.huly.example | sudo tee -a /etc/hosts
echo 127.0.0.1 datalake.huly.example | sudo tee -a /etc/hosts
kubectl apply -R -f .
kubectl wait --for=condition=Available deployment/mongodb --timeout 3m
kubectl wait --for=condition=Available deployment/cockroachdb-single-node --timeout 3m
kubectl wait --for=condition=Available deployment/transactor --timeout 3m
kubectl delete pod -l app=account
kubectl wait --for=condition=Available deployment/account --timeout 3m
- name: "Check login"
run: |
token=$(curl -v -H 'Content-Type: application/json' \
-d '{"method":"createAccount","params":["user1","1234","user","1"]}' \
-d '{"method": "signUp","params": {"email": "user3","password": "1234","firstName": "Test","lastName": "User"}}' \
-X POST \
http://account.huly.example/ | jq -r '.result.token')
+3
View File
@@ -3,5 +3,8 @@ traefik/docker-compose.yaml
nginx.conf
nginx.conf.bak
huly.conf
huly_v7.conf
.huly.secret
.cr.secret
.rp.secret
.idea
+10
View File
@@ -91,4 +91,14 @@ server {
rewrite ^/_stats(/.*)$ $1 break;
proxy_pass http://stats:4900/;
}
location /_datalake {
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 ^/_datalake(/.*)$ $1 break;
proxy_pass http://datalake:4030/;
}
}
+15 -3
View File
@@ -1,5 +1,5 @@
HULY_VERSION=v0.6.502
DOCKER_NAME=huly
HULY_VERSION=s0.7.204
DOCKER_NAME=huly_v7
# The address of the host or server from which you will access your Huly instance.
# This can be a domain name (e.g., huly.example.com) or an IP address (e.g., 192.168.1.1).
@@ -19,11 +19,23 @@ TITLE=${TITLE}
DEFAULT_LANGUAGE=${DEFAULT_LANGUAGE}
LAST_NAME_FIRST=${LAST_NAME_FIRST}
# CockroachDB variables
CR_DATABASE=${CR_DATABASE}
CR_USERNAME=${CR_USERNAME}
CR_USER_PASSWORD=${COCKROACH_SECRET}
CR_DB_URL=postgres://${CR_USERNAME}:${COCKROACH_SECRET}@cockroach:26257/${CR_DATABASE}
# Redpanda variables
REDPANDA_ADMIN_USER=${REDPANDA_ADMIN_USER}
REDPANDA_ADMIN_PWD=${REDPANDA_SECRET}
# Docker volume paths - specify custom paths for persistent data storage
# Leave empty to use default Docker named volumes
VOLUME_DB_PATH=${VOLUME_DB_PATH}
VOLUME_ELASTIC_PATH=${VOLUME_ELASTIC_PATH}
VOLUME_FILES_PATH=${VOLUME_FILES_PATH}
VOLUME_CR_DATA_PATH=${VOLUME_CR_DATA_PATH}
VOLUME_CR_CERTS_PATH=${VOLUME_CR_CERTS_PATH}
VOLUME_REDPANDA_PATH=${VOLUME_REDPANDA_PATH}
# The following configs are auto-generated by the setup script.
# Please do not manually overwrite.
+33 -2
View File
@@ -3,14 +3,21 @@
This document describes the changes required to update Huly from one version to another. Most of updates require updating Docker containers versions.
Though, some updates may require updating other configuration options. In this case, you should review the updated configuration options and update them accordingly.
## v7 preparation
# v7
## v0.7.204
> [!CAUTION]
> Do not upgrade directly from v6 to v7. Direct upgrades will lock your deployment with MongoDB-specific data, making the future migration significantly more complex. Follow the migration instructions below instead.
> [!WARNING]
> Use of MongoDB has been deprecated in v7 in favor of CockroachDB and will be completely removed in v8.
Migration to v7 involves backing up your v6 deployment data and restoring it to a fresh v7 installation with CockroachDB.
To make a full backup of your v6 deployment run the following command adjusting the variables to the actual values of your deployment in case they differ from the ones in the sample deployment.
Migration Steps (command examples shown for Docker on macOS):
1. Make a full backup of your v6 deployment. Run the following command on **v6** tag of the `huly-selfhost` repository adjusting the variables to the actual values of your deployment in case they differ from the ones in the sample deployment.
```
source .env && docker run \
@@ -31,6 +38,30 @@ To make a full backup of your v6 deployment run the following command adjusting
> [!NOTE]
> This command will write the necessary backup files to the mounted volume. Make sure this volume will be available to your new v7 deployment to restore the data from it. Consider using an absolute path instead of "./backup-all".
2. Set up a fresh v7 deployment by following the standard [deployment instructions](https://github.com/hcengineering/huly-selfhost/blob/main/README.md).
3. Restore the data from the backup created in step 1. Make sure the deployment is new and doesn't contain any data as it might result in conflicts during the restore procedure. Run the following command on the main branch of the `huly-selfhost` repository adjusting variables to the actual values of your deployment in case they differ from the ones in the sample deployment. Make sure that the mounted volume is referencing the same path as was used in the backup command.
```
source .env && docker run \
--network "${DOCKER_NAME}_default" \
-e SERVER_SECRET="$SECRET" \
-e TRANSACTOR_URL="ws://transactor:3333" \
-e STORAGE_CONFIG="datalake|http://datalake:4030" \
-e ACCOUNT_DB_URL="${CR_DB_URL}" \
-e ACCOUNTS_URL="http://account:3000" \
-e DB_URL="${CR_DB_URL}" \
-e QUEUE_CONFIG="redpanda:9092" \
-v ./backup-all:/backup \
-it hardcoreeng/tool:s0.7.213 \
-- bundle.js restore-from-v6-all /backup
```
> [!TIP]
> This procedure doesn't affect the data in the v6 deployment and can be repeated as many times as needed.
# v6
## v0.6.502
<details>
+26 -7
View File
@@ -35,7 +35,7 @@ cd huly-selfhost
./setup.sh
```
This will generate a [huly.conf](./huly.conf) file with your chosen values and create your nginx config.
This will generate a [huly_v7.conf](./huly_v7.conf) file with your chosen values and create your nginx config.
To add the generated configuration to your Nginx setup, run the following:
@@ -61,6 +61,9 @@ sudo docker compose up -d
Now, launch your web browser and enjoy Huly!
> [!IMPORTANT]
> Provided configrations include deployments of CockroachDB and Redpanda which might not be production-ready. Please inspect them carefully before using in production. For more information on the recommended deployment configurations, please refer to the [CockroachDB](https://www.cockroachlabs.com/docs/stable/recommended-production-settings) and [Redpanda](https://docs.redpanda.com/24.3/deploy/) documentation.
## Volume Configuration
By default, Huly uses Docker named volumes to store persistent data (database, Elasticsearch indices, and uploaded files). You can optionally configure custom host paths for these volumes during the setup process.
@@ -69,9 +72,11 @@ By default, Huly uses Docker named volumes to store persistent data (database, E
When running `./setup.sh`, you'll be prompted to specify custom paths for:
- **Database volume**: MongoDB data storage
- **Elasticsearch volume**: Search index data storage
- **Files volume**: User-uploaded files and attachments
- **CockroachDB data volume**: Data storage for workspaces and accounts
- **CockroachDB certs volume**: Certificates for CockroachDB
- **Redpanda data volume**: Data storage for Kafka
You can either:
- Press Enter to use the default Docker named volumes
@@ -88,22 +93,26 @@ To quickly reset all volumes back to default Docker named volumes without prompt
### Manual Configuration
You can also manually configure volume paths by editing the `huly.conf` file:
You can also manually configure volume paths by editing the `huly_v7.conf` file:
```bash
# Docker volume paths - specify custom paths for persistent data storage
# Leave empty to use default Docker named volumes
VOLUME_DB_PATH=/path/to/database
VOLUME_ELASTIC_PATH=/path/to/elasticsearch
VOLUME_FILES_PATH=/path/to/files
VOLUME_CR_DATA_PATH=/path/to/cockroachdb/data
VOLUME_CR_CERTS_PATH=/path/to/cockroachdb/certs
VOLUME_REDPANDA_PATH=/path/to/redpanda/data
```
To revert to default volumes, simply leave the paths empty:
```bash
VOLUME_DB_PATH=
VOLUME_ELASTIC_PATH=
VOLUME_FILES_PATH=
VOLUME_CR_DATA_PATH=
VOLUME_CR_CERTS_PATH=
VOLUME_REDPANDA_PATH=
```
After modifying the configuration, restart the services:
@@ -116,6 +125,16 @@ docker compose up -d
> [!WARNING]
> When changing from named volumes to host paths (or vice versa), make sure to migrate your data appropriately to avoid data loss.
## Redpanda Configuration
When using a production deployment of Redpanda with topics auto-creation turned off, you'll need to manually create the following topics:
- fulltext
- process
- tx
- users
- workspace
## Generating Public and Private VAPID keys for front-end
You'll need `Node.js` installed on your machine. Installing `npm` on Debian based distro:
@@ -321,7 +340,7 @@ self-hosted Huly, perform the following steps:
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- SECRET=secret
- ACCOUNTS_URL=http://account:3000
- DB_URL=mongodb://mongodb:27017
- DB_URL=${CR_DB_URL}
- MONGO_URL=mongodb://mongodb:27017
- STORAGE_PROVIDER_NAME=minio
- PORT=8096
@@ -362,7 +381,7 @@ Huly provides AI-powered chatbot that provides several services:
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- SERVER_SECRET=secret
- ACCOUNTS_URL=http://account:3000
- DB_URL=mongodb://mongodb:27017
- DB_URL=${CR_DB_URL}
- MONGO_URL=mongodb://mongodb:27017
- STATS_URL=http://stats:4900
- FIRST_NAME=Bot
+83 -26
View File
@@ -8,20 +8,54 @@ services:
- ./.huly.nginx:/etc/nginx/conf.d/default.conf
restart: unless-stopped
mongodb:
image: "mongo:7-jammy"
cockroach:
image: cockroachdb/cockroach:latest-v24.2
command: start-single-node --accept-sql-without-tls
environment:
- PUID=1000
- PGID=1000
- COCKROACH_DATABASE=${CR_DATABASE}
- COCKROACH_USER=${CR_USERNAME}
- COCKROACH_PASSWORD=${CR_USER_PASSWORD}
volumes:
- ${VOLUME_DB_PATH:-db}:/data/db
- ${VOLUME_CR_DATA_PATH:-cr_data}:/cockroach/cockroach-data
- ${VOLUME_CR_CERTS_PATH:-cr_certs}:/cockroach/certs
restart: unless-stopped
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:v24.3.6
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
- --advertise-kafka-addr internal://redpanda:9092,external://localhost:19092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
- --advertise-pandaproxy-addr internal://redpanda:8082,external://localhost:18082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
- --rpc-addr redpanda:33145
- --advertise-rpc-addr redpanda:33145
- --mode dev-container
- --smp 1
- --default-log-level=info
container_name: redpanda
volumes:
- ${VOLUME_REDPANDA_PATH:-redpanda}:/var/lib/redpanda/data
environment:
- REDPANDA_SUPERUSER_USERNAME=${REDPANDA_ADMIN_USER}
- REDPANDA_SUPERUSER_PASSWORD=${REDPANDA_ADMIN_PWD}
healthcheck:
test: ['CMD', 'rpk', 'cluster', 'info', '-X', 'user=${REDPANDA_ADMIN_USER}', '-X', 'pass=${REDPANDA_ADMIN_PWD}']
interval: 10s
timeout: 5s
retries: 10
minio:
image: "minio/minio"
command: server /data --address ":9000" --console-address ":9001"
volumes:
- ${VOLUME_FILES_PATH:-files}:/data
healthcheck:
test: ['CMD', 'mc', 'ready', 'local']
interval: 5s
retries: 10
restart: unless-stopped
elastic:
@@ -59,15 +93,14 @@ services:
environment:
- SERVER_PORT=3333
- SERVER_SECRET=${SECRET}
- SERVER_CURSOR_MAXTIMEMS=30000
- DB_URL=mongodb://mongodb:27017
- MONGO_URL=mongodb://mongodb:27017
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- DB_URL=${CR_DB_URL}
- STORAGE_CONFIG=datalake|http://datalake:4030
- 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}
- QUEUE_CONFIG=redpanda:9092
restart: unless-stopped
collaborator:
@@ -76,9 +109,8 @@ services:
- COLLABORATOR_PORT=3078
- SECRET=${SECRET}
- ACCOUNTS_URL=http://account:3000
- DB_URL=mongodb://mongodb:27017
- STATS_URL=http://stats:4900
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- STORAGE_CONFIG=datalake|http://datalake:4030
restart: unless-stopped
account:
@@ -86,28 +118,28 @@ services:
environment:
- SERVER_PORT=3000
- SERVER_SECRET=${SECRET}
- DB_URL=mongodb://mongodb:27017
- MONGO_URL=mongodb://mongodb:27017
- DB_URL=${CR_DB_URL}
- TRANSACTOR_URL=ws://transactor:3333;ws${SECURE:+s}://${HOST_ADDRESS}/_transactor
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- STORAGE_CONFIG=datalake|http://datalake:4030
- FRONT_URL=http${SECURE:+s}://${HOST_ADDRESS}
- STATS_URL=http${SECURE:+s}://${HOST_ADDRESS}/stats
- MODEL_ENABLED=*
- ACCOUNTS_URL=http${SECURE:+s}://${HOST_ADDRESS}
- ACCOUNT_PORT=3000
- QUEUE_CONFIG=redpanda:9092
restart: unless-stopped
workspace:
image: hardcoreeng/workspace:${HULY_VERSION}
environment:
- SERVER_SECRET=${SECRET}
- DB_URL=mongodb://mongodb:27017
- MONGO_URL=mongodb://mongodb:27017
- DB_URL=${CR_DB_URL}
- TRANSACTOR_URL=ws://transactor:3333;ws${SECURE:+s}://${HOST_ADDRESS}/_transactor
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- STORAGE_CONFIG=datalake|http://datalake:4030
- MODEL_ENABLED=*
- ACCOUNTS_URL=http://account:3000
- STATS_URL=http://stats:4900
- QUEUE_CONFIG=redpanda:9092
restart: unless-stopped
front:
@@ -117,34 +149,36 @@ services:
- SERVER_SECRET=${SECRET}
- LOVE_ENDPOINT=http${SECURE:+s}://${HOST_ADDRESS}/_love
- ACCOUNTS_URL=http${SECURE:+s}://${HOST_ADDRESS}/_accounts
- ACCOUNTS_URL_INTERNAL=http://account:3000
- REKONI_URL=http${SECURE:+s}://${HOST_ADDRESS}/_rekoni
- 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
- FILES_URL=http${SECURE:+s}://${HOST_ADDRESS}/_datalake/blob/:workspace/:blobId/:filename
- UPLOAD_URL=http${SECURE:+s}://${HOST_ADDRESS}/_datalake/upload/form-data/:workspace
- PREVIEW_CONFIG=image|http${SECURE:+s}://${HOST_ADDRESS}/_datalake/image/fit=cover,width=:width,height=:height,dpr=:dpr/:workspace/:blobId;video|http${SECURE:+s}://${HOST_ADDRESS}/_datalake/meta/:workspace/:blobId
- ELASTIC_URL=http://elastic:9200
- COLLABORATOR_URL=ws${SECURE:+s}://${HOST_ADDRESS}/_collaborator
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- DB_URL=mongodb://mongodb:27017
- MONGO_URL=mongodb://mongodb:27017
- STORAGE_CONFIG=datalake|http://datalake:4030
- TITLE=${TITLE:-Huly Self Host}
- DEFAULT_LANGUAGE=${DEFAULT_LANGUAGE:-en}
- LAST_NAME_FIRST=${LAST_NAME_FIRST:-true}
- DESKTOP_UPDATES_CHANNEL=selfhost
- DESKTOP_UPDATES_CHANNEL=${HULY_VERSION}
restart: unless-stopped
fulltext:
image: hardcoreeng/fulltext:${HULY_VERSION}
environment:
- SERVER_SECRET=${SECRET}
- DB_URL=mongodb://mongodb:27017
- DB_URL=${CR_DB_URL}
- FULLTEXT_DB_URL=http://elastic:9200
- ELASTIC_INDEX_NAME=huly_storage_index
- STORAGE_CONFIG=minio|minio?accessKey=minioadmin&secretKey=minioadmin
- STORAGE_CONFIG=datalake|http://datalake:4030
- REKONI_URL=http://rekoni:4004
- ACCOUNTS_URL=http://account:3000
- STATS_URL=http://stats:4900
- QUEUE_CONFIG=redpanda:9092
restart: unless-stopped
stats:
@@ -153,9 +187,32 @@ services:
- PORT=4900
- SERVER_SECRET=${SECRET}
restart: unless-stopped
datalake:
image: hardcoreeng/datalake:${HULY_VERSION}
depends_on:
minio:
condition: service_healthy
cockroach:
condition: service_started
stats:
condition: service_started
account:
condition: service_started
environment:
- PORT=4030
- SECRET=${SECRET}
- ACCOUNTS_URL=http://account:3000
- STATS_URL=http://stats:4900
- DB_URL=${CR_DB_URL}
- BUCKETS=huly,eu|http://minio:9000?accessKey=minioadmin&secretKey=minioadmin
- QUEUE_CONFIG=redpanda:9092
restart: unless-stopped
volumes:
# These named volumes are used when custom volume paths are not specified
# If VOLUME_*_PATH variables are set, these volumes will be ignored
db:
elastic:
files:
files:
cr_data:
cr_certs:
redpanda:
+12 -1
View File
@@ -19,11 +19,22 @@ TITLE=Huly Self Host
DEFAULT_LANGUAGE=en
LAST_NAME_FIRST=true
# Redpanda variables
REDPANDA_ADMIN_USER=superadmin
REDPANDA_ADMIN_PWD=panda_secret
# CockroachDB variables
CR_DATABASE=defaultdb
CR_USERNAME=selfhost
CR_USER_PASSWORD=cr_secret
# Docker volume paths - specify custom paths for persistent data storage
# Leave empty to use default Docker named volumes
VOLUME_DB_PATH=
VOLUME_ELASTIC_PATH=
VOLUME_FILES_PATH=
VOLUME_CR_DATA_PATH=
VOLUME_CR_CERTS_PATH=
VOLUME_REDPANDA_PATH=
# The following configs are auto-generated by the setup script.
# Please do not manually overwrite.
+6 -1
View File
@@ -63,12 +63,17 @@ Add host entries to be able to work with ingresses from the host machine:
sudo cp -p /etc/hosts /tmp/hosts
echo "127.0.0.1 huly.example" | sudo tee -a /etc/hosts
echo "127.0.0.1 account.huly.example" | sudo tee -a /etc/hosts
echo "127.0.0.1 transactor.huly.example" | sudo tee -a /etc/hosts
echo "127.0.0.1 collaborator.huly.example" | sudo tee -a /etc/hosts
echo "127.0.0.1 datalake.huly.example" | sudo tee -a /etc/hosts
```
Deploy Huly with `kubectl`:
```bash
kubectl apply -R -f .
kubectl create namespace huly-v7
kubectl apply -R -f . --namespace huly-v7
```
Wait until the front app is coming up:
+3 -1
View File
@@ -18,7 +18,9 @@ The sample configuration assume that Huly is available on huly.example hostname
Deploy Huly with `kubectl`.
```bash
kubectl apply -R -f .
kubectl create namespace huly-v7
kubectl apply -R -f . --namespace huly-v7
```
Now, launch your web browser and enjoy Huly!
+6 -4
View File
@@ -39,9 +39,9 @@ spec:
value: '*'
- name: DB_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: MONGO_URL
secretKeyRef:
name: huly-secret
key: CR_DB_URL
- name: MONGO_URL
valueFrom:
configMapKeyRef:
@@ -57,7 +57,9 @@ spec:
configMapKeyRef:
name: huly-config
key: TRANSACTOR_URL
image: hardcoreeng/account:v0.6.502
- name: QUEUE_CONFIG
value: redpanda:9092
image: hardcoreeng/account:s0.7.204
name: account
ports:
- containerPort: 3000
+52
View File
@@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cockroachdb-single-node
spec:
replicas: 1
selector:
matchLabels:
app: cockroach
template:
metadata:
labels:
app: cockroach
spec:
# initContainers:
# - name: init-certs-dir
# image: busybox
# command: ['sh', '-c', 'mkdir -p /cockroach/cockroach-certs && chmod -R 700 /cockroach']
# volumeMounts:
# - name: certs
# mountPath: /cockroach/certs
containers:
- name: cockroachdb
image: cockroachdb/cockroach:latest-v24.2
args:
- start-single-node
- --accept-sql-without-tls
env:
- name: COCKROACH_DATABASE
value: "defaultdb"
- name: COCKROACH_USER
value: "selfhost"
- name: COCKROACH_PASSWORD
valueFrom:
secretKeyRef:
name: huly-secret
key: COCKROACH_PASSWORD
ports:
- containerPort: 26257
- containerPort: 8080
volumeMounts:
- name: cockroachdb-data
mountPath: /cockroach/cockroach-data
- name: cockroachdb-certs
mountPath: /cockroach/certs
volumes:
- name: cockroachdb-data
persistentVolumeClaim:
claimName: cockroachdb-data
- name: cockroachdb-certs
persistentVolumeClaim:
claimName: cockroachdb-certs
@@ -0,0 +1,21 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cockroachdb-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cockroachdb-certs
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
+17
View File
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: cockroach
name: cockroach
spec:
selector:
app: cockroach
ports:
- name: grpc
port: 26257
targetPort: 26257
- name: http
port: 8080
targetPort: 8080
clusterIP: None
@@ -32,7 +32,7 @@ spec:
secretKeyRef:
name: huly-secret
key: SERVER_SECRET
image: hardcoreeng/collaborator:v0.6.502
image: hardcoreeng/collaborator:s0.7.204
name: collaborator
ports:
- containerPort: 3078
+3
View File
@@ -13,3 +13,6 @@ data:
MONGO_URL: 'mongodb://mongodb:27017'
ELASTIC_URL: 'http://elastic:9200'
ELASTIC_INDEX_NAME: 'huly_storage_index'
filesUrl: 'http://datalake.huly.example/blob/:workspace/:blobId/:filename'
uploadUrl: 'http://datalake.huly.example/upload/form-data/:workspace'
previewConfig: 'image|http://datalake.huly.example/image/fit=cover,width=:width,height=:height,dpr=:dpr/:workspace/:blobId;video|http://datalake.huly.example/meta/:workspace/:blobId'
+5 -1
View File
@@ -5,4 +5,8 @@ metadata:
type: Opaque
stringData:
SERVER_SECRET: secret
STORAGE_CONFIG: minio|minio?accessKey=minioadmin&secretKey=minioadmin
STORAGE_CONFIG: datalake|http://datalake
COCKROACH_PASSWORD: cockroach_user_secret
REDPANDA_SUPERUSER_PASSWORD: superpassword
CR_DB_URL: postgres://selfhost:cockroach_user_secret@cockroach:26257/defaultdb
datalakeStorageConfig: huly,eu|http://minio:9000?accessKey=minioadmin&secretKey=minioadmin
+49
View File
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: datalake
name: datalake
spec:
replicas: 1
selector:
matchLabels:
app: datalake
template:
metadata:
labels:
app: datalake
spec:
containers:
- image: hardcoreeng/datalake:s0.7.204
name: datalake
ports:
- containerPort: 3000
env:
- name: PORT
value: '4030'
- name: SECRET
valueFrom:
secretKeyRef:
name: huly-secret
key: SERVER_SECRET
- name: ACCOUNTS_URL
value: http://account
- name: STATS_URL
value: http://stats
- name: DB_URL
valueFrom:
secretKeyRef:
name: huly-secret
key: CR_DB_URL
- name: BUCKETS
valueFrom:
secretKeyRef:
name: huly-secret
key: datalakeStorageConfig
- name: QUEUE_CONFIG
value: redpanda:9092
resources:
limits:
memory: "512M"
restartPolicy: Always
+21
View File
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
labels:
app: datalake
name: datalake
spec:
ingressClassName: nginx
rules:
- host: datalake.huly.example
http:
paths:
- backend:
service:
name: datalake
port:
number: 80
path: /
pathType: Prefix
+12
View File
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: datalake
name: datalake
spec:
ports:
- port: 80
targetPort: 4030
selector:
app: datalake
+17 -2
View File
@@ -21,6 +21,8 @@ spec:
configMapKeyRef:
name: huly-config
key: ACCOUNTS_URL
- name: ACCOUNTS_URL_INTERNAL
value: http://account
- name: CALENDAR_URL
value: http://calendar
- name: COLLABORATOR_URL
@@ -63,13 +65,26 @@ spec:
value: http://telegram:8086
- name: TITLE
value: Huly Self Hosted
- name: FILES_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: filesUrl
- name: UPLOAD_URL
value: /files
valueFrom:
configMapKeyRef:
name: huly-config
key: uploadUrl
- name: PREVIEW_CONFIG
valueFrom:
configMapKeyRef:
name: huly-config
key: previewConfig
- name: STATS_URL
value: http://stats
- name: DESKTOP_UPDATES_CHANNEL
value: selfhost
image: hardcoreeng/front:v0.6.502
image: hardcoreeng/front:s0.7.204
name: front
ports:
- containerPort: 8080
+6 -4
View File
@@ -23,9 +23,9 @@ spec:
key: SERVER_SECRET
- name: DB_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: MONGO_URL
secretKeyRef:
name: huly-secret
key: CR_DB_URL
- name: FULLTEXT_DB_URL
valueFrom:
configMapKeyRef:
@@ -47,7 +47,9 @@ spec:
value: http://account
- name: STATS_URL
value: http://stats
image: hardcoreeng/fulltext:v0.6.502
- name: QUEUE_CONFIG
value: redpanda:9092
image: hardcoreeng/fulltext:s0.7.204
name: fulltext
ports:
- containerPort: 4700
-37
View File
@@ -1,37 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: mongodb
name: mongodb
spec:
replicas: 1
selector:
matchLabels:
app: mongodb
strategy:
type: Recreate
template:
metadata:
labels:
app: mongodb
spec:
containers:
- env:
- name: PGID
value: "1000"
- name: PUID
value: "1000"
image: mongo:7-jammy
name: mongodb
ports:
- containerPort: 27017
protocol: TCP
volumeMounts:
- mountPath: /data/db
name: db
restartPolicy: Always
volumes:
- name: db
persistentVolumeClaim:
claimName: db
-13
View File
@@ -1,13 +0,0 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: mongodb
name: mongodb
spec:
ports:
- port: 27017
targetPort: 27017
protocol: TCP
selector:
app: mongodb
+58
View File
@@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: redpanda
name: redpanda
spec:
replicas: 1
selector:
matchLabels:
app: redpanda
template:
metadata:
labels:
app: redpanda
spec:
containers:
- env:
- name: REDPANDA_SUPERUSER_USERNAME
value: superuser
- name: REDPANDA_SUPERUSER_PASSWORD
valueFrom:
secretKeyRef:
name: huly-secret
key: REDPANDA_SUPERUSER_PASSWORD
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: docker.redpanda.com/redpandadata/redpanda:v24.3.6
args:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
- --advertise-kafka-addr internal://redpanda:9092,external://localhost:19092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
- --advertise-pandaproxy-addr internal://redpanda:8082,external://localhost:18082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
- --rpc-addr 0.0.0.0:33145
- --advertise-rpc-addr redpanda:33145
- --mode dev-container
- --smp 1
- --default-log-level=info
name: redpanda
ports:
- containerPort: 9092
- containerPort: 33145
volumeMounts:
- mountPath: /var/lib/redpanda/data
name: redpanda
resources:
limits:
memory: "512M"
restartPolicy: Always
volumes:
- name: redpanda
persistentVolumeClaim:
claimName: redpanda
@@ -1,10 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: db
labels:
app: redpanda
name: redpanda
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
storage: 100Mi
+16
View File
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: redpanda
name: redpanda
spec:
ports:
- port: 9092
targetPort: 9092
name: kafka
- port: 33145
targetPort: 33145
name: rpc
selector:
app: redpanda
+1 -1
View File
@@ -15,7 +15,7 @@ spec:
app: rekoni
spec:
containers:
- image: hardcoreeng/rekoni-service:v0.6.502
- image: hardcoreeng/rekoni-service:s0.7.204
name: rekoni
env:
- name: SECRET
+1 -1
View File
@@ -15,7 +15,7 @@ spec:
app: stats
spec:
containers:
- image: hardcoreeng/stats:v0.6.502
- image: hardcoreeng/stats:s0.7.204
name: stats
env:
- name: PORT
+6 -4
View File
@@ -39,9 +39,9 @@ spec:
key: MONGO_URL
- name: DB_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: MONGO_URL
secretKeyRef:
name: huly-secret
key: CR_DB_URL
- name: SERVER_CURSOR_MAXTIMEMS
value: "30000"
- name: SERVER_PORT
@@ -51,7 +51,9 @@ spec:
secretKeyRef:
name: huly-secret
key: SERVER_SECRET
image: hardcoreeng/transactor:v0.6.502
- name: QUEUE_CONFIG
value: redpanda:9092
image: hardcoreeng/transactor:s0.7.204
name: transactor
ports:
- containerPort: 3333
+6 -4
View File
@@ -34,9 +34,9 @@ spec:
value: '*'
- name: DB_URL
valueFrom:
configMapKeyRef:
name: huly-config
key: MONGO_URL
secretKeyRef:
name: huly-secret
key: CR_DB_URL
- name: MONGO_URL
valueFrom:
configMapKeyRef:
@@ -47,7 +47,9 @@ spec:
secretKeyRef:
name: huly-secret
key: SERVER_SECRET
image: hardcoreeng/workspace:v0.6.502
- name: QUEUE_CONFIG
value: redpanda:9092
image: hardcoreeng/workspace:s0.7.204
name: workspace
resources:
limits:
+67 -20
View File
@@ -1,8 +1,5 @@
#!/usr/bin/env bash
HULY_VERSION="v0.6.502"
DOCKER_NAME="huly"
CONFIG_FILE="huly.conf"
CONFIG_FILE="huly_v7.conf"
# Parse command line arguments
RESET_VOLUMES=false
@@ -35,9 +32,11 @@ done
if [ "$RESET_VOLUMES" == true ]; then
echo -e "\033[33m--reset-volumes flag detected: Resetting all volume paths to default Docker named volumes.\033[0m"
sed -i \
-e '/^VOLUME_DB_PATH=/s|=.*|=|' \
-e '/^VOLUME_ELASTIC_PATH=/s|=.*|=|' \
-e '/^VOLUME_FILES_PATH=/s|=.*|=|' \
-e '/^VOLUME_CR_DATA_PATH=/s|=.*|=|' \
-e '/^VOLUME_CR_CERTS_PATH=/s|=.*|=|' \
-e '/^VOLUME_REDPANDA_PATH=/s|=.*|=|' \
"$CONFIG_FILE"
exit 0
fi
@@ -110,19 +109,6 @@ echo -e "\n\033[1;34mDocker Volume Configuration:\033[0m"
echo "You can specify custom paths for persistent data storage, or leave empty to use default Docker named volumes."
echo -e "\033[33mTip: To revert from custom paths to default volumes, enter 'default' or just press Enter when prompted.\033[0m"
# Database volume configuration
if [[ -n "$VOLUME_DB_PATH" ]]; then
current_db="custom: $VOLUME_DB_PATH"
else
current_db="default Docker volume"
fi
read -p "Enter custom path for database volume [current: ${current_db}]: " input
if [[ "$input" == "default" ]]; then
_VOLUME_DB_PATH=""
else
_VOLUME_DB_PATH="${input:-${VOLUME_DB_PATH}}"
fi
# Elasticsearch volume configuration
if [[ -n "$VOLUME_ELASTIC_PATH" ]]; then
current_elastic="custom: $VOLUME_ELASTIC_PATH"
@@ -149,6 +135,45 @@ echo -e "\n\033[1;34mDocker Volume Configuration:\033[0m"
_VOLUME_FILES_PATH="${input:-${VOLUME_FILES_PATH}}"
fi
# Cockroach data volume configuration
if [[ -n "$VOLUME_CR_DATA_PATH" ]]; then
current_cr_data="custom: $VOLUME_CR_DATA_PATH"
else
current_cr_data="default Docker volume"
fi
read -p "Enter custom path for CR data volume [current: ${current_cr_data}]: " input
if [[ "$input" == "default" ]]; then
_VOLUME_CR_DATA_PATH=""
else
_VOLUME_CR_DATA_PATH="${input:-${VOLUME_CR_DATA_PATH}}"
fi
# Cockroach certs volume configuration
if [[ -n "$VOLUME_CR_CERTS_PATH" ]]; then
current_cr_certs="custom: $VOLUME_CR_CERTS_PATH"
else
current_cr_certs="default Docker volume"
fi
read -p "Enter custom path for CR certs volume [current: ${current_cr_certs}]: " input
if [[ "$input" == "default" ]]; then
_VOLUME_CR_CERTS_PATH=""
else
_VOLUME_CR_CERTS_PATH="${input:-${VOLUME_CR_CERTS_PATH}}"
fi
# Redpanda volume configuration
if [[ -n "$VOLUME_REDPANDA_PATH" ]]; then
current_redpanda="custom: $VOLUME_REDPANDA_PATH"
else
current_redpanda="default Docker volume"
fi
read -p "Enter custom path for Redpanda volume [current: ${current_redpanda}]: " input
if [[ "$input" == "default" ]]; then
_VOLUME_REDPANDA_PATH=""
else
_VOLUME_REDPANDA_PATH="${input:-${VOLUME_REDPANDA_PATH}}"
fi
if [ ! -f .huly.secret ] || [ "$SECRET" == true ]; then
openssl rand -hex 32 > .huly.secret
echo "Secret generated and stored in .huly.secret"
@@ -157,6 +182,16 @@ else
echo "Run this script with --secret to generate a new secret."
fi
if [ ! -f .cr.secret ]; then
openssl rand -hex 32 > .cr.secret
echo "Secret generated and stored in .cr.secret"
fi
if [ ! -f .rp.secret ]; then
openssl rand -hex 32 > .rp.secret
echo "Secret generated and stored in .rp.secret"
fi
export HOST_ADDRESS=$_HOST_ADDRESS
export SECURE=$_SECURE
export HTTP_PORT=$_HTTP_PORT
@@ -164,13 +199,23 @@ export HTTP_BIND=$HTTP_BIND
export TITLE=${TITLE:-Huly}
export DEFAULT_LANGUAGE=${DEFAULT_LANGUAGE:-en}
export LAST_NAME_FIRST=${LAST_NAME_FIRST:-true}
export VOLUME_DB_PATH=$_VOLUME_DB_PATH
export CR_DATABASE=${CR_DATABASE:-defaultdb}
export CR_USERNAME=${CR_USERNAME:-selfhost}
export REDPANDA_ADMIN_USER=${REDPANDA_ADMIN_USER:-superadmin}
export VOLUME_ELASTIC_PATH=$_VOLUME_ELASTIC_PATH
export VOLUME_FILES_PATH=$_VOLUME_FILES_PATH
export VOLUME_CR_DATA_PATH=$_VOLUME_CR_DATA_PATH
export VOLUME_CR_CERTS_PATH=$_VOLUME_CR_CERTS_PATH
export VOLUME_REDPANDA_PATH=$_VOLUME_REDPANDA_PATH
export HULY_SECRET=$(cat .huly.secret)
export COCKROACH_SECRET=$(cat .cr.secret)
export REDPANDA_SECRET=$(cat .rp.secret)
envsubst < .template.huly.conf > $CONFIG_FILE
source "$CONFIG_FILE"
export CR_DB_URL=$CR_DB_URL
echo -e "\n\033[1;34mConfiguration Summary:\033[0m"
echo -e "Host Address: \033[1;32m$_HOST_ADDRESS\033[0m"
echo -e "HTTP Port: \033[1;32m$_HTTP_PORT\033[0m"
@@ -179,9 +224,11 @@ if [[ -n "$SECURE" ]]; then
else
echo -e "SSL Enabled: \033[1;31mNo\033[0m"
fi
echo -e "Database Volume: \033[1;32m${_VOLUME_DB_PATH:-Docker named volume}\033[0m"
echo -e "Elasticsearch Volume: \033[1;32m${_VOLUME_ELASTIC_PATH:-Docker named volume}\033[0m"
echo -e "Files Volume: \033[1;32m${_VOLUME_FILES_PATH:-Docker named volume}\033[0m"
echo -e "CockroachDB Volume: \033[1;32m${_VOLUME_CR_DATA_PATH:-Docker named volume}\033[0m"
echo -e "CockroachDB Certs Volume: \033[1;32m${_VOLUME_CR_CERTS_PATH:-Docker named volume}\033[0m"
echo -e "Redpanda Volume: \033[1;32m${_VOLUME_REDPANDA_PATH:-Docker named volume}\033[0m"
read -p "Do you want to run 'docker compose up -d' now to start Huly? (Y/n): " RUN_DOCKER
case "${RUN_DOCKER:-Y}" in