A collection of tools and scripts for managing infrastructure, databases, and related services for the Scaling Team.
This repository contains automation scripts, documentation, and tooling for common operational tasks. The repository is organized to scale as new tools are added.
The most common task - setting up passwordless authentication for CockroachDB:
# Complete automated setup (recommended)
./scripts/cockroachdb/auth/setup-passwordless-login.sh --username your-username
# Or step-by-step:
# 1. Configure user
./scripts/cockroachdb/auth/configure-user-passwordless.sh --username your-username
# 2. Generate certificate
./scripts/cockroachdb/certificates/generate-client-cert.sh --username your-username --ca amazingbadger
# 3. Connect
./scripts/cockroachdb/auth/connect-cockroachdb.sh --username your-usernameSee Passwordless Login Setup Guide for detailed instructions.
Upload a CA certificate to CockroachDB Cloud:
export COCKROACH_API_KEY='<your-api-key>'
./scripts/cockroachdb/certificates/upload-ca-cert-to-cockroachdb.sh \
--cluster <cluster-id> \
--certificate path/to/ca.crtSee CA Certificate Upload Guide for detailed instructions.
.
├── scripts/ # All executable scripts
│ ├── cockroachdb/ # CockroachDB-specific scripts
│ │ ├── auth/ # Authentication & user management
│ │ ├── certificates/ # Certificate management
│ │ └── vault/ # Vault PKI integration
│ └── teleport/ # Teleport-specific scripts
├── docs/ # All documentation
│ ├── getting-started/ # User-facing guides
│ ├── reference/ # Reference documentation
│ │ ├── scripts/ # Script documentation
│ │ └── concepts/ # Conceptual docs
│ └── archive/ # Historical/legacy docs
├── certificates/ # Certificate storage (gitignored)
├── templates/ # Script templates for new tools
└── README.md # This file
setup-passwordless-login.sh- Complete end-to-end setup for passwordless authenticationconfigure-user-passwordless.sh- Configure users withPASSWORD NULLfor certificate-only authenticationconnect-cockroachdb.sh- Connection helper that automatically includes client certificates
generate-client-cert.sh- Generate client certificates signed by trusted CAs- Supports: amazingduck, amazingbadger, teleport, vault
check-cockroachdb-ca-cert.sh- Check existing client CA certificates configured in CockroachDB Cloudupload-ca-cert-to-cockroachdb.sh- Upload CA certificates to CockroachDB Cloud (with backup and concatenation support)
setup-vault-pki-cockroachdb.sh- Set up Vault PKI secrets engine and generate root CA (one-time per environment)extract-vault-pki-ca.sh- Extract CA certificate from Vault PKI for upload to CockroachDB Cloud
extract-teleport-ca-cert.sh- Extract Teleport CA certificate from Kubernetes
Start here for step-by-step instructions:
- Passwordless Login Setup - Complete guide for passwordless authentication
- Certificate Generation Walkthrough - Manual certificate generation commands
- CA Certificate Upload - Upload CA certificates to CockroachDB Cloud
- Login Instructions - Quick reference for connections
- Create API Key Guide - How to create CockroachDB Cloud API keys
Detailed reference material:
- Documentation Index - Complete documentation navigation
- Reference Documentation - Script and concept references
- CA Certificate Behavior - How CA certificate uploads work
Historical documentation preserved for reference:
- Archive - Historical guides, support requests, and decision records
# Option 1: Automated (recommended)
./scripts/cockroachdb/auth/setup-passwordless-login.sh --username newuser
# Option 2: Manual steps
./scripts/cockroachdb/auth/configure-user-passwordless.sh --username newuser
./scripts/cockroachdb/certificates/generate-client-cert.sh --username newuser --ca amazingbadger
./scripts/cockroachdb/auth/connect-cockroachdb.sh --username newuser# 1. Set up Vault PKI (one-time per environment)
./scripts/cockroachdb/vault/setup-vault-pki-cockroachdb.sh --environment dev
# 2. Upload CA to CockroachDB Cloud
./scripts/cockroachdb/certificates/upload-ca-cert-to-cockroachdb.sh \
--cluster <cluster-id> \
--vault-extract \
--vault-environment dev
# 3. Generate certificate and configure user
./scripts/cockroachdb/auth/setup-passwordless-login.sh \
--username frameio-dev-service \
--ca vault \
--environment dev# Check existing certificates
./scripts/cockroachdb/certificates/check-cockroachdb-ca-cert.sh <cluster-id>
# Upload new certificate (with automatic backup)
./scripts/cockroachdb/certificates/upload-ca-cert-to-cockroachdb.sh \
--cluster <cluster-id> \
--certificate path/to/new-ca.crtMost scripts require:
bash(version 4+)openssl(for certificate operations)kubectl(for Kubernetes CA options)cockroachCLI orpsql(for database connections)vaultCLI (for Vault PKI options)jq(optional, for JSON parsing)
- Never commit private keys (
.keyfiles) to git - they are automatically excluded - Delete CA private keys after generating client certificates
- Set proper permissions:
chmod 600 certificates/clients/*.key - Rotate certificates periodically (default validity: 365 days)
- Use environment variables for sensitive values (API keys, tokens)
When adding new tools:
- Organize by category - Place scripts in appropriate subdirectories under
scripts/ - Follow naming conventions - Use lowercase with hyphens for scripts and docs
- Document thoroughly - Add getting started guides and reference docs
- Use the template - Start from
templates/script-template.shfor consistency - Update this README - Add new tools to the appropriate sections
See templates/script-template.sh for script development guidelines.
- GitOps Repository - Infrastructure configuration managed in gitops repository
- CockroachDB Cloud Console - https://cockroachlabs.cloud
- CockroachDB Documentation - https://www.cockroachlabs.com/docs/
If you encounter issues:
- Check the troubleshooting sections in the relevant getting started guide
- Review reference documentation for detailed information
- Check archive for historical context on similar issues
- Contact the Scaling Team
Repository Structure: This repository is organized to scale as new tools are added. Scripts are categorized by service/tool, and documentation is separated into getting started guides and reference material.