release actions
This commit is contained in:
parent
047174291b
commit
bce7b1cdd4
8 changed files with 182 additions and 73 deletions
11
.gitea/workflows/action_push.yml
Normal file
11
.gitea/workflows/action_push.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
name: Push Action
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '!**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
uses: ./.gitea/workflows/test.yml
|
||||||
|
|
16
.gitea/workflows/action_tag.yml
Normal file
16
.gitea/workflows/action_tag.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
name: Tag Action
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
uses: ./.gitea/workflows/test.yml
|
||||||
|
release_code:
|
||||||
|
needs: test
|
||||||
|
uses: ./.gitea/workflows/release_code.yml
|
||||||
|
release_amd:
|
||||||
|
needs: [test, release_code]
|
||||||
|
uses: ./.gitea/workflows/release_amd.yml
|
36
.gitea/workflows/release_amd.yml
Normal file
36
.gitea/workflows/release_amd.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
name: Outbag AMD Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
secrets:
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-amd:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
npm run bundleRelease
|
||||||
|
|
||||||
|
- name: Build AMD
|
||||||
|
run: |
|
||||||
|
npm run build-amd
|
||||||
|
mkdir upload
|
||||||
|
cp build/bin/* upload
|
||||||
|
|
||||||
|
- name: Create Release AMD
|
||||||
|
id: gitea-release-amd
|
||||||
|
uses: actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
upload/**
|
||||||
|
api_key: '${{ secrets.RELEASE_TOKEN }}'
|
43
.gitea/workflows/release_code.yml
Normal file
43
.gitea/workflows/release_code.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
name: Outbag Code release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
secrets:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-code:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir build
|
||||||
|
npm run prepublish
|
||||||
|
|
||||||
|
- name: Build Code
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install zip tar -y
|
||||||
|
mkdir outbag_server
|
||||||
|
mkdir outbag_server/dist
|
||||||
|
mkdir upload
|
||||||
|
cp -r dist/* outbag_server/dist
|
||||||
|
cp package.json outbag_server
|
||||||
|
cp package-lock.json outbag_server
|
||||||
|
cp readme.md outbag_server
|
||||||
|
zip -r upload/OutbagServer.zip outbag_server/*
|
||||||
|
tar -czvf upload/OutbagServer.tar.gz outbag_server/*
|
||||||
|
|
||||||
|
- name: Create Release Code
|
||||||
|
id: gitea-release-code
|
||||||
|
uses: actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
upload/**
|
||||||
|
api_key: '${{ secrets.RELEASE_TOKEN }}'
|
|
@ -1,6 +1,9 @@
|
||||||
name: Outbag Tests
|
name: Outbag Tests
|
||||||
|
|
||||||
on: [push]
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
secrets:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
|
@ -4,7 +4,7 @@
|
||||||
PORT=7224
|
PORT=7224
|
||||||
PORTexposed=7224
|
PORTexposed=7224
|
||||||
PATHexposed=/
|
PATHexposed=/
|
||||||
URL=localhost
|
URL=127.0.0.1
|
||||||
CertLiveSec=2592000
|
CertLiveSec=2592000
|
||||||
|
|
||||||
[ssl]
|
[ssl]
|
||||||
|
|
|
@ -18,29 +18,29 @@ const list = [
|
||||||
["signup", async (req) => {
|
["signup", async (req) => {
|
||||||
await req({}, "signup", {
|
await req({}, "signup", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
|
|
||||||
await req({}, "signup", {
|
await req({}, "signup", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", act_error.ACCOUNT_EXISTS);
|
}, "error", act_error.ACCOUNT_EXISTS);
|
||||||
|
|
||||||
await req({}, "signup", {
|
await req({}, "signup", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
|
|
||||||
await req({}, "signup", {
|
await req({}, "signup", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", act_error.config);
|
}, "error", act_error.config);
|
||||||
}], ["remote", async (req) => {
|
}], ["remote", async (req) => {
|
||||||
let signature = (await req({ "authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}` },
|
let signature = (await req({ "authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}` },
|
||||||
"createSignature", {
|
"createSignature", {
|
||||||
publicKey
|
publicKey
|
||||||
}, "ok", null)).sign;
|
}, "ok", null)).sign;
|
||||||
|
@ -51,7 +51,7 @@ const list = [
|
||||||
"authorization": `Bearer ${token}`
|
"authorization": `Bearer ${token}`
|
||||||
}, "remote1", {
|
}, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7223",
|
server: "127.0.0.1:7223",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "error", act_error.SIGNATURE);
|
}, "error", act_error.SIGNATURE);
|
||||||
|
@ -60,7 +60,7 @@ const list = [
|
||||||
"authorization": `Bearer ${token}`
|
"authorization": `Bearer ${token}`
|
||||||
}, "remote1", {
|
}, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: falseSignature
|
sign: falseSignature
|
||||||
}, "error", act_error.SIGNATURE);
|
}, "error", act_error.SIGNATURE);
|
||||||
|
@ -69,7 +69,7 @@ const list = [
|
||||||
"authorization": `Bearer ${token}`
|
"authorization": `Bearer ${token}`
|
||||||
}, "remote1", {
|
}, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "ok", null)).challenge;
|
}, "ok", null)).challenge;
|
||||||
|
@ -78,7 +78,7 @@ const list = [
|
||||||
"authorization": `Bearer ${token}`
|
"authorization": `Bearer ${token}`
|
||||||
}, "remote1", {
|
}, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "error", act_error.WRONG_STATE);
|
}, "error", act_error.WRONG_STATE);
|
||||||
|
@ -97,7 +97,7 @@ const list = [
|
||||||
|
|
||||||
}], ["account", async (req) => {
|
}], ["account", async (req) => {
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "getMyAccount", {}, "ok", {
|
}, "getMyAccount", {}, "ok", {
|
||||||
rights: PERMISSIONS.ALL,
|
rights: PERMISSIONS.ALL,
|
||||||
name: name1,
|
name: name1,
|
||||||
|
@ -107,7 +107,7 @@ const list = [
|
||||||
maxUsersPerRoom: 2,
|
maxUsersPerRoom: 2,
|
||||||
});
|
});
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name2} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name2} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "getMyAccount", {}, "ok", {
|
}, "getMyAccount", {}, "ok", {
|
||||||
rights: PERMISSIONS.DEFAULT,
|
rights: PERMISSIONS.DEFAULT,
|
||||||
name: name2,
|
name: name2,
|
||||||
|
@ -118,31 +118,31 @@ const list = [
|
||||||
});
|
});
|
||||||
}], ["change account", async (req) => {
|
}], ["change account", async (req) => {
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name2} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name2} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "changePassword", {
|
}, "changePassword", {
|
||||||
accountKey: accountKey + "lol"
|
accountKey: accountKey + "lol"
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req({}, "signin", {
|
await req({}, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", act_error.AUTH);
|
}, "error", act_error.AUTH);
|
||||||
await req({}, "signin", {
|
await req({}, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey: accountKey + "lol"
|
accountKey: accountKey + "lol"
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name2} server=localhost:7224 accountKey=${accountKey + "lol"}`
|
"authorization": `Digest name=${name2} server=127.0.0.1:7224 accountKey=${accountKey + "lol"}`
|
||||||
}, "deleteAccount", {}, "ok", "");
|
}, "deleteAccount", {}, "ok", "");
|
||||||
await req({}, "signin", {
|
await req({}, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey: accountKey + "lol"
|
accountKey: accountKey + "lol"
|
||||||
}, "error", act_error.AUTH);
|
}, "error", act_error.AUTH);
|
||||||
}], ["admin", async (req) => {
|
}], ["admin", async (req) => {
|
||||||
let resp = await req({
|
let resp = await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "getAccounts", {}, "ok", [
|
}, "getAccounts", {}, "ok", [
|
||||||
{
|
{
|
||||||
accID: 1,
|
accID: 1,
|
||||||
|
@ -167,13 +167,13 @@ const list = [
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "setPermissions", {
|
}, "setPermissions", {
|
||||||
accID: resp[1].accID,
|
accID: resp[1].accID,
|
||||||
rights: 5
|
rights: 5
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "getAccounts", {}, "ok", [
|
}, "getAccounts", {}, "ok", [
|
||||||
{
|
{
|
||||||
accID: 1,
|
accID: 1,
|
||||||
|
@ -198,14 +198,14 @@ const list = [
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "addOTA", {
|
}, "addOTA", {
|
||||||
token: "12345678",
|
token: "12345678",
|
||||||
expires: uts() + 1,
|
expires: uts() + 1,
|
||||||
usesLeft: -1
|
usesLeft: -1
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "getOTAs", {}, "ok", [
|
}, "getOTAs", {}, "ok", [
|
||||||
{
|
{
|
||||||
token: "12345678",
|
token: "12345678",
|
||||||
|
@ -214,7 +214,7 @@ const list = [
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "addOTA", {
|
}, "addOTA", {
|
||||||
token: "abc",
|
token: "abc",
|
||||||
expires: -1,
|
expires: -1,
|
||||||
|
@ -222,34 +222,34 @@ const list = [
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await wait(2000);
|
await wait(2000);
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "getOTAs", {}, "ok", [{
|
}, "getOTAs", {}, "ok", [{
|
||||||
token: "abc",
|
token: "abc",
|
||||||
expires: -1,
|
expires: -1,
|
||||||
usesLeft: -1
|
usesLeft: -1
|
||||||
}]);
|
}]);
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "deleteOTA", { token: "abc" }, "ok", "");
|
}, "deleteOTA", { token: "abc" }, "ok", "");
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "getOTAs", {}, "ok", []);
|
}, "getOTAs", {}, "ok", []);
|
||||||
}], ["room Owner", async (req) => {
|
}], ["room Owner", async (req) => {
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "createRoom", {
|
}, "createRoom", {
|
||||||
room: room1,
|
room: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
description: "some desc",
|
description: "some desc",
|
||||||
visibility: 0,
|
visibility: 0,
|
||||||
icon: "shopping"
|
icon: "shopping"
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "createRoom", {
|
}, "createRoom", {
|
||||||
room: room1,
|
room: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
description: "some desc",
|
description: "some desc",
|
||||||
visibility: 0,
|
visibility: 0,
|
||||||
|
@ -257,20 +257,20 @@ const list = [
|
||||||
}, "error", act_error.ROOM_EXISTS);
|
}, "error", act_error.ROOM_EXISTS);
|
||||||
|
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "createRoom", {
|
}, "createRoom", {
|
||||||
room: room2,
|
room: room2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 2",
|
title: "Test Room 2",
|
||||||
description: "some desc 2",
|
description: "some desc 2",
|
||||||
visibility: 1,
|
visibility: 1,
|
||||||
icon: ""
|
icon: ""
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "createRoom", {
|
}, "createRoom", {
|
||||||
room: room3,
|
room: room3,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 2",
|
title: "Test Room 2",
|
||||||
description: "some desc 2",
|
description: "some desc 2",
|
||||||
visibility: 1,
|
visibility: 1,
|
||||||
|
@ -278,11 +278,11 @@ const list = [
|
||||||
}, "error", act_error.ROOM_LIMIT);
|
}, "error", act_error.ROOM_LIMIT);
|
||||||
|
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "listRooms", {}, "ok", [
|
}, "listRooms", {}, "ok", [
|
||||||
{
|
{
|
||||||
name: room1,
|
name: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
owner: name1,
|
owner: name1,
|
||||||
rights: 0b11111,
|
rights: 0b11111,
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
|
@ -293,7 +293,7 @@ const list = [
|
||||||
confirmed: true
|
confirmed: true
|
||||||
}, {
|
}, {
|
||||||
name: room2,
|
name: room2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
owner: name1,
|
owner: name1,
|
||||||
rights: 0b11111,
|
rights: 0b11111,
|
||||||
title: "Test Room 2",
|
title: "Test Room 2",
|
||||||
|
@ -305,32 +305,32 @@ const list = [
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "deleteRoom", {
|
}, "deleteRoom", {
|
||||||
room: room2 + "lol",
|
room: room2 + "lol",
|
||||||
server: "localhost:7224"
|
server: "127.0.0.1:7224"
|
||||||
}, "error", act_error.ROOM_NOT_EXISTS);
|
}, "error", act_error.ROOM_NOT_EXISTS);
|
||||||
|
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "deleteRoom", {
|
}, "deleteRoom", {
|
||||||
room: room2,
|
room: room2,
|
||||||
server: "localhost:7224"
|
server: "127.0.0.1:7224"
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
|
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "deleteRoom", {
|
}, "deleteRoom", {
|
||||||
room: room2,
|
room: room2,
|
||||||
server: "localhost:7224"
|
server: "127.0.0.1:7224"
|
||||||
}, "error", act_error.ROOM_NOT_EXISTS);
|
}, "error", act_error.ROOM_NOT_EXISTS);
|
||||||
|
|
||||||
await req({
|
await req({
|
||||||
"authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}`
|
"authorization": `Digest name=${name1} server=127.0.0.1:7224 accountKey=${accountKey}`
|
||||||
}, "listRooms", {}, "ok", [
|
}, "listRooms", {}, "ok", [
|
||||||
{
|
{
|
||||||
name: room1,
|
name: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
owner: name1,
|
owner: name1,
|
||||||
rights: 0b11111,
|
rights: 0b11111,
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
|
|
|
@ -17,33 +17,33 @@ const list = [
|
||||||
["signup", async (handler, req, newHandler) => {
|
["signup", async (handler, req, newHandler) => {
|
||||||
await req(handler, "signup", {
|
await req(handler, "signup", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(handler, "signup", {
|
await req(handler, "signup", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", act_error.WRONG_STATE);
|
}, "error", act_error.WRONG_STATE);
|
||||||
await req(await newHandler(), "signup", {
|
await req(await newHandler(), "signup", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", act_error.ACCOUNT_EXISTS);
|
}, "error", act_error.ACCOUNT_EXISTS);
|
||||||
await req(await newHandler(), "signup", {
|
await req(await newHandler(), "signup", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(await newHandler(), "signup", {
|
await req(await newHandler(), "signup", {
|
||||||
name: name3,
|
name: name3,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", act_error.CONFIG);
|
}, "error", act_error.CONFIG);
|
||||||
}], ["remote", async (handler, req, newHandler) => {
|
}], ["remote", async (handler, req, newHandler) => {
|
||||||
await req(handler, "signin", {
|
await req(handler, "signin", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
let signature = (await req(handler, "createSignature", {
|
let signature = (await req(handler, "createSignature", {
|
||||||
|
@ -53,25 +53,25 @@ const list = [
|
||||||
let h2 = await newHandler();
|
let h2 = await newHandler();
|
||||||
await req(h2, "remote1", {
|
await req(h2, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7223",
|
server: "127.0.0.1:7223",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "error", act_error.SIGNATURE);
|
}, "error", act_error.SIGNATURE);
|
||||||
await req(h2, "remote1", {
|
await req(h2, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: falseSignature
|
sign: falseSignature
|
||||||
}, "error", act_error.SIGNATURE);
|
}, "error", act_error.SIGNATURE);
|
||||||
let challenge = (await req(h2, "remote1", {
|
let challenge = (await req(h2, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "ok", null)).challenge;
|
}, "ok", null)).challenge;
|
||||||
await req(h2, "remote1", {
|
await req(h2, "remote1", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
publicKey,
|
publicKey,
|
||||||
sign: signature
|
sign: signature
|
||||||
}, "error", act_error.WRONG_STATE);
|
}, "error", act_error.WRONG_STATE);
|
||||||
|
@ -84,7 +84,7 @@ const list = [
|
||||||
}], ["account", async (handler, req, newHandler) => {
|
}], ["account", async (handler, req, newHandler) => {
|
||||||
await req(handler, "signin", {
|
await req(handler, "signin", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(handler, "getMyAccount", {}, "ok", {
|
await req(handler, "getMyAccount", {}, "ok", {
|
||||||
|
@ -98,7 +98,7 @@ const list = [
|
||||||
let h2 = await newHandler();
|
let h2 = await newHandler();
|
||||||
await req(h2, "signin", {
|
await req(h2, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(h2, "getMyAccount", {}, "ok", {
|
await req(h2, "getMyAccount", {}, "ok", {
|
||||||
|
@ -112,7 +112,7 @@ const list = [
|
||||||
}], ["change account", async (handler, req, newHandler) => {
|
}], ["change account", async (handler, req, newHandler) => {
|
||||||
await req(handler, "signin", {
|
await req(handler, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(handler, "changePassword", {
|
await req(handler, "changePassword", {
|
||||||
|
@ -121,12 +121,12 @@ const list = [
|
||||||
let h2 = await newHandler();
|
let h2 = await newHandler();
|
||||||
await req(h2, "signin", {
|
await req(h2, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "error", act_error.AUTH);
|
}, "error", act_error.AUTH);
|
||||||
await req(h2, "signin", {
|
await req(h2, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey: accountKey + "lol"
|
accountKey: accountKey + "lol"
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(h2, "deleteAccount", {}, "ok", "");
|
await req(h2, "deleteAccount", {}, "ok", "");
|
||||||
|
@ -134,18 +134,18 @@ const list = [
|
||||||
let h3 = await newHandler();
|
let h3 = await newHandler();
|
||||||
await req(h3, "signin", {
|
await req(h3, "signin", {
|
||||||
name: name2,
|
name: name2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey: accountKey + "lol"
|
accountKey: accountKey + "lol"
|
||||||
}, "error", act_error.AUTH);
|
}, "error", act_error.AUTH);
|
||||||
}], ["room Owner", async (handler, req, newHandler) => {
|
}], ["room Owner", async (handler, req, newHandler) => {
|
||||||
await req(handler, "signin", {
|
await req(handler, "signin", {
|
||||||
name: name1,
|
name: name1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
accountKey
|
accountKey
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(handler, "createRoom", {
|
await req(handler, "createRoom", {
|
||||||
room: room1,
|
room: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
description: "some desc",
|
description: "some desc",
|
||||||
visibility: 0,
|
visibility: 0,
|
||||||
|
@ -153,7 +153,7 @@ const list = [
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(handler, "createRoom", {
|
await req(handler, "createRoom", {
|
||||||
room: room1,
|
room: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
description: "some desc",
|
description: "some desc",
|
||||||
visibility: 0,
|
visibility: 0,
|
||||||
|
@ -162,7 +162,7 @@ const list = [
|
||||||
|
|
||||||
await req(handler, "createRoom", {
|
await req(handler, "createRoom", {
|
||||||
room: room2,
|
room: room2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 2",
|
title: "Test Room 2",
|
||||||
description: "some desc 2",
|
description: "some desc 2",
|
||||||
visibility: 1,
|
visibility: 1,
|
||||||
|
@ -171,7 +171,7 @@ const list = [
|
||||||
|
|
||||||
await req(handler, "createRoom", {
|
await req(handler, "createRoom", {
|
||||||
room: room3,
|
room: room3,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
title: "Test Room 2",
|
title: "Test Room 2",
|
||||||
description: "some desc 2",
|
description: "some desc 2",
|
||||||
visibility: 1,
|
visibility: 1,
|
||||||
|
@ -181,7 +181,7 @@ const list = [
|
||||||
await req(handler, "listRooms", {}, "ok", [
|
await req(handler, "listRooms", {}, "ok", [
|
||||||
{
|
{
|
||||||
name: room1,
|
name: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
owner: name1,
|
owner: name1,
|
||||||
rights: 0b11111,
|
rights: 0b11111,
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
|
@ -192,7 +192,7 @@ const list = [
|
||||||
confirmed: true
|
confirmed: true
|
||||||
}, {
|
}, {
|
||||||
name: room2,
|
name: room2,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
owner: name1,
|
owner: name1,
|
||||||
rights: 0b11111,
|
rights: 0b11111,
|
||||||
title: "Test Room 2",
|
title: "Test Room 2",
|
||||||
|
@ -205,20 +205,20 @@ const list = [
|
||||||
]);
|
]);
|
||||||
await req(handler, "deleteRoom", {
|
await req(handler, "deleteRoom", {
|
||||||
room: room2 + "lol",
|
room: room2 + "lol",
|
||||||
server: "localhost:7224"
|
server: "127.0.0.1:7224"
|
||||||
}, "error", act_error.ROOM_NOT_EXISTS);
|
}, "error", act_error.ROOM_NOT_EXISTS);
|
||||||
await req(handler, "deleteRoom", {
|
await req(handler, "deleteRoom", {
|
||||||
room: room2,
|
room: room2,
|
||||||
server: "localhost:7224"
|
server: "127.0.0.1:7224"
|
||||||
}, "ok", "");
|
}, "ok", "");
|
||||||
await req(handler, "deleteRoom", {
|
await req(handler, "deleteRoom", {
|
||||||
room: room2,
|
room: room2,
|
||||||
server: "localhost:7224"
|
server: "127.0.0.1:7224"
|
||||||
}, "error", act_error.ROOM_NOT_EXISTS);
|
}, "error", act_error.ROOM_NOT_EXISTS);
|
||||||
await req(handler, "listRooms", {}, "ok", [
|
await req(handler, "listRooms", {}, "ok", [
|
||||||
{
|
{
|
||||||
name: room1,
|
name: room1,
|
||||||
server: "localhost:7224",
|
server: "127.0.0.1:7224",
|
||||||
owner: name1,
|
owner: name1,
|
||||||
rights: 0b11111,
|
rights: 0b11111,
|
||||||
title: "Test Room 1",
|
title: "Test Room 1",
|
||||||
|
|
Loading…
Reference in a new issue