generated from magda-io/magda-auth-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.md.gotmpl
85 lines (62 loc) · 3.82 KB
/
README.md.gotmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
{{ template "chart.description" . }}
Requires MAGDA version 0.0.58 or above.
### How to Use
1. Add the auth plugin as a [Helm Chart Dependency](https://helm.sh/docs/helm/helm_dependency/) in your deployment Helm Chart [Chart.yaml](https://helm.sh/docs/topics/charts/#chart-dependencies):
```yaml
- name: magda-auth-internal
version: "2.0.0" # or put latest version number here
repository: "oci://ghcr.io/magda-io/charts"
```
> Since v2.0.0, we use [Github Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) as our official Helm Chart & Docker Image release registry.
2. (Optional) Config the auth plugin in your deployment [Values file](https://helm.sh/docs/chart_template_guide/values_files/). Support parameters can be found from the `Values` section below:
e.g. You can optionally set the text content below the login form.
```yaml
magda-auth-internal:
authPluginConfig:
loginFormExtraInfoContent: "Forgot your password? Email [test@test.com](test@test.com)"
```
3. Config Gatway (in your deployment [Values file](https://helm.sh/docs/chart_template_guide/values_files/)) to add the auth plugin to Gateway's plugin list (More details see [here](https://github.com/magda-io/magda/blob/master/deploy/helm/internal-charts/gateway/README.md))
```yaml
gateway:
authPlugins:
- key: internal
baseUrl: http://magda-auth-internal
```
{{ template "chart.homepageLine" . }}
### `set-user-password` tool Usage
The `set-user-password` tool commandline tool can be used to set password for a local user.
To use this tool, you need:
- Clone this repo
- Run `yarn install`
After that, run
```
$ yarn set-user-password
```
will show usage information:
```
Usage: set-user-password [options]
A tool for setting magda users' password. Version: 1.0.0
By Default, a random password will be auto generate if -p or --password option does not present.
The database connection to auth DB is required, the following environment variables will be used to create a connection:
POSTGRES_HOST: database host; If not available in env var, 'localhost' will be used.
POSTGRES_DB: database name; If not available in env var, 'auth' will be used.
POSTGRES_USER: database username; If not available in env var, 'postgres' will be used.
POSTGRES_PASSWORD: database password; If not available in env var, '' will be used.
Options:
-V, --version output the version number
-u, --user [User ID or email] Specify the user id or email of the user whose password will be reset. If -c switch not present, this switch must be used.
-c, --create [user email] Create the user record before set the password rather than set password for an existing user. If -u switch not present, this switch must be used.
-p, --password [password string] Optional. Specify the password that reset the user account to.
-n, --displayName [user display name] Optional, valid when -c is specified. If not present, default display will be same as the email address. Use double quote if the name contains space.
-a, --isAdmin Optional, valid when -c is specified. If present, the user will be created as admin user.
-h, --help output usage information
```
More examples of using this tool can also be found from [How to create Local Users Doc](https://github.com/magda-io/magda/blob/master/docs/docs/how-to-create-local-users.md)
{{ template "chart.maintainersSection" . }}
{{ template "chart.sourcesSection" . }}
{{ template "chart.requirementsSection" . }}
{{ template "chart.valuesHeader" . }}
{{ template "chart.valuesTable" . }}