Skip to content

Commit 442113e

Browse files
authored
Remote Access: not experimental any more (#33148)
1 parent 10c646e commit 442113e

8 files changed

Lines changed: 65 additions & 11 deletions

File tree

assets/js/components/Config/BackupRestoreModal.vue

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,31 @@
9797
</small>
9898
</label>
9999
</div>
100+
101+
<div class="d-flex mb-1">
102+
<input
103+
id="resetRemote"
104+
v-model="selectedReset.remote"
105+
class="form-check-input"
106+
type="checkbox"
107+
/>
108+
<label class="form-check-label ms-2" for="resetRemote">
109+
<span>{{ $t("config.system.backupRestore.reset.remote") }}</span>
110+
<br />
111+
<small>
112+
{{ $t("config.system.backupRestore.reset.remoteDescription") }}
113+
</small>
114+
</label>
115+
</div>
100116
</div>
101117

102118
<button
103119
class="btn btn-outline-danger mt-3"
104-
:disabled="!selectedReset.sessions && !selectedReset.settings"
120+
:disabled="
121+
!selectedReset.sessions &&
122+
!selectedReset.settings &&
123+
!selectedReset.remote
124+
"
105125
>
106126
{{ $t("config.system.backupRestore.reset.action") }}
107127
</button>
@@ -192,6 +212,7 @@ export default defineComponent({
192212
selectedReset: {
193213
sessions: false,
194214
settings: false,
215+
remote: false,
195216
},
196217
file: null as File | null,
197218
confirmType: "" as "backup" | "restore" | "reset" | "",
@@ -228,6 +249,7 @@ export default defineComponent({
228249
this.selectedReset = {
229250
sessions: false,
230251
settings: false,
252+
remote: false,
231253
};
232254
this.file = null;
233255
this.navigateHomeAfterRestart = false;

assets/js/components/Config/Remote/RemoteModal.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
data-testid="remote-modal"
77
@open="onOpen"
88
>
9-
<div class="alert alert-warning">
10-
Development preview. Not ready for general use. Use with caution and monitor your system
11-
closely. Feedback welcome!
12-
</div>
139
<SponsorTokenRequired v-if="!isSponsor" feature class="mt-0" />
1410
<ErrorMessage :error="error" />
1511

1612
<template v-if="view === 'list'">
17-
<p>{{ $t("config.remote.description") }}</p>
13+
<p>
14+
{{ $t("config.remote.description") }}
15+
<i18n-t tag="span" keypath="config.remote.privacy" scope="global">
16+
<a :href="privacyPolicyLink" target="_blank">
17+
{{ $t("config.remote.privacyLink") }}
18+
</a>
19+
</i18n-t>
20+
</p>
1821
<div class="form-check form-switch my-3">
1922
<input
2023
id="remoteEnabled"
@@ -138,14 +141,18 @@ export default defineComponent({
138141
status(): RemoteStatus {
139142
return this.remote?.status ?? { connected: false, loginBlocked: false };
140143
},
144+
privacyPolicyLink(): string {
145+
const path = this.$i18n.locale === "de" ? "" : "/en";
146+
return `https://evcc.io${path}/datenschutz/`;
147+
},
141148
modalTitle(): string {
142149
switch (this.view) {
143150
case "create":
144151
return this.$t("config.remote.addClientTitle");
145152
case "reveal":
146153
return this.$t("config.remote.clientCreated");
147154
default:
148-
return `${this.$t("config.remote.title")} 🧪`;
155+
return this.$t("config.remote.title");
149156
}
150157
},
151158
},

assets/js/views/Config.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,7 @@
419419
</template>
420420
</DeviceCard>
421421
<DeviceCard
422-
v-if="experimental"
423-
:title="`${$t('config.remote.title')} 🧪`"
422+
:title="$t('config.remote.title')"
424423
editable
425424
:unconfigured="isUnconfigured(remoteTags)"
426425
data-testid="remote-access"

i18n/de.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@
840840
"noClients": "Noch keine Clients. Niemand kann sich verbinden.",
841841
"password": "Passwort",
842842
"passwordOnce": "Dieses Passwort wird nur einmal angezeigt. QR-Code scannen oder jetzt kopieren. Es wird später nicht mehr angezeigt.",
843+
"privacy": "Mit der Aktivierung dieser Funktion akzeptierst du unsere {0}.",
844+
"privacyLink": "Datenschutzerklärung",
843845
"qrInstall": "Installiere die evcc-App für {ios} oder {android}.",
844846
"qrScan": "Scanne den Code mit der Kamera deines Smartphones, um dich zu verbinden. Klicke ihn an, wenn du bereits dein Handy nutzt.",
845847
"removeClient": "Client entfernen",
@@ -916,6 +918,8 @@
916918
"confirmationButton": "Zurücksetzen & Neustart",
917919
"confirmationText": "Dies löscht deine ausgewählten Daten dauerhaft. Stelle sicher, dass du zuerst eine Sicherung heruntergeladen hast.",
918920
"description": "Hast du Probleme mit der Konfiguration und möchtest von vorne beginnen? Lösche alle Daten und beginne neu.",
921+
"remote": "Remotezugriff",
922+
"remoteDescription": "Löscht Konfiguration und Zugangsdaten.",
919923
"sessions": "Ladevorgänge",
920924
"sessionsDescription": "Löscht den Verlauf deiner Ladevorgänge.",
921925
"settings": "Konfiguration & Einstellungen",

i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@
840840
"noClients": "No clients yet. No one can connect yet.",
841841
"password": "Password",
842842
"passwordOnce": "This password is shown only once. Scan the QR code or copy it now. You won't be able to see it again.",
843+
"privacy": "By enabling this feature, you agree to our {0}.",
844+
"privacyLink": "privacy policy",
843845
"qrInstall": "Install the evcc app for {ios} or {android}.",
844846
"qrScan": "Scan the code with your phone's camera to connect. Click it, if you're already using your phone.",
845847
"removeClient": "Remove client",
@@ -916,6 +918,8 @@
916918
"confirmationButton": "Reset & restart",
917919
"confirmationText": "This will permanently delete your selected data. Ensure you've downloaded a backup first.",
918920
"description": "Having problems with configuration and want to start over? Delete all data and start fresh.",
921+
"remote": "Remote access",
922+
"remoteDescription": "Deletes configuration and credentials.",
919923
"sessions": "Charging sessions",
920924
"sessionsDescription": "Deletes your charging session history.",
921925
"settings": "Configuration & settings",

server/http_site_handler.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"time"
1616

1717
"github.com/evcc-io/evcc/api"
18+
"github.com/evcc-io/evcc/core/keys"
1819
"github.com/evcc-io/evcc/core/loadpoint"
1920
"github.com/evcc-io/evcc/core/site"
2021
"github.com/evcc-io/evcc/server/assets"
@@ -528,6 +529,7 @@ func resetDatabase(shutdown func()) http.HandlerFunc {
528529
var req struct {
529530
Sessions bool `json:"sessions"`
530531
Settings bool `json:"settings"`
532+
Remote bool `json:"remote"`
531533
}
532534
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
533535
jsonError(w, http.StatusBadRequest, err)
@@ -560,6 +562,15 @@ func resetDatabase(shutdown func()) http.HandlerFunc {
560562
}
561563
}
562564

565+
if req.Remote {
566+
for _, key := range []string{keys.Remote, keys.RemoteClients, keys.RemoteLastSeen} {
567+
if err := settings.Delete(key); err != nil {
568+
jsonError(w, http.StatusInternalServerError, err)
569+
return
570+
}
571+
}
572+
}
573+
563574
// close db connection to avoid on-shutdown writes
564575
if err := db.Close(); err != nil {
565576
jsonError(w, http.StatusInternalServerError, err)

server/mcp/openapi.json

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

server/openapi.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ paths:
13271327
post:
13281328
operationId: resetDatabase
13291329
summary: Reset database
1330-
description: "Selectively deletes sessions and/or settings from the database. Session users must supply the admin password in the X-Admin-Password header. API key holders via Bearer token are exempt. The instance restarts after a successful reset."
1330+
description: "Selectively deletes sessions, settings and/or remote access data from the database. Session users must supply the admin password in the X-Admin-Password header. API key holders via Bearer token are exempt. The instance restarts after a successful reset."
13311331
tags:
13321332
- db
13331333
security:
@@ -1348,6 +1348,9 @@ paths:
13481348
settings:
13491349
type: boolean
13501350
description: Delete all settings, configs, and meters
1351+
remote:
1352+
type: boolean
1353+
description: Delete remote access configuration and registered clients
13511354
responses:
13521355
"204":
13531356
description: Reset successful, instance is restarting

0 commit comments

Comments
 (0)