Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed root nodejs clutter, migrated to sha256, justfile commands #95

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

wtfsayo
Copy link
Contributor

@wtfsayo wtfsayo commented Feb 11, 2024

This PR aims to simplify and clean the repo, decentralise js repos, migrate to SHA256 for hashing as discussed!

todo: just migrate doesn't work unless db url provided directly via string!

todo: make session more stable; next cookies not working best!!!

This PR aims to simplify and clean the repo, decentralise js repos, migrate to SHA256 for hashing as discussed!

todo: just migrate doesn't work unless db url provided directly via string!
@wtfsayo wtfsayo requested a review from plor February 11, 2024 19:11
Copy link

railway-app bot commented Feb 11, 2024

This PR is being deployed to Railway 🚅

portal-frontend: ◻️ REMOVED
portal-backend: ◻️ REMOVED

Copy link
Contributor

@plor plor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a couple questions that may be addressed in future iterations of this.

Comment on lines +14 to +26
cd ./web-portal/backend && pnpm install && pnpm start
build-backend:
cd ./web-portal/frontend && pnpm install && pnpm build
serve-backend:
cd ./web-portal/backend && pnpm install && pnpm start:prod


dev-frontend:
cd ./web-portal/frontend && pnpm install && pnpm dev
build-frontend:
cd ./web-portal/frontend && pnpm install && pnpm build
serve-frontend:
cd ./web-portal/frontend && pnpm install && pnpm start
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you put a justfile in the subdirectory you can do @just web-portal/build to define the actions closer to the code and avoid the cd. This is fine though. It might be good to bundle all the builds into a build-all or just build.

@@ -1,13 +1,26 @@
default:
@just --list

build:
@just gateway/build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this disconnects the gateway from the top level

}

generator client {
provider = "prisma-client-js"
output = "../../.generated/client"
output = "../../web-portal/backend/.generated/client"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the idea to use a shared volume not pan out?

async createAuthKey(tenantId: string): Promise<any> {
const secretKey = 'sk_' + randomBytes(39).toString('hex'); // <-- TODO: figure out final key format

const hashedKey = await bcrypt.hash(secretKey, this.salt);
const hashedKey = createHash('sha256').update(secretKey).digest('hex');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@wtfsayo wtfsayo merged commit f3c6149 into develop Feb 12, 2024
0 of 3 checks passed
@wtfsayo wtfsayo deleted the sha256-update branch February 13, 2024 09:39
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