Skip to content

Commit

Permalink
Continue work on SSL Support
Browse files Browse the repository at this point in the history
* Fix typo causing CA field to reset on each keystroke
* Change cert key field placeholder to indicate if it has been set or
  not
* Reset cert key when username or password is reset
* Ensure grafana toolkit installed globally in builder dockerfile
  • Loading branch information
meln5674 committed Jan 14, 2023
1 parent 0b80e4c commit d1bb384
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions build-env.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ COPY --from=kind /usr/local/bin/kind /usr/local/bin/kind

RUN apt-get install -y gcc g++ zip unzip make

RUN npm install -g @grafana/toolkit

RUN node --version \
&& npm --version \
&& yarn --version \
Expand Down
12 changes: 4 additions & 8 deletions src/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class ConfigEditor extends PureComponent<Props, State> {
const { onOptionsChange, options } = this.props;
const jsonData = {
...options.jsonData,
tlsCA: event.target.value,
tlsCa: event.target.value,
};
onOptionsChange({ ...options, jsonData });
};
Expand Down Expand Up @@ -93,12 +93,8 @@ export class ConfigEditor extends PureComponent<Props, State> {
secureJsonFields: {
...options.secureJsonFields,
username: false,
password: false
},
secureJsonData: {
...options.secureJsonData,
username: '',
password: ''
password: false,
tlsCertificateKey: false,
},
});
};
Expand Down Expand Up @@ -195,7 +191,7 @@ export class ConfigEditor extends PureComponent<Props, State> {
<Field label="TLS Certificate Key">
<TextArea
value={secureJsonData.tlsCertificateKey || ''}
placeholder={"-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"}
placeholder={secureJsonFields.tlsCertificateKey ? "-----BEGIN RSA PRIVATE KEY-----\n(This field has been set and is hidden)\n-----END RSA PRIVATE KEY-----" : "-----BEGIN RSA PRIVATE KEY-----\n(This field has not been set)\n-----END RSA PRIVATE KEY-----"}
onChange={this.onTLSCertificateKeyChange}
cols={100}
/>
Expand Down

0 comments on commit d1bb384

Please sign in to comment.