Skip to content

Commit a47c8e5

Browse files
committed
Merge branch 'main' into production
2 parents 1498fb3 + 1911374 commit a47c8e5

31 files changed

+1589
-1469
lines changed

.github/workflows/deploy-next.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ on:
55
branches:
66
- main
77

8-
env:
9-
DEPLOYMENT_NAME: "Next"
10-
SECRET_PREFIX: NEXT_
11-
SOURCE_DIR: .vitepress/dist
12-
138
# https://github.com/ouzi-dev/commit-status-updater/tree/v2/#workflow-permissions
149
permissions:
1510
contents: read
@@ -36,9 +31,9 @@ jobs:
3631
- name: Set deployment status
3732
uses: ouzi-dev/commit-status-updater@v2
3833
with:
39-
name: Deploy to ${{ env.DEPLOYMENT_NAME }}
34+
name: Deploy
4035
status: pending
41-
description: Preparing deploy to ${{ env.DEPLOYMENT_NAME }}
36+
description: Preparing deploy
4237

4338
- name: Install
4439
run: npm ci
@@ -54,34 +49,34 @@ jobs:
5449
with:
5550
args: --delete
5651
env:
57-
AWS_S3_BUCKET: ${{ vars[format('{0}BUCKET_NAME', env.SECRET_PREFIX)] }}
58-
AWS_ACCESS_KEY_ID: ${{ secrets[format('{0}KEY', env.SECRET_PREFIX)] }}
59-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('{0}SECRET', env.SECRET_PREFIX)] }}
60-
AWS_REGION: ${{ vars[format('{0}REGION', env.SECRET_PREFIX)] }}
61-
SOURCE_DIR: ${{ env.SOURCE_DIR }}
52+
AWS_S3_BUCKET: ${{ vars.NEXT_BUCKET_NAME }}
53+
AWS_ACCESS_KEY_ID: ${{ secrets.NEXT_KEY }}
54+
AWS_SECRET_ACCESS_KEY: ${{ secrets.NEXT_SECRET }}
55+
AWS_REGION: ${{ vars.NEXT_REGION }}
56+
SOURCE_DIR: .vitepress/dist
6257

6358
- name: Set success deployment status
6459
if: success()
6560
uses: ouzi-dev/commit-status-updater@v2
6661
with:
67-
name: Deploy to ${{ env.DEPLOYMENT_NAME }}
62+
name: Deploy
6863
status: success
69-
description: Deploy ready for ${{ env.DEPLOYMENT_NAME }}!
70-
url: ${{ vars[format('{0}URL', env.SECRET_PREFIX)] }}
64+
description: Deploy ready
65+
url: ${{ vars.NEXT_URL }}
7166

7267
- name: Set failed deployment status
7368
if: failure()
7469
uses: ouzi-dev/commit-status-updater@v2
7570
with:
76-
name: Deploy to ${{ env.DEPLOYMENT_NAME }}
71+
name: Deploy
7772
status: failure
78-
description: Failed to deploy to ${{ env.DEPLOYMENT_NAME }}
73+
description: Failed to deploy
7974

8075
- name: Invalidate CloudFront
8176
uses: chetan/invalidate-cloudfront-action@v2
8277
env:
83-
DISTRIBUTION: ${{ vars[format('{0}DISTRIBUTION', env.SECRET_PREFIX)] }}
78+
DISTRIBUTION: ${{ vars.NEXT_DISTRIBUTION }}
8479
PATHS: "/ /*"
85-
AWS_REGION: ${{ vars[format('{0}REGION', env.SECRET_PREFIX)] }}
86-
AWS_ACCESS_KEY_ID: ${{ secrets[format('{0}KEY', env.SECRET_PREFIX)] }}
87-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('{0}SECRET', env.SECRET_PREFIX)] }}
80+
AWS_REGION: ${{ vars.NEXT_REGION }}
81+
AWS_ACCESS_KEY_ID: ${{ secrets.NEXT_KEY }}
82+
AWS_SECRET_ACCESS_KEY: ${{ secrets.NEXT_SECRET }}

.github/workflows/deploy-production.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ on:
55
branches:
66
- production
77

8-
env:
9-
DEPLOYMENT_NAME: "Production"
10-
SECRET_PREFIX: PRODUCTION_
11-
SOURCE_DIR: .vitepress/dist
12-
138
# https://github.com/ouzi-dev/commit-status-updater/tree/v2/#workflow-permissions
149
permissions:
1510
contents: read
@@ -36,9 +31,9 @@ jobs:
3631
- name: Set deployment status
3732
uses: ouzi-dev/commit-status-updater@v2
3833
with:
39-
name: Deploy to ${{ env.DEPLOYMENT_NAME }}
34+
name: Deploy
4035
status: pending
41-
description: Preparing deploy to ${{ env.DEPLOYMENT_NAME }}
36+
description: Preparing deploy
4237

4338
- name: Install
4439
run: npm ci
@@ -54,34 +49,34 @@ jobs:
5449
with:
5550
args: --delete
5651
env:
57-
AWS_S3_BUCKET: ${{ vars[format('{0}BUCKET_NAME', env.SECRET_PREFIX)] }}
58-
AWS_ACCESS_KEY_ID: ${{ secrets[format('{0}KEY', env.SECRET_PREFIX)] }}
59-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('{0}SECRET', env.SECRET_PREFIX)] }}
60-
AWS_REGION: ${{ vars[format('{0}REGION', env.SECRET_PREFIX)] }}
61-
SOURCE_DIR: ${{ env.SOURCE_DIR }}
52+
AWS_S3_BUCKET: ${{ vars.PRODUCTION_BUCKET_NAME }}
53+
AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_KEY }}
54+
AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_SECRET }}
55+
AWS_REGION: ${{ vars.PRODUCTION_REGION }}
56+
SOURCE_DIR: .vitepress/dist
6257

6358
- name: Set success deployment status
6459
if: success()
6560
uses: ouzi-dev/commit-status-updater@v2
6661
with:
67-
name: Deploy to ${{ env.DEPLOYMENT_NAME }}
62+
name: Deploy
6863
status: success
69-
description: Deploy ready for ${{ env.DEPLOYMENT_NAME }}!
70-
url: ${{ vars[format('{0}URL', env.SECRET_PREFIX)] }}
64+
description: Deploy ready
65+
url: ${{ vars.PRODUCTION_URL }}
7166

7267
- name: Set failed deployment status
7368
if: failure()
7469
uses: ouzi-dev/commit-status-updater@v2
7570
with:
76-
name: Deploy to ${{ env.DEPLOYMENT_NAME }}
71+
name: Deploy
7772
status: failure
78-
description: Failed to deploy to ${{ env.DEPLOYMENT_NAME }}
73+
description: Failed to deploy
7974

8075
- name: Invalidate CloudFront
8176
uses: chetan/invalidate-cloudfront-action@v2
8277
env:
83-
DISTRIBUTION: ${{ vars[format('{0}DISTRIBUTION', env.SECRET_PREFIX)] }}
78+
DISTRIBUTION: ${{ vars.PRODUCTION_DISTRIBUTION }}
8479
PATHS: "/ /*"
85-
AWS_REGION: ${{ vars[format('{0}REGION', env.SECRET_PREFIX)] }}
86-
AWS_ACCESS_KEY_ID: ${{ secrets[format('{0}KEY', env.SECRET_PREFIX)] }}
87-
AWS_SECRET_ACCESS_KEY: ${{ secrets[format('{0}SECRET', env.SECRET_PREFIX)] }}
80+
AWS_REGION: ${{ vars.PRODUCTION_REGION }}
81+
AWS_ACCESS_KEY_ID: ${{ secrets.PRODUCTION_KEY }}
82+
AWS_SECRET_ACCESS_KEY: ${{ secrets.PRODUCTION_SECRET }}

.github/workflows/notify.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Notify
22

3+
permissions:
4+
contents: none
5+
36
on:
47
push:
58
branches:
@@ -34,7 +37,7 @@ jobs:
3437
return actionMessage;
3538
- name: Notify
3639
if: ${{ always() }} # Use always to ensure that the notification is also send on failure of former steps
37-
uses: teknatha136/actions-google-chat-text-message@main
40+
uses: teknatha136/actions-google-chat-text-message@ecec1de3697db2ae67623ed3b4de15bb85d6cac3
3841
with:
3942
google-chat-webhook: '${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}'
4043
text-message: ${{ steps.action-message.outputs.result }}

.vitepress/config.mts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ export default withMermaid(defineConfig({
245245
link: '/devices/peripherals',
246246
},
247247
{
248-
text: 'Legacy',
249-
link: '/devices/legacy',
248+
text: 'History',
249+
link: '/devices/history',
250250
collapsed: true,
251251
items: [
252-
{ text: 'VT2', link: '/devices/legacy/VT2' },
252+
{ text: 'VT2', link: '/devices/history/VT2' },
253253
]
254254
}
255255
]
@@ -278,6 +278,7 @@ export default withMermaid(defineConfig({
278278
},
279279
{
280280
text: 'Structure',
281+
collapsed: true,
281282
link: '/devices/api/structure',
282283
items: [
283284
{
@@ -300,11 +301,13 @@ export default withMermaid(defineConfig({
300301
},
301302
{
302303
text: 'Messages',
304+
collapsed: true,
303305
link: '/devices/api/messages',
304306
items: protocolMenuItems,
305307
},
306308
{
307309
text: 'Tools',
310+
collapsed: true,
308311
items: [
309312
{
310313
text: 'Generate',
@@ -320,6 +323,26 @@ export default withMermaid(defineConfig({
320323
},
321324
]
322325
},
326+
{
327+
text: 'SDKs',
328+
collapsed: true,
329+
items: [
330+
{
331+
text: 'Toit',
332+
link: '/devices/api/sdks/toit/',
333+
items: [
334+
{ text: 'Getting Started', link: '/devices/api/sdks/toit/getting-started' },
335+
{
336+
text: 'Examples',
337+
link: '/devices/api/sdks/toit/examples',
338+
items: [
339+
{ text: 'EInk Hello World', link: '/devices/api/sdks/toit/examples/eink' },
340+
]
341+
},
342+
],
343+
},
344+
]
345+
},
323346
]
324347
},
325348
],
@@ -578,6 +601,7 @@ export default withMermaid(defineConfig({
578601
{ text: 'Configs', link: '/apps/admin/configs' },
579602
{ text: 'Users', link: '/apps/admin/users' },
580603
{ text: 'Invoice Audit', link: '/apps/admin/invoice-audit' },
604+
{ text: 'Plans', link: '/apps/admin/plans' },
581605
],
582606
}
583607
],

.vitepress/theme/Layout.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const redirects = Object.entries({
1212
'/silos': '/onprem',
1313
'/terminology': '/terminology',
1414
'/guides/troubleshooting': '/faq/troubleshooting',
15+
'/devices/legacy': '/devices/history',
1516
'/devices/api/parse': '/devices/api/tools/parse',
1617
'/devices/api/generate': '/devices/api/tools/generate'
1718
})

apis/v1/[operationId].paths.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import { useOpenapi } from 'vitepress-openapi/client'
22
import { httpVerbs } from 'vitepress-openapi'
33
import { loadSpec } from '../../swagger/load'
4-
const spec1 = loadSpec(1)
4+
const spec = loadSpec(1)
55

66
export default {
77
paths() {
8-
const openapi = useOpenapi({ spec: spec1 })
8+
const openapi = useOpenapi({ spec })
99

10-
if (!openapi?.json?.paths) {
10+
if (!openapi?.spec?.paths) {
11+
console.error('No paths found in OpenAPI spec version 1')
1112
return []
1213
}
1314

14-
return Object.keys(openapi.json.paths)
15+
return Object.keys(openapi.spec.paths)
1516
.flatMap((path) => {
1617
return httpVerbs
17-
.filter((verb) => openapi.json.paths[path][verb])
18+
.filter((verb) => openapi.spec.paths[path][verb])
1819
.map((verb) => {
19-
const { operationId, summary } = openapi.json.paths[path][verb]
20+
const { operationId, summary } = openapi.spec.paths[path][verb]
2021
return {
2122
params: {
2223
operationId,

apis/v2/[operationId].paths.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import { useOpenapi } from 'vitepress-openapi/client'
22
import { httpVerbs } from 'vitepress-openapi'
33
import { loadSpec } from '../../swagger/load'
4-
const spec2 = loadSpec(2)
4+
const spec = loadSpec(2)
55

66
export default {
77
paths() {
8-
const openapi = useOpenapi({ spec: spec2 })
8+
const openapi = useOpenapi({ spec })
99

10-
if (!openapi?.json?.paths) {
10+
if (!openapi?.spec?.paths) {
11+
console.error('No paths found in OpenAPI spec version 2')
1112
return []
1213
}
1314

14-
return Object.keys(openapi.json.paths)
15+
return Object.keys(openapi.spec.paths)
1516
.flatMap((path) => {
1617
return httpVerbs
17-
.filter((verb) => openapi.json.paths[path][verb])
18+
.filter((verb) => openapi.spec.paths[path][verb])
1819
.map((verb) => {
19-
const { operationId, summary } = openapi.json.paths[path][verb]
20+
const { operationId, summary } = openapi.spec.paths[path][verb]
2021
return {
2122
params: {
2223
operationId,

apps/admin/creating-account.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ An account is needed to get started with the cloud platform and attached devices
55
Lightbug accounts are shared across all Lightbug interfaces.
66

77
You'll need to create an account within the [cloud app](/apps/cloud/creating-account) to get started.
8+
9+
## Sub accounts
10+
11+
Once you have created an account, you can create sub accounts with access to your devices from the admin portal.
12+
13+
To find out how, see the section on [adding new users to devices](/apps/admin/devices#add-new-user).

apps/admin/devices.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,40 @@ Some actions can be applied on a per device level, these all exist on the right
2727
- Display device information
2828
- Migrate
2929

30+
### Manage Users
31+
32+
Clicking on the manage users icon will open a dialog allowing you to add or remove users from the device.
33+
34+
Users can have different global permissions, which can be controlled from the [users page](/apps/admin/users#permissions).
35+
36+
![](https://i.imgur.com/yIbkNpT.png)
37+
38+
Clicking `Add User`, open an additional dialog allowing you to select a user from the list of users on your account, or create a new user.
39+
40+
#### Add Existing user
41+
42+
In order to select an existing user, click on their name from the list.
43+
44+
![](https://i.imgur.com/5aFeQlp.png)
45+
46+
On success, you'll see a confirmation message in the top right corner.
47+
48+
#### Add New user
49+
50+
To create a new user, click on the `Create New` button.
51+
52+
This will open a dialog allowing you to enter the new users details.
53+
54+
![](https://i.imgur.com/hKBzdYU.png)
55+
56+
Once you have entered the details, click `Create` to create the user.
57+
58+
On success, you'll see a confirmation message in the top right corner.
59+
60+
#### Remove a user
61+
62+
To remove a user from the device, click on the `X` icon next to their name.
63+
3064
### Device information
3165

3266
Verbose information about the device, such as the last known location, battery level, and more.

apps/admin/invoice-audit.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Invoice Audit
22

3-
The invoice audit page allows you to see the number of devices activated and deactivaed on your account in a given month.
4-
53
::: warning
6-
This is primarily for reseller plans and reseller billing.
4+
As of April 2025, all reseller devices have been moved onto the new billing system. As a result you may find the new [plans page](./plans) more useful for your needs when auditing an account for billing purposes.
5+
6+
Historically this invoice audit page was primarily for reseller plans and reseller billing.
7+
8+
It will likely be removed in the future.
79
:::
810

11+
The invoice audit page allows you to see the number of devices activated and deactivated on your account in a given month.
12+
913
![](https://i.imgur.com/xC0cMVi.png)
1014

1115
You can also download a CSV export of the data.

0 commit comments

Comments
 (0)