GitHub(nextgroup2706/ken_nogi)は今後使わず自社Gitea運用に切替え。 NodeSrvは旧リポジトリの履歴を破棄しファイルのみ統合(Dokploy用サービスアカウントは 別途mygit-admin/NodeSrv.gitに履歴あり)。notepmエクスポート(12GB)とPleasanter インストーラzip(208MB)はサイズが大きいため.gitignoreで除外。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
28 lines
886 B
JavaScript
28 lines
886 B
JavaScript
const express = require('express');
|
||
|
||
const app = express();
|
||
const PORT = process.env.PORT || 3000;
|
||
|
||
// 認証ゲートウェイ(oauth2-proxy)が付与するヘッダーからユーザー情報を取得。
|
||
// ローカル開発時(Traefik経由なし)はフォールバック値を使う。
|
||
app.use((req, res, next) => {
|
||
req.authUser = {
|
||
email: req.headers['x-auth-request-email'] || 'dev-local@next-hd.co.jp',
|
||
name: req.headers['x-auth-request-user'] || 'dev-local',
|
||
};
|
||
next();
|
||
});
|
||
|
||
app.get('/', (req, res) => {
|
||
res.send(`<h1>authgw-poc</h1><p>email: ${req.authUser.email}</p><p>name: ${req.authUser.name}</p>`);
|
||
});
|
||
|
||
// Dokploy/Traefikのヘルスチェックが叩くエンドポイント
|
||
app.get('/health', (req, res) => {
|
||
res.status(200).json({ status: 'healthy' });
|
||
});
|
||
|
||
app.listen(PORT, () => {
|
||
console.log(`authgw-poc listening on port ${PORT}`);
|
||
});
|