Skip to content

Commit e61fdc6

Browse files
committed
feat!: Store the dashboard address as a URL
Using a IP address or hostname like for the server address prevented one from defining a port (useful for local development) and prevented all sorts of possible scenarios. Using a URL simplifies a lot of things. This commit also updates the `demo` scenario to make it ready to send invitations (the Dashboard URL was in a configuration key that was removed in #188).
1 parent cad1227 commit e61fdc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+425
-856
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434
### Added
3535

3636
- feat!: Implement factory reset (`DELETE /`) (@RemiBardon in #188).
37-
- feat: Add `PUT /v1/pod/config/dashboard-address` (@RemiBardon in #188).
37+
- feat: Add `PUT /v1/pod/config/dashboard-url` (@RemiBardon in #188 and #197).
3838
- feat(tasks): Update changelog in `task release` (@RemiBardon).
3939
- feat: Enable the `register` module in Prosody (@RemiBardon in #196).
4040

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ tower = { version = "0.5", default-features = false }
5858
tower-http = { version = "0.6", default-features = false }
5959
tracing = { version = "0.1", default-features = false }
6060
tracing-subscriber = { version = "0.3", default-features = false }
61+
url = { version = "2", default-features = false }
6162
url_serde = { version = "0.2", default-features = false }
6263
urlencoding = { version = "2", default-features = false }
6364
uuid = { version = "1", default-features = false }

docs/openapi/features/pod-config.yaml

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -74,41 +74,41 @@ paths:
7474
description: Pod address has no value
7575
"401": { $ref: "../shared.yaml#/components/responses/Unauthorized" }
7676
"403": { $ref: "../shared.yaml#/components/responses/Forbidden" }
77-
set_dashboard_address:
77+
set_dashboard_url:
7878
tags: ["Pod / Configuration"]
79-
summary: Set Dashboard address
79+
summary: Set Dashboard URL
8080
description: Tells the API how the Dashboard is publicly accessible.
81-
operationId: set_dashboard_address
81+
operationId: set_dashboard_url
8282
security: []
8383
requestBody:
8484
required: true
8585
content:
8686
application/json:
87-
schema: { $ref: "#/components/schemas/SetDashboardAddressRequest" }
87+
schema: { $ref: "#/components/schemas/SetDashboardUrlRequest" }
8888
responses:
8989
"200":
9090
description: Success
9191
content:
9292
application/json:
93-
schema: { $ref: "#/components/schemas/NetworkAddress" }
93+
schema: { $ref: "#/components/schemas/GetDashboardUrlResponse" }
9494
"401": { $ref: "../shared.yaml#/components/responses/Unauthorized" }
9595
"403": { $ref: "../shared.yaml#/components/responses/Forbidden" }
9696
"422": { $ref: "../shared.yaml#/components/responses/UnprocessableEntity" }
97-
get_dashboard_address:
97+
get_dashboard_url:
9898
tags: ["Pod / Configuration"]
99-
summary: Get Dashboard address
99+
summary: Get Dashboard URL
100100
description: Get the current address of the Prose Pod Dashboard.
101-
operationId: get_dashboard_address
101+
operationId: get_dashboard_url
102102
security:
103103
- BearerAuth: []
104104
responses:
105105
"200":
106-
description: Dashboard address has a value
106+
description: Dashboard URL has a value
107107
content:
108108
application/json:
109-
schema: { $ref: "#/components/schemas/NetworkAddress" }
109+
schema: { $ref: "#/components/schemas/GetDashboardUrlResponse" }
110110
"204":
111-
description: Dashboard address has no value
111+
description: Dashboard URL has no value
112112
"401": { $ref: "../shared.yaml#/components/responses/Unauthorized" }
113113
"403": { $ref: "../shared.yaml#/components/responses/Forbidden" }
114114
components:
@@ -117,11 +117,20 @@ components:
117117
type: object
118118
required:
119119
- address
120-
- dashboard_address
120+
- dashboard_url
121121
properties:
122122
address: { $ref: "#/components/schemas/SetPodAddressRequest" }
123-
dashboard_address: { $ref: "#/components/schemas/SetDashboardAddressRequest" }
124-
SetNetworkAddressRequest:
123+
dashboard_url: { $ref: "#/components/schemas/DashboardUrl" }
124+
PodConfig:
125+
type: object
126+
required: []
127+
properties:
128+
address:
129+
$ref: "#/components/schemas/NetworkAddress"
130+
type: [object, "null"]
131+
dashboard_url:
132+
$ref: "#/components/schemas/DashboardUrl"
133+
SetPodAddressRequest:
125134
type: object
126135
required: []
127136
properties:
@@ -134,24 +143,22 @@ components:
134143
hostname:
135144
type: string
136145
example: crisp.chat
137-
SetPodAddressRequest:
138-
$ref: "#/components/schemas/SetNetworkAddressRequest"
139-
example:
140-
hostname: crisp.chat
141-
SetDashboardAddressRequest:
142-
$ref: "#/components/schemas/SetNetworkAddressRequest"
143-
example:
144-
hostname: admin.prose.crisp.chat
145-
PodConfig:
146+
DashboardUrl:
147+
type: [string, "null"]
148+
format: uri
149+
example: https://admin.prose.crisp.chat/
150+
SetDashboardUrlRequest:
146151
type: object
147-
required: []
152+
required: [dashboard_url]
148153
properties:
149-
address:
150-
$ref: "#/components/schemas/NetworkAddress"
151-
type: [object, "null"]
152-
dashboard_address:
153-
$ref: "#/components/schemas/NetworkAddress"
154-
type: [object, "null"]
154+
dashboard_url: { $ref: "#/components/schemas/DashboardUrl" }
155+
GetDashboardUrlResponse:
156+
type: object
157+
required: [dashboard_url]
158+
properties:
159+
dashboard_url:
160+
$ref: "#/components/schemas/DashboardUrl"
161+
type: string
155162
NetworkAddress:
156163
type: object
157164
required:
@@ -206,14 +213,14 @@ components:
206213
const: pod_address_not_initialized
207214
example:
208215
error: pod_address_not_initialized
209-
DashboardAddressNotInitialized:
210-
description: Dashboard address not initialized
216+
DashboardUrlNotInitialized:
217+
description: Dashboard URL not initialized
211218
content:
212219
application/json:
213220
schema:
214221
$ref: "../shared.yaml#/components/schemas/Error"
215222
properties:
216223
error:
217-
const: dashboard_address_not_initialized
224+
const: dashboard_url_not_initialized
218225
example:
219-
error: dashboard_address_not_initialized
226+
error: dashboard_url_not_initialized

docs/openapi/openapi.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ paths:
7373
"/v1/pod/config/address":
7474
put: { $ref: "features/pod-config.yaml#/paths/set_pod_address" }
7575
get: { $ref: "features/pod-config.yaml#/paths/get_pod_address" }
76-
"/v1/pod/config/dashboard-address":
77-
put: { $ref: "features/pod-config.yaml#/paths/set_dashboard_address" }
78-
get: { $ref: "features/pod-config.yaml#/paths/get_dashboard_address" }
76+
"/v1/pod/config/dashboard-url":
77+
put: { $ref: "features/pod-config.yaml#/paths/set_dashboard_url" }
78+
get: { $ref: "features/pod-config.yaml#/paths/get_dashboard_url" }
7979
"/v1/workspace":
8080
put: { $ref: "features/workspace.yaml#/paths/init_workspace" }
8181
get: { $ref: "features/workspace.yaml#/paths/get_workspace" }
0 Bytes
Binary file not shown.

local-run/scenarios/demo/prosody/config/prosody.cfg.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ VirtualHost "prose-demo.org.local"
115115
}
116116
oauth2_access_token_ttl = 10800
117117
oauth2_refresh_token_ttl = 0
118-
oauth2_registration_key = "hs3W8InJLICq7Sx1NfBbB1za_56HaBPBj1yJOFOB79rqVSdnGSwCpcTe-sgW--cbCK9mIIVE1ks_gnlu7VT84faHULdPdae6ppC_XvX155n-55eGF2vZi-iB4yfeLsVA0q4sc_222XpKWeplJCHK_sahx--_bzqB2kP2l-cdK9DZShYxtbjeV-EyS0pGBCU5AQSccDTu4EeEkdET03Pd4VEX-ld6qd6VU13awDgcHPS4tTPSJJE32czF37hT6QbEMnXU_kovloh2swCykueHqZP9zX4TMXlAaDtW7moHFUbnMSqrz9-WORRCtqqYqRvwhm3dJurLMekwyOL3ffwA9g"
118+
oauth2_registration_key = "Q8UB3ua8o6ZtNsPLliIY3Komfjz18eOJTpOF-hrEUXaG9hWWLTmZkep0ZRDKCItHKORMFHuBLAoFTqM-L9w7gvM3ptnH5sinpYLQjm_Hs3b6aAHDm9NOQ89X0vGg_fjidNXwQ1w2F2uYJeXpnqtwVmX8E1peMLSTSzpJWE1NNpiariwBirnW0zEj1bgLr1ys-Bk7WCAK7GF661t607C3xcG8B5lMjgpCXqcdBJ9BUNroAYumnYmtReX8q47jsN4nU5GrRMerVAmMOMfC4laF9Zaty2n7dyvhzpyDqCXfTyUwD7Fgi04grJh0JdMcWpxPC5kUxyEzbEpOyytR1iHqhg"
119119

120120
VirtualHost "admin.prose.org.local"
121121
admins = { "[email protected]" }
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
return {
2+
["salt"] = "9b0e2dae-6277-4940-91ca-fd2927b53d49";
3+
["stored_key"] = "61d363707d91680dee01d421506ec0cce7ecbd8c";
4+
["created"] = 1743457706;
5+
["updated"] = 1743457706;
26
["iteration_count"] = 10000;
3-
["stored_key"] = "1935c5dc2048db96313c2166314ae2ed78f04cc1";
4-
["created"] = 1737408582;
5-
["salt"] = "f7dfb1d1-e0f3-48b8-bb4e-cbd03d03b537";
6-
["updated"] = 1737408582;
7-
["server_key"] = "1f07f5600f977063f9bbd2d438115d22a341be5f";
7+
["server_key"] = "ff58cc0b1346b2913528460a0226cd8874dd99c6";
88
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
return {
2-
["tokenauth/clear_expired_grants"] = 1737408583;
2+
["tokenauth/clear_expired_grants"] = 1743446143;
33
};
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
return {
2-
["iteration_count"] = 10000;
3-
["stored_key"] = "82d242f56ca4669ad2baedf23c0d3c9b9f60d0c1";
2+
["salt"] = "e50c16e0-4266-472a-a262-07fb78bcd644";
3+
["stored_key"] = "8207d68ab1532294c9eab6720df21d2ccd7d8566";
44
["created"] = 1737408583;
5-
["salt"] = "0b265224-b291-46f2-ac12-5bf198902ff9";
6-
["updated"] = 1737408583;
7-
["server_key"] = "b33550fdd3ff17ab127d02137929aa134766f476";
5+
["updated"] = 1743457706;
6+
["iteration_count"] = 10000;
7+
["server_key"] = "bc8ddc1c33ffb7fb0e3010e65e3d9ef75ab7ac9d";
88
};

0 commit comments

Comments
 (0)