From 5b1b7a9ef4cf196624a0bd2a897232e1bb515122 Mon Sep 17 00:00:00 2001 From: geezo Date: Fri, 24 Jan 2025 00:10:05 +0000 Subject: [PATCH] n8n --- glance/glance.yml | 74 ++++++++------------------------ n8n/.env | 6 +++ n8n/docker-compose.yml | 44 +++++++++++++++++++ n8n/init-data.sh | 13 ++++++ tubearchivist/docker-compose.yml | 24 +++++------ 5 files changed, 94 insertions(+), 67 deletions(-) create mode 100644 n8n/.env create mode 100644 n8n/docker-compose.yml create mode 100644 n8n/init-data.sh diff --git a/glance/glance.yml b/glance/glance.yml index 6fe918e..4c84be2 100644 --- a/glance/glance.yml +++ b/glance/glance.yml @@ -91,30 +91,9 @@ pages: - type: reddit subreddit: selfhosted show-thumbnails: true - - type: reddit - subreddit: homeassistant - show-thumbnails: true - - type: reddit - subreddit: homeautomation - show-thumbnails: true - type: reddit subreddit: sideproject show-thumbnails: true - #### Development/Coding - - type: videos - channels: - - UC9x0AN7BWHpCDHSm9NiJFJQ # NetworkChuck - - type: group - widgets: - - type: reddit - subreddit: devops - show-thumbnails: true - - type: reddit - subreddit: python - show-thumbnails: true - - type: reddit - subreddit: unixporn - show-thumbnails: true #### Mainstream/Reviewers - type: videos channels: @@ -153,7 +132,7 @@ pages: # - symbol: RDDT # name: Reddit - - name: Entertainment + - name: PopCulture columns: - size: full widgets: @@ -161,7 +140,6 @@ pages: - type: videos channels: - UCnxQ8o9RpqxGF2oLHcCn9VQ # fantano - - UCgi2u-lGY-2i2ubLsUr6FbQ # FD Signifier - UCQ86N3Ulc7yBuY4TZSWjaxA # [Deleted] - type: group widgets: @@ -178,43 +156,24 @@ pages: - type: videos channels: - UCLuYADJ6hESLHX87JnsGbjA # Josh Joshnson + + - name: BlackCulture + columns: + - size: full + widgets: - type: group widgets: - type: reddit subreddit: blackpeopletwitter - - - - # - size: small - # widgets: - # - type: weather - # location: London, United Kingdom - - # - type: markets - # markets: - # - symbol: SPY - # name: S&P 500 - # - symbol: BTC-USD - # name: Bitcoin - # - symbol: NVDA - # name: NVIDIA - # - symbol: AAPL - # name: Apple - # - symbol: MSFT - # name: Microsoft - # - symbol: GOOGL - # name: Google - # - symbol: AMD - # name: AMD - # - symbol: RDDT - # name: Reddit + - type: videos + channels: + - UCgi2u-lGY-2i2ubLsUr6FbQ # FD Signifier - name: News columns: - size: small widgets: - type: calendar - - size: full widgets: - type: group @@ -245,11 +204,16 @@ pages: - UCsy9I56PY3IngCf_VGjunMQ # Zeihan - UCC3ehuUksTyQ7bbjGntmx3Q #Perun - # - name: Finance - # columns: - # - size: small - # widgets: - # - type: calendar + - name: Wealth + columns: + - size: full + widgets: + - type: group + widgets: + - type: reddit + subreddit: realestateinvesting + limit: 20 + sort-by: top # - name: Well-Being diff --git a/n8n/.env b/n8n/.env new file mode 100644 index 0000000..e2c00d9 --- /dev/null +++ b/n8n/.env @@ -0,0 +1,6 @@ +POSTGRES_USER=admin +POSTGRES_PASSWORD=password +POSTGRES_DB=n8n + +POSTGRES_NON_ROOT_USER=geezo +POSTGRES_NON_ROOT_PASSWORD=password \ No newline at end of file diff --git a/n8n/docker-compose.yml b/n8n/docker-compose.yml new file mode 100644 index 0000000..fd11ef7 --- /dev/null +++ b/n8n/docker-compose.yml @@ -0,0 +1,44 @@ +version: '3.8' + +volumes: + db_data: + n8n_data: + +services: + postgres: + image: postgres:16 + restart: always + environment: + - POSTGRES_USER + - POSTGRES_PASSWORD + - POSTGRES_DB + - POSTGRES_NON_ROOT_USER + - POSTGRES_NON_ROOT_PASSWORD + volumes: + - db_data:/var/lib/postgresql/data + - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh + healthcheck: + test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}'] + interval: 5s + timeout: 5s + retries: 10 + + n8n: + image: docker.n8n.io/n8nio/n8n + restart: always + 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} + ports: + - 1012:5678 + links: + - postgres + volumes: + - n8n_data:/home/node/.n8n + depends_on: + postgres: + condition: service_healthy \ No newline at end of file diff --git a/n8n/init-data.sh b/n8n/init-data.sh new file mode 100644 index 0000000..7f2e382 --- /dev/null +++ b/n8n/init-data.sh @@ -0,0 +1,13 @@ +#!/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 \ No newline at end of file diff --git a/tubearchivist/docker-compose.yml b/tubearchivist/docker-compose.yml index 91a1b29..f3bf52b 100644 --- a/tubearchivist/docker-compose.yml +++ b/tubearchivist/docker-compose.yml @@ -11,17 +11,17 @@ services: - /home/geezo/media/youtube:/youtube - cache:/cache environment: - - ES_URL=http://archivist-es:9200 # needs protocol e.g. http and port - - REDIS_HOST=archivist-redis # don't add protocol + - ES_URL=http://archivist-es:9200 # needs protocol e.g. http and port + - REDIS_HOST=archivist-redis # don't add protocol - HOST_UID=1000 - HOST_GID=1000 - - TA_HOST=http://theocorp:1011 # set your host name - - TA_USERNAME=geezo # your initial TA credentials - - TA_PASSWORD=verysecret # your initial TA credentials - - ELASTIC_PASSWORD=verysecret # set password for Elasticsearch - - TZ=America/New_York # set your time zone + - TA_HOST=http://theocorp:1011 # set your host name + - TA_USERNAME=geezo # your initial TA credentials + - TA_PASSWORD=verysecret # your initial TA credentials + - ELASTIC_PASSWORD=verysecret # set password for Elasticsearch + - TZ=America/New_York # set your time zone healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ] interval: 2m timeout: 10s retries: 3 @@ -40,11 +40,11 @@ services: depends_on: - archivist-es archivist-es: - image: bbilly1/tubearchivist-es # only for amd64, or use official es 8.16.0 + image: bbilly1/tubearchivist-es # only for amd64, or use official es 8.16.0 container_name: archivist-es restart: unless-stopped environment: - - "ELASTIC_PASSWORD=verysecret" # matching Elasticsearch password + - "ELASTIC_PASSWORD=verysecret" # matching Elasticsearch password - "ES_JAVA_OPTS=-Xms1g -Xmx1g" - "xpack.security.enabled=true" - "discovery.type=single-node" @@ -54,11 +54,11 @@ services: soft: -1 hard: -1 volumes: - - es:/usr/share/elasticsearch/data # check for permission error when using bind mount, see readme + - es:/usr/share/elasticsearch/data # check for permission error when using bind mount, see readme expose: - "9200" volumes: cache: redis: - es: \ No newline at end of file + es: