mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 20:47:22 +00:00
fix: compatibility for cockroach v22.1 (#3754)
* fix: compatability for cockroach v22.1 * update cr version in docs and compose * bind dev cockroach to 127.0.0.1 * Revert "bind dev cockroach to 127.0.0.1" This reverts commit 1c7c6304ae6682801f8475a8eac91569442b6b8d. * remove --listen-addr flag * use v2.0.0-v2-alpha.16 * use v2.0.0-v2-alpha.17 Co-authored-by: Elio Bischof <eliobischof@gmail.com>
This commit is contained in:
parent
66b6ef7f04
commit
32afa77b97
@ -89,9 +89,9 @@ RUN apt install openssl tzdata tar
|
|||||||
|
|
||||||
# cockroach binary used to backup database
|
# cockroach binary used to backup database
|
||||||
RUN mkdir /usr/local/lib/cockroach
|
RUN mkdir /usr/local/lib/cockroach
|
||||||
RUN wget -qO- https://binaries.cockroachdb.com/cockroach-v21.2.9.linux-amd64.tgz \
|
RUN wget -qO- https://binaries.cockroachdb.com/cockroach-v22.1.0.linux-amd64.tgz \
|
||||||
| tar xvz && cp -i cockroach-v21.2.9.linux-amd64/cockroach /usr/local/bin/
|
| tar xvz && cp -i cockroach-v22.1.0.linux-amd64/cockroach /usr/local/bin/
|
||||||
RUN rm -r cockroach-v21.2.9.linux-amd64
|
RUN rm -r cockroach-v22.1.0.linux-amd64
|
||||||
|
|
||||||
# Migrations for cockroach-secure
|
# Migrations for cockroach-secure
|
||||||
RUN go install github.com/rakyll/statik \
|
RUN go install github.com/rakyll/statik \
|
||||||
|
@ -1 +1,2 @@
|
|||||||
CREATE USER $1 WITH PASSWORD $2
|
-- replace %[1]s with the name of the user
|
||||||
|
CREATE USER %[1]s WITH PASSWORD $1
|
||||||
|
@ -3,6 +3,7 @@ package initialise
|
|||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
@ -43,7 +44,7 @@ func VerifyUser(username, password string) func(*sql.DB) error {
|
|||||||
logging.WithFields("username", username).Info("verify user")
|
logging.WithFields("username", username).Info("verify user")
|
||||||
return verify(db,
|
return verify(db,
|
||||||
exists(searchUser, username),
|
exists(searchUser, username),
|
||||||
exec(createUserStmt, username, &sql.NullString{String: password, Valid: password != ""}),
|
exec(fmt.Sprintf(createUserStmt, username), &sql.NullString{String: password, Valid: password != ""}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ func Test_verifyUser(t *testing.T) {
|
|||||||
args: args{
|
args: args{
|
||||||
db: prepareDB(t,
|
db: prepareDB(t,
|
||||||
expectExists("SELECT EXISTS(SELECT username FROM [show roles] WHERE username = $1)", false, "zitadel-user"),
|
expectExists("SELECT EXISTS(SELECT username FROM [show roles] WHERE username = $1)", false, "zitadel-user"),
|
||||||
expectExec("CREATE USER $1 WITH PASSWORD $2", sql.ErrTxDone, "zitadel-user", nil),
|
expectExec("CREATE USER zitadel-user WITH PASSWORD $1", sql.ErrTxDone, nil),
|
||||||
),
|
),
|
||||||
username: "zitadel-user",
|
username: "zitadel-user",
|
||||||
password: "",
|
password: "",
|
||||||
@ -43,7 +43,7 @@ func Test_verifyUser(t *testing.T) {
|
|||||||
args: args{
|
args: args{
|
||||||
db: prepareDB(t,
|
db: prepareDB(t,
|
||||||
expectExists("SELECT EXISTS(SELECT username FROM [show roles] WHERE username = $1)", false, "zitadel-user"),
|
expectExists("SELECT EXISTS(SELECT username FROM [show roles] WHERE username = $1)", false, "zitadel-user"),
|
||||||
expectExec("CREATE USER $1 WITH PASSWORD $2", nil, "zitadel-user", nil),
|
expectExec("CREATE USER zitadel-user WITH PASSWORD $1", nil, nil),
|
||||||
),
|
),
|
||||||
username: "zitadel-user",
|
username: "zitadel-user",
|
||||||
password: "",
|
password: "",
|
||||||
@ -55,7 +55,7 @@ func Test_verifyUser(t *testing.T) {
|
|||||||
args: args{
|
args: args{
|
||||||
db: prepareDB(t,
|
db: prepareDB(t,
|
||||||
expectExists("SELECT EXISTS(SELECT username FROM [show roles] WHERE username = $1)", false, "zitadel-user"),
|
expectExists("SELECT EXISTS(SELECT username FROM [show roles] WHERE username = $1)", false, "zitadel-user"),
|
||||||
expectExec("CREATE USER $1 WITH PASSWORD $2", nil, "zitadel-user", "password"),
|
expectExec("CREATE USER zitadel-user WITH PASSWORD $1", nil, "password"),
|
||||||
),
|
),
|
||||||
username: "zitadel-user",
|
username: "zitadel-user",
|
||||||
password: "password",
|
password: "password",
|
||||||
|
@ -5,7 +5,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- zitadel
|
- zitadel
|
||||||
image: ghcr.io/zitadel/zitadel:v2.0.0-v2-alpha.3-amd64
|
image: ghcr.io/zitadel/zitadel:v2.0.0-v2-alpha.17-amd64
|
||||||
command: admin start-from-init --masterkey "MasterkeyNeedsToHave32Characters"
|
command: admin start-from-init --masterkey "MasterkeyNeedsToHave32Characters"
|
||||||
environment:
|
environment:
|
||||||
- ZITADEL_DATABASE_HOST=db
|
- ZITADEL_DATABASE_HOST=db
|
||||||
@ -27,8 +27,8 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- zitadel
|
- zitadel
|
||||||
image: cockroachdb/cockroach:v21.2.5
|
image: cockroachdb/cockroach:v22.1.0
|
||||||
command: start-single-node --insecure --listen-addr=0.0.0.0
|
command: start-single-node --insecure
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## Download The CockroachDB binary
|
## Download The CockroachDB binary
|
||||||
|
|
||||||
Download a `cockroach` binary as described [here](https://www.cockroachlabs.com/docs/v21.2/install-cockroachdb).
|
Download a `cockroach` binary as described [here](https://www.cockroachlabs.com/docs/v22.1/install-cockroachdb).
|
||||||
ZITADEL is tested against CockroachDB v21.2.8.
|
ZITADEL is tested against CockroachDB v22.1.0.
|
||||||
|
|
||||||
## Run CockroachDB and ZITADEL
|
## Run CockroachDB and ZITADEL
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ export ZITADEL_DEFAULTINSTANCE_CUSTOMDOMAIN=localhost
|
|||||||
Download the zitadel binary
|
Download the zitadel binary
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -s https://api.github.com/repos/zitadel/zitadel/releases/tags/v2.0.0-v2-alpha.6 | grep "browser_download_url.*zitadel_.*_linux_$(dpkg --print-architecture)" | cut -d '"' -f 4 | sudo wget -i - -O /usr/local/bin/zitadel && sudo chmod +x /usr/local/bin/zitadel && sudo chown $(id -u):$(id -g) /usr/local/bin/zitadel
|
curl -s https://api.github.com/repos/zitadel/zitadel/releases/tags/v2.0.0-v2-alpha.17 | grep "browser_download_url.*zitadel_.*_linux_$(dpkg --print-architecture)" | cut -d '"' -f 4 | sudo wget -i - -O /usr/local/bin/zitadel && sudo chmod +x /usr/local/bin/zitadel && sudo chown $(id -u):$(id -g) /usr/local/bin/zitadel
|
||||||
```
|
```
|
||||||
|
|
||||||
Run the database and application containers
|
Run the database and application containers
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
## Download The CockroachDB binary
|
## Download The CockroachDB binary
|
||||||
|
|
||||||
Download a `cockroach` binary as described [here](https://www.cockroachlabs.com/docs/v21.2/install-cockroachdb).
|
Download a `cockroach` binary as described [here](https://www.cockroachlabs.com/docs/v22.1/install-cockroachdb).
|
||||||
ZITADEL is tested against CockroachDB v21.2.8.
|
ZITADEL is tested against CockroachDB v22.1.0.
|
||||||
|
|
||||||
## Run CockroachDB and ZITADEL
|
## Run CockroachDB and ZITADEL
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ brew install zitadel/tap/zitadel
|
|||||||
... or download the binary from GitHub
|
... or download the binary from GitHub
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -s https://api.github.com/repos/zitadel/zitadel/releases/tags/v2.0.0-v2-alpha.6 | grep "browser_download_url.*zitadel_.*_darwin_${MY_ARCHITECTURE}" | cut -d '"' -f 4 | sudo wget -i - -O /usr/local/bin/zitadel && sudo chmod +x /usr/local/bin/zitadel && sudo chown $(id -u):$(id -g) /usr/local/bin/zitadel
|
curl -s https://api.github.com/repos/zitadel/zitadel/releases/tags/v2.0.0-v2-alpha.17 | grep "browser_download_url.*zitadel_.*_darwin_${MY_ARCHITECTURE}" | cut -d '"' -f 4 | sudo wget -i - -O /usr/local/bin/zitadel && sudo chmod +x /usr/local/bin/zitadel && sudo chown $(id -u):$(id -g) /usr/local/bin/zitadel
|
||||||
```
|
```
|
||||||
|
|
||||||
Run ZITADEL
|
Run ZITADEL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user