Skip to content

d4sw4r/blokhouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

456 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

🏠 Blokhouse

Your infrastructure, block by block.

License: MIT CI Docker Version

Blokhouse is a simple, automation-first open source CMDB. Track your infrastructure assets and power your automation tools β€” Ansible, Puppet, Chef, and custom REST API scripts.

✨ Features

  • Configuration Items β€” manage assets with custom fields, tags, and types
  • Ansible Dynamic Inventory β€” plug directly into your playbooks
  • Puppet ENC β€” External Node Classifier for Puppet masters
  • Chef Integration β€” node inventory and data bags
  • REST API β€” full OpenAPI/Swagger documentation at /docs
  • Relationship Graph β€” visualize asset dependencies
  • Audit Logs β€” track every change
  • Maintenance Schedules β€” plan downtime
  • Notifications β€” stay informed
  • CSV Import/Export β€” bulk operations
  • Dark Mode β€” for the night owls
  • Docker support β€” run anywhere

πŸš€ Quick Start (Docker β€” recommended)

# 1. Download the compose file and create your env
curl -O https://raw.githubusercontent.com/d4sw4r/blokhouse/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/d4sw4r/blokhouse/main/.env.example
cp .env.example .env

# 2. Generate a secure secret and add it to .env
echo "NEXTAUTH_SECRET=$(openssl rand -hex 32)" >> .env

# 3. Start
docker compose up -d

Open http://localhost:3000. The admin credentials are printed in the container logs:

docker compose logs app | grep -i password

Login: admin@example.com / (generated password from logs)

πŸš€ Quick Start (Install Script)

No Docker? One command installs and starts Blokhouse using Node.js directly:

curl -sSL https://raw.githubusercontent.com/d4sw4r/blokhouse/main/install.sh | sudo bash

Requirements: Node.js >= 18, npm, git

The script prints the generated admin password at the end β€” save it.

πŸ”§ Manual Setup (Development)

git clone https://github.com/d4sw4r/blokhouse.git
cd blokhouse
cp .env.example .env
# Edit .env: set NEXTAUTH_SECRET=$(openssl rand -hex 32)
npm install
npx prisma db push
npx prisma db seed
npm run dev

πŸ”Œ Integrations

Ansible Dynamic Inventory

# my-dynamic-inventory.yml
plugin: uri
url: http://localhost:3000/api/ansible
validate_certs: false

Puppet ENC

# /etc/puppetlabs/puppet/puppet.conf
[master]
external_nodes = curl -sf -H 'Authorization: Bearer YOUR_TOKEN' http://localhost:3000/api/puppet?node=%s
node_terminus  = exec

Chef

curl -H 'Authorization: Bearer YOUR_TOKEN' http://localhost:3000/api/chef

πŸ“– API Documentation

Visit /docs for the interactive Swagger UI or fetch the raw spec:

curl http://localhost:3000/api/docs

Generate API tokens under Settings β†’ API Tokens in the web UI.

πŸ“š Documentation

❓ Troubleshooting

Docker: no matching manifest for linux/arm64

The image didn't include your platform. Pull the latest image (rebuilt with multi-arch support):

docker compose pull
docker compose up -d
DATABASE_URL must start with postgresql://

You are running a stale Docker image. Pull the latest:

docker compose pull && docker compose up -d
datasource.url property is required

The DATABASE_URL environment variable is not set. Make sure your .env file exists and contains it:

cat .env | grep DATABASE_URL
# Should show: DATABASE_URL=file:./prisma/blokhouse.db

For the install script, re-run it β€” it now sources .env automatically.

Port 3000 already in use

Change the host port in docker-compose.yml:

ports:
  - "3001:3000"   # change 3001 to any free port
Blank page or redirect loop after login

Check that NEXTAUTH_URL in your .env matches the URL you are actually using in the browser (including port). Also try clearing browser cookies for localhost.

🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

πŸ“„ License

MIT β€” see LICENSE

About

Simple CMDB with a automation first approach

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors