-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #931 from gofiber/rueidis
Add support for rueidis storage driver
- Loading branch information
Showing
13 changed files
with
961 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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,50 @@ | ||
name-template: 'Rueidis - v$RESOLVED_VERSION' | ||
tag-template: 'rueidis/v$RESOLVED_VERSION' | ||
tag-prefix: rueidis/v | ||
include-paths: | ||
- rueidis | ||
categories: | ||
- title: '❗ Breaking Changes' | ||
labels: | ||
- '❗ BreakingChange' | ||
- title: '🚀 New' | ||
labels: | ||
- '✏️ Feature' | ||
- title: '🧹 Updates' | ||
labels: | ||
- '🧹 Updates' | ||
- '🤖 Dependencies' | ||
- title: '🐛 Fixes' | ||
labels: | ||
- '☢️ Bug' | ||
- title: '📚 Documentation' | ||
labels: | ||
- '📒 Documentation' | ||
change-template: '- $TITLE (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
exclude-contributors: | ||
- dependabot | ||
- dependabot[bot] | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
- '❗ BreakingChange' | ||
minor: | ||
labels: | ||
- 'minor' | ||
- '✏️ Feature' | ||
patch: | ||
labels: | ||
- 'patch' | ||
- '📒 Documentation' | ||
- '☢️ Bug' | ||
- '🤖 Dependencies' | ||
- '🧹 Updates' | ||
default: patch | ||
template: | | ||
$CHANGES | ||
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...rueidis/v$RESOLVED_VERSION | ||
Thank you $CONTRIBUTORS for making this update possible. |
This file contains 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,58 @@ | ||
#!/bin/bash | ||
|
||
# Generate some test certificates which are used by the regression test suite: | ||
# | ||
# ./tls/ca.{crt,key} Self signed CA certificate. | ||
# ./tls/redis.{crt,key} A certificate with no key usage/policy restrictions. | ||
# ./tls/client.{crt,key} A certificate restricted for SSL client usage. | ||
# ./tls/server.{crt,key} A certificate restricted for SSL server usage. | ||
|
||
generate_cert() { | ||
local name=$1 | ||
local cn="$2" | ||
local opts="$3" | ||
|
||
local keyfile=./tls/${name}.key | ||
local certfile=./tls/${name}.crt | ||
|
||
[ -f $keyfile ] || openssl genrsa -out $keyfile 2048 | ||
openssl req \ | ||
-new -sha256 \ | ||
-subj "/O=Redis Test/CN=$cn" \ | ||
-key $keyfile | \ | ||
openssl x509 \ | ||
-req -sha256 \ | ||
-CA ./tls/ca.crt \ | ||
-CAkey ./tls/ca.key \ | ||
-CAserial ./tls/ca.txt \ | ||
-CAcreateserial \ | ||
-days 365 \ | ||
$opts \ | ||
-out $certfile | ||
} | ||
|
||
mkdir -p ./tls | ||
[ -f ./tls/ca.key ] || openssl genrsa -out ./tls/ca.key 4096 | ||
openssl req \ | ||
-x509 -new -nodes -sha256 \ | ||
-key ./tls/ca.key \ | ||
-days 3650 \ | ||
-subj '/O=Redis Test/CN=Certificate Authority' \ | ||
-out ./tls/ca.crt | ||
|
||
cat > ./tls/openssl.cnf <<_END_ | ||
[ server_cert ] | ||
keyUsage = digitalSignature, keyEncipherment | ||
nsCertType = server | ||
[ client_cert ] | ||
keyUsage = digitalSignature, keyEncipherment | ||
nsCertType = client | ||
_END_ | ||
|
||
generate_cert server "Server-only" "-extfile ./tls/openssl.cnf -extensions server_cert" | ||
generate_cert client "Client-only" "-extfile ./tls/openssl.cnf -extensions client_cert" | ||
generate_cert redis "Generic-cert" | ||
|
||
# List generated certs | ||
ls -la ./tls | ||
echo "$PWD" |
This file contains 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 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,19 @@ | ||
name: Release Drafter Rueidis | ||
on: | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- 'rueidis/**' | ||
jobs: | ||
draft_release_rueidis: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: release-drafter-rueidis.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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,61 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- 'rueidis/**' | ||
pull_request: | ||
paths: | ||
- 'rueidis/**' | ||
name: "Tests Rueidis" | ||
jobs: | ||
Tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: | ||
- 1.20.x | ||
- 1.21.x | ||
redis: | ||
- '6.x' | ||
- '7.x' | ||
steps: | ||
- name: Fetch Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate TLS certs | ||
run: ./.github/scripts/gen-test-certs.sh | ||
|
||
- name: Setup Redis | ||
uses: shogo82148/actions-setup-redis@v1 | ||
with: | ||
redis-version: ${{ matrix.redis }} | ||
auto-start: 'false' | ||
redis-port: '6379' | ||
redis-tls-port: '6380' | ||
|
||
- name: Run Redis | ||
run: | | ||
redis-server --tls-port 6380 --port 6379 \ | ||
--tls-cert-file /home/runner/work/storage/storage/tls/redis.crt \ | ||
--tls-key-file /home/runner/work/storage/storage/tls/redis.key \ | ||
--tls-ca-cert-file /home/runner/work/storage/storage/tls/ca.crt & | ||
- name: Setup Redis Cluster | ||
uses: vishnudxb/redis-cluster@1.0.8 | ||
with: | ||
master1-port: 7000 | ||
master2-port: 7001 | ||
master3-port: 7002 | ||
slave1-port: 7003 | ||
slave2-port: 7004 | ||
slave3-port: 7005 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '${{ matrix.go-version }}' | ||
|
||
- name: Run Test | ||
run: cd ./rueidis && go test ./... -v -race |
This file contains 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.