-
Notifications
You must be signed in to change notification settings - Fork 32
Gh v2 580b czarte and Dan #630
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
Merged
Merged
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
bb19b4a
remove data from dbip_country.rs - prepared for actions build
czarte dd6873b
Added DBIP file generation
FinsaasGH e2b77c4
ci: improve GitHub Actions workflow - Replace s3-sync-action with AWS…
FinsaasGH 3d13940
refactor: improve path resolution and code quality in generate_dbip
FinsaasGH e5d6dfa
ci: remove unnecessary dependencies and update generate dbip step
FinsaasGH 5e77a80
chore: remove unused generate_dbip_country.sh script
FinsaasGH 4ae5489
docs: update download script message to reference cargo command
FinsaasGH a3cdcf0
refactor: Improve generate_dbip.rs organization and efficiency
FinsaasGH 6614f58
fix: Update dbip_country.rs paths in CI workflow to use temp directory
FinsaasGH 0c995bb
fix: Update verification pattern for generated dbip file
FinsaasGH 3dd52e1
ci: revert platform changes to legacy
FinsaasGH c0780a3
ci: update windows specific file move to use bash
FinsaasGH 325bd40
ci: corrected verification step
FinsaasGH 1db154c
Room for an MMDB parser
dnwiebe 63d26da
Generating countries, rudimentary
dnwiebe 3f7404f
parse() should produce a Countries object, instead of Vec<(String, St…
dnwiebe cd7e2ae
Interim commit
dnwiebe 1a8d6b2
Must make tests self-adapting
dnwiebe c89dca2
No MMDB yet, but tests pass
dnwiebe 9c32dd1
About to try bringing in an actual DBIP file
dnwiebe 174259b
Happy-path test passing
dnwiebe cf1be29
MMDB parser seems to be finished
dnwiebe b714d97
Now MMDB parser isn't as wasteful
dnwiebe e9c7a64
Removed dead data
dnwiebe cfb1ba0
Tests all pass
dnwiebe eb83b48
Merge branch 'GH-788_multinode_test-review2' into GH-v2-580b
dnwiebe 03546ed
Merge mostly complete; lots of tests pass. Maybe all of them?
dnwiebe d7a6ddb
One test failing. Can't figure why.
dnwiebe de6edae
All masq tests passing now
dnwiebe e7b7e3c
Multinode tests pass; one bit of code cleanup remains
dnwiebe d1dc3e9
All tests should be passing
dnwiebe 199cd04
Removed dead code
dnwiebe 4d50c3a
Little surgery on modules and imls
dnwiebe 41456e5
Updated the CSV country list from MMDB
dnwiebe b67a4b3
Started GitHub Actions file for monthly downloads
dnwiebe 07d9121
conditions for failing download and gargo run, to not continue, file …
czarte 894deaf
Going to try out the dbip_download workflow
dnwiebe 62fedaf
Temporary on:
dnwiebe 2b57dc0
generate dbip_country.rs workflow and checkout dbip_country.rs from s…
czarte ac82b47
merge GH-788 in
czarte 00bf223
resolved most failing tests, now failing debut_with_node_addr_not_acc…
czarte 244c6df
fixing failing tests
czarte 242dad5
comment out fetch dbip, and remove unwanted action build dbip
czarte bc80424
try to fix actions
czarte 2fef65a
all countries in test dbip_country.rs
czarte 38fb895
removing misstake
czarte 86c259f
added checkout of read dbip_country.rs from DBIP-Experiment
czarte 645fb80
new workflow: in local we work with reduced dbip, but on ci/all.sh we…
czarte 7d46624
testing git pre-commit hook
czarte d7202cc
update pre-commit hook
czarte 54cd278
remove checkout of dbip_country.rs from ci-matrix, it will be handled…
czarte 369e541
testing pre-commit hooks changes
czarte 0349cb7
testing commit hook
czarte c955825
testing pre commit hook
czarte e2d09c2
testing pre commit hook
czarte 23db9a9
final polishing of pre-commit hook
czarte 3127a44
addressed comments from Review
czarte eb49ebd
formatting
czarte 166e706
addressing review comments, plus fix double entry of ip_country in mo…
czarte e493777
Enabled IDE tests in ip_country
dnwiebe d5c8276
Fixed module-definition problem, addressed two review comments
dnwiebe 4c5d524
Weird stuff with TryFrom and From
dnwiebe 0d4f36f
addressing review comments
czarte 37dca71
fix ci.all condition for chekout dbip
czarte c707004
remove comments and exit in ci/all.sh
czarte 0bedea4
added dbip_download github workflow (#637)
czarte 0ad2d14
Master gh 580 b dbip download workflow (#639)
czarte aeae56c
Master gh 580 b dbip download workflow (#641)
czarte 67929a0
generated-source from Node repo
czarte ba6daab
dbip download workflow for master
czarte 697b3e5
adjust cron shedule for dbip download
czarte 68c2ddb
Master gh 580 b dbip download workflow (#643)
czarte 7659db8
Master gh 580 b dbip download workflow (#644)
czarte 823f818
Master gh 580 b dbip download workflow (#647)
czarte 5ef9b22
Master gh 580 b dbip download workflow (#648)
czarte 5535b1e
Master gh 580 b dbip download workflow (#649)
czarte 7dd6307
final touch for dbip workflow
czarte 1f34ba3
Merge branch 'master' into GH-v2-580b-czarte
czarte 65be2e7
git pull before ci/all.sh
czarte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/bin/bash | ||
|
|
||
| # File to check (relative to repo root) | ||
| FILENAME="ip_country/src/dbip_country.rs" | ||
|
|
||
| if ! git diff --cached --name-only | grep -q "^$FILENAME$"; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| # find 'Nonexistents' country in dbip_country.rs | ||
| @cat "$FILENAME" | grep '("NOEX", "Nonexistent")' | ||
| NONEXISTENT=$? | ||
|
|
||
| # Get local file size (staged version, not working copy) | ||
| LOCAL_SIZE=$(git ls-files --stage | grep "$FILENAME" | awk '{print $2}' | xargs git cat-file -s) | ||
|
|
||
| if [[ $LOCAL_SIZE -gt 1000000 || NONEXISTENT -gt 0 ]]; then | ||
| if [[ $LOCAL_SIZE -gt 1000000 ]]; then | ||
| echo "❌ Commit blocked: $FILENAME size it not dev version, we want to keep dev version under 1 MB." | ||
| echo " Local file size: $LOCAL_SIZE bytes" | ||
| fi | ||
| if [[ $NONEXISTENT -gt 0 ]]; then | ||
| echo "❌ Commit blocked: Dev file must contain '(\"NOEX\", \"Nonexistents\")' country" | ||
| fi | ||
| echo "" | ||
| echo " ⚡ Please sync the file with the remote before committing using:" | ||
| echo " git checkout HEAD -- ip_country/src/dbip_country.rs" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # All good | ||
| exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: Download DBIP data and generate dbip_country.rs | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 0 3 * *" # Runs at midnight on the 3rd of every month | ||
|
|
||
| env: | ||
| TEMP_DIR: '/tmp' | ||
| YEAR_MONTH: '01-9999' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| generate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Rust | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: Download DBIP data in MMDB format | ||
| run: | | ||
| export YEAR_MONTH=$(date +%Y-%m) | ||
| echo "TEMP_DIR=$(mktemp -d)" >> $GITHUB_ENV | ||
| echo "YEAR_MONTH=$YEAR_MONTH" >> $GITHUB_ENV | ||
| cd ip_country | ||
| mkdir -p dbip-data | ||
| curl -L -o dbip-data/dbip-country-lite.mmdb.gz "https://download.db-ip.com/free/dbip-country-lite-$YEAR_MONTH.mmdb.gz" | ||
| gunzip dbip-data/dbip-country-lite.mmdb.gz | ||
|
|
||
| - name: Generate Rust source file | ||
| run: | | ||
| cd ip_country | ||
| cargo run < "dbip-data/dbip-country-lite.mmdb" > "$TEMP_DIR"/dbip_country.rs | ||
| ls "$TEMP_DIR" | ||
|
|
||
| - name: Commit and push generated file | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git fetch | ||
| BRANCH="$(git ls-remote --exit-code --heads origin generated-source 2>/dev/null || true)" | ||
| if [[ "$BRANCH" == "" ]] | ||
| then | ||
| git checkout -B generated-source | ||
| git rm -rf . | ||
| mkdir -p ip_country/src | ||
| else | ||
| git checkout generated-source | ||
| fi | ||
| DIFF="$(diff "${TEMP_DIR}"/dbip_country.rs ip_country/src/dbip_country.rs || true)" | ||
| if [[ "$DIFF" != "" || "$BRANCH" == "" ]] | ||
| then | ||
| mv "${TEMP_DIR}"/dbip_country.rs ip_country/src/dbip_country.rs | ||
| git add ip_country/src/dbip_country.rs | ||
| git commit -m "Update generated dbip_country ${YEAR_MONTH} Rust source file" || true | ||
| git push -u origin HEAD | ||
| fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.