Skip to content

Commit

Permalink
broke out the certificate generation to be its own script, added reac…
Browse files Browse the repository at this point in the history
…tivity to the copy text button, also the button now toasts with a success explaining the text copied
  • Loading branch information
JmScherer committed Nov 13, 2023
1 parent c6b8dba commit fc1bec8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
20 changes: 20 additions & 0 deletions etc/generate-ssl-certs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

# Uses mkcert to generate self-signed SSL/TLS certificates to allow Traefik to manage HTTPS
# connections for a local deployment for Rosalution. Automatically installs the generated certificate
# with the Chrome browser trust to let the browser know the certificate is valid and secure when
# accessing local.rosalutin.cgds/rosalution.

# Also creates the certificate directory path, default is ./etc/.certificates

# ./generate-ssl-certs.sh <hostname> <certificate path>
# ./generate-ssl-certs.sh local.rosalution.cgds ./etc/.certificates


HOSTNAME=$1
CERT_PATH=$2

mkdir "$CERT_PATH"

mkcert -cert-file "$CERT_PATH"/local-deployment-cert.pem -key-file "$CERT_PATH"/local-deployment-key.pem "$HOSTNAME"
mkcert -install
9 changes: 9 additions & 0 deletions frontend/src/components/AnalysisView/GeneBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default {
},
copyToClipboard(textToCopy) {
navigator.clipboard.writeText(textToCopy);
this.$emit('clipboard-copy', textToCopy);
},
getCompleteHgvsVariantName(variant) {
if (variant.p_dot) {
Expand Down Expand Up @@ -140,6 +141,14 @@ export default {
padding-bottom: var(--p-1)
}
.copy-icon:hover {
cursor: pointer;
}
.copy-icon:active {
color: var(--rosalution-purple-200)
}
.genomic-build {
font-size: .875rem;
font-weight: 600;
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/views/AnalysisView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
:gene="genomicUnit.gene"
:transcripts="genomicUnit.transcripts"
:variants="genomicUnit.variants"
@clipboard-copy="this.copyToClipboard"
/>
<SectionBox
v-for="(section) in sectionsList"
Expand Down Expand Up @@ -598,6 +599,10 @@ export default {
await notificationDialog.title('Failure').confirmText('Ok').alert(error);
}
},
copyToClipboard(copiedText) {
toast.success(`Copied ${copiedText} to clipboard!`);
}

Check failure on line 605 in frontend/src/views/AnalysisView.vue

View workflow job for this annotation

GitHub Actions / nodejs-ci (20.8)

Missing trailing comma
},
};
</script>
Expand Down
10 changes: 1 addition & 9 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ clean() {
cd - || { echo "Failure to change return to root directory"; exit 1; }
}

generate_cert() {
local HOSTNAME=$1
local CERT_PATH=$2

mkcert -cert-file "$CERT_PATH"/local-deployment-cert.pem -key-file "$CERT_PATH"/local-deployment-key.pem "$HOSTNAME"
mkcert -install
}

clean_option="clean"

if [[ $# -ne 0 ]] && [[ $1 -eq $clean_option ]]
Expand All @@ -43,7 +35,7 @@ install system-tests
if command -v mkcert &> /dev/null
then
echo "mkcert found, generating certificates"
generate_cert local.rosalution.cgds ./etc/.certificates
./etc/generate-ssl-certs.sh local.rosalution.cgds ./etc/.certificates
else
echo "mkcert could not be found, could not generate certificates. Browser will throw insecure warning."
echo "To generate certificates, please visit and install: https://github.com/FiloSottile/mkcert"
Expand Down

0 comments on commit fc1bec8

Please sign in to comment.