-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: Merge 1.8 changeset #15
base: master
Are you sure you want to change the base?
Conversation
syncrepo.sh
Outdated
"$name" "$@" | ||
utils.say -d 'leaving %s' "$name" | ||
utils.say -d '%-*s leave %s' $((--call_count)) '<-' "$name" | ||
} | ||
|
||
# Log message and print to stdout | ||
# shellcheck disable=SC2059 | ||
utils.say() { |
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.
TODO: Modifiy this to write to stderr, where apropriate (and adjust tee accordingly).
syncrepo.sh
Outdated
@@ -656,7 +661,7 @@ syncrepo.sync_downstream() { | |||
local repo package_list | |||
utils.say 'Configured as downstream, so mirroring local upstream.' | |||
|
|||
[[ -n $SR_MIRROR_UPSTREAM ]] || { | |||
[[ $SR_MIRROR_UPSTREAM ]] || { |
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.
TODO: Rework upstream/downstream variables and how they're set.
syncrepo.sh
Outdated
} | ||
|
||
# And a few more (ClamAV) | ||
[[ $CLAMAV_SYNC == true ]] && | ||
clamsync="clamavmirror -a $CMIRROR -d $CLAMREPO -u root -g www-data" | ||
[[ $SR_SYNC_CLAMAV == true ]] && { |
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.
TODO: Investigate replacing clamavmirror
with cvdupdate
, or writing our own, if necessary.
set -euo pipefail | ||
shopt -s extdebug | ||
|
||
# TODO: Implement support for Rocky (and maybe Alma) |
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.
TODO found
shopt -s extdebug | ||
|
||
# TODO: Implement support for Rocky (and maybe Alma) | ||
# TODO: Implement support for RHEL based SecurityOnion |
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.
TODO found
|
||
# TODO: Implement support for Rocky (and maybe Alma) | ||
# TODO: Implement support for RHEL based SecurityOnion | ||
# TODO: Implement Docker registry sync logic (also podman registry) |
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.
TODO found
# TODO: Implement support for Rocky (and maybe Alma) | ||
# TODO: Implement support for RHEL based SecurityOnion | ||
# TODO: Implement Docker registry sync logic (also podman registry) | ||
# TODO: Fix upstream/downstream logic and detection (also variables) |
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.
TODO found
QUIET=true | ||
shift | ||
elif [[ $1 == -v ]]; then | ||
# TODO: Implement verbose or remove this |
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.
TODO found
fi | ||
fi | ||
# TODO: Test the tput combinations on multiple distros |
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.
TODO found
exit 1 | ||
} | ||
|
||
# TODO: Dig through the other functions and move their checks here |
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.
TODO found
|
||
# Sync docker repository (for each enabled OS) | ||
# TODO: Use wget_rsync() instead of a regular clone |
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.
TODO found
say 'Beginning sync of ClamAV repository from %s.' "$CMIRROR" | ||
$clamsync &>> $PROGFILE | ||
say 'Done.\n' | ||
# TODO: Replace with wget_rsync() |
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.
TODO found
else | ||
# Do a downstream sync | ||
UMIRROR=${UMIRROR:=$MIRROR} && ds_sync | ||
# TODO: This should probably be empty until set by the user |
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.
TODO found
Code Climate has analyzed commit cb60c03 and detected 10 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
2f9308f
to
de59782
Compare
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
8e1b6e4
to
6ba44cc
Compare
Signed-off-by: Eddie Carswell <[email protected]>
- Fix variable quoting and expansion issues - Converted globals to be overrideable - Formatted code for increased legibility - Fixed nonstandard exit code usage Signed-off-by: Eddie Carswell <[email protected]>
- Sync components implicitly inherit from SR_SYNC_ALL_REPOS - All SR_SYNC_* variables default to off and may be overridden - Made owner UID:GID of repository files configurable - Added ability to load configuration from the files: `/etc/syncrepo.conf` and `/etc/syncrepo/syncrepo.conf` The most specific path overrides the former, when settings conflict, otherwise they merge. Expected format is an environment file. - Adjusted a couple function names to not be truncated
- Renamed remaining variables for descriptiveness and namespacing - Marked all local variables as local - Added rudimentary config generation logic - Cleaned up utility functions - Adjusted help text and CLI interface (WIP) Signed-off-by: Eddie Carswell <[email protected]>
Converted any variable that was better off as an array into one Signed-off-by: Eddie Carswell <[email protected]>
Signed-off-by: Eddie Carswell <[email protected]>
Signed-off-by: Eddie Carswell <[email protected]>
- Enabled bash "strict mode" to catch more issues - Fixed all uses of uninitialized variables (so far) - Adjust utility functions argument handling - Improved debug call stack tracing Signed-off-by: Eddie Carswell <[email protected]>
(update from commits when ready)
Add fixes: and see: tags
Review this before merging. Particularly, add
utils.common.sh
as a module and factor out vendored utility functions.TODO: Need to figure out which changes in this should be split into another release. The total refactor is already cumbersome without the functionality changes.