-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Valkey target-lease backend with atomic fencing scripts #95
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
14 commits
Select commit
Hold shift + click to select a range
ccbbd02
Document lease protocol usage and next loop
lost-rob0t 0dc998a
Implement Valkey lease store backend with integration tests
lost-rob0t 76581d2
Address Valkey lease backend review findings
lost-rob0t a4fd56d
Address second-pass review: corrupt-state guards across all authority…
lost-rob0t 9fe1b69
Close list-leases corrupt-state gap, deserialization error translatio…
lost-rob0t 946412f
Fix cluster regression in list-leases and add corrupt-record regressi…
lost-rob0t e07981f
Fix atomic Valkey lease listing validation
lost-rob0t 1e8c02b
Load atomic Valkey list implementation
lost-rob0t 0bd7d16
Add Valkey list race and decode regressions
lost-rob0t cce5f34
Load Valkey review regression tests
lost-rob0t 06163db
Fail closed on corrupt Valkey list records
lost-rob0t 58aa8ab
Fix integration runner loopback resolution
lost-rob0t 54394e3
merge: refresh issue #31 Valkey backend onto canonical master
lost-rob0t 652b148
merge: carry canonical master policy into issue #31
lost-rob0t 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
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
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,41 @@ | ||
| #!/bin/sh | ||
| set -eu | ||
|
|
||
| password_file="${VALKEY_PASSWORD_FILE:-/run/secrets/valkey_password}" | ||
| if [ ! -r "$password_file" ]; then | ||
| echo "Valkey password file is not readable" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| password="$(cat "$password_file")" | ||
| if [ -z "$password" ]; then | ||
| echo "Valkey password file is empty" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| runtime_dir=/run/starintel-valkey | ||
| acl_file="$runtime_dir/users.acl" | ||
| mkdir -p "$runtime_dir" | ||
| password_hash="$(printf %s "$password" | sha256sum | cut -d ' ' -f 1)" | ||
| unset password | ||
| # Least-privilege service credential: deny everything by default, then grant | ||
| # only the commands the lease adapter invokes directly or from Lua scripts, and | ||
| # restrict keys to the StarIntel lease namespace owned by this deployment. | ||
| # Direct adapter commands: AUTH, PING, EVAL, SCAN, GET (list/inspect helpers). | ||
| # Lua script commands: GET, SET, DEL, INCR, PTTL, TIME. | ||
| # Administrative, dangerous, pub/sub, and unrelated-key access stays denied. | ||
| printf 'user default on #%s ~starintel:target-lease:v1:* -@all +auth +ping +eval +get +set +del +incr +pttl +time +scan\n' \ | ||
| "$password_hash" > "$acl_file" | ||
| unset password_hash | ||
| chown -R 65532:65532 "$runtime_dir" | ||
| chmod 0700 "$runtime_dir" | ||
| chmod 0600 "$acl_file" | ||
|
|
||
| exec setpriv --reuid=65532 --regid=65532 --clear-groups valkey-server \ | ||
| --bind 0.0.0.0 \ | ||
| --protected-mode yes \ | ||
| --aclfile "$acl_file" \ | ||
| --appendonly yes \ | ||
| --appendfsync everysec \ | ||
| --dir /data \ | ||
| "$@" | ||
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
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.