Repository navigation
build: make up and make image for local work - #47
Merged
Merged
Conversation
The demo seed was untracked as private in #165, so make up and db:init failed on a fresh clone. The new one is tracked: invented employees on example.com, real public breaches from Have I Been Pwned, alerts scored by the scanner's own rules.
Secrets are generated per instance and passed through env files, never on a command line.
Both used the container name gardik-db, so a stopped host database blocked the stack with a name conflict. The stack database gets its own name, and make up explains how to free port 5432 instead of failing on it.
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.
Closes #46 (closed manually on merge, closing keywords do not apply to
develop).Two
maketargets: one for developers to get the site, one to test the production image before it is published.make up: the site for developersmake envthenmake upgives the site on http://localhost:3000 with hot reload and demo data. It failed on a fresh clone: the stack runsnpm run seed:dev, whoseprisma/seed.dev.tswas untracked as private in #165.seed:devnow runs the admin seed, then a public demo seed (prisma/seed.demo.ts, data inprisma/demo/):example.comdomain, so a demo scan can never reach a real person;severityForandnormalizeType, worded like real scan alerts;make image: test the production imagemake imagebuildsDockerfile(the published image), runs it on http://localhost:3001 with its own Postgres, and prints the bootstrap invite link foradmin@example.com, the same first-run path as a real deployment.make image-scanruns Trivy (HIGH, CRITICAL).make image-downremoves containers, network, volume and secrets..image-local/(mode 600, ignored by git and docker) and passed with--env-file, never on a command line.Running next to the host database
compose.ymlandmake db-upboth named their database containergardik-db, so aftermake db-down(which stops but keeps it)make upfailed on a name conflict. The stack database is nowgardik-stack-db, andmake upstops early with "Stop it first with: make db-down" when the host database holds port 5432. Another PostgreSQL on 5432:POSTGRES_PORT=5433 make up.Verified
make upon a clean stack: migrations, admin, demo data, site on :3000; signed in, 18example.comemployees listed, dashboard populated.make imagetwice: invite link sets the password, sign-in reaches the dashboard, employees, sources and alerts pages load without errors.make image-scan: 0 HIGH or CRITICAL.make image-downleaves no container, volume or secret behind.make checkgreen.Docs
README and wiki (Getting Started, Development, Architecture) now say
make upandmake image, describe the demo data, and fixdb:init, which starts Postgres throughscripts/db-up.sh, notcompose.yml.Found while testing, not changed here
passwords, whileseverityForlooks forpassword. The demo shows it: all 30 alerts are MEDIUM.