mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-04 08:30:39 +00:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
24f9aeb229 | |||
976413e11b | |||
2480d875b4 | |||
5dff12ea70 | |||
e332dc63e8 | |||
a18e9bcc88 | |||
4b43edf54a | |||
e3aa2dd5ff | |||
98a03c25e6 | |||
7f618e7e45 | |||
84a7be4549 | |||
b2bad5f64c | |||
41f55c0920 |
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@@ -14,6 +14,8 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v1
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
- name: Docker Labels
|
- name: Docker Labels
|
||||||
id: meta
|
id: meta
|
||||||
uses: crazy-max/ghaction-docker-meta@v2
|
uses: crazy-max/ghaction-docker-meta@v2
|
||||||
@@ -32,7 +34,7 @@ jobs:
|
|||||||
id: docker_build
|
id: docker_build
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
# platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
- name: Image digest
|
- name: Image digest
|
||||||
|
18
.github/workflows/test.yml
vendored
Normal file
18
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
text:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
docker-compose build
|
||||||
|
npm ci
|
||||||
|
- name: Test
|
||||||
|
run: npm run test:run
|
13
CHANGELOG.md
13
CHANGELOG.md
@@ -5,6 +5,19 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.1.1] - 2021-05-17
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Height on big displays
|
||||||
|
- About page
|
||||||
|
|
||||||
|
## [1.1.0] - 2021-05-16
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- Using hash `#` instead of path
|
||||||
|
|
||||||
## [1.0.11] - 2021-05-08
|
## [1.0.11] - 2021-05-08
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
<style>
|
<style>
|
||||||
textarea {
|
textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: calc(100vh - 30rem);
|
min-height: min(calc(100vh - 30rem), 30rem);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: 2px solid var(--ui-bg-1);
|
border: 2px solid var(--ui-bg-1);
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
|
@@ -50,7 +50,8 @@
|
|||||||
password: password,
|
password: password,
|
||||||
id: response.id,
|
id: response.id,
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
error = 'could not create note.'
|
error = 'could not create note.'
|
||||||
} finally {
|
} finally {
|
||||||
loading = false
|
loading = false
|
||||||
@@ -67,8 +68,9 @@
|
|||||||
type="text"
|
type="text"
|
||||||
readonly
|
readonly
|
||||||
label="share link"
|
label="share link"
|
||||||
value="{window.location.origin}/note/{result.id}/{result.password}"
|
value="{window.location.origin}/note/{result.id}#{result.password}"
|
||||||
copy
|
copy
|
||||||
|
data-testid="note-share-link"
|
||||||
/>
|
/>
|
||||||
<br />
|
<br />
|
||||||
<p>
|
<p>
|
||||||
@@ -84,11 +86,16 @@
|
|||||||
{:else}
|
{:else}
|
||||||
<form on:submit|preventDefault={submit}>
|
<form on:submit|preventDefault={submit}>
|
||||||
<fieldset disabled={loading}>
|
<fieldset disabled={loading}>
|
||||||
<TextArea label="note" bind:value={note.contents} placeholder="..." />
|
<TextArea
|
||||||
|
label="note"
|
||||||
|
bind:value={note.contents}
|
||||||
|
placeholder="..."
|
||||||
|
data-testid="input-note"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<Switch label="advanced" bind:value={advanced} />
|
<Switch label="advanced" bind:value={advanced} />
|
||||||
<Button type="submit">create</Button>
|
<Button type="submit" data-testid="button-create">create</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if error}
|
{#if error}
|
||||||
|
@@ -20,11 +20,13 @@
|
|||||||
<p>
|
<p>
|
||||||
<b>▶ how does it work?</b>
|
<b>▶ how does it work?</b>
|
||||||
<br />
|
<br />
|
||||||
each note has a 512bit generated <i>id</i> that is used to retrieve the note. data is stored in memory
|
each note has a 512bit generated <i>id</i> that is used to retrieve the note. the note is then encrypted
|
||||||
and never persisted to disk.
|
with aes in gcm mode on the client side and then sent to the server. data is stored in memory and
|
||||||
|
never persisted to disk. the server never sees the encryption key and cannot decrypt the contents
|
||||||
|
of the notes even if it tried to.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<b>▶ Features</b>
|
<b>▶ features</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li>server cannot decrypt contents due to client side encryption</li>
|
<li>server cannot decrypt contents due to client side encryption</li>
|
||||||
<li>view and time constraints</li>
|
<li>view and time constraints</li>
|
||||||
|
@@ -16,8 +16,8 @@
|
|||||||
import Button from '$lib/ui/Button.svelte'
|
import Button from '$lib/ui/Button.svelte'
|
||||||
|
|
||||||
export let id: string
|
export let id: string
|
||||||
export let password: string
|
|
||||||
|
|
||||||
|
let password: string
|
||||||
let note: NotePublic | null = null
|
let note: NotePublic | null = null
|
||||||
let exists = false
|
let exists = false
|
||||||
|
|
||||||
@@ -28,6 +28,8 @@
|
|||||||
try {
|
try {
|
||||||
loading = true
|
loading = true
|
||||||
error = null
|
error = null
|
||||||
|
password = window.location.hash.slice(1)
|
||||||
|
console.log(password)
|
||||||
await info(id)
|
await info(id)
|
||||||
exists = true
|
exists = true
|
||||||
} catch {
|
} catch {
|
||||||
@@ -55,10 +57,12 @@
|
|||||||
|
|
||||||
{#if !loading}
|
{#if !loading}
|
||||||
{#if !exists}
|
{#if !exists}
|
||||||
<p class="error-text">note was not found or was already deleted.</p>
|
<p class="error-text" data-testid="note-not-found">
|
||||||
|
note was not found or was already deleted.
|
||||||
|
</p>
|
||||||
{:else if note && !error}
|
{:else if note && !error}
|
||||||
<p class="error-text">you will not get the chance to see the note again.</p>
|
<p class="error-text">you will not get the chance to see the note again.</p>
|
||||||
<div class="note">
|
<div class="note" data-testid="note-result">
|
||||||
{note.contents}
|
{note.contents}
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
@@ -67,7 +71,7 @@
|
|||||||
<form on:submit|preventDefault={show}>
|
<form on:submit|preventDefault={show}>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<p>click below to show and delete the note if the counter has reached it's limit</p>
|
<p>click below to show and delete the note if the counter has reached it's limit</p>
|
||||||
<Button type="submit">show note</Button>
|
<Button type="submit" data-testid="button-show">show note</Button>
|
||||||
{#if error}
|
{#if error}
|
||||||
<br />
|
<br />
|
||||||
<p class="error-text">
|
<p class="error-text">
|
5
cypress.json
Normal file
5
cypress.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"fixturesFolder": false,
|
||||||
|
"pluginsFile": false,
|
||||||
|
"supportFile": false
|
||||||
|
}
|
2
cypress/.gitignore
vendored
Normal file
2
cypress/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
screenshots
|
||||||
|
videos
|
41
cypress/integration/main.spec.js
Normal file
41
cypress/integration/main.spec.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
function createNote(options = {}) {
|
||||||
|
Object.assign(options, {
|
||||||
|
text: `Revaluation battle selfish derive suicide revaluation society love superiority salvation spirit virtues revaluation. Aversion sexuality play burying mountains intentions battle reason strong burying war insofar inexpedient war. Fearful intentions selfish madness suicide.`,
|
||||||
|
})
|
||||||
|
cy.visit('http://localhost:5000')
|
||||||
|
const text = options.text
|
||||||
|
cy.get('[data-testid=input-note]').type(text)
|
||||||
|
cy.get('[data-testid=button-create]').click()
|
||||||
|
cy.wait(500)
|
||||||
|
return cy
|
||||||
|
.get('[data-testid=note-share-link]')
|
||||||
|
.invoke('val')
|
||||||
|
.then((link) => {
|
||||||
|
return [link, text]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Basics', () => {
|
||||||
|
it('Share note', () => {
|
||||||
|
createNote().then(([link, text]) => {
|
||||||
|
cy.visit(link)
|
||||||
|
cy.get('[data-testid=button-show]').click()
|
||||||
|
cy.wait(250)
|
||||||
|
cy.get('[data-testid=note-result]').should('have.text', text)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Check destroyed', () => {
|
||||||
|
createNote().then(([link, text]) => {
|
||||||
|
// Check the first time
|
||||||
|
cy.visit(link)
|
||||||
|
cy.get('[data-testid=button-show]').click()
|
||||||
|
cy.wait(250)
|
||||||
|
cy.get('[data-testid=note-result]').should('have.text', text)
|
||||||
|
|
||||||
|
// Should not exists anymore
|
||||||
|
cy.visit(link)
|
||||||
|
cy.get('[data-testid=note-not-found]').should('exist')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
@@ -15,4 +15,4 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- memcached
|
- memcached
|
||||||
ports:
|
ports:
|
||||||
- 80:5000
|
- 5000:5000
|
||||||
|
4572
package-lock.json
generated
4572
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,14 @@
|
|||||||
"dev:docker": "docker-compose up memcached",
|
"dev:docker": "docker-compose up memcached",
|
||||||
"dev:backend": "cargo watch -x 'run --bin cryptgeon'",
|
"dev:backend": "cargo watch -x 'run --bin cryptgeon'",
|
||||||
"dev:front": "npm --prefix client run dev",
|
"dev:front": "npm --prefix client run dev",
|
||||||
"dev": "run-p dev:*"
|
"dev": "run-p dev:*",
|
||||||
|
"test:server": "docker-compose up --build",
|
||||||
|
"test:cypress": "cypress run --headless",
|
||||||
|
"test:run": "start-server-and-test test:server http://localhost:5000 test:cypress"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npm-run-all": "^4.1.5"
|
"cypress": "^7.2.0",
|
||||||
|
"npm-run-all": "^4.1.5",
|
||||||
|
"start-server-and-test": "^1.12.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user