Skip to content

DevContainer基盤モードへの整理と起動フロー改善#2

Merged
fjmrytfjsn merged 9 commits into
mainfrom
fix/setup
Apr 4, 2026
Merged

DevContainer基盤モードへの整理と起動フロー改善#2
fjmrytfjsn merged 9 commits into
mainfrom
fix/setup

Conversation

@fjmrytfjsn

Copy link
Copy Markdown
Owner

概要

このPRは、opencode-ecc-devcontainer を基盤専用リポジトリとして運用する方針に合わせて、DevContainer設定・起動スクリプト・ドキュメントを整理したものです。

主な変更

  • DevContainer設定の整理(不要ポート・冗長設定の削除、起動メッセージ更新)
  • セットアップ/起動/検証スクリプトのリファクタリング
    • .devcontainer/lib/common.sh を追加して共通処理を集約
    • Tailscale関連処理(キー検証・socket指定・.env更新)を統一
    • 初回設定直後に同じキー更新確認が出る不自然な導線を解消
  • インフラモードに合わせたドキュメント更新
    • README.md / docs/QUICK_START.md を基盤運用向けに刷新
  • 旧プロジェクト生成用テンプレート群の削除

コミット分割

  1. chore(devcontainer): align runtime config for infrastructure mode
  2. refactor(scripts): consolidate setup/startup flows with shared helpers
  3. docs: switch to infrastructure-only guidance and drop templates

動作確認

  • DevContainer起動後に以下を確認
  • 主要シェルスクリプトの構文チェック
    • bash -n でエラーなし

補足

  • OPENCODE_SERVER_PASSWORD / OPENCHAMBER_UI_PASSWORD は未設定運用(利用方針に合わせて任意設定)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

DevContainer を「基盤(Infrastructure Mode)専用」として運用する方針に合わせ、テンプレート生成機能を削除しつつ、セットアップ/起動フローと Tailscale 周りの処理を共通化・簡素化するPRです。

Changes:

  • プロジェクト生成テンプレート群を削除し、基盤運用向けの README / QUICK_START に刷新
  • .devcontainer/lib/common.sh を追加して .env 処理・Tailscale key 判定・権限設定などを共通化
  • 起動/セットアップ/診断スクリプトを基盤モードに合わせて整理(Tailscale socket 指定、監視プロセス追加、権限/ajv 対策など)

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
README.md 基盤モード前提の説明に刷新(開発成果物を置かない方針明記)
docs/QUICK_START.md 基盤起動に必要な最小手順へ整理
templates/README.template.md 旧プロジェクト生成テンプレート削除
templates/README.md 旧テンプレート管理 README 削除
templates/package.template.json 旧プロジェクト生成テンプレート削除
templates/dashboard-with-tailscale.template.js 旧ダッシュボードテンプレート削除
templates/app.template.js 旧サンプルアプリテンプレート削除
scripts/setup-tailscale.sh 共通ヘルパ導入、socket 指定統一、.env 更新処理統一
scripts/fix-permissions.sh .opencode 権限修正ツール追加
scripts/fix-ecc-ajv.sh ECC の ajv 依存問題向け修正ツール追加
scripts/diagnose-devcontainer.sh DevContainer 診断ツール追加
.devcontainer/lib/common.sh .env/Tailscale 判定/権限/hosts 更新の共通関数を追加
.devcontainer/interactive-setup.sh プロジェクト生成をやめ、Tailscale 中心の基盤セットアップに縮小
.devcontainer/env-validator.sh .env 解決/権限/キー検証を共通関数に寄せ、ローカルモード許容へ
.devcontainer/setup.sh 基盤セットアップ誘導、権限/ajv 対策を追加
.devcontainer/startup.sh hosts 修正・Tailscale 起動(socket)・サービス起動・watchdog 追加
.devcontainer/validate-setup.sh 基盤構造に合わせたチェックへ整理(ただしローカルモード判定が未対応)
.devcontainer/entrypoint.sh tailscaled 起動オプションを変更
.devcontainer/Dockerfile ECC ajv 対策と .opencode ディレクトリ整備を追加
.devcontainer/docker-compose.yml Compose 設定整理、healthcheck 修正
.devcontainer/devcontainer.json forwardPorts などを基盤モード向けに整理

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .devcontainer/Dockerfile
Comment thread .devcontainer/startup.sh
Comment thread .devcontainer/validate-setup.sh
Comment thread .devcontainer/validate-setup.sh Outdated
Comment thread .devcontainer/entrypoint.sh Outdated
Comment thread .devcontainer/setup.sh Outdated
Comment thread scripts/diagnose-devcontainer.sh
Comment thread scripts/diagnose-devcontainer.sh
Comment thread scripts/fix-permissions.sh Outdated
@fjmrytfjsn

Copy link
Copy Markdown
Owner Author

Copilot レビューコメントを確認し、今回指摘された8点はすべて修正対象と判断して対応しました。反映コミット: 282ade4

対応内容:

  1. .devcontainer/validate-setup.sh
  • TAILSCALE_AUTH_KEY 未設定を必須FAILにせず、ローカルモード許容(SKIP表示)に変更
  • tailscale up テストで --socket=/run/tailscale/tailscaled.sock を明示
  1. .devcontainer/startup.sh
  • エージェントディレクトリを ~/.opencode/.agents 優先に統一(旧 ~/.opencode/agents も互換フォールバック)
  1. .devcontainer/Dockerfile
  • /bin/sh 実行でも安全な構文へ修正([[ ... ]] / &> を POSIX互換へ)
  1. .devcontainer/setup.sh
  • chown -R /home/vscode を削除し、~/.opencode のみに限定
  1. .devcontainer/entrypoint.sh
  • TAILSCALE_AUTH_KEY がプレースホルダー時は tailscaled を起動しないように修正(有効キー判定を追加)
  1. scripts/fix-permissions.sh
  • chown -R $HOME を削除し、.opencode 配下のみに限定
  1. scripts/diagnose-devcontainer.sh
  • tailscale status/up--socket=/run/tailscale/tailscaled.sock 前提に統一

補足:

  • 今回は「修正不要」と判断したコメントはありません(全件修正済みです)。
  • 変更ファイルのシェル構文チェック(bash -n)とエディタ診断エラーなしを確認済みです。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .devcontainer/lib/common.sh Outdated
Comment thread .devcontainer/startup.sh
Comment thread .devcontainer/startup.sh
Comment thread .devcontainer/validate-setup.sh Outdated
Comment thread .devcontainer/Dockerfile Outdated
Comment thread .devcontainer/setup.sh Outdated
Comment thread .devcontainer/entrypoint.sh Outdated
Comment thread scripts/diagnose-devcontainer.sh Outdated
@fjmrytfjsn fjmrytfjsn merged commit 8f7db49 into main Apr 4, 2026
2 checks passed
@fjmrytfjsn fjmrytfjsn deleted the fix/setup branch April 4, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants