-
Notifications
You must be signed in to change notification settings - Fork 61
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
chore(devops scripts): cert cname script #17225
Conversation
Update scripts/certs.sh Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Update scripts/certs.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update scripts/certs.sh Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Update scripts/certs.sh Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> fix: Reccomended fixes fix: Reccomended fixes fix: Reccomended fixes
Warning Rate limit exceeded@robertaandersen has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 32 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. 📒 Files selected for processing (1)
WalkthroughA new Bash script named Changes
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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: 2
🧹 Outside diff range and nitpick comments (2)
scripts/certs.sh (2)
4-5
: Consider using environment variables for configurationFor better flexibility and maintainability, consider using environment variables with defaults:
-# Configuration -OUTPUT_FILE="${1:-email.md}" +# Configuration +DEFAULT_OUTPUT_FILE="email.md" +OUTPUT_FILE="${CERT_OUTPUT_FILE:-${1:-$DEFAULT_OUTPUT_FILE}}"
18-23
: Consider externalizing the message stringsThe hardcoded Icelandic messages could be moved to a separate configuration file for better maintainability and potential internationalization.
+# Load messages from configuration file +MESSAGE_FILE="${CERT_MESSAGE_FILE:-./cert-messages.conf}" +if [ -f "$MESSAGE_FILE" ]; then + source "$MESSAGE_FILE" +else + TITLE="# Beiðni um staðfestingu á skirteini fyrir lén" + INTRO="Við fengum beiðni um áframsendingu..." + # ... other messages +fi + { - printf "# Beiðni um staðfestingu á skirteini fyrir lén\n\n" - printf "Við fengum beiðni um áframsendingu...\n\n\n" + printf "%s\n\n" "$TITLE" + printf "%s\n\n\n" "$INTRO" # ... rest of the messages } >"$OUTPUT_FILE"
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/certs.sh
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
scripts/certs.sh (1)
Pattern scripts/**/*
: "Confirm that the code adheres to the following:
- Script efficiency, readability, and maintainability.
- Usage of environmental variables and configuration files for flexibility.
- Integration with NX workspace utilities and commands."
🔇 Additional comments (3)
scripts/certs.sh (3)
9-16
: LGTM! Good error handling for file operations
The file initialization logic is robust with proper error handling and atomic operations.
25-35
: LGTM! Thorough prerequisite checks
The AWS CLI and credentials verification is well implemented with clear error messages.
1-85
: Verify integration with NX workspace
As this script is part of the workspace, let's verify its integration with NX utilities and commands.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Datadog ReportAll test runs ✅ 31 Total Test Services: 0 Failed, 26 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (3) |
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.
Does this not belong in the infra repo as the remainder of the config is there?
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: 2
🧹 Outside diff range and nitpick comments (3)
infra/scripts/certs.sh (3)
4-5
: Add parameter validation for OUTPUT_FILEWhile the default value handling is good, consider adding validation to ensure the output directory exists and is writable.
# Configuration OUTPUT_FILE="${1:-email.md}" +OUTPUT_DIR=$(dirname "$OUTPUT_FILE") +if [ ! -d "$OUTPUT_DIR" ] || [ ! -w "$OUTPUT_DIR" ]; then + echo "Error: Directory $(dirname "$OUTPUT_FILE") does not exist or is not writable" + exit 1 +fi
25-35
: Add AWS region validationWhile the AWS CLI and credentials checks are good, consider adding region validation to ensure the script runs in the intended region.
# Check AWS credentials aws sts get-caller-identity >/dev/null 2>&1 || { echo "Error: AWS credentials not configured" exit 1 } + +# Check AWS region +CURRENT_REGION=$(aws configure get region) +EXPECTED_REGION="eu-west-1" # Update this to your expected region +if [ "$CURRENT_REGION" != "$EXPECTED_REGION" ]; then + echo "Error: Script must run in $EXPECTED_REGION region (current: $CURRENT_REGION)" + exit 1 +fi
85-85
: Add error handling for final writeConsider adding error handling for the final write operation to ensure the file is properly completed.
-printf "Með kveðju\n\nApró ehf." >>"$OUTPUT_FILE" +printf "Með kveðju\n\nApró ehf." >>"$OUTPUT_FILE" || { + echo "Error: Failed to write closing message" + exit 1 +}
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
infra/scripts/certs.sh
(1 hunks)
🔇 Additional comments (2)
infra/scripts/certs.sh (2)
9-23
: LGTM! Good file handling practices
The file handling is well-implemented with proper error checking and atomic operations.
1-1
: Verify script permissions
Ensure the script has executable permissions set.
✅ Verification successful
Script permissions are correctly set
The script already has executable permissions (755/-rwxr-xr-x) which allows execution by owner, group, and others.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the script has executable permissions
ls -l infra/scripts/certs.sh | grep -q '^-rwx' || echo "Warning: Script is not executable"
Length of output: 48
Script:
#!/bin/bash
# Let's check the actual permissions of the script
ls -l infra/scripts/certs.sh
Length of output: 102
Svona lítur emailið út:
Beiðni um staðfestingu á skirteini fyrir lén
Við fengum beiðni um áframsendingu á slóð inn á undirssíðu hjá island.is. Við þurfum því að gefa út skilríki fyrir slóðina.
Bæta þarf CNAME færslum við til hægt sé að sannreyna að þau séu í nafni eiganda lénsins.
Hér koma lénin og gildin á CNAME færslunum:
Domain Name: rikiskaup.is
Domain Name: www.rikiskaup.is
Domain Name: netbrot.is
Domain Name: www.netbrot.is
Með kveðju
Apró ehf.
Summary by CodeRabbit