mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-04 00:20:39 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe5ce580ab | |||
0f882da5d1 | |||
ad6f136dd0 |
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2.1.0] - 2023-01-04
|
||||
|
||||
### Added
|
||||
|
||||
- QR Code to more easily copy and share links.
|
||||
|
||||
## [2.0.7] - 2022-12-26
|
||||
|
||||
### Changed
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"scripts": {
|
||||
"dev:docker": "docker-compose up redis",
|
||||
"dev:docker": "docker-compose -f docker-compose.dev.yaml up redis",
|
||||
"dev:packages": "pnpm --parallel run dev",
|
||||
"dev:proxy": "node proxy.mjs",
|
||||
"dev": "run-p dev:*",
|
||||
|
2
packages/backend/Cargo.lock
generated
2
packages/backend/Cargo.lock
generated
@@ -425,7 +425,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cryptgeon"
|
||||
version = "2.0.7"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-web",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cryptgeon"
|
||||
version = "2.0.7"
|
||||
version = "2.1.0"
|
||||
authors = ["cupcakearmy <hi@nicco.io>"]
|
||||
edition = "2021"
|
||||
|
||||
|
@@ -15,7 +15,8 @@
|
||||
"encrypting": "verschlüsseln",
|
||||
"decrypting": "entschlüsselt",
|
||||
"uploading": "hochladen",
|
||||
"downloading": "wird heruntergeladen"
|
||||
"downloading": "wird heruntergeladen",
|
||||
"qr_code": "qr-code"
|
||||
},
|
||||
"home": {
|
||||
"intro": "Senden Sie ganz einfach <i>vollständig verschlüsselte</i>, sichere Notizen oder Dateien mit einem Klick. Erstellen Sie einfach eine Notiz und teilen Sie den Link.",
|
||||
|
@@ -15,7 +15,8 @@
|
||||
"encrypting": "encrypting",
|
||||
"decrypting": "decrypting",
|
||||
"uploading": "uploading",
|
||||
"downloading": "downloading"
|
||||
"downloading": "downloading",
|
||||
"qr_code": "qr code"
|
||||
},
|
||||
"home": {
|
||||
"intro": "Easily send <i>fully encrypted</i>, secure notes or files with one click. Just create a note and share the link.",
|
||||
|
@@ -15,7 +15,8 @@
|
||||
"encrypting": "encriptando",
|
||||
"decrypting": "descifrando",
|
||||
"uploading": "cargando",
|
||||
"downloading": "descargando"
|
||||
"downloading": "descargando",
|
||||
"qr_code": "código qr"
|
||||
},
|
||||
"home": {
|
||||
"intro": "Envía fácilmente notas o archivos <i>totalmente encriptados</i> y seguros con un solo clic. Solo tienes que crear una nota y compartir el enlace.",
|
||||
|
@@ -15,7 +15,8 @@
|
||||
"encrypting": "cryptage",
|
||||
"decrypting": "déchiffrer",
|
||||
"uploading": "téléchargement",
|
||||
"downloading": "téléchargement"
|
||||
"downloading": "téléchargement",
|
||||
"qr_code": "code qr"
|
||||
},
|
||||
"home": {
|
||||
"intro": "Envoyez facilement des notes ou des fichiers <i>entièrement cryptés</i> et sécurisés en un seul clic. Il suffit de créer une note et de partager le lien.",
|
||||
|
@@ -15,7 +15,8 @@
|
||||
"encrypting": "criptando",
|
||||
"decrypting": "decifrando",
|
||||
"uploading": "caricamento",
|
||||
"downloading": "scaricando"
|
||||
"downloading": "scaricando",
|
||||
"qr_code": "codice qr"
|
||||
},
|
||||
"home": {
|
||||
"intro": "Invia facilmente note o file <i>completamente criptati</i> e sicuri con un solo clic. Basta creare una nota e condividere il link.",
|
||||
|
@@ -15,7 +15,8 @@
|
||||
"encrypting": "加密",
|
||||
"decrypting": "解密",
|
||||
"uploading": "上传",
|
||||
"downloading": "下载"
|
||||
"downloading": "下载",
|
||||
"qr_code": "二维码"
|
||||
},
|
||||
"home": {
|
||||
"intro": "一键轻松发送 <i>完全加密的</i> 密信或者文件。只需创建一个密信然后分享链接。",
|
||||
|
@@ -32,6 +32,7 @@
|
||||
"copy-to-clipboard": "^3.3.3",
|
||||
"dompurify": "^2.4.1",
|
||||
"file-saver": "^2.0.5",
|
||||
"pretty-bytes": "^6.0.0"
|
||||
"pretty-bytes": "^6.0.0",
|
||||
"qrious": "^4.0.2"
|
||||
}
|
||||
}
|
||||
|
41
packages/frontend/src/lib/ui/Canvas.svelte
Normal file
41
packages/frontend/src/lib/ui/Canvas.svelte
Normal file
@@ -0,0 +1,41 @@
|
||||
<script lang="ts">
|
||||
import QR from 'qrious'
|
||||
import { t } from 'svelte-intl-precompile'
|
||||
|
||||
import { getCSSVariable } from '$lib/utils'
|
||||
|
||||
export let value: string
|
||||
|
||||
let canvas: HTMLCanvasElement
|
||||
|
||||
$: {
|
||||
new QR({
|
||||
value,
|
||||
level: 'Q',
|
||||
size: 800,
|
||||
background: getCSSVariable('--ui-bg-0'),
|
||||
foreground: getCSSVariable('--ui-text-0'),
|
||||
element: canvas,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<small>{$t('common.qr_code')}</small>
|
||||
<div>
|
||||
<canvas bind:this={canvas} />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
div {
|
||||
padding: 0.5rem;
|
||||
width: fit-content;
|
||||
border: 2px solid var(--ui-bg-1);
|
||||
background-color: var(--ui-bg-0);
|
||||
margin-top: 0.125rem;
|
||||
}
|
||||
|
||||
canvas {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
@@ -10,9 +10,12 @@
|
||||
|
||||
import Button from '$lib/ui/Button.svelte'
|
||||
import TextInput from '$lib/ui/TextInput.svelte'
|
||||
import Canvas from './Canvas.svelte'
|
||||
|
||||
export let result: NoteResult
|
||||
|
||||
$: url = `${window.location.origin}/note/${result.id}#${result.password}`
|
||||
|
||||
function reset() {
|
||||
window.location.reload()
|
||||
}
|
||||
@@ -22,11 +25,15 @@
|
||||
type="text"
|
||||
readonly
|
||||
label={$t('common.share_link')}
|
||||
value="{window.location.origin}/note/{result.id}#{result.password}"
|
||||
value={url}
|
||||
copy
|
||||
data-testid="share-link"
|
||||
/>
|
||||
<br />
|
||||
|
||||
<div>
|
||||
<Canvas value={url} />
|
||||
</div>
|
||||
|
||||
<p>
|
||||
{@html $t('home.new_note_notice')}
|
||||
</p>
|
||||
@@ -34,4 +41,9 @@
|
||||
<Button on:click={reset}>{$t('home.new_note')}</Button>
|
||||
|
||||
<style>
|
||||
div {
|
||||
width: min(12rem, 100%);
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
@@ -9,3 +9,8 @@ export function copy(value: string) {
|
||||
const msg = get(t)('common.copied_to_clipboard')
|
||||
notify.success(msg)
|
||||
}
|
||||
|
||||
export function getCSSVariable(variable: string): string {
|
||||
if (typeof window === 'undefined') return ''
|
||||
return window.getComputedStyle(window.document.body).getPropertyValue(variable)
|
||||
}
|
||||
|
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -32,6 +32,7 @@ importers:
|
||||
dotenv: ^16.0.3
|
||||
file-saver: ^2.0.5
|
||||
pretty-bytes: ^6.0.0
|
||||
qrious: ^4.0.2
|
||||
svelte: ^3.55.0
|
||||
svelte-check: ^2.10.3
|
||||
svelte-intl-precompile: ^0.10.1
|
||||
@@ -45,6 +46,7 @@ importers:
|
||||
dompurify: 2.4.1
|
||||
file-saver: 2.0.5
|
||||
pretty-bytes: 6.0.0
|
||||
qrious: 4.0.2
|
||||
devDependencies:
|
||||
'@lokalise/node-api': 9.3.0
|
||||
'@sveltejs/adapter-static': 1.0.0_@sveltejs+kit@1.0.1
|
||||
@@ -1690,6 +1692,10 @@ packages:
|
||||
engines: {node: ^14.13.1 || >=16.0.0}
|
||||
dev: false
|
||||
|
||||
/qrious/4.0.2:
|
||||
resolution: {integrity: sha512-xWPJIrK1zu5Ypn898fBp8RHkT/9ibquV2Kv24S/JY9VYEhMBMKur1gHVsOiNUh7PHP9uCgejjpZUHUIXXKoU/g==}
|
||||
dev: false
|
||||
|
||||
/queue-microtask/1.2.3:
|
||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||
dev: true
|
||||
|
@@ -3,12 +3,13 @@ import httpProxy from 'http-proxy'
|
||||
|
||||
const proxy = httpProxy.createProxyServer()
|
||||
proxy.on('error', function (err, req, res) {
|
||||
console.error(err)
|
||||
res.writeHead(500, { 'Content-Type': 'text/plain' })
|
||||
res.end('500 Internal Server Error')
|
||||
})
|
||||
|
||||
const server = http.createServer(function (req, res) {
|
||||
const target = req.url.startsWith('/api/') ? 'http://localhost:5000' : 'http://localhost:3000'
|
||||
const target = req.url.startsWith('/api/') ? 'http://127.0.0.1:5000' : 'http://localhost:3000'
|
||||
proxy.web(req, res, { target })
|
||||
})
|
||||
server.listen(1234)
|
||||
|
Reference in New Issue
Block a user