@docbox-nz/docbox-cli 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,98 +2,22 @@
2
2
 
3
3
  CLI tool to setup and manage document box instances
4
4
 
5
- # Create credentials file
5
+ ## Create credentials file
6
6
 
7
- The credentials file is used by the CLI to access the database with a higher level of permissions to perform things like migrations and setting up tenants. You will need this to perform a majority of the CLI actions:
7
+ The CLI tool require a configuration file in order to operate. See the [CLI Config](https://docbox-nz.pages.dev/docs/guides/setup/cli-config) guide to set one up
8
8
 
9
+ ## Initialize root database
9
10
 
10
- Create a file name `cli-credentials.json` in the root of the repository:
11
+ Before you can setup docbox tenants you must setup the root docbox database. See the [Create Root](https://docbox-nz.pages.dev/docs/guides/setup/create-root) guide to set this up
11
12
 
12
- ```json
13
- {
14
- "database": {
15
- "__description": "Database details and credentials",
16
- "host": "{DATABASE HOST}",
17
- "port": 5432, // DATABASE PORT
18
- "root_secret_name": "{ROOT DATABASE SECRET NAME}",
19
- "root_role_name": "{ROOT DATABASE ROLE NAME}",
20
- "root_secret_password": "{ROOT DATABASE SECRET PASSWORD}",
21
- "setup_user": {
22
- "__description": "User to use when migrating and setting up database, should have higher permissions",
23
- "username": "{DB USER}",
24
- "password": "{DB PASSWORD}"
25
- }
26
- },
27
- "secrets": {
28
- "__description": "Secrets manager configurations",
29
- "provider": "aws"
30
- },
31
- "search": {
32
- "__description": "Search index factory configuration",
33
- "provider": "typesense",
34
- "url": "http://localhost:8108",
35
- "api_key": "typesensedev"
36
- },
37
- "storage": {
38
- "provider": "s3",
39
- "endpoint": {
40
- "type": "aws"
41
- }
42
- }
43
- }
44
- ```
13
+ ## Create new tenant
45
14
 
46
- # Initialize root database
47
-
48
- To initialize the root database for docbox run the following command
49
-
50
- ```sh
51
- cargo run --release -p docbox-cli -- create-root
52
- ```
53
-
54
- # Create new tenant
55
-
56
- Create a new file in this case `demo-tenant.json` this will contain the following:
57
-
58
- ```json
59
- {
60
- "id": "00000000-0000-0000-0000-000000000000",
61
- "env": "{Development/Production}",
62
- "db_name": "docbox-{tag}-{dev/prod}",
63
- "db_secret_name": "postgres/docbox/{dev/prod}/{tag}",
64
- "db_role_name": "{TENANT DB ROLE NAME}",
65
- "storage_bucket_name": "docbox-{tag}-{dev/prod}",
66
- "search_index_name": "docbox-{tag}-{dev/prod}",
67
- "storage_s3_queue_arn": "arn:aws:sqs:ap-southeast-2:{YOUR_S3_UPLOADS_QUEUE_ARN}",
68
- "event_queue_url": "https://sqs.ap-southeast-2.amazonaws.com/{YOUR_EVENT_QUEUE_ARN}",
69
- "storage_cors_origins": [
70
- "https://{SOME_ORIGIN}"
71
- ]
72
- }
73
- ```
74
-
75
- Then run the following command from the root of this repository:
76
-
77
- > You must ensure you have a `.env` file setup containing all the required environment
78
- > variables from the terraform setup
79
- >
80
- > Along with:
81
- > ```
82
- > AWS_ACCESS_KEY_ID={YOUR AWS KEY ID}
83
- > AWS_SECRET_ACCESS_KEY={YOUR AWS SECRET ACCESS KEY}
84
- > ```
85
- >
86
- > The specified key must have high enough permission to manage S3 buckets
87
-
88
-
89
- ```sh
90
- cargo run --release -p docbox-cli -- create-tenant --file ./demo-tenant.json
91
- ```
15
+ To create a new tenant with the CLI follow the [Create Tenant](https://docbox-nz.pages.dev/docs/guides/setup/create-tenant) guide.
92
16
 
93
17
  # Migrations
94
18
 
95
- To be documented, but runs a SQL migration over the database (With optional filtering for environment or tenant)
19
+ To be documented, but runs pending tenant migrations (With optional filtering for environment or tenant)
96
20
 
97
21
  ```sh
98
- cargo run --release -p docbox-cli -- migrate --env Development --file ./packages/docbox-cli/migrations/m1_file_parent_id.sql --tenant-id 00000000-0000-0000-0000-000000000000
22
+ docbox-cli -- migrate --env Development --tenant-id 00000000-0000-0000-0000-000000000000
99
23
  ```
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "@docbox-nz/docbox-cli",
26
- "version": "0.2.1"
26
+ "version": "0.3.0"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -896,5 +896,5 @@
896
896
  }
897
897
  },
898
898
  "requires": true,
899
- "version": "0.2.1"
899
+ "version": "0.3.0"
900
900
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/docbox-nz/docbox-cli/releases/download/0.2.1",
2
+ "artifactDownloadUrl": "https://github.com/docbox-nz/docbox-cli/releases/download/0.3.0",
3
3
  "author": "Jacobtread <jacobtread@gmail.com>",
4
4
  "bin": {
5
5
  "docbox-cli": "run-docbox-cli.js"
@@ -96,7 +96,7 @@
96
96
  "zipExt": ".tar.xz"
97
97
  }
98
98
  },
99
- "version": "0.2.1",
99
+ "version": "0.3.0",
100
100
  "volta": {
101
101
  "node": "18.14.1",
102
102
  "npm": "9.5.0"