Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Huly Platform #130

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Homebridge](https://github.com/nfarina/homebridge) - Emulate the iOS HomeKit API
* [Homepage](https://gethomepage.dev/) - Highly customizable application dashboard with integrations for over 100 services.
* [Huginn](https://github.com/huginn/huginn) - Create agents that monitor and act on your behalf. Your agents are standing by!
* [Huly Platform](https://github.com/hcengineering/platform) - All-in-One Project Management Platform (alternative to Linear, Jira, Slack, Notion, Motion)
* [Huntly](https://github.com/lcomplete/huntly) - Self-hosted information management tool
* [ICantBelieveItsNotValetudo](https://github.com/Hypfer/ICantBelieveItsNotValetudo) - companion service for Valetudo that renders ValetudoMap map data to raster graphics.
* [Immich](https://immich.app/) - Self-hosted photo and video backup solution directly from your mobile phone.
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@
tags:
- huginn

- role: huly
tags:
- huly

- role: huntly
tags:
- huntly
Expand Down
115 changes: 115 additions & 0 deletions roles/huly/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
huly_enabled: false
huly_available_externally: false

# directories
huly_data_directory: "{{ docker_home }}/huly"

# network
huly_mongo_port: "27017"
huly_minio_port_a: "9010"
huly_minio_port_b: "9011"
huly_elastic_port: "9201"
huly_account_port: "3020"
huly_front_port: "8139"
huly_collaborator_port: "3078"
huly_transactor_port: "3333"
huly_rekoni_port: "4004"
huly_hostname: "huly"
huly_account_hostname: "huly-account"
huly_collaborator_hostname: "huly-collaborator"
huly_transactor_hostname: "huly-transactor"
huly_network_name: "huly"

# specs
huly_mongo_memory: 1g
huly_minio_memory: 1g
huly_elastic_memory: 1g
huly_account_memory: 1g
huly_front_memory: 1g
huly_collaborator_memory: 1g
huly_transactor_memory: 1g
huly_rekoni_memory: 500m

# docker

huly_mongo_container_name: huly-mongo
huly_mongo_image_name: "mongo"
huly_mongo_image_version: "7-jammy"

huly_minio_container_name: huly-minio
huly_minio_image_name: "minio/minio"
huly_minio_image_version: "latest"

huly_elastic_container_name: huly-elastic
huly_elastic_image_name: "elasticsearch"
huly_elastic_image_version: "7.14.2"

huly_account_container_name: huly-account
huly_account_image_name: "hardcoreeng/account"
huly_account_image_version: "latest"

huly_front_container_name: huly-front
huly_front_image_name: "hardcoreeng/front"
huly_front_image_version: "latest"

huly_collaborator_container_name: huly-collaborator
huly_collaborator_image_name: "hardcoreeng/collaborator"
huly_collaborator_image_version: "latest"

huly_transactor_container_name: huly-transactor
huly_transactor_image_name: "hardcoreeng/transactor"
huly_transactor_image_version: "latest"

huly_rekoni_container_name: huly-rekoni
huly_rekoni_image_name: "hardcoreeng/rekoni-service"
huly_rekoni_image_version: "latest"

huly_user_id: "1000"
huly_group_id: "1000"

# huly
huly_server_address: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"

huly_elastic_bitnami_debug: "true"
huly_elastic_discovery_type: single-node
huly_elastic_es_java_opts: "-Xms1024m -Xmx1024m"
huly_elastic_http_cors_enabled: "true"
huly_elastic_http_cors_allow_origin: "http://localhost:8082" # not sure what this points to, might need to be fixed later

huly_account_server_port: "3000"
huly_account_server_secret: secret
huly_mongo_url: "mongodb://{{ huly_mongo_container_name }}:27017"
huly_transactor_url: "wss://{{ huly_transactor_hostname }}.{{ ansible_nas_domain }}"
huly_endpoint_url: "wss://{{ huly_transactor_hostname }}.{{ ansible_nas_domain }}"
huly_minio_endpoint: "{{ huly_minio_container_name }}"
huly_minio_access_key: minioadmin
huly_minio_secret_key: minioadmin
huly_front_url: "https://{{ huly_hostname }}.{{ ansible_nas_domain }}"
huly_init_workspace: "demo-tracker"
huly_model_enabled: "*"
huly_accounts_url: "https://{{ huly_account_hostname }}.{{ ansible_nas_domain }}"

huly_front_server_port: "8080"
huly_front_server_secret: secret
huly_rekoni_url: "http://{{ huly_server_address }}:4004"
huly_calendar_url: "http://{{ huly_server_address }}:8095"
huly_gmail_url: "http://{{ huly_server_address }}:8088"
huly_telegram_url: "http://{{ huly_server_address }}:8086"
huly_upload_url: "/files"
huly_elastic_url: "http://{{ huly_elastic_container_name }}:9200"
huly_collaborator_url: "wss://{{ huly_collaborator_hostname }}.{{ ansible_nas_domain }}"
huly_collaborator_api_url: "https://{{ huly_collaborator_hostname }}.{{ ansible_nas_domain }}"
huly_title: "Huly Self Hosted"
huly_default_language: "en"
huly_last_name_first: "true"

huly_collaborator_port_env: "3078"
huly_collaborator_server_secret: secret
huly_transactor_server_port: "3333"
huly_transactor_server_secret: secret
huly_transactor_cursor_maxtimesms: "30000"
huly_transactor_metrics_console: "false"
huly_transactor_metrics_file: "metrics.txt"
huly_transactor_server_provider: ws
huly_transactor_elastic_index_name: local_storage_index
11 changes: 11 additions & 0 deletions roles/huly/docs/huly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Huly Platform

Homepage: [https://github.com/hcengineering/platform](https://github.com/hcengineering/platform)

Huly — All-in-One Project Management Platform (alternative to Linear, Jira, Slack, Notion, Motion)

## Usage

Set `huly_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.

huly web interface can be found at [http://ansible_nas_host_or_ip:8139](http://ansible_nas_host_or_ip:8139).
6 changes: 6 additions & 0 deletions roles/huly/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
huly_enabled: true
10 changes: 10 additions & 0 deletions roles/huly/molecule/default/side_effect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
huly_enabled: false
68 changes: 68 additions & 0 deletions roles/huly/molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get huly mongo container state
community.docker.docker_container:
name: "{{ huly_mongo_container_name }}"
register: result_mongo

- name: Get huly minio container state
community.docker.docker_container:
name: "{{ huly_minio_container_name }}"
register: result_minio

- name: Get huly elastic container state
community.docker.docker_container:
name: "{{ huly_elastic_container_name }}"
register: result_elastic

- name: Get huly account container state
community.docker.docker_container:
name: "{{ huly_account_container_name }}"
register: result_account

- name: Get huly front container state
community.docker.docker_container:
name: "{{ huly_front_container_name }}"
register: result_front

- name: Get huly collaborator container state
community.docker.docker_container:
name: "{{ huly_collaborator_container_name }}"
register: result_collaborator

- name: Get huly transactor container state
community.docker.docker_container:
name: "{{ huly_transactor_container_name }}"
register: result_transactor

- name: Get huly rekoni container state
community.docker.docker_container:
name: "{{ huly_rekoni_container_name }}"
register: result_rekoni

- name: Check if huly containers are running
ansible.builtin.assert:
that:
- result_mongo.container['State']['Status'] == "running"
- result_mongo.container['State']['Restarting'] == false
- result_minio.container['State']['Status'] == "running"
- result_minio.container['State']['Restarting'] == false
- result_elastic.container['State']['Status'] == "running"
- result_elastic.container['State']['Restarting'] == false
- result_account.container['State']['Status'] == "running"
- result_account.container['State']['Restarting'] == false
- result_front.container['State']['Status'] == "running"
- result_front.container['State']['Restarting'] == false
- result_collaborator.container['State']['Status'] == "running"
- result_collaborator.container['State']['Restarting'] == false
- result_transactor.container['State']['Status'] == "running"
- result_transactor.container['State']['Restarting'] == false
- result_rekoni.container['State']['Status'] == "running"
- result_rekoni.container['State']['Restarting'] == false
68 changes: 68 additions & 0 deletions roles/huly/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove huly mongo
community.docker.docker_container:
name: "{{ huly_mongo_container_name }}"
state: absent
register: result_mongo

- name: Try and stop and remove huly minio
community.docker.docker_container:
name: "{{ huly_minio_container_name }}"
state: absent
register: result_minio

- name: Try and stop and remove huly elastic
community.docker.docker_container:
name: "{{ huly_elastic_container_name }}"
state: absent
register: result_elastic

- name: Try and stop and remove huly account
community.docker.docker_container:
name: "{{ huly_account_container_name }}"
state: absent
register: result_account

- name: Try and stop and remove huly front
community.docker.docker_container:
name: "{{ huly_front_container_name }}"
state: absent
register: result_front

- name: Try and stop and remove huly collaborator
community.docker.docker_container:
name: "{{ huly_collaborator_container_name }}"
state: absent
register: result_collaborator

- name: Try and stop and remove huly transactor
community.docker.docker_container:
name: "{{ huly_transactor_container_name }}"
state: absent
register: result_transactor

- name: Try and stop and remove huly rekoni
community.docker.docker_container:
name: "{{ huly_rekoni_container_name }}"
state: absent
register: result_rekoni

- name: Check if huly is stopped
ansible.builtin.assert:
that:
- not result_mongo.changed
- not result_minio.changed
- not result_elastic.changed
- not result_account.changed
- not result_front.changed
- not result_collaborator.changed
- not result_transactor.changed
- not result_rekoni.changed
1 change: 1 addition & 0 deletions roles/huly/requirements.yml
Loading