fix: stabilize logging, logs API, CORS, auth, and repo validation#110
Open
codxbrexx wants to merge 16 commits intometacall:masterfrom
Open
fix: stabilize logging, logs API, CORS, auth, and repo validation#110codxbrexx wants to merge 16 commits intometacall:masterfrom
codxbrexx wants to merge 16 commits intometacall:masterfrom
Conversation
…nt, and a comprehensive styling system. P01
…wer, and add Prettier configuration.
…ce dashboard with server status and detailed deployment cards.
…ement full deployment management features on the Deployments page including listing, search, filter, and delete.
… refreshing, testing functions, and deleting deployments.
…, and repository deployment, and integrate new layout components.
…es, update CI/CD workflows, and refactor various UI components.
… process error handling, and refine UI pages and components.
…nsive documentation for the FaaS UI dashboard.
…epend on its healthy status.
…etaining backend UI-support APIs
…entication flexibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a bunch of stability and security issues in the local FaaS backend to get everything running smoothly.
Note: The new UI dashboard has been extracted to a separate repository based on maintainer feedback, so there is no UI code in this PR.
What We Did
1. Better Logging
INFO,WARN,ERROR,DEBUG,HTTP), and timestamps are added so that log aggregators can easily parse them. Multi-line logs (like stack traces) finally stay together instead of splitting weirdly.2. Working Logs API
POST /api/deploy/logsendpoint was just a stub that returned'TODO: Implement Logs...'.3. Enabled CORS
5173) couldn't make requests to the FaaS API because of CORS errors.api.ts. It allows common local development ports (3000,5173) and supports auth headers.4. Basic Auth Skeleton
users.jsonauth scaffold with login/signup endpoints and a defaultdev@metacall.ioaccount.5. Repository Security Fixes
https://,ssh://,git@), and branch names are strictly validated before anyexec()command runs.6. Inspect Stability
packageswasn't set yet would throw an error and break the entire/api/inspectendpoint.7. Deployment Promises Fixed
deployProcesswhere a promise could settle twice across different IPC exits.isSettledsafety check inside the promise resolution.8. Docker Compose Healthcheck Fix
testcontainer fired before the actual FaaS server was ready.healthcheckto the Docker Composefaasservice. The tests now won't trigger until FaaS is actively serving onlocalhost:9000/api/readiness.9. Cleaned Up Merged Code & Formatting
.ymlGithub actions.*.ymlignore rule in.prettierignore, reverted the GitHub Action formatting, and did a general cleanup of leftover files (like removingmocha_log.txt).Tasks
logger.tsto assign colors safely and emit structured formatPOST /api/deploy/logswith line-polling supportapi.tsusers.jsonauthentication scaffold with login/signup endpointsexec()commands inrepository.tswith strict git URL/branch validationisSettledrace condition insidedeploy.tspromisesWhat Is Left To Do
Testing Verification
npm testsuccessfully passes all 28 logging-utility unit tests!sudo docker compose up --build --exit-code-from test.Note: Once we have to make a new repo for the UI, we could have to update the CORS middleware to allow the UI to make requests to the backend.