n8n & rocketchat

This commit is contained in:
Dziad Borowy 2025-03-10 21:27:18 +00:00
parent 1bbe880d2c
commit 8ce6317844
3 changed files with 156 additions and 1 deletions

View File

@ -210,6 +210,9 @@ The aims is to provide a ready-to-run recipes that you can just copy, paste and
# Home Automation
- [HomeAssistant](apps/home-automation/home-assistant.md)
- [Homebridge](apps/home-automation/homebridge.md)
- [n8n](apps/home-automation/n8n.md) - excellent automation platform.
### Other (not tested)
- [Beehive](https://github.com/muesli/beehive) 🔗 - flexible event/agent & automation system
- [Huginn](https://github.com/huginn/huginn) 🔗 - Create agents that monitor and act on your behalf.
- [Node-RED](https://nodered.org/) 🔗 - Low-code programming for event-driven applications
@ -387,10 +390,11 @@ The aims is to provide a ready-to-run recipes that you can just copy, paste and
- [Monica](apps/social/monica.md)
- [Mastodon](apps/social/mastodon.md)
- [Mattermost](apps/social/mattermost.md)
- [RocketChat](apps/social/rocketchat.md)
### Other untested
- [HumHub](https://www.humhub.com/en) 🔗 - Free social network software and framework.
- [RocketChat](https://docs.rocket.chat/installation/docker-containers/) 🔗 - The Ultimate Communication Hub.
- [Snikket](https://snikket.org/) 🔗 - Chat that is simple, secure, and private.
- [Jami](https://jami.net/) 🔗 - Audio & video calls, screen sharing, IM.

100
apps/home-automation/n8n.md Normal file
View File

@ -0,0 +1,100 @@
# n8n
n8n is a free and open node-based Workflow Automation Tool. It can be self-hosted, easily extended, and so also used with internal tools.
---
- [Homepage](https://n8n.io/)
- [Github repo](https://github.com/n8n-io/n8n)
- [Docs](https://docs.n8n.io/)
## Setup
Create 1 folder and 3 files in the same directory:
- storage/
- .env
- init-data.sh
- docker-compose.yml
```sh
touch .env init-data.sh docker-compose.yml
mkdir storage
chmod +x init-data.sh # make the init-data.sh executable
chmod 777 storage # make sure the storage folder is writable
```
## .env
```conf
POSTGRES_USER=n8n
POSTGRES_PASSWORD=n8n
POSTGRES_DB=n8n
POSTGRES_NON_ROOT_USER=n7n
POSTGRES_NON_ROOT_PASSWORD=n7n
```
## init-data.sh
```sh
#!/bin/bash
set -e;
if [ -n "${POSTGRES_NON_ROOT_USER:-}" ] && [ -n "${POSTGRES_NON_ROOT_PASSWORD:-}" ]; then
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER ${POSTGRES_NON_ROOT_USER} WITH PASSWORD '${POSTGRES_NON_ROOT_PASSWORD}';
GRANT ALL PRIVILEGES ON DATABASE ${POSTGRES_DB} TO ${POSTGRES_NON_ROOT_USER};
GRANT CREATE ON SCHEMA public TO ${POSTGRES_NON_ROOT_USER};
EOSQL
else
echo "SETUP INFO: No Environment variables given!"
fi
```
## docker-compose.yml
```yml
---
services:
postgres:
image: postgres:16
restart: unless-stopped
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_NON_ROOT_USER
- POSTGRES_NON_ROOT_PASSWORD
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 5s
timeout: 5s
retries: 10
volumes:
- ./db:/var/lib/postgresql/data
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
n8n:
image: docker.n8n.io/n8nio/n8n
restart: unless-stopped
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
- N8N_EDITOR_BASE_URL=http://localhost:5678/
#- N8N_SECURE_COOKIE=false
links:
- postgres
depends_on:
postgres:
condition: service_healthy
ports:
- 5678:5678
volumes:
- ./storage:/home/node/.n8n
```

51
apps/social/rocketchat.md Normal file
View File

@ -0,0 +1,51 @@
# RocketChat
The Ultimate Communication Hub. A solid option for self-hosted chat and collaboration.
- [Homepage](https://www.rocket.chat)
- [Documentation](https://docs.rocket.chat/docs/deploy-with-docker-docker-compose)
- [Github repo](https://github.com/rocketchat/)
<br>
## docker-compose.yml
```yml
---
services:
mongodb:
# https://hub.docker.com/r/bitnami/mongodb
image: docker.io/bitnami/mongodb:8.0.5
restart: unless-stopped
volumes:
- ./data:/bitnami/mongodb
environment:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_NAME: rs0
MONGODB_PORT_NUMBER: 27017
MONGODB_INITIAL_PRIMARY_HOST: mongodb
MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017
MONGODB_ADVERTISED_HOSTNAME: mongodb
MONGODB_ENABLE_JOURNAL: true
ALLOW_EMPTY_PASSWORD: yes
rocketchat:
# https://github.com/RocketChat/Rocket.Chat/releases
image: registry.rocket.chat/rocketchat/rocket.chat:7.4.0
restart: unless-stopped
environment:
MONGO_URL: "mongodb://mongodb:27017/rocketchat?replicaSet=rs0"
MONGO_OPLOG_URL: "mongodb://mongodb:27017/local?replicaSet=rs0"
ROOT_URL: http://localhost:3123
PORT: 3000
DEPLOY_METHOD: docker
depends_on:
- mongodb
expose:
- 3000
ports:
- 3123:3000
```