2025-10-25 13:52:01 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# PostgreSQL initialization script for compose core stack
|
|
|
|
|
# This script runs on first database initialization
|
|
|
|
|
# Creates all databases required by compose.sh stacks
|
|
|
|
|
|
|
|
|
|
echo "Starting compose database initialization..."
|
|
|
|
|
|
|
|
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
|
|
|
|
-- Create databases for compose services
|
|
|
|
|
-- Main application database
|
|
|
|
|
SELECT 'CREATE DATABASE directus'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'directus')\\gexec
|
feat: add Scrapy, n8n, and Filestash stacks to Falcon
Added three new service stacks to the docker-compose infrastructure:
- **Scrapy stack** (scrapy.pivoine.art):
- scrapyd: Web scraping daemon with web interface (port 6800)
- scrapy: Development container for spider commands
- scrapyrt: Real-time API for running spiders (port 9080)
- **n8n stack** (n8n.pivoine.art):
- Workflow automation platform with PostgreSQL backend
- 200+ integrations for automated tasks
- Runners enabled for task execution
- Webhook support for external triggers
- **Filestash stack** (stash.pivoine.art):
- Web-based file manager with multi-backend support
- Supports SFTP, S3, Dropbox, Google Drive, FTP, WebDAV
- In-browser file viewing and media playback
Infrastructure updates:
- Updated PostgreSQL init script to create n8n database
- Added environment variables to arty.yml for all three stacks
- Updated compose.yaml include list
- Updated CLAUDE.md and README.md documentation
- Normalized service names in existing stacks (gotify, proxy, umami, vpn)
All services integrated with Traefik for SSL termination and include
Watchtower auto-update labels.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 22:36:13 +01:00
|
|
|
|
|
|
|
|
-- Umami analytics database
|
2025-10-25 13:52:01 +02:00
|
|
|
SELECT 'CREATE DATABASE umami'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'umami')\\gexec
|
feat: add Scrapy, n8n, and Filestash stacks to Falcon
Added three new service stacks to the docker-compose infrastructure:
- **Scrapy stack** (scrapy.pivoine.art):
- scrapyd: Web scraping daemon with web interface (port 6800)
- scrapy: Development container for spider commands
- scrapyrt: Real-time API for running spiders (port 9080)
- **n8n stack** (n8n.pivoine.art):
- Workflow automation platform with PostgreSQL backend
- 200+ integrations for automated tasks
- Runners enabled for task execution
- Webhook support for external triggers
- **Filestash stack** (stash.pivoine.art):
- Web-based file manager with multi-backend support
- Supports SFTP, S3, Dropbox, Google Drive, FTP, WebDAV
- In-browser file viewing and media playback
Infrastructure updates:
- Updated PostgreSQL init script to create n8n database
- Added environment variables to arty.yml for all three stacks
- Updated compose.yaml include list
- Updated CLAUDE.md and README.md documentation
- Normalized service names in existing stacks (gotify, proxy, umami, vpn)
All services integrated with Traefik for SSL termination and include
Watchtower auto-update labels.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 22:36:13 +01:00
|
|
|
|
|
|
|
|
-- n8n workflow automation database
|
|
|
|
|
SELECT 'CREATE DATABASE n8n'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'n8n')\\gexec
|
feat: add Scrapy, n8n, and Filestash stacks to Falcon
Added three new service stacks to the docker-compose infrastructure:
- **Scrapy stack** (scrapy.pivoine.art):
- scrapyd: Web scraping daemon with web interface (port 6800)
- scrapy: Development container for spider commands
- scrapyrt: Real-time API for running spiders (port 9080)
- **n8n stack** (n8n.pivoine.art):
- Workflow automation platform with PostgreSQL backend
- 200+ integrations for automated tasks
- Runners enabled for task execution
- Webhook support for external triggers
- **Filestash stack** (stash.pivoine.art):
- Web-based file manager with multi-backend support
- Supports SFTP, S3, Dropbox, Google Drive, FTP, WebDAV
- In-browser file viewing and media playback
Infrastructure updates:
- Updated PostgreSQL init script to create n8n database
- Added environment variables to arty.yml for all three stacks
- Updated compose.yaml include list
- Updated CLAUDE.md and README.md documentation
- Normalized service names in existing stacks (gotify, proxy, umami, vpn)
All services integrated with Traefik for SSL termination and include
Watchtower auto-update labels.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 22:36:13 +01:00
|
|
|
|
2025-11-06 07:49:49 +01:00
|
|
|
-- Linkwarden bookmark manager database
|
|
|
|
|
SELECT 'CREATE DATABASE linkwarden'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'linkwarden')\\gexec
|
2025-11-06 07:49:49 +01:00
|
|
|
|
2025-11-06 12:24:07 +01:00
|
|
|
-- Joplin note-taking server database
|
|
|
|
|
SELECT 'CREATE DATABASE joplin'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'joplin')\\gexec
|
2025-11-06 12:24:07 +01:00
|
|
|
|
2025-11-08 19:43:11 +01:00
|
|
|
-- Mattermost chat platform database
|
|
|
|
|
SELECT 'CREATE DATABASE mattermost'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'mattermost')\\gexec
|
2025-11-08 19:43:11 +01:00
|
|
|
|
2025-11-08 20:54:48 +01:00
|
|
|
-- Tandoor recipe manager database
|
|
|
|
|
SELECT 'CREATE DATABASE tandoor'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'tandoor')\\gexec
|
2025-11-08 20:54:48 +01:00
|
|
|
|
feat: add Asciinema terminal recording server stack
Added new asciinema stack for self-hosted terminal recording and sharing
platform with custom "Pivoine" theme inspired by pivoine.art aesthetic.
New Services:
- **asciinema**: Terminal recording server at asciinema.pivoine.art
- PostgreSQL backend for recording persistence
- Email authentication via IONOS SMTP magic links
- Public/private recording visibility controls
- Embed recordings on any website
- Custom rose/magenta themed UI
Custom Theme (asciinema/theme/custom.css):
- Primary color: RGB(206, 39, 91) - Deep rose/magenta
- Dark charcoal backgrounds: HSL(0, 0%, 17.5%)
- High contrast design with bold color accents
- Styled components: navigation, cards, forms, buttons, terminal player
- Smooth animations and hover effects
- Responsive design with mobile breakpoints
- Custom scrollbars, selection colors, loading states
Infrastructure Updates:
- PostgreSQL: Added `asciinema` database to init script
- arty.yml: Added ASCIINEMA_* environment variables
- compose.yaml: Included asciinema stack in root composition
- CLAUDE.md: Comprehensive documentation with CLI setup guide
- Backup: Added asciinema-backup plan (11 AM daily, 7d/4w/6m/2y retention)
Configuration:
- URL: https://asciinema.pivoine.art
- Database: PostgreSQL `asciinema` database
- SMTP: Email auth via IONOS SMTP
- Unclaimed TTL: 30 days (auto-cleanup)
- Secret: Generated 64-char hex key in .env
Features:
- Record terminal sessions with asciinema CLI
- Web player with play/pause controls and speed adjustment
- User profiles with personal recording collections
- Embed recordings via iframe or direct links
- Privacy controls (public/private recordings)
- Automatic cleanup of unclaimed recordings
Integration Points:
- Documentation: Embed terminal demos
- Blog posts: Share command-line tutorials
- GitHub: Link recordings in README files
- Tutorials: Interactive terminal walkthroughs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 02:00:20 +01:00
|
|
|
-- Asciinema terminal recording server database
|
|
|
|
|
SELECT 'CREATE DATABASE asciinema'
|
2025-11-14 20:40:53 +01:00
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'asciinema')\\gexec
|
|
|
|
|
|
|
|
|
|
-- Koel music streaming database
|
|
|
|
|
SELECT 'CREATE DATABASE koel'
|
|
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'koel')\\gexec
|
feat: add Asciinema terminal recording server stack
Added new asciinema stack for self-hosted terminal recording and sharing
platform with custom "Pivoine" theme inspired by pivoine.art aesthetic.
New Services:
- **asciinema**: Terminal recording server at asciinema.pivoine.art
- PostgreSQL backend for recording persistence
- Email authentication via IONOS SMTP magic links
- Public/private recording visibility controls
- Embed recordings on any website
- Custom rose/magenta themed UI
Custom Theme (asciinema/theme/custom.css):
- Primary color: RGB(206, 39, 91) - Deep rose/magenta
- Dark charcoal backgrounds: HSL(0, 0%, 17.5%)
- High contrast design with bold color accents
- Styled components: navigation, cards, forms, buttons, terminal player
- Smooth animations and hover effects
- Responsive design with mobile breakpoints
- Custom scrollbars, selection colors, loading states
Infrastructure Updates:
- PostgreSQL: Added `asciinema` database to init script
- arty.yml: Added ASCIINEMA_* environment variables
- compose.yaml: Included asciinema stack in root composition
- CLAUDE.md: Comprehensive documentation with CLI setup guide
- Backup: Added asciinema-backup plan (11 AM daily, 7d/4w/6m/2y retention)
Configuration:
- URL: https://asciinema.pivoine.art
- Database: PostgreSQL `asciinema` database
- SMTP: Email auth via IONOS SMTP
- Unclaimed TTL: 30 days (auto-cleanup)
- Secret: Generated 64-char hex key in .env
Features:
- Record terminal sessions with asciinema CLI
- Web player with play/pause controls and speed adjustment
- User profiles with personal recording collections
- Embed recordings via iframe or direct links
- Privacy controls (public/private recordings)
- Automatic cleanup of unclaimed recordings
Integration Points:
- Documentation: Embed terminal demos
- Blog posts: Share command-line tutorials
- GitHub: Link recordings in README files
- Tutorials: Interactive terminal walkthroughs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 02:00:20 +01:00
|
|
|
|
2025-11-15 07:21:15 +01:00
|
|
|
-- Ampache music streaming database
|
|
|
|
|
SELECT 'CREATE DATABASE ampache'
|
|
|
|
|
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'ampache')\\gexec
|
|
|
|
|
|
2025-10-25 13:52:01 +02:00
|
|
|
-- Grant privileges to all databases
|
|
|
|
|
GRANT ALL PRIVILEGES ON DATABASE directus TO $POSTGRES_USER;
|
|
|
|
|
GRANT ALL PRIVILEGES ON DATABASE umami TO $POSTGRES_USER;
|
feat: add Scrapy, n8n, and Filestash stacks to Falcon
Added three new service stacks to the docker-compose infrastructure:
- **Scrapy stack** (scrapy.pivoine.art):
- scrapyd: Web scraping daemon with web interface (port 6800)
- scrapy: Development container for spider commands
- scrapyrt: Real-time API for running spiders (port 9080)
- **n8n stack** (n8n.pivoine.art):
- Workflow automation platform with PostgreSQL backend
- 200+ integrations for automated tasks
- Runners enabled for task execution
- Webhook support for external triggers
- **Filestash stack** (stash.pivoine.art):
- Web-based file manager with multi-backend support
- Supports SFTP, S3, Dropbox, Google Drive, FTP, WebDAV
- In-browser file viewing and media playback
Infrastructure updates:
- Updated PostgreSQL init script to create n8n database
- Added environment variables to arty.yml for all three stacks
- Updated compose.yaml include list
- Updated CLAUDE.md and README.md documentation
- Normalized service names in existing stacks (gotify, proxy, umami, vpn)
All services integrated with Traefik for SSL termination and include
Watchtower auto-update labels.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 22:36:13 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE n8n TO $POSTGRES_USER;
|
2025-11-06 07:49:49 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE linkwarden TO $POSTGRES_USER;
|
2025-11-06 12:24:07 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE joplin TO $POSTGRES_USER;
|
2025-11-08 19:43:11 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE mattermost TO $POSTGRES_USER;
|
2025-11-08 20:54:48 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE tandoor TO $POSTGRES_USER;
|
feat: add Asciinema terminal recording server stack
Added new asciinema stack for self-hosted terminal recording and sharing
platform with custom "Pivoine" theme inspired by pivoine.art aesthetic.
New Services:
- **asciinema**: Terminal recording server at asciinema.pivoine.art
- PostgreSQL backend for recording persistence
- Email authentication via IONOS SMTP magic links
- Public/private recording visibility controls
- Embed recordings on any website
- Custom rose/magenta themed UI
Custom Theme (asciinema/theme/custom.css):
- Primary color: RGB(206, 39, 91) - Deep rose/magenta
- Dark charcoal backgrounds: HSL(0, 0%, 17.5%)
- High contrast design with bold color accents
- Styled components: navigation, cards, forms, buttons, terminal player
- Smooth animations and hover effects
- Responsive design with mobile breakpoints
- Custom scrollbars, selection colors, loading states
Infrastructure Updates:
- PostgreSQL: Added `asciinema` database to init script
- arty.yml: Added ASCIINEMA_* environment variables
- compose.yaml: Included asciinema stack in root composition
- CLAUDE.md: Comprehensive documentation with CLI setup guide
- Backup: Added asciinema-backup plan (11 AM daily, 7d/4w/6m/2y retention)
Configuration:
- URL: https://asciinema.pivoine.art
- Database: PostgreSQL `asciinema` database
- SMTP: Email auth via IONOS SMTP
- Unclaimed TTL: 30 days (auto-cleanup)
- Secret: Generated 64-char hex key in .env
Features:
- Record terminal sessions with asciinema CLI
- Web player with play/pause controls and speed adjustment
- User profiles with personal recording collections
- Embed recordings via iframe or direct links
- Privacy controls (public/private recordings)
- Automatic cleanup of unclaimed recordings
Integration Points:
- Documentation: Embed terminal demos
- Blog posts: Share command-line tutorials
- GitHub: Link recordings in README files
- Tutorials: Interactive terminal walkthroughs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 02:00:20 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE asciinema TO $POSTGRES_USER;
|
2025-11-14 20:40:53 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE koel TO $POSTGRES_USER;
|
2025-11-15 07:21:15 +01:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE ampache TO $POSTGRES_USER;
|
2025-10-25 13:52:01 +02:00
|
|
|
|
|
|
|
|
-- Log success
|
|
|
|
|
SELECT 'Compose databases initialized:' AS status;
|
feat: add Scrapy, n8n, and Filestash stacks to Falcon
Added three new service stacks to the docker-compose infrastructure:
- **Scrapy stack** (scrapy.pivoine.art):
- scrapyd: Web scraping daemon with web interface (port 6800)
- scrapy: Development container for spider commands
- scrapyrt: Real-time API for running spiders (port 9080)
- **n8n stack** (n8n.pivoine.art):
- Workflow automation platform with PostgreSQL backend
- 200+ integrations for automated tasks
- Runners enabled for task execution
- Webhook support for external triggers
- **Filestash stack** (stash.pivoine.art):
- Web-based file manager with multi-backend support
- Supports SFTP, S3, Dropbox, Google Drive, FTP, WebDAV
- In-browser file viewing and media playback
Infrastructure updates:
- Updated PostgreSQL init script to create n8n database
- Added environment variables to arty.yml for all three stacks
- Updated compose.yaml include list
- Updated CLAUDE.md and README.md documentation
- Normalized service names in existing stacks (gotify, proxy, umami, vpn)
All services integrated with Traefik for SSL termination and include
Watchtower auto-update labels.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 22:36:13 +01:00
|
|
|
SELECT datname FROM pg_database
|
2025-11-15 07:21:15 +01:00
|
|
|
WHERE datname IN ('directus', 'umami', 'n8n', 'linkwarden', 'joplin', 'mattermost', 'tandoor', 'asciinema', 'koel', 'ampache')
|
2025-10-25 13:52:01 +02:00
|
|
|
ORDER BY datname;
|
|
|
|
|
EOSQL
|
|
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "✓ PostgreSQL initialization completed"
|
|
|
|
|
echo "✓ All compose databases created successfully"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Databases available:"
|
|
|
|
|
echo " • directus - Sexy application database"
|
|
|
|
|
echo " • umami - Tracking database"
|
feat: add Scrapy, n8n, and Filestash stacks to Falcon
Added three new service stacks to the docker-compose infrastructure:
- **Scrapy stack** (scrapy.pivoine.art):
- scrapyd: Web scraping daemon with web interface (port 6800)
- scrapy: Development container for spider commands
- scrapyrt: Real-time API for running spiders (port 9080)
- **n8n stack** (n8n.pivoine.art):
- Workflow automation platform with PostgreSQL backend
- 200+ integrations for automated tasks
- Runners enabled for task execution
- Webhook support for external triggers
- **Filestash stack** (stash.pivoine.art):
- Web-based file manager with multi-backend support
- Supports SFTP, S3, Dropbox, Google Drive, FTP, WebDAV
- In-browser file viewing and media playback
Infrastructure updates:
- Updated PostgreSQL init script to create n8n database
- Added environment variables to arty.yml for all three stacks
- Updated compose.yaml include list
- Updated CLAUDE.md and README.md documentation
- Normalized service names in existing stacks (gotify, proxy, umami, vpn)
All services integrated with Traefik for SSL termination and include
Watchtower auto-update labels.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 22:36:13 +01:00
|
|
|
echo " • n8n - Workflow automation database"
|
2025-11-06 07:49:49 +01:00
|
|
|
echo " • linkwarden - Bookmark manager database"
|
2025-11-06 12:24:07 +01:00
|
|
|
echo " • joplin - Note-taking server database"
|
2025-11-08 19:43:11 +01:00
|
|
|
echo " • mattermost - Chat platform database"
|
2025-11-08 20:54:48 +01:00
|
|
|
echo " • tandoor - Recipe manager database"
|
feat: add Asciinema terminal recording server stack
Added new asciinema stack for self-hosted terminal recording and sharing
platform with custom "Pivoine" theme inspired by pivoine.art aesthetic.
New Services:
- **asciinema**: Terminal recording server at asciinema.pivoine.art
- PostgreSQL backend for recording persistence
- Email authentication via IONOS SMTP magic links
- Public/private recording visibility controls
- Embed recordings on any website
- Custom rose/magenta themed UI
Custom Theme (asciinema/theme/custom.css):
- Primary color: RGB(206, 39, 91) - Deep rose/magenta
- Dark charcoal backgrounds: HSL(0, 0%, 17.5%)
- High contrast design with bold color accents
- Styled components: navigation, cards, forms, buttons, terminal player
- Smooth animations and hover effects
- Responsive design with mobile breakpoints
- Custom scrollbars, selection colors, loading states
Infrastructure Updates:
- PostgreSQL: Added `asciinema` database to init script
- arty.yml: Added ASCIINEMA_* environment variables
- compose.yaml: Included asciinema stack in root composition
- CLAUDE.md: Comprehensive documentation with CLI setup guide
- Backup: Added asciinema-backup plan (11 AM daily, 7d/4w/6m/2y retention)
Configuration:
- URL: https://asciinema.pivoine.art
- Database: PostgreSQL `asciinema` database
- SMTP: Email auth via IONOS SMTP
- Unclaimed TTL: 30 days (auto-cleanup)
- Secret: Generated 64-char hex key in .env
Features:
- Record terminal sessions with asciinema CLI
- Web player with play/pause controls and speed adjustment
- User profiles with personal recording collections
- Embed recordings via iframe or direct links
- Privacy controls (public/private recordings)
- Automatic cleanup of unclaimed recordings
Integration Points:
- Documentation: Embed terminal demos
- Blog posts: Share command-line tutorials
- GitHub: Link recordings in README files
- Tutorials: Interactive terminal walkthroughs
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 02:00:20 +01:00
|
|
|
echo " • asciinema - Terminal recording server database"
|
2025-11-14 20:40:53 +01:00
|
|
|
echo " • koel - Music streaming server database"
|
2025-11-15 07:21:15 +01:00
|
|
|
echo " • ampache - Music streaming server database"
|
2025-10-25 13:52:01 +02:00
|
|
|
echo ""
|