-
Notifications
You must be signed in to change notification settings - Fork 1
Add local development configuration with docker-compose.local.yml #107
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: main
Are you sure you want to change the base?
Changes from all commits
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,38 @@ | ||
| services: | ||
| redmine-tunnel: | ||
| container_name: redmine-tunnel | ||
| image: alpine:latest | ||
| command: > | ||
| sh -c "apk add --no-cache openssh && | ||
| ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa ubuntu@staging.forecasting-v2.gluzdov.com -N -L 0.0.0.0:3306:redmine-pr-rds-db-read.c1kaki1qbk4o.us-east-1.rds.amazonaws.com:3306 -L 0.0.0.0:31000:10.4.3.184:31000" | ||
| volumes: | ||
| - ~/.ssh:/root/.ssh:ro | ||
| ports: | ||
| - '3306:3306' | ||
| networks: | ||
| - app-network | ||
| environment: | ||
| - SSH_KEY=/root/.ssh/id_rsa | ||
|
Comment on lines
+6
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Major: SSH security misconfigurations and unused environment variable. Multiple SSH-related issues:
Apply this diff to fix the inconsistency: redmine-tunnel:
container_name: redmine-tunnel
image: alpine:latest
command: >
sh -c "apk add --no-cache openssh &&
- ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa ubuntu@staging.forecasting-v2.gluzdov.com -N -L 0.0.0.0:3306:redmine-pr-rds-db-read.c1kaki1qbk4o.us-east-1.rds.amazonaws.com:3306 -L 0.0.0.0:31000:10.4.3.184:31000"
+ ssh -o StrictHostKeyChecking=accept-new -i ${SSH_KEY} ${REDMINE_SSH_USER}@${REDMINE_SSH_HOST} -N -L 0.0.0.0:3306:${REDMINE_DB_HOST}:3306 -L 0.0.0.0:31000:${REDMINE_FORWARD_HOST}:31000"
volumes:
- ~/.ssh:/root/.ssh:ro
ports:
- '3306:3306'
networks:
- app-network
environment:
- SSH_KEY=/root/.ssh/id_rsaConsider
🤖 Prompt for AI Agents |
||
|
|
||
| mongo-tunnel: | ||
| container_name: mongo-tunnel | ||
| image: alpine:latest | ||
| command: > | ||
| sh -c "apk add --no-cache openssh && | ||
| ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa ubuntu@forecasting-v2.gluzdov.com -N -L 0.0.0.0:31000:10.4.3.184:31000" | ||
| volumes: | ||
| - ~/.ssh:/root/.ssh:ro | ||
| ports: | ||
| - '31000:31000' | ||
| networks: | ||
| - app-network | ||
| environment: | ||
| - SSH_KEY=/root/.ssh/id_rsa | ||
|
Comment on lines
+17
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical & Major: Hardcoded infrastructure endpoints and SSH misconfigurations (same as redmine-tunnel). The mongo-tunnel service contains identical issues:
Apply the same refactoring as redmine-tunnel to externalize sensitive data and fix SSH security configuration. 🤖 Prompt for AI Agents |
||
|
|
||
| temporal-worker-main: | ||
| env_file: | ||
| - .env | ||
| extra_hosts: | ||
| - 'mongo1:host-gateway' | ||
| - 'mongo2:host-gateway' | ||
| - 'mongo3:host-gateway' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ describe('handleRunError', () => { | |
| let processExitSpy: ReturnType<typeof vi.spyOn>; | ||
|
|
||
| beforeEach(() => { | ||
| vi.useFakeTimers(); | ||
|
|
||
|
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify timer usage in Fake timers are configured but the tests don't explicitly advance or control them. If Run the following script to check if 🏁 Script executed: #!/bin/bash
# Description: Check if handleRunError implementation uses setTimeout, setInterval, or other timer functions
# Search for handleRunError implementation and timer usage
ast-grep --pattern 'function handleRunError($$$) {
$$$
}'
# Also search for timer-related calls in the index.ts file
rg -n 'setTimeout|setInterval|clearTimeout|clearInterval' workers/main/src/index.tsLength of output: 44 I need to check the actual test implementations to see if they're advancing timers or if they're missing this critical step. 🏁 Script executed: #!/bin/bash
# View the handleRunError implementation and surrounding context
cat workers/main/src/index.ts | head -60 | tail -20
echo "---"
# View the full test file to see if timers are being advanced
cat workers/main/src/index.test.tsLength of output: 1929 Tests must verify the 100ms The test setup enables fake timers and mocks Example fix: it('should exit with code 1 after 100ms', () => {
const error = new Error('test error');
const logSpy = vi.spyOn(logger, 'error').mockImplementation(() => {});
handleRunError(error);
expect(logSpy).toHaveBeenCalledWith(
`Error in main worker: ${error.message}`,
);
vi.advanceTimersByTime(100);
expect(processExitSpy).toHaveBeenCalledWith(1);
logSpy.mockRestore();
});🤖 Prompt for AI Agents |
||
| // Mock process.exit to prevent actual process termination during tests | ||
| processExitSpy = vi.spyOn(process, 'exit').mockImplementation(() => { | ||
| throw new Error('process.exit called'); | ||
|
|
@@ -14,6 +16,8 @@ describe('handleRunError', () => { | |
|
|
||
| afterEach(() => { | ||
| processExitSpy.mockRestore(); | ||
| vi.clearAllTimers(); | ||
| vi.useRealTimers(); | ||
| }); | ||
|
|
||
| it('should log the error', () => { | ||
|
|
||
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.
Critical: Hardcoded infrastructure endpoints and credentials exposed.
Lines 7 and throughout the redmine-tunnel service expose sensitive infrastructure details that must never be committed:
ubuntu@staging.forecasting-v2.gluzdov.comredmine-pr-rds-db-read.c1kaki1qbk4o.us-east-1.rds.amazonaws.com10.4.3.184:31000These represent production/staging infrastructure and should be externalized to environment variables or a
.env.localfile that is excluded from version control.Refactor to use environment variable substitution:
services: redmine-tunnel: container_name: redmine-tunnel image: alpine:latest command: > sh -c "apk add --no-cache openssh && - ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa ubuntu@staging.forecasting-v2.gluzdov.com -N -L 0.0.0.0:3306:redmine-pr-rds-db-read.c1kaki1qbk4o.us-east-1.rds.amazonaws.com:3306 -L 0.0.0.0:31000:10.4.3.184:31000" + ssh -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa ${REDMINE_SSH_USER}@${REDMINE_SSH_HOST} -N -L 0.0.0.0:3306:${REDMINE_DB_HOST}:3306 -L 0.0.0.0:31000:${REDMINE_FORWARD_HOST}:31000"Ensure
.env.localis added to.gitignoreand create a.env.local.exampletemplate with placeholder values.🤖 Prompt for AI Agents