diff --git a/start.sh b/start.sh index edda433..6e3e717 100644 --- a/start.sh +++ b/start.sh @@ -217,11 +217,18 @@ sed -i 's|storage.type: "local"|storage.type: "s3"|g' /app/data/config/config.ya sed -i 's|s3.are_local_buckets: true|s3.are_local_buckets: false|g' /app/data/config/config.yaml # Set up the API endpoint for the web apps -API_ENDPOINT="${CLOUDRON_APP_ORIGIN}/api" -echo "==> Setting API endpoint to $API_ENDPOINT" +echo "==> Setting API endpoint to https://a.due.ren/api" +export ENTE_API_ENDPOINT="https://a.due.ren/api" +export API_ENDPOINT="https://a.due.ren/api" +export PUBLIC_ALBUMS_API_ENDPOINT="https://a.due.ren/public" +export MUSEUM_DB_HOST="${CLOUDRON_POSTGRESQL_HOST}" +export MUSEUM_DB_PORT="${CLOUDRON_POSTGRESQL_PORT}" +export MUSEUM_DB_USER="${CLOUDRON_POSTGRESQL_USERNAME}" +export MUSEUM_DB_PASS="${CLOUDRON_POSTGRESQL_PASSWORD}" +export MUSEUM_DB_NAME="${CLOUDRON_POSTGRESQL_DATABASE}" +export CLOUDRON_APP_ORIGIN="https://a.due.ren" # Set environment variables for the web apps -export ENTE_API_ENDPOINT=$API_ENDPOINT export NEXT_PUBLIC_ENTE_ENDPOINT=$API_ENDPOINT export REACT_APP_ENTE_ENDPOINT=$API_ENDPOINT export VUE_APP_ENTE_ENDPOINT=$API_ENDPOINT @@ -845,13 +852,32 @@ func main() { w.Header().Set("Content-Type", "application/json") if isValid { - // Return a successful verification response + // Return a successful verification response with required fields w.WriteHeader(http.StatusOK) - // Use the json package to create the response - jsonResponse := map[string]string{ + // Use the json package to create the response with all fields expected by client + jsonResponse := map[string]interface{}{ "status": "ok", - "token": "mock-token-12345", + "id": 12345, // Add required numeric ID + "token": "mock-token-12345", + "email": email, + "createdAt": time.Now().Unix() - 3600, + "updatedAt": time.Now().Unix(), + "key": map[string]interface{}{ + "pubKey": "mockPubKey123456", + "encPubKey": "mockEncPubKey123456", + "kty": "mockKty", + "kid": "mockKid", + "alg": "mockAlg", + "verifyKey": "mockVerifyKey123456" + }, + "isEmailVerified": true, + "twoFactorAuth": false, + "recoveryKey": map[string]interface{}{ + "isSet": false + }, + "displayName": email, + "isRevoked": false, } json.NewEncoder(w).Encode(jsonResponse) } else { @@ -1094,13 +1120,32 @@ func main() { w.Header().Set("Content-Type", "application/json") if isValid { - // Return a successful verification response + // Return a successful verification response with required fields w.WriteHeader(http.StatusOK) - // Use the json package to create the response - jsonResponse := map[string]string{ + // Use the json package to create the response with all fields expected by client + jsonResponse := map[string]interface{}{ "status": "ok", - "token": "mock-token-12345", + "id": 12345, // Add required numeric ID + "token": "mock-token-12345", + "email": email, + "createdAt": time.Now().Unix() - 3600, + "updatedAt": time.Now().Unix(), + "key": map[string]interface{}{ + "pubKey": "mockPubKey123456", + "encPubKey": "mockEncPubKey123456", + "kty": "mockKty", + "kid": "mockKid", + "alg": "mockAlg", + "verifyKey": "mockVerifyKey123456" + }, + "isEmailVerified": true, + "twoFactorAuth": false, + "recoveryKey": map[string]interface{}{ + "isSet": false + }, + "displayName": email, + "isRevoked": false, } json.NewEncoder(w).Encode(jsonResponse) } else {