Skip to content

Commit 3786a66

Browse files
committed
Merge branch 'master' into dle-4-0
2 parents a4b8d10 + c8b1e82 commit 3786a66

File tree

30 files changed

+284
-100
lines changed

30 files changed

+284
-100
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ For example, cloning a 1 TiB PostgreSQL database takes just about 10 seconds. On
6060
<p><img src="./assets/dle-demo-animated.gif" border="0" /></p>
6161

6262
Try it yourself right now:
63-
- enter [the Database Lab Platform](https://console.postgres.ai/), join the "Demo" organization, and test cloning of ~1 TiB demo database, or
64-
- check out another demo setup (DBLab 3.4): https://demo.aws.postgres.ai:446/instance, use the token `demo_token` to enter
65-
- if you are looking for DBLab 4.0, with branching and snapshotting support in API/CLI/UI, check out this demo instance: https://branching.aws.postgres.ai:446/instance, use the token `demo_token` to enter
63+
- Visit [Postgres.ai Console](https://console.postgres.ai/), set up your first organization and provision a DBLab Standard Edition (DBLab SE) to any cloud or on-prem
64+
- [Pricing](https://postgres.ai/pricing) (starting at $62/month)
65+
- [Doc: How to install DBLab SE](https://postgres.ai/docs/how-to-guides/administration/install-dle-from-postgres-ai)
66+
- Demo: https://demo.aws.postgres.ai (use the token `demo-token` to access)
67+
- if you are looking for DBLab 4.0, with branching and snapshotting support in API/CLI/UI, check out this demo instance: https://branching.aws.postgres.ai:446/instance, use the token `demo-token` to enter
6668

6769
## How it works
6870
Thin cloning is fast because it uses [Copy-on-Write (CoW)](https://en.wikipedia.org/wiki/Copy-on-write#In_computer_storage). DBLab supports two technologies to enable CoW and thin cloning: [ZFS](https://en.wikipedia.org/wiki/ZFS) (default) and [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)).

assets/database-lab-dark-mode.svg

Lines changed: 4 additions & 4 deletions
Loading

assets/database-lab-light-mode.svg

Lines changed: 4 additions & 4 deletions
Loading

assets/dle-simple.svg

Lines changed: 4 additions & 4 deletions
Loading

assets/dle.svg

Lines changed: 6 additions & 6 deletions
Loading

assets/dle_button.svg

Lines changed: 6 additions & 6 deletions
Loading

engine/api/swagger-spec/dblab_server_swagger.yaml

Lines changed: 82 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ info:
1515
license:
1616
name: AGPL v3 / Database Lab License
1717
url: https://github.com/postgres-ai/database-lab-engine/blob/master/LICENSE
18-
version: 3.4.0
18+
version: 3.5.0
1919
externalDocs:
2020
description: DBLab Docs
2121
url: https://gitlab.com/postgres-ai/docs/tree/master/docs/database-lab
2222

2323
servers:
24-
- url: "https://demo.aws.postgres.ai:446/api"
24+
- url: "https://demo.aws.postgres.ai:446"
2525
description: "DBLab 3.x demo server; token: 'demo-token'"
2626
x-examples:
2727
Verification-Token: "demo-token"
@@ -484,7 +484,7 @@ paths:
484484
schema:
485485
$ref: "#/components/schemas/Error"
486486

487-
/observation/download/{artifact_type}/{clone_id}/{session_id}:
487+
/observation/download:
488488
get:
489489
tags:
490490
- Observation
@@ -497,27 +497,27 @@ paths:
497497
schema:
498498
type: string
499499
required: true
500-
- in: path
500+
- in: query
501501
required: true
502502
name: "artifact_type"
503503
schema:
504504
type: "string"
505505
description: "Type of the requested artifact"
506-
- in: path
506+
- in: query
507507
required: true
508508
name: "clone_id"
509509
schema:
510510
type: "string"
511511
description: "Clone ID"
512-
- in: path
512+
- in: query
513513
required: true
514514
name: "session_id"
515515
schema:
516516
type: "string"
517517
description: "Session ID"
518518
responses:
519519
200:
520-
description: Downloaded the specified artificed of the specified
520+
description: Downloaded the specified artifact of the specified
521521
observation session and clone
522522
400:
523523
description: "Bad request"
@@ -558,7 +558,7 @@ paths:
558558
content:
559559
application/json:
560560
schema:
561-
$ref: '#/components/schemas/Instance'
561+
$ref: "#/components/schemas/Error"
562562
example:
563563
code: "UNAUTHORIZED"
564564
message: "Check your verification token."
@@ -613,7 +613,7 @@ paths:
613613
content:
614614
application/json:
615615
schema:
616-
$ref: '#/components/schemas/Instance'
616+
$ref: "#/components/schemas/Error"
617617
example:
618618
code: "UNAUTHORIZED"
619619
message: "Check your verification token."
@@ -660,7 +660,7 @@ paths:
660660
content:
661661
application/json:
662662
schema:
663-
$ref: '#/components/schemas/Instance'
663+
$ref: "#/components/schemas/Error"
664664
example:
665665
code: "UNAUTHORIZED"
666666
message: "Check your verification token."
@@ -693,7 +693,7 @@ paths:
693693
content:
694694
application/json:
695695
schema:
696-
$ref: '#/components/schemas/Instance'
696+
$ref: "#/components/schemas/Error"
697697
example:
698698
code: "UNAUTHORIZED"
699699
message: "Check your verification token."
@@ -738,7 +738,7 @@ paths:
738738
content:
739739
application/json:
740740
schema:
741-
$ref: '#/components/schemas/Instance'
741+
$ref: "#/components/schemas/Error"
742742
example:
743743
code: "UNAUTHORIZED"
744744
message: "Check your verification token."
@@ -762,6 +762,76 @@ paths:
762762
application/json:
763763
schema:
764764
$ref: "#/components/schemas/WSToken"
765+
/admin/billing-status:
766+
get:
767+
tags:
768+
- Admin
769+
summary: Checks billing status
770+
description: ""
771+
operationId: billingStatus
772+
parameters:
773+
- in: header
774+
name: Verification-Token
775+
schema:
776+
type: string
777+
required: true
778+
responses:
779+
200:
780+
description: "Successful operation"
781+
content:
782+
application/json:
783+
schema:
784+
$ref: "#/components/schemas/BillingStatus"
785+
400:
786+
description: "Bad request"
787+
content:
788+
application/json:
789+
schema:
790+
$ref: "#/components/schemas/Error"
791+
401:
792+
description: Unauthorized access
793+
content:
794+
application/json:
795+
schema:
796+
$ref: "#/components/schemas/Error"
797+
example:
798+
code: "UNAUTHORIZED"
799+
message: "Check your verification token."
800+
/admin/activate:
801+
post:
802+
tags:
803+
- Admin
804+
summary: "Activate billing"
805+
description: "Activates billing and sends usage statistics of the instance"
806+
operationId: activateBilling
807+
parameters:
808+
- in: header
809+
name: Verification-Token
810+
schema:
811+
type: string
812+
required: true
813+
responses:
814+
200:
815+
description: "Successful operation"
816+
content:
817+
application/json:
818+
schema:
819+
$ref: "#/components/schemas/Engine"
820+
400:
821+
description: "Bad request"
822+
content:
823+
application/json:
824+
schema:
825+
$ref: "#/components/schemas/Error"
826+
401:
827+
description: Unauthorized access
828+
content:
829+
application/json:
830+
schema:
831+
$ref: "#/components/schemas/Error"
832+
example:
833+
code: "UNAUTHORIZED"
834+
message: "Check your verification token."
765835

766836
components:
767837
schemas:
@@ -1245,7 +1315,6 @@ components:
12451315
type: "string"
12461316
dbVersion:
12471317
type: "integer"
1248-
required: false
12491318
tuningParams:
12501319
type: "object"
12511320
additionalProperties:

engine/internal/srv/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func (s *Server) Reload(cfg srvCfg.Config) {
191191

192192
// InitHandlers initializes handler functions of the HTTP server.
193193
func (s *Server) InitHandlers() {
194-
r := mux.NewRouter().StrictSlash(true)
194+
r := mux.NewRouter().StrictSlash(true).UseEncodedPath()
195195

196196
authMW := mw.NewAuth(s.Config.VerificationToken, s.Platform)
197197

engine/internal/validator/validator.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package validator
77

88
import (
99
"fmt"
10+
"strings"
1011

1112
"github.com/pkg/errors"
1213
passwordvalidator "github.com/wagslane/go-password-validator"
@@ -34,6 +35,10 @@ func (v Service) ValidateCloneRequest(cloneRequest *types.CloneCreateRequest) er
3435
return errors.New("missing DB password")
3536
}
3637

38+
if cloneRequest.ID != "" && strings.Contains(cloneRequest.ID, "/") {
39+
return errors.New("Clone ID cannot contain slash ('/'). Please choose another ID")
40+
}
41+
3742
if err := passwordvalidator.Validate(cloneRequest.DB.Password, minEntropyBits); err != nil {
3843
return fmt.Errorf("password validation: %w", err)
3944
}

engine/internal/validator/validator_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ func TestValidationCloneRequestErrors(t *testing.T) {
5555
createRequest: types.CloneCreateRequest{DB: &types.DatabaseRequest{Password: "password"}},
5656
error: "missing DB username",
5757
},
58+
{
59+
createRequest: types.CloneCreateRequest{
60+
DB: &types.DatabaseRequest{Username: "user", Password: "password"},
61+
ID: "test/ID",
62+
},
63+
error: "Clone ID cannot contain slash ('/'). Please choose another ID",
64+
},
5865
}
5966

6067
for _, tc := range testCases {

0 commit comments

Comments
 (0)