Compare commits
359 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdd26d87be | ||
|
|
2ade0dda42 | ||
|
|
a87ae5cf65 | ||
|
|
fe7b8b53a6 | ||
|
|
b929f3efdb | ||
|
|
f847fc076f | ||
|
|
60d0a701ce | ||
|
|
0dedaf6824 | ||
|
|
ab231b3fed | ||
|
|
e7f28cca36 | ||
|
|
505e8aac4b | ||
|
|
746e2a6052 | ||
|
|
dc03d5d83d | ||
|
|
b770ab178d | ||
|
|
fd7e022e88 | ||
|
|
ac5df6826b | ||
|
|
91908859bc | ||
|
|
9c8822f857 | ||
|
|
9709da7fb6 | ||
|
|
1852f10131 | ||
|
|
77d7b43e21 | ||
|
|
7410b539a0 | ||
|
|
0403d71502 | ||
|
|
2af1d93a7d | ||
|
|
76281ad761 | ||
|
|
d1ec9b4916 | ||
|
|
448e7460a9 | ||
|
|
ee0cbabffc | ||
|
|
d6a5af890a | ||
|
|
dc313441e5 | ||
|
|
c75320f4f4 | ||
|
|
c788f78416 | ||
|
|
49cf954d4a | ||
|
|
014e3db54f | ||
|
|
6d9c245c81 | ||
|
|
7fa9b79f31 | ||
|
|
c7f3d13b7f | ||
|
|
46f08a89d2 | ||
|
|
0dcfedb4dc | ||
|
|
918bf85a2d | ||
|
|
99db5f7190 | ||
|
|
18eff791b2 | ||
|
|
624dcacac5 | ||
|
|
878d5fd27c | ||
|
|
4b893ce0e8 | ||
|
|
472524f836 | ||
|
|
dbf8b23b15 | ||
|
|
79a5dd53ae | ||
|
|
8a5b20685c | ||
|
|
5a9c972de0 | ||
|
|
fc0e67122d | ||
|
|
eb642f66ca | ||
|
|
8cac15f7dd | ||
|
|
5011e2b7c1 | ||
|
|
b0008143b1 | ||
|
|
a3c3ab5a72 | ||
|
|
3a16269215 | ||
|
|
151145b0c3 | ||
|
|
9c794e9d4b | ||
|
|
01f697d279 | ||
|
|
6cdc37333b | ||
|
|
ae32915565 | ||
|
|
f49457dc5b | ||
|
|
d9e2e247ea | ||
|
|
c6f2f2f150 | ||
|
|
56b9c66cb8 | ||
|
|
5d8a0d0e1f | ||
|
|
f4cb9beda5 | ||
|
|
b66fc3c06d | ||
|
|
ab2e1a9236 | ||
|
|
ab77b400a1 | ||
|
|
eb7ab63563 | ||
|
|
4cf7d01622 | ||
|
|
a876078a9c | ||
|
|
495f2ae3c6 | ||
|
|
4e6d11baf0 | ||
|
|
a951b982b3 | ||
|
|
a33be66504 | ||
|
|
f41b9d5887 | ||
|
|
3c608463e6 | ||
|
|
eeffbe124a | ||
|
|
d7f2d54faa | ||
|
|
7db4b03634 | ||
|
|
77760a681a | ||
|
|
f9c1447ceb | ||
|
|
fb749c1902 | ||
|
|
240c44aa07 | ||
|
|
92cd8642c8 | ||
|
|
89d90cf919 | ||
|
|
920c6b6d8b | ||
|
|
1dd4df3a1c | ||
|
|
c7d44cc253 | ||
|
|
5082ab1893 | ||
|
|
e8b2425222 | ||
|
|
09d12cefd8 | ||
|
|
5f1166965d | ||
|
|
0dbab182e9 | ||
|
|
512f3f99fd | ||
|
|
6fb4fad705 | ||
|
|
fa92529e9b | ||
|
|
d6c6051a6c | ||
|
|
ce063bd3ac | ||
|
|
4468894dfb | ||
|
|
8b00b919ad | ||
|
|
64f4a6dfac | ||
|
|
6faa5153b6 | ||
|
|
a771b1e9b0 | ||
|
|
7750f9c54d | ||
|
|
b2d24ee67b | ||
|
|
589a2a5123 | ||
|
|
184d3d357d | ||
|
|
50b3d85270 | ||
|
|
09fdd34ba3 | ||
|
|
bba10261c5 | ||
|
|
46bfe54097 | ||
|
|
503e7a307e | ||
|
|
821b0a6faf | ||
|
|
d60fdff179 | ||
|
|
fdd841e82a | ||
|
|
2d6f0a116a | ||
|
|
bd13fe4ef4 | ||
|
|
6e1b208464 | ||
|
|
76433a409e | ||
|
|
9b4fa679c2 | ||
|
|
c2ae95c4cc | ||
|
|
b2b7f60fd5 | ||
|
|
a465888b31 | ||
|
|
d368bdc84c | ||
|
|
cdc1150505 | ||
|
|
32d525c53c | ||
|
|
a89b40c607 | ||
|
|
b6bd9150d9 | ||
|
|
96e3e3bc86 | ||
|
|
41377f41bb | ||
|
|
fb744f81e2 | ||
|
|
750c3bcbcd | ||
|
|
d4015d7284 | ||
|
|
a9bf3fda73 | ||
|
|
7f467a4814 | ||
|
|
9f10b5e983 | ||
|
|
5291270e6a | ||
|
|
56bba381d8 | ||
|
|
2ff276b162 | ||
|
|
d77191ce0f | ||
|
|
f99803aef4 | ||
|
|
e09fa17013 | ||
|
|
c7e69aa8a5 | ||
|
|
9548068283 | ||
|
|
09958c78f3 | ||
|
|
aced098982 | ||
|
|
7862a34760 | ||
|
|
1384d28cac | ||
|
|
24b7338153 | ||
|
|
30d254eaef | ||
|
|
bb8a936ade | ||
|
|
61044fd30b | ||
|
|
22a4546d0f | ||
|
|
07450416ed | ||
|
|
0d6db0d2a1 | ||
|
|
ab30b3407b | ||
|
|
7a4c735803 | ||
|
|
654c764019 | ||
|
|
7101139250 | ||
|
|
793614841a | ||
|
|
94f2ac5b2a | ||
|
|
d4d39eecaa | ||
|
|
8af01c859c | ||
|
|
3af92d03e8 | ||
|
|
f17d891302 | ||
|
|
51623436b0 | ||
|
|
1b7c7eef8f | ||
|
|
15e4c7e522 | ||
|
|
120ab132a9 | ||
|
|
0b52e8faa8 | ||
|
|
60eaaf390a | ||
|
|
9101badb1c | ||
|
|
7082111b34 | ||
|
|
a156f2681e | ||
|
|
7cb823c957 | ||
|
|
817f612224 | ||
|
|
1cbaf9d6bc | ||
|
|
d353f9837f | ||
|
|
14beef72fc | ||
|
|
91a33fe7f6 | ||
|
|
7ad7a0ff41 | ||
|
|
d646469f71 | ||
|
|
4f616ffff1 | ||
|
|
64400fba61 | ||
|
|
fc15e8c63d | ||
|
|
cbba1e5317 | ||
|
|
75b997dcc4 | ||
|
|
853063c59b | ||
|
|
5c65edb8fa | ||
|
|
7707cc116f | ||
|
|
737fe749de | ||
|
|
b9c6f17e3f | ||
|
|
af6a340003 | ||
|
|
8ba3bee944 | ||
|
|
153c3566b6 | ||
|
|
97a4753f4f | ||
|
|
74c3899b55 | ||
|
|
273ac6d1a8 | ||
|
|
5edbb39a63 | ||
|
|
0c974c4113 | ||
|
|
46657a525d | ||
|
|
b36aa6f917 | ||
|
|
cddb0ebef9 | ||
|
|
788c4e3531 | ||
|
|
47f9ad8274 | ||
|
|
855beb7fa9 | ||
|
|
f57816b1b0 | ||
|
|
ff08fefc30 | ||
|
|
f792ab9055 | ||
|
|
63af103a4e | ||
|
|
0a36d44cec | ||
|
|
a1f4e1de84 | ||
|
|
05b20d47db | ||
|
|
6b746f13d1 | ||
|
|
e838d5bcd2 | ||
|
|
0dcc21260e | ||
|
|
3c30ad145c | ||
|
|
06b0a8e873 | ||
|
|
b7de2ccadd | ||
|
|
b52c5cfca1 | ||
|
|
fe910c37cf | ||
|
|
337ef330eb | ||
|
|
ffa47177aa | ||
|
|
46a76853c3 | ||
|
|
2cd7dfb2b3 | ||
|
|
fee2808bca | ||
|
|
49e5eb186a | ||
|
|
dee2865466 | ||
|
|
eb340b2615 | ||
|
|
e714549a95 | ||
|
|
a1367bcd3d | ||
|
|
642351dafd | ||
|
|
90b9b5adba | ||
|
|
5bf4bbe45f | ||
|
|
036f928fa3 | ||
|
|
94e7b31fb6 | ||
|
|
be4742382d | ||
|
|
70d2f1a055 | ||
|
|
877fe50049 | ||
|
|
7d505705ee | ||
|
|
38f81a03b5 | ||
|
|
d549d23819 | ||
|
|
934675e0f0 | ||
|
|
2be397aa38 | ||
|
|
a0a422ed45 | ||
|
|
fcce10c695 | ||
|
|
30eb14702f | ||
|
|
3679fcc874 | ||
|
|
d085b4e3c2 | ||
|
|
dc8fcdf214 | ||
|
|
8bab23b65b | ||
|
|
f64022e411 | ||
|
|
2d37302cf9 | ||
|
|
1a1856257d | ||
|
|
24f570b64f | ||
|
|
6322177b71 | ||
|
|
d2390d1cb3 | ||
|
|
6fe6f6b708 | ||
|
|
a656f4fec3 | ||
|
|
399c32da7d | ||
|
|
62167836dc | ||
|
|
caef3897a0 | ||
|
|
5ef6810e3f | ||
|
|
ae2079f583 | ||
|
|
aa65382a0f | ||
|
|
18c61a2bfc | ||
|
|
7cc1a8a58a | ||
|
|
cf9feac702 | ||
|
|
a963cd0209 | ||
|
|
6a5408f9b8 | ||
|
|
9aad62d1e4 | ||
|
|
867eab40f8 | ||
|
|
eb5c7efc4c | ||
|
|
857abc16e7 | ||
|
|
28b9866c42 | ||
|
|
a27deb0a41 | ||
|
|
8e026de20b | ||
|
|
718ecc2372 | ||
|
|
56d46722f4 | ||
|
|
b6463cd715 | ||
|
|
bd3ae0cbfe | ||
|
|
83c3aa894f | ||
|
|
1b88d26fea | ||
|
|
588287fdb4 | ||
|
|
688e544b07 | ||
|
|
3e3f812e83 | ||
|
|
b551c7abe4 | ||
|
|
6d1e7a4c05 | ||
|
|
3341a4bc8e | ||
|
|
1c84980d36 | ||
|
|
833b25881d | ||
|
|
9dbf58903c | ||
|
|
ad007f0d91 | ||
|
|
4b06973a52 | ||
|
|
159a67f15d | ||
|
|
7c03b9953b | ||
|
|
f90987de8d | ||
|
|
70e4ff7820 | ||
|
|
a99356f54b | ||
|
|
c5bc9534cc | ||
|
|
a40733424f | ||
|
|
a937efc60e | ||
|
|
6adb0e8415 | ||
|
|
ff9ffb2f12 | ||
|
|
9be4f472ae | ||
|
|
8581d74b08 | ||
|
|
dafe9bd6b6 | ||
|
|
3ae5772360 | ||
|
|
4628dbccfb | ||
|
|
572b1d4c14 | ||
|
|
bdb70e9859 | ||
|
|
38bda17271 | ||
|
|
455e1d2e5b | ||
|
|
89cd724bab | ||
|
|
b9109b4d0e | ||
|
|
945958f552 | ||
|
|
78eb0d5c06 | ||
|
|
bc6eae711e | ||
|
|
f0a4bf6164 | ||
|
|
fc3b5e3ac3 | ||
|
|
f7235ac847 | ||
|
|
231f4ddb7f | ||
|
|
3cad3994cb | ||
|
|
8c97cc8686 | ||
|
|
7ae976ee5d | ||
|
|
e91b53eb32 | ||
|
|
90311536a7 | ||
|
|
e951b7f2f9 | ||
|
|
e0f94b62cf | ||
|
|
8cb701ec85 | ||
|
|
9afd11e3b8 | ||
|
|
a1d495f2db | ||
|
|
652fa93910 | ||
|
|
ef414855f0 | ||
|
|
76cf35cdf0 | ||
|
|
9d7aa05032 | ||
|
|
62a22c697d | ||
|
|
be497a5aa7 | ||
|
|
fc3e16bc63 | ||
|
|
df35912461 | ||
|
|
0ddc66a854 | ||
|
|
716d557d66 | ||
|
|
f9edcb9d47 | ||
|
|
d4623c5bc9 | ||
|
|
02ba4a3330 | ||
|
|
a72d4eaf78 | ||
|
|
4d3abb2dc0 | ||
|
|
ad6a8d1f7a | ||
|
|
a5c8c2ac97 | ||
|
|
1237004cb1 | ||
|
|
c2bcd17df7 | ||
|
|
bb49cbdd50 | ||
|
|
6ad770a824 | ||
|
|
593eeb3ac3 | ||
|
|
6a7be3ef84 |
7
.github/workflows/build.yml
vendored
@@ -66,7 +66,7 @@ jobs:
|
||||
- name: Set up Go environment
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.23' # 选择 Go 版本
|
||||
go-version: '1.22' # 选择 Go 版本
|
||||
|
||||
- name: Set up npm
|
||||
uses: actions/setup-node@v2
|
||||
@@ -115,12 +115,12 @@ jobs:
|
||||
zip -r ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}} ./release
|
||||
else
|
||||
if [ "${{ matrix.job.platform }}" = "arm64" ]; then
|
||||
wget https://musl.ljw.red/aarch64-linux-musl-cross.tgz
|
||||
wget https://musl.cc/aarch64-linux-musl-cross.tgz
|
||||
tar -xf aarch64-linux-musl-cross.tgz
|
||||
export PATH=$PATH:$PWD/aarch64-linux-musl-cross/bin
|
||||
GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=aarch64-linux-musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
||||
elif [ "${{ matrix.job.platform }}" = "armv7l" ]; then
|
||||
wget https://musl.ljw.red/armv7l-linux-musleabihf-cross.tgz
|
||||
wget https://musl.cc/armv7l-linux-musleabihf-cross.tgz
|
||||
tar -xf armv7l-linux-musleabihf-cross.tgz
|
||||
export PATH=$PATH:$PWD/armv7l-linux-musleabihf-cross/bin
|
||||
GOOS=${{ matrix.job.goos }} GOARCH=arm GOARM=7 CC=armv7l-linux-musleabihf-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
||||
@@ -147,7 +147,6 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Generate Changelog
|
||||
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
|
||||
run: npx changelogithub # or changelogithub@0.12 if ensure the stable result
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
|
||||
6
.github/workflows/build_test.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
||||
- name: Set up Go environment
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.23' # 选择 Go 版本
|
||||
go-version: '1.22' # 选择 Go 版本
|
||||
|
||||
- name: Set up npm
|
||||
uses: actions/setup-node@v2
|
||||
@@ -101,12 +101,12 @@ jobs:
|
||||
zip -r ${{ matrix.job.goos}}-${{ matrix.job.platform }}.${{matrix.job.file_ext}} ./release
|
||||
else
|
||||
if [ "${{ matrix.job.platform }}" = "arm64" ]; then
|
||||
wget https://musl.ljw.red/aarch64-linux-musl-cross.tgz
|
||||
wget https://musl.cc/aarch64-linux-musl-cross.tgz
|
||||
tar -xf aarch64-linux-musl-cross.tgz
|
||||
export PATH=$PATH:$PWD/aarch64-linux-musl-cross/bin
|
||||
GOOS=${{ matrix.job.goos }} GOARCH=${{ matrix.job.platform }} CC=aarch64-linux-musl-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
||||
elif [ "${{ matrix.job.platform }}" = "armv7l" ]; then
|
||||
wget https://musl.ljw.red/armv7l-linux-musleabihf-cross.tgz
|
||||
wget https://musl.cc/armv7l-linux-musleabihf-cross.tgz
|
||||
tar -xf armv7l-linux-musleabihf-cross.tgz
|
||||
export PATH=$PATH:$PWD/armv7l-linux-musleabihf-cross/bin
|
||||
GOOS=${{ matrix.job.goos }} GOARCH=arm GOARM=7 CC=armv7l-linux-musleabihf-gcc CGO_LDFLAGS="-static" CGO_ENABLED=1 go build -ldflags "-s -w" -o ./release/apimain ./cmd/apimain.go
|
||||
|
||||
2
.gitignore
vendored
@@ -5,4 +5,4 @@ runtime/*
|
||||
go.sum
|
||||
resources/admin
|
||||
release
|
||||
data/rustdeskapi.db
|
||||
data
|
||||
@@ -42,11 +42,11 @@ RUN if [ "$COUNTRY" = "CN" ] ; then \
|
||||
fi && \
|
||||
apk update && apk add --no-cache git
|
||||
|
||||
ARG FRONTEND_GIT_REPO=https://github.com/lejianwen/rustdesk-api-web.git
|
||||
ARG FREONTEND_GIT_REPO=https://github.com/lejianwen/rustdesk-api-web.git
|
||||
ARG FRONTEND_GIT_BRANCH=master
|
||||
# Clone the frontend repository
|
||||
|
||||
RUN git clone -b $FRONTEND_GIT_BRANCH $FRONTEND_GIT_REPO .
|
||||
RUN git clone -b $FRONTEND_GIT_BRANCH $FREONTEND_GIT_REPO .
|
||||
|
||||
# Install required tools without caching index to minimize image size
|
||||
RUN if [ "$COUNTRY" = "CN" ] ; then \
|
||||
@@ -91,4 +91,4 @@ VOLUME /app/data
|
||||
EXPOSE 21114
|
||||
|
||||
# Define the command to run the application
|
||||
CMD ["./apimain"]
|
||||
CMD ["./apimain"]
|
||||
31
README.md
@@ -2,8 +2,7 @@
|
||||
|
||||
[English Doc](README_EN.md)
|
||||
|
||||
本项目使用 Go 实现了 RustDesk 的 API,并包含了 Web Admin 和 Web 客户端。
|
||||
|
||||
本项目使用 Go 实现了 RustDesk 的 API,并包含了 Web Admin 和 Web 客户端。RustDesk 是一个远程桌面软件,提供了自托管的解决方案。
|
||||
|
||||
<div align=center>
|
||||
<img src="https://img.shields.io/badge/golang-1.22-blue"/>
|
||||
@@ -14,14 +13,6 @@
|
||||
<img src="https://github.com/lejianwen/rustdesk-api/actions/workflows/build.yml/badge.svg"/>
|
||||
</div>
|
||||
|
||||
## 搭配[lejianwen/rustdesk-server]使用更佳。
|
||||
> [lejianwen/rustdesk-server]fork自RustDesk Server官方仓库
|
||||
> 1. 解决了使用API链接超时问题
|
||||
> 2. 可以强制登录后才能发起链接
|
||||
> 3. 支持客户端websocket
|
||||
|
||||
|
||||
|
||||
# 特性
|
||||
|
||||
- PC端API
|
||||
@@ -54,6 +45,7 @@
|
||||
- 自动获取ID服务器和KEY
|
||||
- 自动获取地址簿
|
||||
- 游客通过临时分享链接直接远程到设备
|
||||
- v2 Preview
|
||||
- CLI
|
||||
- 重置管理员密码
|
||||
|
||||
@@ -102,8 +94,8 @@
|
||||
- 对于`OIDC`, `Issuer`是必须的。`Scopes`是可选的,默认为 `openid,profile,email`. 确保可以获取 `sub`,`email` 和`preferred_username`
|
||||
- `github oauth app`在`Settings`->`Developer settings`->`OAuth Apps`->`New OAuth App`
|
||||
中创建,地址 [https://github.com/settings/developers](https://github.com/settings/developers)
|
||||
- `Authorization callback URL`填写`http://<your server[:port]>/api/oidc/callback`
|
||||
,比如`http://127.0.0.1:21114/api/oidc/callback`
|
||||
- `Authorization callback URL`填写`http://<your server[:port]>/api/oauth/callback`
|
||||
,比如`http://127.0.0.1:21114/api/oauth/callback`
|
||||
7. 登录日志
|
||||
8. 链接日志
|
||||
9. 文件传输日志
|
||||
@@ -126,6 +118,9 @@
|
||||
2. 如果没登录后台,点击右上角登录即可,api server已经自动配置好了
|
||||
3. 登录后,会自动同步ID服务器和KEY
|
||||
4. 登录后,会将地址簿自动保存到web client中,方便使用
|
||||
5. 现已支持`v2 Preview`,访问路径是`/webclient2`
|
||||

|
||||
6. `v2 preview` 部署,参考[WIKI](https://github.com/lejianwen/rustdesk-api/wiki)
|
||||
|
||||
|
||||
### 自动化文档: 使用 Swag 生成 API 文档,方便开发者理解和使用 API。
|
||||
@@ -168,9 +163,6 @@
|
||||
| RUSTDESK_API_APP_SHOW_SWAGGER | 是否可见swagger文档;`1`显示,`0`不显示,默认`0`不显示 | `1` |
|
||||
| RUSTDESK_API_APP_TOKEN_EXPIRE | token有效时长 | `168h` |
|
||||
| RUSTDESK_API_APP_DISABLE_PWD_LOGIN | 是否禁用密码登录; `true`, `false` 默认`false` | `false` |
|
||||
| RUSTDESK_API_APP_REGISTER_STATUS | 注册用户默认状态; 1 启用,2 禁用, 默认 1 | `1` |
|
||||
| RUSTDESK_API_APP_CAPTCHA_THRESHOLD | 验证码触发次数; -1 不启用, 0 一直启用, >0 登录错误次数后启用 ;默认 `3` | `3` |
|
||||
| RUSTDESK_API_APP_BAN_THRESHOLD | 封禁IP触发次数; 0 不启用, >0 登录错误次数后封禁IP; 默认 `0` | `0` |
|
||||
| -----ADMIN配置----- | ---------- | ---------- |
|
||||
| RUSTDESK_API_ADMIN_TITLE | 后台标题 | `RustDesk Api Admin` |
|
||||
| RUSTDESK_API_ADMIN_HELLO | 后台欢迎语,可以使用`html` | |
|
||||
@@ -187,7 +179,6 @@
|
||||
| RUSTDESK_API_MYSQL_PASSWORD | mysql密码 | 111111 |
|
||||
| RUSTDESK_API_MYSQL_ADDR | mysql地址 | 192.168.1.66:3306 |
|
||||
| RUSTDESK_API_MYSQL_DBNAME | mysql数据库名 | rustdesk |
|
||||
| RUSTDESK_API_MYSQL_TLS | 是否启用TLS, 可选值: `true`, `false`, `skip-verify`, `custom` | `false` |
|
||||
| -----RUSTDESK配置----- | ---------- | ---------- |
|
||||
| RUSTDESK_API_RUSTDESK_ID_SERVER | Rustdesk的id服务器地址 | 192.168.1.66:21116 |
|
||||
| RUSTDESK_API_RUSTDESK_RELAY_SERVER | Rustdesk的relay服务器地址 | 192.168.1.66:21117 |
|
||||
@@ -261,12 +252,6 @@
|
||||
#或者使用generate_api.go生成api并运行
|
||||
go generate generate_api.go
|
||||
```
|
||||
> 注意:使用 `go run` 或编译后的二进制时,当前目录下必须存在 `conf` 和 `resources`
|
||||
> 目录。如果在其他目录运行,可通过 `-c` 和环境变量
|
||||
> `RUSTDESK_API_GIN_RESOURCES_PATH` 指定绝对路径,例如:
|
||||
> ```bash
|
||||
> RUSTDESK_API_GIN_RESOURCES_PATH=/opt/rustdesk-api/resources ./apimain -c /opt/rustdesk-api/conf/config.yaml
|
||||
> ```
|
||||
5. 编译,如果想自己编译,先cd到项目根目录,然后windows下直接运行`build.bat`,linux下运行`build.sh`,编译后会在`release`
|
||||
目录下生成对应的可执行文件。直接运行编译后的可执行文件即可。
|
||||
|
||||
@@ -331,5 +316,3 @@
|
||||
</a>
|
||||
|
||||
## 感谢你的支持!如果这个项目对你有帮助,请点个⭐️鼓励一下,谢谢!
|
||||
|
||||
[lejianwen/rustdesk-server]: https://github.com/lejianwen/rustdesk-server
|
||||
38
README_EN.md
@@ -12,13 +12,6 @@ desktop software that provides self-hosted solutions.
|
||||
<img src="https://github.com/lejianwen/rustdesk-api/actions/workflows/build.yml/badge.svg"/>
|
||||
</div>
|
||||
|
||||
## Better used with [lejianwen/rustdesk-server].
|
||||
> [lejianwen/rustdesk-server] is a fork of the official RustDesk Server repository.
|
||||
> 1. Solves the API connection timeout issue.
|
||||
> 2. Can enforce login before initiating a connection.
|
||||
> 3. Supports client websocket.
|
||||
|
||||
|
||||
# Features
|
||||
|
||||
- PC API
|
||||
@@ -101,8 +94,8 @@ displaying data.Frontend code is available at [rustdesk-api-web](https://github.
|
||||
- For `OIDC`, you must set the `Issuer`. And `Scopes` is optional which default is `openid,email,profile`, please make sure this `Oauth App` can access `sub`, `email` and `preferred_username`
|
||||
- Create a `GitHub OAuth App`
|
||||
at `Settings` -> `Developer settings` -> `OAuth Apps` -> `New OAuth App` [here](https://github.com/settings/developers).
|
||||
- Set the `Authorization callback URL` to `http://<your server[:port]>/api/oidc/callback`,
|
||||
e.g., `http://127.0.0.1:21114/api/oidc/callback`.
|
||||
- Set the `Authorization callback URL` to `http://<your server[:port]>/api/oauth/callback`,
|
||||
e.g., `http://127.0.0.1:21114/api/oauth/callback`.
|
||||
|
||||
7. Login logs
|
||||
8. Connection logs
|
||||
@@ -125,6 +118,9 @@ displaying data.Frontend code is available at [rustdesk-api-web](https://github.
|
||||
pre-configured.
|
||||
3. After logging in, the ID server and key will be automatically synced.
|
||||
4. The address book will also be automatically saved to the web client for convenient use.
|
||||
5. Now supports `v2 Preview`, accessible at `/webclient2`
|
||||

|
||||
6. `v2 preview` deployment, [WIKI](https://github.com/lejianwen/rustdesk-api/wiki)
|
||||
|
||||
### Automated Documentation : API documentation is generated using Swag, making it easier for developers to understand and use the API.
|
||||
|
||||
@@ -166,9 +162,6 @@ The table below does not list all configurations. Please refer to the configurat
|
||||
| RUSTDESK_API_APP_SHOW_SWAGGER | swagger visible; 1: yes, 0: no; default: 0 | `0` |
|
||||
| RUSTDESK_API_APP_TOKEN_EXPIRE | token expire duration | `168h` |
|
||||
| RUSTDESK_API_APP_DISABLE_PWD_LOGIN | disable password login | `false` |
|
||||
| RUSTDESK_API_APP_REGISTER_STATUS | register user default status ; 1 enabled , 2 disabled ; default 1 | `1` |
|
||||
| RUSTDESK_API_APP_CAPTCHA_THRESHOLD | captcha threshold; -1 disabled, 0 always enable, >0 threshold ;default `3` | `3` |
|
||||
| RUSTDESK_API_APP_BAN_THRESHOLD | ban ip threshold; 0 disabled, >0 threshold ; default `0` | `0` |
|
||||
| ----- ADMIN Configuration----- | ---------- | ---------- |
|
||||
| RUSTDESK_API_ADMIN_TITLE | Admin Title | `RustDesk Api Admin` |
|
||||
| RUSTDESK_API_ADMIN_HELLO | Admin welcome message, you can use `html` | |
|
||||
@@ -185,7 +178,6 @@ The table below does not list all configurations. Please refer to the configurat
|
||||
| RUSTDESK_API_MYSQL_PASSWORD | MySQL password | 111111 |
|
||||
| RUSTDESK_API_MYSQL_ADDR | MySQL address | 192.168.1.66:3306 |
|
||||
| RUSTDESK_API_MYSQL_DBNAME | MySQL database name | rustdesk |
|
||||
| RUSTDESK_API_MYSQL_TLS | Whether to enable TLS, optional values: `true`, `false`, `skip-verify`, `custom` | `false` |
|
||||
| ----- RUSTDESK Configuration ----- | --------------------------------------- | ----------------------------- |
|
||||
| RUSTDESK_API_RUSTDESK_ID_SERVER | Rustdesk ID server address | 192.168.1.66:21116 |
|
||||
| RUSTDESK_API_RUSTDESK_RELAY_SERVER | Rustdesk relay server address | 192.168.1.66:21117 |
|
||||
@@ -256,17 +248,10 @@ Download the release from [release](https://github.com/lejianwen/rustdesk-api/re
|
||||
4. Run:
|
||||
```bash
|
||||
# Run directly
|
||||
go run cmd/apimain.go
|
||||
# Or generate and run the API using generate_api.go
|
||||
go generate generate_api.go
|
||||
```
|
||||
> **Note:** When using `go run` or the compiled binary, the `conf` and `resources`
|
||||
> directories must exist relative to the current working directory. If you run
|
||||
> the program from another location, specify absolute paths with `-c` and the
|
||||
> `RUSTDESK_API_GIN_RESOURCES_PATH` environment variable. Example:
|
||||
> ```bash
|
||||
> RUSTDESK_API_GIN_RESOURCES_PATH=/opt/rustdesk-api/resources ./apimain -c /opt/rustdesk-api/conf/config.yaml
|
||||
> ```
|
||||
go run cmd/apimain.go
|
||||
# Or generate and run the API using generate_api.go
|
||||
go generate generate_api.go
|
||||
```
|
||||
|
||||
5. To compile, change to the project root directory. For Windows, run `build.bat`, and for Linux, run `build.sh`. After
|
||||
compiling, the corresponding executables will be generated in the `release` directory. Run the compiled executables
|
||||
@@ -329,7 +314,4 @@ Thanks to everyone who contributed!
|
||||
<img src="https://contrib.rocks/image?repo=lejianwen/rustdesk-api" />
|
||||
</a>
|
||||
|
||||
## Thanks for your support! If you find this project useful, please give it a ⭐️. Thank you!
|
||||
|
||||
|
||||
[lejianwen/rustdesk-server]: https://github.com/lejianwen/rustdesk-server
|
||||
## Thanks for your support! If you find this project useful, please give it a ⭐️. Thank you!
|
||||
@@ -1,11 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"github.com/lejianwen/rustdesk-api/v2/config"
|
||||
"github.com/lejianwen/rustdesk-api/v2/global"
|
||||
@@ -21,10 +16,10 @@ import (
|
||||
"github.com/lejianwen/rustdesk-api/v2/utils"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
"github.com/spf13/cobra"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const DatabaseVersion = 265
|
||||
|
||||
// @title 管理系统API
|
||||
// @version 1.0
|
||||
// @description 接口
|
||||
@@ -144,41 +139,18 @@ func InitGlobal() {
|
||||
}
|
||||
//gorm
|
||||
if global.Config.Gorm.Type == config.TypeMysql {
|
||||
|
||||
dsn := fmt.Sprintf("%s:%s@(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local&tls=%s",
|
||||
global.Config.Mysql.Username,
|
||||
global.Config.Mysql.Password,
|
||||
global.Config.Mysql.Addr,
|
||||
global.Config.Mysql.Dbname,
|
||||
global.Config.Mysql.Tls,
|
||||
)
|
||||
|
||||
dns := global.Config.Mysql.Username + ":" + global.Config.Mysql.Password + "@(" + global.Config.Mysql.Addr + ")/" + global.Config.Mysql.Dbname + "?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
global.DB = orm.NewMysql(&orm.MysqlConfig{
|
||||
Dsn: dsn,
|
||||
Dns: dns,
|
||||
MaxIdleConns: global.Config.Gorm.MaxIdleConns,
|
||||
MaxOpenConns: global.Config.Gorm.MaxOpenConns,
|
||||
}, global.Logger)
|
||||
} else if global.Config.Gorm.Type == config.TypePostgresql {
|
||||
dsn := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=%s TimeZone=%s",
|
||||
global.Config.Postgresql.Host,
|
||||
global.Config.Postgresql.Port,
|
||||
global.Config.Postgresql.User,
|
||||
global.Config.Postgresql.Password,
|
||||
global.Config.Postgresql.Dbname,
|
||||
global.Config.Postgresql.Sslmode,
|
||||
global.Config.Postgresql.TimeZone,
|
||||
)
|
||||
global.DB = orm.NewPostgresql(&orm.PostgresqlConfig{
|
||||
Dsn: dsn,
|
||||
MaxIdleConns: global.Config.Gorm.MaxIdleConns,
|
||||
MaxOpenConns: global.Config.Gorm.MaxOpenConns,
|
||||
}, global.Logger)
|
||||
})
|
||||
} else {
|
||||
//sqlite
|
||||
global.DB = orm.NewSqlite(&orm.SqliteConfig{
|
||||
MaxIdleConns: global.Config.Gorm.MaxIdleConns,
|
||||
MaxOpenConns: global.Config.Gorm.MaxOpenConns,
|
||||
}, global.Logger)
|
||||
})
|
||||
}
|
||||
|
||||
//validator
|
||||
@@ -203,18 +175,10 @@ func InitGlobal() {
|
||||
//service
|
||||
service.New(&global.Config, global.DB, global.Logger, global.Jwt, global.Lock)
|
||||
|
||||
global.LoginLimiter = utils.NewLoginLimiter(utils.SecurityPolicy{
|
||||
CaptchaThreshold: global.Config.App.CaptchaThreshold,
|
||||
BanThreshold: global.Config.App.BanThreshold,
|
||||
AttemptsWindow: 10 * time.Minute,
|
||||
BanDuration: 30 * time.Minute,
|
||||
})
|
||||
global.LoginLimiter.RegisterProvider(utils.B64StringCaptchaProvider{})
|
||||
DatabaseAutoUpdate()
|
||||
}
|
||||
|
||||
func DatabaseAutoUpdate() {
|
||||
version := DatabaseVersion
|
||||
version := 262
|
||||
|
||||
db := global.DB
|
||||
|
||||
@@ -224,17 +188,11 @@ func DatabaseAutoUpdate() {
|
||||
if dbName == "" {
|
||||
dbName = global.Config.Mysql.Dbname
|
||||
// 移除 DSN 中的数据库名称,以便初始连接时不指定数据库
|
||||
dsnWithoutDB := fmt.Sprintf("%s:%s@(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
|
||||
global.Config.Mysql.Username,
|
||||
global.Config.Mysql.Password,
|
||||
global.Config.Mysql.Addr,
|
||||
"",
|
||||
)
|
||||
|
||||
dsnWithoutDB := global.Config.Mysql.Username + ":" + global.Config.Mysql.Password + "@(" + global.Config.Mysql.Addr + ")/?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
//新链接
|
||||
dbWithoutDB := orm.NewMysql(&orm.MysqlConfig{
|
||||
Dsn: dsnWithoutDB,
|
||||
}, global.Logger)
|
||||
Dns: dsnWithoutDB,
|
||||
})
|
||||
// 获取底层的 *sql.DB 对象,并确保在程序退出时关闭连接
|
||||
sqlDBWithoutDB, err := dbWithoutDB.DB()
|
||||
if err != nil {
|
||||
@@ -346,11 +304,7 @@ func Migrate(version uint) {
|
||||
// 生成随机密码
|
||||
pwd := utils.RandomString(8)
|
||||
global.Logger.Info("Admin Password Is: ", pwd)
|
||||
var err error
|
||||
admin.Password, err = utils.EncryptPassword(pwd)
|
||||
if err != nil {
|
||||
global.Logger.Fatalf("failed to generate admin password: %v", err)
|
||||
}
|
||||
admin.Password = service.AllService.UserService.EncryptPassword(pwd)
|
||||
global.DB.Create(admin)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,21 +2,14 @@ lang: "zh-CN"
|
||||
app:
|
||||
web-client: 1 # 1:启用 0:禁用
|
||||
register: false #是否开启注册
|
||||
register-status: 1 # 注册用户默认状态 1:启用 2:禁用
|
||||
captcha-threshold: 3 # <0:disabled, 0 always, >0:enabled
|
||||
ban-threshold: 0 # 0:disabled, >0:enabled
|
||||
show-swagger: 0 # 1:启用 0:禁用
|
||||
token-expire: 168h
|
||||
web-sso: true #web auth sso
|
||||
disable-pwd-login: false #禁用密码登录
|
||||
|
||||
admin:
|
||||
title: "RustDesk API Admin"
|
||||
title: "RustDesk Api Admin"
|
||||
hello-file: "./conf/admin/hello.html" #优先使用file
|
||||
hello: ""
|
||||
# ID Server and Relay Server ports https://github.com/lejianwen/rustdesk-api/issues/257
|
||||
id-server-port: 21116 # ID Server port (for server cmd)
|
||||
relay-server-port: 21117 # ID Server port (for server cmd)
|
||||
gin:
|
||||
api-addr: "0.0.0.0:21114"
|
||||
mode: "release" #release,debug,test
|
||||
@@ -31,17 +24,6 @@ mysql:
|
||||
password: ""
|
||||
addr: ""
|
||||
dbname: ""
|
||||
tls: "false" # true / false / skip-verify / custom
|
||||
|
||||
postgresql:
|
||||
host: "127.0.0.1"
|
||||
port: "5432"
|
||||
user: ""
|
||||
password: ""
|
||||
dbname: "postgres"
|
||||
sslmode: "disable" # disable, require, verify-ca, verify-full
|
||||
time-zone: "Asia/Shanghai" # Time zone for PostgreSQL connection
|
||||
|
||||
rustdesk:
|
||||
id-server: "192.168.1.66:21116"
|
||||
relay-server: "192.168.1.66:21117"
|
||||
@@ -81,4 +63,4 @@ ldap:
|
||||
last-name: "sn"
|
||||
sync: false # If true, the user will be synchronized to the database when the user logs in. If false, the user will be synchronized to the database when the user be created.
|
||||
admin-group: "cn=admin,dc=example,dc=com" # The group name of the admin group, if the user is in this group, the user will be an admin.
|
||||
allow-group: "cn=users,dc=example,dc=com" # The group name of the users group, if the user is in this group, the user will be an login.
|
||||
|
||||
|
||||
@@ -14,48 +14,33 @@ const (
|
||||
)
|
||||
|
||||
type App struct {
|
||||
WebClient int `mapstructure:"web-client"`
|
||||
Register bool `mapstructure:"register"`
|
||||
RegisterStatus int `mapstructure:"register-status"`
|
||||
ShowSwagger int `mapstructure:"show-swagger"`
|
||||
TokenExpire time.Duration `mapstructure:"token-expire"`
|
||||
WebSso bool `mapstructure:"web-sso"`
|
||||
DisablePwdLogin bool `mapstructure:"disable-pwd-login"`
|
||||
CaptchaThreshold int `mapstructure:"captcha-threshold"`
|
||||
BanThreshold int `mapstructure:"ban-threshold"`
|
||||
WebClient int `mapstructure:"web-client"`
|
||||
Register bool `mapstructure:"register"`
|
||||
ShowSwagger int `mapstructure:"show-swagger"`
|
||||
TokenExpire time.Duration `mapstructure:"token-expire"`
|
||||
WebSso bool `mapstructure:"web-sso"`
|
||||
DisablePwdLogin bool `mapstructure:"disable-pwd-login"`
|
||||
}
|
||||
type Admin struct {
|
||||
Title string `mapstructure:"title"`
|
||||
Hello string `mapstructure:"hello"`
|
||||
HelloFile string `mapstructure:"hello-file"`
|
||||
IdServerPort int `mapstructure:"id-server-port"`
|
||||
RelayServerPort int `mapstructure:"relay-server-port"`
|
||||
Title string `mapstructure:"title"`
|
||||
Hello string `mapstructure:"hello"`
|
||||
HelloFile string `mapstructure:"hello-file"`
|
||||
}
|
||||
type Config struct {
|
||||
Lang string `mapstructure:"lang"`
|
||||
App App
|
||||
Admin Admin
|
||||
Gorm Gorm
|
||||
Mysql Mysql
|
||||
Postgresql Postgresql
|
||||
Gin Gin
|
||||
Logger Logger
|
||||
Redis Redis
|
||||
Cache Cache
|
||||
Oss Oss
|
||||
Jwt Jwt
|
||||
Rustdesk Rustdesk
|
||||
Proxy Proxy
|
||||
Ldap Ldap
|
||||
}
|
||||
|
||||
func (a *Admin) Init() {
|
||||
if a.IdServerPort == 0 {
|
||||
a.IdServerPort = DefaultIdServerPort
|
||||
}
|
||||
if a.RelayServerPort == 0 {
|
||||
a.RelayServerPort = DefaultRelayServerPort
|
||||
}
|
||||
Lang string `mapstructure:"lang"`
|
||||
App App
|
||||
Admin Admin
|
||||
Gorm Gorm
|
||||
Mysql Mysql
|
||||
Gin Gin
|
||||
Logger Logger
|
||||
Redis Redis
|
||||
Cache Cache
|
||||
Oss Oss
|
||||
Jwt Jwt
|
||||
Rustdesk Rustdesk
|
||||
Proxy Proxy
|
||||
Ldap Ldap
|
||||
}
|
||||
|
||||
// Init 初始化配置
|
||||
@@ -92,7 +77,7 @@ func Init(rowVal *Config, path string) *viper.Viper {
|
||||
panic(fmt.Errorf("Fatal error config: %s \n", err))
|
||||
}
|
||||
rowVal.Rustdesk.LoadKeyFile()
|
||||
rowVal.Admin.Init()
|
||||
rowVal.Rustdesk.ParsePort()
|
||||
return v
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
TypeSqlite = "sqlite"
|
||||
TypeMysql = "mysql"
|
||||
TypePostgresql = "postgresql"
|
||||
TypeSqlite = "sqlite"
|
||||
TypeMysql = "mysql"
|
||||
)
|
||||
|
||||
type Gorm struct {
|
||||
@@ -17,15 +16,4 @@ type Mysql struct {
|
||||
Username string `mapstructure:"username"`
|
||||
Password string `mapstructure:"password"`
|
||||
Dbname string `mapstructure:"dbname"`
|
||||
Tls string `mapstructure:"tls"` // true / false / skip-verify / custom
|
||||
}
|
||||
|
||||
type Postgresql struct {
|
||||
Host string `mapstructure:"host"`
|
||||
Port string `mapstructure:"port"`
|
||||
User string `mapstructure:"user"`
|
||||
Password string `mapstructure:"password"`
|
||||
Dbname string `mapstructure:"dbname"`
|
||||
Sslmode string `mapstructure:"sslmode"` // "disable", "require", "verify-ca", "verify-full"
|
||||
TimeZone string `mapstructure:"time-zone"` // e.g., "Asia/Shanghai"
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ type LdapUser struct {
|
||||
LastName string `mapstructure:"last-name"`
|
||||
Sync bool `mapstructure:"sync"` // Will sync the user's information to the internal database
|
||||
AdminGroup string `mapstructure:"admin-group"` // Which group is the admin group
|
||||
AllowGroup string `mapstructure:"allow-group"` // Which group is allowed to login
|
||||
}
|
||||
|
||||
// type LdapGroup struct {
|
||||
|
||||
@@ -3,20 +3,18 @@ package config
|
||||
type GithubOauth struct {
|
||||
ClientId string `mapstructure:"client-id"`
|
||||
ClientSecret string `mapstructure:"client-secret"`
|
||||
RedirectUrl string `mapstructure:"redirect-url"`
|
||||
}
|
||||
|
||||
type GoogleOauth struct {
|
||||
ClientId string `mapstructure:"client-id"`
|
||||
ClientSecret string `mapstructure:"client-secret"`
|
||||
RedirectUrl string `mapstructure:"redirect-url"`
|
||||
}
|
||||
|
||||
type OidcOauth struct {
|
||||
Issuer string `mapstructure:"issuer"`
|
||||
ClientId string `mapstructure:"client-id"`
|
||||
ClientSecret string `mapstructure:"client-secret"`
|
||||
}
|
||||
|
||||
type LinuxdoOauth struct {
|
||||
ClientId string `mapstructure:"client-id"`
|
||||
ClientSecret string `mapstructure:"client-secret"`
|
||||
RedirectUrl string `mapstructure:"redirect-url"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -38,3 +40,19 @@ func (rd *Rustdesk) LoadKeyFile() {
|
||||
return
|
||||
}
|
||||
}
|
||||
func (rd *Rustdesk) ParsePort() {
|
||||
// Parse port
|
||||
idres := strings.Split(rd.IdServer, ":")
|
||||
if len(idres) == 1 {
|
||||
rd.IdServerPort = DefaultIdServerPort
|
||||
} else if len(idres) == 2 {
|
||||
rd.IdServerPort, _ = strconv.Atoi(idres[1])
|
||||
}
|
||||
|
||||
relayres := strings.Split(rd.RelayServer, ":")
|
||||
if len(relayres) == 1 {
|
||||
rd.RelayServerPort = DefaultRelayServerPort
|
||||
} else if len(relayres) == 2 {
|
||||
rd.RelayServerPort, _ = strconv.Atoi(relayres[1])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ services:
|
||||
dockerfile: Dockerfile.dev
|
||||
args:
|
||||
COUNTRY: CN
|
||||
FRONTEND_GIT_REPO: https://github.com/lejianwen/rustdesk-api-web.git
|
||||
FREONTEND_GIT_REPO: https://github.com/lejianwen/rustdesk-api-web.git
|
||||
FRONTEND_GIT_BRANCH: master
|
||||
# image: lejianwen/rustdesk-api
|
||||
container_name: rustdesk-api
|
||||
@@ -21,4 +21,4 @@ services:
|
||||
- ./data/rustdesk/api:/app/data #将数据库挂载出来方便备份
|
||||
- ./conf:/app/conf # config
|
||||
# - ./resources:/app/resources # 静态资源
|
||||
restart: unless-stopped
|
||||
restart: unless-stopped
|
||||
@@ -5569,7 +5569,8 @@ const docTemplateadmin = `{
|
||||
"required": [
|
||||
"client_id",
|
||||
"client_secret",
|
||||
"oauth_type"
|
||||
"oauth_type",
|
||||
"redirect_url"
|
||||
],
|
||||
"properties": {
|
||||
"auto_register": {
|
||||
@@ -5599,6 +5600,9 @@ const docTemplateadmin = `{
|
||||
"pkce_method": {
|
||||
"type": "string"
|
||||
},
|
||||
"redirect_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"scopes": {
|
||||
"type": "string"
|
||||
}
|
||||
@@ -5824,9 +5828,6 @@ const docTemplateadmin = `{
|
||||
"captcha": {
|
||||
"type": "string"
|
||||
},
|
||||
"captcha_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -6292,6 +6293,9 @@ const docTemplateadmin = `{
|
||||
"pkce_method": {
|
||||
"type": "string"
|
||||
},
|
||||
"redirect_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"scopes": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -5562,7 +5562,8 @@
|
||||
"required": [
|
||||
"client_id",
|
||||
"client_secret",
|
||||
"oauth_type"
|
||||
"oauth_type",
|
||||
"redirect_url"
|
||||
],
|
||||
"properties": {
|
||||
"auto_register": {
|
||||
@@ -5592,6 +5593,9 @@
|
||||
"pkce_method": {
|
||||
"type": "string"
|
||||
},
|
||||
"redirect_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"scopes": {
|
||||
"type": "string"
|
||||
}
|
||||
@@ -5817,9 +5821,6 @@
|
||||
"captcha": {
|
||||
"type": "string"
|
||||
},
|
||||
"captcha_id": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -6285,6 +6286,9 @@
|
||||
"pkce_method": {
|
||||
"type": "string"
|
||||
},
|
||||
"redirect_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"scopes": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -6588,4 +6592,4 @@
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,12 +143,15 @@ definitions:
|
||||
type: boolean
|
||||
pkce_method:
|
||||
type: string
|
||||
redirect_url:
|
||||
type: string
|
||||
scopes:
|
||||
type: string
|
||||
required:
|
||||
- client_id
|
||||
- client_secret
|
||||
- oauth_type
|
||||
- redirect_url
|
||||
type: object
|
||||
admin.PeerBatchDeleteForm:
|
||||
properties:
|
||||
@@ -294,8 +297,6 @@ definitions:
|
||||
properties:
|
||||
captcha:
|
||||
type: string
|
||||
captcha_id:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
platform:
|
||||
@@ -608,6 +609,8 @@ definitions:
|
||||
type: boolean
|
||||
pkce_method:
|
||||
type: string
|
||||
redirect_url:
|
||||
type: string
|
||||
scopes:
|
||||
type: string
|
||||
updated_at:
|
||||
|
||||
@@ -954,6 +954,35 @@ const docTemplateapi = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/oauth/callback": {
|
||||
"get": {
|
||||
"description": "OauthCallback",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Oauth"
|
||||
],
|
||||
"summary": "OauthCallback",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.LoginRes"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/oidc/auth": {
|
||||
"post": {
|
||||
"description": "OidcAuth",
|
||||
@@ -1012,35 +1041,6 @@ const docTemplateapi = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/oidc/callback": {
|
||||
"get": {
|
||||
"description": "OauthCallback",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Oauth"
|
||||
],
|
||||
"summary": "OauthCallback",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.LoginRes"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/peers": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -1208,7 +1208,7 @@ const docTemplateapi = `{
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"System"
|
||||
"地址"
|
||||
],
|
||||
"summary": "提交系统信息",
|
||||
"parameters": [
|
||||
@@ -1238,35 +1238,6 @@ const docTemplateapi = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sysinfo_ver": {
|
||||
"post": {
|
||||
"description": "获取系统版本信息",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"System"
|
||||
],
|
||||
"summary": "获取系统版本信息",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/users": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
||||
@@ -947,6 +947,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/oauth/callback": {
|
||||
"get": {
|
||||
"description": "OauthCallback",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Oauth"
|
||||
],
|
||||
"summary": "OauthCallback",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.LoginRes"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/oidc/auth": {
|
||||
"post": {
|
||||
"description": "OidcAuth",
|
||||
@@ -1005,35 +1034,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/oidc/callback": {
|
||||
"get": {
|
||||
"description": "OauthCallback",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Oauth"
|
||||
],
|
||||
"summary": "OauthCallback",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/api.LoginRes"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/peers": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -1201,7 +1201,7 @@
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"System"
|
||||
"地址"
|
||||
],
|
||||
"summary": "提交系统信息",
|
||||
"parameters": [
|
||||
@@ -1231,35 +1231,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/sysinfo_ver": {
|
||||
"post": {
|
||||
"description": "获取系统版本信息",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"System"
|
||||
],
|
||||
"summary": "获取系统版本信息",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal Server Error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/response.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/users": {
|
||||
"get": {
|
||||
"security": [
|
||||
|
||||
@@ -792,6 +792,25 @@ paths:
|
||||
summary: 登出
|
||||
tags:
|
||||
- 登录
|
||||
/oauth/callback:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: OauthCallback
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/api.LoginRes'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.ErrorResponse'
|
||||
summary: OauthCallback
|
||||
tags:
|
||||
- Oauth
|
||||
/oidc/auth:
|
||||
post:
|
||||
consumes:
|
||||
@@ -830,25 +849,6 @@ paths:
|
||||
summary: OidcAuthQuery
|
||||
tags:
|
||||
- Oauth
|
||||
/oidc/callback:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: OauthCallback
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/api.LoginRes'
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.ErrorResponse'
|
||||
summary: OauthCallback
|
||||
tags:
|
||||
- Oauth
|
||||
/peers:
|
||||
get:
|
||||
consumes:
|
||||
@@ -973,26 +973,7 @@ paths:
|
||||
$ref: '#/definitions/response.ErrorResponse'
|
||||
summary: 提交系统信息
|
||||
tags:
|
||||
- System
|
||||
/sysinfo_ver:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: 获取系统版本信息
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
type: string
|
||||
"500":
|
||||
description: Internal Server Error
|
||||
schema:
|
||||
$ref: '#/definitions/response.ErrorResponse'
|
||||
summary: 获取系统版本信息
|
||||
tags:
|
||||
- System
|
||||
- 地址
|
||||
/users:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"github.com/lejianwen/rustdesk-api/v2/lib/jwt"
|
||||
"github.com/lejianwen/rustdesk-api/v2/lib/lock"
|
||||
"github.com/lejianwen/rustdesk-api/v2/lib/upload"
|
||||
"github.com/lejianwen/rustdesk-api/v2/utils"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
@@ -32,9 +31,8 @@ var (
|
||||
ValidStruct func(*gin.Context, interface{}) []string
|
||||
ValidVar func(ctx *gin.Context, field interface{}, tag string) []string
|
||||
}
|
||||
Oss *upload.Oss
|
||||
Jwt *jwt.Jwt
|
||||
Lock lock.Locker
|
||||
Localizer func(lang string) *i18n.Localizer
|
||||
LoginLimiter *utils.LoginLimiter
|
||||
Oss *upload.Oss
|
||||
Jwt *jwt.Jwt
|
||||
Lock lock.Locker
|
||||
Localizer func(lang string) *i18n.Localizer
|
||||
)
|
||||
|
||||
25
go.mod
@@ -1,23 +1,19 @@
|
||||
module github.com/lejianwen/rustdesk-api/v2
|
||||
|
||||
go 1.23
|
||||
|
||||
toolchain go1.23.10
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.3.2
|
||||
github.com/antonfisher/nested-logrus-formatter v1.3.1
|
||||
github.com/coreos/go-oidc/v3 v3.12.0
|
||||
github.com/fsnotify/fsnotify v1.5.1
|
||||
github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6
|
||||
github.com/gin-gonic/gin v1.9.0
|
||||
github.com/go-ldap/ldap/v3 v3.4.10
|
||||
github.com/go-playground/locales v0.14.1
|
||||
github.com/go-playground/universal-translator v0.18.1
|
||||
github.com/go-playground/validator/v10 v10.26.0
|
||||
github.com/go-redis/redis/v8 v8.11.4
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/mojocn/base64Captcha v1.3.6
|
||||
github.com/nicksnyder/go-i18n/v2 v2.4.0
|
||||
github.com/sirupsen/logrus v1.8.1
|
||||
github.com/spf13/cobra v1.8.1
|
||||
@@ -25,13 +21,11 @@ require (
|
||||
github.com/swaggo/files v1.0.1
|
||||
github.com/swaggo/gin-swagger v1.6.0
|
||||
github.com/swaggo/swag v1.16.3
|
||||
golang.org/x/crypto v0.33.0
|
||||
golang.org/x/oauth2 v0.23.0
|
||||
golang.org/x/text v0.22.0
|
||||
gorm.io/driver/mysql v1.5.7
|
||||
gorm.io/driver/postgres v1.6.0
|
||||
gorm.io/driver/sqlite v1.5.6
|
||||
gorm.io/gorm v1.25.10
|
||||
gorm.io/gorm v1.25.7
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -42,12 +36,13 @@ require (
|
||||
github.com/bytedance/sonic v1.8.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
|
||||
github.com/coreos/go-oidc/v3 v3.12.0 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
|
||||
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
|
||||
github.com/go-ldap/ldap/v3 v3.4.10 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.19.5 // indirect
|
||||
github.com/go-openapi/jsonreference v0.19.6 // indirect
|
||||
github.com/go-openapi/spec v0.20.4 // indirect
|
||||
@@ -57,10 +52,6 @@ require (
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/pgx/v5 v5.6.0 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
@@ -74,9 +65,9 @@ require (
|
||||
github.com/mitchellh/mapstructure v1.4.2 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mojocn/base64Captcha v1.3.6 // indirect
|
||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
|
||||
github.com/rogpeppe/go-internal v1.14.1 // indirect
|
||||
github.com/spf13/afero v1.6.0 // indirect
|
||||
github.com/spf13/cast v1.4.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
@@ -85,11 +76,11 @@ require (
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.9 // indirect
|
||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
|
||||
golang.org/x/crypto v0.33.0 // indirect
|
||||
golang.org/x/image v0.13.0 // indirect
|
||||
golang.org/x/net v0.34.0 // indirect
|
||||
golang.org/x/sync v0.11.0 // indirect
|
||||
golang.org/x/sys v0.30.0 // indirect
|
||||
golang.org/x/tools v0.26.0 // indirect
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
gopkg.in/ini.v1 v1.63.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
||||
@@ -78,13 +78,11 @@ func (co *Config) AdminConfig(c *gin.Context) {
|
||||
}
|
||||
|
||||
hello := global.Config.Admin.Hello
|
||||
if hello == "" {
|
||||
helloFile := global.Config.Admin.HelloFile
|
||||
if helloFile != "" {
|
||||
b, err := os.ReadFile(helloFile)
|
||||
if err == nil && len(b) > 0 {
|
||||
hello = string(b)
|
||||
}
|
||||
helloFile := global.Config.Admin.HelloFile
|
||||
if helloFile != "" {
|
||||
b, err := os.ReadFile(helloFile)
|
||||
if err == nil && len(b) > 0 {
|
||||
hello = string(b)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ func (f *File) Notify(c *gin.Context) {
|
||||
|
||||
res := global.Oss.Verify(c.Request)
|
||||
if !res {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "NoAccess"))
|
||||
response.Fail(c, 101, "权限错误")
|
||||
return
|
||||
}
|
||||
fm := &FileBack{}
|
||||
|
||||
@@ -2,7 +2,6 @@ package admin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/lejianwen/rustdesk-api/v2/global"
|
||||
"github.com/lejianwen/rustdesk-api/v2/http/controller/api"
|
||||
@@ -12,11 +11,135 @@ import (
|
||||
adResp "github.com/lejianwen/rustdesk-api/v2/http/response/admin"
|
||||
"github.com/lejianwen/rustdesk-api/v2/model"
|
||||
"github.com/lejianwen/rustdesk-api/v2/service"
|
||||
"github.com/mojocn/base64Captcha"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Login struct {
|
||||
}
|
||||
|
||||
// Captcha 验证码结构
|
||||
type Captcha struct {
|
||||
Id string `json:"id"` // 验证码 ID
|
||||
B64 string `json:"b64"` // base64 验证码
|
||||
Code string `json:"-"` // 验证码内容
|
||||
ExpiresAt time.Time `json:"-"` // 过期时间
|
||||
}
|
||||
type LoginLimiter struct {
|
||||
mu sync.RWMutex
|
||||
failCount map[string]int // 记录每个 IP 的失败次数
|
||||
timestamp map[string]time.Time // 记录每个 IP 的最后失败时间
|
||||
captchas map[string]Captcha // 每个 IP 的验证码
|
||||
threshold int // 失败阈值
|
||||
expiry time.Duration // 失败记录过期时间
|
||||
}
|
||||
|
||||
func NewLoginLimiter(threshold int, expiry time.Duration) *LoginLimiter {
|
||||
return &LoginLimiter{
|
||||
failCount: make(map[string]int),
|
||||
timestamp: make(map[string]time.Time),
|
||||
captchas: make(map[string]Captcha),
|
||||
threshold: threshold,
|
||||
expiry: expiry,
|
||||
}
|
||||
}
|
||||
|
||||
// RecordFailure 记录登录失败
|
||||
func (l *LoginLimiter) RecordFailure(ip string) {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
|
||||
// 如果该 IP 的记录已经过期,重置计数
|
||||
if lastTime, exists := l.timestamp[ip]; exists && time.Since(lastTime) > l.expiry {
|
||||
l.failCount[ip] = 0
|
||||
}
|
||||
|
||||
// 更新失败次数和时间戳
|
||||
l.failCount[ip]++
|
||||
l.timestamp[ip] = time.Now()
|
||||
}
|
||||
|
||||
// NeedsCaptcha 检查是否需要验证码
|
||||
func (l *LoginLimiter) NeedsCaptcha(ip string) bool {
|
||||
l.mu.RLock()
|
||||
defer l.mu.RUnlock()
|
||||
|
||||
// 检查记录是否存在且未过期
|
||||
if lastTime, exists := l.timestamp[ip]; exists && time.Since(lastTime) <= l.expiry {
|
||||
return l.failCount[ip] >= l.threshold
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GenerateCaptcha 为指定 IP 生成验证码
|
||||
func (l *LoginLimiter) GenerateCaptcha(ip string) Captcha {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
|
||||
capd := base64Captcha.NewDriverString(50, 150, 5, 10, 4, "1234567890abcdefghijklmnopqrstuvwxyz", nil, nil, nil)
|
||||
b64cap := base64Captcha.NewCaptcha(capd, base64Captcha.DefaultMemStore)
|
||||
id, b64s, answer, err := b64cap.Generate()
|
||||
if err != nil {
|
||||
global.Logger.Error("Generate captcha failed: " + err.Error())
|
||||
return Captcha{}
|
||||
}
|
||||
// 保存验证码到对应 IP
|
||||
l.captchas[ip] = Captcha{
|
||||
Id: id,
|
||||
B64: b64s,
|
||||
Code: answer,
|
||||
ExpiresAt: time.Now().Add(5 * time.Minute),
|
||||
}
|
||||
return l.captchas[ip]
|
||||
}
|
||||
|
||||
// VerifyCaptcha 验证指定 IP 的验证码
|
||||
func (l *LoginLimiter) VerifyCaptcha(ip, code string) bool {
|
||||
l.mu.RLock()
|
||||
defer l.mu.RUnlock()
|
||||
|
||||
// 检查验证码是否存在且未过期
|
||||
if captcha, exists := l.captchas[ip]; exists && time.Now().Before(captcha.ExpiresAt) {
|
||||
return captcha.Code == code
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// RemoveCaptcha 移除指定 IP 的验证码
|
||||
func (l *LoginLimiter) RemoveCaptcha(ip string) {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
|
||||
delete(l.captchas, ip)
|
||||
}
|
||||
|
||||
// CleanupExpired 清理过期的记录
|
||||
func (l *LoginLimiter) CleanupExpired() {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
|
||||
now := time.Now()
|
||||
for ip, lastTime := range l.timestamp {
|
||||
if now.Sub(lastTime) > l.expiry {
|
||||
delete(l.failCount, ip)
|
||||
delete(l.timestamp, ip)
|
||||
delete(l.captchas, ip)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (l *LoginLimiter) RemoveRecord(ip string) {
|
||||
l.mu.Lock()
|
||||
defer l.mu.Unlock()
|
||||
|
||||
delete(l.failCount, ip)
|
||||
delete(l.timestamp, ip)
|
||||
delete(l.captchas, ip)
|
||||
}
|
||||
|
||||
var loginLimiter = NewLoginLimiter(3, 5*time.Minute)
|
||||
|
||||
// Login 登录
|
||||
// @Tags 登录
|
||||
// @Summary 登录
|
||||
@@ -33,16 +156,10 @@ func (ct *Login) Login(c *gin.Context) {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "PwdLoginDisabled"))
|
||||
return
|
||||
}
|
||||
|
||||
// 检查登录限制
|
||||
loginLimiter := global.LoginLimiter
|
||||
clientIp := c.ClientIP()
|
||||
_, needCaptcha := loginLimiter.CheckSecurityStatus(clientIp)
|
||||
|
||||
f := &admin.Login{}
|
||||
err := c.ShouldBindJSON(f)
|
||||
clientIp := c.ClientIP()
|
||||
if err != nil {
|
||||
loginLimiter.RecordFailedAttempt(clientIp)
|
||||
global.Logger.Warn(fmt.Sprintf("Login Fail: %s %s %s", "ParamsError", c.RemoteIP(), clientIp))
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "ParamsError")+err.Error())
|
||||
return
|
||||
@@ -50,15 +167,14 @@ func (ct *Login) Login(c *gin.Context) {
|
||||
|
||||
errList := global.Validator.ValidStruct(c, f)
|
||||
if len(errList) > 0 {
|
||||
loginLimiter.RecordFailedAttempt(clientIp)
|
||||
global.Logger.Warn(fmt.Sprintf("Login Fail: %s %s %s", "ParamsError", c.RemoteIP(), clientIp))
|
||||
response.Fail(c, 101, errList[0])
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否需要验证码
|
||||
if needCaptcha {
|
||||
if f.CaptchaId == "" || f.Captcha == "" || !loginLimiter.VerifyCaptcha(f.CaptchaId, f.Captcha) {
|
||||
if loginLimiter.NeedsCaptcha(clientIp) {
|
||||
if f.Captcha == "" || !loginLimiter.VerifyCaptcha(clientIp, f.Captcha) {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "CaptchaError"))
|
||||
return
|
||||
}
|
||||
@@ -68,19 +184,17 @@ func (ct *Login) Login(c *gin.Context) {
|
||||
|
||||
if u.Id == 0 {
|
||||
global.Logger.Warn(fmt.Sprintf("Login Fail: %s %s %s", "UsernameOrPasswordError", c.RemoteIP(), clientIp))
|
||||
loginLimiter.RecordFailedAttempt(clientIp)
|
||||
if _, needCaptcha = loginLimiter.CheckSecurityStatus(clientIp); needCaptcha {
|
||||
response.Fail(c, 110, response.TranslateMsg(c, "UsernameOrPasswordError"))
|
||||
} else {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "UsernameOrPasswordError"))
|
||||
loginLimiter.RecordFailure(clientIp)
|
||||
if loginLimiter.NeedsCaptcha(clientIp) {
|
||||
loginLimiter.RemoveCaptcha(clientIp)
|
||||
}
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "UsernameOrPasswordError"))
|
||||
return
|
||||
}
|
||||
|
||||
if !service.AllService.UserService.CheckUserEnable(u) {
|
||||
if needCaptcha {
|
||||
response.Fail(c, 110, response.TranslateMsg(c, "UserDisabled"))
|
||||
return
|
||||
if loginLimiter.NeedsCaptcha(clientIp) {
|
||||
loginLimiter.RemoveCaptcha(clientIp)
|
||||
}
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "UserDisabled"))
|
||||
return
|
||||
@@ -95,37 +209,23 @@ func (ct *Login) Login(c *gin.Context) {
|
||||
Platform: f.Platform,
|
||||
})
|
||||
|
||||
// 登录成功,清除登录限制
|
||||
loginLimiter.RemoveAttempts(clientIp)
|
||||
// 成功后清除记录
|
||||
loginLimiter.RemoveRecord(clientIp)
|
||||
|
||||
// 清理过期记录
|
||||
go loginLimiter.CleanupExpired()
|
||||
|
||||
responseLoginSuccess(c, u, ut.Token)
|
||||
}
|
||||
func (ct *Login) Captcha(c *gin.Context) {
|
||||
loginLimiter := global.LoginLimiter
|
||||
clientIp := c.ClientIP()
|
||||
banned, needCaptcha := loginLimiter.CheckSecurityStatus(clientIp)
|
||||
if banned {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "LoginBanned"))
|
||||
return
|
||||
}
|
||||
if !needCaptcha {
|
||||
if !loginLimiter.NeedsCaptcha(clientIp) {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "NoCaptchaRequired"))
|
||||
return
|
||||
}
|
||||
err, captcha := loginLimiter.RequireCaptcha()
|
||||
if err != nil {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "CaptchaError")+err.Error())
|
||||
return
|
||||
}
|
||||
err, b64 := loginLimiter.DrawCaptcha(captcha.Content)
|
||||
if err != nil {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "CaptchaError")+err.Error())
|
||||
return
|
||||
}
|
||||
captcha := loginLimiter.GenerateCaptcha(clientIp)
|
||||
response.Success(c, gin.H{
|
||||
"captcha": gin.H{
|
||||
"id": captcha.Id,
|
||||
"b64": b64,
|
||||
},
|
||||
"captcha": captcha,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -157,20 +257,12 @@ func (ct *Login) Logout(c *gin.Context) {
|
||||
// @Failure 500 {object} response.ErrorResponse
|
||||
// @Router /admin/login-options [post]
|
||||
func (ct *Login) LoginOptions(c *gin.Context) {
|
||||
loginLimiter := global.LoginLimiter
|
||||
clientIp := c.ClientIP()
|
||||
banned, needCaptcha := loginLimiter.CheckSecurityStatus(clientIp)
|
||||
if banned {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "LoginBanned"))
|
||||
return
|
||||
}
|
||||
ip := c.ClientIP()
|
||||
ops := service.AllService.OauthService.GetOauthProviders()
|
||||
response.Success(c, gin.H{
|
||||
"ops": ops,
|
||||
"register": global.Config.App.Register,
|
||||
"need_captcha": needCaptcha,
|
||||
"disable_pwd": global.Config.App.DisablePwdLogin,
|
||||
"auto_oidc": global.Config.App.DisablePwdLogin && len(ops) == 1,
|
||||
"need_captcha": loginLimiter.NeedsCaptcha(ip),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -98,10 +98,10 @@ func (abc *AddressBookCollection) Update(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
u := service.AllService.UserService.CurUser(c)
|
||||
//if f.UserId != u.Id {
|
||||
// response.Fail(c, 101, response.TranslateMsg(c, "NoAccess"))
|
||||
// return
|
||||
//}
|
||||
if f.UserId != u.Id {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "NoAccess"))
|
||||
return
|
||||
}
|
||||
ex := service.AllService.AddressBookService.CollectionInfoById(f.Id)
|
||||
if ex.Id == 0 {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "ItemNotFound"))
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/lejianwen/rustdesk-api/v2/global"
|
||||
"github.com/lejianwen/rustdesk-api/v2/http/request/admin"
|
||||
adminReq "github.com/lejianwen/rustdesk-api/v2/http/request/admin"
|
||||
"github.com/lejianwen/rustdesk-api/v2/http/response"
|
||||
"github.com/lejianwen/rustdesk-api/v2/service"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Oauth struct {
|
||||
@@ -69,16 +68,16 @@ func (o *Oauth) Confirm(c *gin.Context) {
|
||||
j := &adminReq.OauthConfirmForm{}
|
||||
err := c.ShouldBindJSON(j)
|
||||
if err != nil {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "ParamsError")+err.Error())
|
||||
response.Fail(c, 101, "参数错误"+err.Error())
|
||||
return
|
||||
}
|
||||
if j.Code == "" {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "ParamsError"))
|
||||
response.Fail(c, 101, "参数错误: code 不存在")
|
||||
return
|
||||
}
|
||||
v := service.AllService.OauthService.GetOauthCache(j.Code)
|
||||
if v == nil {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "OauthExpired"))
|
||||
response.Fail(c, 101, "授权已过期")
|
||||
return
|
||||
}
|
||||
u := service.AllService.UserService.CurUser(c)
|
||||
|
||||
@@ -114,9 +114,6 @@ func (ct *Peer) List(c *gin.Context) {
|
||||
if query.Ip != "" {
|
||||
tx.Where("last_online_ip like ?", "%"+query.Ip+"%")
|
||||
}
|
||||
if query.Alias != "" {
|
||||
tx.Where("alias like ?", "%"+query.Alias+"%")
|
||||
}
|
||||
})
|
||||
response.Success(c, res)
|
||||
}
|
||||
|
||||
@@ -119,16 +119,7 @@ func (r *Rustdesk) SendCmd(c *gin.Context) {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "ParamsError"))
|
||||
return
|
||||
}
|
||||
|
||||
port := 0
|
||||
switch rc.Target {
|
||||
case model.ServerCmdTargetIdServer:
|
||||
port = global.Config.Admin.IdServerPort - 1
|
||||
case model.ServerCmdTargetRelayServer:
|
||||
port = global.Config.Admin.RelayServerPort
|
||||
}
|
||||
|
||||
res, err := service.AllService.ServerCmdService.SendCmd(port, rc.Cmd, rc.Option)
|
||||
res, err := service.AllService.ServerCmdService.SendCmd(rc.Target, rc.Cmd, rc.Option)
|
||||
if err != nil {
|
||||
response.Fail(c, 101, err.Error())
|
||||
return
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
adResp "github.com/lejianwen/rustdesk-api/v2/http/response/admin"
|
||||
"github.com/lejianwen/rustdesk-api/v2/model"
|
||||
"github.com/lejianwen/rustdesk-api/v2/service"
|
||||
"github.com/lejianwen/rustdesk-api/v2/utils"
|
||||
"gorm.io/gorm"
|
||||
"strconv"
|
||||
)
|
||||
@@ -244,10 +243,11 @@ func (ct *User) ChangeCurPwd(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
u := service.AllService.UserService.CurUser(c)
|
||||
// Verify the old password only when the account already has one set
|
||||
// If the password is not empty, the old password is verified
|
||||
// otherwise, the old password is not verified
|
||||
if !service.AllService.UserService.IsPasswordEmptyByUser(u) {
|
||||
ok, _, err := utils.VerifyPassword(u.Password, f.OldPassword)
|
||||
if err != nil || !ok {
|
||||
oldPwd := service.AllService.UserService.EncryptPassword(f.OldPassword)
|
||||
if u.Password != oldPwd {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "OldPasswordError"))
|
||||
return
|
||||
}
|
||||
@@ -320,22 +320,11 @@ func (ct *User) Register(c *gin.Context) {
|
||||
response.Fail(c, 101, errList[0])
|
||||
return
|
||||
}
|
||||
regStatus := model.StatusCode(global.Config.App.RegisterStatus)
|
||||
// 注册状态可能未配置,默认启用
|
||||
if regStatus != model.COMMON_STATUS_DISABLED && regStatus != model.COMMON_STATUS_ENABLE {
|
||||
regStatus = model.COMMON_STATUS_ENABLE
|
||||
}
|
||||
|
||||
u := service.AllService.UserService.Register(f.Username, f.Email, f.Password, regStatus)
|
||||
u := service.AllService.UserService.Register(f.Username, f.Email, f.Password)
|
||||
if u == nil || u.Id == 0 {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "OperationFailed"))
|
||||
return
|
||||
}
|
||||
if regStatus == model.COMMON_STATUS_DISABLED {
|
||||
// 需要管理员审核
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "RegisterSuccessWaitAdminConfirm"))
|
||||
return
|
||||
}
|
||||
// 注册成功后自动登录
|
||||
ut := service.AllService.UserService.Login(u, &model.LoginLog{
|
||||
UserId: u.Id,
|
||||
|
||||
@@ -49,7 +49,7 @@ func (i *Index) Heartbeat(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{})
|
||||
return
|
||||
}
|
||||
peer := service.AllService.PeerService.FindById(info.Id)
|
||||
peer := service.AllService.PeerService.FindByUuid(info.Uuid)
|
||||
if peer == nil || peer.RowId == 0 {
|
||||
c.JSON(http.StatusOK, gin.H{})
|
||||
return
|
||||
|
||||
@@ -31,16 +31,10 @@ func (l *Login) Login(c *gin.Context) {
|
||||
response.Error(c, response.TranslateMsg(c, "PwdLoginDisabled"))
|
||||
return
|
||||
}
|
||||
|
||||
// 检查登录限制
|
||||
loginLimiter := global.LoginLimiter
|
||||
clientIp := c.ClientIP()
|
||||
|
||||
f := &api.LoginForm{}
|
||||
err := c.ShouldBindJSON(f)
|
||||
//fmt.Println(f)
|
||||
if err != nil {
|
||||
loginLimiter.RecordFailedAttempt(clientIp)
|
||||
global.Logger.Warn(fmt.Sprintf("Login Fail: %s %s %s", "ParamsError", c.RemoteIP(), c.ClientIP()))
|
||||
response.Error(c, response.TranslateMsg(c, "ParamsError")+err.Error())
|
||||
return
|
||||
@@ -48,7 +42,6 @@ func (l *Login) Login(c *gin.Context) {
|
||||
|
||||
errList := global.Validator.ValidStruct(c, f)
|
||||
if len(errList) > 0 {
|
||||
loginLimiter.RecordFailedAttempt(clientIp)
|
||||
global.Logger.Warn(fmt.Sprintf("Login Fail: %s %s %s", "ParamsError", c.RemoteIP(), c.ClientIP()))
|
||||
response.Error(c, errList[0])
|
||||
return
|
||||
@@ -57,7 +50,6 @@ func (l *Login) Login(c *gin.Context) {
|
||||
u := service.AllService.UserService.InfoByUsernamePassword(f.Username, f.Password)
|
||||
|
||||
if u.Id == 0 {
|
||||
loginLimiter.RecordFailedAttempt(clientIp)
|
||||
global.Logger.Warn(fmt.Sprintf("Login Fail: %s %s %s", "UsernameOrPasswordError", c.RemoteIP(), c.ClientIP()))
|
||||
response.Error(c, response.TranslateMsg(c, "UsernameOrPasswordError"))
|
||||
return
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/lejianwen/rustdesk-api/v2/global"
|
||||
"github.com/lejianwen/rustdesk-api/v2/http/request/api"
|
||||
@@ -12,6 +10,7 @@ import (
|
||||
"github.com/lejianwen/rustdesk-api/v2/service"
|
||||
"github.com/lejianwen/rustdesk-api/v2/utils"
|
||||
"github.com/nicksnyder/go-i18n/v2/i18n"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Oauth struct {
|
||||
@@ -80,8 +79,7 @@ func (o *Oauth) OidcAuthQueryPre(c *gin.Context) (*model.User, *model.UserToken)
|
||||
|
||||
// 如果 UserId 为 0,说明还在授权中
|
||||
if v.UserId == 0 {
|
||||
//fix: 1.4.2 webclient oidc
|
||||
c.JSON(http.StatusOK, gin.H{"message": "Authorization in progress, please login and bind", "error": "No authed oidc is found"})
|
||||
c.JSON(http.StatusOK, gin.H{"message": "Authorization in progress, please login and bind"})
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -144,7 +142,7 @@ func (o *Oauth) OidcAuthQuery(c *gin.Context) {
|
||||
// @Produce json
|
||||
// @Success 200 {object} apiResp.LoginRes
|
||||
// @Failure 500 {object} response.ErrorResponse
|
||||
// @Router /oidc/callback [get]
|
||||
// @Router /oauth/callback [get]
|
||||
func (o *Oauth) OauthCallback(c *gin.Context) {
|
||||
state := c.Query("state")
|
||||
if state == "" {
|
||||
@@ -227,7 +225,8 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
||||
if !*oauthConfig.AutoRegister {
|
||||
//c.String(http.StatusInternalServerError, "还未绑定用户,请先绑定")
|
||||
oauthCache.UpdateFromOauthUser(oauthUser)
|
||||
c.Redirect(http.StatusFound, "/_admin/#/oauth/bind/"+cacheKey)
|
||||
url := global.Config.Rustdesk.ApiServer + "/_admin/#/oauth/bind/" + cacheKey
|
||||
c.Redirect(http.StatusFound, url)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -252,7 +251,8 @@ func (o *Oauth) OauthCallback(c *gin.Context) {
|
||||
Type: model.LoginLogTypeOauth,
|
||||
Platform: oauthService.DeviceOs,
|
||||
})*/
|
||||
c.Redirect(http.StatusFound, "/_admin/#/")
|
||||
url := global.Config.Rustdesk.ApiServer + "/_admin/#/"
|
||||
c.Redirect(http.StatusFound, url)
|
||||
return
|
||||
}
|
||||
c.HTML(http.StatusOK, "oauth_success.html", gin.H{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
requstform "github.com/lejianwen/rustdesk-api/v2/http/request/api"
|
||||
@@ -14,7 +13,7 @@ type Peer struct {
|
||||
}
|
||||
|
||||
// SysInfo
|
||||
// @Tags System
|
||||
// @Tags 地址
|
||||
// @Summary 提交系统信息
|
||||
// @Description 提交系统信息
|
||||
// @Accept json
|
||||
@@ -31,10 +30,10 @@ func (p *Peer) SysInfo(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
fpe := f.ToPeer()
|
||||
pe := service.AllService.PeerService.FindById(f.Id)
|
||||
pe := service.AllService.PeerService.FindByUuid(f.Uuid)
|
||||
if pe.RowId == 0 {
|
||||
pe = f.ToPeer()
|
||||
pe.UserId = service.AllService.UserService.FindLatestUserIdFromLoginLogByUuid(pe.Uuid, pe.Id)
|
||||
pe.UserId = service.AllService.UserService.FindLatestUserIdFromLoginLogByUuid(pe.Uuid)
|
||||
err = service.AllService.PeerService.Create(pe)
|
||||
if err != nil {
|
||||
response.Error(c, response.TranslateMsg(c, "OperationFailed")+err.Error())
|
||||
@@ -42,7 +41,7 @@ func (p *Peer) SysInfo(c *gin.Context) {
|
||||
}
|
||||
} else {
|
||||
if pe.UserId == 0 {
|
||||
pe.UserId = service.AllService.UserService.FindLatestUserIdFromLoginLogByUuid(pe.Uuid, pe.Id)
|
||||
pe.UserId = service.AllService.UserService.FindLatestUserIdFromLoginLogByUuid(pe.Uuid)
|
||||
}
|
||||
fpe.RowId = pe.RowId
|
||||
fpe.UserId = pe.UserId
|
||||
@@ -58,19 +57,8 @@ func (p *Peer) SysInfo(c *gin.Context) {
|
||||
c.String(http.StatusOK, "SYSINFO_UPDATED")
|
||||
}
|
||||
|
||||
// SysInfoVer
|
||||
// @Tags System
|
||||
// @Summary 获取系统版本信息
|
||||
// @Description 获取系统版本信息
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {string} string ""
|
||||
// @Failure 500 {object} response.ErrorResponse
|
||||
// @Router /sysinfo_ver [post]
|
||||
func (p *Peer) SysInfoVer(c *gin.Context) {
|
||||
//读取resources/version文件
|
||||
v := service.AllService.AppService.GetAppVersion()
|
||||
// 加上启动时间,方便client上传信息
|
||||
v = fmt.Sprintf("%s\n%s", v, service.AllService.AppService.GetStartTime())
|
||||
c.String(http.StatusOK, v)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ func ApiInit() {
|
||||
g.NoRoute(func(c *gin.Context) {
|
||||
c.String(http.StatusNotFound, "404 not found")
|
||||
})
|
||||
g.Use(middleware.Logger(), middleware.Limiter(), gin.Recovery())
|
||||
g.Use(middleware.Logger(), gin.Recovery())
|
||||
router.WebInit(g)
|
||||
router.Init(g)
|
||||
router.ApiInit(g)
|
||||
|
||||
@@ -13,13 +13,13 @@ func BackendUserAuth() gin.HandlerFunc {
|
||||
//测试先关闭
|
||||
token := c.GetHeader("api-token")
|
||||
if token == "" {
|
||||
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
|
||||
response.Fail(c, 403, "请先登录")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
user, ut := service.AllService.UserService.InfoByAccessToken(token)
|
||||
if user.Id == 0 {
|
||||
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
|
||||
response.Fail(c, 403, "请先登录")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ func AdminPrivilege() gin.HandlerFunc {
|
||||
u := service.AllService.UserService.CurUser(c)
|
||||
|
||||
if !service.AllService.UserService.IsAdmin(u) {
|
||||
response.Fail(c, 403, response.TranslateMsg(c, "NoAccess"))
|
||||
response.Fail(c, 403, "无权限")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -12,18 +12,18 @@ func JwtAuth() gin.HandlerFunc {
|
||||
//测试先关闭
|
||||
token := c.GetHeader("api-token")
|
||||
if token == "" {
|
||||
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
|
||||
response.Fail(c, 403, "请先登录")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
uid, err := global.Jwt.ParseToken(token)
|
||||
if err != nil {
|
||||
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
|
||||
response.Fail(c, 403, "请先登录")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
if uid == 0 {
|
||||
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
|
||||
response.Fail(c, 403, "请先登录")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
@@ -34,12 +34,12 @@ func JwtAuth() gin.HandlerFunc {
|
||||
// Username: "测试用户",
|
||||
//}
|
||||
if user.Id == 0 {
|
||||
response.Fail(c, 403, response.TranslateMsg(c, "NeedLogin"))
|
||||
response.Fail(c, 403, "请先登录")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
if !service.AllService.UserService.CheckUserEnable(user) {
|
||||
response.Fail(c, 101, response.TranslateMsg(c, "Banned"))
|
||||
response.Fail(c, 101, "你已被禁用")
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/lejianwen/rustdesk-api/v2/global"
|
||||
"github.com/lejianwen/rustdesk-api/v2/http/response"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func Limiter() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
loginLimiter := global.LoginLimiter
|
||||
clientIp := c.ClientIP()
|
||||
banned, _ := loginLimiter.CheckSecurityStatus(clientIp)
|
||||
if banned {
|
||||
response.Fail(c, http.StatusLocked, response.TranslateMsg(c, "Banned"))
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
c.Next()
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
package admin
|
||||
|
||||
type Login struct {
|
||||
Username string `json:"username" validate:"required" label:"用户名"`
|
||||
Password string `json:"password,omitempty" validate:"required" label:"密码"`
|
||||
Platform string `json:"platform" label:"平台"`
|
||||
Captcha string `json:"captcha,omitempty" label:"验证码"`
|
||||
CaptchaId string `json:"captcha_id,omitempty"`
|
||||
Username string `json:"username" validate:"required" label:"用户名"`
|
||||
Password string `json:"password,omitempty" validate:"required" label:"密码"`
|
||||
Platform string `json:"platform" label:"平台"`
|
||||
Captcha string `json:"captcha,omitempty" label:"验证码"`
|
||||
}
|
||||
|
||||
type LoginLogQuery struct {
|
||||
|
||||
@@ -22,6 +22,7 @@ type OauthForm struct {
|
||||
Scopes string `json:"scopes" validate:"omitempty"`
|
||||
ClientId string `json:"client_id" validate:"required"`
|
||||
ClientSecret string `json:"client_secret" validate:"required"`
|
||||
RedirectUrl string `json:"redirect_url" validate:"required"`
|
||||
AutoRegister *bool `json:"auto_register"`
|
||||
PkceEnable *bool `json:"pkce_enable"`
|
||||
PkceMethod string `json:"pkce_method"`
|
||||
@@ -33,6 +34,7 @@ func (of *OauthForm) ToOauth() *model.Oauth {
|
||||
OauthType: of.OauthType,
|
||||
ClientId: of.ClientId,
|
||||
ClientSecret: of.ClientSecret,
|
||||
RedirectUrl: of.RedirectUrl,
|
||||
AutoRegister: of.AutoRegister,
|
||||
Issuer: of.Issuer,
|
||||
Scopes: of.Scopes,
|
||||
|
||||
@@ -13,7 +13,6 @@ type PeerForm struct {
|
||||
Uuid string `json:"uuid"`
|
||||
Version string `json:"version"`
|
||||
GroupId uint `json:"group_id"`
|
||||
Alias string `json:"alias"`
|
||||
}
|
||||
|
||||
type PeerBatchDeleteForm struct {
|
||||
@@ -33,7 +32,6 @@ func (f *PeerForm) ToPeer() *model.Peer {
|
||||
Uuid: f.Uuid,
|
||||
Version: f.Version,
|
||||
GroupId: f.GroupId,
|
||||
Alias: f.Alias,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +43,6 @@ type PeerQuery struct {
|
||||
Uuids string `json:"uuids" form:"uuids"`
|
||||
Ip string `json:"ip" form:"ip"`
|
||||
Username string `json:"username" form:"username"`
|
||||
Alias string `json:"alias" form:"alias"`
|
||||
}
|
||||
|
||||
type SimpleDataQuery struct {
|
||||
|
||||
@@ -14,7 +14,6 @@ type UserForm struct {
|
||||
GroupId uint `json:"group_id" validate:"required"`
|
||||
IsAdmin *bool `json:"is_admin" `
|
||||
Status model.StatusCode `json:"status" validate:"required,gte=0"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
func (uf *UserForm) FromUser(user *model.User) *UserForm {
|
||||
@@ -26,7 +25,6 @@ func (uf *UserForm) FromUser(user *model.User) *UserForm {
|
||||
uf.GroupId = user.GroupId
|
||||
uf.IsAdmin = user.IsAdmin
|
||||
uf.Status = user.Status
|
||||
uf.Remark = user.Remark
|
||||
return uf
|
||||
}
|
||||
func (uf *UserForm) ToUser() *model.User {
|
||||
@@ -39,7 +37,6 @@ func (uf *UserForm) ToUser() *model.User {
|
||||
user.GroupId = uf.GroupId
|
||||
user.IsAdmin = uf.IsAdmin
|
||||
user.Status = uf.Status
|
||||
user.Remark = uf.Remark
|
||||
return user
|
||||
}
|
||||
|
||||
|
||||
@@ -49,10 +49,6 @@ func ApiInit(g *gin.Engine) {
|
||||
frg.GET("/oauth/callback", o.OauthCallback)
|
||||
frg.GET("/oauth/login", o.OauthCallback)
|
||||
frg.GET("/oauth/msg", o.Message)
|
||||
|
||||
frg.GET("/oidc/callback", o.OauthCallback)
|
||||
frg.GET("/oidc/login", o.OauthCallback)
|
||||
frg.GET("/oidc/msg", o.Message)
|
||||
}
|
||||
{
|
||||
pe := &api.Peer{}
|
||||
|
||||
@@ -2,6 +2,7 @@ package orm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/lejianwen/rustdesk-api/v2/global"
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
@@ -9,14 +10,14 @@ import (
|
||||
)
|
||||
|
||||
type MysqlConfig struct {
|
||||
Dsn string
|
||||
Dns string
|
||||
MaxIdleConns int
|
||||
MaxOpenConns int
|
||||
}
|
||||
|
||||
func NewMysql(mysqlConf *MysqlConfig, logwriter logger.Writer) *gorm.DB {
|
||||
func NewMysql(mysqlConf *MysqlConfig) *gorm.DB {
|
||||
db, err := gorm.Open(mysql.New(mysql.Config{
|
||||
DSN: mysqlConf.Dsn, // DSN data source name
|
||||
DSN: mysqlConf.Dns, // DSN data source name
|
||||
DefaultStringSize: 256, // string 类型字段的默认长度
|
||||
//DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持
|
||||
//DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引
|
||||
@@ -25,7 +26,7 @@ func NewMysql(mysqlConf *MysqlConfig, logwriter logger.Writer) *gorm.DB {
|
||||
}), &gorm.Config{
|
||||
DisableForeignKeyConstraintWhenMigrating: true,
|
||||
Logger: logger.New(
|
||||
logwriter, // io writer
|
||||
global.Logger, // io writer
|
||||
logger.Config{
|
||||
SlowThreshold: time.Second, // Slow SQL threshold
|
||||
LogLevel: logger.Warn, // Log level
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package orm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gorm.io/driver/postgres"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PostgresqlConfig struct {
|
||||
Dsn string
|
||||
MaxIdleConns int
|
||||
MaxOpenConns int
|
||||
}
|
||||
|
||||
func NewPostgresql(conf *PostgresqlConfig, logwriter logger.Writer) *gorm.DB {
|
||||
db, err := gorm.Open(postgres.Open(conf.Dsn), &gorm.Config{
|
||||
DisableForeignKeyConstraintWhenMigrating: true,
|
||||
Logger: logger.New(
|
||||
logwriter, // io writer
|
||||
logger.Config{
|
||||
SlowThreshold: time.Second, // Slow SQL threshold
|
||||
LogLevel: logger.Warn, // Log level
|
||||
//IgnoreRecordNotFoundError: true, // Ignore ErrRecordNotFound error for logger
|
||||
ParameterizedQueries: true, // Don't include params in the SQL log
|
||||
Colorful: true,
|
||||
},
|
||||
),
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
sqlDB, err2 := db.DB()
|
||||
if err2 != nil {
|
||||
fmt.Println(err2)
|
||||
}
|
||||
// SetMaxIdleConns 设置空闲连接池中连接的最大数量
|
||||
sqlDB.SetMaxIdleConns(conf.MaxIdleConns)
|
||||
|
||||
// SetMaxOpenConns 设置打开数据库连接的最大数量。
|
||||
sqlDB.SetMaxOpenConns(conf.MaxOpenConns)
|
||||
|
||||
return db
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package orm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/lejianwen/rustdesk-api/v2/global"
|
||||
"gorm.io/driver/sqlite"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
@@ -13,11 +14,11 @@ type SqliteConfig struct {
|
||||
MaxOpenConns int
|
||||
}
|
||||
|
||||
func NewSqlite(sqliteConf *SqliteConfig, logwriter logger.Writer) *gorm.DB {
|
||||
func NewSqlite(sqliteConf *SqliteConfig) *gorm.DB {
|
||||
db, err := gorm.Open(sqlite.Open("./data/rustdeskapi.db"), &gorm.Config{
|
||||
DisableForeignKeyConstraintWhenMigrating: true,
|
||||
Logger: logger.New(
|
||||
logwriter, // io writer
|
||||
global.Logger, // io writer
|
||||
logger.Config{
|
||||
SlowThreshold: time.Second, // Slow SQL threshold
|
||||
LogLevel: logger.Warn, // Log level
|
||||
|
||||
@@ -14,7 +14,6 @@ const (
|
||||
OauthTypeGoogle string = "google"
|
||||
OauthTypeOidc string = "oidc"
|
||||
OauthTypeWebauth string = "webauth"
|
||||
OauthTypeLinuxdo string = "linuxdo"
|
||||
PKCEMethodS256 string = "S256"
|
||||
PKCEMethodPlain string = "plain"
|
||||
)
|
||||
@@ -22,7 +21,7 @@ const (
|
||||
// Validate the oauth type
|
||||
func ValidateOauthType(oauthType string) error {
|
||||
switch oauthType {
|
||||
case OauthTypeGithub, OauthTypeGoogle, OauthTypeOidc, OauthTypeWebauth, OauthTypeLinuxdo:
|
||||
case OauthTypeGithub, OauthTypeGoogle, OauthTypeOidc, OauthTypeWebauth:
|
||||
return nil
|
||||
default:
|
||||
return errors.New("invalid Oauth type")
|
||||
@@ -30,9 +29,8 @@ func ValidateOauthType(oauthType string) error {
|
||||
}
|
||||
|
||||
const (
|
||||
UserEndpointGithub string = "https://api.github.com/user"
|
||||
UserEndpointLinuxdo string = "https://connect.linux.do/api/user"
|
||||
IssuerGoogle string = "https://accounts.google.com"
|
||||
UserEndpointGithub string = "https://api.github.com/user"
|
||||
IssuerGoogle string = "https://accounts.google.com"
|
||||
)
|
||||
|
||||
type Oauth struct {
|
||||
@@ -41,12 +39,12 @@ type Oauth struct {
|
||||
OauthType string `json:"oauth_type"`
|
||||
ClientId string `json:"client_id"`
|
||||
ClientSecret string `json:"client_secret"`
|
||||
//RedirectUrl string `json:"redirect_url"`
|
||||
RedirectUrl string `json:"redirect_url"`
|
||||
AutoRegister *bool `json:"auto_register"`
|
||||
Scopes string `json:"scopes"`
|
||||
Issuer string `json:"issuer"`
|
||||
PkceEnable *bool `json:"pkce_enable"`
|
||||
PkceMethod string `json:"pkce_method"`
|
||||
PkceEnable *bool `json:"pkce_enable"`
|
||||
PkceMethod string `json:"pkce_method"`
|
||||
TimeModel
|
||||
}
|
||||
|
||||
@@ -62,8 +60,6 @@ func (oa *Oauth) FormatOauthInfo() error {
|
||||
oa.Op = OauthTypeGithub
|
||||
case OauthTypeGoogle:
|
||||
oa.Op = OauthTypeGoogle
|
||||
case OauthTypeLinuxdo:
|
||||
oa.Op = OauthTypeLinuxdo
|
||||
}
|
||||
// check if the op is empty, set the default value
|
||||
op := strings.TrimSpace(oa.Op)
|
||||
@@ -156,24 +152,6 @@ func (gu *GithubUser) ToOauthUser() *OauthUser {
|
||||
}
|
||||
}
|
||||
|
||||
type LinuxdoUser struct {
|
||||
OauthUserBase
|
||||
Id int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar_url"`
|
||||
}
|
||||
|
||||
func (lu *LinuxdoUser) ToOauthUser() *OauthUser {
|
||||
return &OauthUser{
|
||||
OpenId: strconv.Itoa(lu.Id),
|
||||
Name: lu.Name,
|
||||
Username: strings.ToLower(lu.Username),
|
||||
Email: lu.Email,
|
||||
VerifiedEmail: true, // linux.do 用户邮箱默认已验证
|
||||
Picture: lu.Avatar,
|
||||
}
|
||||
}
|
||||
|
||||
type OauthList struct {
|
||||
Oauths []*Oauth `json:"list"`
|
||||
Pagination
|
||||
|
||||
@@ -15,7 +15,6 @@ type Peer struct {
|
||||
LastOnlineTime int64 `json:"last_online_time" gorm:"default:0;not null;"`
|
||||
LastOnlineIp string `json:"last_online_ip" gorm:"default:'';not null;"`
|
||||
GroupId uint `json:"group_id" gorm:"default:0;not null;index"`
|
||||
Alias string `json:"alias" gorm:"default:'';not null;index"`
|
||||
TimeModel
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ type User struct {
|
||||
GroupId uint `json:"group_id" gorm:"default:0;not null;index"`
|
||||
IsAdmin *bool `json:"is_admin" gorm:"default:0;not null;"`
|
||||
Status StatusCode `json:"status" gorm:"default:1;not null;"`
|
||||
Remark string `json:"remark" gorm:"default:'';not null;"`
|
||||
TimeModel
|
||||
}
|
||||
|
||||
|
||||
@@ -33,11 +33,6 @@ description = "No access."
|
||||
one = "No access."
|
||||
other = "No access."
|
||||
|
||||
[NeedLogin]
|
||||
description = "Need login."
|
||||
one = "Please log in first."
|
||||
other = "Please log in first."
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
one = "Username or password error."
|
||||
@@ -147,14 +142,4 @@ other = "Password login disabled."
|
||||
[CannotShareToSelf]
|
||||
description = "Cannot share to self."
|
||||
one = "Cannot share to self."
|
||||
other = "Cannot share to self."
|
||||
|
||||
[Banned]
|
||||
description = "Banned."
|
||||
one = "Banned."
|
||||
other = "Banned."
|
||||
|
||||
[RegisterSuccessWaitAdminConfirm]
|
||||
description = "Register success, wait admin confirm."
|
||||
one = "Register success, wait admin confirm."
|
||||
other = "Register success, wait admin confirm."
|
||||
other = "Cannot share to self."
|
||||
@@ -33,11 +33,6 @@ description = "No access."
|
||||
one = "Sin acceso."
|
||||
other = "Sin acceso."
|
||||
|
||||
[NeedLogin]
|
||||
description = "Need login."
|
||||
one = "Por favor inicie sesión primero."
|
||||
other = "Por favor inicie sesión primero."
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
one = "Error de usuario o contraseña."
|
||||
@@ -156,14 +151,4 @@ other = "Inicio de sesión con contraseña deshabilitado."
|
||||
[CannotShareToSelf]
|
||||
description = "Cannot share to self."
|
||||
one = "No se puede compartir con uno mismo."
|
||||
other = "No se puede compartir con uno mismo."
|
||||
|
||||
[Banned]
|
||||
description = "Banned."
|
||||
one = "Prohibido."
|
||||
other = "Prohibido."
|
||||
|
||||
[RegisterSuccessWaitAdminConfirm]
|
||||
description = "Register success, wait admin confirm."
|
||||
one = "Registro exitoso, espere la confirmación del administrador."
|
||||
other = "Registro exitoso, espere la confirmación del administrador."
|
||||
other = "No se puede compartir con uno mismo."
|
||||
@@ -33,11 +33,6 @@ description = "No access."
|
||||
one = "Aucun d'access."
|
||||
other = "Aucun d'access."
|
||||
|
||||
[NeedLogin]
|
||||
description = "Need login."
|
||||
one = "Veuillez d'abord vous connecter."
|
||||
other = "Veuillez d'abord vous connecter."
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
one = "Nom d'utilisateur ou de mot de passe incorrect."
|
||||
@@ -156,14 +151,4 @@ other = "Connexion par mot de passe désactivée."
|
||||
[CannotShareToSelf]
|
||||
description = "Cannot share to self."
|
||||
one = "Impossible de partager avec soi-même."
|
||||
other = "Impossible de partager avec soi-même."
|
||||
|
||||
[Banned]
|
||||
description = "Banned."
|
||||
one = "Banni."
|
||||
other = "Banni."
|
||||
|
||||
[RegisterSuccessWaitAdminConfirm]
|
||||
description = "Register success wait admin confirm."
|
||||
one = "Inscription réussie, veuillez attendre la confirmation de l'administrateur."
|
||||
other = "Inscription réussie, veuillez attendre la confirmation de l'administrateur."
|
||||
other = "Impossible de partager avec soi-même."
|
||||
@@ -33,11 +33,6 @@ description = "No access."
|
||||
one = "접근할 수 없습니다."
|
||||
other = "접근할 수 없습니다."
|
||||
|
||||
[NeedLogin]
|
||||
description = "Need login."
|
||||
one = "먼저 로그인해주세요."
|
||||
other = "먼저 로그인해주세요."
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
one = "사용자 이름이나 비밀번호가 올바르지 않습니다."
|
||||
@@ -150,14 +145,4 @@ other = "비밀번호 로그인이 비활성화되었습니다."
|
||||
[CannotShareToSelf]
|
||||
description = "Cannot share to self."
|
||||
one = "자기 자신에게 공유할 수 없습니다."
|
||||
other = "자기 자신에게 공유할 수 없습니다."
|
||||
|
||||
[Banned]
|
||||
description = "Banned."
|
||||
one = "금지됨."
|
||||
other = "금지됨."
|
||||
|
||||
[RegisterSuccessWaitAdminConfirm]
|
||||
description = "Register success wait admin confirm."
|
||||
one = "가입 성공, 관리자 확인 대기 중."
|
||||
other = "가입 성공, 관리자 확인 대기 중."
|
||||
other = "자기 자신에게 공유할 수 없습니다."
|
||||
@@ -33,11 +33,6 @@ description = "No access."
|
||||
one = "Нет доступа."
|
||||
other = "Нет доступа."
|
||||
|
||||
[NeedLogin]
|
||||
description = "Need login."
|
||||
one = "Пожалуйста, войдите в систему."
|
||||
other = "Пожалуйста, войдите в систему."
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
one = "Неправильное имя пользователя или пароль."
|
||||
@@ -156,14 +151,4 @@ other = "Вход по паролю отключен."
|
||||
[CannotShareToSelf]
|
||||
description = "Cannot share to self."
|
||||
one = "Нельзя поделиться с собой."
|
||||
other = "Нельзя поделиться с собой."
|
||||
|
||||
[Banned]
|
||||
description = "Banned."
|
||||
one = "Заблокировано."
|
||||
other = "Заблокировано."
|
||||
|
||||
[RegisterSuccessWaitAdminConfirm]
|
||||
description = "Register success wait admin confirm."
|
||||
one = "Регистрация прошла успешно, ожидайте подтверждения администратора."
|
||||
other = "Регистрация прошла успешно, ожидайте подтверждения администратора."
|
||||
other = "Нельзя поделиться с собой."
|
||||
@@ -33,11 +33,6 @@ description = "No access."
|
||||
one = "无权限。"
|
||||
other = "无权限。"
|
||||
|
||||
[NeedLogin]
|
||||
description = "Need login."
|
||||
one = "请先登录。"
|
||||
other = "请先登录。"
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
one = "用户名或密码错误。"
|
||||
@@ -149,14 +144,4 @@ other = "密码登录已禁用。"
|
||||
[CannotShareToSelf]
|
||||
description = "Cannot share to self."
|
||||
one = "不能共享给自己。"
|
||||
other = "不能共享给自己。"
|
||||
|
||||
[Banned]
|
||||
description = "Banned."
|
||||
one = "已被封禁。"
|
||||
other = "已被封禁。"
|
||||
|
||||
[RegisterSuccessWaitAdminConfirm]
|
||||
description = "Register success, wait for admin confirm."
|
||||
one = "注册成功,请等待管理员审核。"
|
||||
other = "注册成功,请等待管理员审核。"
|
||||
other = "不能共享给自己。"
|
||||
@@ -5,8 +5,8 @@ other = "測試2 {{.P0}}"
|
||||
|
||||
[ParamsError]
|
||||
description = "Params validation failed."
|
||||
one = "參數驗證失敗。"
|
||||
other = "參數驗證失敗。"
|
||||
one = "引數錯誤。"
|
||||
other = "引數錯誤。"
|
||||
|
||||
[OperationFailed]
|
||||
description = "OperationFailed."
|
||||
@@ -20,23 +20,18 @@ other = "操作成功。"
|
||||
|
||||
[ItemExists]
|
||||
description = "Item already exists."
|
||||
one = "項目已存在。"
|
||||
other = "項目已存在。"
|
||||
one = "資料已存在。"
|
||||
other = "資料已存在。"
|
||||
|
||||
[ItemNotFound]
|
||||
description = "Item not found."
|
||||
one = "找不到項目。"
|
||||
other = "找不到項目。"
|
||||
one = "資料不存在。"
|
||||
other = "資料不存在。"
|
||||
|
||||
[NoAccess]
|
||||
description = "No access."
|
||||
one = "無權限存取。"
|
||||
other = "無權限存取。"
|
||||
|
||||
[NeedLogin]
|
||||
description = "Need login."
|
||||
one = "請先登入。"
|
||||
other = "請先登入。"
|
||||
one = "無許可權。"
|
||||
other = "無許可權。"
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
@@ -50,23 +45,24 @@ other = "系統錯誤。"
|
||||
|
||||
[ConfigNotFound]
|
||||
description = "Config not found."
|
||||
one = "找不到設定。"
|
||||
other = "找不到設定。"
|
||||
one = "配置不存在。"
|
||||
other = "配置不存在。"
|
||||
|
||||
#授權過期
|
||||
[OauthExpired]
|
||||
description = "Oauth expired."
|
||||
one = "OAuth 已過期,請重試。"
|
||||
other = "OAuth 已過期,請重試。"
|
||||
one = "授權過期,請重新授權。"
|
||||
other = "授權過期,請重新授權。"
|
||||
|
||||
[OauthFailed]
|
||||
description = "Oauth failed."
|
||||
one = "OAuth 失敗。"
|
||||
other = "OAuth 失敗。"
|
||||
one = "授權失敗。"
|
||||
other = "授權失敗。"
|
||||
|
||||
[OauthHasBindOtherUser]
|
||||
description = "Oauth has bind other user."
|
||||
one = "OAuth 已綁定其他使用者。"
|
||||
other = "OAuth 已綁定其他使用者。"
|
||||
one = "授權已繫結其他使用者。"
|
||||
other = "授權已繫結其他使用者。"
|
||||
|
||||
[ParamIsEmpty]
|
||||
description = "Param is empty."
|
||||
@@ -75,64 +71,56 @@ other = "{{.P0}} 為空。"
|
||||
|
||||
[BindFail]
|
||||
description = "Bind fail."
|
||||
one = "綁定失敗。"
|
||||
other = "綁定失敗。"
|
||||
|
||||
one = "繫結失敗。"
|
||||
other = "繫結失敗。"
|
||||
[BindSuccess]
|
||||
description = "Bind success."
|
||||
one = "綁定成功。"
|
||||
other = "綁定成功。"
|
||||
|
||||
one = "繫結成功。"
|
||||
other = "繫結成功。"
|
||||
[OauthHasBeenSuccess]
|
||||
description = "Oauth has been success."
|
||||
one = "OAuth 已成功。"
|
||||
other = "OAuth 已成功。"
|
||||
|
||||
one = "授權已成功。"
|
||||
other = "授權已成功。"
|
||||
[OauthSuccess]
|
||||
description = "Oauth success."
|
||||
one = "OAuth 成功。"
|
||||
other = "OAuth 成功。"
|
||||
|
||||
one = "授權成功。"
|
||||
other = "授權成功。"
|
||||
[OauthRegisterSuccess]
|
||||
description = "Oauth register success."
|
||||
one = "OAuth 註冊成功。"
|
||||
other = "OAuth 註冊成功。"
|
||||
|
||||
one = "授權註冊成功。"
|
||||
other = "授權註冊成功。"
|
||||
[OauthRegisterFailed]
|
||||
description = "Oauth register failed."
|
||||
one = "OAuth 註冊失敗。"
|
||||
other = "OAuth 註冊失敗。"
|
||||
|
||||
one = "授權註冊失敗。"
|
||||
other = "授權註冊失敗。"
|
||||
[GetOauthTokenError]
|
||||
description = "Get oauth token error."
|
||||
one = "取得 OAuth 權杖錯誤。"
|
||||
other = "取得 OAuth 權杖錯誤。"
|
||||
|
||||
one = "獲取授權token失敗。"
|
||||
other = "獲取授權token失敗。"
|
||||
[GetOauthUserInfoError]
|
||||
description = "Get oauth user info error."
|
||||
one = "取得 OAuth 使用者資訊錯誤。"
|
||||
other = "取得 OAuth 使用者資訊錯誤。"
|
||||
|
||||
one = "獲取授權使用者資訊失敗。"
|
||||
other = "獲取授權使用者資訊失敗。"
|
||||
[DecodeOauthUserInfoError]
|
||||
description = "Decode oauth user info error."
|
||||
one = "解析 OAuth 使用者資訊錯誤。"
|
||||
other = "解析 OAuth 使用者資訊錯誤。"
|
||||
one = "解析授權使用者資訊失敗。"
|
||||
other = "解析授權使用者資訊失敗。"
|
||||
|
||||
[OldPasswordError]
|
||||
description = "Old password error."
|
||||
one = "舊密碼錯誤。"
|
||||
other = "舊密碼錯誤。"
|
||||
|
||||
|
||||
[DefaultGroup]
|
||||
description = "Default group."
|
||||
one = "預設群組"
|
||||
other = "預設群組"
|
||||
one = "預設組"
|
||||
other = "預設組"
|
||||
|
||||
[ShareGroup]
|
||||
description = "Share group."
|
||||
one = "共享群組"
|
||||
other = "共享群組"
|
||||
|
||||
one = "共享組"
|
||||
other = "共享組"
|
||||
[RegisterClosed]
|
||||
description = "Register closed."
|
||||
one = "註冊已關閉。"
|
||||
@@ -150,20 +138,10 @@ other = "驗證碼錯誤。"
|
||||
|
||||
[PwdLoginDisabled]
|
||||
description = "Password login disabled."
|
||||
one = "密碼登入已停用。"
|
||||
other = "密碼登入已停用。"
|
||||
one = "密碼登錄已禁用。"
|
||||
other = "密碼登錄已禁用。"
|
||||
|
||||
[CannotShareToSelf]
|
||||
description = "Cannot share to self."
|
||||
one = "無法分享給自己。"
|
||||
other = "無法分享給自己。"
|
||||
|
||||
[Banned]
|
||||
description = "Banned."
|
||||
one = "已被禁用。"
|
||||
other = "已被禁用。"
|
||||
|
||||
[RegisterSuccessWaitAdminConfirm]
|
||||
description = "Register success, wait admin confirm."
|
||||
one = "註冊成功,等待管理員確認。"
|
||||
other = "註冊成功,等待管理員確認。"
|
||||
one = "無法共享給自己。"
|
||||
other = "無法共享給自己。"
|
||||
@@ -62,7 +62,7 @@
|
||||
var title = 'OauthFailed'
|
||||
var msg = '{{.message}}'
|
||||
var btn = 'Close'
|
||||
document.writeln('<script src="/api/oidc/msg?lang=' + lang + '&msg=' + msg + '&title=OauthFailed"><\/script>');
|
||||
document.writeln('<script src="/api/oauth/msg?lang=' + lang + '&msg=' + msg + '&title=OauthFailed"><\/script>');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
var title = 'OauthSuccess'
|
||||
var msg = '{{.message}}'
|
||||
var btn = 'Close'
|
||||
document.writeln('<script src="/api/oidc/msg?lang=' + lang + '&msg=' + msg + '&title=OauthSuccess"><\/script>');
|
||||
document.writeln('<script src="/api/oauth/msg?lang=' + lang + '&msg=' + msg + '&title=OauthSuccess"><\/script>');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
1
resources/web2/assets/AssetManifest.bin
vendored
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
resources/web2/assets/AssetManifest.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"assets/actions.svg":["assets/actions.svg"],"assets/actions_mobile.svg":["assets/actions_mobile.svg"],"assets/address_book.ttf":["assets/address_book.ttf"],"assets/android.svg":["assets/android.svg"],"assets/arrow.svg":["assets/arrow.svg"],"assets/auth-apple.svg":["assets/auth-apple.svg"],"assets/auth-auth0.svg":["assets/auth-auth0.svg"],"assets/auth-azure.svg":["assets/auth-azure.svg"],"assets/auth-default.svg":["assets/auth-default.svg"],"assets/auth-facebook.svg":["assets/auth-facebook.svg"],"assets/auth-github.svg":["assets/auth-github.svg"],"assets/auth-gitlab.svg":["assets/auth-gitlab.svg"],"assets/auth-google.svg":["assets/auth-google.svg"],"assets/auth-okta.svg":["assets/auth-okta.svg"],"assets/call_end.svg":["assets/call_end.svg"],"assets/call_wait.svg":["assets/call_wait.svg"],"assets/chat.svg":["assets/chat.svg"],"assets/chat2.svg":["assets/chat2.svg"],"assets/checkbox-outline.svg":["assets/checkbox-outline.svg"],"assets/chevron_up_chevron_down.svg":["assets/chevron_up_chevron_down.svg"],"assets/close.svg":["assets/close.svg"],"assets/display.svg":["assets/display.svg"],"assets/dots.svg":["assets/dots.svg"],"assets/file.svg":["assets/file.svg"],"assets/file_transfer.svg":["assets/file_transfer.svg"],"assets/folder.svg":["assets/folder.svg"],"assets/folder_new.svg":["assets/folder_new.svg"],"assets/fullscreen.svg":["assets/fullscreen.svg"],"assets/fullscreen_exit.svg":["assets/fullscreen_exit.svg"],"assets/gestures.ttf":["assets/gestures.ttf"],"assets/home.svg":["assets/home.svg"],"assets/icon.svg":["assets/icon.svg"],"assets/insecure.svg":["assets/insecure.svg"],"assets/insecure_relay.svg":["assets/insecure_relay.svg"],"assets/kb_layout_iso.svg":["assets/kb_layout_iso.svg"],"assets/kb_layout_not_iso.svg":["assets/kb_layout_not_iso.svg"],"assets/keyboard.svg":["assets/keyboard.svg"],"assets/linux.svg":["assets/linux.svg"],"assets/mac.svg":["assets/mac.svg"],"assets/message_24dp_5F6368.svg":["assets/message_24dp_5F6368.svg"],"assets/peer_searchbar.ttf":["assets/peer_searchbar.ttf"],"assets/pinned.svg":["assets/pinned.svg"],"assets/rec.svg":["assets/rec.svg"],"assets/record_screen.svg":["assets/record_screen.svg"],"assets/refresh.svg":["assets/refresh.svg"],"assets/scam.png":["assets/scam.png"],"assets/screen.svg":["assets/screen.svg"],"assets/search.svg":["assets/search.svg"],"assets/secure.svg":["assets/secure.svg"],"assets/secure_relay.svg":["assets/secure_relay.svg"],"assets/tabbar.ttf":["assets/tabbar.ttf"],"assets/transfer.svg":["assets/transfer.svg"],"assets/trash.svg":["assets/trash.svg"],"assets/unpinned.svg":["assets/unpinned.svg"],"assets/voice_call.svg":["assets/voice_call.svg"],"assets/voice_call_waiting.svg":["assets/voice_call_waiting.svg"],"assets/win.svg":["assets/win.svg"],"packages/dash_chat_2/assets/placeholder.png":["packages/dash_chat_2/assets/placeholder.png"],"packages/dash_chat_2/assets/profile_placeholder.png":["packages/dash_chat_2/assets/profile_placeholder.png"],"packages/flex_color_picker/assets/opacity.png":["packages/flex_color_picker/assets/opacity.png"],"packages/wakelock_plus/assets/no_sleep.js":["packages/wakelock_plus/assets/no_sleep.js"],"packages/window_manager/images/ic_chrome_close.png":["packages/window_manager/images/ic_chrome_close.png"],"packages/window_manager/images/ic_chrome_maximize.png":["packages/window_manager/images/ic_chrome_maximize.png"],"packages/window_manager/images/ic_chrome_minimize.png":["packages/window_manager/images/ic_chrome_minimize.png"],"packages/window_manager/images/ic_chrome_unmaximize.png":["packages/window_manager/images/ic_chrome_unmaximize.png"]}
|
||||
42
resources/web2/assets/FontManifest.json
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
[
|
||||
{
|
||||
"family": "MaterialIcons",
|
||||
"fonts": [
|
||||
{
|
||||
"asset": "fonts/MaterialIcons-Regular.otf"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"family": "GestureIcons",
|
||||
"fonts": [
|
||||
{
|
||||
"asset": "assets/gestures.ttf"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"family": "Tabbar",
|
||||
"fonts": [
|
||||
{
|
||||
"asset": "assets/tabbar.ttf"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"family": "PeerSearchbar",
|
||||
"fonts": [
|
||||
{
|
||||
"asset": "assets/peer_searchbar.ttf"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"family": "AddressBook",
|
||||
"fonts": [
|
||||
{
|
||||
"asset": "assets/address_book.ttf"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
1
resources/web2/assets/assets/actions.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="496.063 521.772 32 32"><path fill="none" d="M496.063 521.772h32v32h-32v-32Z"/><path d="m513.817 535.858.87-8.052c.136-1.26-.279-1.399-.927-.31l-6.856 11.532c-.216.363-.049.658.374.658h3.031l-.87 8.052c-.136 1.26.279 1.399.927.309l6.856-11.531c.216-.363.048-.658-.374-.658h-3.031Z"/></svg>
|
||||
|
After Width: | Height: | Size: 386 B |
1
resources/web2/assets/assets/actions_mobile.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="91.748 41.508 32 32"><path fill="none" d="M91.748 41.508h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M104.884 48.3h5.728c1.363 0 2.47.94 2.47 2.098v11.448c0 1.158-1.107 2.098-2.47 2.098h-5.728c-1.363 0-2.469-.94-2.469-2.098V50.398c0-1.158 1.106-2.098 2.469-2.098Zm-.004-2.692h5.729a5.162 5.162 0 0 1 5.164 5.164v13.472a5.164 5.164 0 0 1-1.514 3.649 5.143 5.143 0 0 1-3.65 1.515h-5.729a5.164 5.164 0 0 1-5.157-5.164V50.772c0-1.374.538-2.687 1.508-3.656a5.182 5.182 0 0 1 3.649-1.508Zm1.407 21.076a1.462 1.462 0 0 1 2.922 0 1.461 1.461 0 0 1-2.922 0Z"/></svg>
|
||||
|
After Width: | Height: | Size: 657 B |
BIN
resources/web2/assets/assets/address_book.ttf
vendored
Normal file
1
resources/web2/assets/assets/android.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="553" height="553"><path fill="#fff" d="M77 179a33 33 0 0 0-25 10 33 33 0 0 0-9 24v143a33 33 0 0 0 10 24 33 33 0 0 0 24 10c9 0 17-3 24-10a33 33 0 0 0 10-24V213c0-9-4-17-10-24a33 33 0 0 0-24-10zM352 51l24-44c1-3 1-5-2-6-3-2-5-1-7 2l-24 43a163 163 0 0 0-133 0L186 3c-2-3-4-4-7-2-2 1-3 3-1 6l23 44c-24 12-43 29-57 51a129 129 0 0 0-21 72h307c0-26-7-50-21-72a146 146 0 0 0-57-51zm-136 63a13 13 0 0 1-10 4 13 13 0 0 1-12-13c0-4 1-7 3-9 3-3 6-4 9-4s7 1 10 4c2 2 3 5 3 9s-1 7-3 9zm140 0a12 12 0 0 1-9 4c-4 0-7-1-9-4a12 12 0 0 1-4-9c0-4 1-7 4-9 2-3 5-4 9-4a12 12 0 0 1 9 4c2 2 3 5 3 9s-1 7-3 9zM124 407c0 10 4 19 11 26s15 10 26 10h24v76c0 9 4 17 10 24s15 10 24 10c10 0 18-3 25-10s10-15 10-24v-76h45v76c0 9 4 17 10 24s15 10 25 10c9 0 17-3 24-10s10-15 10-24v-76h25a35 35 0 0 0 25-10c7-7 11-16 11-26V185H124v222zm352-228a33 33 0 0 0-24 10 33 33 0 0 0-10 24v143a34 34 0 0 0 34 34c10 0 18-3 25-10s10-15 10-24V213c0-9-4-17-10-24a33 33 0 0 0-25-10z"/></svg>
|
||||
|
After Width: | Height: | Size: 952 B |
1
resources/web2/assets/assets/arrow.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="305.118 110.478 32 32"><path fill="none" d="M305.118 110.478h32v32h-32v-32Z"/><path d="m322.26 126.052-5.963-5.962a1.48 1.48 0 1 1 2.093-2.093l7.63 7.63c.47.47.47 1.233 0 1.703l-7.63 7.629a1.48 1.48 0 0 1-2.093 0 1.482 1.482 0 0 1 0-2.093l5.963-5.962a.603.603 0 0 0 0-.852Z"/></svg>
|
||||
|
After Width: | Height: | Size: 380 B |
1
resources/web2/assets/assets/auth-apple.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><circle cx="512" cy="512" r="512" fill="#999"/><path fill="#fff" d="M407.2 722.1c-10.1-6.7-19-15-26.5-24.5-8.2-9.9-15.7-20.3-22.7-31-16.3-23.9-29.1-50-38-77.5-10.7-32-15.8-62.7-15.8-92.7 0-33.5 7.2-62.7 21.4-87.2 10.4-19.2 26-35.2 44.8-46.5 18.1-11.3 39.2-17.5 60.6-17.9 7.5 0 15.6 1.1 24.1 3.2 6.2 1.7 13.6 4.5 22.8 7.9 11.7 4.5 18.1 7.2 20.3 7.9 6.8 2.6 12.6 3.6 17.1 3.6 3.4 0 8.3-1.1 13.8-2.8 3.1-1.1 9-3 17.3-6.6 8.2-3 14.8-5.5 19.9-7.5 7.9-2.3 15.5-4.5 22.4-5.5 8.3-1.3 16.6-1.7 24.5-1.1 15.1 1.1 29 4.3 41.4 9 21.7 8.7 39.3 22.4 52.4 41.8-5.5 3.4-10.7 7.4-15.5 11.7-10.4 9.2-19.2 20-26.2 32.1-9.2 16.4-13.9 35-13.7 53.7.3 23.1 6.2 43.4 17.9 61 8.3 12.8 19.3 23.8 32.7 32.7 6.6 4.5 12.4 7.6 17.9 9.6-2.6 8-5.4 15.8-8.6 23.5-7.4 17.2-16.2 33.7-26.7 49.3-9.2 13.4-16.5 23.5-22 30.1-8.6 10.2-16.8 17.9-25.2 23.4-9.2 6.1-19.9 9.3-31 9.3-7.5.3-14.9-.6-22-2.7-6.2-2-12.3-4.3-18.3-6.9-6.2-2.9-12.7-5.3-19.3-7.2-8.1-2.1-16.4-3.2-24.8-3.1-8.5 0-16.8 1.1-24.7 3.1-6.6 1.9-13 4.2-19.3 6.9-9 3.7-14.8 6.2-18.2 7.2-6.9 2-14 3.3-21.1 3.7-11.1 0-21.4-3.2-31.7-9.6zm146.1-393.6c-14.5 7.2-28.3 10.3-42.1 9.3-2.1-13.8 0-27.9 5.8-43.4 5.1-13.2 11.9-25.2 21.3-35.8 9.8-11.1 21.5-20.3 34.8-26.9 14.1-7.2 27.5-11.1 40.3-11.7 1.7 14.5 0 28.8-5.3 44.1-4.9 13.6-12.1 26.2-21.3 37.5-9.3 11.1-20.8 20.3-33.8 26.9z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
resources/web2/assets/assets/auth-auth0.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="32" height="32"><path d="M29.307 9.932 26.161 0H5.796L2.692 9.932c-1.802 5.75.042 12.271 5.089 16.021L16.01 32l8.208-6.068c5.005-3.75 6.911-10.25 5.089-16.021l-8.214 6.104 3.12 9.938-8.208-6.13-8.208 6.104 3.141-9.911-8.25-6.063 10.177-.063 3.146-9.891 3.141 9.87z"/></svg>
|
||||
|
After Width: | Height: | Size: 285 B |
1
resources/web2/assets/assets/auth-azure.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="199"><path fill="#0089d6" d="M118.432 187.698c32.89-5.81 60.055-10.618 60.367-10.684l.568-.12-31.052-36.935c-17.078-20.314-31.051-37.014-31.051-37.11 0-.182 32.063-88.477 32.243-88.792.06-.105 21.88 37.567 52.893 91.32 29.035 50.323 52.973 91.815 53.195 92.203l.405.707-98.684-.012-98.684-.013 59.8-10.564zM0 176.435c0-.052 14.631-25.451 32.514-56.442l32.514-56.347 37.891-31.799C123.76 14.358 140.867.027 140.935.001c.069-.026-.205.664-.609 1.534s-18.919 40.582-41.145 88.25l-40.41 86.67-29.386.037c-16.162.02-29.385-.005-29.385-.057z"/></svg>
|
||||
|
After Width: | Height: | Size: 604 B |
1
resources/web2/assets/assets/auth-default.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120"><path d="M142.554 52.81c0-4.113 1.078-6.374 5.369-11.26 17.207-19.593 57.193-19.593 74.4 0 4.291 4.886 5.37 7.147 5.37 11.26v5.145h-85.14zm71.239-42.863 6.676-6.692 10.462 10.74 25.49-25.453 6.133 6.543-31.536 32.356-17.225-17.494Zm-34.474 3.377c-15.027-5.337-19.348-22.264-8.57-33.575 10.85-11.387 29.85-6.099 34.149 9.503 2.523 9.161-4.38 21.951-12.951 23.995-4.39 1.58-8.73 1.433-12.628.077z" style="fill:#024eff;fill-opacity:1;stroke-width:.999998" transform="translate(-142.554 44.365)"/></svg>
|
||||
|
After Width: | Height: | Size: 564 B |
1
resources/web2/assets/assets/auth-facebook.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><rect width="512" height="512" fill="#1877f2" rx="76.8"/><path fill="#fff" d="m355.6 330 11.4-74h-71v-48c0-20.2 9.9-40 41.7-40H370v-63s-29.3-5-57.3-5c-58.5 0-96.7 35.4-96.7 99.6V256h-65v74h65v182h80V330z"/></svg>
|
||||
|
After Width: | Height: | Size: 274 B |
1
resources/web2/assets/assets/auth-github.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 24 24"><path fill="#231f20" d="M12 1A10.89 10.89 0 0 0 1 11.77 10.79 10.79 0 0 0 8.52 22c.55.1.75-.23.75-.52v-1.83c-3.06.65-3.71-1.44-3.71-1.44a2.86 2.86 0 0 0-1.22-1.58c-1-.66.08-.65.08-.65a2.31 2.31 0 0 1 1.68 1.11 2.37 2.37 0 0 0 3.2.89 2.33 2.33 0 0 1 .7-1.44c-2.44-.27-5-1.19-5-5.32a4.15 4.15 0 0 1 1.11-2.91 3.78 3.78 0 0 1 .11-2.84s.93-.29 3 1.1a10.68 10.68 0 0 1 5.5 0c2.1-1.39 3-1.1 3-1.1a3.78 3.78 0 0 1 .11 2.84A4.15 4.15 0 0 1 19 11.2c0 4.14-2.58 5.05-5 5.32a2.5 2.5 0 0 1 .75 2v2.95s.2.63.75.52A10.8 10.8 0 0 0 23 11.77 10.89 10.89 0 0 0 12 1"/></svg>
|
||||
|
After Width: | Height: | Size: 582 B |
1
resources/web2/assets/assets/auth-gitlab.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="236" preserveAspectRatio="xMidYMid"><path fill="#e24329" d="m128.075 236.075 47.104-144.97H80.97z"/><path fill="#fc6d26" d="M128.075 236.074 80.97 91.104H14.956z"/><path fill="#fca326" d="M14.956 91.104.642 135.16a9.752 9.752 0 0 0 3.542 10.903l123.891 90.012z"/><path fill="#e24329" d="M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0z"/><path fill="#fc6d26" d="m128.075 236.074 47.104-144.97h66.015z"/><path fill="#fca326" d="m241.194 91.104 14.314 44.056a9.752 9.752 0 0 1-3.543 10.903l-123.89 90.012z"/><path fill="#e24329" d="M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0z"/></svg>
|
||||
|
After Width: | Height: | Size: 684 B |
1
resources/web2/assets/assets/auth-google.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="48" height="48"><path fill="#ffc107" d="M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917z"/><path fill="#ff3d00" d="m6.306 14.691 6.571 4.819C14.655 15.108 18.961 12 24 12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691z"/><path fill="#4caf50" d="M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238A11.91 11.91 0 0 1 24 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44z"/><path fill="#1976d2" d="M43.611 20.083H42V20H24v8h11.303a12.04 12.04 0 0 1-4.087 5.571l.003-.002 6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917z"/></svg>
|
||||
|
After Width: | Height: | Size: 846 B |
1
resources/web2/assets/assets/auth-okta.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="293.333" height="98.667" version="1.0" viewBox="0 0 220 74"><path fill="#fff" d="M62.7.6c-.4.4-.7 16.5-.7 35.9 0 26 .3 35.4 1.2 36.3 1.3 1.3 8.5 1.6 11.2.6 1.3-.5 1.6-2.4 1.6-10 0-13.3.7-13.3 13.8-.1L100.3 74h6.7c11.5 0 11.3-1-2.8-15.4-6.7-6.7-12.2-13-12.2-13.9 0-1 3.7-5.8 8.3-10.8 13.3-14.7 13.3-14.9 2.4-14.9h-7.2l-7.9 8.6c-4.8 5.2-8.5 8.4-9.5 8.2-1.4-.3-1.7-2.7-2.1-17.8L75.5.5l-6-.3c-3.4-.2-6.4 0-6.8.4zm55.7.7c-.3.8-.4 12.7-.2 26.4l.3 25 3 5.8c5 9.8 16.3 16.5 26 15.3 2.8-.3 3-.6 3.3-4.7.5-7.5-.3-9.1-4.6-9.1-5 0-10.2-2.9-12.4-7.1-2.1-4-2.6-17.7-.6-19.7.7-.7 4.2-1.2 8.5-1.2h7.3V19h-7.2c-4 0-7.8-.4-8.5-.8-.7-.5-1.3-4-1.5-9.2l-.3-8.5-6.3-.3c-4.7-.2-6.4.1-6.8 1.1zm-99.9 19C6.6 25.1.6 33.6.6 46c-.1 6.2.4 8.4 2.6 12.5 5.2 9.9 13.4 14.9 24.3 14.8 8.2 0 12.8-1.8 18.6-7 5.4-4.9 8.1-10.4 8.7-17.9.8-11-4.1-20.5-13.5-26.1-3.7-2.1-6.1-2.7-12.2-3-4.5-.1-8.9.2-10.6 1zm15.2 13.6c7 3.2 9.6 11.7 5.9 18.9-3.4 6.6-11.2 8.9-18.3 5.5-10-4.7-9.5-19.4.7-24.5 4.4-2.3 6.5-2.2 11.7.1zm137.6-13.2c-5.1 1.8-12.2 8.3-14.7 13.7-4.5 9.6-2.7 21.8 4.5 29.9 5.6 6.4 11.7 9.1 20.4 9.1 5.9 0 7.9-.4 12.8-3.1 3.1-1.7 5.7-2.7 5.7-2.3 0 .5 1.5 1.8 3.4 2.9 4.2 2.7 11.6 3.7 14.5 2.2 1.9-1.1 2.2-1.9 1.9-6.9-.3-5.5-.4-5.6-3.8-6.5-6.3-1.6-6.4-1.9-7-22l-.5-18.2-6.3-.3c-4.6-.2-6.4.1-6.8 1.1-.4 1.2-1.1 1.2-4.2.1-4.9-1.7-14.7-1.6-19.9.3zm15 12.7c5.4 2.2 8.7 7 8.7 12.4 0 10.9-9.3 17-19.5 12.8-7.5-3.2-10.1-14.4-4.8-20.7 2.7-3.2 7.4-5.8 10.6-5.9 1 0 3.2.6 5 1.4z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
resources/web2/assets/assets/call_end.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="587.811 560.459 32 32"><path fill="none" d="M587.811 560.459h32v32h-32v-32Z"/><path fill-rule="evenodd" d="m601.469 580.246-3.859 3.858a1.02 1.02 0 1 1-1.444-1.444l3.858-3.859 2.554-2.553 3.85-3.851a1.022 1.022 0 0 1 1.445 1.445l-3.851 3.85 2.299 2.299a1.23 1.23 0 0 0 1.717.014q3.089-2.988 6.218-.117.03.026.089.083c.34.34.527.8.527 1.276a1.78 1.78 0 0 1-.528 1.277l-1.366 1.366a5.557 5.557 0 0 1-7.861.004l-3.648-3.648Zm-.923-6.031-.267-.266a1.23 1.23 0 0 1-.014-1.717q2.988-3.09.117-6.218-.026-.031-.083-.089c-.341-.34-.8-.527-1.276-.527a1.78 1.78 0 0 0-1.277.528l-1.366 1.366a5.555 5.555 0 0 0-.004 7.861l1.616 1.616a.832.832 0 0 0 1.175 0l1.379-1.378a.833.833 0 0 0 0-1.176Z"/></svg>
|
||||
|
After Width: | Height: | Size: 786 B |
1
resources/web2/assets/assets/call_wait.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="587.811 592.459 32 32"><path fill="none" d="M587.811 592.459h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M595.385 608.153a5.553 5.553 0 0 1 .004-7.852l1.365-1.365c.34-.34.795-.531 1.275-.527.476 0 .935.187 1.275.526l.083.089q2.868 3.125-.117 6.212a1.226 1.226 0 0 0 .014 1.714l6.036 6.036a1.226 1.226 0 0 0 1.714.014q3.086-2.985 6.212-.117l.089.083c.339.34.526.799.526 1.275.004.48-.187.935-.527 1.275l-1.365 1.365a5.553 5.553 0 0 1-7.852.004l-8.732-8.732Zm7.426-1.824a1.215 1.215 0 1 1 2.43 0 1.215 1.215 0 0 1-2.43 0Zm3.811 0a1.215 1.215 0 1 1 2.43 0 1.215 1.215 0 0 1-2.43 0Zm3.811 0a1.215 1.215 0 1 1 2.43 0 1.215 1.215 0 0 1-2.43 0Z"/></svg>
|
||||
|
After Width: | Height: | Size: 746 B |
1
resources/web2/assets/assets/chat.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="587.811 521.772 32 32"><path fill="none" d="M587.811 521.772h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M601.822 543.465h7.624a3.94 3.94 0 0 0 3.942-3.938v-7.213a3.944 3.944 0 0 0-3.942-3.942h-11.27a3.944 3.944 0 0 0-3.942 3.942v7.213a3.944 3.944 0 0 0 2.901 3.798v2.543c0 1.413.787 1.726 1.757.699l2.93-3.102Zm-1.593-7.668a2.203 2.203 0 0 1 .001-3.112l.541-.541a.714.714 0 0 1 1.011 0l.033.035q1.136 1.239-.047 2.462a.486.486 0 0 0 .006.679l2.392 2.392c.186.186.49.189.679.006q1.224-1.183 2.462-.046l.035.033a.71.71 0 0 1 0 1.01l-.541.541a2.199 2.199 0 0 1-3.112.002l-3.46-3.461Z"/></svg>
|
||||
|
After Width: | Height: | Size: 690 B |
1
resources/web2/assets/assets/chat2.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="#fff"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10a9.96 9.96 0 0 1-4.644-1.142l-4.29 1.117a.85.85 0 0 1-1.037-1.036l1.116-4.289A9.959 9.959 0 0 1 2 12C2 6.477 6.477 2 12 2Zm1.252 11H8.75l-.102.007a.75.75 0 0 0 0 1.486l.102.007h4.502l.101-.007a.75.75 0 0 0 0-1.486L13.252 13Zm1.998-3.5h-6.5l-.102.007a.75.75 0 0 0 0 1.486L8.75 11h6.5l.102-.007a.75.75 0 0 0 0-1.486L15.25 9.5Z"/></svg>
|
||||
|
After Width: | Height: | Size: 462 B |
1
resources/web2/assets/assets/checkbox-outline.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1696255389449" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1922" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M435.2 704c-9 0-17.8-3.8-23.8-10.6l-115.2-128c-11.8-13.2-10.8-33.4 2.4-45.2 13.2-11.8 33.4-10.8 45.2 2.4l90.6 100.6 245.2-291.8c11.4-13.6 31.6-15.2 45-4 13.6 11.4 15.2 31.6 4 45l-268.8 320c-6 7-14.6 11.2-24 11.4-0.2 0.2-0.4 0.2-0.6 0.2z" p-id="1923"></path><path d="M800 928H224c-70.6 0-128-57.4-128-128V224c0-70.6 57.4-128 128-128h576c70.6 0 128 57.4 128 128v576c0 70.6-57.4 128-128 128zM224 160c-35.2 0-64 28.8-64 64v576c0 35.2 28.8 64 64 64h576c35.2 0 64-28.8 64-64V224c0-35.2-28.8-64-64-64H224z" p-id="1924"></path></svg>
|
||||
|
After Width: | Height: | Size: 856 B |
1
resources/web2/assets/assets/chevron_up_chevron_down.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1696245886035" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4133" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 132.717714c-9.435429 0-18.852571 3.84-29.147429 12.434286L194.011429 379.574857c-7.277714 6.418286-11.556571 15.433143-11.556572 28.288 0 22.272 16.713143 39.003429 39.424 39.003429 8.996571 0 18.432-3.437714 28.288-11.154286L512 222.281143l261.851429 213.430857c9.874286 7.716571 19.291429 11.154286 28.708571 11.154286 22.308571 0 39.003429-16.731429 39.003429-39.003429 0-12.854857-4.278857-21.869714-11.556572-28.288L541.147429 144.713143c-10.294857-8.137143-19.291429-11.995429-29.147429-11.995429z m0 758.564572c9.856 0 18.852571-3.84 29.147429-11.995429L829.988571 644.425143c7.277714-6.418286 11.556571-15.433143 11.556572-28.288 0-22.272-16.713143-39.424-38.985143-39.424-9.435429 0-18.870857 3.858286-28.708571 11.574857L512 801.718857 250.148571 588.288c-9.874286-7.716571-19.291429-11.574857-28.288-11.574857-22.710857 0-39.424 17.152-39.424 39.424 0 12.854857 4.278857 21.869714 11.556572 28.288l288.859428 234.422857c10.294857 8.594286 19.712 12.434286 29.147429 12.434286z" p-id="4134"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
resources/web2/assets/assets/close.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="679.559 521.772 32 32"><path fill="none" d="M679.559 521.772h32v32h-32v-32Z"/><path d="m695.559 536.034-5.305-5.305a1.229 1.229 0 1 0-1.738 1.738l5.305 5.305-5.305 5.305a1.229 1.229 0 0 0 0 1.738 1.23 1.23 0 0 0 1.738 0l5.305-5.305 5.305 5.305a1.229 1.229 0 1 0 1.738-1.738l-5.305-5.305 5.305-5.305a1.229 1.229 0 1 0-1.738-1.738l-5.305 5.305Z"/></svg>
|
||||
|
After Width: | Height: | Size: 449 B |
1
resources/web2/assets/assets/display.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="450.189 521.772 32 32"><path fill="none" d="M450.189 521.772h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M470.477 545.236h2.795a5.13 5.13 0 0 0 3.639-1.515 5.126 5.126 0 0 0 1.515-3.639v-9.07a5.126 5.126 0 0 0-1.515-3.639 5.13 5.13 0 0 0-3.639-1.515h-14.166a5.13 5.13 0 0 0-3.639 1.515 5.127 5.127 0 0 0-1.516 3.639v9.07c0 1.363.544 2.675 1.516 3.639a5.13 5.13 0 0 0 3.639 1.515h2.795v1.234a3.217 3.217 0 0 0 3.216 3.216h2.144a3.217 3.217 0 0 0 3.216-3.216v-1.234Zm-11.371-15.753h14.166c.406 0 .79.166 1.08.449.283.29.449.674.449 1.08v9.07c0 .406-.166.79-.449 1.08-.29.283-.674.449-1.08.449h-14.166c-.406 0-.79-.166-1.08-.449a1.55 1.55 0 0 1-.45-1.08v-9.07c0-.406.167-.79.45-1.08.29-.283.674-.449 1.08-.449Z"/></svg>
|
||||
|
After Width: | Height: | Size: 816 B |
1
resources/web2/assets/assets/dots.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="105.516 106.603 32 32"><path fill="none" d="M105.516 106.603h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M118.954 115.165a2.563 2.563 0 0 1 2.562-2.562 2.563 2.563 0 0 1 0 5.124 2.563 2.563 0 0 1-2.562-2.562Zm0 7.438a2.563 2.563 0 0 1 2.562-2.562 2.563 2.563 0 0 1 0 5.124 2.563 2.563 0 0 1-2.562-2.562Zm0 7.438a2.563 2.563 0 0 1 2.562-2.562 2.563 2.563 0 0 1 0 5.124 2.563 2.563 0 0 1-2.562-2.562Z"/></svg>
|
||||
|
After Width: | Height: | Size: 507 B |
1
resources/web2/assets/assets/file.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="187.624 70.761 32 32"><path fill="none" d="M187.624 70.761h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M199.771 89.326h7.706a.847.847 0 0 1 0 1.693h-7.706a.847.847 0 0 1 0-1.693Zm0-3.412h7.706a.848.848 0 0 1 0 1.694h-7.706a.848.848 0 0 1 0-1.694Zm-2.836-4.797v11.289a2.845 2.845 0 0 0 2.845 2.842h7.688a2.845 2.845 0 0 0 2.845-2.842V81.117a2.846 2.846 0 0 0-2.845-2.843h-7.688a2.846 2.846 0 0 0-2.845 2.843Zm2.836 1.386h7.706a.847.847 0 0 1 0 1.693h-7.706a.847.847 0 0 1 0-1.693Z"/></svg>
|
||||
|
After Width: | Height: | Size: 588 B |
1
resources/web2/assets/assets/file_transfer.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1694049173782" class="icon" viewBox="0 0 1024 1024" width="24" height="24" fill="#fff" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="992" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><path d="M891.64 184.73H620.41c-27.41 0-54.41-7.77-77.32-22.5L428.13 87.36C402.77 71 372.91 62 342.64 62H131.95C93.5 62 62 93.5 62 132.36v759.68C62 930.91 93.5 962 131.95 962h759.68c38.86 0 70.36-31.09 70.36-69.96V255.09c0.01-38.86-31.49-70.36-70.35-70.36zM480.5 753.77c0 16.77-13.5 30.68-30.68 30.68-16.77 0-30.68-13.91-30.68-30.68V523.04l-31.91 55.64c-8.59 14.32-27.41 19.64-42.14 11.04-14.32-8.59-19.64-27.41-11.05-41.73l89.18-154.64c6.96-12.27 21.27-18 34.77-14.32 13.09 3.27 22.5 15.55 22.5 29.45v345.29z m209.04-139.5l-89.18 154.64c-5.32 9.82-15.55 15.55-26.59 15.55-2.46 0-5.32-0.41-7.77-1.23-13.5-3.68-22.91-15.55-22.91-29.46V408.5c0-16.77 13.91-30.68 30.68-30.68 17.18 0 30.68 13.91 30.68 30.68v230.73l31.91-55.64c8.59-14.73 27.41-19.64 42.14-11.05 14.73 8.6 19.64 27.01 11.04 41.73z" p-id="993"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
resources/web2/assets/assets/folder.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="129.858 75.669 32 32"><path fill="none" d="M129.858 75.669h32v32h-32v-32Z"/><path d="M138.617 99.535H153.1a2.76 2.76 0 0 0 2.758-2.758V89.32a2.76 2.76 0 0 0-2.758-2.759h-5.397a.552.552 0 0 1-.552-.552v-.827a1.38 1.38 0 0 0-1.379-1.38h-5.776c-.761 0-1.816.437-2.355.976l-.808.808c-.538.538-.975 1.593-.975 2.354v8.837a2.76 2.76 0 0 0 2.759 2.758Z"/></svg>
|
||||
|
After Width: | Height: | Size: 452 B |
1
resources/web2/assets/assets/folder_new.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="59.535 106.603 32 32"><path fill="none" d="M59.535 106.603h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M68.294 130.469h14.482a2.76 2.76 0 0 0 2.759-2.758v-7.457a2.76 2.76 0 0 0-2.759-2.759H77.38a.552.552 0 0 1-.552-.551v-.828a1.38 1.38 0 0 0-1.379-1.379h-5.776c-.761 0-1.816.437-2.355.975l-.808.808c-.538.538-.975 1.593-.975 2.355v8.836a2.76 2.76 0 0 0 2.759 2.758Zm11.948-5.308h1.682a.794.794 0 1 0 0-1.586h-1.682v-1.683a.794.794 0 1 0-1.587 0v1.683h-1.683a.794.794 0 1 0 0 1.586h1.683v1.683a.795.795 0 0 0 1.587 0v-1.683Z"/></svg>
|
||||
|
After Width: | Height: | Size: 632 B |
1
resources/web2/assets/assets/fullscreen.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="404.315 521.772 32 32"><path fill-rule="evenodd" d="M411.985 533.763a1.815 1.815 0 0 1-1.812 1.812c-.479 0-.943-.196-1.284-.536a1.834 1.834 0 0 1-.529-1.276v-2.806c0-1.312.522-2.566 1.45-3.494a4.938 4.938 0 0 1 3.494-1.45h2.799c.486 0 .942.196 1.283.536.341.334.529.798.529 1.276a1.8 1.8 0 0 1-.529 1.283c-.341.341-.797.53-1.283.53h-2.799c-.348 0-.688.137-.935.391-.246.247-.384.58-.384.928v2.806Zm4.118 12.143a1.802 1.802 0 0 1 1.812 1.812c0 .479-.188.943-.529 1.276a1.81 1.81 0 0 1-1.283.537h-2.799a4.938 4.938 0 0 1-3.494-1.45 4.939 4.939 0 0 1-1.45-3.495v-2.805c0-.479.196-.935.529-1.276a1.824 1.824 0 0 1 1.284-.537c.485 0 .942.196 1.283.537.341.341.529.797.529 1.276v2.805c0 .348.138.682.384.928.247.254.587.392.935.392h2.799Zm8.424-16.268c-.486 0-.943-.189-1.283-.53a1.8 1.8 0 0 1-.529-1.283c0-.478.188-.942.529-1.276.34-.34.797-.536 1.283-.536h2.798a4.94 4.94 0 0 1 3.495 1.45 4.938 4.938 0 0 1 1.45 3.494v2.806a1.823 1.823 0 0 1-1.813 1.812c-.486 0-.942-.196-1.283-.536a1.8 1.8 0 0 1-.529-1.276v-2.806a1.31 1.31 0 0 0-.385-.928 1.302 1.302 0 0 0-.935-.391h-2.798Zm4.118 12.143c0-.479.188-.935.529-1.276a1.81 1.81 0 0 1 1.283-.537 1.82 1.82 0 0 1 1.813 1.813v2.805a4.939 4.939 0 0 1-1.45 3.495 4.94 4.94 0 0 1-3.495 1.45h-2.798c-.486 0-.943-.196-1.283-.537a1.784 1.784 0 0 1-.529-1.276 1.804 1.804 0 0 1 1.812-1.812h2.798c.348 0 .689-.138.935-.392a1.31 1.31 0 0 0 .385-.928v-2.805Z"/><path fill="none" d="M404.315 521.772h32v32h-32v-32Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
resources/web2/assets/assets/fullscreen_exit.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="404.315 560.459 32 32"><path fill="none" d="M404.315 560.459h32v32h-32v-32Z"/><path fill-rule="evenodd" d="M414.29 566.512c0-.478.189-.935.53-1.275.34-.341.797-.537 1.283-.537a1.824 1.824 0 0 1 1.812 1.812v2.806a4.938 4.938 0 0 1-1.45 3.494 4.938 4.938 0 0 1-3.494 1.45h-2.798c-.486 0-.943-.195-1.284-.536a1.792 1.792 0 0 1-.529-1.276 1.805 1.805 0 0 1 1.813-1.813h2.798c.348 0 .689-.137.935-.391.247-.246.384-.58.384-.928v-2.806Zm-4.117 15.768a1.804 1.804 0 0 1-1.813-1.812c0-.478.189-.942.529-1.276a1.811 1.811 0 0 1 1.284-.536h2.798c1.312 0 2.566.522 3.494 1.449a4.94 4.94 0 0 1 1.45 3.495v2.805a1.824 1.824 0 0 1-1.812 1.813c-.486 0-.943-.196-1.283-.537a1.797 1.797 0 0 1-.53-1.276V583.6c0-.348-.137-.682-.384-.928a1.303 1.303 0 0 0-.935-.392h-2.798Zm20.284-11.643c.486 0 .943.189 1.283.53.341.34.53.797.53 1.283 0 .478-.189.942-.53 1.276-.34.341-.797.536-1.283.536h-2.798a4.94 4.94 0 0 1-3.495-1.45 4.937 4.937 0 0 1-1.449-3.494v-2.806a1.82 1.82 0 0 1 1.812-1.812c.486 0 .942.196 1.283.537.341.34.529.797.529 1.275v2.806c0 .348.138.682.385.928.246.254.587.391.935.391h2.798Zm-4.118 15.768c0 .479-.188.936-.529 1.276a1.81 1.81 0 0 1-1.283.537 1.82 1.82 0 0 1-1.812-1.813V583.6a4.944 4.944 0 0 1 4.944-4.944h2.798c.486 0 .943.195 1.283.536.341.334.53.798.53 1.276 0 .486-.189.942-.53 1.283a1.8 1.8 0 0 1-1.283.529h-2.798c-.348 0-.689.138-.935.392a1.31 1.31 0 0 0-.385.928v2.805Z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
BIN
resources/web2/assets/assets/gestures.ttf
vendored
Normal file
1
resources/web2/assets/assets/home.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" style="isolation:isolate" viewBox="13.554 106.603 32 32"><path fill="none" d="M13.554 106.603h32v32h-32v-32Z"/><path d="M32.944 132.507h3.661a1 1 0 0 0 1-1v-7.837h2.335c.552 0 .683-.316.293-.707l-9.972-9.971a.999.999 0 0 0-1.414 0l-9.971 9.971c-.391.391-.259.707.293.707h2.334v7.837a1 1 0 0 0 1 1h3.661a1 1 0 0 0 1-1v-2.966a.5.5 0 0 1 .5-.5h3.78a.5.5 0 0 1 .5.5v2.966c0 .552.449 1 1 1Z"/></svg>
|
||||
|
After Width: | Height: | Size: 457 B |
1
resources/web2/assets/assets/icon.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="66.993 897.484 26 26"><linearGradient id="a" x1=".148" x2=".845" y1=".851" y2=".154" gradientTransform="matrix(26.301 0 0 26.331 90.674 911.757)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0071ff"/><stop offset="1" stop-color="#00bfe1"/></linearGradient><defs><linearGradient xlink:href="#a" id="b" x1=".148" x2=".845" y1=".851" y2=".154" gradientTransform="matrix(26.00048 0 0 25.99935 66.993 897.485)" gradientUnits="userSpaceOnUse"/></defs><path fill="url(#b)" d="m89.318 903.552-2.135 2.122c-.376.337-.558.879-.347 1.337 1.422 2.976.882 6.524-1.452 8.856-2.335 2.331-5.887 2.87-8.866 1.449-.439-.197-.954-.03-1.292.312l-2.17 2.167a1.154 1.154 0 0 0 .208 1.81 13.005 13.005 0 0 0 15.91-1.912 12.97 12.97 0 0 0 1.956-15.887 1.154 1.154 0 0 0-1.812-.254zm-18.467-2.305a12.969 12.969 0 0 0-2.02 15.885 1.154 1.154 0 0 0 1.812.254l2.124-2.11c.385-.336.572-.884.359-1.348-1.423-2.976-.884-6.524 1.451-8.856 2.334-2.332 5.887-2.871 8.866-1.45.434.194.942.033 1.281-.3l2.182-2.18a1.152 1.152 0 0 0-.208-1.81 13.009 13.009 0 0 0-15.893 1.973z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
resources/web2/assets/assets/insecure.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 347.97 347.97"><path fill="none" stroke="red" stroke-width="14.827" d="M317.469 61.615c-59.442 0-104.976-16.082-143.489-51.539-38.504 35.457-84.04 51.539-143.479 51.539 0 92.337-20.177 224.612 143.479 278.324 163.661-53.717 143.489-185.992 143.489-278.324z"/><g fill="red"><path d="m238.802 115.023-111.573 114.68-8.6-8.367L230.2 106.656z"/><path d="m125.559 108.093 114.68 111.572-8.368 8.601-114.68-111.572z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 440 B |
1
resources/web2/assets/assets/insecure_relay.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 347.97 347.97"><path fill="none" stroke="red" stroke-width="14.827" d="M317.469 61.615c-59.442 0-104.976-16.082-143.489-51.539-38.504 35.457-84.04 51.539-143.479 51.539 0 92.337-20.177 224.612 143.479 278.324 163.661-53.717 143.489-185.992 143.489-278.324z"/><path fill="red" d="m231.442 247.498-7.754-10.205c-17.268 12.441-38.391 17.705-59.478 14.822-21.087-2.883-39.613-13.569-52.166-30.088-25.916-34.101-17.997-82.738 17.65-108.42 32.871-23.685 78.02-19.704 105.172 7.802l-32.052 7.987 3.082 12.369 48.722-12.142-11.712-46.998-12.822 3.196 4.496 18.039c-31.933-24.008-78.103-25.342-112.642-.458-31.361 22.596-44.3 60.436-35.754 94.723 2.77 11.115 7.801 21.862 15.192 31.588 30.19 39.727 88.538 47.705 130.066 17.785z"/></svg>
|
||||
|
After Width: | Height: | Size: 746 B |
1
resources/web2/assets/assets/kb_layout_iso.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="261" height="253" version="1.2"><path fill="#0ff" d="M1 217c0-5.5 4.5-10 10-10h60c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10H11c-5.5 0-10-4.5-10-10z"/><path fill="#487997" d="M89 216c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10H99c-5.5 0-10-4.5-10-10z"/><path fill="#c0ff00" d="M3 166c0-5.5 4.5-10 10-10h34c5.5 0 10 4.5 10 10v24c0 5.5-4.5 10-10 10H13c-5.5 0-10-4.5-10-10z"/><path fill="#00f" d="M63 166c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10H73c-5.5 0-10-4.5-10-10z"/><path fill="#0ff" d="M140 215c0-5.5 4.5-10 10-10h26c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10h-26c-5.5 0-10-4.5-10-10zm50 0c0-5.5 4.5-10 10-10h26c5.5 0 10 4.5 10 10v28c0 5.5-4.5 10-10 10h-26c-5.5 0-10-4.5-10-10z"/><path fill="#00ffa8" d="M112 166c0-5.5 4.5-10 10-10h27c5.5 0 10 4.5 10 10v24c0 5.5-4.5 10-10 10h-27c-5.5 0-10-4.5-10-10zm53-1c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zm51-1c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10z"/><path fill="#0ff" d="M0 115c0-5.5 4.5-10 10-10h61c5.5 0 10 4.5 10 10v23c0 5.5-4.5 10-10 10H10c-5.5 0-10-4.5-10-10z"/><path fill="#00ffa8" d="M90 116c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10h-24c-5.5 0-10-4.5-10-10zm49 0c0-5.5 4.5-10 10-10h27c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10h-27c-5.5 0-10-4.5-10-10zm52-1c0-5.5 4.5-10 10-10h23c5.5 0 10 4.5 10 10v24c0 5.5-4.5 10-10 10h-23c-5.5 0-10-4.5-10-10z"/><path fill="#0ff" d="M2 62c0-5.5 4.5-10 10-10h50c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10H12C6.5 98 2 93.5 2 88z"/><path fill="#00ffa8" d="M79 62c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10H89c-5.5 0-10-4.5-10-10zm52 2c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v24c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zm51-1c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zM0 10C0 4.5 4.5 0 10 0h28c5.5 0 10 4.5 10 10v27c0 5.5-4.5 10-10 10H10C4.5 47 0 42.5 0 37zm54 1c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10H64c-5.5 0-10-4.5-10-10zm51 1c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zm51 1c0-5.5 4.5-10 10-10h27c5.5 0 10 4.5 10 10v24c0 5.5-4.5 10-10 10h-27c-5.5 0-10-4.5-10-10z"/><path d="M16.7 171.9v1.9q-1.1-.5-2.1-.8-1-.2-1.9-.2-1.7 0-2.5.6-.9.6-.9 1.8 0 .9.6 1.4.6.5 2.2.8l1.2.3q2.2.4 3.2 1.4 1.1 1.1 1.1 2.9 0 2.1-1.4 3.2-1.5 1.1-4.2 1.1-1 0-2.2-.3-1.2-.2-2.4-.6v-2.1q1.2.7 2.3 1 1.2.4 2.3.4 1.7 0 2.6-.7.9-.6.9-1.9 0-1.1-.6-1.7-.7-.6-2.2-.9l-1.2-.2q-2.2-.4-3.2-1.4-1-.9-1-2.6 0-1.9 1.4-3 1.3-1.1 3.7-1.1 1.1 0 2.1.1 1.1.2 2.2.6zm13 7.5v6.6h-1.8v-6.5q0-1.6-.6-2.4-.6-.7-1.8-.7-1.5 0-2.3.9-.9.9-.9 2.5v6.2h-1.8v-15.2h1.8v6q.7-1 1.5-1.5.9-.5 2.1-.5 1.8 0 2.8 1.2 1 1.1 1 3.4zm3.6 6.6v-10.9h1.8V186zm0-12.9v-2.3H35v2.3zm9.4-2.3h1.7v1.5h-1.7q-.9 0-1.3.4t-.4 1.4v1h3v1.4h-3v9.5h-1.8v-9.5h-1.7v-1.4h1.7v-.8q0-1.8.8-2.7.9-.8 2.7-.8zm2.9 1.2h1.8v3.1h3.7v1.4h-3.7v5.9q0 1.3.3 1.7.4.4 1.5.4h1.9v1.5h-1.9q-2.1 0-2.8-.8-.8-.8-.8-2.8v-5.9h-1.4v-1.4h1.4z"/></svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
1
resources/web2/assets/assets/kb_layout_not_iso.svg
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="260" height="253" version="1.2"><path fill="#c0ff00" d="M0 167c0-5.5 4.5-10 10-10h90c5.5 0 10 4.5 10 10v23c0 5.5-4.5 10-10 10H10c-5.5 0-10-4.5-10-10z"/><path fill="#0ff" d="M3 63c0-5.5 4.5-10 10-10h46c5.5 0 10 4.5 10 10v24c0 5.5-4.5 10-10 10H13C7.5 97 3 92.5 3 87zm-2 51c0-5.5 4.5-10 10-10h62c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10H11c-5.5 0-10-4.5-10-10z"/><path fill="#00ffa8" d="M114 166c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v24c0 5.5-4.5 10-10 10h-24c-5.5 0-10-4.5-10-10zm-24-49c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v22c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zm-9-53c0-5.5 4.5-10 10-10h22c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10H91c-5.5 0-10-4.5-10-10zM54 10c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v27c0 5.5-4.5 10-10 10H64c-5.5 0-10-4.5-10-10zM2 10C2 4.5 6.5 0 12 0h26c5.5 0 10 4.5 10 10v27c0 5.5-4.5 10-10 10H12C6.5 47 2 42.5 2 37z"/><path fill="#0ff" d="M2 216c0-5.5 4.5-10 10-10h59c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10H12c-5.5 0-10-4.5-10-10z"/><path fill="#487997" d="M89 217c0-5.5 4.5-10 10-10h23c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10H99c-5.5 0-10-4.5-10-10z"/><path fill="#0ff" d="M141 217c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10h-24c-5.5 0-10-4.5-10-10zm50-1c0-5.5 4.5-10 10-10h23c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10h-23c-5.5 0-10-4.5-10-10z"/><path fill="#00ffa8" d="M166 164c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v27c0 5.5-4.5 10-10 10h-24c-5.5 0-10-4.5-10-10zm49 1c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zm-77-54c0-5.5 4.5-10 10-10h28c5.5 0 10 4.5 10 10v29c0 5.5-4.5 10-10 10h-28c-5.5 0-10-4.5-10-10zm54 1c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v29c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zm-63-48c0-5.5 4.5-10 10-10h27c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10h-27c-5.5 0-10-4.5-10-10zm53-2c0-5.5 4.5-10 10-10h25c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10h-25c-5.5 0-10-4.5-10-10zm-77-51c0-5.5 4.5-10 10-10h24c5.5 0 10 4.5 10 10v26c0 5.5-4.5 10-10 10h-24c-5.5 0-10-4.5-10-10zm49 1c0-5.5 4.5-10 10-10h27c5.5 0 10 4.5 10 10v25c0 5.5-4.5 10-10 10h-27c-5.5 0-10-4.5-10-10z"/><path d="M42.7 172.9v1.9q-1.1-.5-2.1-.8-1-.2-1.9-.2-1.7 0-2.5.6-.9.6-.9 1.8 0 .9.6 1.4.6.5 2.2.8l1.2.3q2.2.4 3.2 1.4 1.1 1.1 1.1 2.9 0 2.1-1.4 3.2-1.5 1.1-4.2 1.1-1 0-2.2-.3-1.2-.2-2.4-.6v-2.1q1.2.7 2.3 1 1.2.4 2.3.4 1.7 0 2.6-.7.9-.6.9-1.9 0-1.1-.6-1.7-.7-.6-2.2-.9l-1.2-.2q-2.2-.4-3.2-1.4-1-.9-1-2.6 0-1.9 1.4-3 1.3-1.1 3.7-1.1 1.1 0 2.1.1 1.1.2 2.2.6zm13 7.5v6.6h-1.8v-6.5q0-1.6-.6-2.4-.6-.7-1.8-.7-1.5 0-2.3.9-.9.9-.9 2.5v6.2h-1.8v-15.2h1.8v6q.7-1 1.5-1.5.9-.5 2.1-.5 1.8 0 2.8 1.2 1 1.1 1 3.4zm3.6 6.6v-10.9h1.8V187zm0-12.9v-2.3H61v2.3zm9.4-2.3h1.7v1.5h-1.7q-.9 0-1.3.4t-.4 1.4v1h3v1.4h-3v9.5h-1.8v-9.5h-1.7v-1.4h1.7v-.8q0-1.8.8-2.7.9-.8 2.7-.8zm2.9 1.2h1.8v3.1h3.7v1.4h-3.7v5.9q0 1.3.3 1.7.4.4 1.5.4h1.9v1.5h-1.9q-2.1 0-2.8-.8-.8-.8-.8-2.8v-5.9h-1.4v-1.4h1.4z"/></svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |