diff --git a/bootstrap_db_nice_names.py b/bootstrap_db_nice_names.py index 774cd04..7221b84 100644 --- a/bootstrap_db_nice_names.py +++ b/bootstrap_db_nice_names.py @@ -224,15 +224,15 @@ REGION_DEFS = [ "name": "Adelaide - Morphett St", "country": "Australia", "abbreviation": "AU-ADL1", - "enrollment_key": "a", - "ip_address_range_northsouth": "192.168.50.0/24", - "ip_address_range_eastwest": "192.168.60.0/24", + "enrollment_key": str(uuid.uuid4()), + "ip_address_range_northsouth": "192.168.11.0/24", + "ip_address_range_eastwest": "192.168.12.0/24", }, { "forced_id": "f0da9f0c-52f4-4259-af6d-ec14d7473efb", - "name": "Singapore - HyperSwitch XXL DC", - "country": "Singapore", - "abbreviation": "SIN1", + "name": "Norway", + "country": "Norway", + "abbreviation": "NN1", "enrollment_key": "62ea314d-d372-4bb1-b906-8cc77d757187", "ip_address_range_northsouth": "10.10.10.0/24", "ip_address_range_eastwest": "10.10.20.0/24", @@ -253,13 +253,13 @@ UNIVERSE_DEFS = ["Universe 0", "Universe 1", "Universe 2"] PROJECT_DEFS = [ ("Acme", "Universe 0"), ("Sunny Corp", "Universe 1"), - ("Widget Co", "Universe 2"), + ("Norway Production", "Universe 2"), ] # VDC → (ProjectName, RegionName) VDC_DEFS = { "AcmeDevEnv": ("Acme", "Adelaide - Morphett St"), - "Fidget spinner research": ("Widget Co", "Singapore - HyperSwitch XXL DC"), + "Fidget spinner research": ("Norway Production", "Norway"), "Sunny Corp - Dev": ("Sunny Corp", "Sydney - Global switch"), "Sunny Corp - Test": ("Sunny Corp", "Sydney - Global switch"), } diff --git a/docs/dev-init a new db.md b/docs/dev-init a new db.md new file mode 100644 index 0000000..ae350b0 --- /dev/null +++ b/docs/dev-init a new db.md @@ -0,0 +1,41 @@ +root@deb9a30c3cd5:/app# python3 manage.py migrations:apply +-----In init---------- +2026-02-04 02:58:10 - INFO - RequestID:[pid:388|thr:MainThread] - - Environment variables loaded from .env +2026-02-04 02:58:10 - INFO - RequestID:[pid:388|thr:MainThread] - - Cloudflare configuration set (token=, account_id=)zone_id=) +in celery +2026-02-04 02:58:10 - DEBUG - RequestID:[pid:388|thr:MainThread] - - __init__ complete +INFO:__main__:Applying migrations to database … +INFO [alembic.runtime.migration] Context impl MySQLImpl. +INFO [alembic.runtime.migration] Will assume non-transactional DDL. +INFO [alembic.runtime.migration] Running upgrade -> 879385f419fb, First +INFO [alembic.runtime.migration] Running upgrade 879385f419fb -> 5355aba46f23, schema update +INFO [alembic.runtime.migration] Running upgrade 5355aba46f23 -> eadc45347e95, schema update +INFO [alembic.runtime.migration] Running upgrade eadc45347e95 -> 75bed14faf79, Add ovs fallback +root@deb9a30c3cd5:/app# python3 bootstrap_db_nice_names.py +-----In init---------- +2026-02-04 02:58:28 - INFO - RequestID:[pid:403|thr:MainThread] - - Environment variables loaded from .env +2026-02-04 02:58:28 - INFO - RequestID:[pid:403|thr:MainThread] - - Cloudflare configuration set (token=, account_id=)zone_id=) +in celery +2026-02-04 02:58:28 - DEBUG - RequestID:[pid:403|thr:MainThread] - - __init__ complete +INFO:xcloudify.bootstrap:Starting xCloudify deterministic bootstrap… +INFO:xcloudify.bootstrap:Created seed user System Admin. +INFO:xcloudify.bootstrap:Created Region: Adelaide - Morphett St (AU-ADL1) id=1 +INFO:xcloudify.bootstrap:Created Region: Singapore - HyperSwitch XXL DC (SIN1) id=f0da9f0c-52f4-4259-af6d-ec14d7473efb +INFO:xcloudify.bootstrap:Created Region: Sydney - Global switch (AU-SYD1) id=3e657699-44bc-4511-bc4a-1b76a07f6e8a +INFO:xcloudify.bootstrap:Created Universe: Universe 0 +INFO:xcloudify.bootstrap:Created Universe: Universe 1 +INFO:xcloudify.bootstrap:Created Universe: Universe 2 +INFO:xcloudify.bootstrap:Created Project: Acme in Universe 0 +INFO:xcloudify.bootstrap:Created Project: Sunny Corp in Universe 1 +INFO:xcloudify.bootstrap:Created Project: Widget Co in Universe 2 +INFO:xcloudify.bootstrap:Ensured VDC: AcmeDevEnv → Project=Acme, Region=Adelaide - Morphett St +INFO:xcloudify.bootstrap:Ensured VDC: Fidget spinner research → Project=Widget Co, Region=Singapore - HyperSwitch XXL DC +INFO:xcloudify.bootstrap:Ensured VDC: Sunny Corp - Dev → Project=Sunny Corp, Region=Sydney - Global switch +INFO:xcloudify.bootstrap:Ensured VDC: Sunny Corp - Test → Project=Sunny Corp, Region=Sydney - Global switch +INFO:xcloudify.bootstrap:Ensured network and ports for VDC AcmeDevEnv: VNI=10010, CIDR=192.168.10.0/24 +INFO:xcloudify.bootstrap:Ensured network and ports for VDC Fidget spinner research: VNI=10020, CIDR=192.168.20.0/24 +INFO:xcloudify.bootstrap:Ensured network and ports for VDC Sunny Corp - Dev: VNI=10030, CIDR=192.168.30.0/24 +INFO:xcloudify.bootstrap:Ensured network and ports for VDC Sunny Corp - Test: VNI=10031, CIDR=192.168.31.0/24 +INFO:xcloudify.bootstrap:xCloudify deterministic bootstrap completed successfully. +root@deb9a30c3cd5:/app# + diff --git a/docs/major todo items.md b/docs/major todo items.md index 6b132b5..6bf5851 100644 --- a/docs/major todo items.md +++ b/docs/major todo items.md @@ -376,57 +376,4 @@ Port forwardings get fucked up on reconciliation On the worker, when creating a container, if the payload for container creation specifies a network port then dont use the docker bridge. Create the nscontroller with no networking becuase later on we will shove an ovs port into it's namespace, therby enabling networking. ---------------- - -You are an expert Hugo documentation builder tasked with creating comprehensive, user-facing documentation for this project from the ground up. Focus exclusively on end-user guidance: explain how users interact with and leverage the application's features, not internal administration or management. - -**Step 1: Project Setup** -- Create a new folder named `user_facing_docs` in the root of this application. -- Initialize it as a fully functional Hugo project: - - Run `hugo new site user_facing_docs` (or equivalent commands to bootstrap). - - Install and configure a user-friendly theme like "hugo-book" or "docsy" via `git submodule add` or `hugo theme create`. - - Set up `config.toml` (or YAML/TOML equivalent) with: - - Site title: "User Guide - [Project Name]" - - BaseURL: "/" - - Language: "en" - - Enable features like search, menus, and taxonomies. - - Define a top-level navigation menu with high-level categories: Virtual Machines, Containers, Storage, Certificates, DNS, Cloudflare (Public DNS), and any other categories derived from existing code features (e.g., Networking, Backups if present). - - Create necessary archetypes for content (e.g., `layouts/_default/single.html` if needed for custom pages). - - Add a homepage (`content/_index.md`) with a welcoming overview, quick-start guide, and links to categories. - -**Step 2: Content Structure and Guidelines** -- Organize content hierarchically under `content/`: - - Each high-level category gets its own subfolder (e.g., `content/virtual-machines/`, `content/containers/`). - - Within each category folder: - - Add an index page (`_index.md`) with an overview of the category. - - Create subpages for specific features/functions (e.g., `content/virtual-machines/create.md`, `content/containers/deploy.md`). -- **Content Requirements for Each Feature/Page** (derive 100% from the codebase—only document implemented, working capabilities): - - **What it does**: Clear, concise explanation in plain English. - - **Capabilities**: List supported features, options, parameters, and limitations (e.g., "Supports KVM/QEMU hypervisors with up to 32 vCPUs"). - - **Example Use Cases**: Provide 2-3 practical scenarios with copy-paste-ready code snippets: - - Bash examples using CLI commands (e.g., `app vm create --name myvm --cpus 4`). - - Python examples using API/SDK (e.g., via `requests` or official client library). - - Use Markdown best practices: Headings (H1-H3), code blocks with syntax highlighting (`bash`, `python`), tables for parameters, screenshots/diagrams if derivable from code/comments, short paragraphs, bullet points. - - Tone: Beginner-friendly, actionable, assume no prior admin knowledge—focus on "how to use this to achieve X." -- Categories to cover (expand based on code inspection): - | Category | Key Subtopics (Adapt to Code) | - |-------------------|-------------------------------| - | Virtual Machines | Provisioning, snapshots, scaling, migration | - | Containers | Deployment, orchestration, scaling, networking | - | Storage | Volumes, snapshots, backups, mounting | - | Certificates | Issuance, renewal, TLS setup | - | DNS | Record management, zones, queries | - | Cloudflare (Public DNS) | Integration, proxying, caching | - -**Step 3: Polish and Functionality** -- Ensure full Hugo functionality: Run `hugo server` locally to verify no build errors, responsive design, working navigation, search indexing. -- Add global elements: - - Sidebar with table of contents, version selector (if applicable), feedback form. - - Footer with links to GitHub, support. - - 404 page, robots.txt, sitemap. -- Optimize for users: Fast-loading, mobile-friendly, SEO with meta descriptions. -- Output the complete folder structure with all files generated, ready for `hugo deploy` or static hosting. - -The final deliverable is a production-ready, fully functional Hugo site in `user_facing_docs/` containing accurate, code-derived documentation for all user-facing features. Provide the full directory tree and key file contents in your response. - - +When deleting VDC's and regions, check for child objects and either block or recursively delete all items - super dangerous!