搜索

PythonReactSEOPDF
GitHub Skill

ops-deployment

Procedures for building, verifying, and deploying the application using Vantus Systems specific scripts. Use when performing ops tasks, troubleshooting builds, or explaining the deployment process.

ArtisanClarinets☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Ops Deployment

This skill details the custom build and deployment pipeline for Project SENTINEL. It ensures system integrity through cryptographic proofs, automated server bootstrapping, and hardened security configurations.

Quick Start

Deploy a new version in 4 steps:

  1. Verify Environment: Ensure all required secrets are set in .env or /etc/default/vantus.
  2. Run Build Proof: Execute npm run build to generate the cryptographic build proof and compile the app.
  3. Apply Migrations: Run npx prisma migrate deploy to update the production database.
  4. Restart Services: Restart the Systemd service and reload Nginx to apply changes.
# Example: Manual deployment sequence
npm run build
npx prisma migrate deploy
sudo systemctl restart vantus
sudo systemctl reload nginx

Core Concepts

1. Build Proof System

We use a "Build Proof" system instead of a standard next build to ensure the integrity of the running code.

  • Artifact: scripts/generate-build-proof.mjs creates a cryptographic signature of the build.
  • Verification: The app exposes /proof/build.json for runtime integrity checks.
2. Automated Bootstrapping (Ubuntu 22.04)

Fresh production servers are configured using scripts/bootstrap-ubuntu22.sh.

  • Security: Creates an unprivileged vantus user and configures UFW.
  • Stack: Installs Node.js, Nginx, SQLite, and Certbot.
3. Environment Configuration

Interactive setup via scripts/setup-env.js ensures secure secret generation and correct database wiring.

Ops Workflows

Troubleshooting a Failed Build

Step 1: Check Build Logs Review the output of npm run build. Look for errors in the generate-build-proof step or Next.js compilation.

Step 2: Verify Dependencies Ensure package-lock.json is consistent and all dependencies are installed via npm ci.

Step 3: Validate Environment Run node scripts/setup-env.js --verify to check for missing or invalid environment variables.

Updating Nginx Configuration

Step 1: Generate Config Run npm run generate:nginx to create a new configuration based on current environment variables.

Step 2: Test Configuration Always run sudo nginx -t before reloading to prevent downtime due to syntax errors.

Step 3: Apply Changes Execute sudo systemctl reload nginx.

Advanced Patterns

Zero-Downtime Migrations

For complex schema changes, use a dual-write strategy or ensure migrations are backward-compatible with the currently running code version.

Integrity Monitoring

Integrate the /proof/build.json endpoint with external monitoring tools to detect unauthorized code changes or deployment drift.

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!