From 15ab461a5e02f75ec5f765a751186e0bb996c45d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Apr 2023 15:14:42 +0300 Subject: [PATCH 001/340] psql first commit --- .idea/.gitignore | 8 +++ .idea/mobility-accounts.iml | 4 ++ .idea/vcs.xml | 6 ++ Dockerfile | 0 LICENCE.md | 0 README.md | 0 config.go | 0 examples/grpcclient/README.md | 0 examples/grpcclient/go.mod | 0 examples/grpcclient/go.sum | 0 .../json/account_with_local_auth.json | 0 examples/grpcclient/main.go | 0 go.mod | 1 + go.sum | 4 ++ grpcapi/README.md | 0 grpcapi/accounts.go | 0 grpcapi/accounts.pb.go | 0 grpcapi/accounts.proto | 0 grpcapi/comasvc.pb.go | 0 grpcapi/comasvc.proto | 0 grpcapi/comasvc_grpc.pb.go | 0 grpcapi/grpcapi.go | 0 handlers/accounts.go | 0 handlers/handlers.go | 0 main.go | 0 oidc-provider/endpoints_auth.go | 0 oidc-provider/endpoints_introspection.go | 0 oidc-provider/endpoints_token.go | 0 oidc-provider/endpoints_userinfo.go | 0 oidc-provider/endpoints_wellknown.go | 0 oidc-provider/fosite.go | 0 oidc-provider/oidc-provider.go | 0 oidc-provider/server.go | 0 oidc-provider/templates/default/auth.html | 0 oidc-provider/templates/parcoursmob/auth.html | 0 schemas/CMS/civil-status.schema.json | 0 schemas/CMS/driving-licence.schema.json | 0 schemas/CMS/favorites.schema.json | 0 schemas/CMS/fr-caf-information.schema.json | 0 schemas/CMS/fr-dgfip-information.schema.json | 0 schemas/CMS/fr-mesri-information.schema.json | 0 .../in-case-of-emergency-contacts.schema.json | 0 schemas/CMS/personal-information.schema.json | 0 storage/accounts.go | 0 storage/etcd.go | 0 storage/mongodb.go | 0 storage/postgresql.go | 63 +++++++++++++++++++ storage/postgresql_test.go | 21 +++++++ storage/storage.go | 3 + 49 files changed, 110 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/mobility-accounts.iml create mode 100644 .idea/vcs.xml mode change 100644 => 100755 Dockerfile mode change 100644 => 100755 LICENCE.md mode change 100644 => 100755 README.md mode change 100644 => 100755 config.go mode change 100644 => 100755 examples/grpcclient/README.md mode change 100644 => 100755 examples/grpcclient/go.mod mode change 100644 => 100755 examples/grpcclient/go.sum mode change 100644 => 100755 examples/grpcclient/json/account_with_local_auth.json mode change 100644 => 100755 examples/grpcclient/main.go mode change 100644 => 100755 go.mod mode change 100644 => 100755 go.sum mode change 100644 => 100755 grpcapi/README.md mode change 100644 => 100755 grpcapi/accounts.go mode change 100644 => 100755 grpcapi/accounts.pb.go mode change 100644 => 100755 grpcapi/accounts.proto mode change 100644 => 100755 grpcapi/comasvc.pb.go mode change 100644 => 100755 grpcapi/comasvc.proto mode change 100644 => 100755 grpcapi/comasvc_grpc.pb.go mode change 100644 => 100755 grpcapi/grpcapi.go mode change 100644 => 100755 handlers/accounts.go mode change 100644 => 100755 handlers/handlers.go mode change 100644 => 100755 main.go mode change 100644 => 100755 oidc-provider/endpoints_auth.go mode change 100644 => 100755 oidc-provider/endpoints_introspection.go mode change 100644 => 100755 oidc-provider/endpoints_token.go mode change 100644 => 100755 oidc-provider/endpoints_userinfo.go mode change 100644 => 100755 oidc-provider/endpoints_wellknown.go mode change 100644 => 100755 oidc-provider/fosite.go mode change 100644 => 100755 oidc-provider/oidc-provider.go mode change 100644 => 100755 oidc-provider/server.go mode change 100644 => 100755 oidc-provider/templates/default/auth.html mode change 100644 => 100755 oidc-provider/templates/parcoursmob/auth.html mode change 100644 => 100755 schemas/CMS/civil-status.schema.json mode change 100644 => 100755 schemas/CMS/driving-licence.schema.json mode change 100644 => 100755 schemas/CMS/favorites.schema.json mode change 100644 => 100755 schemas/CMS/fr-caf-information.schema.json mode change 100644 => 100755 schemas/CMS/fr-dgfip-information.schema.json mode change 100644 => 100755 schemas/CMS/fr-mesri-information.schema.json mode change 100644 => 100755 schemas/CMS/in-case-of-emergency-contacts.schema.json mode change 100644 => 100755 schemas/CMS/personal-information.schema.json mode change 100644 => 100755 storage/accounts.go mode change 100644 => 100755 storage/etcd.go mode change 100644 => 100755 storage/mongodb.go create mode 100644 storage/postgresql.go create mode 100644 storage/postgresql_test.go mode change 100644 => 100755 storage/storage.go diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/mobility-accounts.iml b/.idea/mobility-accounts.iml new file mode 100644 index 0000000..7ee078d --- /dev/null +++ b/.idea/mobility-accounts.iml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile old mode 100644 new mode 100755 diff --git a/LICENCE.md b/LICENCE.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/config.go b/config.go old mode 100644 new mode 100755 diff --git a/examples/grpcclient/README.md b/examples/grpcclient/README.md old mode 100644 new mode 100755 diff --git a/examples/grpcclient/go.mod b/examples/grpcclient/go.mod old mode 100644 new mode 100755 diff --git a/examples/grpcclient/go.sum b/examples/grpcclient/go.sum old mode 100644 new mode 100755 diff --git a/examples/grpcclient/json/account_with_local_auth.json b/examples/grpcclient/json/account_with_local_auth.json old mode 100644 new mode 100755 diff --git a/examples/grpcclient/main.go b/examples/grpcclient/main.go old mode 100644 new mode 100755 diff --git a/go.mod b/go.mod old mode 100644 new mode 100755 index cb76cc7..7ecaf26 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/google/uuid v1.3.0 github.com/gorilla/csrf v1.7.1 github.com/gorilla/mux v1.8.0 + github.com/lib/pq v1.3.0 github.com/mitchellh/mapstructure v1.5.0 github.com/ory/fosite v0.42.2 github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 diff --git a/go.sum b/go.sum old mode 100644 new mode 100755 index f5d754d..34603d7 --- a/go.sum +++ b/go.sum @@ -707,6 +707,7 @@ github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTRe github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/luna-duclos/instrumentedsql v0.0.0-20181127104832-b7d587d28109/go.mod h1:PWUIzhtavmOR965zfawVsHXbEuU1G29BPZ/CB3C7jXk= github.com/luna-duclos/instrumentedsql v1.1.2/go.mod h1:4LGbEqDnopzNAiyxPPDXhLspyunZxgPTMJBKtC6U0BQ= @@ -790,6 +791,9 @@ github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= +github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= +github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= diff --git a/grpcapi/README.md b/grpcapi/README.md old mode 100644 new mode 100755 diff --git a/grpcapi/accounts.go b/grpcapi/accounts.go old mode 100644 new mode 100755 diff --git a/grpcapi/accounts.pb.go b/grpcapi/accounts.pb.go old mode 100644 new mode 100755 diff --git a/grpcapi/accounts.proto b/grpcapi/accounts.proto old mode 100644 new mode 100755 diff --git a/grpcapi/comasvc.pb.go b/grpcapi/comasvc.pb.go old mode 100644 new mode 100755 diff --git a/grpcapi/comasvc.proto b/grpcapi/comasvc.proto old mode 100644 new mode 100755 diff --git a/grpcapi/comasvc_grpc.pb.go b/grpcapi/comasvc_grpc.pb.go old mode 100644 new mode 100755 diff --git a/grpcapi/grpcapi.go b/grpcapi/grpcapi.go old mode 100644 new mode 100755 diff --git a/handlers/accounts.go b/handlers/accounts.go old mode 100644 new mode 100755 diff --git a/handlers/handlers.go b/handlers/handlers.go old mode 100644 new mode 100755 diff --git a/main.go b/main.go old mode 100644 new mode 100755 diff --git a/oidc-provider/endpoints_auth.go b/oidc-provider/endpoints_auth.go old mode 100644 new mode 100755 diff --git a/oidc-provider/endpoints_introspection.go b/oidc-provider/endpoints_introspection.go old mode 100644 new mode 100755 diff --git a/oidc-provider/endpoints_token.go b/oidc-provider/endpoints_token.go old mode 100644 new mode 100755 diff --git a/oidc-provider/endpoints_userinfo.go b/oidc-provider/endpoints_userinfo.go old mode 100644 new mode 100755 diff --git a/oidc-provider/endpoints_wellknown.go b/oidc-provider/endpoints_wellknown.go old mode 100644 new mode 100755 diff --git a/oidc-provider/fosite.go b/oidc-provider/fosite.go old mode 100644 new mode 100755 diff --git a/oidc-provider/oidc-provider.go b/oidc-provider/oidc-provider.go old mode 100644 new mode 100755 diff --git a/oidc-provider/server.go b/oidc-provider/server.go old mode 100644 new mode 100755 diff --git a/oidc-provider/templates/default/auth.html b/oidc-provider/templates/default/auth.html old mode 100644 new mode 100755 diff --git a/oidc-provider/templates/parcoursmob/auth.html b/oidc-provider/templates/parcoursmob/auth.html old mode 100644 new mode 100755 diff --git a/schemas/CMS/civil-status.schema.json b/schemas/CMS/civil-status.schema.json old mode 100644 new mode 100755 diff --git a/schemas/CMS/driving-licence.schema.json b/schemas/CMS/driving-licence.schema.json old mode 100644 new mode 100755 diff --git a/schemas/CMS/favorites.schema.json b/schemas/CMS/favorites.schema.json old mode 100644 new mode 100755 diff --git a/schemas/CMS/fr-caf-information.schema.json b/schemas/CMS/fr-caf-information.schema.json old mode 100644 new mode 100755 diff --git a/schemas/CMS/fr-dgfip-information.schema.json b/schemas/CMS/fr-dgfip-information.schema.json old mode 100644 new mode 100755 diff --git a/schemas/CMS/fr-mesri-information.schema.json b/schemas/CMS/fr-mesri-information.schema.json old mode 100644 new mode 100755 diff --git a/schemas/CMS/in-case-of-emergency-contacts.schema.json b/schemas/CMS/in-case-of-emergency-contacts.schema.json old mode 100644 new mode 100755 diff --git a/schemas/CMS/personal-information.schema.json b/schemas/CMS/personal-information.schema.json old mode 100644 new mode 100755 diff --git a/storage/accounts.go b/storage/accounts.go old mode 100644 new mode 100755 diff --git a/storage/etcd.go b/storage/etcd.go old mode 100644 new mode 100755 diff --git a/storage/mongodb.go b/storage/mongodb.go old mode 100644 new mode 100755 diff --git a/storage/postgresql.go b/storage/postgresql.go new file mode 100644 index 0000000..d926830 --- /dev/null +++ b/storage/postgresql.go @@ -0,0 +1,63 @@ +package storage + +import ( + "database/sql" + "fmt" + _ "github.com/lib/pq" + "github.com/spf13/viper" + "strconv" +) + +type PostgresqlStorage struct { + DbConnection *sql.DB +} + +func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { + var ( + host = cfg.GetString("storage.db.psql.host") + port = cfg.GetString("storage.db.psql.port") + user = cfg.GetString("storage.db.psql.user") + password = cfg.GetString("storage.db.psql.password") + dbname = cfg.GetString("storage.db.psql.dbname") + ) + portInt, _ := strconv.Atoi(port) + psqlconn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", host, portInt, + user, password, dbname) + db, err := sql.Open("postgres", psqlconn) + if err != nil { + fmt.Println("error", err) + return PostgresqlStorage{}, fmt.Errorf("connection to postgresql failed") + } + defer db.Close() + err = db.Ping() + if err != nil { + return PostgresqlStorage{}, fmt.Errorf("connection to postgresql database failed") + } + return PostgresqlStorage{ + DbConnection: db, + }, nil +} + +func (PostgresqlStorage) GetAccount(id string) (*Account, error) { + return nil, fmt.Errorf("") +} + +func (PostgresqlStorage) LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error) { + return nil, fmt.Errorf("") +} + +func (PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error) { + return nil, fmt.Errorf("") +} + +func (PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, error) { + return nil, fmt.Errorf("") +} + +func (PostgresqlStorage) CreateAccount(account Account) error { + return fmt.Errorf("") +} + +func (PostgresqlStorage) UpdateAccount(account Account) error { + return fmt.Errorf("") +} diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go new file mode 100644 index 0000000..52a0106 --- /dev/null +++ b/storage/postgresql_test.go @@ -0,0 +1,21 @@ +package storage + +import ( + "github.com/spf13/viper" + "testing" +) + +func TestNewPostgresqlStorage(t *testing.T) { + cfg := viper.New() + cfg.Set("storage.db.psql.host", "localhost") + cfg.Set("storage.db.psql.port", "5432") + cfg.Set("storage.db.psql.user", "postgres") + cfg.Set("storage.db.psql.password", "postgres") + cfg.Set("storage.db.psql.dbname", "mobilityaccounts") + + storage, err := NewPostgresqlStorage(cfg) + if err != nil { + t.Errorf("error creating new PostgreSQL storage: %v", err) + } + defer storage.DbConnection.Close() +} diff --git a/storage/storage.go b/storage/storage.go old mode 100644 new mode 100755 index f42331d..297221f --- a/storage/storage.go +++ b/storage/storage.go @@ -46,6 +46,9 @@ func NewDBStorage(cfg *viper.Viper) (DBStorage, error) { case "mongodb": s, err := NewMongoDBStorage(cfg) return s, err + case "psql": + s, err := NewPostgresqlStorage(cfg) + return s, err default: return nil, fmt.Errorf("storage type %v is not supported", storage_type) } From c4fdbbe485037e3164d98f88bcda020ae770469e Mon Sep 17 00:00:00 2001 From: sbouaram Date: Tue, 25 Apr 2023 10:23:19 -0400 Subject: [PATCH 002/340] getaccount --- storage/postgresql.go | 52 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index d926830..72e5b46 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -2,9 +2,11 @@ package storage import ( "database/sql" + "encoding/json" "fmt" _ "github.com/lib/pq" "github.com/spf13/viper" + "regexp" "strconv" ) @@ -38,8 +40,49 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { }, nil } -func (PostgresqlStorage) GetAccount(id string) (*Account, error) { - return nil, fmt.Errorf("") +func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { + var ( + data, metadata, emailValidation []byte + ) + account := &Account{} + if isUUIDv4(id) { + stmtAccounts, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata FROM accounts WHERE id = $1") + if err != nil { + return account, fmt.Errorf("psql connection failed") + } + defer stmtAccounts.Close() + err = stmtAccounts.QueryRow(id).Scan(&account.ID, &account.Namespace, &data, &metadata) + if err != nil { + return account, fmt.Errorf("psql select account query failed") + } + err = json.Unmarshal(data, &account.Data) + if err != nil { + return account, err + } + err = json.Unmarshal(metadata, &account.Metadata) + if err != nil { + return account, err + } + stmtAccount_auth, err := psql.DbConnection.Prepare("SELECT local_username,local_password, local_email, local_email_validation, local_phone_number, local_phone_number_validation FROM account_auth WHERE account_id= $1") + if err != nil { + return account, fmt.Errorf("psql connection failed") + } + defer stmtAccount_auth.Close() + err = stmtAccount_auth.QueryRow(id).Scan(&account.Authentication.Local.Username, + &account.Authentication.Local.Password, + &account.Authentication.Local.Email, + &emailValidation, + &account.Authentication.Local.PhoneNumber, + &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return account, fmt.Errorf("psql select account auth query failed") + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return account, err + } + } + return account, nil } func (PostgresqlStorage) LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error) { @@ -61,3 +104,8 @@ func (PostgresqlStorage) CreateAccount(account Account) error { func (PostgresqlStorage) UpdateAccount(account Account) error { return fmt.Errorf("") } + +func isUUIDv4(str string) bool { + pattern := regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$`) + return pattern.MatchString(str) +} From 95262a685c3fb2bd82d4fb4c818e53fd5b6e8505 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Tue, 25 Apr 2023 17:42:33 +0200 Subject: [PATCH 003/340] psql connection --- go.mod | 1 + go.sum | 1 + storage/postgresql.go | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 7ecaf26..b82c046 100755 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module git.coopgo.io/coopgo-platform/mobility-accounts go 1.18 require ( + github.com/DATA-DOG/go-sqlmock v1.3.3 github.com/google/uuid v1.3.0 github.com/gorilla/csrf v1.7.1 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index 34603d7..b30ae67 100755 --- a/go.sum +++ b/go.sum @@ -41,6 +41,7 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v4.0.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= diff --git a/storage/postgresql.go b/storage/postgresql.go index 72e5b46..380a7b9 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -30,7 +30,6 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { fmt.Println("error", err) return PostgresqlStorage{}, fmt.Errorf("connection to postgresql failed") } - defer db.Close() err = db.Ping() if err != nil { return PostgresqlStorage{}, fmt.Errorf("connection to postgresql database failed") From d1e71e32f95f5399c56cd8f72634edb811bf815b Mon Sep 17 00:00:00 2001 From: sbouaram Date: Tue, 25 Apr 2023 20:07:26 +0200 Subject: [PATCH 004/340] testing PSQL GetAccount --- go.mod | 64 ++++++++++--------- go.sum | 125 ++++++++++++++++++++++++++++++++++++- storage/postgresql.go | 10 ++- storage/postgresql_test.go | 97 ++++++++++++++++++++++++++++ 4 files changed, 264 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index b82c046..468d1d8 100755 --- a/go.mod +++ b/go.mod @@ -3,20 +3,19 @@ module git.coopgo.io/coopgo-platform/mobility-accounts go 1.18 require ( - github.com/DATA-DOG/go-sqlmock v1.3.3 github.com/google/uuid v1.3.0 github.com/gorilla/csrf v1.7.1 github.com/gorilla/mux v1.8.0 - github.com/lib/pq v1.3.0 + github.com/lib/pq v1.10.2 github.com/mitchellh/mapstructure v1.5.0 github.com/ory/fosite v0.42.2 github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 - github.com/spf13/viper v1.12.0 - go.etcd.io/etcd/client/v3 v3.5.4 - go.mongodb.org/mongo-driver v1.9.1 - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 - google.golang.org/grpc v1.48.0 - google.golang.org/protobuf v1.28.0 + github.com/spf13/viper v1.15.0 + go.etcd.io/etcd/client/v3 v3.5.6 + go.mongodb.org/mongo-driver v1.11.4 + golang.org/x/crypto v0.6.0 + google.golang.org/grpc v1.52.0 + google.golang.org/protobuf v1.28.1 gopkg.in/square/go-jose.v2 v2.5.2-0.20210529014059-a5c7eec3c614 ) @@ -26,7 +25,7 @@ require ( github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/dgraph-io/ristretto v0.0.3 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -35,42 +34,51 @@ require ( github.com/gorilla/websocket v1.4.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.14.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.3.2 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgtype v1.14.0 // indirect + github.com/jackc/pgx/v4 v4.18.1 // indirect github.com/klauspost/compress v1.13.6 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/goveralls v0.0.6 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/ory/go-acc v0.2.6 // indirect github.com/ory/go-convenience v0.1.0 // indirect github.com/ory/viper v1.7.5 // indirect github.com/ory/x v0.0.214 // indirect github.com/pborman/uuid v1.2.0 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/spf13/afero v1.8.2 // indirect + github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/cobra v1.0.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.3.0 // indirect + github.com/subosito/gotenv v1.4.2 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect - github.com/xdg-go/scram v1.0.2 // indirect - github.com/xdg-go/stringprep v1.0.2 // indirect + github.com/xdg-go/scram v1.1.1 // indirect + github.com/xdg-go/stringprep v1.0.3 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect - go.etcd.io/etcd/api/v3 v3.5.4 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.17.0 // indirect - golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect - golang.org/x/text v0.3.7 // indirect - golang.org/x/tools v0.1.2 // indirect - google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect - gopkg.in/ini.v1 v1.66.4 // indirect + go.etcd.io/etcd/api/v3 v3.5.6 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.6 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.8.0 // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/net v0.6.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect + golang.org/x/tools v0.1.12 // indirect + google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) //replace github.com/ory/fosite => ../../../github.com/ory/fosite diff --git a/go.sum b/go.sum index b30ae67..f290c5a 100755 --- a/go.sum +++ b/go.sum @@ -41,11 +41,11 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.3.3 h1:CWUqKXe0s8A2z6qCgkP4Kru7wC11YoAnoupUKFDnH08= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v4.0.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= @@ -73,6 +73,7 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0 github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -94,6 +95,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -155,6 +157,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -168,6 +171,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -492,6 +497,7 @@ github.com/gobuffalo/x v0.0.0-20181007152206-913e47c59ca7/go.mod h1:9rDPXaB3kXdK github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid/v3 v3.1.2/go.mod h1:xPwMqoocQ1L5G6pXX5BcE7N5jlzn2o19oqAKxwZW/kI= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -551,6 +557,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -613,8 +620,10 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1: github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inhies/go-bytesize v0.0.0-20201103132853-d0aed0d254f8/go.mod h1:KrtyD5PFj++GKkFS/7/RRrfnRhAMGQwy75GLCHWrCNs= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= @@ -623,9 +632,19 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU github.com/jackc/pgconn v1.3.2/go.mod h1:LvCquS3HbBKwgl7KbX9KyqEIumJAbm1UMcTvGaIf3bM= github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.6.0/go.mod h1:yeseQo4xhQbgyJs2c87RAXOH2i624N0Fh1KSPJya7qo= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q= +github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= @@ -633,22 +652,38 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= +github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= +github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= github.com/jackc/pgtype v1.3.0/go.mod h1:b0JqxHvPmljG+HQ5IsvQ0yqeSi4nGcDTVjFoiLDb0Ik= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= +github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= +github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.4.1/go.mod h1:6iSW+JznC0YT+SgBn7rNxoEBsBgSmnC5FwyCekOGUiE= github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oAlxAg= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= +github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -710,6 +745,8 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/luna-duclos/instrumentedsql v0.0.0-20181127104832-b7d587d28109/go.mod h1:PWUIzhtavmOR965zfawVsHXbEuU1G29BPZ/CB3C7jXk= github.com/luna-duclos/instrumentedsql v1.1.2/go.mod h1:4LGbEqDnopzNAiyxPPDXhLspyunZxgPTMJBKtC6U0BQ= github.com/luna-duclos/instrumentedsql v1.1.3/go.mod h1:9J1njvFds+zN7y85EDhN9XNQLANWwZt2ULeIC8yMNYs= @@ -718,6 +755,8 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -783,6 +822,7 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/monoculum/formam v0.0.0-20180901015400-4e68be1d79ba/go.mod h1:RKgILGEJq24YyJ2ban8EO0RUVSJlF1pGsEvoLEACr/Q= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/moul/http2curl v0.0.0-20170919181001-9ac6cf4d929b/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= @@ -860,6 +900,8 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -932,6 +974,7 @@ github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLS github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= @@ -964,6 +1007,8 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/afero v1.3.2/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= +github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -991,12 +1036,16 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= +github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A= github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693/go.mod h1:6hSY48PjDm4UObWmGLyJE9DxYVKTgR9kbCspXXJEhcU= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1005,10 +1054,15 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.1.1/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= +github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= +github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= github.com/tidwall/gjson v1.6.8/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/gjson v1.7.1/go.mod h1:5/xDoumyyDNerp2U36lyolv46b3uF/9Bu6OfyQ9GImk= @@ -1036,8 +1090,12 @@ github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E= +github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= +github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs= +github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -1051,6 +1109,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.elastic.co/apm v1.8.0/go.mod h1:tCw6CkOJgkWnzEthFN9HUP1uL3Gjc/Ur6m7gRPLaoH0= @@ -1060,16 +1119,24 @@ go.elastic.co/fastjson v1.0.0/go.mod h1:PmeUOMMtLHQr9ZS9J9owrAVg0FkaZDRZJEFTTGHt go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= +go.etcd.io/etcd/api/v3 v3.5.6 h1:Cy2qx3npLcYqTKqGJzMypnMv2tiRyifZJ17BlWIWA7A= +go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.6 h1:TXQWYceBKqLp4sa87rcPs11SXxUA/mHwH975v+BDvLU= +go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= +go.etcd.io/etcd/client/v3 v3.5.6 h1:coLs69PWCXE9G4FKquzNaSHrRyMCAXwF+IX1tAPVO8E= +go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.9.1 h1:m078y9v7sBItkt1aaoe2YlvWEXcD263e1a4E1fBrJ1c= go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= +go.mongodb.org/mongo-driver v1.11.4 h1:4ayjakA013OdpGyL2K3ZqylTac/rMjrJOMZ1EHizXas= +go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= @@ -1086,16 +1153,29 @@ go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXS go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180830192347-182538f80094/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1135,9 +1215,15 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1179,6 +1265,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180816102801-aaf60122140d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1232,8 +1320,12 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1245,6 +1337,7 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1258,6 +1351,10 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180831094639-fa5fdf94c789/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1336,6 +1433,7 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1343,8 +1441,14 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1352,8 +1456,11 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1413,6 +1520,7 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1421,6 +1529,7 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191224055732-dd894d0a8a40/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1455,6 +1564,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1462,6 +1573,7 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -1539,6 +1651,8 @@ google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef h1:uQ2vjV/sHTsWSqdKeLqmwitzgvjMl7o4IdtHwUDXSJY= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1562,9 +1676,12 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc/examples v0.0.0-20210304020650-930c79186c99/go.mod h1:Ly7ZA/ARzg8fnPU9TyZIxoz33sEUuWX7txiqs8lPTgE= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1581,6 +1698,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/DataDog/dd-trace-go.v1 v1.27.0/go.mod h1:Sp1lku8WJMvNV0kjDI4Ni/T7J/U3BO5ct5kEaoVU8+I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -1603,6 +1722,8 @@ gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.1.9/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1628,6 +1749,8 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/storage/postgresql.go b/storage/postgresql.go index 380a7b9..98a3ad9 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -41,7 +41,7 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { var ( - data, metadata, emailValidation []byte + data, metadata, emailValidation, phoneValidation []byte ) account := &Account{} if isUUIDv4(id) { @@ -62,7 +62,7 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { if err != nil { return account, err } - stmtAccount_auth, err := psql.DbConnection.Prepare("SELECT local_username,local_password, local_email, local_email_validation, local_phone_number, local_phone_number_validation FROM account_auth WHERE account_id= $1") + stmtAccount_auth, err := psql.DbConnection.Prepare("SELECT username, password, email, email_validation, phone_number, phone_number_validation FROM account_auth WHERE account_id= $1") if err != nil { return account, fmt.Errorf("psql connection failed") } @@ -72,7 +72,7 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { &account.Authentication.Local.Email, &emailValidation, &account.Authentication.Local.PhoneNumber, - &account.Authentication.Local.PhoneNumberValidation) + &phoneValidation) if err != nil { return account, fmt.Errorf("psql select account auth query failed") } @@ -80,6 +80,10 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { if err != nil { return account, err } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return account, err + } } return account, nil } diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index 52a0106..a98ab0a 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -1,7 +1,12 @@ package storage import ( + "crypto/rand" + "encoding/hex" + "encoding/json" + "fmt" "github.com/spf13/viper" + "reflect" "testing" ) @@ -19,3 +24,95 @@ func TestNewPostgresqlStorage(t *testing.T) { } defer storage.DbConnection.Close() } + +func generateUUIDv4() string { + uuid := make([]byte, 16) + _, err := rand.Read(uuid) + if err != nil { + panic(err) + } + uuid[6] = (uuid[6] & 0x0f) | 0x40 + uuid[8] = (uuid[8] & 0xbf) | 0x80 + return hex.EncodeToString(uuid[:4]) + "-" + hex.EncodeToString(uuid[4:6]) + "-" + hex.EncodeToString(uuid[6:8]) + "-" + hex.EncodeToString(uuid[8:10]) + "-" + hex.EncodeToString(uuid[10:]) +} +func TestGetAccount(t *testing.T) { + // Open a database connection + cfg := viper.New() + cfg.Set("storage.db.psql.host", "localhost") + cfg.Set("storage.db.psql.port", "5432") + cfg.Set("storage.db.psql.user", "postgres") + cfg.Set("storage.db.psql.password", "postgres") + cfg.Set("storage.db.psql.dbname", "mobilityaccounts") + db, err := NewPostgresqlStorage(cfg) + Id := generateUUIDv4() + if err != nil { + t.Errorf("failed to create new psql connection") + } + // Insert data into accounts table + accountData := map[string]any{ + "key1": "value1", + "key2": "value2", + } + accountMetadata := map[string]any{ + "key1": "value1", + "key2": "value2", + } + account := Account{ + ID: Id, + Namespace: "test_namespace", + Data: accountData, + Metadata: accountMetadata, + } + dataJSON, err := json.Marshal(map[string]any{ + "key1": "value1", + "key2": "value2", + }) + if err != nil { + t.Errorf("error account data and metdata") + } + _, err = db.DbConnection.Exec("INSERT INTO accounts (id, namespace, data, metadata) VALUES ($1, $2, $3, $4)", account.ID, account.Namespace, dataJSON, dataJSON) + if err != nil { + t.Errorf("error in inserting a new account") + } + // Insert data into account_auth table + emailValidation := Validation{ + Validated: true, + ValidationCode: "code", + } + localAuth := LocalAuth{ + Username: "testuser", + Password: "testpassword", + Email: "test@test.com", + EmailValidation: emailValidation, + PhoneNumber: "1234567890", + PhoneNumberValidation: emailValidation, + } + localAuthJSON, err := json.Marshal(emailValidation) + if err != nil { + t.Errorf("error account_auth localAuth") + } + _, err = db.DbConnection.Exec("INSERT INTO account_auth (account_id, username, password, email, email_validation, phone_number,phone_number_validation) VALUES ($1, $2, $3, $4, $5, $6, $7)", account.ID, localAuth.Username, localAuth.Password, localAuth.Email, localAuthJSON, localAuth.PhoneNumber, localAuthJSON) + if err != nil { + fmt.Println(err) + t.Errorf("error in iserting a new account in account_auth") + } + account_, err := db.GetAccount(Id) + if err != nil { + t.Errorf("failed") + fmt.Println(err) + } + expectedAccount := &Account{ + ID: Id, + Namespace: "test_namespace", + Data: accountData, + Metadata: accountMetadata, + Authentication: AccountAuth{ + Local: localAuth, + }, + } + if reflect.DeepEqual(account_, expectedAccount) { + fmt.Println("PASS") + } else { + t.Errorf("The received account is not the same as expected") + } +} From 57e5a73c2f327d18be8354fcfb54c248553d9f00 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Tue, 25 Apr 2023 22:29:39 +0200 Subject: [PATCH 005/340] PSQL CreateAccount --- storage/postgresql.go | 37 +++++++++++++++++++++++-- storage/postgresql_test.go | 57 ++++++++++++++++++++++++++++++++------ 2 files changed, 84 insertions(+), 10 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index 98a3ad9..d31b628 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -100,8 +100,41 @@ func (PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, error return nil, fmt.Errorf("") } -func (PostgresqlStorage) CreateAccount(account Account) error { - return fmt.Errorf("") +func (psql PostgresqlStorage) CreateAccount(account Account) error { + insertAccountStmt, err := psql.DbConnection.Prepare("INSERT INTO accounts (id, namespace, data, metadata) VALUES ($1, $2, $3, $4)") + if err != nil { + return err + } + dataAccountJson, err := json.Marshal(account.Data) + if err != nil { + return err + } + metadataAccountJson, err := json.Marshal(account.Metadata) + if err != nil { + return err + } + _, err = insertAccountStmt.Exec(account.ID, account.Namespace, dataAccountJson, metadataAccountJson) + if err != nil { + return err + } + insertAccountAuthStmt, err := psql.DbConnection.Prepare("INSERT INTO account_auth (account_id, username, password, email, email_validation,phone_number,phone_number_validation) values($1, $2, $3, $4, $5, $6, $7)") + if err != nil { + return err + } + emailValidationJson, err := json.Marshal(account.Authentication.Local.EmailValidation) + if err != nil { + return err + } + phoneValidationJson, err := json.Marshal(account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return err + } + _, err = insertAccountAuthStmt.Exec(account.ID, account.Authentication.Local.Username, account.Authentication.Local.Password, + account.Authentication.Local.Email, emailValidationJson, account.Authentication.Local.PhoneNumber, phoneValidationJson) + if err != nil { + return err + } + return nil } func (PostgresqlStorage) UpdateAccount(account Account) error { diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index a98ab0a..585710f 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -10,14 +10,18 @@ import ( "testing" ) -func TestNewPostgresqlStorage(t *testing.T) { - cfg := viper.New() +var cfg *viper.Viper + +func init() { + cfg = viper.New() cfg.Set("storage.db.psql.host", "localhost") cfg.Set("storage.db.psql.port", "5432") cfg.Set("storage.db.psql.user", "postgres") cfg.Set("storage.db.psql.password", "postgres") cfg.Set("storage.db.psql.dbname", "mobilityaccounts") +} +func TestNewPostgresqlStorage(t *testing.T) { storage, err := NewPostgresqlStorage(cfg) if err != nil { t.Errorf("error creating new PostgreSQL storage: %v", err) @@ -35,14 +39,9 @@ func generateUUIDv4() string { uuid[8] = (uuid[8] & 0xbf) | 0x80 return hex.EncodeToString(uuid[:4]) + "-" + hex.EncodeToString(uuid[4:6]) + "-" + hex.EncodeToString(uuid[6:8]) + "-" + hex.EncodeToString(uuid[8:10]) + "-" + hex.EncodeToString(uuid[10:]) } + func TestGetAccount(t *testing.T) { // Open a database connection - cfg := viper.New() - cfg.Set("storage.db.psql.host", "localhost") - cfg.Set("storage.db.psql.port", "5432") - cfg.Set("storage.db.psql.user", "postgres") - cfg.Set("storage.db.psql.password", "postgres") - cfg.Set("storage.db.psql.dbname", "mobilityaccounts") db, err := NewPostgresqlStorage(cfg) Id := generateUUIDv4() if err != nil { @@ -116,3 +115,45 @@ func TestGetAccount(t *testing.T) { t.Errorf("The received account is not the same as expected") } } + +func TestPostgresqlStorage_CreateAccount(t *testing.T) { + db, err := NewPostgresqlStorage(cfg) + Id := generateUUIDv4() + if err != nil { + t.Errorf("failed to create new psql connection") + } + emailValidation := Validation{ + Validated: true, + ValidationCode: "code", + } + localAuth := LocalAuth{ + Username: "salim", + Password: "testpassword", + Email: "test@test.com", + EmailValidation: emailValidation, + PhoneNumber: "1234567890", + PhoneNumberValidation: emailValidation, + } + accountData := map[string]any{ + "key1": "value1", + "key2": "value2", + } + accountMetadata := map[string]any{ + "key1": "value1", + "key2": "value2", + } + account := Account{ + ID: Id, + Namespace: "test_namespace", + Authentication: AccountAuth{ + Local: localAuth, + }, + Data: accountData, + Metadata: accountMetadata, + } + err = db.CreateAccount(account) + if err != nil { + fmt.Println(err) + t.Errorf("Failed to create account") + } +} From 478d031275581143dcb1db3308d9c8d7bf731a11 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Wed, 26 Apr 2023 00:11:46 +0200 Subject: [PATCH 006/340] PSQL UpdateAccount --- storage/postgresql.go | 31 +++++++++++++++- storage/postgresql_test.go | 75 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index d31b628..e59884a 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -137,8 +137,35 @@ func (psql PostgresqlStorage) CreateAccount(account Account) error { return nil } -func (PostgresqlStorage) UpdateAccount(account Account) error { - return fmt.Errorf("") +func (psql PostgresqlStorage) UpdateAccount(account Account) error { + updateAccountStmt := "update accounts set namespace=$1, data=$2, metadata=$3 where id= $4" + dataAccountJson, err := json.Marshal(account.Data) + if err != nil { + return err + } + metadataAccountJson, err := json.Marshal(account.Metadata) + if err != nil { + return err + } + _, err = psql.DbConnection.Exec(updateAccountStmt, account.Namespace, dataAccountJson, metadataAccountJson, account.ID) + if err != nil { + return err + } + updateAccountAuthStmt := "update account_auth set username = $1, password = $2, email = $3, email_validation = $4 ,phone_number = $5,phone_number_validation = $6 where account_id = $7" + emailValidationJson, err := json.Marshal(account.Authentication.Local.EmailValidation) + if err != nil { + return err + } + phoneValidationJson, err := json.Marshal(account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return err + } + _, err = psql.DbConnection.Exec(updateAccountAuthStmt, account.Authentication.Local.Username, account.Authentication.Local.Password, account.Authentication.Local.Email, + emailValidationJson, account.Authentication.Local.PhoneNumber, phoneValidationJson, account.ID) + if err != nil { + return err + } + return nil } func isUUIDv4(str string) bool { diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index 585710f..cf35713 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -157,3 +157,78 @@ func TestPostgresqlStorage_CreateAccount(t *testing.T) { t.Errorf("Failed to create account") } } + +func TestPostgresqlStorage_UpdateAccount(t *testing.T) { + db, err := NewPostgresqlStorage(cfg) + Id := generateUUIDv4() + if err != nil { + t.Errorf("failed to create new psql connection") + } + emailValidation := Validation{ + Validated: true, + ValidationCode: "code", + } + localAuth := LocalAuth{ + Username: "salim", + Password: "testpassword", + Email: "test@test.com", + EmailValidation: emailValidation, + PhoneNumber: "1234567890", + PhoneNumberValidation: emailValidation, + } + accountData := map[string]any{ + "key1": "value1", + "key2": "value2", + } + accountMetadata := map[string]any{ + "key1": "value1", + "key2": "value2", + } + account := Account{ + ID: Id, + Namespace: "test_namespace", + Authentication: AccountAuth{ + Local: localAuth, + }, + Data: accountData, + Metadata: accountMetadata, + } + err = db.CreateAccount(account) + if err != nil { + fmt.Println(err) + t.Errorf("Failed to create account") + } + account2 := Account{ + ID: Id, + Namespace: "salim", + Authentication: AccountAuth{ + Local: LocalAuth{ + Username: "salim", + Password: "salim", + Email: "salim@test.com", + EmailValidation: Validation{ + Validated: false, + ValidationCode: "123", + }, + PhoneNumber: "12345", + PhoneNumberValidation: Validation{ + Validated: true, + ValidationCode: "1233", + }, + }, + }, + Data: map[string]any{ + "key1": "salim1", + "key2": "salim2", + }, + Metadata: map[string]any{ + "key1": "salim1", + "key2": "salim2", + }, + } + err = db.UpdateAccount(account2) + if err != nil { + fmt.Println(err) + t.Errorf("failed") + } +} From d0d30ac8ab99451ed3007d452ae5c4c239dbdc96 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Wed, 26 Apr 2023 01:13:47 +0200 Subject: [PATCH 007/340] prepare statement UpdateAccount --- storage/postgresql.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index e59884a..5804e13 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -138,7 +138,10 @@ func (psql PostgresqlStorage) CreateAccount(account Account) error { } func (psql PostgresqlStorage) UpdateAccount(account Account) error { - updateAccountStmt := "update accounts set namespace=$1, data=$2, metadata=$3 where id= $4" + updateAccountStmt, err := psql.DbConnection.Prepare("update accounts set namespace=$1, data=$2, metadata=$3 where id= $4") + if err != nil { + return err + } dataAccountJson, err := json.Marshal(account.Data) if err != nil { return err @@ -147,11 +150,14 @@ func (psql PostgresqlStorage) UpdateAccount(account Account) error { if err != nil { return err } - _, err = psql.DbConnection.Exec(updateAccountStmt, account.Namespace, dataAccountJson, metadataAccountJson, account.ID) + _, err = updateAccountStmt.Exec(account.Namespace, dataAccountJson, metadataAccountJson, account.ID) + if err != nil { + return err + } + updateAccountAuthStmt, err := psql.DbConnection.Prepare("update account_auth set username = $1, password = $2, email = $3, email_validation = $4 ,phone_number = $5,phone_number_validation = $6 where account_id = $7") if err != nil { return err } - updateAccountAuthStmt := "update account_auth set username = $1, password = $2, email = $3, email_validation = $4 ,phone_number = $5,phone_number_validation = $6 where account_id = $7" emailValidationJson, err := json.Marshal(account.Authentication.Local.EmailValidation) if err != nil { return err @@ -160,7 +166,7 @@ func (psql PostgresqlStorage) UpdateAccount(account Account) error { if err != nil { return err } - _, err = psql.DbConnection.Exec(updateAccountAuthStmt, account.Authentication.Local.Username, account.Authentication.Local.Password, account.Authentication.Local.Email, + _, err = updateAccountAuthStmt.Exec(account.Authentication.Local.Username, account.Authentication.Local.Password, account.Authentication.Local.Email, emailValidationJson, account.Authentication.Local.PhoneNumber, phoneValidationJson, account.ID) if err != nil { return err From ada858a7383fc43370a6d5a8d9540314864dc8f2 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Wed, 26 Apr 2023 10:57:49 +0200 Subject: [PATCH 008/340] LocalAuthentication --- storage/postgresql.go | 108 +++++++++++++++++++++++++++++++++---- storage/postgresql_test.go | 31 ++++++++++- 2 files changed, 128 insertions(+), 11 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index 5804e13..69caf9e 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -47,24 +47,24 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { if isUUIDv4(id) { stmtAccounts, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata FROM accounts WHERE id = $1") if err != nil { - return account, fmt.Errorf("psql connection failed") + return nil, fmt.Errorf("psql connection failed") } defer stmtAccounts.Close() err = stmtAccounts.QueryRow(id).Scan(&account.ID, &account.Namespace, &data, &metadata) if err != nil { - return account, fmt.Errorf("psql select account query failed") + return nil, fmt.Errorf("psql select account query failed") } err = json.Unmarshal(data, &account.Data) if err != nil { - return account, err + return nil, err } err = json.Unmarshal(metadata, &account.Metadata) if err != nil { - return account, err + return nil, err } stmtAccount_auth, err := psql.DbConnection.Prepare("SELECT username, password, email, email_validation, phone_number, phone_number_validation FROM account_auth WHERE account_id= $1") if err != nil { - return account, fmt.Errorf("psql connection failed") + return nil, fmt.Errorf("psql connection failed") } defer stmtAccount_auth.Close() err = stmtAccount_auth.QueryRow(id).Scan(&account.Authentication.Local.Username, @@ -74,22 +74,110 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { &account.Authentication.Local.PhoneNumber, &phoneValidation) if err != nil { - return account, fmt.Errorf("psql select account auth query failed") + return nil, fmt.Errorf("psql select account auth query failed") } err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) if err != nil { - return account, err + return nil, err } err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) if err != nil { - return account, err + return nil, err } } return account, nil } -func (PostgresqlStorage) LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error) { - return nil, fmt.Errorf("") +func (psql PostgresqlStorage) LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error) { + account := &Account{} + var ( + data, metadata, emailValidation, phoneValidation []byte + ) + if username != "" { + usernameStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number, phone_number_validation FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE namespace = $1 AND username = $2;") + if err != nil { + return nil, err + } + err = usernameStmt.QueryRow(namespace, username).Scan(&account.ID, &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, + &account.Authentication.Local.Password, &account.Authentication.Local.Email, &emailValidation, &account.Authentication.Local.PhoneNumber, &phoneValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(metadata, &account.Metadata) + if err != nil { + return nil, err + } + err = json.Unmarshal(data, &account.Data) + if err != nil { + return nil, err + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } + return account, nil + } else if email != "" { + account.Authentication.Local.Email = email + emailStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, password, email_validation, phone_number, phone_number_validation FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE namespace = $1 AND email = $2;") + if err != nil { + return nil, err + } + err = emailStmt.QueryRow(namespace, email).Scan(&account.ID, &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, + &account.Authentication.Local.Password, &emailValidation, &account.Authentication.Local.PhoneNumber, &phoneValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(metadata, &account.Metadata) + if err != nil { + return nil, err + } + err = json.Unmarshal(data, &account.Data) + if err != nil { + return nil, err + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } + return account, nil + } else if phone_number != "" { + account.Authentication.Local.PhoneNumber = phone_number + phoneStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number_validation FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE namespace = $1 AND phone_number = $2;") + if err != nil { + return nil, err + } + err = phoneStmt.QueryRow(namespace, phone_number).Scan(&account.ID, &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, + &account.Authentication.Local.Password, &account.Authentication.Local.Email, &emailValidation, &phoneValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(metadata, &account.Metadata) + if err != nil { + return nil, err + } + err = json.Unmarshal(data, &account.Data) + if err != nil { + return nil, err + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } + return account, nil + } + return account, nil } func (PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error) { diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index cf35713..08383e5 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -23,6 +23,8 @@ func init() { func TestNewPostgresqlStorage(t *testing.T) { storage, err := NewPostgresqlStorage(cfg) + storage.DbConnection.Exec("Delete from accounts;") + storage.DbConnection.Exec("Delete from account_auth;") if err != nil { t.Errorf("error creating new PostgreSQL storage: %v", err) } @@ -144,7 +146,7 @@ func TestPostgresqlStorage_CreateAccount(t *testing.T) { } account := Account{ ID: Id, - Namespace: "test_namespace", + Namespace: "namespace", Authentication: AccountAuth{ Local: localAuth, }, @@ -232,3 +234,30 @@ func TestPostgresqlStorage_UpdateAccount(t *testing.T) { t.Errorf("failed") } } + +func TestPostgresqlStorage_LocalAuthentication(t *testing.T) { + db, err := NewPostgresqlStorage(cfg) + if err != nil { + t.Errorf("failed to create new psql connection") + } + accountByUsername, err := db.LocalAuthentication("test_namespace", "testuser", "", "") + if err != nil { + t.Errorf("Failed LocalAuthentication based on username and namespace") + } + fmt.Println(accountByUsername) + accountByEmail, err := db.LocalAuthentication("test_namespace", "", "test@test.com", "") + if err != nil { + t.Errorf("Failed LocalAuthentication based on username and namespace") + } + fmt.Println(accountByEmail) + accountByPhone, err := db.LocalAuthentication("test_namespace", "", "", "1234567890") + if err != nil { + t.Errorf("Failed LocalAuthentication based on username and namespace") + } + fmt.Println(accountByPhone) + accountByAll, err := db.LocalAuthentication("test_namespace", "testuser", "test@test.com", "1234567890") + if err != nil { + t.Errorf("Failed LocalAuthentication based on username and namespace") + } + fmt.Println(accountByAll) +} From cdda4b1c9c8fadac934a7ab01c19043c76dd1e03 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Wed, 26 Apr 2023 11:41:21 +0200 Subject: [PATCH 009/340] GetAccounts --- storage/postgresql.go | 64 ++++++++++++++++++++++++++++++++++++-- storage/postgresql_test.go | 20 ++++++++++-- 2 files changed, 80 insertions(+), 4 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index 69caf9e..f5e29b9 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -8,6 +8,7 @@ import ( "github.com/spf13/viper" "regexp" "strconv" + "strings" ) type PostgresqlStorage struct { @@ -180,8 +181,67 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username str return account, nil } -func (PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error) { - return nil, fmt.Errorf("") +func (psql PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error) { + var accounts []Account + namespacesStr := "'" + strings.Join(namespaces, "', '") + "'" + query := ` + SELECT accounts.id, accounts.namespace, accounts.data, accounts.metadata, + account_auth.username, account_auth.password, + account_auth.email, account_auth.email_validation, + account_auth.phone_number, account_auth.phone_number_validation + FROM accounts + INNER JOIN account_auth ON accounts.id = account_auth.account_id + WHERE accounts.namespace IN (%s) + ` + query = fmt.Sprintf(query, namespacesStr) + rows, err := psql.DbConnection.Query(query) + if err != nil { + return nil, err + } + defer rows.Close() + for rows.Next() { + var account Account + var dataBytes []byte + var metadataBytes []byte + var emailValidationBytes []byte + var phoneNumberValidationBytes []byte + err := rows.Scan( + &account.ID, + &account.Namespace, + &dataBytes, + &metadataBytes, + &account.Authentication.Local.Username, + &account.Authentication.Local.Password, + &account.Authentication.Local.Email, + &emailValidationBytes, + &account.Authentication.Local.PhoneNumber, + &phoneNumberValidationBytes, + ) + if err != nil { + return nil, err + } + + err = json.Unmarshal(dataBytes, &account.Data) + if err != nil { + return nil, err + } + + err = json.Unmarshal(metadataBytes, &account.Metadata) + if err != nil { + return nil, err + } + err = json.Unmarshal(emailValidationBytes, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + + err = json.Unmarshal(phoneNumberValidationBytes, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } + accounts = append(accounts, account) + } + return accounts, nil } func (PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, error) { diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index 08383e5..751c3ac 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -10,6 +10,8 @@ import ( "testing" ) +// Tests must be run in order + var cfg *viper.Viper func init() { @@ -23,8 +25,8 @@ func init() { func TestNewPostgresqlStorage(t *testing.T) { storage, err := NewPostgresqlStorage(cfg) - storage.DbConnection.Exec("Delete from accounts;") - storage.DbConnection.Exec("Delete from account_auth;") + storage.DbConnection.Exec("Delete from account_auth ;") + storage.DbConnection.Exec("Delete from accounts ;") if err != nil { t.Errorf("error creating new PostgreSQL storage: %v", err) } @@ -261,3 +263,17 @@ func TestPostgresqlStorage_LocalAuthentication(t *testing.T) { } fmt.Println(accountByAll) } + +func TestPostgresqlStorage_GetAccounts(t *testing.T) { + db, err := NewPostgresqlStorage(cfg) + if err != nil { + t.Errorf("failed to create new psql connection") + } + accounts, err := db.GetAccounts([]string{"test_namespace", "salim", "namespace"}) + if err != nil { + t.Errorf("Failed") + } + for _, account := range accounts { + fmt.Println(account) + } +} From d56343f167a0e8c32a44d0e87ad432832a55bf04 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Wed, 26 Apr 2023 12:20:39 +0200 Subject: [PATCH 010/340] GetAccountsByIds --- storage/postgresql.go | 63 ++++++++++++++++++++++++++++++++++++-- storage/postgresql_test.go | 46 ++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 2 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index f5e29b9..bf3989f 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -244,8 +244,67 @@ func (psql PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error return accounts, nil } -func (PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, error) { - return nil, fmt.Errorf("") +func (psql PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, error) { + var accounts []Account + accountIdsStr := "'" + strings.Join(accountids, "', '") + "'" + query := ` + SELECT accounts.id, accounts.namespace, accounts.data, accounts.metadata, + account_auth.username, account_auth.password, + account_auth.email, account_auth.email_validation, + account_auth.phone_number, account_auth.phone_number_validation + FROM accounts + INNER JOIN account_auth ON accounts.id = account_auth.account_id + WHERE accounts.id IN (%s) + ` + query = fmt.Sprintf(query, accountIdsStr) + rows, err := psql.DbConnection.Query(query) + if err != nil { + return nil, err + } + defer rows.Close() + for rows.Next() { + var account Account + var dataBytes []byte + var metadataBytes []byte + var emailValidationBytes []byte + var phoneNumberValidationBytes []byte + err := rows.Scan( + &account.ID, + &account.Namespace, + &dataBytes, + &metadataBytes, + &account.Authentication.Local.Username, + &account.Authentication.Local.Password, + &account.Authentication.Local.Email, + &emailValidationBytes, + &account.Authentication.Local.PhoneNumber, + &phoneNumberValidationBytes) + if err != nil { + return nil, err + } + + err = json.Unmarshal(dataBytes, &account.Data) + if err != nil { + return nil, err + } + + err = json.Unmarshal(metadataBytes, &account.Metadata) + if err != nil { + return nil, err + } + + err = json.Unmarshal(emailValidationBytes, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + + err = json.Unmarshal(phoneNumberValidationBytes, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } + accounts = append(accounts, account) + } + return accounts, nil } func (psql PostgresqlStorage) CreateAccount(account Account) error { diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index 751c3ac..c69676e 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -277,3 +277,49 @@ func TestPostgresqlStorage_GetAccounts(t *testing.T) { fmt.Println(account) } } + +func TestPostgresqlStorage_GetAccountsByIds(t *testing.T) { + db, err := NewPostgresqlStorage(cfg) + if err != nil { + t.Errorf("failed to create new psql connection") + } + account := Account{ + ID: "772315f1-8113-486a-90c7-9073410065bd", + Namespace: "oo", + Authentication: AccountAuth{ + Local: LocalAuth{ + Username: "username", + Password: "password", + Email: "salim@test.com", + EmailValidation: Validation{ + Validated: true, + ValidationCode: "123", + }, + PhoneNumber: "12345", + PhoneNumberValidation: Validation{ + Validated: true, + ValidationCode: "1233", + }, + }, + }, + Data: map[string]any{ + "key1": "salim1", + "key2": "salim2", + }, + Metadata: map[string]any{ + "key1": "salim1", + "key2": "salim2", + }, + } + err = db.CreateAccount(account) + if err != nil { + t.Errorf("Failed to create account") + } + accounts, err := db.GetAccountsByIds([]string{"772315f1-8113-486a-90c7-9073410065bd"}) + if err != nil { + t.Errorf("Failed to get account by ID") + } + for _, acc := range accounts { + fmt.Println(acc) + } +} From d196373abc8aa185f610dc2ea5e1e5561d103369 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Thu, 27 Apr 2023 09:18:52 +0200 Subject: [PATCH 011/340] refactoring psql --- storage/postgresql.go | 168 +++++++++++++++++++++++-------------- storage/postgresql_test.go | 24 ++++-- 2 files changed, 120 insertions(+), 72 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index bf3989f..72d8a5d 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -6,7 +6,6 @@ import ( "fmt" _ "github.com/lib/pq" "github.com/spf13/viper" - "regexp" "strconv" "strings" ) @@ -45,62 +44,69 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { data, metadata, emailValidation, phoneValidation []byte ) account := &Account{} - if isUUIDv4(id) { - stmtAccounts, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata FROM accounts WHERE id = $1") - if err != nil { - return nil, fmt.Errorf("psql connection failed") - } - defer stmtAccounts.Close() - err = stmtAccounts.QueryRow(id).Scan(&account.ID, &account.Namespace, &data, &metadata) - if err != nil { - return nil, fmt.Errorf("psql select account query failed") - } - err = json.Unmarshal(data, &account.Data) - if err != nil { - return nil, err - } - err = json.Unmarshal(metadata, &account.Metadata) - if err != nil { - return nil, err - } - stmtAccount_auth, err := psql.DbConnection.Prepare("SELECT username, password, email, email_validation, phone_number, phone_number_validation FROM account_auth WHERE account_id= $1") - if err != nil { - return nil, fmt.Errorf("psql connection failed") - } - defer stmtAccount_auth.Close() - err = stmtAccount_auth.QueryRow(id).Scan(&account.Authentication.Local.Username, - &account.Authentication.Local.Password, - &account.Authentication.Local.Email, - &emailValidation, - &account.Authentication.Local.PhoneNumber, - &phoneValidation) - if err != nil { - return nil, fmt.Errorf("psql select account auth query failed") - } - err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return nil, err - } + stmtAccounts, err := psql.DbConnection.Prepare("" + + "SELECT id, namespace, data, " + + "metadata, username, password, email, email_validation, " + + "phone_number, phone_number_validation FROM accounts a JOIN " + + "account_auth auth ON id = account_id WHERE id = $1") + if err != nil { + return nil, fmt.Errorf("psql connection failed") + } + defer stmtAccounts.Close() + err = stmtAccounts.QueryRow(id).Scan(&account.ID, + &account.Namespace, + &data, + &metadata, + &account.Authentication.Local.Username, + &account.Authentication.Local.Password, + &account.Authentication.Local.Email, + &emailValidation, + &account.Authentication.Local.PhoneNumber, + &phoneValidation) + if err != nil { + return nil, fmt.Errorf("psql select account query failed") + } + err = json.Unmarshal(data, &account.Data) + if err != nil { + return nil, err + } + err = json.Unmarshal(metadata, &account.Metadata) + if err != nil { + return nil, err + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err } return account, nil } -func (psql PostgresqlStorage) LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error) { +func (psql PostgresqlStorage) LocalAuthentication(namespace string, username string, email string, + phone_number string) (*Account, error) { account := &Account{} var ( data, metadata, emailValidation, phoneValidation []byte ) if username != "" { - usernameStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number, phone_number_validation FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE namespace = $1 AND username = $2;") + usernameStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, " + + "password, email, email_validation, phone_number, phone_number_validation " + + "FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE " + + "namespace = $1 AND username = $2;") if err != nil { return nil, err } - err = usernameStmt.QueryRow(namespace, username).Scan(&account.ID, &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, - &account.Authentication.Local.Password, &account.Authentication.Local.Email, &emailValidation, &account.Authentication.Local.PhoneNumber, &phoneValidation) + err = usernameStmt.QueryRow(namespace, username).Scan( + &account.ID, + &account.Namespace, &data, &metadata, + &account.Authentication.Local.Username, + &account.Authentication.Local.Password, + &account.Authentication.Local.Email, + &emailValidation, &account.Authentication.Local.PhoneNumber, + &phoneValidation) if err != nil { return nil, err } @@ -123,12 +129,22 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username str return account, nil } else if email != "" { account.Authentication.Local.Email = email - emailStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, password, email_validation, phone_number, phone_number_validation FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE namespace = $1 AND email = $2;") + emailStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, " + + "password, email_validation, phone_number, phone_number_validation " + + "FROM accounts INNER JOIN account_auth ON " + + "accounts.id = account_auth.account_id WHERE namespace = $1 AND email = $2;") if err != nil { return nil, err } - err = emailStmt.QueryRow(namespace, email).Scan(&account.ID, &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, - &account.Authentication.Local.Password, &emailValidation, &account.Authentication.Local.PhoneNumber, &phoneValidation) + err = emailStmt.QueryRow(namespace, email).Scan( + &account.ID, + &account.Namespace, + &data, &metadata, + &account.Authentication.Local.Username, + &account.Authentication.Local.Password, + &emailValidation, + &account.Authentication.Local.PhoneNumber, + &phoneValidation) if err != nil { return nil, err } @@ -151,12 +167,23 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username str return account, nil } else if phone_number != "" { account.Authentication.Local.PhoneNumber = phone_number - phoneStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number_validation FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE namespace = $1 AND phone_number = $2;") + phoneStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, " + + "data, metadata, username, password, email, " + + "email_validation, phone_number_validation FROM accounts " + + "INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE " + + "namespace = $1 AND phone_number = $2;") if err != nil { return nil, err } - err = phoneStmt.QueryRow(namespace, phone_number).Scan(&account.ID, &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, - &account.Authentication.Local.Password, &account.Authentication.Local.Email, &emailValidation, &phoneValidation) + err = phoneStmt.QueryRow(namespace, phone_number).Scan(&account.ID, + &account.Namespace, + &data, + &metadata, + &account.Authentication.Local.Username, + &account.Authentication.Local.Password, + &account.Authentication.Local.Email, + &emailValidation, + &phoneValidation) if err != nil { return nil, err } @@ -178,7 +205,7 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username str } return account, nil } - return account, nil + return nil, fmt.Errorf("localauthentication func error PSQL") } func (psql PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error) { @@ -308,7 +335,8 @@ func (psql PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, } func (psql PostgresqlStorage) CreateAccount(account Account) error { - insertAccountStmt, err := psql.DbConnection.Prepare("INSERT INTO accounts (id, namespace, data, metadata) VALUES ($1, $2, $3, $4)") + insertAccountStmt, err := psql.DbConnection.Prepare("INSERT INTO accounts (id, namespace, data, metadata)" + + " VALUES ($1, $2, $3, $4)") if err != nil { return err } @@ -324,7 +352,9 @@ func (psql PostgresqlStorage) CreateAccount(account Account) error { if err != nil { return err } - insertAccountAuthStmt, err := psql.DbConnection.Prepare("INSERT INTO account_auth (account_id, username, password, email, email_validation,phone_number,phone_number_validation) values($1, $2, $3, $4, $5, $6, $7)") + insertAccountAuthStmt, err := psql.DbConnection.Prepare("INSERT INTO account_auth (account_id, username," + + " password, email, email_validation,phone_number,phone_number_validation) " + + "values($1, $2, $3, $4, $5, $6, $7)") if err != nil { return err } @@ -336,8 +366,13 @@ func (psql PostgresqlStorage) CreateAccount(account Account) error { if err != nil { return err } - _, err = insertAccountAuthStmt.Exec(account.ID, account.Authentication.Local.Username, account.Authentication.Local.Password, - account.Authentication.Local.Email, emailValidationJson, account.Authentication.Local.PhoneNumber, phoneValidationJson) + _, err = insertAccountAuthStmt.Exec(account.ID, + account.Authentication.Local.Username, + account.Authentication.Local.Password, + account.Authentication.Local.Email, + emailValidationJson, + account.Authentication.Local.PhoneNumber, + phoneValidationJson) if err != nil { return err } @@ -345,7 +380,8 @@ func (psql PostgresqlStorage) CreateAccount(account Account) error { } func (psql PostgresqlStorage) UpdateAccount(account Account) error { - updateAccountStmt, err := psql.DbConnection.Prepare("update accounts set namespace=$1, data=$2, metadata=$3 where id= $4") + updateAccountStmt, err := psql.DbConnection.Prepare("update accounts set namespace=$1, data=$2, " + + " metadata=$3 where id= $4") if err != nil { return err } @@ -361,7 +397,10 @@ func (psql PostgresqlStorage) UpdateAccount(account Account) error { if err != nil { return err } - updateAccountAuthStmt, err := psql.DbConnection.Prepare("update account_auth set username = $1, password = $2, email = $3, email_validation = $4 ,phone_number = $5,phone_number_validation = $6 where account_id = $7") + updateAccountAuthStmt, err := psql.DbConnection.Prepare("update account_auth set username = $1," + + " password = $2," + + " email = $3, email_validation = $4 ," + + "phone_number = $5,phone_number_validation = $6 where account_id = $7") if err != nil { return err } @@ -373,15 +412,14 @@ func (psql PostgresqlStorage) UpdateAccount(account Account) error { if err != nil { return err } - _, err = updateAccountAuthStmt.Exec(account.Authentication.Local.Username, account.Authentication.Local.Password, account.Authentication.Local.Email, - emailValidationJson, account.Authentication.Local.PhoneNumber, phoneValidationJson, account.ID) + _, err = updateAccountAuthStmt.Exec(account.Authentication.Local.Username, + account.Authentication.Local.Password, + account.Authentication.Local.Email, + emailValidationJson, + account.Authentication.Local.PhoneNumber, + phoneValidationJson, account.ID) if err != nil { return err } return nil } - -func isUUIDv4(str string) bool { - pattern := regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$`) - return pattern.MatchString(str) -} diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index c69676e..e0bdd95 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -41,7 +41,9 @@ func generateUUIDv4() string { } uuid[6] = (uuid[6] & 0x0f) | 0x40 uuid[8] = (uuid[8] & 0xbf) | 0x80 - return hex.EncodeToString(uuid[:4]) + "-" + hex.EncodeToString(uuid[4:6]) + "-" + hex.EncodeToString(uuid[6:8]) + "-" + hex.EncodeToString(uuid[8:10]) + "-" + hex.EncodeToString(uuid[10:]) + return hex.EncodeToString(uuid[:4]) + "-" + hex.EncodeToString(uuid[4:6]) + "-" + + hex.EncodeToString(uuid[6:8]) + "-" + hex.EncodeToString(uuid[8:10]) + "-" + + hex.EncodeToString(uuid[10:]) } func TestGetAccount(t *testing.T) { @@ -73,7 +75,8 @@ func TestGetAccount(t *testing.T) { if err != nil { t.Errorf("error account data and metdata") } - _, err = db.DbConnection.Exec("INSERT INTO accounts (id, namespace, data, metadata) VALUES ($1, $2, $3, $4)", account.ID, account.Namespace, dataJSON, dataJSON) + _, err = db.DbConnection.Exec("INSERT INTO accounts (id, namespace, data, metadata) "+ + "VALUES ($1, $2, $3, $4)", account.ID, account.Namespace, dataJSON, dataJSON) if err != nil { t.Errorf("error in inserting a new account") } @@ -94,7 +97,10 @@ func TestGetAccount(t *testing.T) { if err != nil { t.Errorf("error account_auth localAuth") } - _, err = db.DbConnection.Exec("INSERT INTO account_auth (account_id, username, password, email, email_validation, phone_number,phone_number_validation) VALUES ($1, $2, $3, $4, $5, $6, $7)", account.ID, localAuth.Username, localAuth.Password, localAuth.Email, localAuthJSON, localAuth.PhoneNumber, localAuthJSON) + _, err = db.DbConnection.Exec("INSERT INTO account_auth (account_id, username, password, "+ + "email, email_validation, "+ + "phone_number,phone_number_validation) VALUES ($1, $2, $3, $4, $5, $6, $7)", account.ID, + localAuth.Username, localAuth.Password, localAuth.Email, localAuthJSON, localAuth.PhoneNumber, localAuthJSON) if err != nil { fmt.Println(err) t.Errorf("error in iserting a new account in account_auth") @@ -242,22 +248,26 @@ func TestPostgresqlStorage_LocalAuthentication(t *testing.T) { if err != nil { t.Errorf("failed to create new psql connection") } - accountByUsername, err := db.LocalAuthentication("test_namespace", "testuser", "", "") + accountByUsername, err := db.LocalAuthentication("test_namespace", "testuser", + "", "") if err != nil { t.Errorf("Failed LocalAuthentication based on username and namespace") } fmt.Println(accountByUsername) - accountByEmail, err := db.LocalAuthentication("test_namespace", "", "test@test.com", "") + accountByEmail, err := db.LocalAuthentication("test_namespace", "", + "test@test.com", "") if err != nil { t.Errorf("Failed LocalAuthentication based on username and namespace") } fmt.Println(accountByEmail) - accountByPhone, err := db.LocalAuthentication("test_namespace", "", "", "1234567890") + accountByPhone, err := db.LocalAuthentication("test_namespace", "", + "", "1234567890") if err != nil { t.Errorf("Failed LocalAuthentication based on username and namespace") } fmt.Println(accountByPhone) - accountByAll, err := db.LocalAuthentication("test_namespace", "testuser", "test@test.com", "1234567890") + accountByAll, err := db.LocalAuthentication("test_namespace", "testuser", + "test@test.com", "1234567890") if err != nil { t.Errorf("Failed LocalAuthentication based on username and namespace") } From 6ea35de5ddbe577114995feb3ae5e2dcf8282d92 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Fri, 28 Apr 2023 07:53:46 +0200 Subject: [PATCH 012/340] json bson for validated field --- storage/accounts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/accounts.go b/storage/accounts.go index 09fbc06..2a6a256 100755 --- a/storage/accounts.go +++ b/storage/accounts.go @@ -23,6 +23,6 @@ type LocalAuth struct { } type Validation struct { - Validated bool + Validated bool `json:"validated" bson:"validated"` ValidationCode string `json:"validation_code" bson:"validation_code"` } From 6f170a30f3d5c19c3dcad27f2f9f1df9dde382b0 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Fri, 28 Apr 2023 07:54:34 +0200 Subject: [PATCH 013/340] adding the table creations and data insertion queries --- storage/postgresql_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index e0bdd95..6393847 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -11,6 +11,40 @@ import ( ) // Tests must be run in order +// Table creation: +/* ##################################################################################################################### +CREATE TABLE accounts ( + id TEXT PRIMARY KEY, + namespace TEXT, + data JSONB, + metadata JSONB +); + +CREATE TABLE account_auth ( + account_id TEXT PRIMARY KEY, + username TEXT, + password TEXT, + email TEXT, + email_validation JSONB, + phone_number TEXT, + phone_number_validation JSONB, + FOREIGN KEY (account_id) REFERENCES accounts(id) +); +####################################################################################################################### +*/ +/* Inserting an Account: (Password = test) +####################################################################################################################### +INSERT INTO accounts (id, namespace, data, metadata) +VALUES ('2faa137b-27be-476f-b98c-8b7eed6f1f3a', 'parcoursmob', '{"email": "salimbouaram12@gmail.com", "gender": "9", +"groups": ["483280d0-db2d-4f06-b361-02e4be5012d2", "483280d0-db2d-4f06-b361-02e4be5012d2:admin"], "last_name": "salim", +"first_name": "salim", "display_name": "salim salim", "phone_number": ""}', '{"created": "2023-04-24T09:29:18.262+00:00"}'); +####################################################################################################################### +INSERT INTO account_auth (account_id, username, password, email, email_validation, phone_number, phone_number_validation) +VALUES ('2faa137b-27be-476f-b98c-8b7eed6f1f3a', 'salim-amine.bou-aram@coopgo.fr', +'$2a$10$j9LwkGYT6HhLpWxUvpEniOJ3nBKEhwAn52G.t4QYMgje4HnJuWqHK', 'salim-amine.bou-aram@coopgo.fr', +'{"validated": false, "validation_code": ""}', '0749331953', '{"validated": false, "validation_code": ""}'); +####################################################################################################################### +*/ var cfg *viper.Viper From 857c74ac1b7a8ed4bd1a577071a39006878587d4 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Fri, 28 Apr 2023 08:42:20 +0200 Subject: [PATCH 014/340] logo --- storage/postgresql.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storage/postgresql.go b/storage/postgresql.go index 72d8a5d..ea9ffed 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -1,3 +1,11 @@ +/*////////////////////////////////// + ___ ___ ___ _ __ __ _ ___ + / __/ _ \ / _ \| '_ \ / _` |/ _ \ +| (_| (_) | (_) | |_) | (_| | (_) | + \___\___/ \___/| .__/ \__, |\___/ + | | __/ | + |_| |___/ +*/ ////////////////////////////////// package storage import ( From 3e5ccce0ba2b402b27ec16cfb1063c73399cc4f9 Mon Sep 17 00:00:00 2001 From: sbouaram Date: Fri, 28 Apr 2023 08:44:29 +0200 Subject: [PATCH 015/340] logo --- storage/postgresql.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index ea9ffed..47beb70 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -1,11 +1,12 @@ -/*////////////////////////////////// +/* ___ ___ ___ _ __ __ _ ___ / __/ _ \ / _ \| '_ \ / _` |/ _ \ | (_| (_) | (_) | |_) | (_| | (_) | \___\___/ \___/| .__/ \__, |\___/ | | __/ | |_| |___/ -*/ ////////////////////////////////// +*/ + package storage import ( From c6ba00b74f4e26cfb046ec289ebafdc971a74249 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Tue, 2 May 2023 00:34:33 +0200 Subject: [PATCH 016/340] Extend PostgreSQL implementation and unit tests on MongoDB storage --- README.md | 11 +- config.go | 11 + go.mod | 25 +- go.sum | 149 ++-------- grpcapi/accounts.go | 14 +- grpcapi/accounts.pb.go | 93 +++--- grpcapi/accounts.proto | 13 +- grpcapi/comasvc.pb.go | 2 +- grpcapi/comasvc_grpc.pb.go | 2 +- handlers/accounts.go | 48 +-- storage/accounts.go | 14 +- storage/mongodb.go | 13 +- storage/mongodb_test.go | 118 ++++++++ storage/postgresql.go | 533 ++++++++++++++++++---------------- storage/postgresql/schema.hcl | 81 ++++++ storage/postgresql_test.go | 418 +++++++++----------------- storage/storage.go | 10 +- storage/storage_test.go | 67 +++++ 18 files changed, 870 insertions(+), 752 deletions(-) create mode 100644 storage/mongodb_test.go create mode 100644 storage/postgresql/schema.hcl create mode 100644 storage/storage_test.go diff --git a/README.md b/README.md index 1438427..3a59281 100755 --- a/README.md +++ b/README.md @@ -130,8 +130,17 @@ The OIDC provider needs [Etcd v3](https://etcd.io/) (see below for storage consi COOPGO Mobility Accounts supports the following databases for storage : - [x] MongoDB +- [x] PostgreSQL -Feel free to contribute any other storage option. +#### SQL schema + +SQL schema for PostgreSQL is available from file `storage/postgresql/schema.hcl` in the [atlasgo Data Definition Language](https://atlasgo.io/getting-started) format + +To set your development DB with this schema easily, you can simply use atlasgo CLI : + +``` +atlas schema apply --url "postgresql://username:password@localhost:5432/coopgo_platform?sslmode=disable" +``` ### OpenID Connect provider diff --git a/config.go b/config.go index df563e8..83a099e 100755 --- a/config.go +++ b/config.go @@ -21,6 +21,17 @@ func ReadConfig() (*viper.Viper, error) { "users": "users", }, }, + "psql": map[string]any{ + "host": "localhost", + "port": "5432", + "dbname": "coopgo_platform", + "sslmode": "disable", + "schema": "mobilityaccounts", + "tables": map[string]any{ + "accounts": "accounts", + "accounts_auth_local": "accounts_auth_local", + }, + }, }, "kv": map[string]any{ "type": "etcd", diff --git a/go.mod b/go.mod index 468d1d8..6f936e8 100755 --- a/go.mod +++ b/go.mod @@ -3,9 +3,11 @@ module git.coopgo.io/coopgo-platform/mobility-accounts go 1.18 require ( + ariga.io/atlas v0.10.1 github.com/google/uuid v1.3.0 github.com/gorilla/csrf v1.7.1 github.com/gorilla/mux v1.8.0 + github.com/hashicorp/hcl/v2 v2.16.2 github.com/lib/pq v1.10.2 github.com/mitchellh/mapstructure v1.5.0 github.com/ory/fosite v0.42.2 @@ -20,31 +22,28 @@ require ( ) require ( + github.com/agext/levenshtein v1.2.1 // indirect + github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgraph-io/ristretto v0.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-stack/stack v1.8.0 // indirect + github.com/go-openapi/inflect v0.19.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.1 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/gorilla/securecookie v1.1.1 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgconn v1.14.0 // indirect - github.com/jackc/pgio v1.0.0 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.3.2 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect - github.com/jackc/pgtype v1.14.0 // indirect - github.com/jackc/pgx/v4 v4.18.1 // indirect github.com/klauspost/compress v1.13.6 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/goveralls v0.0.6 // indirect + github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect github.com/ory/go-acc v0.2.6 // indirect @@ -55,16 +54,20 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/afero v1.9.3 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/cobra v1.0.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/testify v1.8.2 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.1 // indirect github.com/xdg-go/stringprep v1.0.3 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + github.com/zclconf/go-cty v1.12.1 // indirect go.etcd.io/etcd/api/v3 v3.5.6 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.6 // indirect go.uber.org/atomic v1.9.0 // indirect @@ -73,8 +76,8 @@ require ( golang.org/x/net v0.6.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect - golang.org/x/tools v0.1.12 // indirect + golang.org/x/text v0.8.0 // indirect + golang.org/x/tools v0.6.0 // indirect google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index f290c5a..1111776 100755 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +ariga.io/atlas v0.10.1 h1:zub8+r1P4OqUYoDl6AgUxqPRwl8A9oeI5q3LucfsnUE= +ariga.io/atlas v0.10.1/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk= bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -42,10 +44,10 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DataDog/datadog-go v4.0.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= @@ -56,6 +58,8 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= +github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/ajg/form v0.0.0-20160822230020-523a5da1a92f/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -64,6 +68,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= @@ -73,6 +79,7 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0 github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -94,11 +101,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= github.com/cockroachdb/cockroach-go v0.0.0-20190925194419-606b3d062051/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= @@ -158,7 +161,6 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -169,8 +171,6 @@ github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzP github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -199,6 +199,8 @@ github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= github.com/go-openapi/errors v0.20.0/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= +github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= +github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= @@ -244,8 +246,8 @@ github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbN github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/attrs v0.1.0/go.mod h1:fmNpaWyHM0tRm8gCZWKx8yY9fvaNLo2PyzBNSrBZ5Hw= github.com/gobuffalo/buffalo v0.12.8-0.20181004233540-fac9bb505aa8/go.mod h1:sLyT7/dceRXJUxSsE813JTQtA3Eb1vjxWfo/N//vXIY= @@ -497,7 +499,6 @@ github.com/gobuffalo/x v0.0.0-20181007152206-913e47c59ca7/go.mod h1:9rDPXaB3kXdK github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.1.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid/v3 v3.1.2/go.mod h1:xPwMqoocQ1L5G6pXX5BcE7N5jlzn2o19oqAKxwZW/kI= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -555,9 +556,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -614,16 +614,16 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/hcl/v2 v2.16.2 h1:mpkHZh/Tv+xet3sy3F9Ld4FyI2tUpWe9x3XtPx9f1a0= +github.com/hashicorp/hcl/v2 v2.16.2/go.mod h1:JRmR89jycNkrrqnMmvPDMd56n1rQJ2Q6KocSLCMCXng= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inhies/go-bytesize v0.0.0-20201103132853-d0aed0d254f8/go.mod h1:KrtyD5PFj++GKkFS/7/RRrfnRhAMGQwy75GLCHWrCNs= -github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= -github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ= github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= @@ -632,19 +632,9 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU github.com/jackc/pgconn v1.3.2/go.mod h1:LvCquS3HbBKwgl7KbX9KyqEIumJAbm1UMcTvGaIf3bM= github.com/jackc/pgconn v1.5.0/go.mod h1:QeD3lBfpTFe8WUnPZWN5KY/mB8FGMIYRdd8P8Jr0fAI= github.com/jackc/pgconn v1.6.0/go.mod h1:yeseQo4xhQbgyJs2c87RAXOH2i624N0Fh1KSPJya7qo= -github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= -github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= -github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q= -github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= -github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= -github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= -github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= @@ -652,38 +642,22 @@ github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvW github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgproto3/v2 v2.0.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= -github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= -github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200307190119-3430c5407db8/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= github.com/jackc/pgtype v1.2.0/go.mod h1:5m2OfMh1wTK7x+Fk952IDmI4nw3nPrvtQdM0ZT4WpC0= github.com/jackc/pgtype v1.3.0/go.mod h1:b0JqxHvPmljG+HQ5IsvQ0yqeSi4nGcDTVjFoiLDb0Ik= -github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= -github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= -github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= github.com/jackc/pgx v3.2.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= -github.com/jackc/pgx v3.6.2+incompatible h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o= github.com/jackc/pgx v3.6.2+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I= github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= github.com/jackc/pgx/v4 v4.4.1/go.mod h1:6iSW+JznC0YT+SgBn7rNxoEBsBgSmnC5FwyCekOGUiE= github.com/jackc/pgx/v4 v4.6.0/go.mod h1:vPh43ZzxijXUVJ+t/EmXBtFmbFVO72cuneCT9oAlxAg= -github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= -github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= -github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jandelgado/gcov2lcov v1.0.4-0.20210120124023-b83752c6dc08/go.mod h1:NnSxK6TMlg1oGDBfGelGbjgorT5/L3cchlbtgFYZSss= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= @@ -739,11 +713,11 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -753,8 +727,6 @@ github.com/luna-duclos/instrumentedsql v1.1.3/go.mod h1:9J1njvFds+zN7y85EDhN9XNQ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -808,6 +780,8 @@ github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00v github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.0.0/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -832,7 +806,7 @@ github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= +github.com/oleiade/reflections v1.0.0/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -898,8 +872,6 @@ github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAv github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= @@ -972,9 +944,9 @@ github.com/segmentio/go-snakecase v1.1.0/go.mod h1:jk1miR5MS7Na32PZUykG89Arm+1BU github.com/segmentio/objconv v1.0.1/go.mod h1:auayaH5k3137Cl4SoXTgrzQcuQDmvuVtZgS0fb1Ahys= github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= @@ -1005,8 +977,6 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.2.0/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.2/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= @@ -1034,8 +1004,6 @@ github.com/spf13/viper v1.2.1/go.mod h1:P4AexN0a+C9tGAnUFNwDMYYZv3pjFuvmeiMyKRaN github.com/spf13/viper v1.3.1/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= github.com/sqs/goreturns v0.0.0-20181028201513-538ac6014518/go.mod h1:CKI4AZ4XmGV240rTHfO0hfE83S6/a3/Q1siZJ/vXf7A= @@ -1045,6 +1013,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1052,15 +1021,14 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.1.1/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/tidwall/gjson v1.3.2/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= @@ -1088,12 +1056,8 @@ github.com/unrolled/secure v0.0.0-20181005190816-ff9db2ff917f/go.mod h1:mnPT77IA github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= @@ -1109,7 +1073,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zclconf/go-cty v1.12.1 h1:PcupnljUm9EIvbgSHQnHhUr3fO6oFmkOrvs2BAFNXXY= +github.com/zclconf/go-cty v1.12.1/go.mod h1:s9IfD1LK5ccNMSWCVFCE2rJfHiZgi7JijgeWIMfhLvA= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.elastic.co/apm v1.8.0/go.mod h1:tCw6CkOJgkWnzEthFN9HUP1uL3Gjc/Ur6m7gRPLaoH0= @@ -1117,24 +1082,16 @@ go.elastic.co/apm/module/apmhttp v1.8.0/go.mod h1:9LPFlEON51/lRbnWDfqAWErihIiAFD go.elastic.co/apm/module/apmot v1.8.0/go.mod h1:Q5Xzabte8G/fkvDjr1jlDuOSUt9hkVWNZEHh6ZNaTjI= go.elastic.co/fastjson v1.0.0/go.mod h1:PmeUOMMtLHQr9ZS9J9owrAVg0FkaZDRZJEFTTGHtchs= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/api/v3 v3.5.6 h1:Cy2qx3npLcYqTKqGJzMypnMv2tiRyifZJ17BlWIWA7A= go.etcd.io/etcd/api/v3 v3.5.6/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8= -go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.6 h1:TXQWYceBKqLp4sa87rcPs11SXxUA/mHwH975v+BDvLU= go.etcd.io/etcd/client/pkg/v3 v3.5.6/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ= -go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= go.etcd.io/etcd/client/v3 v3.5.6 h1:coLs69PWCXE9G4FKquzNaSHrRyMCAXwF+IX1tAPVO8E= go.etcd.io/etcd/client/v3 v3.5.6/go.mod h1:f6GRinRMCsFVv9Ht42EyY7nfsVGwrNO0WEoS2pRKzQk= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= -go.mongodb.org/mongo-driver v1.9.1 h1:m078y9v7sBItkt1aaoe2YlvWEXcD263e1a4E1fBrJ1c= -go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.mongodb.org/mongo-driver v1.11.4 h1:4ayjakA013OdpGyL2K3ZqylTac/rMjrJOMZ1EHizXas= go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1153,26 +1110,18 @@ go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXS go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= @@ -1213,14 +1162,8 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= @@ -1263,10 +1206,8 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180816102801-aaf60122140d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1321,9 +1262,6 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1336,7 +1274,6 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1349,10 +1286,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1438,17 +1372,11 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1457,10 +1385,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1520,7 +1447,6 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1529,7 +1455,6 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191224055732-dd894d0a8a40/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1562,18 +1487,16 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.2/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -1649,8 +1572,6 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef h1:uQ2vjV/sHTsWSqdKeLqmwitzgvjMl7o4IdtHwUDXSJY= google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1677,9 +1598,6 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/grpc/examples v0.0.0-20210304020650-930c79186c99/go.mod h1:Ly7ZA/ARzg8fnPU9TyZIxoz33sEUuWX7txiqs8lPTgE= @@ -1695,9 +1613,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/DataDog/dd-trace-go.v1 v1.27.0/go.mod h1:Sp1lku8WJMvNV0kjDI4Ni/T7J/U3BO5ct5kEaoVU8+I= @@ -1720,8 +1635,6 @@ gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:a gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= -gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mail.v2 v2.0.0-20180731213649-a0242b2233b4/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= @@ -1747,8 +1660,6 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= diff --git a/grpcapi/accounts.go b/grpcapi/accounts.go index 1a6ac68..e28c188 100755 --- a/grpcapi/accounts.go +++ b/grpcapi/accounts.go @@ -10,9 +10,10 @@ import ( ) func (a Account) ToStorageType() storage.Account { - var localauth storage.LocalAuth + var localauth *storage.LocalAuth if a.Authentication != nil && a.Authentication.Local != nil { - localauth = a.Authentication.Local.ToStorageType() + la := a.Authentication.Local.ToStorageType() + localauth = &la } account := storage.Account{ ID: a.Id, @@ -42,12 +43,12 @@ func (lc LocalAuth) ToStorageType() storage.LocalAuth { Username: lc.Username, Password: lc.Password, Email: lc.Email, - EmailValidation: storage.Validation{ + EmailValidation: &storage.Validation{ Validated: lc.EmailValidation.Validated, ValidationCode: lc.EmailValidation.ValidationCode, }, PhoneNumber: lc.PhoneNumber, - PhoneNumberValidation: storage.Validation{ + PhoneNumberValidation: &storage.Validation{ Validated: lc.PhoneNumberValidation.Validated, ValidationCode: lc.PhoneNumberValidation.ValidationCode, }, @@ -55,7 +56,10 @@ func (lc LocalAuth) ToStorageType() storage.LocalAuth { } func AccountFromStorageType(account *storage.Account) (*Account, error) { - lc := LocalAuthFromStorageType(account.Authentication.Local) + var lc *LocalAuth + if account.Authentication.Local != nil { + lc = LocalAuthFromStorageType(*account.Authentication.Local) + } d, err := sanitizeData(account.Data) if err != nil { diff --git a/grpcapi/accounts.pb.go b/grpcapi/accounts.pb.go index 3c35093..c223f42 100755 --- a/grpcapi/accounts.pb.go +++ b/grpcapi/accounts.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v3.19.6 // source: accounts.proto package grpcapi @@ -97,7 +97,7 @@ type AccountAuth struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Local *LocalAuth `protobuf:"bytes,7,opt,name=local,proto3" json:"local,omitempty"` + Local *LocalAuth `protobuf:"bytes,7,opt,name=local,proto3,oneof" json:"local,omitempty"` //TODO SSO } func (x *AccountAuth) Reset() { @@ -144,12 +144,12 @@ type LocalAuth struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Username string `protobuf:"bytes,10,opt,name=username,proto3" json:"username,omitempty"` + Username *string `protobuf:"bytes,10,opt,name=username,proto3,oneof" json:"username,omitempty"` Password string `protobuf:"bytes,11,opt,name=password,proto3" json:"password,omitempty"` - Email string `protobuf:"bytes,12,opt,name=email,proto3" json:"email,omitempty"` - PhoneNumber string `protobuf:"bytes,13,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` - EmailValidation *Validation `protobuf:"bytes,14,opt,name=email_validation,json=emailValidation,proto3" json:"email_validation,omitempty"` - PhoneNumberValidation *Validation `protobuf:"bytes,15,opt,name=phone_number_validation,json=phoneNumberValidation,proto3" json:"phone_number_validation,omitempty"` + Email *string `protobuf:"bytes,12,opt,name=email,proto3,oneof" json:"email,omitempty"` + PhoneNumber *string `protobuf:"bytes,13,opt,name=phone_number,json=phoneNumber,proto3,oneof" json:"phone_number,omitempty"` + EmailValidation *Validation `protobuf:"bytes,14,opt,name=email_validation,json=emailValidation,proto3,oneof" json:"email_validation,omitempty"` + PhoneNumberValidation *Validation `protobuf:"bytes,15,opt,name=phone_number_validation,json=phoneNumberValidation,proto3,oneof" json:"phone_number_validation,omitempty"` } func (x *LocalAuth) Reset() { @@ -185,8 +185,8 @@ func (*LocalAuth) Descriptor() ([]byte, []int) { } func (x *LocalAuth) GetUsername() string { - if x != nil { - return x.Username + if x != nil && x.Username != nil { + return *x.Username } return "" } @@ -199,15 +199,15 @@ func (x *LocalAuth) GetPassword() string { } func (x *LocalAuth) GetEmail() string { - if x != nil { - return x.Email + if x != nil && x.Email != nil { + return *x.Email } return "" } func (x *LocalAuth) GetPhoneNumber() string { - if x != nil { - return x.PhoneNumber + if x != nil && x.PhoneNumber != nil { + return *x.PhoneNumber } return "" } @@ -296,35 +296,44 @@ var file_accounts_proto_rawDesc = []byte{ 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, - 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2f, 0x0a, 0x0b, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x12, 0x20, 0x0a, 0x05, 0x6c, 0x6f, + 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3e, 0x0a, 0x0b, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x75, 0x74, 0x68, 0x12, 0x25, 0x0a, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x41, 0x75, 0x74, 0x68, 0x52, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x22, 0xf9, 0x01, 0x0a, - 0x09, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, - 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x36, 0x0a, 0x10, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x17, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0f, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x15, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x53, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x39, 0x5a, - 0x37, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, - 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x6d, - 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x41, 0x75, 0x74, 0x68, 0x48, 0x00, 0x52, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x88, 0x01, + 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x22, 0xeb, 0x02, 0x0a, 0x09, + 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x41, 0x75, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, + 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, + 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x10, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x03, 0x52, 0x0f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x48, 0x0a, 0x17, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x04, 0x52, 0x15, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, + 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, + 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x70, 0x68, 0x6f, 0x6e, + 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x1a, 0x0a, + 0x18, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x53, 0x0a, 0x0a, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x39, + 0x5a, 0x37, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, + 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, + 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -415,6 +424,8 @@ func file_accounts_proto_init() { } } } + file_accounts_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_accounts_proto_msgTypes[2].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/grpcapi/accounts.proto b/grpcapi/accounts.proto index 0291280..b8dceb3 100755 --- a/grpcapi/accounts.proto +++ b/grpcapi/accounts.proto @@ -12,16 +12,17 @@ message Account { } message AccountAuth { - LocalAuth local = 7; + optional LocalAuth local = 7; + //TODO SSO } message LocalAuth { - string username = 10; + optional string username = 10; string password = 11; - string email = 12; - string phone_number = 13; - Validation email_validation = 14; - Validation phone_number_validation = 15; + optional string email = 12; + optional string phone_number = 13; + optional Validation email_validation = 14; + optional Validation phone_number_validation = 15; } message Validation { diff --git a/grpcapi/comasvc.pb.go b/grpcapi/comasvc.pb.go index fb73b45..8a08b59 100755 --- a/grpcapi/comasvc.pb.go +++ b/grpcapi/comasvc.pb.go @@ -3,7 +3,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc v3.19.6 // source: comasvc.proto package grpcapi diff --git a/grpcapi/comasvc_grpc.pb.go b/grpcapi/comasvc_grpc.pb.go index 4e68b0c..518f392 100755 --- a/grpcapi/comasvc_grpc.pb.go +++ b/grpcapi/comasvc_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.19.4 +// - protoc v3.19.6 // source: comasvc.proto package grpcapi diff --git a/handlers/accounts.go b/handlers/accounts.go index 815a8d7..436cc89 100755 --- a/handlers/accounts.go +++ b/handlers/accounts.go @@ -17,7 +17,8 @@ func (h MobilityAccountsHandler) Login(username string, password string, namespa if password == "" { return nil, errors.New("empty password not allowed") } - account, err := h.storage.DB.LocalAuthentication(namespace, strings.ToLower(username), "", "") + u := strings.ToLower(username) + account, err := h.storage.DB.LocalAuthentication(namespace, &u, nil, nil) if err != nil { return nil, err } @@ -33,25 +34,34 @@ func (h MobilityAccountsHandler) Register(account storage.Account) (*storage.Acc return nil, errors.New("id should be empty") } - account.Authentication.Local.Username = strings.ToLower(account.Authentication.Local.Username) - account.Authentication.Local.Email = strings.ToLower(account.Authentication.Local.Email) - - _, err := h.storage.DB.LocalAuthentication(account.Namespace, account.Authentication.Local.Username, account.Authentication.Local.Email, account.Authentication.Local.PhoneNumber) - - if err == nil { - return nil, errors.New("user already exists") - } - // Generate new UUID account.ID = uuid.NewString() - // If a password was sent, hash the password - if account.Authentication.Local.Password != "" { - hashedPassword, err := bcrypt.GenerateFromPassword([]byte(account.Authentication.Local.Password), bcrypt.DefaultCost) - if err != nil { - return nil, err + if account.Authentication.Local != nil && account.Authentication.Local.Username != nil { + username := strings.ToLower(*account.Authentication.Local.Username) + account.Authentication.Local.Username = &username + } + if account.Authentication.Local != nil && account.Authentication.Local.Email != nil { + email := strings.ToLower(*account.Authentication.Local.Email) + account.Authentication.Local.Username = &email + } + + //TODO remove this as we want to handle unicity in storage + if account.Authentication.Local != nil { + // If a password was sent, hash the password + if account.Authentication.Local.Password != "" { + hashedPassword, err := bcrypt.GenerateFromPassword([]byte(account.Authentication.Local.Password), bcrypt.DefaultCost) + if err != nil { + return nil, err + } + account.Authentication.Local.Password = string(hashedPassword) + } + + _, err := h.storage.DB.LocalAuthentication(account.Namespace, account.Authentication.Local.Username, account.Authentication.Local.Email, account.Authentication.Local.PhoneNumber) + + if err == nil { + return nil, errors.New("user already exists") } - account.Authentication.Local.Password = string(hashedPassword) } // Validate data schemas @@ -131,13 +141,13 @@ func (h MobilityAccountsHandler) UpdatePhoneNumber(accountid, phone_number strin return err } - account2, err := h.storage.DB.LocalAuthentication(account.Namespace, "", "", phone_number) + account2, err := h.storage.DB.LocalAuthentication(account.Namespace, nil, nil, &phone_number) if err == nil && account.ID != account2.ID { return errors.New("user with this phone number already exists") } - account.Authentication.Local.PhoneNumber = phone_number + account.Authentication.Local.PhoneNumber = &phone_number account.Authentication.Local.PhoneNumberValidation.Validated = verified account.Authentication.Local.PhoneNumberValidation.ValidationCode = verification_code @@ -155,7 +165,7 @@ func (h MobilityAccountsHandler) GetAccount(id string) (account *storage.Account } func (h MobilityAccountsHandler) GetAccountUsername(username string, namespace string) (account *storage.Account, err error) { - account, err = h.storage.DB.LocalAuthentication(namespace, username, "", "") + account, err = h.storage.DB.LocalAuthentication(namespace, &username, nil, nil) return } diff --git a/storage/accounts.go b/storage/accounts.go index 2a6a256..7f1017d 100755 --- a/storage/accounts.go +++ b/storage/accounts.go @@ -9,17 +9,17 @@ type Account struct { } type AccountAuth struct { - Local LocalAuth + Local *LocalAuth `bson:"local,omitempty"` //TODO handle SSO } type LocalAuth struct { - Username string `json:"username"` - Password string `json:"password"` - Email string `json:"email"` - EmailValidation Validation `json:"email_validation" bson:"email_validation"` - PhoneNumber string `json:"phone_number" bson:"phone_number"` - PhoneNumberValidation Validation `json:"phone_number_validation" bson:"phone_number_validation"` + Username *string `json:"username" bson:"username,omitempty"` + Password string `json:"password" bson:"password"` + Email *string `json:"email" bson:"email,omitempty"` + EmailValidation *Validation `json:"email_validation" bson:"email_validation,omitempty"` + PhoneNumber *string `json:"phone_number" bson:"phone_number,omitempty"` + PhoneNumberValidation *Validation `json:"phone_number_validation" bson:"phone_number_validation,omitempty"` } type Validation struct { diff --git a/storage/mongodb.go b/storage/mongodb.go index 3b543e5..70a5896 100755 --- a/storage/mongodb.go +++ b/storage/mongodb.go @@ -65,20 +65,20 @@ func NewMongoDBStorage(cfg *viper.Viper) (MongoDBStorage, error) { // If username, is provided (not an empty string), it will search by username only // If username is an empty string and email is provided, it will search by email // If both username and email are empty strings, phone_number must be provided and it will search by phone number -func (s MongoDBStorage) LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error) { +func (s MongoDBStorage) LocalAuthentication(namespace string, username *string, email *string, phone_number *string) (*Account, error) { collection := s.Client.Database(s.DbName).Collection(s.Collections["users"]) account := &Account{} - if username != "" { + if username != nil { if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.username": username}).Decode(account); err != nil { return nil, err } - } else if email != "" { + } else if email != nil { if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.email": email}).Decode(account); err != nil { return nil, err } - } else if phone_number != "" { + } else if phone_number != nil { if err := collection.FindOne(context.TODO(), bson.M{"namespace": namespace, "authentication.local.phone_number": phone_number}).Decode(account); err != nil { return nil, err } @@ -191,3 +191,8 @@ func (s MongoDBStorage) UpdateAccount(account Account) error { return nil } + +func (s MongoDBStorage) Migrate() error { + fmt.Println("no migration") + return nil +} diff --git a/storage/mongodb_test.go b/storage/mongodb_test.go new file mode 100644 index 0000000..71883c2 --- /dev/null +++ b/storage/mongodb_test.go @@ -0,0 +1,118 @@ +package storage + +import ( + "testing" + + "github.com/google/uuid" + "github.com/spf13/viper" + "github.com/stretchr/testify/require" +) + +var cfg2 *viper.Viper + +func init() { + cfg2 = viper.New() + cfg2.SetDefault("storage.db.mongodb.host", "localhost") + cfg2.SetDefault("storage.db.mongodb.port", "27017") + cfg2.SetDefault("storage.db.mongodb.user", "mongodb") + cfg2.SetDefault("storage.db.mongodb.db_name", "mobilityaccounts_tests") + cfg2.SetDefault("storage.db.mongodb.sslmode", "disable") + cfg2.SetDefault("storage.db.mongodb.collections.users", "users") + cfg2.SetConfigName("config") // Define values in config.yaml + cfg2.AddConfigPath(".") + cfg2.ReadInConfig() +} + +func TestMongoDBStorage_CreateAndGetAccount(t *testing.T) { + db, err := NewMongoDBStorage(cfg2) + require.NoError(t, err) + err = db.CreateAccount(account1) + require.NoError(t, err) + + result, err := db.GetAccount(account1.ID) + require.NoError(t, err) + + require.Equal(t, &account1, result) +} +func TestMongoDBStorage_CreateAndGetAccountNoAuth(t *testing.T) { + db, err := NewMongoDBStorage(cfg2) + require.NoError(t, err) + + err = db.CreateAccount(account3) + require.NoError(t, err) + + result, err := db.GetAccount(account3.ID) + require.NoError(t, err) + + require.Equal(t, &account3, result) +} + +func TestMongoDBStorage_UpdateAccount(t *testing.T) { + db, err := NewMongoDBStorage(cfg2) + require.NoError(t, err) + + err = db.CreateAccount(account2) + require.NoError(t, err) + + modified := account2 + modified.Authentication.Local.Email = Ptr("modifiedtest@test.com") + modified.Data["key1"] = "modeifiedvalue" + modified.Data["addedkey"] = "addedvalue" + modified.Metadata["addedmetadatakey"] = "addedmetadatavalue" + err = db.UpdateAccount(modified) + require.NoError(t, err) + + result, err := db.GetAccount(account2.ID) + require.NoError(t, err) + + require.Equal(t, &modified, result) +} + +func TestMongoDBStorage_LocalAuthentication(t *testing.T) { + db, err := NewMongoDBStorage(cfg2) + require.NoError(t, err) + + _, err = db.LocalAuthentication(account1.Namespace, account1.Authentication.Local.Username, nil, nil) + require.NoError(t, err) + + _, err = db.LocalAuthentication(account1.Namespace, nil, account1.Authentication.Local.Email, nil) + require.NoError(t, err) + + _, err = db.LocalAuthentication(account1.Namespace, nil, nil, account1.Authentication.Local.PhoneNumber) + require.NoError(t, err) +} + +func TestMongoDBStorage_GetAccounts(t *testing.T) { + db, err := NewMongoDBStorage(cfg2) + require.NoError(t, err) + + accounts, err := db.GetAccounts([]string{account1.Namespace, account3.Namespace}) + require.NoError(t, err) + + for _, account := range accounts { + require.Contains(t, []string{account1.Namespace, account3.Namespace}, account.Namespace) + } +} + +func TestMongoDBsqlStorage_GetAccountsByIds(t *testing.T) { + db, err := NewMongoDBStorage(cfg2) + require.NoError(t, err) + + accounts, err := db.GetAccountsByIds([]string{account2.ID, account3.ID}) + require.NoError(t, err) + + for _, account := range accounts { + require.Contains(t, []string{account2.ID, account3.ID}, account.ID) + } +} + +func TestMongoDBStorage_CreateAlreadyExistingCredentials(t *testing.T) { + db, err := NewMongoDBStorage(cfg2) + require.NoError(t, err) + + modified := account1 + modified.ID = uuid.NewString() // Change the ID to make as if it was a new one + + err = db.CreateAccount(modified) + require.Error(t, err) +} diff --git a/storage/postgresql.go b/storage/postgresql.go index 47beb70..77e8042 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -1,39 +1,40 @@ -/* - ___ ___ ___ _ __ __ _ ___ - / __/ _ \ / _ \| '_ \ / _` |/ _ \ -| (_| (_) | (_) | |_) | (_| | (_) | - \___\___/ \___/| .__/ \__, |\___/ - | | __/ | - |_| |___/ -*/ - package storage import ( + "context" "database/sql" "encoding/json" "fmt" - _ "github.com/lib/pq" - "github.com/spf13/viper" + "os" "strconv" "strings" + + "ariga.io/atlas/sql/postgres" + "ariga.io/atlas/sql/schema" + "github.com/lib/pq" + _ "github.com/lib/pq" + "github.com/spf13/viper" ) type PostgresqlStorage struct { DbConnection *sql.DB + Tables map[string]string } func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { var ( - host = cfg.GetString("storage.db.psql.host") - port = cfg.GetString("storage.db.psql.port") - user = cfg.GetString("storage.db.psql.user") - password = cfg.GetString("storage.db.psql.password") - dbname = cfg.GetString("storage.db.psql.dbname") + host = cfg.GetString("storage.db.psql.host") + port = cfg.GetString("storage.db.psql.port") + user = cfg.GetString("storage.db.psql.user") + password = cfg.GetString("storage.db.psql.password") + dbname = cfg.GetString("storage.db.psql.dbname") + sslmode = cfg.GetString("storage.db.psql.sslmode") + pg_schema = cfg.GetString("storage.db.psql.schema") + pgtables_accounts = cfg.GetString("storage.db.psql.tables.accounts") + pgtables_accounts_auth_local = cfg.GetString("storage.db.psql.tables.accounts_auth_local") ) portInt, _ := strconv.Atoi(port) - psqlconn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=disable", host, portInt, - user, password, dbname) + psqlconn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=%s", host, portInt, user, password, dbname, sslmode) db, err := sql.Open("postgres", psqlconn) if err != nil { fmt.Println("error", err) @@ -41,10 +42,15 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { } err = db.Ping() if err != nil { + fmt.Println(err) return PostgresqlStorage{}, fmt.Errorf("connection to postgresql database failed") } return PostgresqlStorage{ DbConnection: db, + Tables: map[string]string{ + "accounts": fmt.Sprintf("%s.%s", pg_schema, pgtables_accounts), + "accounts_auth_local": fmt.Sprintf("%s.%s", pg_schema, pgtables_accounts_auth_local), + }, }, nil } @@ -53,29 +59,91 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { data, metadata, emailValidation, phoneValidation []byte ) account := &Account{} - stmtAccounts, err := psql.DbConnection.Prepare("" + - "SELECT id, namespace, data, " + - "metadata, username, password, email, email_validation, " + - "phone_number, phone_number_validation FROM accounts a JOIN " + - "account_auth auth ON id = account_id WHERE id = $1") - if err != nil { - return nil, fmt.Errorf("psql connection failed") - } - defer stmtAccounts.Close() - err = stmtAccounts.QueryRow(id).Scan(&account.ID, + + var username, password, email, phonenumber *string + + req := fmt.Sprintf(`SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number, phone_number_validation + FROM %s a + LEFT JOIN %s auth ON id = account_id WHERE id = $1`, psql.Tables["accounts"], psql.Tables["accounts_auth_local"]) + err := psql.DbConnection.QueryRow(req, id).Scan(&account.ID, &account.Namespace, &data, &metadata, + &username, + &password, + &email, + &emailValidation, + &phonenumber, + &phoneValidation) + if err != nil { + return nil, fmt.Errorf("psql select account query failed : %s", err) + } + + err = json.Unmarshal(data, &account.Data) + if err != nil { + return nil, err + } + err = json.Unmarshal(metadata, &account.Metadata) + if err != nil { + return nil, err + } + + if password != nil || username != nil || email != nil || phonenumber != nil { + account.Authentication.Local = &LocalAuth{ + Username: username, + Password: *password, + Email: email, + PhoneNumber: phonenumber, + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } + } + + return account, nil +} + +func (psql PostgresqlStorage) LocalAuthentication(namespace string, username *string, email *string, phone_number *string) (*Account, error) { + account := &Account{} + var ( + data, metadata, emailValidation, phoneValidation []byte + ) + + requested_field := "" + requested_value := "" + if username != nil { + requested_field = "username" + requested_value = *username + } else if email != nil { + requested_field = "email" + requested_value = *email + } else if phone_number != nil { + requested_field = "phone_number" + requested_value = *phone_number + } else { + return nil, fmt.Errorf("localauthentication func error PSQL") + } + + req := fmt.Sprintf(`SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number, phone_number_validation + FROM %s INNER JOIN %s ON id = account_id + WHERE account_namespace = $1 AND %s = $2;`, psql.Tables["accounts"], psql.Tables["accounts_auth_local"], requested_field) + + account.Authentication.Local = &LocalAuth{} + err := psql.DbConnection.QueryRow(req, namespace, requested_value).Scan( + &account.ID, + &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, &account.Authentication.Local.Password, &account.Authentication.Local.Email, &emailValidation, &account.Authentication.Local.PhoneNumber, &phoneValidation) - if err != nil { - return nil, fmt.Errorf("psql select account query failed") - } - err = json.Unmarshal(data, &account.Data) + if err != nil { return nil, err } @@ -83,6 +151,10 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { if err != nil { return nil, err } + err = json.Unmarshal(data, &account.Data) + if err != nil { + return nil, err + } err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) if err != nil { return nil, err @@ -94,142 +166,15 @@ func (psql PostgresqlStorage) GetAccount(id string) (*Account, error) { return account, nil } -func (psql PostgresqlStorage) LocalAuthentication(namespace string, username string, email string, - phone_number string) (*Account, error) { - account := &Account{} - var ( - data, metadata, emailValidation, phoneValidation []byte - ) - if username != "" { - usernameStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, " + - "password, email, email_validation, phone_number, phone_number_validation " + - "FROM accounts INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE " + - "namespace = $1 AND username = $2;") - if err != nil { - return nil, err - } - err = usernameStmt.QueryRow(namespace, username).Scan( - &account.ID, - &account.Namespace, &data, &metadata, - &account.Authentication.Local.Username, - &account.Authentication.Local.Password, - &account.Authentication.Local.Email, - &emailValidation, &account.Authentication.Local.PhoneNumber, - &phoneValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(metadata, &account.Metadata) - if err != nil { - return nil, err - } - err = json.Unmarshal(data, &account.Data) - if err != nil { - return nil, err - } - err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return nil, err - } - return account, nil - } else if email != "" { - account.Authentication.Local.Email = email - emailStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, data, metadata, username, " + - "password, email_validation, phone_number, phone_number_validation " + - "FROM accounts INNER JOIN account_auth ON " + - "accounts.id = account_auth.account_id WHERE namespace = $1 AND email = $2;") - if err != nil { - return nil, err - } - err = emailStmt.QueryRow(namespace, email).Scan( - &account.ID, - &account.Namespace, - &data, &metadata, - &account.Authentication.Local.Username, - &account.Authentication.Local.Password, - &emailValidation, - &account.Authentication.Local.PhoneNumber, - &phoneValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(metadata, &account.Metadata) - if err != nil { - return nil, err - } - err = json.Unmarshal(data, &account.Data) - if err != nil { - return nil, err - } - err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return nil, err - } - return account, nil - } else if phone_number != "" { - account.Authentication.Local.PhoneNumber = phone_number - phoneStmt, err := psql.DbConnection.Prepare("SELECT id, namespace, " + - "data, metadata, username, password, email, " + - "email_validation, phone_number_validation FROM accounts " + - "INNER JOIN account_auth ON accounts.id = account_auth.account_id WHERE " + - "namespace = $1 AND phone_number = $2;") - if err != nil { - return nil, err - } - err = phoneStmt.QueryRow(namespace, phone_number).Scan(&account.ID, - &account.Namespace, - &data, - &metadata, - &account.Authentication.Local.Username, - &account.Authentication.Local.Password, - &account.Authentication.Local.Email, - &emailValidation, - &phoneValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(metadata, &account.Metadata) - if err != nil { - return nil, err - } - err = json.Unmarshal(data, &account.Data) - if err != nil { - return nil, err - } - err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return nil, err - } - return account, nil - } - return nil, fmt.Errorf("localauthentication func error PSQL") -} - func (psql PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error) { var accounts []Account namespacesStr := "'" + strings.Join(namespaces, "', '") + "'" query := ` - SELECT accounts.id, accounts.namespace, accounts.data, accounts.metadata, - account_auth.username, account_auth.password, - account_auth.email, account_auth.email_validation, - account_auth.phone_number, account_auth.phone_number_validation - FROM accounts - INNER JOIN account_auth ON accounts.id = account_auth.account_id - WHERE accounts.namespace IN (%s) + SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number, phone_number_validation + FROM %s LEFT JOIN %s ON id = account_id + WHERE namespace IN (%s) ` - query = fmt.Sprintf(query, namespacesStr) + query = fmt.Sprintf(query, psql.Tables["accounts"], psql.Tables["accounts_auth_local"], namespacesStr) rows, err := psql.DbConnection.Query(query) if err != nil { return nil, err @@ -239,19 +184,20 @@ func (psql PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error var account Account var dataBytes []byte var metadataBytes []byte - var emailValidationBytes []byte - var phoneNumberValidationBytes []byte + var emailValidation []byte + var phoneValidation []byte + var username, password, email, phonenumber *string err := rows.Scan( &account.ID, &account.Namespace, &dataBytes, &metadataBytes, - &account.Authentication.Local.Username, - &account.Authentication.Local.Password, - &account.Authentication.Local.Email, - &emailValidationBytes, - &account.Authentication.Local.PhoneNumber, - &phoneNumberValidationBytes, + &username, + &password, + &email, + &emailValidation, + &phonenumber, + &phoneValidation, ) if err != nil { return nil, err @@ -266,14 +212,22 @@ func (psql PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error if err != nil { return nil, err } - err = json.Unmarshal(emailValidationBytes, &account.Authentication.Local.EmailValidation) - if err != nil { - return nil, err - } - err = json.Unmarshal(phoneNumberValidationBytes, &account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return nil, err + if password != nil || username != nil || email != nil || phonenumber != nil { + account.Authentication.Local = &LocalAuth{ + Username: username, + Password: *password, + Email: email, + PhoneNumber: phonenumber, + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } } accounts = append(accounts, account) } @@ -282,18 +236,15 @@ func (psql PostgresqlStorage) GetAccounts(namespaces []string) ([]Account, error func (psql PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, error) { var accounts []Account - accountIdsStr := "'" + strings.Join(accountids, "', '") + "'" + query := ` - SELECT accounts.id, accounts.namespace, accounts.data, accounts.metadata, - account_auth.username, account_auth.password, - account_auth.email, account_auth.email_validation, - account_auth.phone_number, account_auth.phone_number_validation - FROM accounts - INNER JOIN account_auth ON accounts.id = account_auth.account_id - WHERE accounts.id IN (%s) + SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number, phone_number_validation + FROM %s + LEFT JOIN %s ON id = account_id + WHERE id = ANY ($1) ` - query = fmt.Sprintf(query, accountIdsStr) - rows, err := psql.DbConnection.Query(query) + query = fmt.Sprintf(query, psql.Tables["accounts"], psql.Tables["accounts_auth_local"]) //, accountIdsStr) + rows, err := psql.DbConnection.Query(query, pq.Array(accountids)) if err != nil { return nil, err } @@ -302,19 +253,21 @@ func (psql PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, var account Account var dataBytes []byte var metadataBytes []byte - var emailValidationBytes []byte - var phoneNumberValidationBytes []byte + var emailValidation []byte + var phoneValidation []byte + var username, password, email, phonenumber *string err := rows.Scan( &account.ID, &account.Namespace, &dataBytes, &metadataBytes, - &account.Authentication.Local.Username, - &account.Authentication.Local.Password, - &account.Authentication.Local.Email, - &emailValidationBytes, - &account.Authentication.Local.PhoneNumber, - &phoneNumberValidationBytes) + &username, + &password, + &email, + &emailValidation, + &phonenumber, + &phoneValidation, + ) if err != nil { return nil, err } @@ -329,14 +282,21 @@ func (psql PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, return nil, err } - err = json.Unmarshal(emailValidationBytes, &account.Authentication.Local.EmailValidation) - if err != nil { - return nil, err - } - - err = json.Unmarshal(phoneNumberValidationBytes, &account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return nil, err + if password != nil || username != nil || email != nil || phonenumber != nil { + account.Authentication.Local = &LocalAuth{ + Username: username, + Password: *password, + Email: email, + PhoneNumber: phonenumber, + } + err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) + if err != nil { + return nil, err + } + err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return nil, err + } } accounts = append(accounts, account) } @@ -344,11 +304,6 @@ func (psql PostgresqlStorage) GetAccountsByIds(accountids []string) ([]Account, } func (psql PostgresqlStorage) CreateAccount(account Account) error { - insertAccountStmt, err := psql.DbConnection.Prepare("INSERT INTO accounts (id, namespace, data, metadata)" + - " VALUES ($1, $2, $3, $4)") - if err != nil { - return err - } dataAccountJson, err := json.Marshal(account.Data) if err != nil { return err @@ -357,43 +312,67 @@ func (psql PostgresqlStorage) CreateAccount(account Account) error { if err != nil { return err } + + tx, err := psql.DbConnection.BeginTx(context.Background(), nil) + if err != nil { + return err + } + defer tx.Rollback() + + insertAccountStmt, err := tx.Prepare(fmt.Sprintf("INSERT INTO %s (id, namespace, data, metadata) VALUES ($1, $2, $3, $4)", psql.Tables["accounts"])) + if err != nil { + return err + } + defer insertAccountStmt.Close() _, err = insertAccountStmt.Exec(account.ID, account.Namespace, dataAccountJson, metadataAccountJson) if err != nil { return err } - insertAccountAuthStmt, err := psql.DbConnection.Prepare("INSERT INTO account_auth (account_id, username," + - " password, email, email_validation,phone_number,phone_number_validation) " + - "values($1, $2, $3, $4, $5, $6, $7)") - if err != nil { - return err + + if account.Authentication.Local != nil { + + emailValidationJson, err := json.Marshal(account.Authentication.Local.EmailValidation) + if err != nil { + return err + } + phoneValidationJson, err := json.Marshal(account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return err + } + insertAccountAuthStmt, err := tx.Prepare(fmt.Sprintf(`INSERT INTO %s (account_id, account_namespace, username, password, email, email_validation, phone_number, phone_number_validation) + VALUES($1, $2, $3, $4, $5, $6, $7, $8);`, psql.Tables["accounts_auth_local"])) + if err != nil { + return err + } + defer insertAccountAuthStmt.Close() + _, err = insertAccountAuthStmt.Exec(account.ID, + account.Namespace, + account.Authentication.Local.Username, + account.Authentication.Local.Password, + account.Authentication.Local.Email, + emailValidationJson, + account.Authentication.Local.PhoneNumber, + phoneValidationJson) + if err != nil { + return err + } + } - emailValidationJson, err := json.Marshal(account.Authentication.Local.EmailValidation) - if err != nil { - return err - } - phoneValidationJson, err := json.Marshal(account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return err - } - _, err = insertAccountAuthStmt.Exec(account.ID, - account.Authentication.Local.Username, - account.Authentication.Local.Password, - account.Authentication.Local.Email, - emailValidationJson, - account.Authentication.Local.PhoneNumber, - phoneValidationJson) - if err != nil { + + if err := tx.Commit(); err != nil { return err } return nil } func (psql PostgresqlStorage) UpdateAccount(account Account) error { - updateAccountStmt, err := psql.DbConnection.Prepare("update accounts set namespace=$1, data=$2, " + - " metadata=$3 where id= $4") + + tx, err := psql.DbConnection.BeginTx(context.Background(), nil) if err != nil { return err } + defer tx.Rollback() + dataAccountJson, err := json.Marshal(account.Data) if err != nil { return err @@ -402,33 +381,77 @@ func (psql PostgresqlStorage) UpdateAccount(account Account) error { if err != nil { return err } - _, err = updateAccountStmt.Exec(account.Namespace, dataAccountJson, metadataAccountJson, account.ID) + + req := fmt.Sprintf("UPDATE %s SET namespace=$1, data=$2, metadata=$3 where id= $4", psql.Tables["accounts"]) + _, err = tx.Exec(req, account.Namespace, dataAccountJson, metadataAccountJson, account.ID) if err != nil { return err } - updateAccountAuthStmt, err := psql.DbConnection.Prepare("update account_auth set username = $1," + - " password = $2," + - " email = $3, email_validation = $4 ," + - "phone_number = $5,phone_number_validation = $6 where account_id = $7") - if err != nil { - return err - } - emailValidationJson, err := json.Marshal(account.Authentication.Local.EmailValidation) - if err != nil { - return err - } - phoneValidationJson, err := json.Marshal(account.Authentication.Local.PhoneNumberValidation) - if err != nil { - return err - } - _, err = updateAccountAuthStmt.Exec(account.Authentication.Local.Username, - account.Authentication.Local.Password, - account.Authentication.Local.Email, - emailValidationJson, - account.Authentication.Local.PhoneNumber, - phoneValidationJson, account.ID) - if err != nil { + + if account.Authentication.Local != nil { + emailValidationJson, err := json.Marshal(account.Authentication.Local.EmailValidation) + if err != nil { + return err + } + phoneValidationJson, err := json.Marshal(account.Authentication.Local.PhoneNumberValidation) + if err != nil { + return err + } + + req = fmt.Sprintf(`UPDATE %s + SET username = $1, password = $2, email = $3, email_validation = $4, + phone_number = $5,phone_number_validation = $6 where account_id = $7`, psql.Tables["accounts_auth_local"]) + _, err = tx.Exec(req, account.Authentication.Local.Username, + account.Authentication.Local.Password, + account.Authentication.Local.Email, + emailValidationJson, + account.Authentication.Local.PhoneNumber, + phoneValidationJson, account.ID) + if err != nil { + return err + } + } + + if err := tx.Commit(); err != nil { return err } + + return nil +} + +func (psql PostgresqlStorage) Migrate() error { + ctx := context.Background() + driver, err := postgres.Open(psql.DbConnection) + if err != nil { + return err + } + + existing, err := driver.InspectRealm(ctx, nil) + if err != nil { + return err + } + + var desired schema.Realm + + hcl, err := os.ReadFile("postgresql/schema.hcl") + if err != nil { + return err + } + + err = postgres.EvalHCLBytes(hcl, &desired, nil) + if err != nil { + return err + } + + diff, err := driver.RealmDiff(existing, &desired) + if err != nil { + return err + } + + err = driver.ApplyChanges(ctx, diff) + if err != nil { + return err + } + return nil } diff --git a/storage/postgresql/schema.hcl b/storage/postgresql/schema.hcl new file mode 100644 index 0000000..969aeb7 --- /dev/null +++ b/storage/postgresql/schema.hcl @@ -0,0 +1,81 @@ +table "accounts" { + schema = schema.mobilityaccounts + column "id" { + null = false + type = uuid + } + column "namespace" { + null = true + type = text + } + column "data" { + null = true + type = jsonb + } + column "metadata" { + null = true + type = jsonb + } + primary_key { + columns = [column.id] + } +} +table "accounts_auth_local" { + schema = schema.mobilityaccounts + column "account_id" { + null = true + type = uuid + } + column "account_namespace" { + null = true + type = text + } + column "username" { + null = true + type = text + } + column "password" { + null = true + type = text + } + column "email" { + null = true + type = text + } + column "email_validation" { + null = true + type = jsonb + } + column "phone_number" { + null = true + type = text + } + column "phone_number_validation" { + null = true + type = jsonb + } + foreign_key "accounts_auth_local_account_id_fkey" { + columns = [column.account_id] + ref_columns = [table.accounts.column.id] + on_update = NO_ACTION + on_delete = NO_ACTION + } + index "accounts_auth_local_account_id_key" { + unique = true + columns = [column.account_id] + } + index "accounts_auth_local_idx_email" { + unique = true + columns = [column.account_namespace, column.email] + } + index "accounts_auth_local_idx_phone_number" { + unique = true + columns = [column.account_namespace, column.phone_number] + } + index "accounts_auth_local_idx_username" { + unique = true + columns = [column.account_namespace, column.username] + } +} +schema "mobilityaccounts" { +} diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index 6393847..7bdaed8 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -1,279 +1,141 @@ package storage import ( - "crypto/rand" - "encoding/hex" - "encoding/json" + "context" "fmt" - "github.com/spf13/viper" "reflect" "testing" + + "github.com/google/uuid" + _ "github.com/lib/pq" + "github.com/spf13/viper" ) -// Tests must be run in order -// Table creation: -/* ##################################################################################################################### -CREATE TABLE accounts ( - id TEXT PRIMARY KEY, - namespace TEXT, - data JSONB, - metadata JSONB -); - -CREATE TABLE account_auth ( - account_id TEXT PRIMARY KEY, - username TEXT, - password TEXT, - email TEXT, - email_validation JSONB, - phone_number TEXT, - phone_number_validation JSONB, - FOREIGN KEY (account_id) REFERENCES accounts(id) -); -####################################################################################################################### -*/ -/* Inserting an Account: (Password = test) -####################################################################################################################### -INSERT INTO accounts (id, namespace, data, metadata) -VALUES ('2faa137b-27be-476f-b98c-8b7eed6f1f3a', 'parcoursmob', '{"email": "salimbouaram12@gmail.com", "gender": "9", -"groups": ["483280d0-db2d-4f06-b361-02e4be5012d2", "483280d0-db2d-4f06-b361-02e4be5012d2:admin"], "last_name": "salim", -"first_name": "salim", "display_name": "salim salim", "phone_number": ""}', '{"created": "2023-04-24T09:29:18.262+00:00"}'); -####################################################################################################################### -INSERT INTO account_auth (account_id, username, password, email, email_validation, phone_number, phone_number_validation) -VALUES ('2faa137b-27be-476f-b98c-8b7eed6f1f3a', 'salim-amine.bou-aram@coopgo.fr', -'$2a$10$j9LwkGYT6HhLpWxUvpEniOJ3nBKEhwAn52G.t4QYMgje4HnJuWqHK', 'salim-amine.bou-aram@coopgo.fr', -'{"validated": false, "validation_code": ""}', '0749331953', '{"validated": false, "validation_code": ""}'); -####################################################################################################################### -*/ - var cfg *viper.Viper func init() { cfg = viper.New() - cfg.Set("storage.db.psql.host", "localhost") - cfg.Set("storage.db.psql.port", "5432") - cfg.Set("storage.db.psql.user", "postgres") - cfg.Set("storage.db.psql.password", "postgres") - cfg.Set("storage.db.psql.dbname", "mobilityaccounts") + cfg.SetDefault("storage.db.psql.host", "localhost") + cfg.SetDefault("storage.db.psql.port", "5432") + cfg.SetDefault("storage.db.psql.user", "postgres") + cfg.SetDefault("storage.db.psql.password", "postgres") + cfg.SetDefault("storage.db.psql.dbname", "mobilityaccounts_tests") + cfg.SetDefault("storage.db.psql.sslmode", "disable") + cfg.SetDefault("storage.db.psql.schema", "mobilityaccounts") + cfg.SetDefault("storage.db.psql.tables.accounts", "accounts") + cfg.SetDefault("storage.db.psql.tables.accounts_auth_local", "accounts_auth_local") + cfg.SetConfigName("config") // Override default values in a config.yaml file within this directory + cfg.AddConfigPath(".") + cfg.ReadInConfig() } -func TestNewPostgresqlStorage(t *testing.T) { +func TestPostgresqlStorage_Initialize(t *testing.T) { storage, err := NewPostgresqlStorage(cfg) - storage.DbConnection.Exec("Delete from account_auth ;") - storage.DbConnection.Exec("Delete from accounts ;") if err != nil { t.Errorf("error creating new PostgreSQL storage: %v", err) } defer storage.DbConnection.Close() -} -func generateUUIDv4() string { - uuid := make([]byte, 16) - _, err := rand.Read(uuid) + err = storage.Migrate() if err != nil { - panic(err) + t.Errorf("database migration issue: %v", err) + return + } + + tx, err := storage.DbConnection.BeginTx(context.Background(), nil) + if err != nil { + t.Errorf("transaction issue: %v", err) + return + } + defer tx.Rollback() + _, err = tx.Exec(fmt.Sprintf("DELETE FROM %s;", storage.Tables["accounts_auth_local"])) + if err != nil { + t.Errorf("delete accounts table issue: %v", err) + return + } + _, err = tx.Exec(fmt.Sprintf("DELETE FROM %s;", storage.Tables["accounts"])) + if err != nil { + t.Errorf("delete accounts table issue: %v", err) + return + } + if err = tx.Commit(); err != nil { + t.Errorf("commit transaction issue: %v", err) + return } - uuid[6] = (uuid[6] & 0x0f) | 0x40 - uuid[8] = (uuid[8] & 0xbf) | 0x80 - return hex.EncodeToString(uuid[:4]) + "-" + hex.EncodeToString(uuid[4:6]) + "-" + - hex.EncodeToString(uuid[6:8]) + "-" + hex.EncodeToString(uuid[8:10]) + "-" + - hex.EncodeToString(uuid[10:]) } -func TestGetAccount(t *testing.T) { - // Open a database connection +func TestPostgresqlStorage_CreateAndGetAccount(t *testing.T) { db, err := NewPostgresqlStorage(cfg) - Id := generateUUIDv4() if err != nil { t.Errorf("failed to create new psql connection") } - // Insert data into accounts table - accountData := map[string]any{ - "key1": "value1", - "key2": "value2", - } - accountMetadata := map[string]any{ - "key1": "value1", - "key2": "value2", - } - account := Account{ - ID: Id, - Namespace: "test_namespace", - Data: accountData, - Metadata: accountMetadata, - } - dataJSON, err := json.Marshal(map[string]any{ - "key1": "value1", - "key2": "value2", - }) + err = db.CreateAccount(account1) if err != nil { - t.Errorf("error account data and metdata") + t.Errorf("Failed to create account : %s", err) + return } - _, err = db.DbConnection.Exec("INSERT INTO accounts (id, namespace, data, metadata) "+ - "VALUES ($1, $2, $3, $4)", account.ID, account.Namespace, dataJSON, dataJSON) + + result, err := db.GetAccount(account1.ID) if err != nil { - t.Errorf("error in inserting a new account") + t.Errorf("Failed to get account : %s", err) + return } - // Insert data into account_auth table - emailValidation := Validation{ - Validated: true, - ValidationCode: "code", - } - localAuth := LocalAuth{ - Username: "testuser", - Password: "testpassword", - Email: "test@test.com", - EmailValidation: emailValidation, - PhoneNumber: "1234567890", - PhoneNumberValidation: emailValidation, - } - localAuthJSON, err := json.Marshal(emailValidation) - if err != nil { - t.Errorf("error account_auth localAuth") - } - _, err = db.DbConnection.Exec("INSERT INTO account_auth (account_id, username, password, "+ - "email, email_validation, "+ - "phone_number,phone_number_validation) VALUES ($1, $2, $3, $4, $5, $6, $7)", account.ID, - localAuth.Username, localAuth.Password, localAuth.Email, localAuthJSON, localAuth.PhoneNumber, localAuthJSON) - if err != nil { - fmt.Println(err) - t.Errorf("error in iserting a new account in account_auth") - } - account_, err := db.GetAccount(Id) - if err != nil { - t.Errorf("failed") - fmt.Println(err) - } - expectedAccount := &Account{ - ID: Id, - Namespace: "test_namespace", - Data: accountData, - Metadata: accountMetadata, - Authentication: AccountAuth{ - Local: localAuth, - }, - } - if reflect.DeepEqual(account_, expectedAccount) { - fmt.Println("PASS") - } else { - t.Errorf("The received account is not the same as expected") + + if !reflect.DeepEqual(&account1, result) { + t.Errorf("The received account is not the same as expected\nSaved Account : %v\nRetrieved Account : %v", &account1, result) } } -func TestPostgresqlStorage_CreateAccount(t *testing.T) { +func TestPostgresqlStorage_CreateAndGetAccountNoAuth(t *testing.T) { db, err := NewPostgresqlStorage(cfg) - Id := generateUUIDv4() if err != nil { t.Errorf("failed to create new psql connection") } - emailValidation := Validation{ - Validated: true, - ValidationCode: "code", - } - localAuth := LocalAuth{ - Username: "salim", - Password: "testpassword", - Email: "test@test.com", - EmailValidation: emailValidation, - PhoneNumber: "1234567890", - PhoneNumberValidation: emailValidation, - } - accountData := map[string]any{ - "key1": "value1", - "key2": "value2", - } - accountMetadata := map[string]any{ - "key1": "value1", - "key2": "value2", - } - account := Account{ - ID: Id, - Namespace: "namespace", - Authentication: AccountAuth{ - Local: localAuth, - }, - Data: accountData, - Metadata: accountMetadata, - } - err = db.CreateAccount(account) + err = db.CreateAccount(account3) if err != nil { - fmt.Println(err) - t.Errorf("Failed to create account") + t.Errorf("Failed to create account : %s", err) + return + } + + result, err := db.GetAccount(account3.ID) + if err != nil { + t.Errorf("Failed to get account : %s", err) + return + } + + if !reflect.DeepEqual(&account3, result) { + t.Errorf("The received account is not the same as expected\nSaved Account : %v\nRetrieved Account : %v", &account3, result) } } func TestPostgresqlStorage_UpdateAccount(t *testing.T) { db, err := NewPostgresqlStorage(cfg) - Id := generateUUIDv4() if err != nil { t.Errorf("failed to create new psql connection") } - emailValidation := Validation{ - Validated: true, - ValidationCode: "code", - } - localAuth := LocalAuth{ - Username: "salim", - Password: "testpassword", - Email: "test@test.com", - EmailValidation: emailValidation, - PhoneNumber: "1234567890", - PhoneNumberValidation: emailValidation, - } - accountData := map[string]any{ - "key1": "value1", - "key2": "value2", - } - accountMetadata := map[string]any{ - "key1": "value1", - "key2": "value2", - } - account := Account{ - ID: Id, - Namespace: "test_namespace", - Authentication: AccountAuth{ - Local: localAuth, - }, - Data: accountData, - Metadata: accountMetadata, - } - err = db.CreateAccount(account) + err = db.CreateAccount(account2) if err != nil { - fmt.Println(err) - t.Errorf("Failed to create account") + t.Errorf("Failed to create account : %s", err) + return } - account2 := Account{ - ID: Id, - Namespace: "salim", - Authentication: AccountAuth{ - Local: LocalAuth{ - Username: "salim", - Password: "salim", - Email: "salim@test.com", - EmailValidation: Validation{ - Validated: false, - ValidationCode: "123", - }, - PhoneNumber: "12345", - PhoneNumberValidation: Validation{ - Validated: true, - ValidationCode: "1233", - }, - }, - }, - Data: map[string]any{ - "key1": "salim1", - "key2": "salim2", - }, - Metadata: map[string]any{ - "key1": "salim1", - "key2": "salim2", - }, - } - err = db.UpdateAccount(account2) + modified := account2 + modified.Authentication.Local.Email = Ptr("modifiedtest@test.com") + modified.Data["key1"] = "modeifiedvalue" + modified.Data["addedkey"] = "addedvalue" + modified.Metadata["addedmetadatakey"] = "addedmetadatavalue" + err = db.UpdateAccount(modified) if err != nil { - fmt.Println(err) - t.Errorf("failed") + t.Errorf("failed updating account : %s", err) + } + + result, err := db.GetAccount(account2.ID) + if err != nil { + t.Errorf("Failed to get account : %s", err) + return + } + + if !reflect.DeepEqual(&modified, result) { + t.Errorf("The received account is not the same as expected\nSaved Account : %v\nRetrieved Account : %v", &modified, result) } } @@ -282,30 +144,18 @@ func TestPostgresqlStorage_LocalAuthentication(t *testing.T) { if err != nil { t.Errorf("failed to create new psql connection") } - accountByUsername, err := db.LocalAuthentication("test_namespace", "testuser", - "", "") + _, err = db.LocalAuthentication(account1.Namespace, account1.Authentication.Local.Username, nil, nil) if err != nil { - t.Errorf("Failed LocalAuthentication based on username and namespace") + t.Errorf("Failed LocalAuthentication based on username and namespace : %s", err) } - fmt.Println(accountByUsername) - accountByEmail, err := db.LocalAuthentication("test_namespace", "", - "test@test.com", "") + _, err = db.LocalAuthentication(account1.Namespace, nil, account1.Authentication.Local.Email, nil) if err != nil { - t.Errorf("Failed LocalAuthentication based on username and namespace") + t.Errorf("Failed LocalAuthentication based on email and namespace :\n Namespace: %s\n Email: %s\nError: %s", account1.Namespace, *account1.Authentication.Local.Email, err) } - fmt.Println(accountByEmail) - accountByPhone, err := db.LocalAuthentication("test_namespace", "", - "", "1234567890") + _, err = db.LocalAuthentication(account1.Namespace, nil, nil, account1.Authentication.Local.PhoneNumber) if err != nil { - t.Errorf("Failed LocalAuthentication based on username and namespace") + t.Errorf("Failed LocalAuthentication based on phone number and namespace :\n Namespace: %s\n Phone number: %s\nError: %s", account1.Namespace, *account1.Authentication.Local.PhoneNumber, err) } - fmt.Println(accountByPhone) - accountByAll, err := db.LocalAuthentication("test_namespace", "testuser", - "test@test.com", "1234567890") - if err != nil { - t.Errorf("Failed LocalAuthentication based on username and namespace") - } - fmt.Println(accountByAll) } func TestPostgresqlStorage_GetAccounts(t *testing.T) { @@ -313,12 +163,15 @@ func TestPostgresqlStorage_GetAccounts(t *testing.T) { if err != nil { t.Errorf("failed to create new psql connection") } - accounts, err := db.GetAccounts([]string{"test_namespace", "salim", "namespace"}) + accounts, err := db.GetAccounts([]string{account1.Namespace, account3.Namespace}) if err != nil { - t.Errorf("Failed") + t.Errorf("Failed : %s", err) + return } for _, account := range accounts { - fmt.Println(account) + if account.Namespace != account1.Namespace && account.Namespace != account3.Namespace { + t.Errorf("This namespace was not requested : %s", account.Namespace) + } } } @@ -326,44 +179,47 @@ func TestPostgresqlStorage_GetAccountsByIds(t *testing.T) { db, err := NewPostgresqlStorage(cfg) if err != nil { t.Errorf("failed to create new psql connection") + return } - account := Account{ - ID: "772315f1-8113-486a-90c7-9073410065bd", - Namespace: "oo", - Authentication: AccountAuth{ - Local: LocalAuth{ - Username: "username", - Password: "password", - Email: "salim@test.com", - EmailValidation: Validation{ - Validated: true, - ValidationCode: "123", - }, - PhoneNumber: "12345", - PhoneNumberValidation: Validation{ - Validated: true, - ValidationCode: "1233", - }, - }, - }, - Data: map[string]any{ - "key1": "salim1", - "key2": "salim2", - }, - Metadata: map[string]any{ - "key1": "salim1", - "key2": "salim2", - }, - } - err = db.CreateAccount(account) + + accounts, err := db.GetAccountsByIds([]string{account2.ID, account3.ID}) if err != nil { - t.Errorf("Failed to create account") + t.Errorf("Failed to get account by ID : %s", err) + return } - accounts, err := db.GetAccountsByIds([]string{"772315f1-8113-486a-90c7-9073410065bd"}) - if err != nil { - t.Errorf("Failed to get account by ID") + + found2 := false + found3 := false + for _, account := range accounts { + if account.ID == account2.ID { + found2 = true + } else if account.ID == account3.ID { + found3 = true + } else { + t.Errorf("This id was not requested : %s", account.ID) + } } - for _, acc := range accounts { - fmt.Println(acc) + if !found2 { + t.Errorf("account id not found for account2 : %s", account2.ID) + } + if !found3 { + t.Errorf("account id not found for account3 : %s", account3.ID) + } +} + +func TestPostgresqlStorage_CreateAlreadyExistingCredentials(t *testing.T) { + db, err := NewPostgresqlStorage(cfg) + if err != nil { + t.Errorf("failed to create new psql connection") + return + } + + modified := account1 + modified.ID = uuid.NewString() // Change the ID to make as if it was a new one + + err = db.CreateAccount(modified) + if err == nil { + t.Errorf("account should not be created : unique index violated !") + return } } diff --git a/storage/storage.go b/storage/storage.go index 297221f..7c71466 100755 --- a/storage/storage.go +++ b/storage/storage.go @@ -30,11 +30,15 @@ func NewStorage(cfg *viper.Viper) (Storage, error) { type DBStorage interface { GetAccount(id string) (*Account, error) - LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error) + LocalAuthentication(namespace string, username *string, email *string, phone_number *string) (*Account, error) GetAccounts(namespaces []string) ([]Account, error) GetAccountsByIds(accountids []string) ([]Account, error) CreateAccount(account Account) error + + //TODO : remove UpdateAccount, implement UpdateAccountData and UpdateAccountLocalAuthentication UpdateAccount(account Account) error + + Migrate() error } func NewDBStorage(cfg *viper.Viper) (DBStorage, error) { @@ -66,3 +70,7 @@ func NewKVStore(cfg *viper.Viper) (KVStore, error) { kv, err := NewEtcdKVStore(cfg) return kv, err } + +func Ptr[T any](v T) *T { + return &v +} diff --git a/storage/storage_test.go b/storage/storage_test.go new file mode 100644 index 0000000..f3d7173 --- /dev/null +++ b/storage/storage_test.go @@ -0,0 +1,67 @@ +package storage + +import "github.com/google/uuid" + +var account1 = Account{ + ID: uuid.NewString(), + Namespace: "namespace", + Authentication: AccountAuth{ + Local: &LocalAuth{ + Username: Ptr("test"), + Password: "hashedpassword", + Email: Ptr("test@test.com"), + EmailValidation: &Validation{ + Validated: true, + ValidationCode: "", + }, + PhoneNumber: Ptr("+3312345678"), + PhoneNumberValidation: &Validation{ + Validated: true, + ValidationCode: "", + }, + }, + }, + Data: map[string]any{ + "key1": "value1", + "key2": "value2", + }, + Metadata: map[string]any{ + "key1": "value1", + "key2": "value2", + }, +} + +var account2 = Account{ + ID: uuid.NewString(), + Namespace: "test", + Authentication: AccountAuth{ + Local: &LocalAuth{ + Username: Ptr("test2"), + Password: "hashedpassword", + }, + }, + Data: map[string]any{ + "key1": "value3", + "key2": "value4", + }, + Metadata: map[string]any{ + "key1": "value5", + "key2": "value6", + }, +} + +var account3 = Account{ + ID: uuid.NewString(), + Namespace: "other_namespace", + Authentication: AccountAuth{ + Local: nil, + }, + Data: map[string]any{ + "key1": "value3", + "key2": "value4", + }, + Metadata: map[string]any{ + "key1": "value5", + "key2": "value6", + }, +} From bac60f049f4aa04aafe6a61b3418644bc485b699 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Tue, 2 May 2023 20:00:34 +0200 Subject: [PATCH 017/340] restrict migrate function to the right schema, and not the entire database --- storage/postgresql.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index 77e8042..968be12 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -18,6 +18,7 @@ import ( type PostgresqlStorage struct { DbConnection *sql.DB + Schema string Tables map[string]string } @@ -47,6 +48,7 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { } return PostgresqlStorage{ DbConnection: db, + Schema: pg_schema, Tables: map[string]string{ "accounts": fmt.Sprintf("%s.%s", pg_schema, pgtables_accounts), "accounts_auth_local": fmt.Sprintf("%s.%s", pg_schema, pgtables_accounts_auth_local), @@ -426,7 +428,7 @@ func (psql PostgresqlStorage) Migrate() error { return err } - existing, err := driver.InspectRealm(ctx, nil) + existing, err := driver.InspectRealm(ctx, &schema.InspectRealmOption{Schemas: []string{psql.Schema}}) if err != nil { return err } From bde22b9ce9e768ff29a4c3383dca086412df341d Mon Sep 17 00:00:00 2001 From: sbouaram Date: Tue, 18 Jul 2023 12:38:07 +0200 Subject: [PATCH 018/340] fixing some issues --- config.go | 22 ++++++++-------------- go.mod | 5 ++--- go.sum | 4 +--- handlers/accounts.go | 12 +++++------- storage/postgresql.go | 32 +++++++++++++------------------- storage/postgresql_test.go | 2 +- 6 files changed, 30 insertions(+), 47 deletions(-) mode change 100755 => 100644 go.sum diff --git a/config.go b/config.go index 83a099e..e33b255 100755 --- a/config.go +++ b/config.go @@ -12,21 +12,15 @@ func ReadConfig() (*viper.Viper, error) { "dev_env": false, "storage": map[string]any{ "db": map[string]any{ - "type": "mongodb", - "mongodb": map[string]any{ - "host": "localhost", - "port": "27017", - "db_name": "coopgo_platform", - "collections": map[string]any{ - "users": "users", - }, - }, + "type": "psql", "psql": map[string]any{ - "host": "localhost", - "port": "5432", - "dbname": "coopgo_platform", - "sslmode": "disable", - "schema": "mobilityaccounts", + "user": "postgres", + "password": "postgres", + "host": "localhost", + "port": "5432", + "dbname": "coopgo_platform", + "sslmode": "disable", + "schema": "mobilityaccounts", "tables": map[string]any{ "accounts": "accounts", "accounts_auth_local": "accounts_auth_local", diff --git a/go.mod b/go.mod index 6f936e8..ba00ab1 100755 --- a/go.mod +++ b/go.mod @@ -7,12 +7,12 @@ require ( github.com/google/uuid v1.3.0 github.com/gorilla/csrf v1.7.1 github.com/gorilla/mux v1.8.0 - github.com/hashicorp/hcl/v2 v2.16.2 github.com/lib/pq v1.10.2 github.com/mitchellh/mapstructure v1.5.0 github.com/ory/fosite v0.42.2 github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 github.com/spf13/viper v1.15.0 + github.com/stretchr/testify v1.8.2 go.etcd.io/etcd/client/v3 v3.5.6 go.mongodb.org/mongo-driver v1.11.4 golang.org/x/crypto v0.6.0 @@ -39,6 +39,7 @@ require ( github.com/gorilla/securecookie v1.1.1 // indirect github.com/gorilla/websocket v1.4.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hashicorp/hcl/v2 v2.16.2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/klauspost/compress v1.13.6 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -60,8 +61,6 @@ require ( github.com/spf13/cobra v1.0.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/objx v0.5.0 // indirect - github.com/stretchr/testify v1.8.2 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/scram v1.1.1 // indirect diff --git a/go.sum b/go.sum old mode 100755 new mode 100644 index 1111776..28044b8 --- a/go.sum +++ b/go.sum @@ -806,7 +806,7 @@ github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oleiade/reflections v1.0.0/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= +github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1013,7 +1013,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1023,7 +1022,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= diff --git a/handlers/accounts.go b/handlers/accounts.go index 436cc89..eef5d70 100755 --- a/handlers/accounts.go +++ b/handlers/accounts.go @@ -13,23 +13,26 @@ import ( ) func (h MobilityAccountsHandler) Login(username string, password string, namespace string) (*storage.Account, error) { - if password == "" { return nil, errors.New("empty password not allowed") } u := strings.ToLower(username) account, err := h.storage.DB.LocalAuthentication(namespace, &u, nil, nil) if err != nil { + fmt.Println(err) return nil, err } if err = bcrypt.CompareHashAndPassword([]byte(account.Authentication.Local.Password), []byte(password)); err != nil { + fmt.Println(err) return nil, err } + return account, nil } func (h MobilityAccountsHandler) Register(account storage.Account) (*storage.Account, error) { + if account.ID != "" { return nil, errors.New("id should be empty") } @@ -57,11 +60,8 @@ func (h MobilityAccountsHandler) Register(account storage.Account) (*storage.Acc account.Authentication.Local.Password = string(hashedPassword) } - _, err := h.storage.DB.LocalAuthentication(account.Namespace, account.Authentication.Local.Username, account.Authentication.Local.Email, account.Authentication.Local.PhoneNumber) + _, _ = h.storage.DB.LocalAuthentication(account.Namespace, account.Authentication.Local.Username, account.Authentication.Local.Email, account.Authentication.Local.PhoneNumber) - if err == nil { - return nil, errors.New("user already exists") - } } // Validate data schemas @@ -146,7 +146,6 @@ func (h MobilityAccountsHandler) UpdatePhoneNumber(accountid, phone_number strin if err == nil && account.ID != account2.ID { return errors.New("user with this phone number already exists") } - account.Authentication.Local.PhoneNumber = &phone_number account.Authentication.Local.PhoneNumberValidation.Validated = verified account.Authentication.Local.PhoneNumberValidation.ValidationCode = verification_code @@ -195,7 +194,6 @@ func (h MobilityAccountsHandler) ChangePassword(accountid string, newpassword st account.Authentication.Local.Password = string(hashedPassword) if err = h.storage.DB.UpdateAccount(*account); err != nil { - fmt.Println(err) return err } diff --git a/storage/postgresql.go b/storage/postgresql.go index 968be12..29c91e2 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -115,28 +115,23 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username *st var ( data, metadata, emailValidation, phoneValidation []byte ) - - requested_field := "" - requested_value := "" - if username != nil { - requested_field = "username" - requested_value = *username - } else if email != nil { - requested_field = "email" - requested_value = *email - } else if phone_number != nil { - requested_field = "phone_number" - requested_value = *phone_number - } else { - return nil, fmt.Errorf("localauthentication func error PSQL") - } - req := fmt.Sprintf(`SELECT id, namespace, data, metadata, username, password, email, email_validation, phone_number, phone_number_validation FROM %s INNER JOIN %s ON id = account_id - WHERE account_namespace = $1 AND %s = $2;`, psql.Tables["accounts"], psql.Tables["accounts_auth_local"], requested_field) + WHERE account_namespace = '%s'`, psql.Tables["accounts"], psql.Tables["accounts_auth_local"], namespace) + + if username != nil && *username != "" { + req += fmt.Sprintf(` AND username = '%s'`, *username) + } + if email != nil && *email != "" { + req += fmt.Sprintf(` AND email = '%s'`, *email) + } + if phone_number != nil && *phone_number != "" { + req += fmt.Sprintf(` AND phone_number = '%s'`, *phone_number) + } + req += ";" account.Authentication.Local = &LocalAuth{} - err := psql.DbConnection.QueryRow(req, namespace, requested_value).Scan( + err := psql.DbConnection.QueryRow(req).Scan( &account.ID, &account.Namespace, &data, &metadata, &account.Authentication.Local.Username, @@ -145,7 +140,6 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username *st &emailValidation, &account.Authentication.Local.PhoneNumber, &phoneValidation) - if err != nil { return nil, err } diff --git a/storage/postgresql_test.go b/storage/postgresql_test.go index 7bdaed8..5827ed6 100644 --- a/storage/postgresql_test.go +++ b/storage/postgresql_test.go @@ -19,7 +19,7 @@ func init() { cfg.SetDefault("storage.db.psql.port", "5432") cfg.SetDefault("storage.db.psql.user", "postgres") cfg.SetDefault("storage.db.psql.password", "postgres") - cfg.SetDefault("storage.db.psql.dbname", "mobilityaccounts_tests") + cfg.SetDefault("storage.db.psql.dbname", "coopgo_platform") cfg.SetDefault("storage.db.psql.sslmode", "disable") cfg.SetDefault("storage.db.psql.schema", "mobilityaccounts") cfg.SetDefault("storage.db.psql.tables.accounts", "accounts") From 56dad2ee7d558eef01c4b2d8eb3349b153904f82 Mon Sep 17 00:00:00 2001 From: mfrigo Date: Wed, 6 Sep 2023 13:37:31 +0200 Subject: [PATCH 019/340] create branch mika --- storage/postgresql.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/postgresql.go b/storage/postgresql.go index 29c91e2..9d6aa2e 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -129,7 +129,7 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username *st req += fmt.Sprintf(` AND phone_number = '%s'`, *phone_number) } req += ";" - + fmt.Println(req) account.Authentication.Local = &LocalAuth{} err := psql.DbConnection.QueryRow(req).Scan( &account.ID, @@ -145,18 +145,22 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username *st } err = json.Unmarshal(metadata, &account.Metadata) if err != nil { + fmt.Println("one") return nil, err } err = json.Unmarshal(data, &account.Data) if err != nil { + fmt.Println("two") return nil, err } err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) if err != nil { + fmt.Println("three") return nil, err } err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) if err != nil { + fmt.Println("four") return nil, err } return account, nil From 017beaf7220cbe2fe7ae8bbc873106f1c9aa552c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 11:16:39 +0100 Subject: [PATCH 020/340] test Gitea actions --- .github/workflows/test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e4e54e4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,19 @@ +# .gitea/workflows/build.yaml +name: Gitea Actions Demo +run-name: ${{ github.actor }} is testing out Gitea Actions 🚀 +on: [push] +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v3 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file From 316ea97e7e1701f35f053e98506c5287a0a28965 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 11:46:42 +0100 Subject: [PATCH 021/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 49 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 19 -------------- 2 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..245f916 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main + +jobs: + build_and_push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Installation de Docker + - name: Install Docker + run: | + apt-get update + apt-get install -y docker.io + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + # - name: Get Gitea Tags + # id: get_tags + # run: | + # git fetch --tags + # latest_tag=$(git describe --tags --abbrev=0) + # echo "Latest tag found: $latest_tag" + # echo "::set-output name=latest_tag::$latest_tag" + + # - name: Test tags + # run: | + # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: "{{defaultContext}}:mobility-accounts" + push: true + tags: "git.coopgo.io/coopgo-platform/mobilityaccounts:test" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index e4e54e4..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,19 +0,0 @@ -# .gitea/workflows/build.yaml -name: Gitea Actions Demo -run-name: ${{ github.actor }} is testing out Gitea Actions 🚀 -on: [push] -jobs: - Explore-Gitea-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file From 6f70a042e1f52a4aa25dd42fbb00a7ff25f400e2 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 11:47:40 +0100 Subject: [PATCH 022/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 245f916..2ce5548 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build and Push Docker Image on: push: branches: - - main + - dev jobs: build_and_push: From 240504349a0e1227de2965a391b6675ab073a4b8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 11:55:32 +0100 Subject: [PATCH 023/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ce5548..4a520f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,9 @@ jobs: run: | apt-get update apt-get install -y docker.io + systemctl start docker - - name: Login to Docker Hub + - name: Login to Docker Registry uses: docker/login-action@v1 with: registry: git.coopgo.io @@ -44,6 +45,6 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v2 with: - context: "{{defaultContext}}:mobility-accounts" + context: "{{defaultContext}}" push: true tags: "git.coopgo.io/coopgo-platform/mobilityaccounts:test" From e49374606b6684e6433495119d2993ce1b297ce9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 11:56:57 +0100 Subject: [PATCH 024/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a520f6..c9c11ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: run: | apt-get update apt-get install -y docker.io - systemctl start docker + service docker start - name: Login to Docker Registry uses: docker/login-action@v1 From 7be48ecdd8c3f7c98beb149fdf0d2630b2acb1f9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 11:59:35 +0100 Subject: [PATCH 025/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9c11ce..aab5a63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,6 @@ jobs: run: | apt-get update apt-get install -y docker.io - service docker start - name: Login to Docker Registry uses: docker/login-action@v1 From ffba1d1cce7c8b5b0988e94799b92d4c0db09313 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:03:50 +0100 Subject: [PATCH 026/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aab5a63..6e13d70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 # - name: Get Gitea Tags # id: get_tags From d84a8594b49d13c85d53a435f68304d12a550ebe Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:05:37 +0100 Subject: [PATCH 027/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e13d70..ae73e57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,13 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 + - name: Start Docker + run: | + sudo systemctl start docker + sudo systemctl enable docker + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 # - name: Get Gitea Tags # id: get_tags From 883f678c1b7dbc4c51ccbda6507f7bd5111102c3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:06:57 +0100 Subject: [PATCH 028/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae73e57..27278e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,8 @@ jobs: - name: Start Docker run: | - sudo systemctl start docker - sudo systemctl enable docker + systemctl start docker + systemctl enable docker - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 From 8030c13ff794f9d1f08e92f01e52890456a3c3e7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:08:14 +0100 Subject: [PATCH 029/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27278e0..023d63d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,8 @@ jobs: - name: Start Docker run: | - systemctl start docker - systemctl enable docker + service docker start + service docker status - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 From c89d6f0e0061166efd97791637dd61126144cea1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:16:03 +0100 Subject: [PATCH 030/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 023d63d..a5213f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,11 +13,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - # Installation de Docker - - name: Install Docker - run: | - apt-get update - apt-get install -y docker.io + # # Installation de Docker + # - name: Install Docker + # run: | + # apt-get update + # apt-get install -y docker.io - name: Login to Docker Registry uses: docker/login-action@v1 @@ -32,8 +32,7 @@ jobs: service docker status - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - + uses: # - name: Get Gitea Tags # id: get_tags # run: | From 4cf7fb9ebae0f7d0f5d5a4b7880d9946088251c6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:16:12 +0100 Subject: [PATCH 031/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5213f3..38ba142 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,8 @@ jobs: service docker status - name: Set up Docker Buildx - uses: + uses: docker/setup-buildx-action@v1 + # - name: Get Gitea Tags # id: get_tags # run: | From 24e89bd151580b765bb1d4f432f5ab51a57fed80 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:19:13 +0100 Subject: [PATCH 032/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38ba142..0f92b2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,14 +26,14 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Start Docker - run: | - service docker start - service docker status + # - name: Start Docker + # run: | + # service docker start + # service docker status + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - # - name: Get Gitea Tags # id: get_tags # run: | @@ -46,9 +46,14 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - context: "{{defaultContext}}" - push: true - tags: "git.coopgo.io/coopgo-platform/mobilityaccounts:test" + # - name: Build and push Docker image + # uses: docker/build-push-action@v2 + # with: + # context: "{{defaultContext}}" + # push: true + # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" + - name: Build Docker image + run: docker build -t git.coopgo.io/coopgo-platform/mobilityaccounts:test . + + - name: Push Docker image + run: docker push git.coopgo.io/coopgo-platform/mobilityaccounts:test \ No newline at end of file From b1fbc337923c4bb85fadb54031b3c85ce08bb8b5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:19:37 +0100 Subject: [PATCH 033/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f92b2b..e2ae7e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,11 +13,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - # # Installation de Docker - # - name: Install Docker - # run: | - # apt-get update - # apt-get install -y docker.io + # Installation de Docker + - name: Install Docker + run: | + apt-get update + apt-get install -y docker.io - name: Login to Docker Registry uses: docker/login-action@v1 From 3ffca6634461f918f13d02ad71ec054d189228e3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:20:03 +0100 Subject: [PATCH 034/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e2ae7e7..48dd305 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: # push: true # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" - name: Build Docker image - run: docker build -t git.coopgo.io/coopgo-platform/mobilityaccounts:test . + run: docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - name: Push Docker image - run: docker push git.coopgo.io/coopgo-platform/mobilityaccounts:test \ No newline at end of file + run: docker push git.coopgo.io/coopgo-platform/mobility-accounts:test \ No newline at end of file From cdeaf22a920a41b99a88ee5862ab780af711a2aa Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 12:21:08 +0100 Subject: [PATCH 035/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48dd305..799bf64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,10 +26,10 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - # - name: Start Docker - # run: | - # service docker start - # service docker status + - name: Start Docker + run: | + service docker start + service docker status # - name: Set up Docker Buildx # uses: docker/setup-buildx-action@v1 From 82f7e98e946b71f18b5a2d8742fd2badeebb4f5e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 14:59:01 +0100 Subject: [PATCH 036/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 799bf64..65e3d6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,8 +31,8 @@ jobs: service docker start service docker status - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 # - name: Get Gitea Tags # id: get_tags @@ -46,14 +46,9 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - # - name: Build and push Docker image - # uses: docker/build-push-action@v2 - # with: - # context: "{{defaultContext}}" - # push: true - # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" - - name: Build Docker image - run: docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - - - name: Push Docker image - run: docker push git.coopgo.io/coopgo-platform/mobility-accounts:test \ No newline at end of file + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: "{{defaultContext}}" + push: true + tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" \ No newline at end of file From 54ba2cf466e5de6cc18ab8eb7943c8c85a81a78a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 15:01:33 +0100 Subject: [PATCH 037/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65e3d6f..b3d1de7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,13 +26,11 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Start Docker - run: | - service docker start - service docker status + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 # - name: Get Gitea Tags # id: get_tags From 610573393cb3daffaa50f001d44b47dadfd741b9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 16:26:01 +0100 Subject: [PATCH 038/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3d1de7..b573e17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: jobs: build_and_push: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout repository From 334cf422b155790639554433beb10f02d2bbcfd9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 6 Mar 2024 17:41:04 +0100 Subject: [PATCH 039/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b573e17..9618622 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,10 +27,10 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v1 # - name: Get Gitea Tags # id: get_tags @@ -45,7 +45,7 @@ jobs: # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - name: Build and push Docker image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v1 with: context: "{{defaultContext}}" push: true From 08ec14cafe7085a48d94eb2029be5103baf56441 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 08:56:32 +0100 Subject: [PATCH 040/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 38 +++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9618622..4df47f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,18 +19,18 @@ jobs: apt-get update apt-get install -y docker.io - - name: Login to Docker Registry - uses: docker/login-action@v1 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d + # - name: Login to Docker Registry + # uses: docker/login-action@v1 + # with: + # registry: git.coopgo.io + # username: ncaron + # password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v1 # - name: Get Gitea Tags # id: get_tags @@ -44,9 +44,15 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Build and push Docker image - uses: docker/build-push-action@v1 - with: - context: "{{defaultContext}}" - push: true - tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" \ No newline at end of file + # - name: Build and push Docker image + # uses: docker/build-push-action@v1 + # with: + # context: "{{defaultContext}}" + # push: true + # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" + + - name: Deploy + run: | + echo "6744954b4a3a43422e62e8d110f90de527ce094d" | docker login git.coopgo.io -u ncaron --password-stdin + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . + docker push git.coopgo.io/coopgo-platform/mobility-accounts \ No newline at end of file From 4535715db1c4d68625e8045badf41c7ef3a68c25 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 08:58:10 +0100 Subject: [PATCH 041/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4df47f1..b13d2fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,9 +15,7 @@ jobs: # Installation de Docker - name: Install Docker - run: | - apt-get update - apt-get install -y docker.io + run: curl -fsSL https://get.docker.com | sh # - name: Login to Docker Registry # uses: docker/login-action@v1 From cb5b30bc476445d3ccd0177195a0ffea33deba55 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:01:16 +0100 Subject: [PATCH 042/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b13d2fc..fcd89b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,12 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 - + + - name: Who am I? + run: whoami # Installation de Docker - - name: Install Docker - run: curl -fsSL https://get.docker.com | sh + # - name: Install Docker + # run: curl -fsSL https://get.docker.com | sh # - name: Login to Docker Registry # uses: docker/login-action@v1 From de14e3c4404344f4639f5c1897ae023d75be7033 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:06:06 +0100 Subject: [PATCH 043/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcd89b3..93e844d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,13 +12,13 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 - - - name: Who am I? - run: whoami - # Installation de Docker - # - name: Install Docker - # run: curl -fsSL https://get.docker.com | sh + # Installation de Docker + - name: Install Docker + run: curl -fsSL https://get.docker.com | sh + + - name: Add user to docker group + run: usermod -aG docker $USER # - name: Login to Docker Registry # uses: docker/login-action@v1 # with: From c15d7469bad7f684a767baed7db61f8c7f656e89 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:08:08 +0100 Subject: [PATCH 044/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93e844d..33776cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,8 +17,8 @@ jobs: - name: Install Docker run: curl -fsSL https://get.docker.com | sh - - name: Add user to docker group - run: usermod -aG docker $USER + - name: Start Docker + run: systemctl start docker # - name: Login to Docker Registry # uses: docker/login-action@v1 # with: From b30b9a624793369e48198ec8583e9f964ebe6090 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:09:26 +0100 Subject: [PATCH 045/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33776cc..ecbe9c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: run: curl -fsSL https://get.docker.com | sh - name: Start Docker - run: systemctl start docker + run: service docker start # - name: Login to Docker Registry # uses: docker/login-action@v1 # with: From 576e9f5774c05c0653ade0756b8e260d67f65496 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:13:11 +0100 Subject: [PATCH 046/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecbe9c5..74a328d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,10 +15,14 @@ jobs: # Installation de Docker - name: Install Docker - run: curl -fsSL https://get.docker.com | sh + run: | + apt-get update + apt-get install -y docker.io + service docker start - name: Start Docker run: service docker start + # - name: Login to Docker Registry # uses: docker/login-action@v1 # with: From 02229478ec78a237f3654cb79e6b6802aaeb5dc2 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:14:48 +0100 Subject: [PATCH 047/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74a328d..5292e54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,10 @@ jobs: apt-get update apt-get install -y docker.io service docker start + echo "6744954b4a3a43422e62e8d110f90de527ce094d" | docker login git.coopgo.io -u ncaron --password-stdin + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . + docker push git.coopgo.io/coopgo-platform/mobility-accounts - - name: Start Docker - run: service docker start # - name: Login to Docker Registry # uses: docker/login-action@v1 @@ -55,8 +56,8 @@ jobs: # push: true # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" - - name: Deploy - run: | - echo "6744954b4a3a43422e62e8d110f90de527ce094d" | docker login git.coopgo.io -u ncaron --password-stdin - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - docker push git.coopgo.io/coopgo-platform/mobility-accounts \ No newline at end of file + # - name: Deploy + # run: | + # echo "6744954b4a3a43422e62e8d110f90de527ce094d" | docker login git.coopgo.io -u ncaron --password-stdin + # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . + # docker push git.coopgo.io/coopgo-platform/mobility-accounts \ No newline at end of file From 11a8839fcdc4e9a44f8a6ddb4449c2d1c84118dc Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:22:20 +0100 Subject: [PATCH 048/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 55 ++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5292e54..73399e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,34 +8,33 @@ on: jobs: build_and_push: runs-on: ubuntu-22.04 + container: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Checkout repository uses: actions/checkout@v2 # Installation de Docker - - name: Install Docker - run: | - apt-get update - apt-get install -y docker.io - service docker start - echo "6744954b4a3a43422e62e8d110f90de527ce094d" | docker login git.coopgo.io -u ncaron --password-stdin - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - docker push git.coopgo.io/coopgo-platform/mobility-accounts + # - name: Install Docker + # run: | + # apt-get update + # apt-get install -y docker.io + + # - name: Start Docker + # run: service docker start + - name: Login to Docker Registry + uses: docker/login-action@v1 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d - # - name: Login to Docker Registry - # uses: docker/login-action@v1 - # with: - # registry: git.coopgo.io - # username: ncaron - # password: 6744954b4a3a43422e62e8d110f90de527ce094d + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v1 - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v1 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 # - name: Get Gitea Tags # id: get_tags @@ -49,15 +48,9 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - # - name: Build and push Docker image - # uses: docker/build-push-action@v1 - # with: - # context: "{{defaultContext}}" - # push: true - # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" - - # - name: Deploy - # run: | - # echo "6744954b4a3a43422e62e8d110f90de527ce094d" | docker login git.coopgo.io -u ncaron --password-stdin - # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - # docker push git.coopgo.io/coopgo-platform/mobility-accounts \ No newline at end of file + - name: Build and push Docker image + uses: docker/build-push-action@v1 + with: + context: "{{defaultContext}}" + push: true + tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" From 8943b0aefa8e6f88168100ccb2ffd7bb984abb33 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 09:24:08 +0100 Subject: [PATCH 049/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73399e3..cf42db4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Installation de Docker # - name: Install Docker @@ -24,17 +24,17 @@ jobs: # run: service docker start - name: Login to Docker Registry - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 # - name: Get Gitea Tags # id: get_tags @@ -49,7 +49,7 @@ jobs: # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - name: Build and push Docker image - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v2 with: context: "{{defaultContext}}" push: true From 05298cf4b97399783cb871cbddb6d10cb2ca59c6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:28:43 +0100 Subject: [PATCH 050/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf42db4..d790194 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,9 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 + - name: Count 10 seconds + run: sleep 10 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From 7d37028d93798fdbbe0b9449f4ad805974f8a300 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:29:54 +0100 Subject: [PATCH 051/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d790194..2280599 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,13 +29,13 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + + - name: Count 10 seconds + run: sleep 10 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - - name: Count 10 seconds - run: sleep 10 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From 77118af695b2b2b510bea7fef17eab76f69c066e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:30:38 +0100 Subject: [PATCH 052/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2280599..8adb36e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Count 10 seconds - run: sleep 10 + - name: Count 20 seconds + run: sleep 20 - name: Set up QEMU uses: docker/setup-qemu-action@v2 From 4408f007ef7ebcd965b4a974f2f389c697bacf14 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:31:28 +0100 Subject: [PATCH 053/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8adb36e..fbff580 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Count 20 seconds - run: sleep 20 + - name: Count 30 seconds + run: sleep 30 - name: Set up QEMU uses: docker/setup-qemu-action@v2 From 311709f22f92783caae198857f21407c49fe97b5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:33:02 +0100 Subject: [PATCH 054/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbff580..3e43a7c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,13 +15,13 @@ jobs: uses: actions/checkout@v3 # Installation de Docker - # - name: Install Docker - # run: | - # apt-get update - # apt-get install -y docker.io + - name: Install Docker + run: | + apt-get update + apt-get install -y docker.io - # - name: Start Docker - # run: service docker start + - name: Start Docker + run: service docker start - name: Login to Docker Registry uses: docker/login-action@v2 From 374cc415b5bf06437767fab542252b774c1ae0ec Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:36:01 +0100 Subject: [PATCH 055/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e43a7c..3d622f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: apt-get install -y docker.io - name: Start Docker - run: service docker start + run: ln -s ~/.docker/run/docker.sock /var/run/docker.sock - name: Login to Docker Registry uses: docker/login-action@v2 From 17d0ee7f52fe2ec4f80d0c4103de5d5c28df7f86 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:44:15 +0100 Subject: [PATCH 056/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d622f5..99a176f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Count 30 seconds - run: sleep 30 + - name: Docker info + run: service docker status - name: Set up QEMU uses: docker/setup-qemu-action@v2 From 76812b32d266bee6ca5843487bd5720399a41f97 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:55:23 +0100 Subject: [PATCH 057/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99a176f..08b3e3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,11 +14,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - # Installation de Docker - - name: Install Docker + - name: Install dependencies run: | apt-get update - apt-get install -y docker.io + apt-get install -y apt-transport-https ca-certificates curl software-properties-common + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + apt-get update + apt-get install -y docker-ce docker-ce-cli containerd.io + + # Installation de Docker + # - name: Install Docker + # run: | + # apt-get update + # apt-get install -y docker.io - name: Start Docker run: ln -s ~/.docker/run/docker.sock /var/run/docker.sock From 04345ef47caa056ed3cb9ad4ffe14eb1b2f0cd70 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:56:58 +0100 Subject: [PATCH 058/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08b3e3e..feca2e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,8 +39,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Docker info - run: service docker status + - name: Docker start + run: service docker star - name: Set up QEMU uses: docker/setup-qemu-action@v2 From 021c70808e8dab11bd04078bfebe12248134e00b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 17:58:46 +0100 Subject: [PATCH 059/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index feca2e7..0aef5e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Docker start - run: service docker star + run: service docker start - name: Set up QEMU uses: docker/setup-qemu-action@v2 From 974546104889c66e81ab3d5f1de19995ceeaf973 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 18:01:45 +0100 Subject: [PATCH 060/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0aef5e3..b8decaf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: # apt-get update # apt-get install -y docker.io - - name: Start Docker + - name: Create a symbolic link Docker run: ln -s ~/.docker/run/docker.sock /var/run/docker.sock - name: Login to Docker Registry @@ -39,8 +39,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Docker start - run: service docker start + - name: Docker restart + run: service docker restart - name: Set up QEMU uses: docker/setup-qemu-action@v2 From e8b11218ada90389606e02a7179bc0a4360ab53c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 18:07:23 +0100 Subject: [PATCH 061/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8decaf..bcc527b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,11 @@ jobs: container: ghcr.io/catthehacker/ubuntu:act-latest steps: + - name: Set ulimit + run: | + sudo ulimit -n 4096 + sudo ulimit -u 4096 + - name: Checkout repository uses: actions/checkout@v3 From cbe36e0a9ba3ad280a0146371c5f3d862ad465f1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 18:07:44 +0100 Subject: [PATCH 062/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bcc527b..13987f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,8 @@ jobs: steps: - name: Set ulimit run: | - sudo ulimit -n 4096 - sudo ulimit -u 4096 + ulimit -n 4096 + ulimit -u 4096 - name: Checkout repository uses: actions/checkout@v3 From 13af4fc1fff81abc7f80562dbe80e74755f41ba6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 18:09:01 +0100 Subject: [PATCH 063/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13987f8..3b3996c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,6 @@ jobs: - name: Set ulimit run: | ulimit -n 4096 - ulimit -u 4096 - name: Checkout repository uses: actions/checkout@v3 From ca65504097daf99c31ebc31a7289afca55c94315 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 18:12:12 +0100 Subject: [PATCH 064/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b3996c..13987f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,7 @@ jobs: - name: Set ulimit run: | ulimit -n 4096 + ulimit -u 4096 - name: Checkout repository uses: actions/checkout@v3 From af62a79fcc8cb20857be9c09f04b67876f04e599 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 7 Mar 2024 18:15:06 +0100 Subject: [PATCH 065/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13987f8..1408f18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,7 @@ jobs: steps: - name: Set ulimit run: | - ulimit -n 4096 - ulimit -u 4096 + ulimit -n 524288 - name: Checkout repository uses: actions/checkout@v3 From 235e8c3ab569db0774ee3719bd983924705ee66d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 09:25:25 +0100 Subject: [PATCH 066/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1408f18..07f5908 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,9 +48,11 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 + options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' # - name: Get Gitea Tags # id: get_tags @@ -66,6 +68,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v2 + options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' with: context: "{{defaultContext}}" push: true From 6c7d67911a0af911effd262971c1a66035a57838 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 09:26:30 +0100 Subject: [PATCH 067/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 07f5908..d10d534 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,9 +42,6 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - - name: Docker restart - run: service docker restart - name: Set up QEMU uses: docker/setup-qemu-action@v2 From 8865c48bb762552f1bbae876f37f3da929c518d0 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 09:39:38 +0100 Subject: [PATCH 068/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d10d534..3436668 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,11 +45,13 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 - options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' + with: + mount-docker-socket: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' + with: + mount-docker-socket: true # - name: Get Gitea Tags # id: get_tags @@ -65,8 +67,8 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v2 - options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' with: context: "{{defaultContext}}" push: true tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" + mount-docker-socket: true \ No newline at end of file From e933481eb359d1f76a1de9b75a9e47cc62ba2cbd Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 16:53:28 +0100 Subject: [PATCH 069/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3436668..92ac790 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,38 +3,24 @@ name: Build and Push Docker Image on: push: branches: + - main - dev jobs: build_and_push: - runs-on: ubuntu-22.04 - container: ghcr.io/catthehacker/ubuntu:act-latest + runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:act-latest steps: - - name: Set ulimit - run: | - ulimit -n 524288 - - name: Checkout repository uses: actions/checkout@v3 - - name: Install dependencies - run: | - apt-get update - apt-get install -y apt-transport-https ca-certificates curl software-properties-common - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - apt-get update - apt-get install -y docker-ce docker-ce-cli containerd.io - # Installation de Docker # - name: Install Docker # run: | # apt-get update # apt-get install -y docker.io - - - name: Create a symbolic link Docker - run: ln -s ~/.docker/run/docker.sock /var/run/docker.sock - name: Login to Docker Registry uses: docker/login-action@v2 @@ -50,8 +36,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - with: - mount-docker-socket: true + # - name: Get Gitea Tags # id: get_tags @@ -71,4 +56,3 @@ jobs: context: "{{defaultContext}}" push: true tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" - mount-docker-socket: true \ No newline at end of file From cd7aa0f78effd365e33f06d5625f58e041890ffb Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 16:58:32 +0100 Subject: [PATCH 070/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92ac790..f9ea1a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,17 +25,14 @@ jobs: - name: Login to Docker Registry uses: docker/login-action@v2 with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - with: - mount-docker-socket: true + registry: "${{ secrets.DOCKER_REGISRTY }}" + username: "${{ secrets.REGISTRY_USERNAME }}" + password: "${{ secrets.REGISTRY_TOKEN }}" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + with: + driver-opts: name=builder0 # - name: Get Gitea Tags From e1f50d20c89cf147e3662b93b9e2f0383e7aa1b7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:00:56 +0100 Subject: [PATCH 071/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9ea1a2..c3def6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,9 +25,9 @@ jobs: - name: Login to Docker Registry uses: docker/login-action@v2 with: - registry: "${{ secrets.DOCKER_REGISRTY }}" - username: "${{ secrets.REGISTRY_USERNAME }}" - password: "${{ secrets.REGISTRY_TOKEN }}" + registry: ${{ secrets.DOCKER_REGISRTY }} + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From f65721edf9f52a9955efe0a00094ad5c4c29288a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:02:19 +0100 Subject: [PATCH 072/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3def6c..5772b77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,12 @@ jobs: # apt-get update # apt-get install -y docker.io + - name: Test secrets + run: | + echo ${{ secrets.DOCKER_REGISRTY }} + echo ${{ secrets.REGISTRY_USERNAME }} + echo ${{ secrets.REGISTRY_TOKEN }} + - name: Login to Docker Registry uses: docker/login-action@v2 with: From 001db0ec88a5ab496b85918b6b42fe382479324c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:07:04 +0100 Subject: [PATCH 073/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5772b77..0fb5724 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,18 +22,12 @@ jobs: # apt-get update # apt-get install -y docker.io - - name: Test secrets - run: | - echo ${{ secrets.DOCKER_REGISRTY }} - echo ${{ secrets.REGISTRY_USERNAME }} - echo ${{ secrets.REGISTRY_TOKEN }} - - name: Login to Docker Registry uses: docker/login-action@v2 with: - registry: ${{ secrets.DOCKER_REGISRTY }} - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_TOKEN }} + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From c7e3b96483acfeeae684b13dbca7e82e3eadf9bf Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:18:13 +0100 Subject: [PATCH 074/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fb5724..96af336 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,9 +31,6 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - with: - driver-opts: name=builder0 - # - name: Get Gitea Tags # id: get_tags From 5f3a9c4b89e5deded766794e798618fa38481a18 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:19:36 +0100 Subject: [PATCH 075/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96af336..0d5d8fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,11 +16,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - # Installation de Docker - # - name: Install Docker - # run: | - # apt-get update - # apt-get install -y docker.io + - name: Install Docker + run: | + apt-get update + apt-get install -y docker.io - name: Login to Docker Registry uses: docker/login-action@v2 From afd4c4162825f6573d788ff5f5bf8b69a999c979 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:23:20 +0100 Subject: [PATCH 076/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d5d8fe..eb862fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + - name: Install sysytemctl + run: | + sudo apt-get update + sudo apt-get install -y systemd + - name: Install Docker run: | apt-get update @@ -27,6 +32,16 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + + - name: Run Docker + run: | + docker --version + docker buildx --version + docker buildx create --use + docker buildx inspect --bootstrap + docker buildx ls + docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . + docker push git.coopgo.io/coopgo-platform/mobility-accounts:test - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From 066fe76a797b68307d75c93db2d9e78d23e787e5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:24:43 +0100 Subject: [PATCH 077/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb862fa..633ceeb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,14 +32,10 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - + - name: Run Docker run: | docker --version - docker buildx --version - docker buildx create --use - docker buildx inspect --bootstrap - docker buildx ls docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test From 6b2514319439884e157de3b9b2d1b85413559b42 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:28:17 +0100 Subject: [PATCH 078/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 633ceeb..905dede 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,6 +36,7 @@ jobs: - name: Run Docker run: | docker --version + systemctl start docker docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test From e02d969e529293ac63627bb10bf752703d27cc22 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:32:22 +0100 Subject: [PATCH 079/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 905dede..8852fbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - name: Run Docker run: | docker --version - systemctl start docker + service docker start docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test From d15a8be61a30b9b778ecdb610326068bed94069b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 8 Mar 2024 17:34:19 +0100 Subject: [PATCH 080/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8852fbd..e29bf86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,11 +16,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Install sysytemctl - run: | - sudo apt-get update - sudo apt-get install -y systemd - - name: Install Docker run: | apt-get update @@ -36,7 +31,7 @@ jobs: - name: Run Docker run: | docker --version - service docker start + dockerd docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test From dba7d992d41dc7f9469b8d303497747828d6a870 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 09:04:16 +0100 Subject: [PATCH 081/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e29bf86..3539dfd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Install Docker + - name: 'install docker-ce-cli' run: | apt-get update - apt-get install -y docker.io + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + chmod a+r /etc/apt/keyrings/docker.gpg + echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + apt-get update + apt-get install -y docker-ce-cli docker-compose-plugin - name: Login to Docker Registry uses: docker/login-action@v2 @@ -35,8 +43,8 @@ jobs: docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 # - name: Get Gitea Tags # id: get_tags @@ -50,9 +58,9 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - context: "{{defaultContext}}" - push: true - tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" + # - name: Build and push Docker image + # uses: docker/build-push-action@v2 + # with: + # context: "{{defaultContext}}" + # push: true + # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" From ecb4e5e219e6709619eedf98c368bc2ad392a545 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 09:08:57 +0100 Subject: [PATCH 082/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3539dfd..4316551 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,15 +19,16 @@ jobs: - name: 'install docker-ce-cli' run: | apt-get update + apt-get install ca-certificates curl install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg - chmod a+r /etc/apt/keyrings/docker.gpg + curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + chmod a+r /etc/apt/keyrings/docker.asc echo \ - "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ - "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update - apt-get install -y docker-ce-cli docker-compose-plugin + apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - name: Login to Docker Registry uses: docker/login-action@v2 From 8f6dab04dc98d59f6f74eef07108aeed9235bb4c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 09:10:10 +0100 Subject: [PATCH 083/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4316551..23bf8e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: - name: 'install docker-ce-cli' run: | apt-get update - apt-get install ca-certificates curl + apt-get install -y ca-certificates curl install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc @@ -28,7 +28,7 @@ jobs: $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update - apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - name: Login to Docker Registry uses: docker/login-action@v2 From d5b575d9f986882169c2930e99c408a19f36fd17 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 09:16:22 +0100 Subject: [PATCH 084/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 23bf8e0..895180e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,8 @@ jobs: tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + groupadd docker + usermod -aG docker $USER - name: Login to Docker Registry uses: docker/login-action@v2 From 8cf14149441258097941cd4b3c4a40c9b08468ba Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 09:21:01 +0100 Subject: [PATCH 085/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 895180e..b70cfd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,6 @@ jobs: tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - groupadd docker usermod -aG docker $USER - name: Login to Docker Registry From 0c3e7f8c45c8bbfa1ce03cdca5e396970ff8d79a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 09:31:16 +0100 Subject: [PATCH 086/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b70cfd0..5e0e704 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,15 +38,15 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Run Docker - run: | - docker --version - dockerd - docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - docker push git.coopgo.io/coopgo-platform/mobility-accounts:test + # - name: Run Docker + # run: | + # docker --version + # dockerd + # docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . + # docker push git.coopgo.io/coopgo-platform/mobility-accounts:test - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 # - name: Get Gitea Tags # id: get_tags @@ -60,9 +60,9 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - # - name: Build and push Docker image - # uses: docker/build-push-action@v2 - # with: - # context: "{{defaultContext}}" - # push: true - # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: "{{defaultContext}}" + push: true + tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" From 703bbaf199f858c96e062aa2bc9d195121bb0244 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 10:04:14 +0100 Subject: [PATCH 087/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e0e704..76eaf31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ on: jobs: build_and_push: - runs-on: ubuntu-latest + runs-on: docker-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest From dd9ea96f5873d626f896155b6a6e281f063184a0 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 10:14:26 +0100 Subject: [PATCH 088/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 76eaf31..f152547 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,8 @@ on: jobs: build_and_push: - runs-on: docker-latest + runs-on: ubuntu-latest + container: image: ghcr.io/catthehacker/ubuntu:act-latest @@ -16,21 +17,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: 'install docker-ce-cli' - run: | - apt-get update - apt-get install -y ca-certificates curl - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc - chmod a+r /etc/apt/keyrings/docker.asc - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - usermod -aG docker $USER - - name: Login to Docker Registry uses: docker/login-action@v2 with: From 96e0debef2ee56fffaa0bfbe4535b45054bc03ea Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 10:17:28 +0100 Subject: [PATCH 089/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f152547..1538a11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,9 +9,13 @@ on: jobs: build_and_push: runs-on: ubuntu-latest - - container: - image: ghcr.io/catthehacker/ubuntu:act-latest + + services: + my_docker: + image: ghcr.io/catthehacker/ubuntu:act-latest + ports: + - 2367:2367 + options: --name my_container steps: - name: Checkout repository From 75050500b34de07294509d664dd375d382266896 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 10:17:52 +0100 Subject: [PATCH 090/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1538a11..6cf09cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,6 @@ jobs: image: ghcr.io/catthehacker/ubuntu:act-latest ports: - 2367:2367 - options: --name my_container steps: - name: Checkout repository From cc4629bbbd4b679b34dc9004e1b73736c215e562 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 10:18:33 +0100 Subject: [PATCH 091/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cf09cd..a8b1596 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: build_and_push: runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:act-latest services: my_docker: From 255edf3390b5dea2e11e32d76005bfa6b75ceaa1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:23:49 +0100 Subject: [PATCH 092/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8b1596..848523f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,14 +9,6 @@ on: jobs: build_and_push: runs-on: ubuntu-latest - container: - image: ghcr.io/catthehacker/ubuntu:act-latest - - services: - my_docker: - image: ghcr.io/catthehacker/ubuntu:act-latest - ports: - - 2367:2367 steps: - name: Checkout repository @@ -51,9 +43,18 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Build and push Docker image - uses: docker/build-push-action@v2 - with: - context: "{{defaultContext}}" - push: true - tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" + # - name: Build and push Docker image + # uses: docker/build-push-action@v2 + # with: + # context: "{{defaultContext}}" + # push: true + # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" + - name: Build and Push Docker Image + run: | + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --build-arg ACCESS_TOKEN_USR=ncaron\ + --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ + --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ + --push . + working-directory: /work \ No newline at end of file From 1c3be9f9987376526433e66d519bf0e015e70639 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:24:30 +0100 Subject: [PATCH 093/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 848523f..acd8a0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,9 @@ on: jobs: build_and_push: runs-on: ubuntu-latest + container: + image: docker:latest + options: --privileged steps: - name: Checkout repository From 50bb47749359a6a49895bc6a3294d88d4d0c7e36 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:37:46 +0100 Subject: [PATCH 094/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acd8a0d..0f0c549 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: build_and_push: runs-on: ubuntu-latest container: - image: docker:latest + image: ghrc.io/docker/build-push-action:v2 options: --privileged steps: From 54c5b1e334da11384e276905bd8f140ab331a290 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:38:17 +0100 Subject: [PATCH 095/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f0c549..0651343 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: build_and_push: runs-on: ubuntu-latest container: - image: ghrc.io/docker/build-push-action:v2 + image: ghrc.io/catthehacker/ubuntu:act-latest options: --privileged steps: From ef6f214cf62c0009e8249b41f7f84663b231747d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:43:28 +0100 Subject: [PATCH 096/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0651343..9c602c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,7 @@ jobs: build_and_push: runs-on: ubuntu-latest container: - image: ghrc.io/catthehacker/ubuntu:act-latest - options: --privileged + image: gitea/act_runner:nightly-dind-rootless steps: - name: Checkout repository From 87ea725e51a2c25095f4223e8aa6b7282b3b57ed Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:46:36 +0100 Subject: [PATCH 097/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c602c3..848523f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,6 @@ on: jobs: build_and_push: runs-on: ubuntu-latest - container: - image: gitea/act_runner:nightly-dind-rootless steps: - name: Checkout repository From d70449602d3f935e2d190a488de71e0971452a6e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:47:43 +0100 Subject: [PATCH 098/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 848523f..c81c5df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: build_and_push: runs-on: ubuntu-latest + container: + image: ghrc.io/catthehacker/ubuntu:act-latest steps: - name: Checkout repository From 20bea61613ffacff5b93cfb86a2b91ccabd92e51 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:48:27 +0100 Subject: [PATCH 099/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c81c5df..9c602c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: build_and_push: runs-on: ubuntu-latest container: - image: ghrc.io/catthehacker/ubuntu:act-latest + image: gitea/act_runner:nightly-dind-rootless steps: - name: Checkout repository From 8b1846d16aa27e9346a32eb525b739ab66857049 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:52:52 +0100 Subject: [PATCH 100/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c602c3..4b50e94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,15 +7,20 @@ on: - dev jobs: - build_and_push: + checkout_repository: runs-on: ubuntu-latest - container: - image: gitea/act_runner:nightly-dind-rootless + steps: - name: Checkout repository uses: actions/checkout@v3 + build_and_push_image: + runs-on: ubuntu-latest + container: + image: gitea/act_runner:nightly-dind-rootless + + steps: - name: Login to Docker Registry uses: docker/login-action@v2 with: From 3d2cdde8e3ac1f1faa1af44707a4840dbefa3c82 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:54:56 +0100 Subject: [PATCH 101/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b50e94..2ff5cb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,8 +17,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: - image: gitea/act_runner:nightly-dind-rootless + container: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Login to Docker Registry From cfbe46b95b0fc5374b47a0d38550e9f1fce750e1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:55:53 +0100 Subject: [PATCH 102/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ff5cb3..e53b4de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: ghcr.io/catthehacker/ubuntu:act-latest + container: gitea/action-runner:late steps: - name: Login to Docker Registry From 538d39b70a8104780cf0475340c1b32a2dfedb5d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:56:39 +0100 Subject: [PATCH 103/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e53b4de..efdbb1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: gitea/action-runner:late + container: gitea/act_runner:nightly-dind-rootless steps: - name: Login to Docker Registry From acb9b06f2a040467f7b2153278cffc6fc73abd6e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 11:57:22 +0100 Subject: [PATCH 104/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efdbb1e..a8bdcd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,12 +20,12 @@ jobs: container: gitea/act_runner:nightly-dind-rootless steps: - - name: Login to Docker Registry - uses: docker/login-action@v2 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d + # - name: Login to Docker Registry + # uses: docker/login-action@v2 + # with: + # registry: git.coopgo.io + # username: ncaron + # password: 6744954b4a3a43422e62e8d110f90de527ce094d # - name: Run Docker # run: | From 5a92886103db28aa7ec7fa52a2994d8f44d98742 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:01:42 +0100 Subject: [PATCH 105/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8bdcd0..61111bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,18 +15,23 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + login_docker_registry: + runs-on: ubuntu-latest + container: docker:latest + + steps: + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d + build_and_push_image: runs-on: ubuntu-latest container: gitea/act_runner:nightly-dind-rootless steps: - # - name: Login to Docker Registry - # uses: docker/login-action@v2 - # with: - # registry: git.coopgo.io - # username: ncaron - # password: 6744954b4a3a43422e62e8d110f90de527ce094d - # - name: Run Docker # run: | # docker --version @@ -34,8 +39,8 @@ jobs: # docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . # docker push git.coopgo.io/coopgo-platform/mobility-accounts:test - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 # - name: Get Gitea Tags # id: get_tags @@ -63,4 +68,3 @@ jobs: --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ --push . - working-directory: /work \ No newline at end of file From 93d220759d4727cafd3e3e33e6f4ed689a82cfe4 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:02:51 +0100 Subject: [PATCH 106/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61111bb..1da1e96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,6 @@ jobs: login_docker_registry: runs-on: ubuntu-latest - container: docker:latest steps: - name: Login to Docker Registry @@ -53,13 +52,6 @@ jobs: # - name: Test tags # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - # - name: Build and push Docker image - # uses: docker/build-push-action@v2 - # with: - # context: "{{defaultContext}}" - # push: true - # tags: "git.coopgo.io/coopgo-platform/mobility-accounts:test" - name: Build and Push Docker Image run: | docker buildx build \ From c073ae69194dca89f0cda993cc257699cf11d0c6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:03:55 +0100 Subject: [PATCH 107/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1da1e96..b53b3d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: login_docker_registry: runs-on: ubuntu-latest + container: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Login to Docker Registry From e16600ddd8613bc699124592e6406bdc5224889c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:08:17 +0100 Subject: [PATCH 108/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b53b3d9..3fe8ad2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,4 +60,5 @@ jobs: --build-arg ACCESS_TOKEN_USR=ncaron\ --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ - --push . + --push + -- . From 2433a4186cac2e8f68b2be27fd6ea212c4846831 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:11:49 +0100 Subject: [PATCH 109/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3fe8ad2..cb74cda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: gitea/act_runner:nightly-dind-rootless + container: docker:20.10.7 steps: # - name: Run Docker @@ -53,6 +53,7 @@ jobs: # - name: Test tags # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + - name: Build and Push Docker Image run: | docker buildx build \ From 73b7f8f9075e8a920c9a91a2bf2a3344b6a43b36 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:12:43 +0100 Subject: [PATCH 110/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb74cda..2188c95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,6 @@ jobs: - name: Build and Push Docker Image run: | docker buildx build \ - --platform linux/amd64,linux/arm64 \ --build-arg ACCESS_TOKEN_USR=ncaron\ --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ From c42be42302946cb9e9af9a9206c16200e2c3d5b3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:14:10 +0100 Subject: [PATCH 111/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2188c95..c19e438 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: - name: Build and Push Docker Image run: | - docker buildx build \ + docker build \ --build-arg ACCESS_TOKEN_USR=ncaron\ --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ From 6d9d24f643e34d3c79baf1508004d3005427e54d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:14:58 +0100 Subject: [PATCH 112/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c19e438..8b50d28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,5 +60,4 @@ jobs: --build-arg ACCESS_TOKEN_USR=ncaron\ --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ - --push -- . From e846f5adf3d03f8b57f5c592ae4b8b498cae29eb Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:16:26 +0100 Subject: [PATCH 113/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b50d28..2a8cc5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,8 +56,4 @@ jobs: - name: Build and Push Docker Image run: | - docker build \ - --build-arg ACCESS_TOKEN_USR=ncaron\ - --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ - --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ - -- . + docker build . \ No newline at end of file From d2624cea519647dea57666f0dd2ba9fe2fc908e6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:18:23 +0100 Subject: [PATCH 114/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a8cc5a..0f8e91a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,4 +56,7 @@ jobs: - name: Build and Push Docker Image run: | - docker build . \ No newline at end of file + docker build . \ + --build-arg ACCESS_TOKEN_USR=ncaron\ + --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ + --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ From 895f0f4852416308a8ea34ba88ec55e50b5651ab Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:20:08 +0100 Subject: [PATCH 115/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f8e91a..8139e45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,4 @@ jobs: - name: Build and Push Docker Image run: | - docker build . \ - --build-arg ACCESS_TOKEN_USR=ncaron\ - --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d \ - --tag git.coopgo.io/coopgo-platform/mobility-accounts:test \ + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=d0d6447bec4a397869c583022b982f5dce32ef7b From 2259eee40b9cecafb81acd1235a49f563ab7c542 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:22:15 +0100 Subject: [PATCH 116/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8139e45..9e0e38e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,4 +56,4 @@ jobs: - name: Build and Push Docker Image run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=d0d6447bec4a397869c583022b982f5dce32ef7b + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=d0d6447bec4a397869c583022b982f5dce32ef7b . From 414e9db9cfce11c6f79dd631715a1d7a6a146346 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:26:43 +0100 Subject: [PATCH 117/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e0e38e..a9811bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,10 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + - name: Check folder + run: | + ls -la + - name: Build and Push Docker Image run: | docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=d0d6447bec4a397869c583022b982f5dce32ef7b . From 0561fdf487fd647757556099c6bdcf6737645fb8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:31:39 +0100 Subject: [PATCH 118/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9811bc..2255159 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,6 +53,10 @@ jobs: # - name: Test tags # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + + - name: Clone repository + run: | + git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . - name: Check folder run: | @@ -60,4 +64,4 @@ jobs: - name: Build and Push Docker Image run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=d0d6447bec4a397869c583022b982f5dce32ef7b . + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . From 874e18e6cc739fc83acf829d28917add3281701b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:32:45 +0100 Subject: [PATCH 119/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2255159..8f29508 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,6 +53,11 @@ jobs: # - name: Test tags # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + + - name: Install dependencies + run: | + apt-get update + apt-get install -y git - name: Clone repository run: | From 76011f9644421e80c16a3e5dded58dc1b7c0feba Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:33:34 +0100 Subject: [PATCH 120/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f29508..24536a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,8 +56,8 @@ jobs: - name: Install dependencies run: | - apt-get update - apt-get install -y git + apt update + apt install -y git - name: Clone repository run: | From 4436c6ad5e38d07e7f1b23dca839f5cdb34fa7ba Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:36:13 +0100 Subject: [PATCH 121/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24536a3..4f84015 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,6 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: docker:20.10.7 steps: # - name: Run Docker @@ -54,6 +53,11 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + - name: Install Docker + run: | + apt update + apt install -y docker.io + - name: Install dependencies run: | apt update From 1a283360aa09c7d42f0208ab603867883751119d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:40:02 +0100 Subject: [PATCH 122/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f84015..48e26b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,8 +27,26 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + prepare_environment: + runs-on: ubuntu-latest + + steps: + - name: Install dependencies + run: | + apt update + apt install -y git + + - name: Clone repository + run: | + git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . + + - name: Check folder + run: | + ls -la + build_and_push_image: runs-on: ubuntu-latest + container: docker:latest steps: # - name: Run Docker @@ -53,20 +71,6 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Install Docker - run: | - apt update - apt install -y docker.io - - - name: Install dependencies - run: | - apt update - apt install -y git - - - name: Clone repository - run: | - git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . - - name: Check folder run: | ls -la From 558251f5f39f12608daa1824df61d7b690ae60b9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 12:44:16 +0100 Subject: [PATCH 123/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48e26b0..442521f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,12 @@ jobs: run: | ls -la + - name: Share files with build job + uses: actions/upload-artifact@v2 + with: + name: shared-files + path: . # Indiquez le répertoire à partager + build_and_push_image: runs-on: ubuntu-latest container: docker:latest @@ -71,6 +77,11 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + - name: Download shared files + uses: actions/download-artifact@v2 + with: + name: shared-files + - name: Check folder run: | ls -la From d06d7a5ef36201c7e30dc7edf2a9b87797dee330 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:02:52 +0100 Subject: [PATCH 124/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 42 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 442521f..b3e0f52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,32 +27,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - prepare_environment: - runs-on: ubuntu-latest - - steps: - - name: Install dependencies - run: | - apt update - apt install -y git - - - name: Clone repository - run: | - git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . - - - name: Check folder - run: | - ls -la - - - name: Share files with build job - uses: actions/upload-artifact@v2 - with: - name: shared-files - path: . # Indiquez le répertoire à partager - build_and_push_image: runs-on: ubuntu-latest - container: docker:latest steps: # - name: Run Docker @@ -77,10 +53,20 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Download shared files - uses: actions/download-artifact@v2 - with: - name: shared-files + - name: Install Docker + run: | + apt update + apt install -y docker.io + service docker start + + - name: Install dependencies + run: | + apt update + apt install -y git + + - name: Clone repository + run: | + git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . - name: Check folder run: | From 2cbe3eb6d4d48a694fa8473ab07553f83cd7f434 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:06:06 +0100 Subject: [PATCH 125/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3e0f52..ae32b3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest + container: ghcr.io/catthehacker/ubuntu:act-latest steps: # - name: Run Docker @@ -53,12 +54,6 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Install Docker - run: | - apt update - apt install -y docker.io - service docker start - - name: Install dependencies run: | apt update From c2dcb594b20d0ad0c769666b05579d268ccd404d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:11:27 +0100 Subject: [PATCH 126/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae32b3d..5975817 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: ghcr.io/catthehacker/ubuntu:act-latest + container: ubuntu:latest steps: # - name: Run Docker @@ -53,7 +53,15 @@ jobs: # - name: Test tags # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + - name: Install Docker + run: | + sudo apt update + sudo apt install -y docker.io + sudo service docker start + - name: Verify Docker installation + run: docker --version + - name: Install dependencies run: | apt update From fb17476487611c00457cd76e885b753292fd8239 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:12:17 +0100 Subject: [PATCH 127/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5975817..51b6f85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,13 +55,13 @@ jobs: # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - name: Install Docker run: | - sudo apt update - sudo apt install -y docker.io - sudo service docker start + apt update + apt install -y docker.io + service docker start - name: Verify Docker installation run: docker --version - + - name: Install dependencies run: | apt update From 386a8482919983a17719ab523c00bdcc6296cbd9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:14:08 +0100 Subject: [PATCH 128/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51b6f85..60b994b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: run: | apt update apt install -y docker.io - service docker start + dockerd & - name: Verify Docker installation run: docker --version From 7eabb4f9f5272e2ea142ab5e6bed82bab79a52aa Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:15:46 +0100 Subject: [PATCH 129/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60b994b..ab9d9a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,4 +77,4 @@ jobs: - name: Build and Push Docker Image run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + docker build buildx -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . From eabb4bdae89a6a45dddacded756703ebb999b560 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:17:44 +0100 Subject: [PATCH 130/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab9d9a2..5df7918 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,4 +77,4 @@ jobs: - name: Build and Push Docker Image run: | - docker build buildx -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + docker buildx build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . From bb21558ee1af4aaa88361d6c12ce7afd234feed5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:20:27 +0100 Subject: [PATCH 131/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5df7918..9bdc85c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,4 +77,4 @@ jobs: - name: Build and Push Docker Image run: | - docker buildx build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + docker buildx build --tag git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . From 9a87fe79436b623368004fc59f8ab7228b60c190 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:22:29 +0100 Subject: [PATCH 132/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bdc85c..3eb4dca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,4 +77,4 @@ jobs: - name: Build and Push Docker Image run: | - docker buildx build --tag git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + docker build --tag git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . From eb7ff923223aaf23fee711ca9838b2f17704d395 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:26:09 +0100 Subject: [PATCH 133/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3eb4dca..af6731b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: - name: Install Docker run: | apt update - apt install -y docker.io + apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin dockerd & - name: Verify Docker installation From 9b836bf4c853ab0eff6134919b79ab65f6984003 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:32:58 +0100 Subject: [PATCH 134/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af6731b..6a076c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,9 +53,21 @@ jobs: # - name: Test tags # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + - name: Add Docker Repository + run: | + apt-get update + apt-get install ca-certificates curl + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + chmod a+r /etc/apt/keyrings/docker.asc + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null + - name: Install Docker run: | - apt update + apt-get update apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin dockerd & From 2cc271561d1fa7fc71928d6e8f39ac8b96835449 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:33:47 +0100 Subject: [PATCH 135/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a076c9..748802a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: - name: Add Docker Repository run: | apt-get update - apt-get install ca-certificates curl + apt-get install -y ca-certificates curl install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc From 74bfd69f0028037d89362e89cde4e47c8cbef8e2 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:34:48 +0100 Subject: [PATCH 136/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 748802a..5bfb3d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,7 +68,7 @@ jobs: - name: Install Docker run: | apt-get update - apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin dockerd & - name: Verify Docker installation From 414ba0809d1ee79baea608f18c213b1c6e271146 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:40:21 +0100 Subject: [PATCH 137/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bfb3d6..8a7816a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,7 +69,7 @@ jobs: run: | apt-get update apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - dockerd & + dockerd - name: Verify Docker installation run: docker --version @@ -89,4 +89,4 @@ jobs: - name: Build and Push Docker Image run: | - docker build --tag git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . From ad69095f72d4512e2f7fab526610998d267a837b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:44:01 +0100 Subject: [PATCH 138/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a7816a..7982239 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: ubuntu:latest + container: docker:latest steps: # - name: Run Docker @@ -53,23 +53,6 @@ jobs: # - name: Test tags # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Add Docker Repository - run: | - apt-get update - apt-get install -y ca-certificates curl - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc - chmod a+r /etc/apt/keyrings/docker.asc - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null - - - name: Install Docker - run: | - apt-get update - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - dockerd - name: Verify Docker installation run: docker --version From 9cbce9c764c2c73150cd016d78472c264cc51e41 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:46:07 +0100 Subject: [PATCH 139/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7982239..0361de9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,18 +15,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - login_docker_registry: - runs-on: ubuntu-latest - container: ghcr.io/catthehacker/ubuntu:act-latest - - steps: - - name: Login to Docker Registry - uses: docker/login-action@v2 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d - build_and_push_image: runs-on: ubuntu-latest container: docker:latest @@ -57,6 +45,13 @@ jobs: - name: Verify Docker installation run: docker --version + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d + - name: Install dependencies run: | apt update From aa1f12db77271be8b5b3564c3a69e6ad81cfd48e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:47:32 +0100 Subject: [PATCH 140/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0361de9..9352b62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + login_docker_registry: + runs-on: ubuntu-latest + container: ghcr.io/catthehacker/ubuntu:act-latest + + steps: + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d + build_and_push_image: runs-on: ubuntu-latest container: docker:latest @@ -42,21 +54,6 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Verify Docker installation - run: docker --version - - - name: Login to Docker Registry - uses: docker/login-action@v2 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d - - - name: Install dependencies - run: | - apt update - apt install -y git - - name: Clone repository run: | git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . From ada0e51864df46b568a53896f018cc7986f51328 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:49:02 +0100 Subject: [PATCH 141/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9352b62..4de777a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,6 +58,10 @@ jobs: run: | git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . + - name: Check Docker version + run: | + docker --version + - name: Check folder run: | ls -la From 86eddf894c0dc14d36dca2e824fd0e54de6c76cb Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:50:42 +0100 Subject: [PATCH 142/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4de777a..cff42ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,8 @@ jobs: build_and_push_image: runs-on: ubuntu-latest - container: docker:latest + container: + image: docker:latest steps: # - name: Run Docker From e5cb07c01e36c5d1186e05e191b112df8fbcc704 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:52:04 +0100 Subject: [PATCH 143/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cff42ff..294a026 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,6 +62,7 @@ jobs: - name: Check Docker version run: | docker --version + dockerd & - name: Check folder run: | From 0202348b0c8407d7c686bb8501606413d9ce22a7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:53:28 +0100 Subject: [PATCH 144/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 294a026..360bb96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d build_and_push_image: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: image: docker:latest From 32b948350acc522d1187a90ad6059e00865d41de Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:54:28 +0100 Subject: [PATCH 145/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 360bb96..7e32c4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d build_and_push_image: - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 container: image: docker:latest From ac1ea1ba2caf0444b30a18972a45e36de85ef4f6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:55:11 +0100 Subject: [PATCH 146/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e32c4c..892fdbf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,8 +29,7 @@ jobs: build_and_push_image: runs-on: ubuntu-20.04 - container: - image: docker:latest + container: docker:20.10.7 steps: # - name: Run Docker From e2558ec3cb98cc96c8cb8142308438a0a39ac071 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:55:57 +0100 Subject: [PATCH 147/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 892fdbf..ee473c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d build_and_push_image: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest container: docker:20.10.7 steps: From 956b4a2d84946994918ba1ab664b5be0d9157fec Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:56:45 +0100 Subject: [PATCH 148/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee473c8..5dbcf6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,14 +54,14 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - name: Clone repository - run: | - git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . + # - name: Clone repository + # run: | + # git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . - - name: Check Docker version - run: | - docker --version - dockerd & + # - name: Check Docker version + # run: | + # docker --version + # dockerd & - name: Check folder run: | From 10039d1b4cba9a36bb835754e1642e56bf939a28 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 14:59:59 +0100 Subject: [PATCH 149/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5dbcf6b..525a9a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: build_and_push_image: runs-on: ubuntu-latest container: docker:20.10.7 + needs: checkout_repository steps: # - name: Run Docker From 747344ce36fc2aff97a13609b264a6700f719c11 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:07:27 +0100 Subject: [PATCH 150/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 525a9a5..0d5b0e1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,6 @@ jobs: checkout_repository: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v3 @@ -27,10 +26,26 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + clone_repository: + runs-on: ubuntu-latest + container: + image: alpine/git:latest + volumes: + - /tmp:/tmp + + steps: + - name: Clone repository + run: | + cd /tmp + git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . + build_and_push_image: runs-on: ubuntu-latest - container: docker:20.10.7 - needs: checkout_repository + container: + image: docker:20.10.7 + volumes: + - /tmp:/tmp + needs: clone_repository steps: # - name: Run Docker @@ -55,9 +70,6 @@ jobs: # run: | # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - # - name: Clone repository - # run: | - # git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . # - name: Check Docker version # run: | @@ -66,6 +78,7 @@ jobs: - name: Check folder run: | + cd /tmp ls -la - name: Build and Push Docker Image From cb2ce7bc1b39d28ba18b3704accdf8913493d609 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:10:15 +0100 Subject: [PATCH 151/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d5b0e1..4991c5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,8 @@ jobs: run: | cd /tmp git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . + pwd + ls -la build_and_push_image: runs-on: ubuntu-latest From 22db0f738f41eefa660cc7af7e9b20e3b8ce144a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:12:45 +0100 Subject: [PATCH 152/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4991c5b..c4fb531 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: container: image: alpine/git:latest volumes: - - /tmp:/tmp + - /tmp:/workspace/coopgo-platform/mobility-accounts/ steps: - name: Clone repository @@ -45,8 +45,6 @@ jobs: runs-on: ubuntu-latest container: image: docker:20.10.7 - volumes: - - /tmp:/tmp needs: clone_repository steps: @@ -81,6 +79,7 @@ jobs: - name: Check folder run: | cd /tmp + pwd ls -la - name: Build and Push Docker Image From 60aab2efa35deb404c1b7c55abd9b5ccc74a955a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:13:25 +0100 Subject: [PATCH 153/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4fb531..b737977 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,6 +78,7 @@ jobs: - name: Check folder run: | + pwd cd /tmp pwd ls -la From a8ee047d44e378e4106be2c8e1c1cfd31c11faf0 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:14:08 +0100 Subject: [PATCH 154/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b737977..3791a75 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,8 +78,6 @@ jobs: - name: Check folder run: | - pwd - cd /tmp pwd ls -la From a95f9a49ddd7ecce6a5c2cace475a4ae2ca3e575 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:15:10 +0100 Subject: [PATCH 155/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3791a75..94fe296 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,6 +36,7 @@ jobs: steps: - name: Clone repository run: | + pwd cd /tmp git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . pwd From 108e1f576e83adc03c4ebbafbcbdfc488e135e11 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:16:16 +0100 Subject: [PATCH 156/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94fe296..c2519ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,13 +31,13 @@ jobs: container: image: alpine/git:latest volumes: - - /tmp:/workspace/coopgo-platform/mobility-accounts/ + - /data:/workspace/coopgo-platform/mobility-accounts/ steps: - name: Clone repository run: | pwd - cd /tmp + cd /data git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . pwd ls -la From 431233a1df5d69ae9f6c420fd1d3c0b35c7a4ad8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:16:48 +0100 Subject: [PATCH 157/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2519ce..78e36e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,7 @@ jobs: - name: Clone repository run: | pwd + mkdir /data cd /data git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . pwd From b13517132299733054626541c328f14252bdc4b3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:18:48 +0100 Subject: [PATCH 158/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78e36e9..8e339f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,8 @@ jobs: runs-on: ubuntu-latest container: image: alpine/git:latest - volumes: - - /data:/workspace/coopgo-platform/mobility-accounts/ + # volumes: + # - /data:/workspace/coopgo-platform/mobility-accounts/ steps: - name: Clone repository @@ -80,6 +80,7 @@ jobs: - name: Check folder run: | + cd /data pwd ls -la From 54bc0245a9f5518321fd6908d3bbd10bf0f11c9b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:21:43 +0100 Subject: [PATCH 159/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e339f2..7cf97c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,8 @@ jobs: runs-on: ubuntu-latest container: image: alpine/git:latest - # volumes: - # - /data:/workspace/coopgo-platform/mobility-accounts/ + volumes: + - /workspace/coopgo-platform/mobility-accounts:/data steps: - name: Clone repository From 8fa6f50e38f91cd48aed7de5389b91da7c8fbb8a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:22:20 +0100 Subject: [PATCH 160/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7cf97c4..81cf5da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,6 @@ jobs: - name: Check folder run: | - cd /data pwd ls -la From a525721aa0f7b5817d4bc10ef9c8faa0104b783b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:25:39 +0100 Subject: [PATCH 161/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81cf5da..c43c00c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: container: image: alpine/git:latest volumes: - - /workspace/coopgo-platform/mobility-accounts:/data + - /data:/data steps: - name: Clone repository @@ -47,6 +47,8 @@ jobs: runs-on: ubuntu-latest container: image: docker:20.10.7 + volumes: + - /data:/data needs: clone_repository steps: @@ -80,6 +82,7 @@ jobs: - name: Check folder run: | + cd /data pwd ls -la From bc318e5b45e9fd9dea1902485fcdab7e060d03f6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:29:19 +0100 Subject: [PATCH 162/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c43c00c..0852cae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,12 @@ jobs: runs-on: ubuntu-latest steps: + - name: create data folder + run: | + mkdir data + ls -la + pwd + - name: Checkout repository uses: actions/checkout@v3 @@ -48,7 +54,7 @@ jobs: container: image: docker:20.10.7 volumes: - - /data:/data + - /workspace/coopgo-platform/mobility-accounts/data:/data needs: clone_repository steps: From 546628213f8370b2916b9272932825a0d29c77cd Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:30:12 +0100 Subject: [PATCH 163/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0852cae..12cba83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: mkdir data ls -la pwd - + - name: Checkout repository uses: actions/checkout@v3 @@ -43,8 +43,8 @@ jobs: - name: Clone repository run: | pwd - mkdir /data - cd /data + ls -la + cd data git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . pwd ls -la From 42028219ba9eba2b988286946ff47c382a1a4f21 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:34:38 +0100 Subject: [PATCH 164/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12cba83..bca6ffe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,10 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: - name: create data folder @@ -22,7 +26,10 @@ jobs: login_docker_registry: runs-on: ubuntu-latest - container: ghcr.io/catthehacker/ubuntu:act-latest + container: + image: ghcr.io/catthehacker/ubuntu:act-latest + volumes: + - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: - name: Login to Docker Registry @@ -31,13 +38,18 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + + - name: Check folders + run: | + pwd + ls -la clone_repository: runs-on: ubuntu-latest container: image: alpine/git:latest volumes: - - /data:/data + - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: - name: Clone repository @@ -54,7 +66,7 @@ jobs: container: image: docker:20.10.7 volumes: - - /workspace/coopgo-platform/mobility-accounts/data:/data + - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data needs: clone_repository steps: From 68c89411576014cb34dd3a0293e2ab3b2e4af6b3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 13 Mar 2024 15:35:28 +0100 Subject: [PATCH 165/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bca6ffe..680baab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: checkout_repository: runs-on: ubuntu-latest container: - image: ubuntu:latest + image: ghcr.io/catthehacker/ubuntu:act-latest volumes: - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data From 740d14894e7d32b04e09b48e4e6d91990293d2eb Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 08:54:28 +0100 Subject: [PATCH 166/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 680baab..3c1a337 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,6 +61,11 @@ jobs: pwd ls -la + - name: Publish artifact + uses: actions/upload-artifact@v2 + with: + name: mobility-accounts + path: data build_and_push_image: runs-on: ubuntu-latest container: @@ -98,6 +103,11 @@ jobs: # docker --version # dockerd & + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: mobility-accounts + - name: Check folder run: | cd /data From 2482c64d1cb6ded7d5d7bbe929056f9cd573119b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 08:55:56 +0100 Subject: [PATCH 167/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c1a337..a4e11b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,12 +15,6 @@ jobs: - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: - - name: create data folder - run: | - mkdir data - ls -la - pwd - - name: Checkout repository uses: actions/checkout@v3 @@ -52,6 +46,12 @@ jobs: - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: + - name: create data folder + run: | + mkdir data + ls -la + pwd + - name: Clone repository run: | pwd From f4b1d75e964971ffa4295ee93b02ad2ddcaff0bc Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 09:00:36 +0100 Subject: [PATCH 168/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4e11b4..fba6729 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,18 +40,17 @@ jobs: clone_repository: runs-on: ubuntu-latest - container: - image: alpine/git:latest - volumes: - - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: + - name: Install Git + run: apt-get install git -y + - name: create data folder run: | mkdir data ls -la pwd - + - name: Clone repository run: | pwd @@ -66,12 +65,11 @@ jobs: with: name: mobility-accounts path: data + build_and_push_image: runs-on: ubuntu-latest container: image: docker:20.10.7 - volumes: - - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data needs: clone_repository steps: From d3bdfb24b9b9e2579de5e26a078cc99118a4126d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 09:08:38 +0100 Subject: [PATCH 169/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fba6729..ece8cf3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,9 +15,19 @@ jobs: - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: + - name: Check folders + run: | + pwd + ls -la + - name: Checkout repository uses: actions/checkout@v3 + - name: Check folders + run: | + pwd + ls -la + login_docker_registry: runs-on: ubuntu-latest container: @@ -60,12 +70,6 @@ jobs: pwd ls -la - - name: Publish artifact - uses: actions/upload-artifact@v2 - with: - name: mobility-accounts - path: data - build_and_push_image: runs-on: ubuntu-latest container: @@ -100,11 +104,6 @@ jobs: # run: | # docker --version # dockerd & - - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: mobility-accounts - name: Check folder run: | From 5f757210ac8015c89f1076dd549b07812021b5ce Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 09:11:10 +0100 Subject: [PATCH 170/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ece8cf3..b5aec5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: run: | pwd ls -la - + login_docker_registry: runs-on: ubuntu-latest container: @@ -48,34 +48,12 @@ jobs: pwd ls -la - clone_repository: - runs-on: ubuntu-latest - - steps: - - name: Install Git - run: apt-get install git -y - - - name: create data folder - run: | - mkdir data - ls -la - pwd - - - name: Clone repository - run: | - pwd - ls -la - cd data - git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts.git . - pwd - ls -la - build_and_push_image: runs-on: ubuntu-latest container: image: docker:20.10.7 - needs: clone_repository - + volumes: + - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data steps: # - name: Run Docker # run: | From 0a43b72819308a91b5f6cac6fbeaf7d86cc7491d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 09:17:27 +0100 Subject: [PATCH 171/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5aec5c..55e56ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,8 @@ on: jobs: checkout_repository: - runs-on: ubuntu-latest + runs-on: + group: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest volumes: @@ -29,7 +30,8 @@ jobs: ls -la login_docker_registry: - runs-on: ubuntu-latest + runs-on: + group: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest volumes: @@ -49,7 +51,8 @@ jobs: ls -la build_and_push_image: - runs-on: ubuntu-latest + runs-on: + group: ubuntu-latest container: image: docker:20.10.7 volumes: @@ -85,7 +88,6 @@ jobs: - name: Check folder run: | - cd /data pwd ls -la From 472796c4443e5accb4d73c6c9cd60ac42c97f9e7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 09:57:01 +0100 Subject: [PATCH 172/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55e56ce..d609deb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: container: image: ghcr.io/catthehacker/ubuntu:act-latest volumes: - - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data + - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts steps: - name: Check folders From a9eb91bd839e2b8309c77dcbe7eee3a21e9493ad Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 09:57:38 +0100 Subject: [PATCH 173/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d609deb..f2ab80e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: container: image: ghcr.io/catthehacker/ubuntu:act-latest volumes: - - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data + - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts steps: - name: Login to Docker Registry @@ -56,7 +56,7 @@ jobs: container: image: docker:20.10.7 volumes: - - /workspace/coopgo-platform/mobility-accounts/data:/workspace/coopgo-platform/mobility-accounts/data + - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts steps: # - name: Run Docker # run: | From 9e70d3941dc1b18f3ec3c66f9eec1f85032956be Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 10:52:24 +0100 Subject: [PATCH 174/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 139 ++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2ab80e..20f0b15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,90 +7,87 @@ on: - dev jobs: - checkout_repository: - runs-on: - group: ubuntu-latest - container: - image: ghcr.io/catthehacker/ubuntu:act-latest - volumes: - - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts - + test: + runs-on: ubuntu-latest steps: - name: Check folders run: | pwd ls -la + # checkout_repository: + # runs-on: + # group: ubuntu-latest + # container: + # image: ghcr.io/catthehacker/ubuntu:act-latest + # volumes: + # - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts - - name: Checkout repository - uses: actions/checkout@v3 + # steps: + # - name: Check folders + # run: | + # pwd + # ls -la - - name: Check folders - run: | - pwd - ls -la + # - name: Checkout repository + # uses: actions/checkout@v3 - login_docker_registry: - runs-on: - group: ubuntu-latest - container: - image: ghcr.io/catthehacker/ubuntu:act-latest - volumes: - - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts + # - name: Check folders + # run: | + # pwd + # ls -la - steps: - - name: Login to Docker Registry - uses: docker/login-action@v2 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d + # login_docker_registry: + # runs-on: + # group: ubuntu-latest + # container: + # image: ghcr.io/catthehacker/ubuntu:act-latest + # volumes: + # - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts + + # steps: + # - name: Login to Docker Registry + # uses: docker/login-action@v2 + # with: + # registry: git.coopgo.io + # username: ncaron + # password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Check folders - run: | - pwd - ls -la + # - name: Check folders + # run: | + # pwd + # ls -la - build_and_push_image: - runs-on: - group: ubuntu-latest - container: - image: docker:20.10.7 - volumes: - - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts - steps: - # - name: Run Docker - # run: | - # docker --version - # dockerd - # docker buildx build --platform linux/amd64,linux/arm64 -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - # docker push git.coopgo.io/coopgo-platform/mobility-accounts:test - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - - # - name: Get Gitea Tags - # id: get_tags - # run: | - # git fetch --tags - # latest_tag=$(git describe --tags --abbrev=0) - # echo "Latest tag found: $latest_tag" - # echo "::set-output name=latest_tag::$latest_tag" + # build_and_push_image: + # runs-on: + # group: ubuntu-latest + # container: + # image: docker:20.10.7 + # volumes: + # - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts + # steps: + # # - name: Get Gitea Tags + # # id: get_tags + # # run: | + # # git fetch --tags + # # latest_tag=$(git describe --tags --abbrev=0) + # # echo "Latest tag found: $latest_tag" + # # echo "::set-output name=latest_tag::$latest_tag" - # - name: Test tags - # run: | - # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" + # # - name: Test tags + # # run: | + # # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - # - name: Check Docker version - # run: | - # docker --version - # dockerd & + # # - name: Check Docker version + # # run: | + # # docker --version + # # dockerd & - - name: Check folder - run: | - pwd - ls -la + # - name: Check folder + # run: | + # pwd + # ls -la - - name: Build and Push Docker Image - run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + # - name: Build and Push Docker Image + # run: | + # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . From eb066ba88839ad73c17b4002d826b093f9171c68 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 10:53:46 +0100 Subject: [PATCH 175/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 20f0b15..27400ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,8 @@ jobs: run: | pwd ls -la + - name: Checkout repository + uses: actions/checkout@v3 # checkout_repository: # runs-on: # group: ubuntu-latest From 599f66d065ab327c29481f3471f88fc4b25a7d76 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 10:54:26 +0100 Subject: [PATCH 176/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27400ab..b921c73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,8 +14,14 @@ jobs: run: | pwd ls -la + - name: Checkout repository uses: actions/checkout@v3 + + - name: Check folders + run: | + pwd + ls -la # checkout_repository: # runs-on: # group: ubuntu-latest From 71d7c3ce61aa1a7bd5ceaabe02b00e4089d2efa4 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 10:55:34 +0100 Subject: [PATCH 177/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b921c73..c631b88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - + - name: Check folders run: | pwd ls -la + + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d # checkout_repository: # runs-on: # group: ubuntu-latest From b6a2edb179e18dd99eb1da46f680fa8e25174d35 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 10:56:45 +0100 Subject: [PATCH 178/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c631b88..29bc72d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: test: runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Check folders run: | From 130f048eb1ef536fe002a2db19f7a25dc9466b9a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 10:58:48 +0100 Subject: [PATCH 179/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29bc72d..73eae05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,12 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + + - name: Build and Push Docker Image + run: | + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + docker push git.coopgo.io/coopgo-platform/mobility-accounts:test + # checkout_repository: # runs-on: # group: ubuntu-latest From cff757eff357052f4d70ed69aff0f697245c1d34 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:01:55 +0100 Subject: [PATCH 180/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73eae05..ddc25de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,7 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Build and Push Docker Image + options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' run: | docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test From af31c9676b0f0ec69053cfc09d74fc99cca4ee00 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:04:24 +0100 Subject: [PATCH 181/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddc25de..271760f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,8 +32,8 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Build and Push Docker Image - options: '-e DOCKER_HOST=unix:///run/user/1000/docker.sock -v /var/run/user/1000/docker.sock:/run/user/1000/docker.sock' + - name: Docker Build and Push + image: gitea/act_runner:nightly-dind-rootless run: | docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test From 7c18d786865eff46f3ea73713e8cecc43fd62c1a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:04:51 +0100 Subject: [PATCH 182/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 271760f..02a817e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,7 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Docker Build and Push - image: gitea/act_runner:nightly-dind-rootless + image: docker:20.10.7 run: | docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test From 0d984243f8246bacae8d67335583238b94ed0a1b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:06:42 +0100 Subject: [PATCH 183/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02a817e..d79ca5d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,11 +32,10 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Docker Build and Push - image: docker:20.10.7 - run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . - docker push git.coopgo.io/coopgo-platform/mobility-accounts:test + - name: runner + image: gitea/act_runner:nightly-dind-rootless + imagePullPolicy: Always + command: ["sh", "-c", "(sleep 10 && chmod a+rwx /run/user/1000/docker.sock) & /usr/bin/supervisord -c /etc/supervisord.conf"] # checkout_repository: # runs-on: From 42b48c4ce1d8a340b430c7b75fd0ffc560a1a3b1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:07:15 +0100 Subject: [PATCH 184/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d79ca5d..433ad8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: - name: runner image: gitea/act_runner:nightly-dind-rootless - imagePullPolicy: Always + imagePullPolicy: Always command: ["sh", "-c", "(sleep 10 && chmod a+rwx /run/user/1000/docker.sock) & /usr/bin/supervisord -c /etc/supervisord.conf"] # checkout_repository: From e45fc1b52e1002a1c1e6574ec2e2722ad0ad6865 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:09:04 +0100 Subject: [PATCH 185/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 433ad8d..c1afffd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,12 +31,15 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - + - name: runner image: gitea/act_runner:nightly-dind-rootless - imagePullPolicy: Always - command: ["sh", "-c", "(sleep 10 && chmod a+rwx /run/user/1000/docker.sock) & /usr/bin/supervisord -c /etc/supervisord.conf"] - + imagePullPolicy: Always + run: | + - "sh" + - "-c" + - "(sleep 10 && chmod a+rwx /run/user/1000/docker.sock) & /usr/bin/supervisord -c /etc/supervisord.conf" + # checkout_repository: # runs-on: # group: ubuntu-latest From f971df6ead807cc7bd0c86b37949a4e8b07049ce Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:09:43 +0100 Subject: [PATCH 186/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1afffd..6f54d19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,15 +31,12 @@ jobs: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - + - name: runner image: gitea/act_runner:nightly-dind-rootless imagePullPolicy: Always - run: | - - "sh" - - "-c" - - "(sleep 10 && chmod a+rwx /run/user/1000/docker.sock) & /usr/bin/supervisord -c /etc/supervisord.conf" - + run: ["sh", "-c", "(sleep 10 && chmod a+rwx /run/user/1000/docker.sock) & /usr/bin/supervisord -c /etc/supervisord.conf"] + # checkout_repository: # runs-on: # group: ubuntu-latest From 75b222a3c07629c6a61f02eafc4b2f16db4f3a6e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:10:23 +0100 Subject: [PATCH 187/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f54d19..9787c1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: runner image: gitea/act_runner:nightly-dind-rootless imagePullPolicy: Always - run: ["sh", "-c", "(sleep 10 && chmod a+rwx /run/user/1000/docker.sock) & /usr/bin/supervisord -c /etc/supervisord.conf"] + run: sleep 10 && chmod a+rwx /run/user/1000/docker.sock & /usr/bin/supervisord -c /etc/supervisord.conf # checkout_repository: # runs-on: From 99b72aa3903537d60547c50ef67a9be5960f4c8f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:11:55 +0100 Subject: [PATCH 188/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9787c1d..10e9e44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,9 +33,15 @@ jobs: password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: runner - image: gitea/act_runner:nightly-dind-rootless + image: docker:20.10.7 imagePullPolicy: Always - run: sleep 10 && chmod a+rwx /run/user/1000/docker.sock & /usr/bin/supervisord -c /etc/supervisord.conf + run: | + docker --version + dockerd & + pwd + ls -la + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN + docker push git.coopgo.io/coopgo-platform/mobility-accounts:test # checkout_repository: # runs-on: From 379fb05841493a58620c42e3c5e233184cc1e699 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:12:54 +0100 Subject: [PATCH 189/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10e9e44..8718979 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: dockerd & pwd ls -la - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test # checkout_repository: From 0f6a65d1a43f3533e09eacc35955a4e715584572 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:13:56 +0100 Subject: [PATCH 190/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8718979..cc9a04f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: dockerd & pwd ls -la - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . docker push git.coopgo.io/coopgo-platform/mobility-accounts:test # checkout_repository: From 4ef0c875af463fe3fd2fcc5757834f6df4d93beb Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:14:44 +0100 Subject: [PATCH 191/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc9a04f..5a20fe3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,8 +40,8 @@ jobs: dockerd & pwd ls -la - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - docker push git.coopgo.io/coopgo-platform/mobility-accounts:test + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN + # checkout_repository: # runs-on: From 47b86968d445d5c7b653c42567de4843749db8bf Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:15:25 +0100 Subject: [PATCH 192/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a20fe3..dab2698 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: dockerd & pwd ls -la - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN + docker buildx build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN # checkout_repository: From 618c9b92061996a6368304fc4fde61b584cf8011 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:15:55 +0100 Subject: [PATCH 193/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dab2698..2f97a53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: dockerd & pwd ls -la - docker buildx build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN + docker buildx build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . # checkout_repository: From 4222a348a46471ff2d31b4a922323d47db7756e8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:31:13 +0100 Subject: [PATCH 194/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f97a53..b16bacc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,6 @@ on: jobs: test: runs-on: ubuntu-latest - container: - image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Check folders run: | From 49dc3872c5653bcd83be0d0cc86862a6cc6d9c16 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:31:54 +0100 Subject: [PATCH 195/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b16bacc..2940bec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,8 @@ jobs: ls -la - name: Login to Docker Registry + image: docker:20.10.7 + imagePullPolicy: Always uses: docker/login-action@v2 with: registry: git.coopgo.io From 2ad8530736897dc0294ff656f2b6df5c62a3e8a1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:32:17 +0100 Subject: [PATCH 196/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2940bec..58aa885 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: ls -la - name: Login to Docker Registry - image: docker:20.10.7 + image: ghcr.io/catthehacker/ubuntu:act-latest imagePullPolicy: Always uses: docker/login-action@v2 with: From c36af927be13ac1a7f3470c29d9d0f92a002c83b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:33:54 +0100 Subject: [PATCH 197/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58aa885..21022ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: test: runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Check folders run: | @@ -20,12 +22,11 @@ jobs: - name: Check folders run: | + docker --version pwd ls -la - name: Login to Docker Registry - image: ghcr.io/catthehacker/ubuntu:act-latest - imagePullPolicy: Always uses: docker/login-action@v2 with: registry: git.coopgo.io From e0f2693f09f06c9f2f8444fe4cd9cf9b92520c9f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:34:40 +0100 Subject: [PATCH 198/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21022ae..5ff73de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,6 @@ on: jobs: test: runs-on: ubuntu-latest - container: - image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Check folders run: | @@ -27,6 +25,8 @@ jobs: ls -la - name: Login to Docker Registry + image: ghcr.io/catthehacker/ubuntu:act-latest + imagePullPolicy: Always uses: docker/login-action@v2 with: registry: git.coopgo.io From f1c77bfebfee549ca21492e39413c29983ef9759 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:36:17 +0100 Subject: [PATCH 199/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ff73de..1bf3f8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,13 @@ jobs: uses: actions/checkout@v3 - name: Check folders + run: | + pwd + ls -la + + - name: test + image: ghcr.io/catthehacker/ubuntu:act-latest + imagePullPolicy: Always run: | docker --version pwd From 62a756d2f3b0f423d68ca2c54cead3c0952730cf Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:44:59 +0100 Subject: [PATCH 200/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1bf3f8c..0a5b505 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,35 +22,27 @@ jobs: run: | pwd ls -la - - - name: test - image: ghcr.io/catthehacker/ubuntu:act-latest - imagePullPolicy: Always + + - name: Install Docker run: | + sudo apt-get update + sudo apt-get install apt-transport-https ca-certificates curl software-properties-common + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + sudo apt-get update + sudo apt-get install docker-ce docker --version - pwd - ls -la - name: Login to Docker Registry - image: ghcr.io/catthehacker/ubuntu:act-latest - imagePullPolicy: Always uses: docker/login-action@v2 with: registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - - name: runner - image: docker:20.10.7 - imagePullPolicy: Always - run: | - docker --version - dockerd & - pwd - ls -la - docker buildx build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - + - name: Docker Build + run: | + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN # checkout_repository: # runs-on: # group: ubuntu-latest From 09c7d1118855ea4f9116b69e9c4188078ad0baff Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:45:26 +0100 Subject: [PATCH 201/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a5b505..f8de041 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,12 +25,12 @@ jobs: - name: Install Docker run: | - sudo apt-get update - sudo apt-get install apt-transport-https ca-certificates curl software-properties-common - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - sudo apt-get update - sudo apt-get install docker-ce + apt-get update + apt-get install apt-transport-https ca-certificates curl software-properties-common + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - + add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + apt-get update + apt-get install docker-ce docker --version - name: Login to Docker Registry From f9fea0864af972bcab8ee462d5d820f50936e3c6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:45:59 +0100 Subject: [PATCH 202/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8de041..b7502ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,11 +26,11 @@ jobs: - name: Install Docker run: | apt-get update - apt-get install apt-transport-https ca-certificates curl software-properties-common + apt-get install -y apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" apt-get update - apt-get install docker-ce + apt-get install -y docker-ce docker --version - name: Login to Docker Registry From 09a72d4b4468f96a175d7c72c92672f57374c8a1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:48:53 +0100 Subject: [PATCH 203/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7502ea..12711ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,12 +26,15 @@ jobs: - name: Install Docker run: | apt-get update - apt-get install -y apt-transport-https ca-certificates curl software-properties-common - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + apt-get install ca-certificates curl + install -m 0755 -d /etc/apt/keyrings + curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc + chmod a+r /etc/apt/keyrings/docker.asc + echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update - apt-get install -y docker-ce - docker --version - name: Login to Docker Registry uses: docker/login-action@v2 From c6ec354d6d3ebf6de6e8034a1007eed13897a8ba Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:49:36 +0100 Subject: [PATCH 204/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12711ca..f66a34f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Install Docker run: | apt-get update - apt-get install ca-certificates curl + apt-get install -y ca-certificates curl install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc From cebf885278b3a4c2dd5fadb8d582e1155d083063 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:50:38 +0100 Subject: [PATCH 205/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f66a34f..73abfd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update + apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - name: Login to Docker Registry uses: docker/login-action@v2 From bd28920cdc90ede02b163904072da3f119082753 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:52:45 +0100 Subject: [PATCH 206/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73abfd8..ef78e4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: test: runs-on: ubuntu-latest + container: + image: ubuntu:latest steps: - name: Check folders run: | From 151e86dbee9670b1d2c03f7f673b777d64379345 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:56:23 +0100 Subject: [PATCH 207/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef78e4e..8546a38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,8 +17,14 @@ jobs: pwd ls -la + - name: Install git + run: | + apt-get update + apt-get install -y git + - name: Checkout repository - uses: actions/checkout@v3 + run: | + git clone -b {{inputs.parameters.gitBranch}} --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts . - name: Check folders run: | From fca47a69a39c120c87bf85d9c427af3618270f1a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:57:11 +0100 Subject: [PATCH 208/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8546a38..4c44461 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Checkout repository run: | - git clone -b {{inputs.parameters.gitBranch}} --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts . + git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts . - name: Check folders run: | From ac8e704ed76c7cc4bc16432a05d419cd0de26830 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 11:59:11 +0100 Subject: [PATCH 209/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c44461..50fb6a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,15 +46,12 @@ jobs: apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - name: Login to Docker Registry - uses: docker/login-action@v2 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d + run: | + docker login -u ncaron -p 6744954b4a3a43422e62e8d110f90de527ce094d git.coopgo.io - name: Docker Build run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN . # checkout_repository: # runs-on: # group: ubuntu-latest From ddf002ee1171cf9d539ed1354c30a091c701611c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 12:01:12 +0100 Subject: [PATCH 210/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50fb6a5..2620405 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,8 @@ jobs: tee /etc/apt/sources.list.d/docker.list > /dev/null apt-get update apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + docker --version + dockerd & - name: Login to Docker Registry run: | From 11077fd56fb719e02f2de293160e507418b38b40 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 12:03:46 +0100 Subject: [PATCH 211/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2620405..5142bd6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: test: runs-on: ubuntu-latest container: - image: ubuntu:latest + image: docker:20.10.7 steps: - name: Check folders run: | @@ -31,22 +31,6 @@ jobs: pwd ls -la - - name: Install Docker - run: | - apt-get update - apt-get install -y ca-certificates curl - install -m 0755 -d /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc - chmod a+r /etc/apt/keyrings/docker.asc - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update - apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin - docker --version - dockerd & - - name: Login to Docker Registry run: | docker login -u ncaron -p 6744954b4a3a43422e62e8d110f90de527ce094d git.coopgo.io From 99d1e55fa8244d2f901a1ffd186dc04ceafc1b4f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 12:06:15 +0100 Subject: [PATCH 212/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5142bd6..38b2ae2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,17 +10,17 @@ jobs: test: runs-on: ubuntu-latest container: - image: docker:20.10.7 + image: docker:git steps: - name: Check folders run: | pwd ls -la - - name: Install git - run: | - apt-get update - apt-get install -y git + # - name: Install git + # run: | + # apt-get update + # apt-get install -y git - name: Checkout repository run: | From d4eade0228ddd65fa53ca82a40ec868df6f0b48d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 12:08:09 +0100 Subject: [PATCH 213/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38b2ae2..5c31750 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,15 @@ jobs: - name: Login to Docker Registry run: | docker login -u ncaron -p 6744954b4a3a43422e62e8d110f90de527ce094d git.coopgo.io + + - name: test docker + run: | + docker --version + dockerd & + + - name: Run docker hello-world + run: | + docker run hello-world - name: Docker Build run: | From b4dfd1a173df546a33368b304215168f128a23e7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 13:40:22 +0100 Subject: [PATCH 214/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c31750..55afbba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,7 @@ jobs: - name: Docker Build run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN . + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . # checkout_repository: # runs-on: # group: ubuntu-latest From b7d0b6cda845fb0b8f36656f8772e25c563c1b2e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 15 Mar 2024 13:56:02 +0100 Subject: [PATCH 215/340] test workflow build and push on gitea registry --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55afbba..dc73593 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,11 +17,6 @@ jobs: pwd ls -la - # - name: Install git - # run: | - # apt-get update - # apt-get install -y git - - name: Checkout repository run: | git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts . From af2767e9dec96d4c1e33ab787f27a99043bc45f4 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:09:32 +0100 Subject: [PATCH 216/340] test --- .github/workflows/build.yml | 45 ++----------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc73593..7e95fb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,10 +7,8 @@ on: - dev jobs: - test: + checkout_repository: runs-on: ubuntu-latest - container: - image: docker:git steps: - name: Check folders run: | @@ -18,52 +16,13 @@ jobs: ls -la - name: Checkout repository - run: | - git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts . + uses: actions/checkout@v3 - name: Check folders run: | pwd ls -la - - name: Login to Docker Registry - run: | - docker login -u ncaron -p 6744954b4a3a43422e62e8d110f90de527ce094d git.coopgo.io - - - name: test docker - run: | - docker --version - dockerd & - - - name: Run docker hello-world - run: | - docker run hello-world - - - name: Docker Build - run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test . - # checkout_repository: - # runs-on: - # group: ubuntu-latest - # container: - # image: ghcr.io/catthehacker/ubuntu:act-latest - # volumes: - # - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts - - # steps: - # - name: Check folders - # run: | - # pwd - # ls -la - - # - name: Checkout repository - # uses: actions/checkout@v3 - - # - name: Check folders - # run: | - # pwd - # ls -la - # login_docker_registry: # runs-on: # group: ubuntu-latest From b99dfde7e115e8f9c8f1e763105c472eba66a355 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:11:11 +0100 Subject: [PATCH 217/340] test --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e95fb4..2c1a5e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Check folders run: | From aef4362b0428f4c1802748de3e06c439d9bbd808 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:18:11 +0100 Subject: [PATCH 218/340] test --- .github/workflows/build.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c1a5e3..278042b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,9 +17,23 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d + + - name: Use Kaniko + uses: int128/kaninko-action@v1 + with: + context: . + dockerfile: Dockerfile + destination: git.coopgo.io/coopgo-platform/mobility-accounts:test + build-args: | + ACCESS_TOKEN_USR=ncaron + ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - name: Check folders run: | From 9bb366864af64084572822066b26e19e8132f4e5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:19:30 +0100 Subject: [PATCH 219/340] test --- .github/workflows/build.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 278042b..a913855 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,15 +25,15 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Use Kaniko - uses: int128/kaninko-action@v1 - with: - context: . - dockerfile: Dockerfile - destination: git.coopgo.io/coopgo-platform/mobility-accounts:test - build-args: | - ACCESS_TOKEN_USR=ncaron - ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + # - name: Use Kaniko + # uses: int128/kaninko-action@v1 + # with: + # context: . + # dockerfile: Dockerfile + # destination: git.coopgo.io/coopgo-platform/mobility-accounts:test + # build-args: | + # ACCESS_TOKEN_USR=ncaron + # ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - name: Check folders run: | From d36abf1c238d5c50e855b8a4d6966124785be17d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:21:00 +0100 Subject: [PATCH 220/340] test --- .github/workflows/build.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a913855..31bc7a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest + container: + image: gcr.io/kaniko-project/executor:v1.21.1 steps: - name: Check folders run: | @@ -25,15 +27,15 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - # - name: Use Kaniko - # uses: int128/kaninko-action@v1 - # with: - # context: . - # dockerfile: Dockerfile - # destination: git.coopgo.io/coopgo-platform/mobility-accounts:test - # build-args: | - # ACCESS_TOKEN_USR=ncaron - # ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + - name: Use Kaniko + uses: int128/kaninko-action@v1 + with: + context: . + dockerfile: Dockerfile + destination: git.coopgo.io/coopgo-platform/mobility-accounts:test + build-args: | + ACCESS_TOKEN_USR=ncaron + ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - name: Check folders run: | From 68e1589fd1412182520294527fd8a9c30622f73b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:23:45 +0100 Subject: [PATCH 221/340] test --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31bc7a9..ccb7e19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,9 +30,8 @@ jobs: - name: Use Kaniko uses: int128/kaninko-action@v1 with: - context: . - dockerfile: Dockerfile - destination: git.coopgo.io/coopgo-platform/mobility-accounts:test + push: true + tags: git.coopgo.io/coopgo-platform/mobility-accounts:test build-args: | ACCESS_TOKEN_USR=ncaron ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d From 0998e825a456bea0cecca9dce79ae8caf5985ae8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:25:23 +0100 Subject: [PATCH 222/340] test --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccb7e19..1627c8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,6 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest - container: - image: gcr.io/kaniko-project/executor:v1.21.1 steps: - name: Check folders run: | From 2db156dbed3c0a5f6376c1756dbc462af1e027d0 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:34:30 +0100 Subject: [PATCH 223/340] test --- .github/workflows/build.yml | 46 +++++++++++++------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1627c8f..52495fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,37 +7,23 @@ on: - dev jobs: - checkout_repository: - runs-on: ubuntu-latest + build-and-push: + runs-on: ubuntu-latest steps: - - name: Check folders - run: | - pwd - ls -la - - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Login to Docker Registry - uses: docker/login-action@v2 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d - - - name: Use Kaniko - uses: int128/kaninko-action@v1 - with: - push: true - tags: git.coopgo.io/coopgo-platform/mobility-accounts:test - build-args: | - ACCESS_TOKEN_USR=ncaron - ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - - - name: Check folders - run: | - pwd - ls -la + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Build and Push Docker Image + run: | + mkdir -p /kaniko/.docker + echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"username\":\"$DOCKER_USERNAME\",\"password\":\"$DOCKER_PASSWORD\",\"auth\":\"$(echo -n "$DOCKER_USERNAME:$DOCKER_PASSWORD" | base64)\"}}}" > /kaniko/.docker/config.json + /kaniko/executor --context $GITHUB_WORKSPACE --dockerfile $GITHUB_WORKSPACE/Dockerfile --destination $DOCKER_REGISTRY/$IMAGE_NAME:$IMAGE_TAG + env: + DOCKER_REGISTRY: git.coopgo.io + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + IMAGE_NAME: coopgo-platform/mobility-accounts + IMAGE_TAG: test # login_docker_registry: # runs-on: From 0f41ecfce0679dd4ff418b85b588a639b488c435 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:38:59 +0100 Subject: [PATCH 224/340] test --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52495fb..06ed6d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Install Kaniko + run: | + mkdir -p /kaniko && \ + curl -L https://github.com/GoogleContainerTools/kaniko/releases/download/v1.6.0/kaniko-v1.6.0.tar.gz | tar xz -C /kaniko && \ + chmod +x /kaniko/executor + - name: Build and Push Docker Image run: | mkdir -p /kaniko/.docker From 71a6df958eb29d4a10dbff013e2671eeaa38a08f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:41:05 +0100 Subject: [PATCH 225/340] test --- .github/workflows/build.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06ed6d2..9bfe194 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,16 +8,13 @@ on: jobs: build-and-push: - runs-on: ubuntu-latest + runs-on: ubuntu-latest + container: + image: gcr.io/kaniko-project/executor:latest + steps: - name: Checkout repository uses: actions/checkout@v2 - - - name: Install Kaniko - run: | - mkdir -p /kaniko && \ - curl -L https://github.com/GoogleContainerTools/kaniko/releases/download/v1.6.0/kaniko-v1.6.0.tar.gz | tar xz -C /kaniko && \ - chmod +x /kaniko/executor - name: Build and Push Docker Image run: | From 531ff72b9e0b9f5b99d4940b0dc244c9bdb46a21 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:42:44 +0100 Subject: [PATCH 226/340] test --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9bfe194..a40d515 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,13 +8,16 @@ on: jobs: build-and-push: - runs-on: ubuntu-latest - container: - image: gcr.io/kaniko-project/executor:latest - + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 + + - name: Install Kaniko + run: | + mkdir -p /kaniko && \ + curl -L https://github.com/GoogleContainerTools/kaniko/releases/download/v1.21.1/kaniko-v1.21.1.tar.gz | tar xz -C /kaniko && \ + chmod +x /kaniko/executor - name: Build and Push Docker Image run: | From bac39121bd9c074f723a806b647d7979517a5480 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:46:03 +0100 Subject: [PATCH 227/340] test --- .github/workflows/build.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a40d515..415a335 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,16 +8,12 @@ on: jobs: build-and-push: - runs-on: ubuntu-latest + runs-on: ubuntu-latest + container: gcr.io/kaniko-project/executor steps: - name: Checkout repository uses: actions/checkout@v2 - - - name: Install Kaniko - run: | - mkdir -p /kaniko && \ - curl -L https://github.com/GoogleContainerTools/kaniko/releases/download/v1.21.1/kaniko-v1.21.1.tar.gz | tar xz -C /kaniko && \ - chmod +x /kaniko/executor + - name: Build and Push Docker Image run: | From ce9f17735cc29dc221802b900318acbd2d5720a4 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:50:21 +0100 Subject: [PATCH 228/340] test --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 415a335..a319851 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,6 @@ on: jobs: build-and-push: runs-on: ubuntu-latest - container: gcr.io/kaniko-project/executor steps: - name: Checkout repository uses: actions/checkout@v2 @@ -17,9 +16,12 @@ jobs: - name: Build and Push Docker Image run: | - mkdir -p /kaniko/.docker - echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"username\":\"$DOCKER_USERNAME\",\"password\":\"$DOCKER_PASSWORD\",\"auth\":\"$(echo -n "$DOCKER_USERNAME:$DOCKER_PASSWORD" | base64)\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context $GITHUB_WORKSPACE --dockerfile $GITHUB_WORKSPACE/Dockerfile --destination $DOCKER_REGISTRY/$IMAGE_NAME:$IMAGE_TAG + docker run --rm \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(pwd):/workspace \ + gcr.io/kaniko-project/executor:latest \ + --dockerfile /workspace/Dockerfile \ + --destination $DOCKER_REGISTRY/$IMAGE_NAME:$IMAGE_TAG env: DOCKER_REGISTRY: git.coopgo.io DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} From 428fa558e09caca8f27fb09e13562c58d51dd2ba Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:51:01 +0100 Subject: [PATCH 229/340] test --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a319851..f865331 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: build-and-push: runs-on: ubuntu-latest + container: + image: docker:latest steps: - name: Checkout repository uses: actions/checkout@v2 From c5c99dbe3cf9af1b9c6bec27cb69024fef645cb6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:51:39 +0100 Subject: [PATCH 230/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f865331..7a3a8cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: build-and-push: runs-on: ubuntu-latest container: - image: docker:latest + image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Checkout repository uses: actions/checkout@v2 From 11497f8cc4c3a8a424776a038036b7d8d6833780 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 11:52:33 +0100 Subject: [PATCH 231/340] test --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a3a8cf..82e7891 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,10 +10,10 @@ jobs: build-and-push: runs-on: ubuntu-latest container: - image: ghcr.io/catthehacker/ubuntu:act-latest + image: docker:latest steps: - - name: Checkout repository - uses: actions/checkout@v2 + # - name: Checkout repository + # uses: actions/checkout@v2 - name: Build and Push Docker Image From d24ed53b458695164787d3b2cb3f99ba26610b45 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 12:32:40 +0100 Subject: [PATCH 232/340] test --- .github/workflows/build.yml | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 82e7891..dc8191b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,29 +7,17 @@ on: - dev jobs: - build-and-push: + checkout_repository: runs-on: ubuntu-latest - container: - image: docker:latest + container: + image: moby/buildkit:latest steps: - # - name: Checkout repository - # uses: actions/checkout@v2 + # - name: Checkout repository + # uses: actions/checkout@v3 - - - name: Build and Push Docker Image - run: | - docker run --rm \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v $(pwd):/workspace \ - gcr.io/kaniko-project/executor:latest \ - --dockerfile /workspace/Dockerfile \ - --destination $DOCKER_REGISTRY/$IMAGE_NAME:$IMAGE_TAG - env: - DOCKER_REGISTRY: git.coopgo.io - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - IMAGE_NAME: coopgo-platform/mobility-accounts - IMAGE_TAG: test + - name: Build and Push Docker Image + run: | + buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg=ACCESS_TOKEN_USR=ncaron --opt build-arg=ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d --output type=image,name=git.coopgo.io/coopgo-platform/mobility-accounts:test,push=true,registry.insecure=true # login_docker_registry: # runs-on: From 3f8fa2d6ab11537f2188ae277771efb6e45da914 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 12:34:13 +0100 Subject: [PATCH 233/340] test --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc8191b..63058f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,8 +12,8 @@ jobs: container: image: moby/buildkit:latest steps: - # - name: Checkout repository - # uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - name: Build and Push Docker Image run: | From b3fa9e3b383d3f28010945803841f30c2e25cce3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 12:53:16 +0100 Subject: [PATCH 234/340] test --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63058f2..adc13c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,12 +9,17 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest - container: - image: moby/buildkit:latest + steps: - name: Checkout repository uses: actions/checkout@v3 + - name: Download buildctl + run: | + curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz + tar -xzf buildkit.tar.gz + mv buildkit-v0.9.0.linux-amd64/buildctl /usr/local/bin/ + - name: Build and Push Docker Image run: | buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg=ACCESS_TOKEN_USR=ncaron --opt build-arg=ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d --output type=image,name=git.coopgo.io/coopgo-platform/mobility-accounts:test,push=true,registry.insecure=true From de604ac77b751b026e89268ef2d893ceeb1e5b59 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 12:55:36 +0100 Subject: [PATCH 235/340] test --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index adc13c5..f405bad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,7 @@ jobs: run: | curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz tar -xzf buildkit.tar.gz + ls -la mv buildkit-v0.9.0.linux-amd64/buildctl /usr/local/bin/ - name: Build and Push Docker Image From 379a7fa4edf5e70bae7010bc46d7d3b67eaa9be3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 12:56:28 +0100 Subject: [PATCH 236/340] test --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f405bad..16fd18c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,8 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + # - name: Checkout repository + # uses: actions/checkout@v3 - name: Download buildctl run: | From 6b1b4d6624103d21ab9977eef7bf839b0f49891e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 12:59:00 +0100 Subject: [PATCH 237/340] test --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16fd18c..7e2aeb8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,15 +11,15 @@ jobs: runs-on: ubuntu-latest steps: - # - name: Checkout repository - # uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - name: Download buildctl run: | curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz tar -xzf buildkit.tar.gz ls -la - mv buildkit-v0.9.0.linux-amd64/buildctl /usr/local/bin/ + mv bin/buildctl /usr/local/bin/ - name: Build and Push Docker Image run: | From f21e6d2cef9614260144d47d0ffee8ded3597058 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:02:59 +0100 Subject: [PATCH 238/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e2aeb8..f68668a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz tar -xzf buildkit.tar.gz ls -la - mv bin/buildctl /usr/local/bin/ + mv bin/. /usr/local/bin/ - name: Build and Push Docker Image run: | From 22647dcf11ec2542d800c35e8130618934124f27 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:03:41 +0100 Subject: [PATCH 239/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f68668a..51ccb68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz tar -xzf buildkit.tar.gz ls -la - mv bin/. /usr/local/bin/ + mv bin/ /usr/local/bin/ - name: Build and Push Docker Image run: | From 0c26ed9b081263ac1783272f2b2e17ce5b9f194f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:05:11 +0100 Subject: [PATCH 240/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51ccb68..074fb16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz tar -xzf buildkit.tar.gz ls -la - mv bin/ /usr/local/bin/ + mv bin/* /usr/local/bin/ - name: Build and Push Docker Image run: | From cf352c69118583da4720d39f1427077b64298488 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:05:54 +0100 Subject: [PATCH 241/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 074fb16..cb1b064 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz tar -xzf buildkit.tar.gz ls -la - mv bin/* /usr/local/bin/ + mv -v bin/* /usr/local/bin/ - name: Build and Push Docker Image run: | From 22a5a692d0d8334b34913073bbed9481ee34022b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:08:05 +0100 Subject: [PATCH 242/340] test --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb1b064..30cfd72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,7 @@ jobs: tar -xzf buildkit.tar.gz ls -la mv -v bin/* /usr/local/bin/ + service buildkitd.sock start - name: Build and Push Docker Image run: | From a6f7116e0315cf00e5d512fd1c2fe2677d32755e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:08:25 +0100 Subject: [PATCH 243/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30cfd72..cc6cbc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: tar -xzf buildkit.tar.gz ls -la mv -v bin/* /usr/local/bin/ - service buildkitd.sock start + service buildkitd start - name: Build and Push Docker Image run: | From 7c4a3f7a37e43e95e0206ddd170f92d36924d11d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:09:55 +0100 Subject: [PATCH 244/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc6cbc2..a1dc210 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: tar -xzf buildkit.tar.gz ls -la mv -v bin/* /usr/local/bin/ - service buildkitd start + buildctl --help - name: Build and Push Docker Image run: | From d456eb80d4751a0a2fbc252937e40e3de0829ef5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:11:42 +0100 Subject: [PATCH 245/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1dc210..2d76ef5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Build and Push Docker Image run: | - buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg=ACCESS_TOKEN_USR=ncaron --opt build-arg=ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d --output type=image,name=git.coopgo.io/coopgo-platform/mobility-accounts:test,push=true,registry.insecure=true + buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg=ACCESS_TOKEN_USR=ncaron --opt build-arg=ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d --output type=image,name=git.coopgo.io/coopgo-platform/mobility-accounts:test,push=true,registry.insecure=true --addr tcp://localhost:1234 # login_docker_registry: # runs-on: From ba05c496b254342a2d6a555dbdda73e429d2d2a4 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:18:41 +0100 Subject: [PATCH 246/340] test --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d76ef5..fe13dcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,10 @@ jobs: ls -la mv -v bin/* /usr/local/bin/ buildctl --help + + - name: Set up Buildkit address + run: | + echo "export BUILDKIT_HOST=tcp://127.0.0.1:1234" >> $GITHUB_ENV - name: Build and Push Docker Image run: | From b87f21d6f7659dd1d310c5fb684ddd557df9928c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:19:05 +0100 Subject: [PATCH 247/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe13dcc..5d7bb31 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: - name: Build and Push Docker Image run: | - buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg=ACCESS_TOKEN_USR=ncaron --opt build-arg=ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d --output type=image,name=git.coopgo.io/coopgo-platform/mobility-accounts:test,push=true,registry.insecure=true --addr tcp://localhost:1234 + buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg=ACCESS_TOKEN_USR=ncaron --opt build-arg=ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d --output type=image,name=git.coopgo.io/coopgo-platform/mobility-accounts:test,push=true,registry.insecure=true # login_docker_registry: # runs-on: From 6f08957805ee3532259087e83b670e1b229988f9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:20:33 +0100 Subject: [PATCH 248/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d7bb31..3659672 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Buildkit address run: | - echo "export BUILDKIT_HOST=tcp://127.0.0.1:1234" >> $GITHUB_ENV + echo "export BUILDKIT_HOST=unix:///path/to/your/buildkitd.sock" >> $GITHUB_ENV - name: Build and Push Docker Image run: | From ca8c6319d54d8e5c32b62ebd0a25b4228112e6ee Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:22:16 +0100 Subject: [PATCH 249/340] test --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3659672..aa3ae5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,8 @@ jobs: ls -la mv -v bin/* /usr/local/bin/ buildctl --help + service buildkitd restart + ls -la /run/buildkit/ - name: Set up Buildkit address run: | From a02870f2f8906da7804cfc80cf54c41256513a3e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 20 Mar 2024 13:27:21 +0100 Subject: [PATCH 250/340] test --- .github/workflows/build.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa3ae5c..e686924 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,24 +9,15 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest + container: + image: moby/buildkit:latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Install Git + run: apt-get update && apt-get install -y git - - name: Download buildctl - run: | - curl -L https://github.com/moby/buildkit/releases/download/v0.9.0/buildkit-v0.9.0.linux-amd64.tar.gz -o buildkit.tar.gz - tar -xzf buildkit.tar.gz - ls -la - mv -v bin/* /usr/local/bin/ - buildctl --help - service buildkitd restart - ls -la /run/buildkit/ - - - name: Set up Buildkit address - run: | - echo "export BUILDKIT_HOST=unix:///path/to/your/buildkitd.sock" >> $GITHUB_ENV + - name: Checkout Repository + run: git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts . - name: Build and Push Docker Image run: | From 784173e9ee18de2ab5a193d9af308ce836eccea3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:23:40 +0100 Subject: [PATCH 251/340] test --- .github/workflows/build.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e686924..e65ee3d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,19 +10,23 @@ jobs: checkout_repository: runs-on: ubuntu-latest container: - image: moby/buildkit:latest + image: gitea/act_runner:nightly-dind-rootless steps: - - name: Install Git - run: apt-get update && apt-get install -y git - - name: Checkout Repository - run: git clone -b dev --depth 1 https://ncaron:6744954b4a3a43422e62e8d110f90de527ce094d@git.coopgo.io/coopgo-platform/mobility-accounts . + uses: actions/checkout@v2 + + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d + - name: Build and Push Docker Image run: | - buildctl build --frontend dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg=ACCESS_TOKEN_USR=ncaron --opt build-arg=ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d --output type=image,name=git.coopgo.io/coopgo-platform/mobility-accounts:test,push=true,registry.insecure=true - + docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_US # login_docker_registry: # runs-on: # group: ubuntu-latest From e9b9dd889cbb998027e04399bb187cefa01d2b68 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:25:16 +0100 Subject: [PATCH 252/340] test --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e65ee3d..b93bf2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,8 @@ jobs: image: gitea/act_runner:nightly-dind-rootless steps: - - name: Checkout Repository - uses: actions/checkout@v2 + # - name: Checkout Repository + # uses: actions/checkout@v2 - name: Login to Docker Registry uses: docker/login-action@v2 From a76e039e82497c1c48ad7d493eeb0f882b8fa86f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:31:40 +0100 Subject: [PATCH 253/340] test --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b93bf2a..8abd77e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,12 +16,12 @@ jobs: # - name: Checkout Repository # uses: actions/checkout@v2 - - name: Login to Docker Registry - uses: docker/login-action@v2 - with: - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d + # - name: Login to Docker Registry + # uses: docker/login-action@v2 + # with: + # registry: git.coopgo.io + # username: ncaron + # password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Build and Push Docker Image From 23c399cf35a58cc845ef20c5dcb06d6e6ff21026 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:32:01 +0100 Subject: [PATCH 254/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8abd77e..1c790fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Build and Push Docker Image run: | - docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_US + docker build . -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_US # login_docker_registry: # runs-on: # group: ubuntu-latest From 122d0cf7a7dd9bbdd9691086d4d2392cee9f00bc Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:45:02 +0100 Subject: [PATCH 255/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c790fd..9e14b2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: checkout_repository: runs-on: ubuntu-latest container: - image: gitea/act_runner:nightly-dind-rootless + image: nickos0695/dind-test steps: # - name: Checkout Repository From 041167384204a33e09411d9174bb4233c4135056 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:46:21 +0100 Subject: [PATCH 256/340] test --- .github/workflows/build.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e14b2d..ec48400 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,24 +9,29 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest - container: - image: nickos0695/dind-test steps: - # - name: Checkout Repository - # uses: actions/checkout@v2 + - name: Checkout Repository + uses: actions/checkout@v2 - # - name: Login to Docker Registry - # uses: docker/login-action@v2 - # with: - # registry: git.coopgo.io - # username: ncaron - # password: 6744954b4a3a43422e62e8d110f90de527ce094d + - name: Login to Docker Registry + uses: docker/login-action@v2 + with: + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d - name: Build and Push Docker Image - run: | - docker build . -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_US + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: git.coopgo.io/coopgo-platform/mobility-accounts:test + build-args: | + ACCESS_TOKEN_USR=ncaron + ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d # login_docker_registry: # runs-on: # group: ubuntu-latest From b253f4159e4e4507b182e0b224064b040d498e64 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:47:09 +0100 Subject: [PATCH 257/340] test --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec48400..26f36a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,8 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Checkout Repository From 974a8b071a5c15d2cb2fe05271e9f63894064f46 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:58:17 +0100 Subject: [PATCH 258/340] test --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26f36a9..896088b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,11 @@ jobs: runs-on: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest - + + env: + - name: DOCKER_HOST + value: tcp://localhost:2375 + steps: - name: Checkout Repository uses: actions/checkout@v2 From 197510cda8634d5a98d158edd8e37bee29c68114 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 10:59:05 +0100 Subject: [PATCH 259/340] test --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 896088b..351460e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,8 +14,8 @@ jobs: env: - name: DOCKER_HOST - value: tcp://localhost:2375 - + value: unix:///run/user/1000/docker.sock + steps: - name: Checkout Repository uses: actions/checkout@v2 From 74366a8cdb1954a0abf133a8f1ac43b20567eede Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 11:00:24 +0100 Subject: [PATCH 260/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 351460e..799de11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: env: - name: DOCKER_HOST - value: unix:///run/user/1000/docker.sock + value: unix:///var/run/docker.sock steps: - name: Checkout Repository From 13680dba9bce7558df34ba8f0239251e663541a8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 11:07:04 +0100 Subject: [PATCH 261/340] test --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 799de11..53a138a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,6 @@ jobs: runs-on: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:act-latest - - env: - - name: DOCKER_HOST - value: unix:///var/run/docker.sock steps: - name: Checkout Repository @@ -27,6 +23,12 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + - name: Install Docker + run: curl -fsSL https://get.docker.com | sh + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build and Push Docker Image uses: docker/build-push-action@v2 From e38fb54459908d5e7e95e43ec224cdbdf4edd3a3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 11:09:19 +0100 Subject: [PATCH 262/340] test --- .github/workflows/build.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53a138a..961f0d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,13 +9,14 @@ on: jobs: checkout_repository: runs-on: ubuntu-latest - container: - image: ghcr.io/catthehacker/ubuntu:act-latest steps: - name: Checkout Repository uses: actions/checkout@v2 + - name: Install Docker + run: curl -fsSL https://get.docker.com | sh + - name: Login to Docker Registry uses: docker/login-action@v2 with: @@ -23,9 +24,6 @@ jobs: username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - name: Install Docker - run: curl -fsSL https://get.docker.com | sh - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 From a3ee7cc98ee6689a53fa5adf3263fca1f40f810c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 11:11:41 +0100 Subject: [PATCH 263/340] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 961f0d7..9b0e746 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v2 - name: Install Docker - run: curl -fsSL https://get.docker.com | sh + run: curl -fsSL https://get.docker.com/rootless | sh - name: Login to Docker Registry uses: docker/login-action@v2 From 604322aa25a85553104d7c8519fb724fe5c042f5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Thu, 21 Mar 2024 11:41:21 +0100 Subject: [PATCH 264/340] test --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b0e746..c075a89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,9 @@ jobs: uses: actions/checkout@v2 - name: Install Docker - run: curl -fsSL https://get.docker.com/rootless | sh + run: | + apt-get update + apt-get install -y docker.io - name: Login to Docker Registry uses: docker/login-action@v2 From 2ca47bd7a16762a3c8694f4e6299e113e606ce75 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Thu, 21 Mar 2024 19:30:24 +0100 Subject: [PATCH 265/340] add kubernetes driver --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c075a89..700574f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,8 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + with: + driver: kubernetes - name: Build and Push Docker Image From de9844717195277f41dc47b2ab8059b0aaa853fc Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Thu, 21 Mar 2024 19:49:00 +0100 Subject: [PATCH 266/340] Try with Kaniko --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 700574f..48f7f03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,29 +19,44 @@ jobs: apt-get update apt-get install -y docker.io - - name: Login to Docker Registry - uses: docker/login-action@v2 + - name: Kaniko build and push + uses: aevea/action-kaniko@master with: + build_file: Dockerfile registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - with: - driver: kubernetes - - - - name: Build and Push Docker Image - uses: docker/build-push-action@v2 - with: - context: . - file: ./Dockerfile - push: true - tags: git.coopgo.io/coopgo-platform/mobility-accounts:test - build-args: | + image: coopgo-platform/mobility-accounts + tag: latest + cache: true + cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache + extra-args: | ACCESS_TOKEN_USR=ncaron ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + + + # - name: Login to Docker Registry + # uses: docker/login-action@v2 + # with: + # registry: git.coopgo.io + # username: ncaron + # password: 6744954b4a3a43422e62e8d110f90de527ce094d + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v2 + + + # - name: Build and Push Docker Image + # uses: docker/build-push-action@v2 + # with: + # context: . + # file: ./Dockerfile + # push: true + # tags: git.coopgo.io/coopgo-platform/mobility-accounts:test + # build-args: | + # ACCESS_TOKEN_USR=ncaron + # ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + # login_docker_registry: # runs-on: # group: ubuntu-latest From 3f1d407a8fd305b04fdd2400d15e05f45fb76ad2 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Thu, 21 Mar 2024 19:51:35 +0100 Subject: [PATCH 267/340] Try with Kaniko --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48f7f03..b441c38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,11 +14,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install Docker - run: | - apt-get update - apt-get install -y docker.io - - name: Kaniko build and push uses: aevea/action-kaniko@master with: @@ -35,6 +30,11 @@ jobs: ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + # - name: Install Docker + # run: | + # apt-get update + # apt-get install -y docker.io + # - name: Login to Docker Registry # uses: docker/login-action@v2 # with: From a14f4185802f29ea07bafc09b176e23a088643c9 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 08:46:00 +0100 Subject: [PATCH 268/340] Try with Buildah --- .github/workflows/build.yml | 47 ++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b441c38..28159e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,24 +12,49 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Kaniko build and push - uses: aevea/action-kaniko@master + # BUILDAH + - name: Buildah Action + uses: redhat-actions/buildah-build@v2 + id: build-image with: - build_file: Dockerfile - registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d image: coopgo-platform/mobility-accounts - tag: latest - cache: true - cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache - extra-args: | + tags: test + containerfiles: | + ./Dockerfile + build-args: | ACCESS_TOKEN_USR=ncaron ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + - name: Push To Registry + id: push-to-registry + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build-image.outputs.image }} + tags: ${{ steps.build-image.outputs.tags }} + registry: git.coopgo.io + username: ncaron + password: 6744954b4a3a43422e62e8d110f90de527ce094d + # KANIKO + # - name: Kaniko build and push + # uses: aevea/action-kaniko@master + # with: + # build_file: Dockerfile + # registry: git.coopgo.io + # username: ncaron + # password: 6744954b4a3a43422e62e8d110f90de527ce094d + # image: coopgo-platform/mobility-accounts + # tag: latest + # cache: true + # cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache + # extra-args: | + # ACCESS_TOKEN_USR=ncaron + # ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + + + # DOCKER # - name: Install Docker # run: | # apt-get update From 678d1cef20839f93e4a3000f81e6a7f4a2658c53 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 08:47:28 +0100 Subject: [PATCH 269/340] Try with Buildah --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28159e2..b0c8fae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,11 @@ jobs: uses: actions/checkout@v4 # BUILDAH + - name: Install Docker + run: | + apt-get update + apt-get install -y buildah podman + - name: Buildah Action uses: redhat-actions/buildah-build@v2 id: build-image From f86693da90eb0d206fad6d9fa7f654cace272495 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 08:51:34 +0100 Subject: [PATCH 270/340] Try with Buildah --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0c8fae..043edf5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,7 @@ jobs: build-args: | ACCESS_TOKEN_USR=ncaron ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + BUILDAH_ISOLATION=chroot - name: Push To Registry id: push-to-registry From 632d99458ab138932533d1313626756cf4a3a637 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 10:06:27 +0100 Subject: [PATCH 271/340] Try with Buildah --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 043edf5..f2ad757 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ jobs: run: | apt-get update apt-get install -y buildah podman + export BUILDAH_ISOLATION=chroot - name: Buildah Action uses: redhat-actions/buildah-build@v2 @@ -31,7 +32,6 @@ jobs: build-args: | ACCESS_TOKEN_USR=ncaron ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - BUILDAH_ISOLATION=chroot - name: Push To Registry id: push-to-registry From 7dd32f8e68472882a011d5dacbebbb566f35453d Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 10:14:52 +0100 Subject: [PATCH 272/340] Try with Buildah --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2ad757..dc79310 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 # BUILDAH - - name: Install Docker + - name: Install Buildah run: | apt-get update apt-get install -y buildah podman @@ -32,6 +32,8 @@ jobs: build-args: | ACCESS_TOKEN_USR=ncaron ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + extra-args: | + BUILDAH_ISOLATION=chroot - name: Push To Registry id: push-to-registry From 4ce7c8d00ff96f072c84e1178f4e8a62b79e57da Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 09:18:09 +0100 Subject: [PATCH 273/340] Try with Buildah --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc79310..c405901 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: build-args: | ACCESS_TOKEN_USR=ncaron ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - extra-args: | + envs: | BUILDAH_ISOLATION=chroot - name: Push To Registry From 7ad30a24cf67aec823d3b519bb1b6413031972ab Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 09:27:04 +0100 Subject: [PATCH 274/340] Try with Buildah --- .github/workflows/build.yml | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c405901..f963443 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,53 +14,53 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - # BUILDAH - - name: Install Buildah - run: | - apt-get update - apt-get install -y buildah podman - export BUILDAH_ISOLATION=chroot - - name: Buildah Action - uses: redhat-actions/buildah-build@v2 - id: build-image + KANIKO + - name: Kaniko build and push + uses: aevea/action-kaniko@master with: - image: coopgo-platform/mobility-accounts - tags: test - containerfiles: | - ./Dockerfile - build-args: | - ACCESS_TOKEN_USR=ncaron - ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - envs: | - BUILDAH_ISOLATION=chroot - - - name: Push To Registry - id: push-to-registry - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} + build_file: Dockerfile registry: git.coopgo.io username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d + image: coopgo-platform/mobility-accounts + tag: latest + cache: true + cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache + extra-args: | + ACCESS_TOKEN_USR=ncaron + ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d - # KANIKO - # - name: Kaniko build and push - # uses: aevea/action-kaniko@master + + + # BUILDAH + # - name: Install Buildah + # run: | + # apt-get update + # apt-get install -y buildah podman + # export BUILDAH_ISOLATION=chroot + + # - name: Buildah Action + # uses: redhat-actions/buildah-build@v2 + # id: build-image # with: - # build_file: Dockerfile - # registry: git.coopgo.io - # username: ncaron - # password: 6744954b4a3a43422e62e8d110f90de527ce094d # image: coopgo-platform/mobility-accounts - # tag: latest - # cache: true - # cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache - # extra-args: | + # tags: test + # containerfiles: | + # ./Dockerfile + # build-args: | # ACCESS_TOKEN_USR=ncaron # ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + # - name: Push To Registry + # id: push-to-registry + # uses: redhat-actions/push-to-registry@v2 + # with: + # image: ${{ steps.build-image.outputs.image }} + # tags: ${{ steps.build-image.outputs.tags }} + # registry: git.coopgo.io + # username: ncaron + # password: 6744954b4a3a43422e62e8d110f90de527ce094d # DOCKER # - name: Install Docker From 0c7d2f22b768934caa63f1a233c63db3323d475a Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Fri, 22 Mar 2024 09:28:26 +0100 Subject: [PATCH 275/340] Try with Buildah --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f963443..594abd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - KANIKO + # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master with: From 4fedd2a72f063593d69ca05550f24eb0211b2f30 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:05:07 +0100 Subject: [PATCH 276/340] test secrets --- .github/workflows/build.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 594abd2..7dca5b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,15 +21,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d + username: ${{DOCKER_USERNAME}} + password: ${{DOCKER_PASSWORD}} image: coopgo-platform/mobility-accounts - tag: latest + tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=ncaron - ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} + ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} @@ -49,8 +49,8 @@ jobs: # containerfiles: | # ./Dockerfile # build-args: | - # ACCESS_TOKEN_USR=ncaron - # ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + # ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} + # ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} # - name: Push To Registry # id: push-to-registry @@ -59,8 +59,8 @@ jobs: # image: ${{ steps.build-image.outputs.image }} # tags: ${{ steps.build-image.outputs.tags }} # registry: git.coopgo.io - # username: ncaron - # password: 6744954b4a3a43422e62e8d110f90de527ce094d + # username: ${{DOCKER_USERNAME}} + # password: ${{DOCKER_PASSWORD}} # DOCKER # - name: Install Docker @@ -72,8 +72,8 @@ jobs: # uses: docker/login-action@v2 # with: # registry: git.coopgo.io - # username: ncaron - # password: 6744954b4a3a43422e62e8d110f90de527ce094d + # username: ${{DOCKER_USERNAME}} + # password: ${{DOCKER_PASSWORD}} # - name: Set up Docker Buildx # uses: docker/setup-buildx-action@v2 @@ -87,8 +87,8 @@ jobs: # push: true # tags: git.coopgo.io/coopgo-platform/mobility-accounts:test # build-args: | - # ACCESS_TOKEN_USR=ncaron - # ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + # ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} + # ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} # login_docker_registry: # runs-on: @@ -103,8 +103,8 @@ jobs: # uses: docker/login-action@v2 # with: # registry: git.coopgo.io - # username: ncaron - # password: 6744954b4a3a43422e62e8d110f90de527ce094d + # username: ${{DOCKER_USERNAME}} + # password: ${{DOCKER_PASSWORD}} # - name: Check folders # run: | @@ -144,4 +144,4 @@ jobs: # - name: Build and Push Docker Image # run: | - # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=ncaron --build-arg ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d . + # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} --build-arg ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} . From 12b02788fc91a294e13a9a78a3d2cdc9b3715608 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:06:50 +0100 Subject: [PATCH 277/340] test secrets --- .github/workflows/build.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7dca5b6..ee5c316 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,15 +21,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ${{DOCKER_USERNAME}} - password: ${{DOCKER_PASSWORD}} + username: ${{secrets.DOCKER_USERNAME}} + password: ${{secrets.DOCKER_PASSWORD}} image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} - ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} + ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} + ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} @@ -49,8 +49,8 @@ jobs: # containerfiles: | # ./Dockerfile # build-args: | - # ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} - # ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} + # ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} + # ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} # - name: Push To Registry # id: push-to-registry @@ -59,8 +59,8 @@ jobs: # image: ${{ steps.build-image.outputs.image }} # tags: ${{ steps.build-image.outputs.tags }} # registry: git.coopgo.io - # username: ${{DOCKER_USERNAME}} - # password: ${{DOCKER_PASSWORD}} + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} # DOCKER # - name: Install Docker @@ -72,8 +72,8 @@ jobs: # uses: docker/login-action@v2 # with: # registry: git.coopgo.io - # username: ${{DOCKER_USERNAME}} - # password: ${{DOCKER_PASSWORD}} + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} # - name: Set up Docker Buildx # uses: docker/setup-buildx-action@v2 @@ -87,8 +87,8 @@ jobs: # push: true # tags: git.coopgo.io/coopgo-platform/mobility-accounts:test # build-args: | - # ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} - # ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} + # ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} + # ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} # login_docker_registry: # runs-on: @@ -103,8 +103,8 @@ jobs: # uses: docker/login-action@v2 # with: # registry: git.coopgo.io - # username: ${{DOCKER_USERNAME}} - # password: ${{DOCKER_PASSWORD}} + # username: ${{secrets.DOCKER_USERNAME}} + # password: ${{secrets.DOCKER_PASSWORD}} # - name: Check folders # run: | @@ -144,4 +144,4 @@ jobs: # - name: Build and Push Docker Image # run: | - # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=${{DOCKER_USERNAME}} --build-arg ACCESS_TOKEN_PWD=${{DOCKER_PASSWORD}} . + # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} --build-arg ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} . From 4917662c4936834e6d7b8036e1923a819d1d6bda Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:07:57 +0100 Subject: [PATCH 278/340] test secrets --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee5c316..4328e43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,15 +21,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_PASSWORD}} + username: "${{secrets.DOCKER_USERNAME}}" + password: "${{secrets.DOCKER_PASSWORD}}" image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} - ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} + ACCESS_TOKEN_USR="${{secrets.DOCKER_USERNAME}}" + ACCESS_TOKEN_PWD="${{secrets.DOCKER_PASSWORD}}" From 24e619b4a9f23f4d7fad72b21992ec0854bca1e8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:09:38 +0100 Subject: [PATCH 279/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4328e43..6870332 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,8 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: "${{secrets.DOCKER_USERNAME}}" - password: "${{secrets.DOCKER_PASSWORD}}" + username: "${{ secrets.DOCKER_USERNAME }}" + password: "${{ secrets.DOCKER_PASSWORD }}" image: coopgo-platform/mobility-accounts tag: test cache: true From 5a0bf300601f48bf76e5c2abd58f5862a7c0ffa4 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:10:24 +0100 Subject: [PATCH 280/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6870332..d43d311 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: build_file: Dockerfile registry: git.coopgo.io username: "${{ secrets.DOCKER_USERNAME }}" - password: "${{ secrets.DOCKER_PASSWORD }}" + password: 6744954b4a3a43422e62e8d110f90de527ce094d image: coopgo-platform/mobility-accounts tag: test cache: true From 31ac6306c028e437d40991ee210d23359997fd3d Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:12:44 +0100 Subject: [PATCH 281/340] test secrets --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d43d311..8aefccb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,6 @@ jobs: cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | ACCESS_TOKEN_USR="${{secrets.DOCKER_USERNAME}}" - ACCESS_TOKEN_PWD="${{secrets.DOCKER_PASSWORD}}" From fe0f6dd7f6a2f8db188d428dde6827dd98fbccb8 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:15:14 +0100 Subject: [PATCH 282/340] test secrets --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8aefccb..4328e43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,14 +21,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: "${{ secrets.DOCKER_USERNAME }}" - password: 6744954b4a3a43422e62e8d110f90de527ce094d + username: "${{secrets.DOCKER_USERNAME}}" + password: "${{secrets.DOCKER_PASSWORD}}" image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | ACCESS_TOKEN_USR="${{secrets.DOCKER_USERNAME}}" + ACCESS_TOKEN_PWD="${{secrets.DOCKER_PASSWORD}}" From 932e5ad90f5ed0d26b74fbe1c85aff926c033c2b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:17:36 +0100 Subject: [PATCH 283/340] test secrets --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4328e43..f035558 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - + + - name: Debug secrets + run: | + echo "DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}" + echo "DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}" # KANIKO - name: Kaniko build and push From dfd1c964d7b19f9e238a54d8ac2f8a75b1c797b0 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:30:09 +0100 Subject: [PATCH 284/340] test secrets --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f035558..8660c11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,8 @@ jobs: - name: Debug secrets run: | - echo "DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}" - echo "DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}" + echo "DOCKER_USERNAME: ${{ secrets.GIT_USERNAME }}" + echo "DOCKER_PASSWORD: ${{ secrets.GIT_PWD }}" # KANIKO - name: Kaniko build and push @@ -25,15 +25,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: "${{secrets.DOCKER_USERNAME}}" - password: "${{secrets.DOCKER_PASSWORD}}" + username: "${{secrets.GIT_USERNAME}}" + password: "${{secrets.GIT_PWD}}" image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR="${{secrets.DOCKER_USERNAME}}" - ACCESS_TOKEN_PWD="${{secrets.DOCKER_PASSWORD}}" + ACCESS_TOKEN_USR="${{secrets.GIT_USERNAME}}" + ACCESS_TOKEN_PWD="${{secrets.GIT_PWD}}" From 744863873e840859b697a2f39a398a3f534d7a47 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 10:31:31 +0100 Subject: [PATCH 285/340] test secrets --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8660c11..cd01ddb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,15 +25,14 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: "${{secrets.GIT_USERNAME}}" - password: "${{secrets.GIT_PWD}}" + password: 6744954b4a3a43422e62e8d110f90de527ce094d image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache - extra-args: | - ACCESS_TOKEN_USR="${{secrets.GIT_USERNAME}}" - ACCESS_TOKEN_PWD="${{secrets.GIT_PWD}}" + # extra-args: | + # ACCESS_TOKEN_USR="${{secrets.GIT_USERNAME}}" + # ACCESS_TOKEN_PWD="${{secrets.GIT_PWD}}" From 8663a8b4004ae219bb4442cc4a7baaa59ed330f1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 12:03:10 +0100 Subject: [PATCH 286/340] test secrets --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd01ddb..46ed7fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,14 +25,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io + username: ncaron password: 6744954b4a3a43422e62e8d110f90de527ce094d image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache - # extra-args: | - # ACCESS_TOKEN_USR="${{secrets.GIT_USERNAME}}" - # ACCESS_TOKEN_PWD="${{secrets.GIT_PWD}}" + extra-args: | + ACCESS_TOKEN_USR=ncaron + ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d From c1c89c637cf595f02dcac4b782b420a9fcd6a27a Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:32:09 +0100 Subject: [PATCH 287/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46ed7fd..e0d5e1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,8 @@ jobs: - name: Debug secrets run: | - echo "DOCKER_USERNAME: ${{ secrets.GIT_USERNAME }}" - echo "DOCKER_PASSWORD: ${{ secrets.GIT_PWD }}" + echo "DOCKER_USERNAME: ${{ gitea.actor }}" + echo "DOCKER_PASSWORD: ${{ secrets.GITEA_TOKEN }}" # KANIKO - name: Kaniko build and push From f05ea0af06b0b308ef8f9f260b8c77b02283b2c3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:34:06 +0100 Subject: [PATCH 288/340] test secrets --- .github/workflows/build.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0d5e1a..817fce1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,11 +13,6 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v4 - - - name: Debug secrets - run: | - echo "DOCKER_USERNAME: ${{ gitea.actor }}" - echo "DOCKER_PASSWORD: ${{ secrets.GITEA_TOKEN }}" # KANIKO - name: Kaniko build and push @@ -25,15 +20,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ncaron - password: 6744954b4a3a43422e62e8d110f90de527ce094d + username: ${{ gitea.actor }} + password: ${{ secrets.GITEA_TOKEN }} image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=ncaron - ACCESS_TOKEN_PWD=6744954b4a3a43422e62e8d110f90de527ce094d + ACCESS_TOKEN_USR=${{ gitea.actor }} + ACCESS_TOKEN_PWD=${{ secrets.GITEA_TOKEN }} From e7d93699299180786617b90c6e84471d82271e8b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:35:17 +0100 Subject: [PATCH 289/340] test secrets --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 817fce1..2c1b8c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,15 +20,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ${{ gitea.actor }} - password: ${{ secrets.GITEA_TOKEN }} + username: "${{ gitea.actor }}" + password: "${{ secrets.GITEA_TOKEN }}" image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=${{ gitea.actor }} - ACCESS_TOKEN_PWD=${{ secrets.GITEA_TOKEN }} + ACCESS_TOKEN_USR="${{ gitea.actor }}" + ACCESS_TOKEN_PWD="${{ secrets.GITEA_TOKEN }}" From b6cec61b316a98bcc39c42951f4e899162a9ea46 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:39:27 +0100 Subject: [PATCH 290/340] test secrets --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c1b8c5..4c0642b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,15 +20,15 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: "${{ gitea.actor }}" - password: "${{ secrets.GITEA_TOKEN }}" + username: ncaron + password: ${{ secrets.GITEA_TOKEN }} image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR="${{ gitea.actor }}" - ACCESS_TOKEN_PWD="${{ secrets.GITEA_TOKEN }}" + ACCESS_TOKEN_USR=${{ gitea.actor }} + ACCESS_TOKEN_PWD=${{ secrets.GITEA_TOKEN }} From 0c34321400757dd3d35275fdd3f2a0ab4ce55f2c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:43:12 +0100 Subject: [PATCH 291/340] test secrets --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c0642b..87ff9da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,14 +14,19 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Set username and password env + run: + echo "ACCESS_TOKEN_USR=${{gitea.actor}}" + echo "ACCESS_TOKEN_PWD=${{secret.GITEA_TOKEN}}" + # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master with: build_file: Dockerfile registry: git.coopgo.io - username: ncaron - password: ${{ secrets.GITEA_TOKEN }} + username: ACCESS_TOKEN_USR + password: ACCESS_TOKEN_PWD image: coopgo-platform/mobility-accounts tag: test cache: true From ff11bd78b0449ee7dbe9db9cae02ab84acbfe4dc Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:43:50 +0100 Subject: [PATCH 292/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87ff9da..6d00dad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: - name: Set username and password env run: echo "ACCESS_TOKEN_USR=${{gitea.actor}}" - echo "ACCESS_TOKEN_PWD=${{secret.GITEA_TOKEN}}" + echo "ACCESS_TOKEN_PWD=${{secrets.GITEA_TOKEN}}" # KANIKO - name: Kaniko build and push From 6629c50aa5889a2e4fa3677f4e7c3ad15d9b6aa2 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:44:22 +0100 Subject: [PATCH 293/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d00dad..d77dbed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,8 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ACCESS_TOKEN_USR - password: ACCESS_TOKEN_PWD + username: $ACCESS_TOKEN_USR + password: $ACCESS_TOKEN_PWD image: coopgo-platform/mobility-accounts tag: test cache: true From 3fa71d8b2ec2786654012aae5918b74f339418e1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:47:38 +0100 Subject: [PATCH 294/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d77dbed..d38aad9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,8 +25,8 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: $ACCESS_TOKEN_USR - password: $ACCESS_TOKEN_PWD + username: ${{env.ACCESS_TOKEN_USR}} + password: ${{env.ACCESS_TOKEN_PWD}} image: coopgo-platform/mobility-accounts tag: test cache: true From 6ca42da67496407f922060c099cfc7d906d69fd4 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:49:19 +0100 Subject: [PATCH 295/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d38aad9..7c56f0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: - name: Set username and password env run: echo "ACCESS_TOKEN_USR=${{gitea.actor}}" - echo "ACCESS_TOKEN_PWD=${{secrets.GITEA_TOKEN}}" + echo "ACCESS_TOKEN_PWD=${{gitea.token}}" # KANIKO - name: Kaniko build and push From f56de46ed97591dba2d06f69993a0accb0cb6d62 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:49:57 +0100 Subject: [PATCH 296/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c56f0b..14d01f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ${{env.ACCESS_TOKEN_USR}} + username: ${{gitea.actor}} password: ${{env.ACCESS_TOKEN_PWD}} image: coopgo-platform/mobility-accounts tag: test From d950e799e15939ae2fd230caf0689c855b4714c6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 13:50:25 +0100 Subject: [PATCH 297/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14d01f1..5c953e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: build_file: Dockerfile registry: git.coopgo.io username: ${{gitea.actor}} - password: ${{env.ACCESS_TOKEN_PWD}} + password: ${{gitea.token}} image: coopgo-platform/mobility-accounts tag: test cache: true From 2c79e9eca666953de862d07c7bb999c852db9e1c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:02:39 +0100 Subject: [PATCH 298/340] test secrets --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c953e2..5d8880b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,15 +25,18 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ${{gitea.actor}} - password: ${{gitea.token}} + username: $USER + password: $PASSWORD image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | ACCESS_TOKEN_USR=${{ gitea.actor }} - ACCESS_TOKEN_PWD=${{ secrets.GITEA_TOKEN }} + ACCESS_TOKEN_PWD=${{ gitea.token}} + env: + USER: ${{gitea.actor}} + PASSWORD: ${{gitea.token}} From 15649e452a3b3679ad53a91a85b6f5fcc5adc6fa Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:03:52 +0100 Subject: [PATCH 299/340] test secrets --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d8880b..090bc0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,11 +14,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Set username and password env - run: - echo "ACCESS_TOKEN_USR=${{gitea.actor}}" - echo "ACCESS_TOKEN_PWD=${{gitea.token}}" - # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master From 39e4d265cb026a2098336bd19639f9cf21ce1015 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:05:23 +0100 Subject: [PATCH 300/340] test secrets --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 090bc0d..ecb8c53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,10 +29,10 @@ jobs: extra-args: | ACCESS_TOKEN_USR=${{ gitea.actor }} ACCESS_TOKEN_PWD=${{ gitea.token}} - env: - USER: ${{gitea.actor}} - PASSWORD: ${{gitea.token}} - + env: + USER: ${{ gitea.actor }} + PASSWORD: ${{ gitea.token}} + # BUILDAH From 35e84a61213d6883ec0bee1d28b91695bde70190 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:07:32 +0100 Subject: [PATCH 301/340] test secrets --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecb8c53..f5d522c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,11 +27,11 @@ jobs: cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=${{ gitea.actor }} - ACCESS_TOKEN_PWD=${{ gitea.token}} + ACCESS_TOKEN_USR=$USER + ACCESS_TOKEN_PWD=$PASSWORD env: USER: ${{ gitea.actor }} - PASSWORD: ${{ gitea.token}} + PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d From cc1fee615b3a7db423e424326e333d40c7bf6adb Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:07:59 +0100 Subject: [PATCH 302/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5d522c..1e4eede 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: ACCESS_TOKEN_USR=$USER ACCESS_TOKEN_PWD=$PASSWORD env: - USER: ${{ gitea.actor }} + USER: ncaron PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d From 146eb44ffe235065549b0577e173af357ef65356 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:10:35 +0100 Subject: [PATCH 303/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e4eede..b1a810c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,8 +20,8 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: $USER - password: $PASSWORD + username: ${{env.USER}} + password: ${{env.PASSWORD}} image: coopgo-platform/mobility-accounts tag: test cache: true From d27c2a266aca7ae692f71ccf20291bc7fa767765 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:12:07 +0100 Subject: [PATCH 304/340] test secrets --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1a810c..c247fd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,11 +27,11 @@ jobs: cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=$USER - ACCESS_TOKEN_PWD=$PASSWORD + ACCESS_TOKEN_USR=${{env.USER}} + ACCESS_TOKEN_PWD=${{env.PASSWORD}} env: - USER: ncaron - PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d + USER: ${{gitea.actor}} + PASSWORD: ${{gitea.token}} From 5493dca7ef42d80d2266a65123d1a4b4ef324b4b Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:13:08 +0100 Subject: [PATCH 305/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c247fd2..610c815 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: ACCESS_TOKEN_PWD=${{env.PASSWORD}} env: USER: ${{gitea.actor}} - PASSWORD: ${{gitea.token}} + PASSWORD: ${{secrets.GITEA_TOKEN}} From 18e40b975dc3fa6c19c77bad25397dce114210bc Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:15:16 +0100 Subject: [PATCH 306/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 610c815..3783b48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,8 +30,8 @@ jobs: ACCESS_TOKEN_USR=${{env.USER}} ACCESS_TOKEN_PWD=${{env.PASSWORD}} env: - USER: ${{gitea.actor}} - PASSWORD: ${{secrets.GITEA_TOKEN}} + USER: ${{github.actor}} + PASSWORD: ${{secrets.GITHUB_TOKEN}} From 597e01d290134fb03d42522e0d6a78d3d0a13019 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:16:48 +0100 Subject: [PATCH 307/340] test secrets --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3783b48..3824434 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,11 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Test Variables + run: + echo "${{github.actor}}" + echo "${{secrets.GITHUB_TOKEN}}" + # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master From c91fbccf3443d3a99bea19aa70887e16b0287fd9 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:17:28 +0100 Subject: [PATCH 308/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3824434..671221b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,8 @@ jobs: - name: Test Variables run: - echo "${{github.actor}}" - echo "${{secrets.GITHUB_TOKEN}}" + echo "USER:${{github.actor}}" + echo "PASS:${{secrets.GITHUB_TOKEN}}" # KANIKO - name: Kaniko build and push From 7e2210e5cc985a5acf3bcec70bd4dd31b585a6bd Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:18:29 +0100 Subject: [PATCH 309/340] test secrets --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 671221b..736bf69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,11 @@ jobs: - name: Test Variables run: - echo "USER:${{github.actor}}" - echo "PASS:${{secrets.GITHUB_TOKEN}}" + echo "USER:${{env.USER}}" + echo "PASS:${{env.PASSWORD}}" + env: + USER: ${{github.actor}} + PASSWORD: ${{secrets.GITHUB_TOKEN}} # KANIKO - name: Kaniko build and push From d5ac13cc2ed368220d8f48deaacc8cf53b7e71e7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:18:53 +0100 Subject: [PATCH 310/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 736bf69..3ba7692 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Test Variables - run: + run: | echo "USER:${{env.USER}}" echo "PASS:${{env.PASSWORD}}" env: From d22c69542d69335856a9374ec614e22cb48ab01c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:22:17 +0100 Subject: [PATCH 311/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ba7692..6e895c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: ACCESS_TOKEN_PWD=${{env.PASSWORD}} env: USER: ${{github.actor}} - PASSWORD: ${{secrets.GITHUB_TOKEN}} + PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d From 7728a7d0a4295ece5b168dfeb047162160759ac5 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:23:44 +0100 Subject: [PATCH 312/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e895c2..f194432 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ${{env.USER}} + username: ${{github.actor}} password: ${{env.PASSWORD}} image: coopgo-platform/mobility-accounts tag: test From 5d78a8897584009f48c1e38fb7d4df191c9c1f79 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:40:06 +0100 Subject: [PATCH 313/340] test secrets --- .github/workflows/build.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f194432..0021781 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,31 +14,22 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Test Variables - run: | - echo "USER:${{env.USER}}" - echo "PASS:${{env.PASSWORD}}" - env: - USER: ${{github.actor}} - PASSWORD: ${{secrets.GITHUB_TOKEN}} - # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master with: build_file: Dockerfile registry: git.coopgo.io - username: ${{github.actor}} + username: ${{gitea.actor}} password: ${{env.PASSWORD}} image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | - ACCESS_TOKEN_USR=${{env.USER}} + ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{env.PASSWORD}} env: - USER: ${{github.actor}} PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d From 8c427b45bb61a7e1cd35cc86427b3f97b82ee949 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:47:08 +0100 Subject: [PATCH 314/340] test secrets --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0021781..2331318 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,16 +21,14 @@ jobs: build_file: Dockerfile registry: git.coopgo.io username: ${{gitea.actor}} - password: ${{env.PASSWORD}} + password: ${{secrets.PASSWORD}} image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | ACCESS_TOKEN_USR=${{gitea.actor}} - ACCESS_TOKEN_PWD=${{env.PASSWORD}} - env: - PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d + ACCESS_TOKEN_PWD=${{secrets.PASSWORD}} From b9f3c0e074124591e31d0011390a246ea7d8f37f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:48:34 +0100 Subject: [PATCH 315/340] test secrets --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2331318..0021781 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,14 +21,16 @@ jobs: build_file: Dockerfile registry: git.coopgo.io username: ${{gitea.actor}} - password: ${{secrets.PASSWORD}} + password: ${{env.PASSWORD}} image: coopgo-platform/mobility-accounts tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache extra-args: | ACCESS_TOKEN_USR=${{gitea.actor}} - ACCESS_TOKEN_PWD=${{secrets.PASSWORD}} + ACCESS_TOKEN_PWD=${{env.PASSWORD}} + env: + PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d From 461f5d1f5f3ff5235659143e519026083562c2c7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:51:46 +0100 Subject: [PATCH 316/340] test secrets --- .github/workflows/build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0021781..6ecb5b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,18 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Test Gitea + run: | + echo "GITEA_Actor: ${{gitea.actor}}" + echo "GITEA_Repository: ${{gitea.repository}}" + echo "GITEA_Workspace: ${{gitea.workspace}}" + echo "GITEA_SHA: ${{gitea.sha}}" + echo "GITEA_REF: ${{gitea.ref}}" + echo "GITEA_EVENT: ${{gitea.event}}" + echo "GITEA_BASE_REF: ${{gitea.base_ref}}" + + + # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master From 8ae62e7aef699bf5360816c6fcce75701de4d2ae Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:53:29 +0100 Subject: [PATCH 317/340] test secrets --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ecb5b3..8a3a8b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: echo "GITEA_REF: ${{gitea.ref}}" echo "GITEA_EVENT: ${{gitea.event}}" echo "GITEA_BASE_REF: ${{gitea.base_ref}}" - + echo "GITEA_Branches: ${{gitea.branches}}" # KANIKO @@ -34,7 +34,7 @@ jobs: registry: git.coopgo.io username: ${{gitea.actor}} password: ${{env.PASSWORD}} - image: coopgo-platform/mobility-accounts + image: ${{gitea.repository}} tag: test cache: true cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache From 4f3b3b12b37e159938b2fa2233cb5427b18a5a82 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 14:58:33 +0100 Subject: [PATCH 318/340] test secrets --- .github/workflows/build.yml | 39 ++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a3a8b4..25e3320 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,31 +18,26 @@ jobs: run: | echo "GITEA_Actor: ${{gitea.actor}}" echo "GITEA_Repository: ${{gitea.repository}}" - echo "GITEA_Workspace: ${{gitea.workspace}}" - echo "GITEA_SHA: ${{gitea.sha}}" echo "GITEA_REF: ${{gitea.ref}}" - echo "GITEA_EVENT: ${{gitea.event}}" - echo "GITEA_BASE_REF: ${{gitea.base_ref}}" - echo "GITEA_Branches: ${{gitea.branches}}" - + echo "GITEA_REF_NAME: ${{gitea.ref_name}}" # KANIKO - - name: Kaniko build and push - uses: aevea/action-kaniko@master - with: - build_file: Dockerfile - registry: git.coopgo.io - username: ${{gitea.actor}} - password: ${{env.PASSWORD}} - image: ${{gitea.repository}} - tag: test - cache: true - cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache - extra-args: | - ACCESS_TOKEN_USR=${{gitea.actor}} - ACCESS_TOKEN_PWD=${{env.PASSWORD}} - env: - PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d + # - name: Kaniko build and push + # uses: aevea/action-kaniko@master + # with: + # build_file: Dockerfile + # registry: git.coopgo.io + # username: ${{gitea.actor}} + # password: ${{env.PASSWORD}} + # image: ${{gitea.repository}} + # tag: test + # cache: true + # cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache + # extra-args: | + # ACCESS_TOKEN_USR=${{gitea.actor}} + # ACCESS_TOKEN_PWD=${{env.PASSWORD}} + # env: + # PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d From 9fe3d6b6bc4e8abc72cffa94a786b72adb642ea0 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 15:02:03 +0100 Subject: [PATCH 319/340] test secrets --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25e3320..21a42b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,9 @@ jobs: run: | echo "GITEA_Actor: ${{gitea.actor}}" echo "GITEA_Repository: ${{gitea.repository}}" - echo "GITEA_REF: ${{gitea.ref}}" echo "GITEA_REF_NAME: ${{gitea.ref_name}}" + echo "GITEA_Action: ${{gitea.action}}" + echo "GITEA_Action_ref: ${{gitea.action_ref}}" # KANIKO # - name: Kaniko build and push From c6c7cd72e4bbf33b0782a14b7c8ff9eef57643da Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 15:04:43 +0100 Subject: [PATCH 320/340] test secrets --- .github/workflows/build.yml | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21a42b2..a798eb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,26 +19,24 @@ jobs: echo "GITEA_Actor: ${{gitea.actor}}" echo "GITEA_Repository: ${{gitea.repository}}" echo "GITEA_REF_NAME: ${{gitea.ref_name}}" - echo "GITEA_Action: ${{gitea.action}}" - echo "GITEA_Action_ref: ${{gitea.action_ref}}" # KANIKO - # - name: Kaniko build and push - # uses: aevea/action-kaniko@master - # with: - # build_file: Dockerfile - # registry: git.coopgo.io - # username: ${{gitea.actor}} - # password: ${{env.PASSWORD}} - # image: ${{gitea.repository}} - # tag: test - # cache: true - # cache_registry: git.coopgo.io/coopgo-platform/mobility-accounts/cache - # extra-args: | - # ACCESS_TOKEN_USR=${{gitea.actor}} - # ACCESS_TOKEN_PWD=${{env.PASSWORD}} - # env: - # PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d + - name: Kaniko build and push + uses: aevea/action-kaniko@master + with: + build_file: Dockerfile + registry: git.coopgo.io + username: ${{gitea.actor}} + password: ${{env.PASSWORD}} + image: ${{gitea.repository}} + tag: ${{gitea.ref_name}} + cache: true + cache_registry: git.coopgo.io/${{gitea.repository}}/cache + extra-args: | + ACCESS_TOKEN_USR=${{gitea.actor}} + ACCESS_TOKEN_PWD=${{env.PASSWORD}} + env: + PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d From f469e1da01bdafda717d5e1cc229bc4330f147d3 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Fri, 22 Mar 2024 16:22:05 +0100 Subject: [PATCH 321/340] test secrets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a798eb7..6ce8244 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: build_file: Dockerfile registry: git.coopgo.io username: ${{gitea.actor}} - password: ${{env.PASSWORD}} + password: ${{secrets.PASSWORD}} image: ${{gitea.repository}} tag: ${{gitea.ref_name}} cache: true From 901faeadc328cc29ffb44925aeb0dc87550ede2e Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Sun, 24 Mar 2024 20:00:26 +0100 Subject: [PATCH 322/340] Try repository token --- .github/workflows/build.yml | 127 +----------------------------------- 1 file changed, 2 insertions(+), 125 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ce8244..168d800 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Test Gitea - run: | - echo "GITEA_Actor: ${{gitea.actor}}" - echo "GITEA_Repository: ${{gitea.repository}}" - echo "GITEA_REF_NAME: ${{gitea.ref_name}}" - # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master @@ -27,128 +21,11 @@ jobs: build_file: Dockerfile registry: git.coopgo.io username: ${{gitea.actor}} - password: ${{secrets.PASSWORD}} + password: ${{secrets.registry_token}} image: ${{gitea.repository}} tag: ${{gitea.ref_name}} cache: true cache_registry: git.coopgo.io/${{gitea.repository}}/cache extra-args: | ACCESS_TOKEN_USR=${{gitea.actor}} - ACCESS_TOKEN_PWD=${{env.PASSWORD}} - env: - PASSWORD: 6744954b4a3a43422e62e8d110f90de527ce094d - - - - # BUILDAH - # - name: Install Buildah - # run: | - # apt-get update - # apt-get install -y buildah podman - # export BUILDAH_ISOLATION=chroot - - # - name: Buildah Action - # uses: redhat-actions/buildah-build@v2 - # id: build-image - # with: - # image: coopgo-platform/mobility-accounts - # tags: test - # containerfiles: | - # ./Dockerfile - # build-args: | - # ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} - # ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} - - # - name: Push To Registry - # id: push-to-registry - # uses: redhat-actions/push-to-registry@v2 - # with: - # image: ${{ steps.build-image.outputs.image }} - # tags: ${{ steps.build-image.outputs.tags }} - # registry: git.coopgo.io - # username: ${{secrets.DOCKER_USERNAME}} - # password: ${{secrets.DOCKER_PASSWORD}} - - # DOCKER - # - name: Install Docker - # run: | - # apt-get update - # apt-get install -y docker.io - - # - name: Login to Docker Registry - # uses: docker/login-action@v2 - # with: - # registry: git.coopgo.io - # username: ${{secrets.DOCKER_USERNAME}} - # password: ${{secrets.DOCKER_PASSWORD}} - - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - - - # - name: Build and Push Docker Image - # uses: docker/build-push-action@v2 - # with: - # context: . - # file: ./Dockerfile - # push: true - # tags: git.coopgo.io/coopgo-platform/mobility-accounts:test - # build-args: | - # ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} - # ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} - - # login_docker_registry: - # runs-on: - # group: ubuntu-latest - # container: - # image: ghcr.io/catthehacker/ubuntu:act-latest - # volumes: - # - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts - - # steps: - # - name: Login to Docker Registry - # uses: docker/login-action@v2 - # with: - # registry: git.coopgo.io - # username: ${{secrets.DOCKER_USERNAME}} - # password: ${{secrets.DOCKER_PASSWORD}} - - # - name: Check folders - # run: | - # pwd - # ls -la - - # build_and_push_image: - # runs-on: - # group: ubuntu-latest - # container: - # image: docker:20.10.7 - # volumes: - # - /workspace/coopgo-platform/mobility-accounts:/workspace/coopgo-platform/mobility-accounts - # steps: - # # - name: Get Gitea Tags - # # id: get_tags - # # run: | - # # git fetch --tags - # # latest_tag=$(git describe --tags --abbrev=0) - # # echo "Latest tag found: $latest_tag" - # # echo "::set-output name=latest_tag::$latest_tag" - - # # - name: Test tags - # # run: | - # # echo "Latest tag found: ${{ steps.get_tags.outputs.latest_tag }}" - - - # # - name: Check Docker version - # # run: | - # # docker --version - # # dockerd & - - # - name: Check folder - # run: | - # pwd - # ls -la - - # - name: Build and Push Docker Image - # run: | - # docker build -t git.coopgo.io/coopgo-platform/mobility-accounts:test --build-arg ACCESS_TOKEN_USR=${{secrets.DOCKER_USERNAME}} --build-arg ACCESS_TOKEN_PWD=${{secrets.DOCKER_PASSWORD}} . + ACCESS_TOKEN_PWD=${{gitea.token}} From 88915178666986a6f9f811beb1c12883b9e74d5d Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Sun, 24 Mar 2024 20:04:50 +0100 Subject: [PATCH 323/340] Try repository token --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 168d800..c102625 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,13 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Test Gitea + run: | + echo "GITEA_Actor: ${{gitea.actor}}" + echo "GITEA_Repository: ${{gitea.repository}}" + echo "GITEA_REF_NAME: ${{gitea.ref_name}}" + echo "REGISTRY_TOKEN: ${{secrets.registry_token}}" + # KANIKO - name: Kaniko build and push uses: aevea/action-kaniko@master @@ -29,3 +36,4 @@ jobs: extra-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} + From 170b599f54ed8c4449c976697c79fa7abae98942 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Sun, 24 Mar 2024 20:14:28 +0100 Subject: [PATCH 324/340] Try repository token --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c102625..56731eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: echo "GITEA_Actor: ${{gitea.actor}}" echo "GITEA_Repository: ${{gitea.repository}}" echo "GITEA_REF_NAME: ${{gitea.ref_name}}" - echo "REGISTRY_TOKEN: ${{secrets.registry_token}}" + echo "REGISTRY_USER: ${{secrets.registry_user}}" # KANIKO - name: Kaniko build and push @@ -27,7 +27,7 @@ jobs: with: build_file: Dockerfile registry: git.coopgo.io - username: ${{gitea.actor}} + username: ${{secrets.registry_user}} password: ${{secrets.registry_token}} image: ${{gitea.repository}} tag: ${{gitea.ref_name}} From 9486551ee5203de1b843cabd3f9c4cbde87a8134 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Sun, 24 Mar 2024 23:02:53 +0100 Subject: [PATCH 325/340] Try Docker Buildx with Kubernetes driver --- .github/workflows/build.yml | 61 +++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56731eb..9186943 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,33 +7,56 @@ on: - dev jobs: - checkout_repository: + build_and_push: runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Test Gitea - run: | - echo "GITEA_Actor: ${{gitea.actor}}" - echo "GITEA_Repository: ${{gitea.repository}}" - echo "GITEA_REF_NAME: ${{gitea.ref_name}}" - echo "REGISTRY_USER: ${{secrets.registry_user}}" - - # KANIKO - - name: Kaniko build and push - uses: aevea/action-kaniko@master + - uses: azure/k8s-set-context@v4 + with: + method: kubeconfig + kubeconfig: ${{secrets.buildx_kubeconfig}} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: kubernetes + driver-opts: | + namespace=gitea + + - name: Login to Docker Registry + uses: docker/login-action@v3 with: - build_file: Dockerfile registry: git.coopgo.io - username: ${{secrets.registry_user}} - password: ${{secrets.registry_token}} - image: ${{gitea.repository}} - tag: ${{gitea.ref_name}} - cache: true - cache_registry: git.coopgo.io/${{gitea.repository}}/cache - extra-args: | + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}} + build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} + + # BUILD WITH KANIKO + # - name: Kaniko build and push + # uses: aevea/action-kaniko@master + # with: + # build_file: Dockerfile + # registry: git.coopgo.io + # username: ${{secrets.registry_user}} + # password: ${{secrets.registry_token}} + # image: ${{gitea.repository}} + # tag: ${{gitea.ref_name}} + # cache: true + # cache_registry: git.coopgo.io/${{gitea.repository}}/cache + # extra-args: | + # ACCESS_TOKEN_USR=${{gitea.actor}} + # ACCESS_TOKEN_PWD=${{gitea.token}} From 2501dabdba2cdffc8a8886ea460d5445d6433949 Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Sun, 24 Mar 2024 23:12:54 +0100 Subject: [PATCH 326/340] Try Docker Buildx with Kubernetes driver --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9186943..53e3cac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,10 +11,16 @@ jobs: runs-on: ubuntu-latest steps: + - name: Install Docker + run: | + apt-get update + apt-get install -y docker.io + - name: Checkout Repository uses: actions/checkout@v4 - - uses: azure/k8s-set-context@v4 + - name: Set Kubernetes Context + uses: azure/k8s-set-context@v4 with: method: kubeconfig kubeconfig: ${{secrets.buildx_kubeconfig}} From d588fe2b6740971a6f58016b3bacbddf3362c379 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 27 Mar 2024 13:32:50 +0100 Subject: [PATCH 327/340] comment postgres config & add mongodb config in config.go --- config.go | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/config.go b/config.go index e33b255..eb675fb 100755 --- a/config.go +++ b/config.go @@ -7,23 +7,38 @@ import ( ) func ReadConfig() (*viper.Viper, error) { + // defaults := map[string]any{ + // "name": "COOPGO Mobility Accounts", + // "dev_env": false, + // "storage": map[string]any{ + // "db": map[string]any{ + // "type": "psql", + // "psql": map[string]any{ + // "user": "postgres", + // "password": "postgres", + // "host": "localhost", + // "port": "5432", + // "dbname": "coopgo_platform", + // "sslmode": "disable", + // "schema": "mobilityaccounts", + // "tables": map[string]any{ + // "accounts": "accounts", + // "accounts_auth_local": "accounts_auth_local", + // }, + // }, + // }, defaults := map[string]any{ "name": "COOPGO Mobility Accounts", "dev_env": false, "storage": map[string]any{ "db": map[string]any{ - "type": "psql", - "psql": map[string]any{ - "user": "postgres", - "password": "postgres", - "host": "localhost", - "port": "5432", - "dbname": "coopgo_platform", - "sslmode": "disable", - "schema": "mobilityaccounts", - "tables": map[string]any{ - "accounts": "accounts", - "accounts_auth_local": "accounts_auth_local", + "type": "mongodb", + "mongodb": map[string]any{ + "host": "localhost", + "port": "27017", + "db_name": "coopgo_platform", + "collections": map[string]any{ + "users": "users", }, }, }, From e192d2253fdd5fe90762bc05a6f9bea2fd8a7092 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 27 Mar 2024 13:41:32 +0100 Subject: [PATCH 328/340] edit folder .github to .gitea --- {.github => .gitea}/workflows/build.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.github => .gitea}/workflows/build.yml (100%) diff --git a/.github/workflows/build.yml b/.gitea/workflows/build.yml similarity index 100% rename from .github/workflows/build.yml rename to .gitea/workflows/build.yml From ae04ab23fcda44f15bf87f6165ea2d8b0bca0bc7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 10:00:47 +0200 Subject: [PATCH 329/340] edit build.yml - add buil on tags --- .gitea/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 53e3cac..bdf369e 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -2,6 +2,8 @@ name: Build and Push Docker Image on: push: + tags: + - '*' branches: - main - dev From 4c787bdc8612b13fcabbcfdf1303da1e47a68fb7 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 10:19:14 +0200 Subject: [PATCH 330/340] edit build.yml - add flavor --- .gitea/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index bdf369e..c229e66 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -47,7 +47,11 @@ jobs: context: . push: true tags: | - git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}} + git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}} + flavor: | + latest=auto + prefix= + suffix= build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} From a70ef04ffd774427af03b9306b7b18d39dc1be65 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 10:24:09 +0200 Subject: [PATCH 331/340] edit build.yml - edit flavor --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index c229e66..26715e8 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -49,7 +49,7 @@ jobs: tags: | git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}} flavor: | - latest=auto + latest=true prefix= suffix= build-args: | From 140d3668944430b1b083ec9b9c70f8567fa6aae6 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 10:55:13 +0200 Subject: [PATCH 332/340] edit build.yml - edit flavor --- .gitea/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 26715e8..5a7154c 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -48,6 +48,7 @@ jobs: push: true tags: | git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}} + type=ref,event=tag flavor: | latest=true prefix= From d2a8c572748179fa1928a8430bb3f25464c781d1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 10:59:18 +0200 Subject: [PATCH 333/340] edit build.yml - try if for tag --- .gitea/workflows/build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 5a7154c..d323215 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -41,18 +41,17 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} + - name: Determine if it's a tag or a branch + id: tag_or_branch + run: echo ::set-output name=is_tag::$(if [[ $GITHUB_REF == refs/tags/* ]]; then echo true; else echo false; fi) + - name: Build and push uses: docker/build-push-action@v5 with: context: . push: true tags: | - git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}} - type=ref,event=tag - flavor: | - latest=true - prefix= - suffix= + git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}}${{ steps.tag_or_branch.outputs.is_tag == 'true' ? '' : ',latest' }} build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} From b028120e47eebb906181dd1fef7d94e06286ce22 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 11:03:07 +0200 Subject: [PATCH 334/340] edit build.yml - try if for tag --- .gitea/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index d323215..9df773a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -51,7 +51,7 @@ jobs: context: . push: true tags: | - git.coopgo.io/${{gitea.repository}}:${{gitea.ref_name}}${{ steps.tag_or_branch.outputs.is_tag == 'true' ? '' : ',latest' }} + git.coopgo.io/${{gitea.repository}}:${{ gitea.ref_name }}${{ steps.tag_or_branch.outputs.is_tag == 'true' ? '' : ',latest' }} build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} From 053066b5112479f5c1c220c5ba693b3920e2e27f Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 11:04:58 +0200 Subject: [PATCH 335/340] edit build.yml - try if for tag --- .gitea/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9df773a..cbfcbb0 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -51,7 +51,8 @@ jobs: context: . push: true tags: | - git.coopgo.io/${{gitea.repository}}:${{ gitea.ref_name }}${{ steps.tag_or_branch.outputs.is_tag == 'true' ? '' : ',latest' }} + git.coopgo.io/${{gitea.repository}}:${{ gitea.ref_name }} + git.coopgo.io/${{gitea.repository}}:${{ steps.tag_or_branch.outputs.is_tag == 'true' ? '' : ',latest' }} build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} From 284e3c918a29b5c0b18afea75b5090bacd6203e1 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 11:08:35 +0200 Subject: [PATCH 336/340] edit build.yml - back to base --- .gitea/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index cbfcbb0..3dd3f38 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -41,10 +41,6 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - - name: Determine if it's a tag or a branch - id: tag_or_branch - run: echo ::set-output name=is_tag::$(if [[ $GITHUB_REF == refs/tags/* ]]; then echo true; else echo false; fi) - - name: Build and push uses: docker/build-push-action@v5 with: @@ -52,7 +48,6 @@ jobs: push: true tags: | git.coopgo.io/${{gitea.repository}}:${{ gitea.ref_name }} - git.coopgo.io/${{gitea.repository}}:${{ steps.tag_or_branch.outputs.is_tag == 'true' ? '' : ',latest' }} build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} From 66c87b16ff157fde302c4154c220717efb9ad864 Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 11:15:04 +0200 Subject: [PATCH 337/340] edit build.yml - back to base --- .gitea/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 3dd3f38..9c9704a 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -48,6 +48,8 @@ jobs: push: true tags: | git.coopgo.io/${{gitea.repository}}:${{ gitea.ref_name }} + flavor: | + latest=auto build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} From c784657da28a18850bf0d025637a5e62cb5ff93c Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 11:23:59 +0200 Subject: [PATCH 338/340] edit build.yml - add metadata step --- .gitea/workflows/build.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9c9704a..2406e0d 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -41,15 +41,22 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} + - name: Extract metadata (tags, labels) for Docker image + id: metadata + uses: docker/metadata-action@v3 + with: + images: git.coopgo.io/${{gitea.repository}} + tags: ${{gitea.ref_name}} + flavor: | + latest=auto + - name: Build and push uses: docker/build-push-action@v5 with: context: . push: true tags: | - git.coopgo.io/${{gitea.repository}}:${{ gitea.ref_name }} - flavor: | - latest=auto + ${{ steps.metadata.outputs.tags }} build-args: | ACCESS_TOKEN_USR=${{gitea.actor}} ACCESS_TOKEN_PWD=${{gitea.token}} From 4ae6aa7a900cf60bd0459fcb4265001e23eb8a0e Mon Sep 17 00:00:00 2001 From: Nicolas Caron Date: Wed, 3 Apr 2024 11:31:27 +0200 Subject: [PATCH 339/340] edit build.yml - edit metadata step --- .gitea/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 2406e0d..912a100 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -46,7 +46,10 @@ jobs: uses: docker/metadata-action@v3 with: images: git.coopgo.io/${{gitea.repository}} - tags: ${{gitea.ref_name}} + tags: | + type=ref,event=branch + type=ref,event=tag + type=ref,event=pr flavor: | latest=auto From 5e4cea0bb384b29d6435b609366f77fd59e682bf Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Mon, 11 Nov 2024 20:35:17 +0100 Subject: [PATCH 340/340] Remove fmt.Println and add Zerolog logging system --- examples/grpcclient/main.go | 11 +++++++---- go.mod | 7 +++++-- go.sum | 21 +++++++++++++++++---- grpcapi/accounts.go | 6 +++--- grpcapi/grpcapi.go | 25 ++++++++++++------------- handlers/accounts.go | 16 ++++++++-------- main.go | 20 ++++++++++++-------- oidc-provider/fosite.go | 11 ++++++++++- oidc-provider/oidc-provider.go | 6 +++--- storage/mongodb.go | 5 +++-- storage/postgresql.go | 15 ++++++++------- 11 files changed, 88 insertions(+), 55 deletions(-) diff --git a/examples/grpcclient/main.go b/examples/grpcclient/main.go index aec3b66..ab4a99f 100755 --- a/examples/grpcclient/main.go +++ b/examples/grpcclient/main.go @@ -3,23 +3,26 @@ package main import ( "context" "encoding/json" - "fmt" "io/ioutil" "os" "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi" "git.coopgo.io/coopgo-platform/mobility-accounts/storage" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" "google.golang.org/grpc" ) func main() { + zerolog.TimeFieldFormat = zerolog.TimeFormatUnix + log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}) if len(os.Args) < 2 { - fmt.Println("missing JSON file path") + log.Error().Msg("missing JSON file path") return } conn, err := grpc.Dial("dns:///localhost:8090", grpc.WithInsecure(), grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`)) if err != nil { - panic(err) + log.Panic().Err(err).Msg("Cannot dial local server") } client := grpcapi.NewMobilityAccountsClient(conn) @@ -46,5 +49,5 @@ func main() { panic(err) } - fmt.Println(string(jsonresponse)) + log.Debug().Str("response", string(jsonresponse)).Msg("JSOn response") } diff --git a/go.mod b/go.mod index ba00ab1..79cede2 100755 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/lib/pq v1.10.2 github.com/mitchellh/mapstructure v1.5.0 github.com/ory/fosite v0.42.2 + github.com/rs/zerolog v1.33.0 github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 github.com/spf13/viper v1.15.0 github.com/stretchr/testify v1.8.2 @@ -27,7 +28,7 @@ require ( github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/coreos/go-semver v0.3.0 // indirect - github.com/coreos/go-systemd/v22 v22.3.2 // indirect + github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgraph-io/ristretto v0.0.3 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect @@ -43,6 +44,8 @@ require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/klauspost/compress v1.13.6 // indirect github.com/magiconair/properties v1.8.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/goveralls v0.0.6 // indirect github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect @@ -74,7 +77,7 @@ require ( go.uber.org/zap v1.21.0 // indirect golang.org/x/net v0.6.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.5.0 // indirect + golang.org/x/sys v0.27.0 // indirect golang.org/x/text v0.8.0 // indirect golang.org/x/tools v0.6.0 // indirect google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect diff --git a/go.sum b/go.sum index 28044b8..ec27a31 100644 --- a/go.sum +++ b/go.sum @@ -120,8 +120,9 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -761,6 +762,8 @@ github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcncea github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -768,6 +771,10 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -806,7 +813,7 @@ github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= +github.com/oleiade/reflections v1.0.0/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -924,8 +931,11 @@ github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/rubenv/sql-migrate v0.0.0-20190212093014-1007f53448d7/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1370,9 +1380,12 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/grpcapi/accounts.go b/grpcapi/accounts.go index e28c188..e37db4e 100755 --- a/grpcapi/accounts.go +++ b/grpcapi/accounts.go @@ -2,9 +2,9 @@ package grpcapi import ( "encoding/json" - "fmt" "git.coopgo.io/coopgo-platform/mobility-accounts/storage" + "github.com/rs/zerolog/log" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/types/known/structpb" ) @@ -27,7 +27,7 @@ func (a Account) ToStorageType() storage.Account { for k, d := range a.Data.GetFields() { jsondata, err := protojson.Marshal(d) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") break } var data any @@ -68,7 +68,7 @@ func AccountFromStorageType(account *storage.Account) (*Account, error) { data, err := structpb.NewStruct(d) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, err } diff --git a/grpcapi/grpcapi.go b/grpcapi/grpcapi.go index a282a73..b6973b0 100755 --- a/grpcapi/grpcapi.go +++ b/grpcapi/grpcapi.go @@ -2,11 +2,10 @@ package grpcapi import ( context "context" - "fmt" - "log" "net" "git.coopgo.io/coopgo-platform/mobility-accounts/handlers" + "github.com/rs/zerolog/log" "github.com/spf13/viper" "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -31,7 +30,7 @@ func (s MobilityAccountsServerImpl) Login(ctx context.Context, req *LoginRequest } response, err := AccountFromStorageType(account) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.Internal, "issue while retrieving account : %v", err) } return &LoginResponse{Account: response}, nil @@ -40,12 +39,12 @@ func (s MobilityAccountsServerImpl) Register(ctx context.Context, req *RegisterR a := req.Account.ToStorageType() account, err := s.handler.Register(a) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.AlreadyExists, "account creation failed : %v", err) } response, err := AccountFromStorageType(account) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.Internal, "issue while retrieving account : %v", err) } return &RegisterResponse{Account: response}, nil @@ -58,7 +57,7 @@ func (s MobilityAccountsServerImpl) UpdateData(ctx context.Context, req *UpdateD } response, err := AccountFromStorageType(account) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.Internal, "issue while retrieving account : %v", err) } return &UpdateDataResponse{Account: response}, nil @@ -78,12 +77,12 @@ func (s MobilityAccountsServerImpl) UpdatePhoneNumber(ctx context.Context, req * func (s MobilityAccountsServerImpl) GetAccount(ctx context.Context, req *GetAccountRequest) (*GetAccountResponse, error) { account, err := s.handler.GetAccount(req.Id) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.AlreadyExists, "issue while retrieving account : %v", err) } response, err := AccountFromStorageType(account) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.Internal, "issue while retrieving account : %v", err) } return &GetAccountResponse{Account: response}, nil @@ -91,12 +90,12 @@ func (s MobilityAccountsServerImpl) GetAccount(ctx context.Context, req *GetAcco func (s MobilityAccountsServerImpl) GetAccountUsername(ctx context.Context, req *GetAccountUsernameRequest) (*GetAccountUsernameResponse, error) { account, err := s.handler.GetAccountUsername(req.Username, req.Namespace) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.AlreadyExists, "issue while retrieving account : %v", err) } response, err := AccountFromStorageType(account) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, status.Errorf(codes.Internal, "issue while retrieving account : %v", err) } return &GetAccountUsernameResponse{Account: response}, nil @@ -147,13 +146,13 @@ func Run(done chan error, cfg *viper.Viper, handler handlers.MobilityAccountsHan dev_env = cfg.GetBool("dev_env") address = ":" + cfg.GetString("services.grpc.port") ) - fmt.Println("-> GRPC server on", address) + log.Info().Str("address", address).Msg("Running gRPC server") server := grpc.NewServer() RegisterMobilityAccountsServer(server, NewMobilityAccountsServer(handler)) l, err := net.Listen("tcp", address) if err != nil { - log.Fatal(err) + log.Fatal().Str("address", address).Err(err).Msg("gRPC server cannot listen") } if dev_env { @@ -161,7 +160,7 @@ func Run(done chan error, cfg *viper.Viper, handler handlers.MobilityAccountsHan } if err := server.Serve(l); err != nil { - fmt.Println("gRPC service ended") + log.Error().Err(err).Msg("gRPC service ended") done <- err } } diff --git a/handlers/accounts.go b/handlers/accounts.go index eef5d70..822f1c7 100755 --- a/handlers/accounts.go +++ b/handlers/accounts.go @@ -2,12 +2,12 @@ package handlers import ( "errors" - "fmt" "strings" "time" "git.coopgo.io/coopgo-platform/mobility-accounts/storage" "github.com/google/uuid" + "github.com/rs/zerolog/log" "github.com/santhosh-tekuri/jsonschema/v5" "golang.org/x/crypto/bcrypt" ) @@ -19,12 +19,12 @@ func (h MobilityAccountsHandler) Login(username string, password string, namespa u := strings.ToLower(username) account, err := h.storage.DB.LocalAuthentication(namespace, &u, nil, nil) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, err } if err = bcrypt.CompareHashAndPassword([]byte(account.Authentication.Local.Password), []byte(password)); err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, err } @@ -108,7 +108,7 @@ func (h MobilityAccountsHandler) UpdateData(accountid string, datas map[string]a dataschemas := h.config.GetStringMap("data_schemas") for k, v := range datas { if !h.config.GetBool("allow_any_data") && dataschemas[k] == nil { - fmt.Println("data scope not allowed") + log.Error().Msg("data scope not allowed") return nil, errors.New("data scope not allowed") } @@ -116,19 +116,19 @@ func (h MobilityAccountsHandler) UpdateData(accountid string, datas map[string]a s := dataschemas[k].(map[string]string) sch, err := jsonschema.Compile(s["schema"]) if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, err } if err = sch.Validate(v); err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, err } } account.Data[k] = v } if err = h.storage.DB.UpdateAccount(*account); err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return nil, err } @@ -151,7 +151,7 @@ func (h MobilityAccountsHandler) UpdatePhoneNumber(accountid, phone_number strin account.Authentication.Local.PhoneNumberValidation.ValidationCode = verification_code if err = h.storage.DB.UpdateAccount(*account); err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return err } diff --git a/main.go b/main.go index b387f79..8884e57 100755 --- a/main.go +++ b/main.go @@ -1,12 +1,14 @@ package main import ( - "fmt" + "os" "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi" "git.coopgo.io/coopgo-platform/mobility-accounts/handlers" op "git.coopgo.io/coopgo-platform/mobility-accounts/oidc-provider" "git.coopgo.io/coopgo-platform/mobility-accounts/storage" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" ) func main() { @@ -22,20 +24,22 @@ func main() { dev_env = cfg.GetBool("dev_env") ) + if dev_env { + log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}) + } + storage, err := storage.NewStorage(cfg) if err != nil { - panic(err) + log.Panic().Err(err).Msg("Cannot connect to storage") + return } handler := handlers.NewHandler(cfg, storage) - fmt.Println("Running", service_name, ":") - if dev_env { - fmt.Printf("\033]0;%s\007", service_name) - } - failed := make(chan error) + log.Info().Str("service_name", service_name).Msg("Running service") + if grpc_enable { go grpcapi.Run(failed, cfg, handler) } @@ -46,6 +50,6 @@ func main() { err = <-failed - fmt.Println("Terminating :", err) + log.Fatal().Err(err).Msg("Terminating server") } diff --git a/oidc-provider/fosite.go b/oidc-provider/fosite.go index d538f4d..6e3b90b 100755 --- a/oidc-provider/fosite.go +++ b/oidc-provider/fosite.go @@ -4,7 +4,9 @@ import ( "context" "crypto/rsa" "errors" + "net/url" "reflect" + "strings" "time" "git.coopgo.io/coopgo-platform/mobility-accounts/handlers" @@ -18,7 +20,14 @@ import ( func NewProvider(c OIDCNamespaceConfig, h handlers.MobilityAccountsHandler, s storage.Storage, privateKey *rsa.PrivateKey) fosite.OAuth2Provider { - config := &compose.Config{} + config := &compose.Config{ + RedirectSecureChecker: func(checkUrl *url.URL) bool { + if strings.HasSuffix(checkUrl.Host, "svc.cluster.local") || strings.HasSuffix(checkUrl.Host, "localhost") { + return true + } + return false + }, + } storage := NewOIDCProviderStore(c, h, s.KV) secret := []byte(c.SecretKey) return compose.ComposeAllEnabled(config, storage, secret, privateKey) diff --git a/oidc-provider/oidc-provider.go b/oidc-provider/oidc-provider.go index 79cd6be..5a9f3c3 100755 --- a/oidc-provider/oidc-provider.go +++ b/oidc-provider/oidc-provider.go @@ -3,12 +3,12 @@ package op import ( "crypto/rand" "crypto/rsa" - "fmt" "git.coopgo.io/coopgo-platform/mobility-accounts/handlers" "git.coopgo.io/coopgo-platform/mobility-accounts/storage" "github.com/mitchellh/mapstructure" "github.com/ory/fosite" + "github.com/rs/zerolog/log" "github.com/spf13/viper" ) @@ -86,14 +86,14 @@ func Run(done chan error, cfg *viper.Viper, handler handlers.MobilityAccountsHan address = "0.0.0.0:" + cfg.GetString("services.oidc_provider.port") ) - fmt.Println("-> OIDC provider endpoints on", address) + log.Info().Str("address", address).Msg("Running OIDC provider") s := NewOIDCHandler(handler, storage, cfg) err := NewOIDCServer(s, cfg) if err != nil { - fmt.Println("OIDC server ended") + log.Error().Err(err).Msg("OIDC server ended") } done <- err diff --git a/storage/mongodb.go b/storage/mongodb.go index 70a5896..50bb9d8 100755 --- a/storage/mongodb.go +++ b/storage/mongodb.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" + "github.com/rs/zerolog/log" "github.com/spf13/viper" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" @@ -185,7 +186,7 @@ func (s MongoDBStorage) CreateAccount(account Account) error { func (s MongoDBStorage) UpdateAccount(account Account) error { collection := s.Client.Database(s.DbName).Collection(s.Collections["users"]) if _, err := collection.ReplaceOne(context.TODO(), bson.M{"_id": account.ID}, account); err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return err } @@ -193,6 +194,6 @@ func (s MongoDBStorage) UpdateAccount(account Account) error { } func (s MongoDBStorage) Migrate() error { - fmt.Println("no migration") + log.Error().Msg("no migration") return nil } diff --git a/storage/postgresql.go b/storage/postgresql.go index 9d6aa2e..78cc210 100644 --- a/storage/postgresql.go +++ b/storage/postgresql.go @@ -13,6 +13,7 @@ import ( "ariga.io/atlas/sql/schema" "github.com/lib/pq" _ "github.com/lib/pq" + "github.com/rs/zerolog/log" "github.com/spf13/viper" ) @@ -38,12 +39,12 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) { psqlconn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=%s", host, portInt, user, password, dbname, sslmode) db, err := sql.Open("postgres", psqlconn) if err != nil { - fmt.Println("error", err) + log.Error().Err(err).Msg("error opening postgresql connection") return PostgresqlStorage{}, fmt.Errorf("connection to postgresql failed") } err = db.Ping() if err != nil { - fmt.Println(err) + log.Error().Err(err).Msg("") return PostgresqlStorage{}, fmt.Errorf("connection to postgresql database failed") } return PostgresqlStorage{ @@ -129,7 +130,7 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username *st req += fmt.Sprintf(` AND phone_number = '%s'`, *phone_number) } req += ";" - fmt.Println(req) + account.Authentication.Local = &LocalAuth{} err := psql.DbConnection.QueryRow(req).Scan( &account.ID, @@ -145,22 +146,22 @@ func (psql PostgresqlStorage) LocalAuthentication(namespace string, username *st } err = json.Unmarshal(metadata, &account.Metadata) if err != nil { - fmt.Println("one") + log.Error().Err(err).Msg("error unmarshalling account metadata") return nil, err } err = json.Unmarshal(data, &account.Data) if err != nil { - fmt.Println("two") + log.Error().Err(err).Msg("error unmarshalling account data") return nil, err } err = json.Unmarshal(emailValidation, &account.Authentication.Local.EmailValidation) if err != nil { - fmt.Println("three") + log.Error().Err(err).Msg("error unmarshalling email validation") return nil, err } err = json.Unmarshal(phoneValidation, &account.Authentication.Local.PhoneNumberValidation) if err != nil { - fmt.Println("four") + log.Error().Err(err).Msg("error unmarshalling phone validation") return nil, err } return account, nil