Skip to content

ocument the setup gotchas we kept hitting - #59

Open
vector-ok wants to merge 63 commits into
masterfrom
develop
Open

vector-ok wants to merge 63 commits into
masterfrom
develop

Conversation

@vector-ok

Copy link
Copy Markdown
Collaborator

Description

Please include a summary of the change and relevant motivation and context.
List any dependencies that are required for this change.

All pull requests should be related to open issues. Indicate the issue(s) bellow and remove this line:
Fixes #(issue number 1) #(issue number 2 if applicable)

How Has This Been Tested?

Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code etc.

Screenshots (if applicable, else remove this line / section)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added necessary inline code documentation
  • I have added tests that prove my fix is effective and that this feature works
  • New and existing unit tests pass locally with my changes

codacy-badger and others added 30 commits June 8, 2020 11:33
Add a Codacy badge to README.md
Removed default D-rating.
Setup CI with Git Actions.
Added gitignore node-modules.
Added Nodemon library.
Set up first middleware.
Backend app set for deploy on Heroku.
Removed unnecesary comments
Added middleware for default response.
added organization field for users
fixed date of birth validation bug.
vector-ok and others added 29 commits June 26, 2020 18:54
Fixed Sponsor bug on events model.
Added linked Event to Announcement.
Modified admin Controller for better response.
Added functionality for updating User and Admin records.
Implemented image upload functionality.
Added image upload capability to Events page.
The app connected to Mongo on import, signed tokens with a hardcoded
secret and repeated the same CRUD blocks in every controller. This turns
it into something we can maintain and deploy:

* config comes from the environment and fails fast when STRING or
  JWT_SECRET is missing
* the Mongo connection lives in db.js, so the Express app can be imported
  without a database and the tests run against mongodb-memory-server
* every writable route validates its payload with Joi and answers 400 with
  field level details
* events, funds and announcements share one CRUD factory, and a single
  error handler formats every failure response
* pino replaces console logging and /health reports the connection state
* 69 tests across 8 suites, with a coverage gate in CI
* dependencies, ESLint config, GitHub Actions, Docker and the README are
  brought up to date
Release the API rework: environment configuration, Joi validation, a shared
CRUD factory, structured logging with a health endpoint, integration tests
with coverage gates, and refreshed tooling and CI.
Three things have tripped people up on a fresh clone: the STRING
variable actually holds the Mongo URI, the first test run is slow
because mongodb-memory-server downloads a mongod binary, and the
pre-commit hook fails if Node is not on PATH. Worth writing down.
@gitguardian

gitguardian Bot commented Oct 27, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - MongoDB Credentials 7d7d62f src/app.js View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants