chore(opencode-sandbox): add SSH auth and workspace mount for Gitea
- Mount host workspace at /home/ga/workspace - Add SSH key and known_hosts for Gitea auth - Configure git user identity in container
This commit is contained in:
@@ -10,7 +10,10 @@ services:
|
|||||||
- NET_RAW
|
- NET_RAW
|
||||||
volumes:
|
volumes:
|
||||||
# Your monorepo — opencode's working directory
|
# Your monorepo — opencode's working directory
|
||||||
- ../:/workspace
|
- /home/ga/workspace:/workspace
|
||||||
|
# SSH key for Gitea auth
|
||||||
|
- ~/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro
|
||||||
|
- ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro
|
||||||
# Persist opencode auth so you don't re-login every time
|
# Persist opencode auth so you don't re-login every time
|
||||||
- opencode-auth:/root/.local/share/opencode
|
- opencode-auth:/root/.local/share/opencode
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
export GIT_SSH_COMMAND="ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new"
|
||||||
|
git config --global user.email "gabriel.pereira@protonmail.com"
|
||||||
|
git config --global user.name "gabspereira"
|
||||||
exec opencode
|
exec opencode
|
||||||
|
|||||||
12
AGENTS.md
12
AGENTS.md
@@ -9,7 +9,7 @@ This workspace is a monorepo containing data engineering projects and WhatsApp C
|
|||||||
```
|
```
|
||||||
workspace/
|
workspace/
|
||||||
├── apps/
|
├── apps/
|
||||||
│ ├── whatsapp-crm/ # Next.js CRM with Kanban board
|
│ ├── whatsapp-crm/ # Next.js CRM with Kanban board (primary app)
|
||||||
│ ├── whatsapp-sync/ # WhatsApp message sync service
|
│ ├── whatsapp-sync/ # WhatsApp message sync service
|
||||||
│ ├── whatsapp-reader/ # WhatsApp message reader
|
│ ├── whatsapp-reader/ # WhatsApp message reader
|
||||||
│ └── timesfm-forecast/ # Time series forecasting app
|
│ └── timesfm-forecast/ # Time series forecasting app
|
||||||
@@ -52,6 +52,7 @@ npm run dev # node --watch src/index.js
|
|||||||
npm run sync # node src/sync.js
|
npm run sync # node src/sync.js
|
||||||
npm run test # Jest
|
npm run test # Jest
|
||||||
npm run test:watch # Jest watch mode
|
npm run test:watch # Jest watch mode
|
||||||
|
npm run test:coverage # Jest with coverage
|
||||||
```
|
```
|
||||||
|
|
||||||
### whatsapp-reader
|
### whatsapp-reader
|
||||||
@@ -113,7 +114,6 @@ export async function POST(request: Request) {
|
|||||||
try {
|
try {
|
||||||
const body = await request.json()
|
const body = await request.json()
|
||||||
const validated = CreateContactInput.parse(body)
|
const validated = CreateContactInput.parse(body)
|
||||||
// ... process
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof ZodError) {
|
if (error instanceof ZodError) {
|
||||||
return Response.json({ error: error.errors }, { status: 400 })
|
return Response.json({ error: error.errors }, { status: 400 })
|
||||||
@@ -138,14 +138,9 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function ComponentName({ contacts, onContactClick }: Props) {
|
export default function ComponentName({ contacts, onContactClick }: Props) {
|
||||||
// hooks first, then effects, then render
|
|
||||||
const [state, setState] = useState(false)
|
const [state, setState] = useState(false)
|
||||||
|
|
||||||
return (
|
return <div>{/* JSX */}</div>
|
||||||
<div>
|
|
||||||
{/* JSX */}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -166,7 +161,6 @@ test('should update contact stage', async () => {
|
|||||||
render(<KanbanBoard {...props} />)
|
render(<KanbanBoard {...props} />)
|
||||||
|
|
||||||
await user.click(screen.getByText('Move to Next Stage'))
|
await user.click(screen.getByText('Move to Next Stage'))
|
||||||
|
|
||||||
expect(onStageChange).toHaveBeenCalledWith(1, 'DECIDINDO')
|
expect(onStageChange).toHaveBeenCalledWith(1, 'DECIDINDO')
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user