-
Notifications
You must be signed in to change notification settings - Fork 33
docs #1561
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
base: dev
Are you sure you want to change the base?
docs #1561
Changes from 11 commits
c3de9df
c2c7ede
e08fd6d
c70d8a0
34f322f
2b16d00
0252358
4e11844
efe58c5
efc5a8b
3ddde55
252b577
f02a24d
e463a77
612546e
216a721
fe9e779
5924978
99eab96
1147e62
f606627
68a5a85
3d78883
c0ccbc5
566f1a6
b954a53
0f2e699
3ec151e
1ee4222
fa079f4
520115f
2057976
07a64d7
36e9d16
96f3ee3
a7d6e3f
6ac36dd
4116422
d535aa9
fcf8c7b
b3d1cb8
6c1f630
5324a77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| abc-user-feedback |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| web: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| hostname: web | ||||||||||||||||||||||||||||||||||||||||||||||||||
| image: line/abc-user-feedback-web | ||||||||||||||||||||||||||||||||||||||||||||||||||
| restart: always | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - 3000:3000 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| extra_hosts: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'host.docker.internal:host-gateway' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| environment: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - NEXT_PUBLIC_API_BASE_URL=http://localhost:4000 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - NEXT_PUBLIC_MAX_DAYS=90 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| depends_on: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - api | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| api: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| hostname: api | ||||||||||||||||||||||||||||||||||||||||||||||||||
| image: line/abc-user-feedback-api | ||||||||||||||||||||||||||||||||||||||||||||||||||
| restart: always | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ports: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - 4000:4000 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| extra_hosts: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - 'host.docker.internal:host-gateway' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| environment: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - JWT_SECRET=secret | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - MYSQL_PRIMARY_URL=mysql://root:userfeedback@host.docker.internal:13306/userfeedback | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - JWT_SECRET=secret | |
| - MYSQL_PRIMARY_URL=mysql://root:userfeedback@host.docker.internal:13306/userfeedback | |
| environment: | |
| - JWT_SECRET=${JWT_SECRET:-secret} | |
| - MYSQL_PRIMARY_URL=${MYSQL_PRIMARY_URL:-mysql://root:userfeedback@host.docker.internal:13306/userfeedback} |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Replace default API key with a placeholder or generated value.
The MASTER_API_KEY is set to a predictable value "MASTER_API_KEY". This should be a placeholder instructing users to change it, or better, a generated secure random value.
- - MASTER_API_KEY=MASTER_API_KEY
+ - MASTER_API_KEY=${MASTER_API_KEY:-$(openssl rand -hex 16)}Alternatively, generate this value during initialization and store it in the config.toml file.
Committable suggestion skipped: line range outside the PR's diff.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add volume mounts for data persistence.
The Docker Compose services don't include any volume mounts. Without persistent storage, all data will be lost when containers are removed.
environment:
- JWT_SECRET=secret
- MYSQL_PRIMARY_URL=mysql://root:userfeedback@host.docker.internal:13306/userfeedback
- BASE_URL=http://localhost:3000
- SMTP_HOST=smtp4dev
- SMTP_PORT=25
- SMTP_SENDER=noreply@linecorp.com
- SMTP_BASE_URL=http://localhost:3000
- AUTO_MIGRATION=true
- MASTER_API_KEY=MASTER_API_KEY
- NODE_OPTIONS=--max_old_space_size=3072
+ volumes:
+ - api_data:/app/data
+
+volumes:
+ api_data:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - BASE_URL=http://localhost:3000 | |
| - SMTP_HOST=smtp4dev | |
| - SMTP_PORT=25 | |
| - SMTP_SENDER=noreply@linecorp.com | |
| - SMTP_BASE_URL=http://localhost:3000 | |
| - AUTO_MIGRATION=true | |
| - MASTER_API_KEY=MASTER_API_KEY | |
| - NODE_OPTIONS=--max_old_space_size=3072 | |
| environment: | |
| - JWT_SECRET=secret | |
| - MYSQL_PRIMARY_URL=mysql://root:userfeedback@host.docker.internal:13306/userfeedback | |
| - BASE_URL=http://localhost:3000 | |
| - SMTP_HOST=smtp4dev | |
| - SMTP_PORT=25 | |
| - SMTP_SENDER=noreply@linecorp.com | |
| - SMTP_BASE_URL=http://localhost:3000 | |
| - AUTO_MIGRATION=true | |
| - MASTER_API_KEY=MASTER_API_KEY | |
| - NODE_OPTIONS=--max_old_space_size=3072 | |
| volumes: | |
| - api_data:/app/data | |
| volumes: | |
| api_data: |
Uh oh!
There was an error while loading. Please reload this page.