Compare commits
3 Commits
9e1a817ed6
...
cab06ec681
| Author | SHA1 | Date |
|---|---|---|
|
|
cab06ec681 | |
|
|
9c892e723a | |
|
|
a60dda9528 |
55
CLAUDE.md
55
CLAUDE.md
|
|
@ -10,6 +10,61 @@
|
||||||
2. **memory/ ディレクトリを確認する** — `C:\Users\maita\.claude\projects\c--Users-maita-posimai-project\memory\MEMORY.md` にプロジェクト固有の記憶がある
|
2. **memory/ ディレクトリを確認する** — `C:\Users\maita\.claude\projects\c--Users-maita-posimai-project\memory\MEMORY.md` にプロジェクト固有の記憶がある
|
||||||
3. **`posimai-dashboard/src/data/projects.json` を確認する** — 全アプリの一覧・ステータス・技術スタックがここにある
|
3. **`posimai-dashboard/src/data/projects.json` を確認する** — 全アプリの一覧・ステータス・技術スタックがここにある
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ディザスタリカバリ(PC 完全消失時の復元手順)
|
||||||
|
|
||||||
|
### バックアップリポジトリ
|
||||||
|
|
||||||
|
| リポジトリ | Gitea(ローカル) | GitHub(クラウド) | 内容 |
|
||||||
|
|-----------|-----------------|-----------------|------|
|
||||||
|
| `posimai-root` | `http://100.76.7.3:3000/mai/posimai-root` | `https://github.com/posimai/posimai-root` (private) | CLAUDE.md / _template / server.js / scripts / deploy-server.sh / claude-settings.json |
|
||||||
|
| `claude-memory` | `http://100.76.7.3:3000/mai/claude-memory` | `https://github.com/posimai/claude-memory` (private) | ~/.claude/memory 以下の全記憶ファイル |
|
||||||
|
|
||||||
|
### 新マシンでの復元手順
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. GitHub CLI 認証
|
||||||
|
gh auth login
|
||||||
|
|
||||||
|
# 2. posimai-root を clone(CLAUDE.md・設定類を復元)
|
||||||
|
git clone https://github.com/posimai/posimai-root.git "C:/Users/maita/posimai-project"
|
||||||
|
cd "C:/Users/maita/posimai-project"
|
||||||
|
git remote add gitea http://100.76.7.3:3000/mai/posimai-root.git
|
||||||
|
|
||||||
|
# 3. Claude Code settings を復元
|
||||||
|
cp "C:/Users/maita/posimai-project/claude-settings.json" "C:/Users/maita/.claude/settings.json"
|
||||||
|
|
||||||
|
# 4. claude-memory を clone(AI 記憶を復元)
|
||||||
|
git clone https://github.com/posimai/claude-memory.git "C:/Users/maita/.claude/projects/c--Users-maita-posimai-project/memory"
|
||||||
|
cd "C:/Users/maita/.claude/projects/c--Users-maita-posimai-project/memory"
|
||||||
|
git remote add gitea http://100.76.7.3:3000/mai/claude-memory.git
|
||||||
|
|
||||||
|
# 5. 各アプリを必要に応じて clone
|
||||||
|
# git clone https://github.com/posimai/[app-name].git "C:/Users/maita/posimai-project/[app-name]"
|
||||||
|
# cd [app-name] && git remote add gitea http://100.76.7.3:3000/mai/[app-name].git
|
||||||
|
```
|
||||||
|
|
||||||
|
### posimai-root の更新方法(CLAUDE.md・server.js 等を変更した後)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd C:/Users/maita/posimai-project
|
||||||
|
git add CLAUDE.md claude-settings.json _template/ deploy-server.sh scripts/ server.js
|
||||||
|
git commit -m "chore: update ..."
|
||||||
|
git push gitea main && git push github main
|
||||||
|
```
|
||||||
|
|
||||||
|
### claude-memory の更新方法(AI が記憶を更新した後)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd "C:/Users/maita/.claude/projects/c--Users-maita-posimai-project/memory"
|
||||||
|
git add .
|
||||||
|
git commit -m "chore: update memory"
|
||||||
|
git push gitea main && git push github main
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### AI が絶対に守るべきルール(違反時は即修正)
|
### AI が絶対に守るべきルール(違反時は即修正)
|
||||||
|
|
||||||
| 禁止事項 | 理由 |
|
| 禁止事項 | 理由 |
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"defaultMode": "acceptEdits",
|
||||||
|
"allow": [
|
||||||
|
"Bash(*)",
|
||||||
|
"Read",
|
||||||
|
"Glob",
|
||||||
|
"Grep",
|
||||||
|
"WebSearch",
|
||||||
|
"WebFetch",
|
||||||
|
"Bash(git *)",
|
||||||
|
"Bash(npm *)",
|
||||||
|
"Bash(npx *)",
|
||||||
|
"Bash(node *)",
|
||||||
|
"Bash(python3 *)",
|
||||||
|
"Bash(flutter *)",
|
||||||
|
"Bash(vercel *)",
|
||||||
|
"Bash(gh *)",
|
||||||
|
"Bash(curl *)",
|
||||||
|
"Bash(scp *)",
|
||||||
|
"Bash(ssh *)",
|
||||||
|
"Bash(ls*)",
|
||||||
|
"Bash(find *)",
|
||||||
|
"Bash(mkdir *)",
|
||||||
|
"Bash(mv *)",
|
||||||
|
"Bash(cp *)",
|
||||||
|
"Bash(rm -f *)",
|
||||||
|
"Bash(rm -r *)",
|
||||||
|
"Bash(chmod *)",
|
||||||
|
"Bash(cat *)",
|
||||||
|
"Bash(grep *)",
|
||||||
|
"Bash(head *)",
|
||||||
|
"Bash(tail *)",
|
||||||
|
"Bash(sed *)",
|
||||||
|
"Bash(awk *)",
|
||||||
|
"Bash(echo *)",
|
||||||
|
"Bash(printf *)",
|
||||||
|
"Bash(wc *)",
|
||||||
|
"Bash(xargs *)",
|
||||||
|
"Bash(unzip *)",
|
||||||
|
"Bash(bash *)",
|
||||||
|
"Bash(keytool *)",
|
||||||
|
"Bash(yes)",
|
||||||
|
"Bash(for *)",
|
||||||
|
"Bash(do *)",
|
||||||
|
"Bash(done*)"
|
||||||
|
],
|
||||||
|
"deny": [
|
||||||
|
"Bash(rm -rf *)",
|
||||||
|
"Bash(git reset --hard *)",
|
||||||
|
"Bash(git push --force *)",
|
||||||
|
"Bash(git clean *)",
|
||||||
|
"Bash(sudo *)"
|
||||||
|
],
|
||||||
|
"additionalDirectories": [
|
||||||
|
"c:\\Users\\maita\\posimai-project\\_template",
|
||||||
|
"c:\\Users\\maita\\posimai-project\\posimai-analytics\\src\\app\\(galaxy)",
|
||||||
|
"c:\\Users\\maita\\.claude\\projects\\c--Users-maita-posimai-project\\memory",
|
||||||
|
"c:\\Users\\maita\\posimai-project",
|
||||||
|
"/tmp"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -577,7 +577,7 @@ function buildRouter() {
|
||||||
let fullText = content || null;
|
let fullText = content || null;
|
||||||
const source = clientSource || extractSource(url);
|
const source = clientSource || extractSource(url);
|
||||||
|
|
||||||
// 🔥 重要: contentが空の場合、Jina Reader APIで本文を自動取得
|
// 重要: contentが空の場合、Jina Reader APIで本文を自動取得
|
||||||
if (!fullText || fullText.trim().length === 0) {
|
if (!fullText || fullText.trim().length === 0) {
|
||||||
console.log(`[Brain API] No content provided for ${url}, attempting Jina Reader fetch...`);
|
console.log(`[Brain API] No content provided for ${url}, attempting Jina Reader fetch...`);
|
||||||
|
|
||||||
|
|
@ -1424,6 +1424,10 @@ ${excerpt}
|
||||||
r.post('/together/share', async (req, res) => {
|
r.post('/together/share', async (req, res) => {
|
||||||
const { group_id, shared_by, url = null, title = null, message = '', tags = [] } = req.body || {};
|
const { group_id, shared_by, url = null, title = null, message = '', tags = [] } = req.body || {};
|
||||||
if (!group_id || !shared_by) return res.status(400).json({ error: 'group_id と shared_by は必須です' });
|
if (!group_id || !shared_by) return res.status(400).json({ error: 'group_id と shared_by は必須です' });
|
||||||
|
if (url) {
|
||||||
|
try { const p = new URL(url); if (!['http:', 'https:'].includes(p.protocol)) throw new Error(); }
|
||||||
|
catch { return res.status(400).json({ error: 'url は http/https のみ有効です' }); }
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const grpCheck = await pool.query('SELECT id FROM together_groups WHERE id=$1', [group_id]);
|
const grpCheck = await pool.query('SELECT id FROM together_groups WHERE id=$1', [group_id]);
|
||||||
if (grpCheck.rows.length === 0) return res.status(404).json({ error: 'グループが見つかりません' });
|
if (grpCheck.rows.length === 0) return res.status(404).json({ error: 'グループが見つかりません' });
|
||||||
|
|
@ -1488,6 +1492,7 @@ ${excerpt}
|
||||||
r.post('/together/react', async (req, res) => {
|
r.post('/together/react', async (req, res) => {
|
||||||
const { share_id, username, type = 'like' } = req.body || {};
|
const { share_id, username, type = 'like' } = req.body || {};
|
||||||
if (!share_id || !username) return res.status(400).json({ error: 'share_id と username は必須です' });
|
if (!share_id || !username) return res.status(400).json({ error: 'share_id と username は必須です' });
|
||||||
|
if (!['like', 'star', 'fire'].includes(type)) return res.status(400).json({ error: 'type は like/star/fire のみ有効です' });
|
||||||
try {
|
try {
|
||||||
const existing = await pool.query(
|
const existing = await pool.query(
|
||||||
'SELECT 1 FROM together_reactions WHERE share_id=$1 AND username=$2 AND type=$3',
|
'SELECT 1 FROM together_reactions WHERE share_id=$1 AND username=$2 AND type=$3',
|
||||||
|
|
@ -1696,7 +1701,7 @@ const PORT = parseInt(process.env.PORT || '8090');
|
||||||
initDB()
|
initDB()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
app.listen(PORT, '0.0.0.0', () => {
|
app.listen(PORT, '0.0.0.0', () => {
|
||||||
console.log(`\n🧠 Posimai Brain API`);
|
console.log(`\nPosimai Brain API`);
|
||||||
console.log(` Port: ${PORT}`);
|
console.log(` Port: ${PORT}`);
|
||||||
console.log(` Gemini: ${genAI ? 'enabled' : 'disabled (no key)'}`);
|
console.log(` Gemini: ${genAI ? 'enabled' : 'disabled (no key)'}`);
|
||||||
console.log(` Users: ${Object.values(KEY_MAP).join(', ') || '(none - set API_KEYS)'}`);
|
console.log(` Users: ${Object.values(KEY_MAP).join(', ') || '(none - set API_KEYS)'}`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue