mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2025-09-05 17:00:39 +00:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
42a8ab5d0f | |||
0934808a59 | |||
88ea828b66 | |||
41ed5c0e23 | |||
0a98481991 | |||
5d62c48a35 | |||
0ab39023b0 | |||
7b202962e8 | |||
7a045b3f34 | |||
cb80c8bfe4 | |||
74c3197e47 | |||
6ae927ce71 | |||
9d13e607f5 | |||
0db3ef4a1f | |||
03e9fb431f | |||
b84df2866b | |||
3d4fef7c23 | |||
9d787008a4 | |||
687f26bb40 | |||
371a869800 | |||
321c303a8a | |||
2f176d84e9 | |||
67d4f09bd7 | |||
c40f009523 | |||
026f8c69d7 |
@@ -1,15 +1,15 @@
|
|||||||
*
|
*
|
||||||
|
|
||||||
!/backend/src
|
!/packages/backend/src
|
||||||
!/backend/Cargo.lock
|
!/packages/backend/Cargo.lock
|
||||||
!/backend/Cargo.toml
|
!/packages/backend/Cargo.toml
|
||||||
|
|
||||||
!/frontend/locales
|
!/packages/frontend/locales
|
||||||
!/frontend/src
|
!/packages/frontend/src
|
||||||
!/frontend/static
|
!/packages/frontend/static
|
||||||
!/frontend/.npmrc
|
!/packages/frontend/.npmrc
|
||||||
!/frontend/package.json
|
!/packages/frontend/package.json
|
||||||
!/frontend/pnpm-lock.yaml
|
!/packages/frontend/pnpm-lock.yaml
|
||||||
!/frontend/svelte.config.js
|
!/packages/frontend/svelte.config.js
|
||||||
!/frontend/tsconfig.json
|
!/packages/frontend/tsconfig.json
|
||||||
!/frontend/vite.config.js
|
!/packages/frontend/vite.config.js
|
||||||
|
5
.github/workflows/docker.yml
vendored
5
.github/workflows/docker.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: ci
|
name: Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -31,11 +31,8 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
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
|
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
||||||
|
34
.github/workflows/test.yaml
vendored
34
.github/workflows/test.yaml
vendored
@@ -1,36 +1,36 @@
|
|||||||
|
name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
|
||||||
redis:
|
|
||||||
image: redis:7-alpine
|
|
||||||
ports:
|
|
||||||
- 6379:6379
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "16"
|
||||||
- uses: pnpm/action-setup@v2
|
|
||||||
|
- uses: docker/setup-qemu-action@v1
|
||||||
|
- uses: docker/setup-buildx-action@v1
|
||||||
with:
|
with:
|
||||||
version: 7
|
install: true
|
||||||
- uses: actions-rs/toolchain@v1
|
- name: Build docker image
|
||||||
with:
|
run: npm run test:prepare
|
||||||
toolchain: 1.61
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
npm install playwright
|
||||||
pnpm run test:prepare
|
npx playwright install --with-deps
|
||||||
- name: Install Playwright
|
|
||||||
run: npx playwright install --with-deps
|
|
||||||
- name: Run your tests
|
- name: Run your tests
|
||||||
run: pnpm run test:run
|
run: npm test
|
||||||
- name: Upload test results
|
- uses: actions/upload-artifact@v2
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
with:
|
||||||
name: test-results
|
name: test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
|
25
CHANGELOG.md
25
CHANGELOG.md
@@ -5,6 +5,29 @@ 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).
|
||||||
|
|
||||||
|
## [2.0.6] - 2022-11-12
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- #66 Set minimum a view.
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
- Updated dependencies.
|
||||||
|
|
||||||
|
## [2.0.5] - 2022-11-04
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Docker build pipeline.
|
||||||
|
|
||||||
|
## [2.0.4] - 2022-10-29
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `THEME_PAGE_TITLE`.
|
||||||
|
- `THEME_FAVICON`.
|
||||||
|
|
||||||
## [2.0.3] - 2022-10-07
|
## [2.0.3] - 2022-10-07
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -21,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Toasts for events.
|
- Toasts for events.
|
||||||
- E2E Tests.
|
- E2E Tests.
|
||||||
- Make backend more configurable
|
- Make backend more configurable.
|
||||||
|
|
||||||
## [2.0.1] - 2022-07-18
|
## [2.0.1] - 2022-07-18
|
||||||
|
|
||||||
|
@@ -9,13 +9,16 @@ RUN pnpm run build
|
|||||||
|
|
||||||
|
|
||||||
# BACKEND
|
# BACKEND
|
||||||
FROM rust:1.61-alpine as backend
|
FROM rust:1.64-alpine as backend
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
RUN apk add libc-dev openssl-dev alpine-sdk
|
RUN apk add libc-dev openssl-dev alpine-sdk
|
||||||
COPY ./packages/backend/Cargo.* ./
|
COPY ./packages/backend/Cargo.* ./
|
||||||
RUN cargo fetch
|
# https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html
|
||||||
|
RUN rustup update nightly
|
||||||
|
ENV CARGO_UNSTABLE_SPARSE_REGISTRY=true
|
||||||
|
RUN cargo +nightly fetch
|
||||||
COPY ./packages/backend ./
|
COPY ./packages/backend ./
|
||||||
RUN cargo build --release
|
RUN cargo +nightly build --release
|
||||||
|
|
||||||
|
|
||||||
# RUNNER
|
# RUNNER
|
||||||
|
35
README.md
35
README.md
@@ -24,9 +24,9 @@ _cryptgeon_ is a secure, open source sharing note or file service inspired by [_
|
|||||||
>
|
>
|
||||||
> Thanks to [Lokalise](https://lokalise.com/) for providing free access to their platform.
|
> Thanks to [Lokalise](https://lokalise.com/) for providing free access to their platform.
|
||||||
|
|
||||||
## Demo
|
## Live Service / Demo
|
||||||
|
|
||||||
Check out the demo and see for yourself [cryptgeon.org](https://cryptgeon.org)
|
Check out the live service / demo and see for yourself [cryptgeon.org](https://cryptgeon.org)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -50,16 +50,18 @@ of the notes even if it tried to.
|
|||||||
|
|
||||||
## Environment Variables
|
## Environment Variables
|
||||||
|
|
||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
| ---------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `REDIS` | `redis://redis/` | Redis URL to connect to. [According to format](https://docs.rs/redis/latest/redis/#connection-parameters) |
|
| `REDIS` | `redis://redis/` | Redis URL to connect to. [According to format](https://docs.rs/redis/latest/redis/#connection-parameters) |
|
||||||
| `SIZE_LIMIT` | `1 KiB` | Max size for body. Accepted values according to [byte-unit](https://docs.rs/byte-unit/). <br> `512 MiB` is the maximum allowed. <br> The frontend will show that number including the ~35% encoding overhead. |
|
| `SIZE_LIMIT` | `1 KiB` | Max size for body. Accepted values according to [byte-unit](https://docs.rs/byte-unit/). <br> `512 MiB` is the maximum allowed. <br> The frontend will show that number including the ~35% encoding overhead. |
|
||||||
| `MAX_VIEWS` | `100` | Maximal number of views. |
|
| `MAX_VIEWS` | `100` | Maximal number of views. |
|
||||||
| `MAX_EXPIRATION` | `360` | Maximal expiration in minutes. |
|
| `MAX_EXPIRATION` | `360` | Maximal expiration in minutes. |
|
||||||
| `ALLOW_ADVANCED` | `true` | Allow custom configuration. If set to `false` all notes will be one view only. |
|
| `ALLOW_ADVANCED` | `true` | Allow custom configuration. If set to `false` all notes will be one view only. |
|
||||||
| `THEME_IMAGE` | `""` | Custom image for replacing the logo. Must be publicly reachable |
|
| `VERBOSITY` | `warn` | Verbosity level for the backend. [Possible values](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) are: `error`, `warn`, `info`, `debug`, `trace` |
|
||||||
| `THEME_TEXT` | `""` | Custom text for replacing the description below the logo |
|
| `THEME_IMAGE` | `""` | Custom image for replacing the logo. Must be publicly reachable |
|
||||||
| `VERBOSITY` | `warn` | Verbosity level for the backend. [Possible values](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) are: `error`, `warn`, `info`, `debug`, `trace` |
|
| `THEME_TEXT` | `""` | Custom text for replacing the description below the logo |
|
||||||
|
| `THEME_PAGE_TITLE` | `""` | Custom text the page title |
|
||||||
|
| `THEME_FAVICON` | `""` | Custom url for the favicon. Must be publicly reachable |
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
@@ -77,12 +79,16 @@ version: '3.8'
|
|||||||
services:
|
services:
|
||||||
redis:
|
redis:
|
||||||
image: redis:7-alpine
|
image: redis:7-alpine
|
||||||
|
# Set a size limit. See link below on how to customise.
|
||||||
|
# https://redis.io/docs/manual/eviction/
|
||||||
|
command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: cupcakearmy/cryptgeon:latest
|
image: cupcakearmy/cryptgeon:latest
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
environment:
|
environment:
|
||||||
|
# Size limit for a single note.
|
||||||
SIZE_LIMIT: 4 MiB
|
SIZE_LIMIT: 4 MiB
|
||||||
ports:
|
ports:
|
||||||
- 80:5000
|
- 80:5000
|
||||||
@@ -104,6 +110,11 @@ See the [examples/scratch](https://github.com/cupcakearmy/cryptgeon/tree/main/ex
|
|||||||
|
|
||||||
There is a [guide](https://mariushosting.com/how-to-install-cryptgeon-on-your-synology-nas/) you can follow.
|
There is a [guide](https://mariushosting.com/how-to-install-cryptgeon-on-your-synology-nas/) you can follow.
|
||||||
|
|
||||||
|
### YouTube Guides
|
||||||
|
|
||||||
|
- English by [DB Tech](https://www.youtube.com/watch?v=S0jx7wpOfNM) [Previous Video](https://www.youtube.com/watch?v=JhpIatD06vE)
|
||||||
|
- German by [ApfelCast](https://www.youtube.com/watch?v=84ZMbE9AkHg)
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
**Requirements**
|
**Requirements**
|
||||||
|
@@ -10,11 +10,10 @@ services:
|
|||||||
- 6379:6379
|
- 6379:6379
|
||||||
|
|
||||||
app:
|
app:
|
||||||
# build: .
|
image: cupcakearmy/cryptgeon:test
|
||||||
image: cupcakearmy/cryptgeon
|
build: .
|
||||||
|
env_file: .dev.env
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
environment:
|
|
||||||
SIZE_LIMIT: 10 MiB
|
|
||||||
ports:
|
ports:
|
||||||
- 1234:5000
|
- 1234:5000
|
18
docker-compose.yaml
Normal file
18
docker-compose.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
# Set a size limit. See link below on how to customise.
|
||||||
|
# https://redis.io/docs/manual/eviction/
|
||||||
|
# command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru
|
||||||
|
|
||||||
|
app:
|
||||||
|
image: cupcakearmy/cryptgeon:latest
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
environment:
|
||||||
|
# Size limit for a single note.
|
||||||
|
SIZE_LIMIT: 4 MiB
|
||||||
|
ports:
|
||||||
|
- 80:5000
|
@@ -4,10 +4,10 @@
|
|||||||
"dev:packages": "pnpm --parallel run dev",
|
"dev:packages": "pnpm --parallel run dev",
|
||||||
"dev:proxy": "node proxy.mjs",
|
"dev:proxy": "node proxy.mjs",
|
||||||
"dev": "run-p dev:*",
|
"dev": "run-p dev:*",
|
||||||
"test:run": "playwright test --project chrome firefox safari",
|
"test": "playwright test --project chrome firefox safari",
|
||||||
"test:local": "playwright test --project local",
|
"test:local": "playwright test --project local",
|
||||||
"test:server": "pnpm --parallel run test:server",
|
"test:server": "docker compose -f docker-compose.dev.yaml up",
|
||||||
"test:prepare": "pnpm --parallel run test:prepare"
|
"test:prepare": "docker compose -f docker-compose.dev.yaml build"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@playwright/test": "^1.25.1",
|
"@playwright/test": "^1.25.1",
|
||||||
|
439
packages/backend/Cargo.lock
generated
439
packages/backend/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cryptgeon"
|
name = "cryptgeon"
|
||||||
version = "2.0.3"
|
version = "2.0.5"
|
||||||
authors = ["cupcakearmy <hi@nicco.io>"]
|
authors = ["cupcakearmy <hi@nicco.io>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
@@ -42,4 +42,12 @@ lazy_static! {
|
|||||||
.unwrap_or("".to_string())
|
.unwrap_or("".to_string())
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
pub static ref THEME_PAGE_TITLE: String = std::env::var("THEME_PAGE_TITLE")
|
||||||
|
.unwrap_or("".to_string())
|
||||||
|
.parse()
|
||||||
|
.unwrap();
|
||||||
|
pub static ref THEME_FAVICON: String = std::env::var("THEME_FAVICON")
|
||||||
|
.unwrap_or("".to_string())
|
||||||
|
.parse()
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
@@ -49,7 +49,7 @@ async fn create(note: web::Json<Note>) -> impl Responder {
|
|||||||
}
|
}
|
||||||
match n.views {
|
match n.views {
|
||||||
Some(v) => {
|
Some(v) => {
|
||||||
if v > *config::MAX_VIEWS {
|
if v > *config::MAX_VIEWS || v < 1 {
|
||||||
return bad_req;
|
return bad_req;
|
||||||
}
|
}
|
||||||
n.expiration = None; // views overrides expiration
|
n.expiration = None; // views overrides expiration
|
||||||
|
@@ -12,4 +12,6 @@ pub struct Status {
|
|||||||
// Theme
|
// Theme
|
||||||
pub theme_image: String,
|
pub theme_image: String,
|
||||||
pub theme_text: String,
|
pub theme_text: String,
|
||||||
|
pub theme_page_title: String,
|
||||||
|
pub theme_favicon: String,
|
||||||
}
|
}
|
||||||
|
@@ -13,6 +13,8 @@ async fn get_status() -> impl Responder {
|
|||||||
allow_advanced: *config::ALLOW_ADVANCED,
|
allow_advanced: *config::ALLOW_ADVANCED,
|
||||||
theme_image: config::THEME_IMAGE.to_string(),
|
theme_image: config::THEME_IMAGE.to_string(),
|
||||||
theme_text: config::THEME_TEXT.to_string(),
|
theme_text: config::THEME_TEXT.to_string(),
|
||||||
|
theme_page_title: config::THEME_PAGE_TITLE.to_string(),
|
||||||
|
theme_favicon: config::THEME_FAVICON.to_string()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
node_modules
|
|
||||||
/.svelte
|
|
||||||
/build
|
|
||||||
/functions
|
|
@@ -12,26 +12,26 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@lokalise/node-api": "^7.3.1",
|
"@lokalise/node-api": "^7.3.1",
|
||||||
"@sveltejs/adapter-static": "1.0.0-next.42",
|
"@sveltejs/adapter-static": "^1.0.0-next.48",
|
||||||
"@sveltejs/kit": "1.0.0-next.480",
|
"@sveltejs/kit": "^1.0.0-next.544",
|
||||||
"@types/dompurify": "^2.3.3",
|
"@types/dompurify": "^2.4.0",
|
||||||
"@types/file-saver": "^2.0.5",
|
"@types/file-saver": "^2.0.5",
|
||||||
"@zerodevx/svelte-toast": "^0.7.2",
|
"@zerodevx/svelte-toast": "^0.7.2",
|
||||||
"adm-zip": "^0.5.9",
|
"adm-zip": "^0.5.9",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.3",
|
||||||
"svelte": "^3.49.0",
|
"svelte": "^3.53.1",
|
||||||
"svelte-check": "^2.8.0",
|
"svelte-check": "^2.9.2",
|
||||||
"svelte-intl-precompile": "^0.10.1",
|
"svelte-intl-precompile": "^0.10.1",
|
||||||
"svelte-preprocess": "^4.10.7",
|
"svelte-preprocess": "^4.10.7",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.4.1",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.8.4",
|
||||||
"vite": "^3.0.2"
|
"vite": "^3.2.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/fira-mono": "^4.5.8",
|
"@fontsource/fira-mono": "^4.5.10",
|
||||||
"copy-to-clipboard": "^3.3.1",
|
"copy-to-clipboard": "^3.3.2",
|
||||||
"dompurify": "^2.3.10",
|
"dompurify": "^2.4.1",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"pretty-bytes": "^5.6.0"
|
"pretty-bytes": "^6.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -87,6 +87,8 @@ button {
|
|||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
background: inherit;
|
background: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
border: none;
|
||||||
|
padding-inline: initial;
|
||||||
}
|
}
|
||||||
|
|
||||||
*:disabled,
|
*:disabled,
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="/favicon.png" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
|
@@ -9,6 +9,8 @@ export type Status = {
|
|||||||
allow_advanced: boolean
|
allow_advanced: boolean
|
||||||
theme_image: string
|
theme_image: string
|
||||||
theme_text: string
|
theme_text: string
|
||||||
|
theme_favicon: string
|
||||||
|
theme_page_title: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const status = writable<null | Status>(null)
|
export const status = writable<null | Status>(null)
|
||||||
|
@@ -18,8 +18,9 @@
|
|||||||
bind:value={note.views}
|
bind:value={note.views}
|
||||||
disabled={timeExpiration}
|
disabled={timeExpiration}
|
||||||
max={$status?.max_views}
|
max={$status?.max_views}
|
||||||
|
min={1}
|
||||||
validate={(v) =>
|
validate={(v) =>
|
||||||
($status && v <= $status?.max_views) ||
|
($status && v <= $status?.max_views && v > 0) ||
|
||||||
$t('home.errors.max', { values: { n: $status?.max_views ?? 0 } })}
|
$t('home.errors.max', { values: { n: $status?.max_views ?? 0 } })}
|
||||||
/>
|
/>
|
||||||
<div class="middle-switch">
|
<div class="middle-switch">
|
||||||
|
@@ -53,7 +53,9 @@
|
|||||||
{:else}
|
{:else}
|
||||||
{#each files as file}
|
{#each files as file}
|
||||||
<div class="note file">
|
<div class="note file">
|
||||||
<b on:click={() => downloadFile(file)}>↓ {file.name}</b>
|
<button on:click={() => downloadFile(file)}>
|
||||||
|
<b>↓ {file.name}</b>
|
||||||
|
</button>
|
||||||
<small> {file.type} - {prettyBytes(file.size)}</small>
|
<small> {file.type} - {prettyBytes(file.size)}</small>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
@@ -40,19 +40,19 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div on:click={change}>
|
<button on:click={change}>
|
||||||
<Icon class="icon" icon="contrast" />
|
<Icon class="icon" icon="contrast" />
|
||||||
{$theme}
|
{$theme}
|
||||||
</div>
|
</button>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
div :global(.icon) {
|
button :global(.icon) {
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
div {
|
button {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
@@ -7,7 +7,9 @@
|
|||||||
<nav>
|
<nav>
|
||||||
<a href="/">/home</a>
|
<a href="/">/home</a>
|
||||||
<a href="/about">/about</a>
|
<a href="/about">/about</a>
|
||||||
<a href="https://github.com/cupcakearmy/cryptgeon" target="_blank" rel="noopener">/code</a>
|
<a href="https://github.com/cupcakearmy/cryptgeon" target="_blank" rel="noopener noreferrer">
|
||||||
|
code
|
||||||
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import '../app.css'
|
import '../app.css'
|
||||||
|
|
||||||
import { init as initStores } from '$lib/stores/status'
|
import { init as initStores, status } from '$lib/stores/status'
|
||||||
import Footer from '$lib/views/Footer.svelte'
|
import Footer from '$lib/views/Footer.svelte'
|
||||||
import Header from '$lib/views/Header.svelte'
|
import Header from '$lib/views/Header.svelte'
|
||||||
|
|
||||||
@@ -15,7 +15,8 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>cryptgeon</title>
|
<title>{$status?.theme_page_title || 'cryptgeon'}</title>
|
||||||
|
<link rel="icon" href={$status?.theme_favicon || '/favicon.png'} />
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
{#await waitLocale() then _}
|
{#await waitLocale() then _}
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
the backend is written in rust and the frontend is svelte and typescript.
|
the backend is written in rust and the frontend is svelte and typescript.
|
||||||
<br />
|
<br />
|
||||||
you are welcomed to check & audit the
|
you are welcomed to check & audit the
|
||||||
<a href="https://github.com/cupcakearmy/cryptgeon" target="_blank" rel="noopener">
|
<a href="https://github.com/cupcakearmy/cryptgeon" target="_blank" rel="noopener noreferrer">
|
||||||
source code
|
source code
|
||||||
</a>.
|
</a>.
|
||||||
</span>
|
</span>
|
||||||
@@ -47,9 +47,12 @@
|
|||||||
|
|
||||||
<AboutParagraph title="translations">
|
<AboutParagraph title="translations">
|
||||||
<span
|
<span
|
||||||
>translations are managed on <a href="https://lokalise.com/" target="_blank">Lokalise</a>,
|
>translations are managed on <a
|
||||||
which granted an open source license to use the paid version. If you are interested in helping
|
href="https://lokalise.com/"
|
||||||
translating don't hesitate to contact me!
|
target="_blank"
|
||||||
|
rel="noopener noreferrer">Lokalise</a
|
||||||
|
>, which granted an open source license to use the paid version. If you are interested in
|
||||||
|
helping translating don't hesitate to contact me!
|
||||||
</span>
|
</span>
|
||||||
</AboutParagraph>
|
</AboutParagraph>
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ const config: PlaywrightTestConfig = {
|
|||||||
testIgnore: ['file/too-big.spec.ts'],
|
testIgnore: ['file/too-big.spec.ts'],
|
||||||
|
|
||||||
webServer: {
|
webServer: {
|
||||||
command: 'pnpm run test:server',
|
command: 'docker compose -f docker-compose.dev.yaml up',
|
||||||
port: 1234,
|
port: 1234,
|
||||||
reuseExistingServer: true,
|
reuseExistingServer: true,
|
||||||
},
|
},
|
||||||
|
634
pnpm-lock.yaml
generated
634
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
PDF: 'test/assets/AES.pdf',
|
PDF: 'test/assets/AES.pdf',
|
||||||
Image: 'test/assets/alfred-kenneally-UIu4RmMxnHU-unsplash.jpg',
|
Image: 'test/assets/image.jpg',
|
||||||
Zip: 'test/assets/Pigeons.zip',
|
Zip: 'test/assets/Pigeons.zip',
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,6 @@ test('multiple', async ({ page }) => {
|
|||||||
const files = [Files.PDF, Files.Image]
|
const files = [Files.PDF, Files.Image]
|
||||||
const checksums = await Promise.all(files.map(getFileChecksum))
|
const checksums = await Promise.all(files.map(getFileChecksum))
|
||||||
const link = await createNote(page, { files, views: 2 })
|
const link = await createNote(page, { files, views: 2 })
|
||||||
await checkLinkForDownload(page, link, 'alfred-kenneally', checksums[1])
|
await checkLinkForDownload(page, link, 'image.jpg', checksums[1])
|
||||||
await checkLinkForDownload(page, link, 'AES.pdf', checksums[0])
|
await checkLinkForDownload(page, link, 'AES.pdf', checksums[0])
|
||||||
})
|
})
|
||||||
|
@@ -20,5 +20,5 @@ test('image content', async ({ page }) => {
|
|||||||
const files = [Files.Image]
|
const files = [Files.Image]
|
||||||
const checksum = await getFileChecksum(files[0])
|
const checksum = await getFileChecksum(files[0])
|
||||||
const link = await createNote(page, { files })
|
const link = await createNote(page, { files })
|
||||||
await checkLinkForDownload(page, link, 'alfred-kenneally', checksum)
|
await checkLinkForDownload(page, link, 'image.jpg', checksum)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user