mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-04 00:20:39 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe5ce580ab | |||
0f882da5d1 | |||
ad6f136dd0 | |||
da527a0857 | |||
a95931ae77 | |||
d6c2236673 |
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"cSpell.words": ["ciphertext", "cryptgeon"],
|
||||
"i18n-ally.localesPaths": ["packages/frontend/locales"],
|
||||
"i18n-ally.enabledFrameworks": ["svelte"],
|
||||
"i18n-ally.keystyle": "nested"
|
||||
}
|
12
CHANGELOG.md
12
CHANGELOG.md
@@ -5,6 +5,18 @@ 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
|
||||
|
||||
- Svelte Kit now stable 🎉
|
||||
|
||||
## [2.0.6] - 2022-11-12
|
||||
|
||||
### Fixed
|
||||
|
16
cryptgeon.code-workspace
Normal file
16
cryptgeon.code-workspace
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
},
|
||||
{
|
||||
"path": "packages/backend"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"cSpell.words": ["ciphertext", "cryptgeon"],
|
||||
"i18n-ally.enabledFrameworks": ["svelte"],
|
||||
"i18n-ally.keystyle": "nested",
|
||||
"i18n-ally.localesPaths": ["packages/frontend/locales"]
|
||||
}
|
||||
}
|
@@ -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:*",
|
||||
@@ -10,8 +10,8 @@
|
||||
"test:prepare": "docker compose -f docker-compose.dev.yaml build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.25.1",
|
||||
"@types/node": "^16.11.57",
|
||||
"@playwright/test": "^1.29.1",
|
||||
"@types/node": "^16.18.10",
|
||||
"http-proxy": "^1.18.1",
|
||||
"npm-run-all": "^4.1.5"
|
||||
}
|
||||
|
2
packages/backend/Cargo.lock
generated
2
packages/backend/Cargo.lock
generated
@@ -425,7 +425,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cryptgeon"
|
||||
version = "2.0.5"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-web",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cryptgeon"
|
||||
version = "2.0.5"
|
||||
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> 密信或者文件。只需创建一个密信然后分享链接。",
|
||||
|
@@ -11,27 +11,28 @@
|
||||
},
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@lokalise/node-api": "^7.3.1",
|
||||
"@sveltejs/adapter-static": "^1.0.0-next.48",
|
||||
"@sveltejs/kit": "^1.0.0-next.544",
|
||||
"@lokalise/node-api": "^9.3.0",
|
||||
"@sveltejs/adapter-static": "^1.0.0",
|
||||
"@sveltejs/kit": "^1.0.1",
|
||||
"@types/dompurify": "^2.4.0",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@zerodevx/svelte-toast": "^0.7.2",
|
||||
"adm-zip": "^0.5.9",
|
||||
"adm-zip": "^0.5.10",
|
||||
"dotenv": "^16.0.3",
|
||||
"svelte": "^3.53.1",
|
||||
"svelte-check": "^2.9.2",
|
||||
"svelte": "^3.55.0",
|
||||
"svelte-check": "^2.10.3",
|
||||
"svelte-intl-precompile": "^0.10.1",
|
||||
"svelte-preprocess": "^4.10.7",
|
||||
"tslib": "^2.4.1",
|
||||
"typescript": "^4.8.4",
|
||||
"vite": "^3.2.3"
|
||||
"typescript": "^4.9.4",
|
||||
"vite": "^4.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/fira-mono": "^4.5.10",
|
||||
"copy-to-clipboard": "^3.3.2",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import dotenv from 'dotenv'
|
||||
import { LokaliseApi } from '@lokalise/node-api'
|
||||
import https from 'https'
|
||||
import AdmZip from 'adm-zip'
|
||||
import dotenv from 'dotenv'
|
||||
import https from 'https'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
|
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)
|
||||
}
|
||||
|
1079
pnpm-lock.yaml
generated
1079
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -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