Skip to content

Deploying cState

Introduction

cState is a hyperfast, open-source status page generator built on Hugo that creates beautiful, static status pages without requiring a database or complex backend infrastructure. Designed for speed and simplicity, cState generates static HTML files that can be deployed anywhere, making it ideal for high-availability status communication.

Unlike traditional status page solutions that require databases and application servers, cState leverages Hugo’s static site generation to create lightning-fast pages that load in milliseconds. The entire status page is pre-rendered, eliminating server-side processing and database queries during page loads.

Key highlights of cState:

  • Hyperfast Performance: Static HTML pages load in under 100ms, even under heavy traffic
  • No Database Required: All data is stored in Markdown files and YAML configuration
  • Beautiful Themes: Modern, responsive design with customizable themes and branding
  • Incident Management: Track incidents, scheduled maintenance, and service status over time
  • Component Groups: Organize services into logical groups with individual status indicators
  • Multilingual Support: Built-in internationalization for global status pages
  • RSS Feeds: Automatic RSS/Atom feeds for incident updates
  • Git-Based Workflow: Manage incidents and configuration through version control
  • API Integration: Generate status updates programmatically via Git commits
  • 100% Open Source: MIT licensed with no vendor lock-in

This guide walks through deploying cState on Klutch.sh, configuring your services and components, and managing incidents effectively.

Why Deploy cState on Klutch.sh

Deploying cState on Klutch.sh provides several advantages for your status page infrastructure:

Simplified Deployment: Klutch.sh automatically builds your Hugo-based cState site from source, handling the static site generation without manual build steps.

High Availability: Static pages served through Klutch.sh’s infrastructure provide excellent uptime for your status communications.

HTTPS by Default: Automatic SSL certificates ensure secure access to your status page without configuration.

GitHub Integration: Connect your cState repository directly to Klutch.sh. Push incident updates to GitHub, and they appear on your status page within seconds.

Custom Domains: Use your own domain for a professional status page URL that matches your brand.

Global Performance: Static assets are served efficiently, ensuring fast page loads for users worldwide.

Zero Database Overhead: No database to manage, back up, or worry about during incidents.

Prerequisites

Before deploying cState on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your status page
  • Basic familiarity with Hugo and static site generators
  • A list of services and components to monitor
  • (Optional) A custom domain for your status page

Understanding cState Architecture

cState uses Hugo’s static site generation to create fast, reliable status pages:

Hugo Static Generator: The core engine that transforms Markdown content and YAML configuration into static HTML, CSS, and JavaScript files.

Markdown Incidents: Each incident is a Markdown file in the content/issues directory, making it easy to create, update, and track incidents over time.

YAML Configuration: Service components, categories, and site settings are defined in config.yml, providing a single source of truth for your status page structure.

Theme System: cState includes a default theme with customizable colors, logos, and layouts. Themes can be modified or replaced entirely.

Git-Based Workflow: All changes flow through Git, enabling automation, review processes, and audit trails for status updates.

Preparing Your Repository

Create a GitHub repository for your cState status page with the necessary configuration.

Repository Structure

cstate-status/
├── Dockerfile
├── config.yml
├── content/
│ └── issues/
│ └── .gitkeep
├── static/
│ └── logo.png
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile that builds your cState site:

FROM hugomods/hugo:exts as builder
WORKDIR /src
# Copy configuration and content
COPY . .
# Initialize cState theme
RUN hugo mod init status-page && \
hugo mod get github.com/cstate/cstate@latest
# Build the static site
RUN hugo --minify
# Production image with nginx
FROM nginx:alpine
# Copy built site to nginx
COPY --from=builder /src/public /usr/share/nginx/html
# Copy custom nginx config if needed
COPY nginx.conf /etc/nginx/conf.d/default.conf 2>/dev/null || true
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Creating the Configuration File

Create a config.yml in the root of your repository:

baseURL: https://status.example.com
languageCode: en
title: System Status
# Required for cState
module:
imports:
- path: github.com/cstate/cstate
# Theme customization
params:
# Brand settings
brand: "Your Company"
logo: /logo.png
# Color scheme
colorBrand: "#0a0c0f"
colorOk: "#008000"
colorDisrupted: "#cc4400"
colorDown: "#e60000"
colorNotice: "#24478f"
# Features
enableLastMod: true
dateFormat: "January 2, 2006 at 3:04 PM"
shortDateFormat: "15:04 - Jan 2"
# Description shown on homepage
description: "Current status and incident history for our services."
# Incident settings
incidentPostsPerPage: 10
# Categories and Systems
categories:
- name: Infrastructure
description: "Core infrastructure components"
closed: false
- name: Applications
description: "User-facing applications"
closed: false
- name: APIs
description: "Developer APIs and integrations"
closed: false
systems:
- name: Website
category: Applications
description: "Main website and user portal"
- name: API Gateway
category: APIs
description: "REST API endpoints"
- name: Database Cluster
category: Infrastructure
description: "Primary database infrastructure"
- name: CDN
category: Infrastructure
description: "Content delivery network"
- name: Authentication
category: Applications
description: "Login and identity services"

Creating an Nginx Configuration

Create an nginx.conf file for proper static file serving:

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Enable gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
# Cache static assets
location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Handle clean URLs
location / {
try_files $uri $uri/ $uri.html =404;
}
# Custom error pages
error_page 404 /404.html;
}

Creating the .dockerignore File

Create a .dockerignore file:

.git
.github
*.md
!content/**/*.md
LICENSE
.gitignore
.DS_Store
public/
resources/

Deploying cState on Klutch.sh

Follow these steps to deploy your cState status page:

    Prepare Your Repository

    Initialize your cState repository with the configuration files described above. Customize the config.yml with your actual services, branding, and color scheme.

    Push Your Repository to GitHub

    Commit and push your configuration to GitHub:

    Terminal window
    git init
    git add .
    git commit -m "Initial cState configuration"
    git remote add origin https://github.com/yourusername/cstate-status.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Name it something descriptive like “status-page” or “cstate”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account and select the repository containing your cState configuration.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80 (nginx default)

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Build the Hugo static site
    • Create the nginx container
    • Provision an HTTPS certificate
    • Serve your status page

    Access Your Status Page

    Once deployment completes, access your status page at https://your-app-name.klutch.sh. You should see your configured services and categories.

Managing Incidents

Creating an Incident

Create a new Markdown file in content/issues/ for each incident:

---
title: "API Latency Issues"
date: 2024-01-15T14:30:00-05:00
resolved: false
resolvedWhen: ""
severity: disrupted
affected:
- API Gateway
- Authentication
section: issue
---
*Investigating* - We are currently investigating reports of increased latency on API requests.
<!--more-->
{{< track "2024-01-15T14:45:00-05:00" >}}
*Identified* - The issue has been identified as a database connection pool exhaustion. Engineering is working on a fix.
{{< /track >}}
{{< track "2024-01-15T15:00:00-05:00" >}}
*Monitoring* - A fix has been deployed. We are monitoring the situation.
{{< /track >}}

Incident Severity Levels

cState supports different severity levels:

SeverityDescriptionColor
noticeInformational notice, no impactBlue
disruptedPartial service disruptionOrange
downComplete service outageRed

Resolving an Incident

Update the incident file to mark it resolved:

---
title: "API Latency Issues"
date: 2024-01-15T14:30:00-05:00
resolved: true
resolvedWhen: 2024-01-15T15:30:00-05:00
severity: disrupted
affected:
- API Gateway
- Authentication
section: issue
---
*Investigating* - We are currently investigating reports of increased latency.
<!--more-->
{{< track "2024-01-15T15:30:00-05:00" >}}
*Resolved* - The issue has been fully resolved. All systems are operating normally.
{{< /track >}}

Scheduled Maintenance

Create maintenance notices with future dates:

---
title: "Scheduled Database Maintenance"
date: 2024-01-20T02:00:00-05:00
resolved: false
severity: notice
affected:
- Database Cluster
section: issue
---
We will be performing scheduled maintenance on our database infrastructure. Users may experience brief interruptions during this window.
**Maintenance Window**: January 20, 2024, 2:00 AM - 4:00 AM EST

Customizing Your Status Page

Place your logo in the static/ directory and reference it in config.yml:

params:
logo: /logo.png

Custom Colors

Adjust the color scheme to match your brand:

params:
colorBrand: "#1a1a2e"
colorOk: "#16a34a"
colorDisrupted: "#f59e0b"
colorDown: "#dc2626"
colorNotice: "#3b82f6"

Adding Custom Pages

Create additional pages in the content/ directory:

---
title: "About Our Status Page"
---
This status page provides real-time information about our service availability.
For support, contact us at support@example.com.

Multilingual Support

Configure multiple languages in config.yml:

languages:
en:
languageName: English
weight: 1
es:
languageName: Espanol
weight: 2

Automation and Integration

Automating Incident Creation

Create incidents programmatically by committing files via Git or the GitHub API:

import requests
from datetime import datetime
def create_incident(title, severity, affected_systems, description):
content = f"""---
title: "{title}"
date: {datetime.now().isoformat()}
resolved: false
severity: {severity}
affected:
{chr(10).join(f' - {s}' for s in affected_systems)}
section: issue
---
{description}
"""
# Use GitHub API to create the file
# This triggers a new deployment on Klutch.sh

Monitoring Integration

Integrate with monitoring tools to automatically create incidents:

  • Uptime Monitors: Trigger incident creation when services go down
  • APM Tools: Create disruption notices when performance degrades
  • Alerting Systems: Bridge alerts to status page updates

Production Best Practices

Performance Optimization

  • Minimal Assets: Keep images and custom assets small for fast loading
  • CDN Caching: Leverage browser caching headers in nginx configuration
  • Hugo Minification: The Dockerfile includes --minify for optimized output

Security Recommendations

  • Separate Repository: Keep your status page in its own repository with limited access
  • Review Incidents: Establish a review process for incident publications
  • Audit Trail: Git history provides a complete audit trail of all status changes

Incident Communication Best Practices

  • Be Timely: Post updates within minutes of becoming aware of issues
  • Be Specific: Clearly state what is affected and what is not
  • Update Regularly: Provide updates at least every 30 minutes during active incidents
  • Post Mortems: Create follow-up posts explaining root causes and preventive measures

Troubleshooting Common Issues

Build Failures

Symptoms: Deployment fails during Hugo build.

Solutions:

  • Verify config.yml syntax is valid YAML
  • Ensure all required theme modules are specified
  • Check for typos in template references

Incidents Not Appearing

Symptoms: New incident files don’t show on the status page.

Solutions:

  • Verify the incident file is in content/issues/
  • Check the frontmatter format matches expected fields
  • Ensure the date is not in the future (unless intended)
  • Confirm section: issue is set in frontmatter

Styling Issues

Symptoms: Status page looks broken or unstyled.

Solutions:

  • Verify the theme module is correctly imported
  • Check that static assets are being copied correctly
  • Clear browser cache and reload

Additional Resources

Conclusion

Deploying cState on Klutch.sh gives you a lightning-fast, reliable status page that communicates service availability without the complexity of database-backed solutions. The combination of Hugo’s static site generation and Klutch.sh’s automated deployments means status updates flow from Git commits to your live page in seconds.

With cState’s clean design, Git-based workflow, and zero database requirements, you get a professional status page that performs reliably even during major incidents when your users need it most. The static architecture ensures your status page remains accessible regardless of what might be happening with your other infrastructure.