-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix HEALTHCHECK #78
Fix HEALTHCHECK #78
Conversation
- fixes #77
Warning Rate limit exceeded@svengo has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 24 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes focus on updating file copies, configuring environment variables, and improving the health check in the Docker setup for a Tor service. The Changes
Sequence Diagram(s)sequenceDiagram
participant Dockerfile
participant config.sh
participant entry-point.sh
participant healthcheck.sh
participant Tor Service
Dockerfile->>config.sh: COPY config.sh
Dockerfile->>entry-point.sh: COPY entry-point.sh
Dockerfile->>healthcheck.sh: COPY healthcheck.sh
config.sh->>entry-point.sh: Set environment variables
entry-point.sh->>Tor Service: Configure and start Tor
healthcheck.sh->>Tor Service: Verify connectivity
Tor Service->>healthcheck.sh: Respond with status
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
healthcheck.sh
Outdated
source /config.sh | ||
|
||
# check health | ||
su-exec tor echo quit | curl -sS telnet://localhost:${ORPORT} || exit 1 |
Check notice
Code scanning / Shellcheck (reported by Codacy)
Double quote to prevent globbing and word splitting. Note
@@ -0,0 +1,7 @@ | |||
export ORPORT="${ORPORT:-9001}" |
Check warning
Code scanning / Shellcheck (reported by Codacy)
Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. Warning
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.
Actionable comments posted: 5
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- Dockerfile (1 hunks)
- config.sh (1 hunks)
- entry-point.sh (1 hunks)
- healthcheck.sh (1 hunks)
Additional context used
Shellcheck
healthcheck.sh
[warning] 5-5: In POSIX sh, 'source' in place of '.' is undefined.
(SC3046)
config.sh
[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
(SC2148)
entry-point.sh
[warning] 5-5: In POSIX sh, 'source' in place of '.' is undefined.
(SC3046)
GitHub Check: Codacy Static Code Analysis
healthcheck.sh
[warning] 8-8: healthcheck.sh#L8
Double quote to prevent globbing and word splitting.Dockerfile
[failure] 82-82: Dockerfile#L82
By not specifying a USER, a program in the container may run as 'root'. This is a security hazard.
GitHub Check: Shellcheck (reported by Codacy)
healthcheck.sh
[notice] 8-8:
Double quote to prevent globbing and word splitting.config.sh
[warning] 1-1:
Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
GitHub Check: Semgrep (reported by Codacy)
Dockerfile
[failure] 82-82:
By not specifying a USER, a program in the container may run as 'root'. This is a security hazard.
Additional comments not posted (15)
healthcheck.sh (6)
1-1
: LGTM!The shebang line is correct and necessary for script execution.
2-2
: LGTM!The
set -e
command ensures that the script stops on errors, which is a good practice for health check scripts.
3-3
: LGTM!The empty line improves readability.
4-4
: LGTM!The comment indicates the start of the default configuration section and provides useful information.
6-6
: LGTM!The empty line improves readability.
7-7
: LGTM!The comment indicates the start of the health check section and provides useful information.
config.sh (6)
2-2
: LGTM!The line sets a default value for
DIRPORT
if it is not already set.
3-3
: LGTM!The line sets a default value for
EXITPOLICY
if it is not already set.
4-4
: LGTM!The line sets a default value for
CONTROLPORT
if it is not already set.
5-5
: LGTM!The line sets a default value for
HASHEDCONTROLPASSWORD
if it is not already set.
6-6
: LGTM!The line sets a default value for
NICKNAME
if it is not already set.
7-7
: LGTM!The line sets a default value for
CONTACTINFO
if it is not already set.Dockerfile (3)
74-74
: LGTM!The line copies
config.sh
into the container, which is necessary for the container to have access to the configuration file.
75-75
: LGTM!The line copies
entry-point.sh
into the container, which is necessary for the container to have access to the entry point script.
76-76
: LGTM!The line copies
healthcheck.sh
into the container, which is necessary for the container to have access to the health check script.
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.
Actionable comments posted: 0
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- config.sh (1 hunks)
- entry-point.sh (1 hunks)
- healthcheck.sh (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- config.sh
Additional context used
Shellcheck
healthcheck.sh
[warning] 6-6: In POSIX sh, 'source' in place of '.' is undefined.
(SC3046)
entry-point.sh
[warning] 6-6: In POSIX sh, 'source' in place of '.' is undefined.
(SC3046)
Additional comments not posted (3)
healthcheck.sh (2)
6-6
: Use POSIX compliant command.The use of
source
is not POSIX compliant. Use.
instead.- source /config.sh + . /config.shTools
Shellcheck
[warning] 6-6: In POSIX sh, 'source' in place of '.' is undefined.
(SC3046)
9-9
: Quote the command to prevent globbing and word splitting.The command should be quoted to prevent globbing and word splitting.
- su-exec tor echo quit | curl -sS "telnet://localhost:${ORPORT}" || exit 1 + su-exec tor echo quit | curl -sS "telnet://localhost:${ORPORT}" || exit 1entry-point.sh (1)
6-6
: Use POSIX compliant command.The use of
source
is not POSIX compliant. Use.
instead.- source /config.sh + . /config.shTools
Shellcheck
[warning] 6-6: In POSIX sh, 'source' in place of '.' is undefined.
(SC3046)
config.sh
with configuration defaultsdocker-entry-point.sh
toentry-point.sh
healthcheck.sh
http://localhost:${DIRPORT}/tor/server/authority
Summary by CodeRabbit
New Features
Improvements