Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0eee3c6
Merge pull request #3 from abevz/feature/improvements
abevz Sep 2, 2025
f8a859e
Update RELEASE_NOTES.md with security and code quality improvements
abevz Sep 2, 2025
9299f5f
🔧 Hotfix v1.1.1: Fix critical status command bugs (#5)
abevz Sep 3, 2025
4821ad9
fix: hotfix v1.1.2 - restore addon functionality and fix all module bugs
abevz Sep 3, 2025
c694519
docs: Add release notes for v1.1.2 hotfix
abevz Sep 3, 2025
10e0a16
🚀 Modular Addon System - Complete Architecture Redesign (v1.2.0) (#7)
abevz Sep 5, 2025
37025a5
feat: update core module secrets mapping and add VS Code settings (#8)
abevz Sep 8, 2025
25e49bc
docs: add comprehensive secrets management guide and update documenta…
abevz Sep 8, 2025
45572bb
refactor: completely refactor 60_tofu.sh module for better maintainab…
abevz Sep 8, 2025
bfaf407
Add comprehensive unit tests for refactored 60_tofu.sh functions
abevz Sep 8, 2025
592fcca
Add comprehensive pytest test suite for refactored 60_tofu.sh functions
abevz Sep 8, 2025
4ace271
Fix automatic environment loading and Proxmox API authentication
abevz Sep 8, 2025
b235610
🎉 Fix Kubernetes connectivity and add comprehensive unit tests
abevz Sep 8, 2025
30467a1
Fix configuration inconsistency and improve test isolation
abevz Sep 8, 2025
1a965df
Fix ./cpc ctx command and workspace management
abevz Sep 10, 2025
5f8415a
Clean up test artifacts and temporary files
abevz Sep 10, 2025
0c8b298
feat: Refactor tofu module and fix AWS credentials handling
abevz Sep 10, 2025
080a15b
🔄 Restore deleted test files from commit 5f8415a
abevz Sep 10, 2025
5a86d80
feat: Add workspace command support with backward compatibility
abevz Sep 10, 2025
8514d41
feat: Comprehensive Ansible module refactoring and testing
abevz Sep 10, 2025
f56cab7
feat: Comprehensive pytest test suite for 00_core.sh module
abevz Sep 10, 2025
e2db05e
Fix Ansible playbook syntax error and refactor k8s_cluster module
abevz Sep 11, 2025
85d4cbb
fix: resolve k8s_get_kubeconfig certificate corruption and add compre…
abevz Sep 11, 2025
c9f70f8
enhance: Comprehensive test runner infrastructure improvements
abevz Sep 11, 2025
db35552
Fix k8s_nodes module and add uncordon functionality
abevz Sep 12, 2025
08ad75a
Add comprehensive unit tests for 10_proxmox module
abevz Sep 12, 2025
ce934d4
Improve Proxmox module and hostname generation system
abevz Sep 12, 2025
84f8e8e
Add Python test cache to .gitignore
abevz Sep 12, 2025
67da7aa
Remove pycache file from git tracking
abevz Sep 12, 2025
4d2a76d
Add comprehensive pytest test suite for k8s_nodes module
abevz Sep 12, 2025
0487581
feat(testing): Add tests for cluster_ops and refactor module
abevz Sep 13, 2025
b5b001e
fix(refactor): Correct stdout/stderr pollution in helper function
abevz Sep 14, 2025
0e95813
fix(ops): Correct CoreDNS config and validation logic
abevz Sep 14, 2025
99e6083
fix(ops): Correct CoreDNS config and validation logic
abevz Sep 14, 2025
75b5787
feat(refactor): Refactor 70_dns_ssl.sh module
abevz Sep 14, 2025
478eb8d
fix(tests): Ensure test runner restores original CPC context and isol…
abevz Sep 14, 2025
cd372e8
feat(testing): overhaul and repair test suite
abevz Sep 15, 2025
227050e
feat(ssh): Refactor SSH module and add robust test suite
abevz Sep 16, 2025
0f587bb
feat(testing): Create comprehensive unit test suite
abevz Sep 16, 2025
6d31184
feat(linting): Integrate shellcheck and tflint
abevz Sep 16, 2025
88e0d74
feat(security): Major security improvements and release preparation
abevz Sep 19, 2025
c12b953
Security: Fix critical and medium-priority vulnerabilities
abevz Sep 19, 2025
7160f2e
Merge branch 'main' into feature/multicloud
abevz Sep 19, 2025
4ae4403
fix: resolve shellcheck SC2168 errors and add tflint to CI
abevz Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Linting

on:
pull_request:
branches:
- main
- 'feature/**'

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install shellcheck
run: sudo apt-get update && sudo apt-get install -y shellcheck

- name: Run shellcheck
run: make lint-shell

tflint:
name: TFLint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install tflint
run: |
TFLINT_VERSION=$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep '"tag_name"' | cut -d'"' -f4 | sed 's/v//')
wget "https://github.com/terraform-linters/tflint/releases/download/v${TFLINT_VERSION}/tflint_linux_amd64.zip"
unzip tflint_linux_amd64.zip
sudo mv tflint /usr/local/bin/

- name: Run tflint
run: cd terraform && tflint
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,18 @@ cpc.env
secrets.sops.yaml
terraform_state.json
terraform/snippets/summary.txt

# Gemini-generated files
GEMINI.md
TEST_COMPLIANCE_REPORT.md

# Test environment files
envs/test-clone.env
envs/ubuntu-test.env

# Log files
kube-bench-full.log

# Temp files
tmp/
next_step.md
2 changes: 2 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore SC2086 (Double quote to prevent globbing and word splitting)
disable=SC2086
Comment thread
abevz marked this conversation as resolved.
3 changes: 3 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config {
preset = "all"
}
75 changes: 75 additions & 0 deletions CPC_AUTO_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# CPC Auto Environment Loading

## Overview
CPC now supports automatic loading of environment variables into your shell session. This allows you to access secrets and configuration variables in your terminal without running `cpc load_secrets` manually.

## Commands

### `cpc auto`
Loads all environment variables and outputs export commands for shell sourcing.

```bash
# View available variables
./cpc auto

# Load variables into current shell
eval "$(./cpc auto 2>/dev/null | grep -E '^export ')"

# Load variables into new shell
zsh -c 'eval "$(./cpc auto 2>/dev/null | grep -E \"^export \")" && ./cpc ctx'
```

### `cpc-auto` script
Simple wrapper script for loading environment variables.

```bash
# Load variables into current shell
./cpc-auto

# Use in new shell
zsh -c './cpc-auto && ./cpc ctx'
```

## What gets loaded

The auto-loading system loads variables from:

1. **Global configuration** (`cpc.env`):
- Proxmox connection settings
- General project configuration

2. **Workspace configuration** (`envs/{context}.env`):
- Kubernetes versions
- VM specifications
- DNS settings
- Template configurations

3. **Secrets** (`terraform/secrets.sops.yaml`):
- Proxmox credentials
- SSH keys
- Cloud provider credentials
- Docker registry credentials

## Usage Examples

```bash
# Load variables and run tofu
./cpc-auto && tofu plan

# Load variables and check cluster status
./cpc-auto && ./cpc cluster-info

# Use in scripts
#!/bin/bash
./cpc-auto
echo "Using TEMPLATE_VM_ID: $TEMPLATE_VM_ID"
echo "Using AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID"
```

## Troubleshooting

If you encounter AWS credential errors in tofu/OpenTofu, make sure to load the environment variables first:

```bash
./cpc-auto && tofu workspace select k8s133
```
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# CPC Project Makefile
# Provides convenient commands for development, testing, and maintenance

.PHONY: help test test-unit test-integration lint lint-shell lint-ansible clean setup dev-setup
.PHONY: help test test-unit test-integration lint lint-shell lint-ansible clean setup dev-setup security

# Default target
help:
@echo "CPC Project Makefile"
@echo "==================="
@echo ""
@echo "Available targets:"
@echo " security - Run security checks for secrets"
@echo " test - Run all tests"
@echo " test-unit - Run unit tests only"
@echo " test-integration - Run integration tests only"
Expand All @@ -34,17 +35,25 @@ test-integration:
python -m pytest tests/integration/ -v --tb=short

# Linting targets
lint: lint-shell lint-ansible
lint: lint-shell lint-tf lint-ansible

lint-shell:
@echo "Running shell linting..."
shellcheck cpc modules/*.sh
bashate cpc modules/*.sh
find . -name "*.sh" -not -path "./.git/*" -print0 | xargs -0 shellcheck

lint-tf:
@echo "Running Terraform linting..."
cd terraform && tflint

lint-ansible:
@echo "Running Ansible linting..."
ansible-lint ansible/playbooks/

# Security targets
security:
@echo "Running security checks..."
./scripts/security_check.sh

# Cleanup
clean:
@echo "Cleaning up..."
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## 📋 Table of Contents

- [🔒 Security & Secrets](#-security--secrets)
- [🎯 Overview](#-overview)
- [✨ Key Features](#-key-features)
- [🚀 Quick Start](#-quick-start)
Expand All @@ -26,6 +27,29 @@

---

## 🔒 Security & Secrets

**⚠️ IMPORTANT**: This project handles sensitive information including API keys, passwords, and tokens. Always follow security best practices:

### 🚨 Never Commit Secrets
- **DO NOT** commit files containing real secrets to version control
- Use `secrets.sops.yaml` (encrypted with SOPS) for sensitive data
- Temporary files like `secrets_temp.yaml` are **automatically ignored**
- Always run `gitleaks detect` before pushing to check for exposed secrets

### 🔐 Secret Management
- Use [SOPS](https://github.com/getsops/sops) for encrypting secrets
- Store encrypted secrets in `secrets.sops.yaml`
- Decrypt only when needed: `sops decrypt secrets.sops.yaml`
- Never store decrypted secrets in the repository

### 🛡️ Security Tools
- Run `gitleaks detect` regularly to scan for exposed secrets
- Use `.gitignore` to prevent accidental commits of sensitive files
- Rotate compromised credentials immediately

---

## 🎯 Overview

**CPC (Cluster Provisioning Control)** is a comprehensive, production-ready solution for deploying and managing Kubernetes clusters on Proxmox Virtual Environment. Built with infrastructure as code principles, it provides:
Expand Down
157 changes: 0 additions & 157 deletions RELEASE_PREPARATION.md

This file was deleted.

2 changes: 1 addition & 1 deletion ansible/addons/addon_discovery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ addon_display_interactive_menu() {
for addon in "${addons_in_cat[@]}"; do
local description
description=$(addon_get_description "$addon")
printf " %2d) %-30s - %s\n" $choice_num "$addon" "$description" >&2
printf " %2d) %-30s - %s\n" "$choice_num" "$addon" "$description" >&2
choice_to_addon[$choice_num]="$addon"
((choice_num++))
done
Expand Down
Loading
Loading