Skip to content

Commit

Permalink
restructuring (#56)
Browse files Browse the repository at this point in the history
* restructuring

* pin svelte kit version & parallel execution

* update svelte kit

* correct test result assets

* add timeout

* correct locale path

* simplify crypto

* fix for #58

* add verbosity flag

* disable flaky test
  • Loading branch information
cupcakearmy authored Oct 7, 2022
1 parent 2d573ed commit cacb808
Show file tree
Hide file tree
Showing 84 changed files with 1,759 additions and 1,748 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
- name: Prepare
run: |
pnpm install
pnpm run ci:prepare
pnpm run test:prepare
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run your tests
run: pnpm run test
run: pnpm run test:run
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: playwright-report
path: playwright-report
name: test-results
path: test-results
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cSpell.words": ["ciphertext", "cryptgeon"],
"i18n-ally.localesPaths": ["frontend/locales"],
"i18n-ally.localesPaths": ["packages/frontend/locales"],
"i18n-ally.enabledFrameworks": ["svelte"],
"i18n-ally.keystyle": "nested"
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ 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.0.3] - 2022-10-07

### Added

- Flag for verbosity.

### Fixed

- #58 Fixed bug in the max views frontend form.

## [2.0.2] - 2022-07-20

### Added
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM node:16-alpine as client
WORKDIR /tmp
RUN npm install -g pnpm@7
COPY ./frontend ./
COPY ./packages/frontend ./
RUN pnpm install
RUN pnpm exec svelte-kit sync
RUN pnpm run build
Expand All @@ -12,9 +12,9 @@ RUN pnpm run build
FROM rust:1.61-alpine as backend
WORKDIR /tmp
RUN apk add libc-dev openssl-dev alpine-sdk
COPY ./backend/Cargo.* ./
COPY ./packages/backend/Cargo.* ./
RUN cargo fetch
COPY ./backend ./
COPY ./packages/backend ./
RUN cargo build --release


Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ of the notes even if it tried to.
| `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 |
| `THEME_TEXT` | `""` | Custom text for replacing the description below the logo |
| `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` |

## Deployment

Expand Down Expand Up @@ -146,9 +147,9 @@ You can see the app under [localhost:1234](http://localhost:1234).
Tests are end to end tests written with Playwright.

```sh
pnpm run ci:prepare
pnpm run test:prepare
docker compose up redis -d
pnpm run ci:server
pnpm run test:server
# In another terminal.
# Use the test or test:local script. The local version only runs in one browser for quicker development.
Expand Down
24 changes: 12 additions & 12 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ _加密鸽_ 是一个受 [_PrivNote_](https://privnote.com)项目启发的安全

## 环境变量

| 变量名称 | 默认值 | 描述 |
| 变量名称 | 默认值 | 描述 |
| ----------------- | ---------------- | --------------------------------------------------------------------------------- |
| `REDIS` | `redis://redis/` | Redis 连接 URL。 |
| `SIZE_LIMIT` | `1 KiB` | 最大请求体(body)限制。有关支持的数值请查看 [字节单位](https://docs.rs/byte-unit/) |
| `MAX_VIEWS` | `100` | 密信最多查看次数限制 |
| ` MAX_EXPIRATION` | `360` | 密信最长过期时间限制(分钟) |
| `ALLOW_ADVANCED` | `true` | 是否允许自定义设置,该项如果设为`false`,则不会显示自定义设置模块 |
| `THEME_IMAGE` | `""` | 自定义Logo图片,你在这里填写的的图片链接必须是可以公开访问的。 |
| `THEME_TEXT` | `""` | 自定义在Logo下方的文本。 |
| `REDIS` | `redis://redis/` | Redis 连接 URL。 |
| `SIZE_LIMIT` | `1 KiB` | 最大请求体(body)限制。有关支持的数值请查看 [字节单位](https://docs.rs/byte-unit/) |
| `MAX_VIEWS` | `100` | 密信最多查看次数限制 |
| ` MAX_EXPIRATION` | `360` | 密信最长过期时间限制(分钟) |
| `ALLOW_ADVANCED` | `true` | 是否允许自定义设置,该项如果设为`false`,则不会显示自定义设置模块 |
| `THEME_IMAGE` | `""` | 自定义 Logo 图片,你在这里填写的的图片链接必须是可以公开访问的。 |
| `THEME_TEXT` | `""` | 自定义在 Logo 下方的文本。 |

## 部署

Expand Down Expand Up @@ -148,7 +148,7 @@ cargo install cargo-watch

确保你的 Docker 正在运行

> 如果你用的是 `macOS` 的话你可能需要关闭AirPlay接收功能因为该功能需要占用5000端口...)
> 如果你用的是 `macOS` 的话你可能需要关闭 AirPlay 接收功能因为该功能需要占用 5000 端口...)
> https://developer.apple.com/forums/thread/682332

```bash
Expand All @@ -165,12 +165,12 @@ pnpm run dev

## 测试

这些测试是用Playwright实现的一些端到端测试用例
这些测试是用 Playwright 实现的一些端到端测试用例

```sh
pnpm run ci:prepare
pnpm run test:prepare
docker compose up redis -d
pnpm run ci:server
pnpm run test:server
# 在另一个终端中:
# 使用test或者test:local script。为了更快的开发,本地版本只会在一个浏览器中运行。
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ services:
- 6379:6379

app:
build: .
# build: .
image: cupcakearmy/cryptgeon
depends_on:
- redis
environment:
SIZE_LIMIT: 128 MiB
SIZE_LIMIT: 10 MiB
ports:
- 1234:5000
Loading

0 comments on commit cacb808

Please sign in to comment.