Skip to content

Commit 0d03a59

Browse files
committed
feat(deploy): deprecate direct Docker access and Docker Socket Proxy, scheduled for removal in Nextcloud 35
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 32290fd commit 0d03a59

9 files changed

Lines changed: 56 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ All notable changes to this project will be documented in this file.
99
The format is based on [Keep a Changelog](http://keepachangelog.com/)
1010
and this project adheres to [Semantic Versioning](http://semver.org/).
1111

12+
## [34.0.0]
13+
14+
### Deprecated
15+
16+
- Direct Docker access via Docker Socket Proxy is deprecated and scheduled for removal in Nextcloud 35. Migrate `docker-install` daemons to HaRP.
17+
- AIO Docker Socket Proxy auto-registration (`AIODockerActions::registerAIODaemonConfig`) is deprecated in favor of the HaRP-based AIO daemon.
18+
19+
1220
## [3.2.0 - 2024-09-10]
1321

1422
### Added

js/app_api-adminSettings.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app_api-adminSettings.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Command/Daemon/RegisterDaemon.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function configure(): void {
3434

3535
$this->addArgument('name', InputArgument::REQUIRED, 'Unique deploy daemon name');
3636
$this->addArgument('display-name', InputArgument::REQUIRED);
37-
$this->addArgument('accepts-deploy-id', InputArgument::REQUIRED, 'The deployment method that the daemon accepts. Can be "manual-install" or "docker-install". "docker-install" is for Docker Socket Proxy and HaRP.');
37+
$this->addArgument('accepts-deploy-id', InputArgument::REQUIRED, 'The deployment method that the daemon accepts. Can be "manual-install", "docker-install", or "kubernetes-install". "docker-install" is for HaRP (recommended) and the legacy Docker Socket Proxy (deprecated, scheduled for removal in Nextcloud 35).');
3838
$this->addArgument('protocol', InputArgument::REQUIRED, 'The protocol used to connect to the daemon. Can be "http" or "https".');
3939
$this->addArgument('host', InputArgument::REQUIRED, 'The hostname (and port) or path at which the Docker socket proxy or HaRP or the manual-install app is/would be available. This does not need to be a public host, just a host accessible by the Nextcloud server. It can also be a path to the Docker socket. (e.g. appapi-harp:8780, /var/run/docker.sock)');
4040
$this->addArgument('nextcloud_url', InputArgument::REQUIRED);
@@ -161,6 +161,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
161161
$output->writeln('<comment>Warning: The host contains a port, which will be ignored for manual-install daemons. The ExApp\'s port from --json-info will be used instead.</comment>');
162162
}
163163

164+
if ($acceptsDeployId === 'docker-install' && !$isHarp) {
165+
$output->writeln('<comment>Warning: Direct Docker access (Docker Socket Proxy) is deprecated and will be removed in Nextcloud 35. Please register a HaRP-based daemon instead (pass --harp).</comment>');
166+
}
167+
164168
if ($this->daemonConfigService->getDaemonConfigByName($name) !== null) {
165169
$output->writeln(sprintf('Registration skipped, as the daemon config `%s` already exists.', $name));
166170
return 0;

lib/DeployActions/AIODockerActions.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
* Class with utils methods for AIO setup
1919
*/
2020
class AIODockerActions {
21+
/** @deprecated since AppAPI 34.0.0, scheduled for removal in Nextcloud 35. Use AIO_HARP_DAEMON_CONFIG_NAME instead. */
2122
public const AIO_DAEMON_CONFIG_NAME = 'docker_aio';
23+
/** @deprecated since AppAPI 34.0.0, scheduled for removal in Nextcloud 35. Use AIO_HARP_HOST instead. */
2224
public const AIO_DOCKER_SOCKET_PROXY_HOST = 'nextcloud-aio-docker-socket-proxy:2375';
2325
public const AIO_HARP_DAEMON_CONFIG_NAME = 'harp_aio';
2426
public const AIO_HARP_HOST = 'nextcloud-aio-harp:8780';
@@ -37,7 +39,10 @@ public function isAIO(): bool {
3739
}
3840

3941
/**
40-
* Registers DaemonConfig with default params to use AIO Docker Socket Proxy
42+
* Registers DaemonConfig with default params to use AIO Docker Socket Proxy.
43+
*
44+
* @deprecated since AppAPI 34.0.0, scheduled for removal in Nextcloud 35.
45+
* Use {@see registerAIOHarpDaemonConfig()} instead.
4146
*/
4247
public function registerAIODaemonConfig(): ?DaemonConfig {
4348
$defaultDaemonConfig = $this->appConfig->getValueString(Application::APP_ID, 'default_daemon_config', lazy: true);
@@ -83,7 +88,10 @@ public function isHarpEnabled(): bool {
8388
}
8489

8590
/**
86-
* Check if Docker Socket Proxy is enabled in AIO
91+
* Check if Docker Socket Proxy is enabled in AIO.
92+
*
93+
* @deprecated since AppAPI 34.0.0, scheduled for removal in Nextcloud 35.
94+
* The Docker Socket Proxy deployment mode is being replaced by HaRP.
8795
*/
8896
public function isDockerSocketProxyEnabled(): bool {
8997
$dspEnabled = getenv('DOCKER_SOCKET_PROXY_ENABLED');

lib/Service/DaemonConfigService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use OCA\AppAPI\Db\DaemonConfig;
1313
use OCA\AppAPI\Db\DaemonConfigMapper;
1414

15+
use OCA\AppAPI\DeployActions\DockerActions;
1516
use OCA\AppAPI\DeployActions\KubernetesActions;
1617
use OCA\AppAPI\DeployActions\ManualActions;
1718
use OCP\AppFramework\Db\DoesNotExistException;
@@ -77,6 +78,12 @@ public function registerDaemonConfig(array $params): ?DaemonConfig {
7778
$this->logger->error('Failed to register daemon configuration: setting `net=host` in HaRP is not supported when communication with ExApps is done directly without FRP.');
7879
return null;
7980
}
81+
if ($params['accepts_deploy_id'] === DockerActions::DEPLOY_ID && empty($params['deploy_config']['harp'])) {
82+
$this->logger->warning(sprintf(
83+
'Daemon "%s" uses direct Docker access (Docker Socket Proxy). This deployment method is deprecated and will be removed in Nextcloud 35. Please migrate to a HaRP-based daemon.',
84+
$params['name'],
85+
));
86+
}
8087
$params['deploy_config']['nextcloud_url'] = rtrim($params['deploy_config']['nextcloud_url'], '/');
8188
try {
8289
if (isset($params['deploy_config']['haproxy_password']) && $params['deploy_config']['haproxy_password'] !== '') {

src/components/DaemonConfig/DaemonConfigDetailsModal.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
{{ t('app_api', 'The "Manual install" daemon is usually used for development. It cannot be set as the default daemon.') }}
1919
</NcNoteCard>
2020

21+
<NcNoteCard v-if="isDeprecatedDirectDocker" type="warning">
22+
{{ t('app_api', 'Direct Docker access (Docker Socket Proxy) is deprecated and will be removed in Nextcloud 35. Please migrate to a HaRP-based daemon.') }}
23+
</NcNoteCard>
24+
2125
<NcNoteCard v-if="daemon.accepts_deploy_id === 'kubernetes-install'" type="info">
2226
{{ t('app_api', 'This is a Kubernetes daemon managed via CLI.') }}
2327
</NcNoteCard>
@@ -127,6 +131,11 @@ export default {
127131
verifying: false,
128132
}
129133
},
134+
computed: {
135+
isDeprecatedDirectDocker() {
136+
return this.daemon.accepts_deploy_id === 'docker-install' && !this.daemon.deploy_config?.harp
137+
},
138+
},
130139
methods: {
131140
closeModal() {
132141
this.$emit('update:show', false)

src/components/DaemonConfig/ManageDaemonConfigModal.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
@close="closeModal">
1010
<div class="register-daemon-config-body">
1111
<h2>{{ isEdit ? t('app_api', 'Edit the deploy daemon') : t('app_api', 'Register a new deploy daemon') }}</h2>
12+
<NcNoteCard v-if="isDeprecatedDirectDocker" type="warning">
13+
{{ t('app_api', 'Direct Docker access (Docker Socket Proxy) is deprecated and will be removed in Nextcloud 35. Please migrate to a HaRP-based daemon.') }}
14+
</NcNoteCard>
1215
<div v-if="!isEdit" class="templates">
1316
<NcSelect
1417
id="daemon-template"
@@ -332,6 +335,7 @@ import { generateUrl } from '@nextcloud/router'
332335
import NcButton from '@nextcloud/vue/components/NcButton'
333336
import NcInputField from '@nextcloud/vue/components/NcInputField'
334337
import NcModal from '@nextcloud/vue/components/NcModal'
338+
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
335339
import NcPasswordField from '@nextcloud/vue/components/NcPasswordField'
336340
import NcSelect from '@nextcloud/vue/components/NcSelect'
337341
import NcFormBoxSwitch from '@nextcloud/vue/components/NcFormBoxSwitch'
@@ -354,6 +358,7 @@ export default {
354358
NcLoadingIcon,
355359
NcModal,
356360
NcInputField,
361+
NcNoteCard,
357362
NcPasswordField,
358363
UnfoldLessHorizontal,
359364
UnfoldMoreHorizontal,
@@ -403,7 +408,10 @@ export default {
403408
registeringDaemon: false,
404409
configurationTab: { id: DAEMON_TEMPLATES[0].name, label: DAEMON_TEMPLATES[0].displayName },
405410
configurationTemplateOptions: [
406-
...DAEMON_TEMPLATES.map(template => { return { id: template.name, label: template.displayName } }),
411+
...DAEMON_TEMPLATES.map(template => ({
412+
id: template.name,
413+
label: template.deprecated ? `${template.displayName} (deprecated)` : template.displayName,
414+
})),
407415
],
408416
verifyingDaemonConnection: false,
409417
computeDevices: DAEMON_COMPUTE_DEVICES,
@@ -567,6 +575,9 @@ export default {
567575
isK8s() {
568576
return this.acceptsDeployId === 'kubernetes-install'
569577
},
578+
isDeprecatedDirectDocker() {
579+
return this.acceptsDeployId === 'docker-install' && !this.isHarp
580+
},
570581
},
571582
watch: {
572583
configurationTab(newConfigurationTab) {

src/constants/daemonTemplates.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export const DAEMON_TEMPLATES = [
120120
name: 'docker_socket_proxy',
121121
displayName: 'Docker Socket Proxy',
122122
acceptsDeployId: 'docker-install',
123+
deprecated: true,
123124
httpsEnabled: false,
124125
host: 'nextcloud-appapi-dsp:2375',
125126
nextcloud_url: null,
@@ -144,6 +145,7 @@ export const DAEMON_TEMPLATES = [
144145
name: 'custom',
145146
displayName: 'Custom Default',
146147
acceptsDeployId: 'docker-install',
148+
deprecated: true,
147149
httpsEnabled: false,
148150
host: 'nextcloud-appapi-dsp:2375',
149151
nextcloud_url: null,
@@ -168,6 +170,7 @@ export const DAEMON_TEMPLATES = [
168170
name: 'docker_aio',
169171
displayName: 'All-in-One',
170172
acceptsDeployId: 'docker-install',
173+
deprecated: true,
171174
httpsEnabled: false,
172175
host: 'nextcloud-aio-docker-socket-proxy:2375',
173176
nextcloud_url: null,

0 commit comments

Comments
 (0)