Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- `POST /ocs/v2.php/apps/app_api/api/v1/notification` now answers `404` when the `notifications` app is not enabled, instead of `200` for a notification that nobody delivers.
- `occ app_api:daemon:register` and the admin settings refuse a HaRP or HTTPS daemon key shorter than 12 characters. #1082
- The daemon templates in the admin settings no longer prefill the HaRP shared key or HaProxy password. #1083

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion js/app_api-adminSettings.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/app_api-adminSettings.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Service/DaemonConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public const LOCAL_REGISTRY = 'local';
/** Minimum length of the HaRP shared key, and of the HaProxy password of an HTTPS daemon. */
public const MIN_SECRET_LENGTH = 12;
/** Example secrets from the documentation and the daemon templates. */
/** Example secrets from the documentation and from older daemon templates. */
private const EXAMPLE_SECRETS = ['some_very_secure_password', 'some_secure_password', 'enter_haproxy_password'];

public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion src/components/DaemonConfig/ManageDaemonConfigModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
id="deploy-config-haproxy-password"
v-model="deployConfig.haproxy_password"
:label="isHarp ? t('app_api', 'HaRP shared key') : t('app_api', 'HaProxy password')"
:error="isHaProxyPasswordValid === false"
:error="!!deployConfig.haproxy_password && isHaProxyPasswordValid === false"
:disabled="isEdit && isK8s"
:placeholder="haProxyPasswordHelperText"
:aria-label="haProxyPasswordHelperText"
Expand Down
12 changes: 6 additions & 6 deletions src/constants/__snapshots__/daemonTemplates.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`DAEMON_TEMPLATES > matches snapshot 1`] = `
"label": "CPU",
},
"gpu": false,
"haproxy_password": "some_very_secure_password",
"haproxy_password": "",
"harp": {
"docker_socket_port": 24000,
"exapp_direct": false,
Expand Down Expand Up @@ -39,7 +39,7 @@ exports[`DAEMON_TEMPLATES > matches snapshot 1`] = `
"label": "CPU",
},
"gpu": false,
"haproxy_password": "some_very_secure_password",
"haproxy_password": "",
"harp": {
"docker_socket_port": 24000,
"exapp_direct": false,
Expand Down Expand Up @@ -67,7 +67,7 @@ exports[`DAEMON_TEMPLATES > matches snapshot 1`] = `
"label": "CPU",
},
"gpu": false,
"haproxy_password": "some_very_secure_password",
"haproxy_password": "",
"harp": {
"docker_socket_port": 24000,
"exapp_direct": true,
Expand Down Expand Up @@ -95,7 +95,7 @@ exports[`DAEMON_TEMPLATES > matches snapshot 1`] = `
"label": "CPU",
},
"gpu": false,
"haproxy_password": "some_very_secure_password",
"haproxy_password": "",
"harp": {
"docker_socket_port": 24000,
"exapp_direct": false,
Expand Down Expand Up @@ -123,7 +123,7 @@ exports[`DAEMON_TEMPLATES > matches snapshot 1`] = `
"label": "CPU",
},
"gpu": false,
"haproxy_password": "enter_haproxy_password",
"haproxy_password": "",
"harp": null,
"net": "host",
"resourceLimits": {
Expand All @@ -148,7 +148,7 @@ exports[`DAEMON_TEMPLATES > matches snapshot 1`] = `
"label": "CPU",
},
"gpu": false,
"haproxy_password": "some_secure_password",
"haproxy_password": "",
"harp": null,
"net": "host",
"resourceLimits": {
Expand Down
12 changes: 6 additions & 6 deletions src/constants/daemonTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const DAEMON_TEMPLATES = [
nextcloud_url: null,
deployConfig: {
net: 'host',
haproxy_password: 'some_very_secure_password',
haproxy_password: '',
gpu: false,
computeDevice: {
id: 'cpu',
Expand Down Expand Up @@ -41,7 +41,7 @@ export const DAEMON_TEMPLATES = [
nextcloud_url: null,
deployConfig: {
net: '',
haproxy_password: 'some_very_secure_password',
haproxy_password: '',
gpu: false,
computeDevice: {
id: 'cpu',
Expand Down Expand Up @@ -69,7 +69,7 @@ export const DAEMON_TEMPLATES = [
nextcloud_url: null,
deployConfig: {
net: 'nextcloud-aio',
haproxy_password: 'some_very_secure_password',
haproxy_password: '',
gpu: false,
computeDevice: {
id: 'cpu',
Expand Down Expand Up @@ -97,7 +97,7 @@ export const DAEMON_TEMPLATES = [
nextcloud_url: null,
deployConfig: {
net: 'host',
haproxy_password: 'some_very_secure_password',
haproxy_password: '',
gpu: false,
computeDevice: {
id: 'cpu',
Expand Down Expand Up @@ -126,7 +126,7 @@ export const DAEMON_TEMPLATES = [
nextcloud_url: null,
deployConfig: {
net: 'host',
haproxy_password: 'enter_haproxy_password',
haproxy_password: '',
gpu: false,
computeDevice: {
id: 'cpu',
Expand All @@ -151,7 +151,7 @@ export const DAEMON_TEMPLATES = [
nextcloud_url: null,
deployConfig: {
net: 'host',
haproxy_password: 'some_secure_password',
haproxy_password: '',
gpu: false,
computeDevice: {
id: 'cpu',
Expand Down
6 changes: 6 additions & 0 deletions src/constants/daemonTemplates.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ describe('DAEMON_TEMPLATES', () => {
}
})

it('does not prefill the HaRP shared key or HaProxy password', () => {
for (const template of DAEMON_TEMPLATES) {
expect(template.deployConfig.haproxy_password, `template "${template.name}" prefills a key`).toBe('')
}
})

it('matches snapshot', () => {
expect(DAEMON_TEMPLATES).toMatchSnapshot()
})
Expand Down
Loading