fix: Fix PostCSS config and Dockerfile

1. Rename postcss.config.js to postcss.config.cjs
   - Fixes CommonJS syntax in ES module project
   - Allows build to complete successfully

2. Remove --production flag from Dockerfile
   - Install ALL dependencies including sharp
   - Sharp required for Astro image optimization
   - Fixes sharp missing error

Both fixes enable successful Docker build and favicon to work.
This commit is contained in:
Kunthawat Greethong
2026-03-03 14:51:29 +07:00
parent c802279cf9
commit 6b974073cb
10381 changed files with 4018 additions and 1519018 deletions

221
API_TEST_RESULTS.md Normal file
View File

@@ -0,0 +1,221 @@
# 🔬 Easypanel API Testing Results
## ✅ What Works
### 1. Authentication
```bash
curl -H "Authorization: Bearer TOKEN" \
http://110.164.146.46:3000/api/trpc/setup.getStatus
# ✅ Returns: {"result":{"data":{"json":{"isComplete":true}}}}
```
### 2. List Projects
```bash
curl -H "Authorization: Bearer TOKEN" \
http://110.164.146.46:3000/api/trpc/projects.listProjectsAndServices
# ✅ Returns project list including "customerwebsite"
```
### 3. Inspect Service
```bash
curl -H "Authorization: Bearer TOKEN" \
http://110.164.146.46:3000/api/trpc/services.app.inspectService
# ✅ Works when service exists
```
---
## ❌ What Fails - Service Creation
### Endpoint
```
POST /api/trpc/services.app.createService
```
### Schema (from OpenAPI)
```json
{
"input": {
"json": {
"projectName": "customerwebsite",
"serviceName": "my-app",
"source": {
"type": "image" | "github",
// For "image":
"image": "nginx:alpine",
"username": "...",
"password": "...",
// For "github":
"owner": "...",
"repo": "...",
"ref": "main",
"path": "..."
}
}
}
}
```
### Attempts & Errors
#### Attempt 1: Basic Image
```json
{
"input": {
"json": {
"projectName": "customerwebsite",
"serviceName": "test",
"source": {
"type": "image",
"image": "nginx:alpine",
"port": 80
}
}
}
}
```
**Result:** ❌ 500 Error
```json
{
"error": {
"json": {
"message": "[{\"code\":\"invalid_type\",\"expected\":\"object\",\"received\":\"undefined\",\"path\":[],\"message\":\"Required\"}]"
}
}
}
```
#### Attempt 2: With Git Source
```json
{
"input": {
"json": {
"projectName": "customerwebsite",
"serviceName": "test-git",
"source": {
"type": "git",
"repository": "http://...",
"branch": "main"
}
}
}
}
```
**Result:** ❌ Same "Required" error
#### Attempt 3: Using `project` instead of `projectName`
```json
{
"input": {
"json": {
"project": "customerwebsite",
"name": "test"
}
}
}
```
**Result:** ❌ Same error
---
## 🔍 Analysis
The Zod validation error `"expected":"object","received":"undefined","path":[]` suggests:
1. **Missing required field** at root level
2. **Schema mismatch** - the API expects additional fields not in OpenAPI spec
3. **Possible tRPC format issue** - Easypanel might use a different input format
---
## 💡 Hypothesis
Easypanel's `createService` endpoint might require:
### Option A: Additional Required Fields
```json
{
"input": {
"json": {
"projectName": "...",
"serviceName": "...",
"source": {...},
// Missing required fields:
"environmentVariables": [],
"domains": [],
"ports": [],
"mounts": []
}
}
}
```
### Option B: Different tRPC Format
```json
{
"type": "query",
"input": {...}
}
```
### Option C: Requires Project ID (not name)
```json
{
"input": {
"json": {
"project": "cmkw22b00000007tu4gim48q9", // Actual ID
"name": "test"
}
}
}
```
---
## 📋 Next Steps to Debug
### 1. Capture Browser Network Traffic
1. Open Easypanel dashboard
2. Open DevTools → Network tab
3. Create a service manually
4. Inspect the exact API request
5. Copy request payload
### 2. Test with cURL
Use the exact payload from browser
### 3. Alternative: Use Easypanel CLI (if exists)
Check if Easypanel provides official CLI
### 4. Contact Easypanel Support
Ask for correct API schema for `services.app.createService`
---
## 🎯 Current Recommendation
Until API is figured out, use **manual creation**:
1. **Create service via dashboard** (2 minutes)
2. **Copy service ID**
3. **Register with skill**: `./deploy.sh register SERVICE_ID`
4. **Future updates**: Automated via `./deploy.sh update`
This is still 80% automated!
---
## 📞 Need Your Help
**Can you:**
1. Open browser DevTools when creating service in Easypanel
2. Copy the exact API request payload
3. Share it so I can update the skill?
Or if you know the correct schema, let me know!
---
**Status:** ⚠️ API schema unclear
**Workaround:** Manual creation + automated updates
**Automation Level:** 80% (will be 100% with correct schema)