Skip to content

Commit

Permalink
[#184] Add error message when subtle crypto is unavailable
Browse files Browse the repository at this point in the history
closes #184

Signed-off-by: Knut Ahlers <[email protected]>
  • Loading branch information
Luzifer committed Oct 26, 2024
1 parent 1514af3 commit a87cc5c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
3 changes: 3 additions & 0 deletions i18n.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ reference:
translators:
- Luzifer
translations:
alert-insecure-environment: You are accessing this instance using an insecure connection. You will not be able to create or read secrets.
alert-secret-not-found: This is not the secret you are looking for&hellip; - If you expected the secret to be here it might be compromised as someone else might have opened the link already.
alert-something-went-wrong: Something went wrong. I'm very sorry about this&hellip;
btn-create-secret: Create the secret!
Expand Down Expand Up @@ -97,6 +98,7 @@ translations:
translators:
- Luzifer
translations:
alert-insecure-environment: Du besuchst diese Instanz über eine unsichere Verbindung. Du kannst deswegen keine Secrets erstellen oder lesen.
alert-secret-not-found: Das ist nicht das Secret, was du suchst&hellip; - Falls du diesen Link noch nicht selbst geöffnet hast, könnte das Secret kompromittiert sein, da jemand anderes den Link geöffnet haben könnte.
alert-something-went-wrong: Irgendwas ging schief. Entschuldigung&hellip;
btn-create-secret: Secret erstellen!
Expand Down Expand Up @@ -142,6 +144,7 @@ translations:
tooltip-copy-to-clipboard: In die Zwischenablage kopieren
tooltip-download-as-file: Als Datei herunterladen
formalTranslations:
alert-insecure-environment: Sie besuchen diese Instanz über eine unsichere Verbindung. Sie können deswegen keine Secrets erstellen oder lesen.
alert-secret-not-found: Dieses Secret existiert nicht. - Falls Sie diesen Link noch nicht selbst geöffnet haben, könnte der Inhalt kompromittiert sein, da jemand anderes den Link geöffnet haben könnte.
btn-reveal-secret: Secret anzeigen
items-explanation:
Expand Down
6 changes: 5 additions & 1 deletion src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
v-if="error"
class="row justify-content-center"
>
<div class="col-8">
<div class="col-12 col-md-8">
<div
class="alert alert-danger"
role="alert"
Expand Down Expand Up @@ -100,6 +100,10 @@ export default {
mounted() {
window.onhashchange = this.hashLoad
this.hashLoad()
if (!this.$root.isSecureEnvironment) {
this.error = this.$t('alert-insecure-environment')
}
},
name: 'App',
Expand Down
6 changes: 5 additions & 1 deletion src/components/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<template>
<!-- Creation disabled -->
<div
v-if="!canWrite"
v-if="!showCreateForm"
class="card border-info-subtle mb-3"
>
<div
Expand Down Expand Up @@ -210,6 +210,10 @@ export default {
maxFileSizeExceeded() {
return this.fileSize > this.maxFileSize
},
showCreateForm() {
return this.canWrite && this.$root.isSecureEnvironment
},
},
created() {
Expand Down
Loading

0 comments on commit a87cc5c

Please sign in to comment.