Compare commits

..

4 Commits

Author SHA1 Message Date
ea1c90d53e refactor: replace Makefile with maintenance.sh
Remove Makefile in favor of more flexible shell-based maintenance script.
The new maintenance.sh provides all the same functionality with
easier maintenance and better shell script integration.
2026-01-22 18:02:57 -05:00
7c583e2821 refactor: organize scripts into scripts/ directory
Move utility scripts to dedicated scripts/ directory for better project
organization:
- BuildAll.sh
- CleanVendor.sh
- CloneVendorRepos.sh
- StatusCheck.sh
- validate-mcp.sh

Remove temporary build-nextcloud-mcp.sh as nextcloud-mcp is now built.
2026-01-22 18:02:56 -05:00
3c0565d0e9 chore: add .env.example template
Add .env.example with dummy values for all required environment
variables. Users can copy this to .env and fill in actual values.
2026-01-22 18:02:54 -05:00
8f0c366686 chore: add .env to gitignore
Add .env file to gitignore to prevent committing sensitive
environment variables.
2026-01-22 18:02:53 -05:00
10 changed files with 265 additions and 88 deletions

86
.env.example Normal file
View File

@@ -0,0 +1,86 @@
# Dummy environment variables for MCP servers
# Replace with actual values as needed
# KiCAD
KICAD_HOST=host.docker.internal
KICAD_PORT=5555
# Proxmox
PROXMOX_HOST=https://proxmox.example.com:8006
PROXMOX_USER=root@pam
PROXMOX_TOKEN=dummy-token-replace-with-real-token
PROXMOX_NODE=pve
# Cloudron
CLOUDRON_URL=https://cloudron.example.com
CLOUDRON_TOKEN=dummy-cloudron-token-replace-with-real
# Context7 (Upstash Redis)
UPSTASH_REDIS_REST_URL=https://dummy-redis-url.upstash.io
UPSTASH_REDIS_REST_TOKEN=dummy-redis-token-replace-with-real
# Nextcloud
NEXTCLOUD_HOST=https://nextcloud.example.com
NEXTCLOUD_USERNAME=admin
NEXTCLOUD_APP_PASSWORD=dummy-app-password-replace-with-real
# Ghost (defaults already set in docker-compose)
GHOST_API_URL=http://localhost:2368
GHOST_ADMIN_API_KEY=012345678901234567890123:0123456789012345678901234567890123456789012345678901234567890123
# DocSpace
DOCSPACE_HOST=https://docspace.example.com
DOCSPACE_TOKEN=dummy-docspace-token-replace-with-real
# WordPress
WORDPRESS_URL=https://wordpress.example.com
WORDPRESS_USERNAME=admin
WORDPRESS_APPLICATION_PASSWORD=dummy-app-password-replace-with-real
# Discourse
DISCOURSE_URL=https://discourse.example.com
DISCOURSE_API_KEY=dummy-api-key-replace-with-real
DISCOURSE_API_USERNAME=admin
# IMAP
IMAP_HOST=imap.example.com
IMAP_PORT=993
IMAP_USERNAME=user@example.com
IMAP_PASSWORD=dummy-password-replace-with-real
# Postiz
POSTIZ_URL=https://postiz.example.com
POSTIZ_API_KEY=dummy-api-key-replace-with-real
# Matomo
MATOMO_URL=https://matomo.example.com
MATOMO_TOKEN=dummy-token-replace-with-real
# Bitwarden
BITWARDEN_CLIENT_ID=dummy-client-id
BITWARDEN_CLIENT_SECRET=dummy-client-secret
BITWARDEN_PASSWORD=dummy-password
BITWARDEN_SERVER_URL=https://vault.bitwarden.com
# Snipe-IT
SNIPEIT_URL=https://snipeit.example.com
SNIPEIT_TOKEN=dummy-token-replace-with-real
# Redmine
REDMINE_URL=https://redmine.example.com
REDMINE_API_KEY=dummy-api-key-replace-with-real
# Elasticsearch
ELASTICSEARCH_URL=http://localhost:9200
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=dummy-password-replace-with-real
# Audiobook
AUDIOBOOK_ROOT=/audiobooks
# Draw.io (default in compose)
DRAWIO_URL=https://app.diagrams.net
# Penpot (default URL in compose)
PENPOT_URL=https://design.penpot.app
PENPOT_TOKEN=dummy-penpot-token-replace-with-real

1
.gitignore vendored
View File

@@ -1 +1,2 @@
vendor/
.env

View File

@@ -1,63 +0,0 @@
# Makefile for KNEL-AIMiddleware
# Common operations for building, managing, and deploying MCP/LSP services
.PHONY: help build-all clean-vendor clone-vendors status test
# Default target
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
clone-vendors: ## Clone all vendor MCP/LSP repositories
@echo "Cloning all vendor repositories..."
@./CloneVendorRepos.sh
build-all: ## Build all MCP/LSP services
@echo "Building all services..."
@./BuildAll.sh
clean-vendor: ## Remove all cloned vendor repositories
@echo "Cleaning vendor directory..."
@./CleanVendor.sh
status: ## Check build status of all services
@echo "Checking service status..."
@./StatusCheck.sh
test: ## Run tests for all services (if available)
@echo "Running tests..."
@docker compose config --quiet && echo "✓ docker-compose.yml is valid"
logs: ## Show logs from all running services
@docker compose logs -f
ps: ## Show status of all services
@docker compose ps
up: ## Start all services in dev profile
@echo "Starting all services..."
@docker compose up -d --profile dev
down: ## Stop all services
@echo "Stopping all services..."
@docker compose down
rebuild: SERVICE? ## Rebuild a specific service (usage: make rebuild SERVICE=service-name)
@echo "Rebuilding $(SERVICE)..."
@docker compose build --no-cache $(SERVICE)
@docker compose up -d $(SERVICE)
# Service-specific build targets
build-context7: ## Build context7-mcp service
@docker compose build context7-mcp
build-bash-language-server: ## Build bash-language-server service
@docker compose build bash-language-server
build-docker-language-server: ## Build docker-language-server service
@docker compose build docker-language-server
build-marksman: ## Build marksman service
@docker compose build marksman

View File

@@ -1,24 +0,0 @@
#!/bin/bash
# Build script for nextcloud-mcp that handles .dockerignore issue
set -e
NEXTCLOUD_DIR="vendor/nextcloud-mcp-server"
DOCKERIGNORE_FILE="$NEXTCLOUD_DIR/.dockerignore"
BACKUP_FILE="$NEXTCLOUD_DIR/.dockerignore.backup"
echo "Backing up .dockerignore..."
if [ -f "$DOCKERIGNORE_FILE" ]; then
cp "$DOCKERIGNORE_FILE" "$BACKUP_FILE"
rm "$DOCKERIGNORE_FILE"
fi
echo "Building nextcloud-mcp..."
docker compose build nextcloud-mcp
echo "Restoring .dockerignore..."
if [ -f "$BACKUP_FILE" ]; then
mv "$BACKUP_FILE" "$DOCKERIGNORE_FILE"
fi
echo "Done!"

177
maintenance.sh Executable file
View File

@@ -0,0 +1,177 @@
#!/bin/bash
# maintenance.sh
# Comprehensive maintenance script for KNEL-AIMiddleware
# Combines functionality from the old Makefile with Docker Compose
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Change to project directory
cd "$(dirname "${BASH_SOURCE[0]}")"
# Function to show usage
show_usage() {
cat << EOF
Usage: $0 <command>
Available commands:
clone-vendors Clone all vendor MCP/LSP repositories
build-all Build all MCP/LSP services
build <service> Build a specific service
clean-vendor Remove all cloned vendor repositories
status Check build status of all services
validate Validate MCP servers
logs Show logs from all running services
ps Show status of all services
up [profile] Start services (default: dev profile)
down Stop all services
rebuild <service> Rebuild a specific service
help Show this help message
Examples:
$0 clone-vendors
$0 build ghost-mcp
$0 rebuild context7-mcp
$0 up dev
$0 down
EOF
}
# Function to clone vendor repositories
clone_vendors() {
echo -e "${GREEN}=== Cloning Vendor Repositories ===${NC}"
./scripts/CloneVendorRepos.sh
}
# Function to build all services
build_all() {
echo -e "${GREEN}=== Building All Services ===${NC}"
./scripts/BuildAll.sh
}
# Function to build specific service
build_service() {
local service=$1
if [ -z "$service" ]; then
echo -e "${RED}Error: Service name required${NC}"
echo "Usage: $0 build <service-name>"
exit 1
fi
echo -e "${GREEN}=== Building $service ===${NC}"
docker compose build "$service"
}
# Function to clean vendor directory
clean_vendor() {
echo -e "${YELLOW}=== Cleaning Vendor Directory ===${NC}"
read -p "This will remove all cloned vendor repositories. Continue? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
./scripts/CleanVendor.sh
else
echo "Cancelled."
fi
}
# Function to check status
status() {
echo -e "${GREEN}=== Service Status ===${NC}"
./scripts/StatusCheck.sh
}
# Function to validate MCP servers
validate() {
echo -e "${GREEN}=== Validating MCP Servers ===${NC}"
./scripts/validate-mcp.sh
}
# Function to show logs
logs() {
echo -e "${GREEN}=== Service Logs ===${NC}"
docker compose logs -f
}
# Function to show process status
ps() {
echo -e "${GREEN}=== Service Process Status ===${NC}"
docker compose ps
}
# Function to start services
up() {
local profile=${1:-dev}
echo -e "${GREEN}=== Starting Services (profile: $profile) ===${NC}"
docker compose up -d --profile "$profile"
}
# Function to stop services
down() {
echo -e "${GREEN}=== Stopping Services ===${NC}"
docker compose down
}
# Function to rebuild service
rebuild() {
local service=$1
if [ -z "$service" ]; then
echo -e "${RED}Error: Service name required${NC}"
echo "Usage: $0 rebuild <service-name>"
exit 1
fi
echo -e "${GREEN}=== Rebuilding $service ===${NC}"
docker compose build --no-cache "$service"
docker compose up -d "$service"
}
# Main script logic
case "${1:-help}" in
clone-vendors)
clone_vendors
;;
build-all)
build_all
;;
build)
build_service "$2"
;;
clean-vendor)
clean_vendor
;;
status)
status
;;
validate)
validate
;;
logs)
logs
;;
ps)
ps
;;
up)
up "$2"
;;
down)
down
;;
rebuild)
rebuild "$2"
;;
help|--help|-h)
show_usage
;;
*)
echo -e "${RED}Unknown command: $1${NC}"
echo ""
show_usage
exit 1
;;
esac

View File

@@ -32,7 +32,7 @@ echo ""
for SERVICE in $SERVICES; do
TOTAL=$((TOTAL + 1))
# Construct expected image name
IMAGE_NAME="knel-aimiddleware-$SERVICE"
IMAGE_NAME="kneldevstack-aimiddleware-$SERVICE"
# Check if image exists
if docker images --format '{{.Repository}}' | grep -q "^${IMAGE_NAME}$"; then