mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-10 04:57:06 +00:00
Compare commits
28 Commits
20251012-2
...
v0.9.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58fb269450 | ||
|
|
303e52b476 | ||
|
|
868894f500 | ||
|
|
67d49b461f | ||
|
|
f89ee5a370 | ||
|
|
2afea56e56 | ||
|
|
a5387b64af | ||
|
|
0b178fc791 | ||
|
|
5d27a91e90 | ||
|
|
e2016a2ab4 | ||
|
|
924c7f5b18 | ||
|
|
22e46194ab | ||
|
|
ffdb2b6900 | ||
|
|
a7b870c397 | ||
|
|
b48eb28fc2 | ||
|
|
dc9c82aa4e | ||
|
|
24fedf8c4d | ||
|
|
dda20f44ae | ||
|
|
0b7c132ace | ||
|
|
e006cdd051 | ||
|
|
ac2971a78d | ||
|
|
b7c2ca84ab | ||
|
|
82b492e529 | ||
|
|
d567155f12 | ||
|
|
27ea7345ea | ||
|
|
5b534242c4 | ||
|
|
e36fc9738b | ||
|
|
657a3f08e5 |
37
.github/workflows/book.yml
vendored
37
.github/workflows/book.yml
vendored
@@ -1,37 +0,0 @@
|
||||
name: Build documentation
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write # To push a branch
|
||||
pages: write # To push to a GitHub Pages site
|
||||
id-token: write # To update the deployment status
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install latest mdbook
|
||||
run: |
|
||||
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
|
||||
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
|
||||
mkdir mdbook
|
||||
curl -sSL $url | tar -xz --directory=./mdbook
|
||||
echo `pwd`/mdbook >> $GITHUB_PATH
|
||||
- name: Build Book
|
||||
run: |
|
||||
cd doc
|
||||
mdbook build
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: "doc/book"
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
11
.github/workflows/docker.yaml
vendored
11
.github/workflows/docker.yaml
vendored
@@ -5,19 +5,22 @@ on:
|
||||
tags:
|
||||
- "*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
paths:
|
||||
- "Dockerfile"
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
base:
|
||||
name: Test base image build
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: arc-runner-set
|
||||
if: github.event_name == 'pull_request'
|
||||
steps:
|
||||
# Configure build environment
|
||||
@@ -38,7 +41,7 @@ jobs:
|
||||
cache-to: type=gha,scope=buildx-base-multi-arch,mode=max
|
||||
|
||||
publish:
|
||||
runs-on: self-hosted
|
||||
runs-on: arc-runner-set
|
||||
if: github.event_name != 'pull_request'
|
||||
name: Publish Docker images
|
||||
steps:
|
||||
|
||||
29
.github/workflows/docs-test.yml
vendored
Normal file
29
.github/workflows/docs-test.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
name: Documentation (test)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test-deploy:
|
||||
name: Test deployment
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./docs
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: ./docs/package.json
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
cache-dependency-path: ./docs/pnpm-lock.yaml
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Test build website
|
||||
run: pnpm run build
|
||||
54
.github/workflows/docs.yml
vendored
Normal file
54
.github/workflows/docs.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Docusaurus
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./docs
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
package_json_file: ./docs/package.json
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
cache-dependency-path: ./docs/pnpm-lock.yaml
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
- name: Build website
|
||||
run: pnpm run build
|
||||
|
||||
- name: Upload Build Artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: ./docs/build
|
||||
|
||||
deploy:
|
||||
name: Deploy to GitHub Pages
|
||||
needs: build
|
||||
|
||||
permissions:
|
||||
pages: write # to deploy to Pages
|
||||
id-token: write # to verify the deployment originates from an appropriate source
|
||||
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
60
.github/workflows/release-please.yml
vendored
Normal file
60
.github/workflows/release-please.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Release Please
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main] # updates/opens the release PR when commits land on main
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: release-please
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
name: Release Please
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
release_created: ${{ steps.rp.outputs.release_created }}
|
||||
tag_name: ${{ steps.rp.outputs.tag_name }}
|
||||
steps:
|
||||
- id: app-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ secrets.GH_STOAT_RELEASE_APP_ID }}
|
||||
private-key: ${{ secrets.GH_STOAT_RELEASE_APP_PRIVATE_KEY }}
|
||||
- id: rp
|
||||
uses: googleapis/release-please-action@v4
|
||||
with:
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
config-file: release-please-config.json
|
||||
|
||||
publish-please:
|
||||
name: Publish Please
|
||||
needs: release-please
|
||||
if: needs.release-please.outputs.release_created == 'true'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- id: app-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ secrets.GH_STOAT_RELEASE_APP_ID }}
|
||||
private-key: ${{ secrets.GH_STOAT_RELEASE_APP_PRIVATE_KEY }}
|
||||
|
||||
- name: Send release notification webhook
|
||||
run: |
|
||||
RELEASE_URL="https://github.com/revoltchat/backend/releases/tag/${{ needs.release-please.outputs.tag_name }}"
|
||||
curl -X POST "${{ secrets.STOAT_WEBHOOK_UPDATES_URL }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"content\": \"$RELEASE_URL\"}"
|
||||
|
||||
- name: Publish crates
|
||||
uses: katyo/publish-crates@v2
|
||||
with:
|
||||
registry-token: ${{ secrets.CRATES_IO_PUBLISH_TOKEN }}
|
||||
51
.github/workflows/rust.yaml
vendored
51
.github/workflows/rust.yaml
vendored
@@ -2,16 +2,12 @@ name: Rust build, test, and generate specification
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- ".github/**"
|
||||
- "!.github/workflows/rust.yaml"
|
||||
- ".vscode/**"
|
||||
- "doc/**"
|
||||
- ".gitignore"
|
||||
- "LICENSE"
|
||||
- "README"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
@@ -19,25 +15,28 @@ env:
|
||||
jobs:
|
||||
check:
|
||||
name: Rust project
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: arc-runner-set
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
|
||||
# Using our own runners for now:
|
||||
# - name: Free up disk space
|
||||
# run: |
|
||||
# sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
|
||||
|
||||
- name: Install latest stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Install cargo-nextest
|
||||
uses: baptiste0928/cargo-install@v1
|
||||
uses: taiki-e/install-action@a58ae9526b2c3acee9ad8e1926b950b7863305d4 # 2.65.16
|
||||
with:
|
||||
crate: cargo-nextest
|
||||
locked: true
|
||||
tool: cargo-nextest@0.9.119
|
||||
|
||||
- name: Run cargo build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
run: cargo build
|
||||
|
||||
- name: Run services in background
|
||||
run: |
|
||||
@@ -65,17 +64,17 @@ jobs:
|
||||
|
||||
- name: Wait for API to go up
|
||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||
uses: nev7n/wait_for_response@v1
|
||||
uses: nev7n/wait_for_response@7fef3c1a6e8939d0b09062f14fec50d3c5d15fa1 # v1.0.1
|
||||
with:
|
||||
url: "http://localhost:14702/"
|
||||
|
||||
- name: Checkout API repository
|
||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
repository: stoatchat/api
|
||||
repository: stoatchat/javascript-client-api
|
||||
path: api
|
||||
token: ${{ secrets.PAT }}
|
||||
ssh-key: ${{ secrets.DEPLOY_KEY_JAVASCRIPT_CLIENT_API }}
|
||||
|
||||
- name: Download OpenAPI specification
|
||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||
@@ -83,10 +82,10 @@ jobs:
|
||||
|
||||
- name: Commit changes
|
||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||
uses: EndBug/add-and-commit@v4
|
||||
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
|
||||
with:
|
||||
cwd: "api"
|
||||
add: "*.json"
|
||||
author_name: Revolt CI
|
||||
author_email: revolt-ci@users.noreply.github.com
|
||||
author_name: Stoat CI
|
||||
author_email: stoat-ci@users.noreply.github.com
|
||||
message: "chore: generate OpenAPI specification"
|
||||
|
||||
54
.github/workflows/triage_issue.yml
vendored
54
.github/workflows/triage_issue.yml
vendored
@@ -1,54 +0,0 @@
|
||||
name: Add Issue to Board
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
track_issue:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
query {
|
||||
organization(login: "stoatchat"){
|
||||
projectV2(number: 3) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
... on ProjectV2SingleSelectField {
|
||||
id
|
||||
name
|
||||
options {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add issue to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
ISSUE_ID: ${{ github.event.issue.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $issue:ID!) {
|
||||
addProjectV2ItemById(input: {projectId: $project, contentId: $issue}) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
79
.github/workflows/triage_pr.yml
vendored
79
.github/workflows/triage_pr.yml
vendored
@@ -1,79 +0,0 @@
|
||||
name: Add PR to Board
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, ready_for_review, review_requested]
|
||||
|
||||
jobs:
|
||||
track_pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get project data
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
query {
|
||||
organization(login: "stoatchat"){
|
||||
projectV2(number: 5) {
|
||||
id
|
||||
fields(first:20) {
|
||||
nodes {
|
||||
... on ProjectV2SingleSelectField {
|
||||
id
|
||||
name
|
||||
options {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}' > project_data.json
|
||||
|
||||
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
|
||||
echo 'INCOMING_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🆕 Untriaged") |.id' project_data.json) >> $GITHUB_ENV
|
||||
|
||||
- name: Add PR to project
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
PR_ID: ${{ github.event.pull_request.node_id }}
|
||||
run: |
|
||||
item_id="$( gh api graphql -f query='
|
||||
mutation($project:ID!, $pr:ID!) {
|
||||
addProjectV2ItemById(input: {projectId: $project, contentId: $pr}) {
|
||||
item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.item.id')"
|
||||
|
||||
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
|
||||
|
||||
- name: Set fields
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
mutation (
|
||||
$project: ID!
|
||||
$item: ID!
|
||||
$status_field: ID!
|
||||
$status_value: String!
|
||||
) {
|
||||
set_status: updateProjectV2ItemFieldValue(input: {
|
||||
projectId: $project
|
||||
itemId: $item
|
||||
fieldId: $status_field
|
||||
value: {
|
||||
singleSelectOptionId: $status_value
|
||||
}
|
||||
}) {
|
||||
projectV2Item {
|
||||
id
|
||||
}
|
||||
}
|
||||
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.INCOMING_OPTION_ID }} --silent
|
||||
20
.github/workflows/validate-pr-title.yml
vendored
Normal file
20
.github/workflows/validate-pr-title.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: "Lint PR"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- edited
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
main:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@v6
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,5 +12,4 @@ venv/
|
||||
.DS_Store
|
||||
|
||||
livekit.yml
|
||||
.idea
|
||||
start
|
||||
.idea
|
||||
3
.release-please-manifest.json
Normal file
3
.release-please-manifest.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
".": "0.9.1"
|
||||
}
|
||||
51
CHANGELOG.md
Normal file
51
CHANGELOG.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Changelog
|
||||
|
||||
## [0.9.1](https://github.com/stoatchat/stoatchat/compare/v0.9.0...v0.9.1) (2026-01-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** pipeline fixes (marked as fix to force release) ([#483](https://github.com/stoatchat/stoatchat/issues/483)) ([303e52b](https://github.com/stoatchat/stoatchat/commit/303e52b476585eea81c33837f1b01506ce387684))
|
||||
|
||||
## [0.9.0](https://github.com/stoatchat/stoatchat/compare/v0.8.8...v0.9.0) (2026-01-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add id field to role ([#470](https://github.com/stoatchat/stoatchat/issues/470)) ([2afea56](https://github.com/stoatchat/stoatchat/commit/2afea56e56017f02de98e67316b4457568ad5b26))
|
||||
* add ratelimits to gifbox ([1542047](https://github.com/stoatchat/stoatchat/commit/154204742d21cbeff6e2577b00f50b495ea44631))
|
||||
* include groups and dms in fetch mutuals ([caa8607](https://github.com/stoatchat/stoatchat/commit/caa86074680d46223cebc20f41e9c91c41ec825d))
|
||||
* include member payload in ServerMemberJoin event ([480f210](https://github.com/stoatchat/stoatchat/commit/480f210ce85271e13d1dac58a5dae08de108579d))
|
||||
* initial work on tenor gif searching ([b0c977b](https://github.com/stoatchat/stoatchat/commit/b0c977b324b8144c1152589546eb8fec5954c3e7))
|
||||
* make message lexer use unowned string ([1561481](https://github.com/stoatchat/stoatchat/commit/1561481eb4cdc0f385fbf0a81e4950408050e11f))
|
||||
* ready payload field customisation ([db57706](https://github.com/stoatchat/stoatchat/commit/db577067948f13e830b5fb773034e9713a1abaff))
|
||||
* require auth for search ([b5cd5e3](https://github.com/stoatchat/stoatchat/commit/b5cd5e30ef7d5e56e8964fb7c543965fa6bf5a4a))
|
||||
* trending and categories routes ([5885e06](https://github.com/stoatchat/stoatchat/commit/5885e067a627b8fff1c8ce2bf9e852ff8cf3f07a))
|
||||
* voice chats v2 ([#414](https://github.com/stoatchat/stoatchat/issues/414)) ([d567155](https://github.com/stoatchat/stoatchat/commit/d567155f124e4da74115b1a8f810062f7c6559d9))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add license to revolt-parser ([5335124](https://github.com/stoatchat/stoatchat/commit/53351243064cac8d499dd74284be73928fa78a43))
|
||||
* allow for disabling default features ([65fbd36](https://github.com/stoatchat/stoatchat/commit/65fbd3662462aed1333b79e59155fa6377e83fcc))
|
||||
* apple music to use original url instead of metadata url ([bfe4018](https://github.com/stoatchat/stoatchat/commit/bfe4018e436a4075bae780dd4d35a9b58315e12f))
|
||||
* apply uname fix to january and autumn ([8f9015a](https://github.com/stoatchat/stoatchat/commit/8f9015a6ff181d208d9269ab8691bd417d39811a))
|
||||
* **ci:** publish images under stoatchat and remove docker hub ([d65c1a1](https://github.com/stoatchat/stoatchat/commit/d65c1a1ab3bdc7e5684b03f280af77d881661a3d))
|
||||
* correct miniz_oxide in lockfile ([#478](https://github.com/stoatchat/stoatchat/issues/478)) ([5d27a91](https://github.com/stoatchat/stoatchat/commit/5d27a91e901dd2ea3e860aeaed8468db6c5f3214))
|
||||
* correct shebang for try-tag-and-release ([050ba16](https://github.com/stoatchat/stoatchat/commit/050ba16d4adad5d0fb247867aa3e94e3d42bd12d))
|
||||
* correct string_cache in lockfile ([#479](https://github.com/stoatchat/stoatchat/issues/479)) ([0b178fc](https://github.com/stoatchat/stoatchat/commit/0b178fc791583064bf9ca94b1d39b42d021e1d79))
|
||||
* don't remove timeouts when a member leaves a server ([#409](https://github.com/stoatchat/stoatchat/issues/409)) ([e635bc2](https://github.com/stoatchat/stoatchat/commit/e635bc23ec857d648d5705e1a3875d7bc3402b0d))
|
||||
* don't update the same field while trying to remove it ([f4ee35f](https://github.com/stoatchat/stoatchat/commit/f4ee35fb093ca49f0a64ff4b17fd61587df28145)), closes [#392](https://github.com/stoatchat/stoatchat/issues/392)
|
||||
* github webhook incorrect payload and formatting ([#468](https://github.com/stoatchat/stoatchat/issues/468)) ([dc9c82a](https://github.com/stoatchat/stoatchat/commit/dc9c82aa4e9667ea6639256c65ac8de37a24d1f7))
|
||||
* implement Serialize to ClientMessage ([dea0f67](https://github.com/stoatchat/stoatchat/commit/dea0f675dde7a63c7a59b38d469f878b7a8a3af4))
|
||||
* newly created roles should be ranked the lowest ([947eb15](https://github.com/stoatchat/stoatchat/commit/947eb15771ed6785b3dcd16c354c03ded5e4cbe0))
|
||||
* permit empty `remove` array in edit requests ([6ad3da5](https://github.com/stoatchat/stoatchat/commit/6ad3da5f35f989a2e7d8e29718b98374248e76af))
|
||||
* preserve order of replies in message ([#447](https://github.com/stoatchat/stoatchat/issues/447)) ([657a3f0](https://github.com/stoatchat/stoatchat/commit/657a3f08e5d652814bbf0647e089ed9ebb139bbf))
|
||||
* prevent timing out members which have TimeoutMembers permission ([e36fc97](https://github.com/stoatchat/stoatchat/commit/e36fc9738bac0de4f3fcbccba521f1e3754f7ae7))
|
||||
* relax settings name regex ([3a34159](https://github.com/stoatchat/stoatchat/commit/3a3415915f0d0fdce1499d47a2b7fa097f5946ea))
|
||||
* remove authentication tag bytes from attachment download ([32e6600](https://github.com/stoatchat/stoatchat/commit/32e6600272b885c595c094f0bc69459250220dcb))
|
||||
* rename openapi operation ids ([6048587](https://github.com/stoatchat/stoatchat/commit/6048587d348fbca0dc3a9b47690c56df8fece576)), closes [#406](https://github.com/stoatchat/stoatchat/issues/406)
|
||||
* respond with 201 if no body in requests ([#465](https://github.com/stoatchat/stoatchat/issues/465)) ([24fedf8](https://github.com/stoatchat/stoatchat/commit/24fedf8c4d9cd3160bdec97aa451520f8beaa739))
|
||||
* swap to using reqwest for query building ([38dd4d1](https://github.com/stoatchat/stoatchat/commit/38dd4d10797b3e6e397fc219e818f379bdff19f2))
|
||||
* use `trust_cloudflare` config value instead of env var ([cc7a796](https://github.com/stoatchat/stoatchat/commit/cc7a7962a882e1627fcd0bc75858a017415e8cfc))
|
||||
* use our own result types instead of tenors types ([a92152d](https://github.com/stoatchat/stoatchat/commit/a92152d86da136997817e797c7af8e38731cdde8))
|
||||
35
Cargo.lock
generated
35
Cargo.lock
generated
@@ -6519,7 +6519,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-autumn"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"axum-macros",
|
||||
@@ -6557,7 +6557,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-bonfire"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"async-channel 2.5.0",
|
||||
"async-std",
|
||||
@@ -6588,7 +6588,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-coalesced"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"indexmap 2.11.4",
|
||||
"lru 0.7.8",
|
||||
@@ -6597,7 +6597,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-config"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"cached",
|
||||
@@ -6614,7 +6614,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-crond"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"log",
|
||||
"revolt-config",
|
||||
@@ -6626,7 +6626,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-database"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"amqprs",
|
||||
"async-lock 2.8.0",
|
||||
@@ -6676,7 +6676,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-delta"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"amqprs",
|
||||
"async-channel 1.9.0",
|
||||
@@ -6726,7 +6726,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-files"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"aes-gcm",
|
||||
"aws-config",
|
||||
@@ -6749,7 +6749,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-gifbox"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"axum-extra",
|
||||
@@ -6771,7 +6771,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-january"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"async-recursion",
|
||||
"axum",
|
||||
@@ -6799,7 +6799,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-models"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"indexmap 1.9.3",
|
||||
"iso8601-timestamp",
|
||||
@@ -6818,14 +6818,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-parser"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"logos",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "revolt-permissions"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"async-trait",
|
||||
@@ -6840,7 +6840,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-presence"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"log",
|
||||
@@ -6852,7 +6852,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-pushd"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"amqprs",
|
||||
"anyhow",
|
||||
@@ -6880,7 +6880,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-ratelimits"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"authifier",
|
||||
@@ -6897,7 +6897,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "revolt-result"
|
||||
version = "0.8.9"
|
||||
version = "0.8.8"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"log",
|
||||
@@ -6905,6 +6905,7 @@ dependencies = [
|
||||
"revolt_rocket_okapi",
|
||||
"rocket",
|
||||
"schemars 0.8.22",
|
||||
"sentry",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"utoipa",
|
||||
|
||||
@@ -37,9 +37,6 @@ The services and libraries that power the Revolt service.<br/>
|
||||
|
||||
Rust 1.86.0 or higher.
|
||||
|
||||
> [!CAUTION]
|
||||
> The events server has a significant performance regression between Rust 1.77.2 and 1.78.0 onwards, see [issue #341](https://github.com/revoltchat/backend/issues/341). This is currently solved by build time options but we are looking for a proper fix.
|
||||
|
||||
## Development Guide
|
||||
|
||||
Before contributing, make yourself familiar with [our contribution guidelines](https://developers.revolt.chat/contrib.html) and the [technical documentation for this project](https://revoltchat.github.io/backend/).
|
||||
|
||||
@@ -54,7 +54,7 @@ use_starttls = false
|
||||
url = "http://livekit"
|
||||
lat = 0.0
|
||||
lon = 0.0
|
||||
key = "worldwide_key"
|
||||
key = "worldwide"
|
||||
secret = "ZjCofRlfm6GGtjlifmNpCDkcQbEIIVC0"
|
||||
|
||||
[files.s3]
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
# Code Style Guide
|
||||
|
||||
Beyond using Cargo format and Clippy, there are some specific code style guidelines laid out in this document for different parts of the project.
|
||||
|
||||
## Writing Style
|
||||
|
||||
- Shorten "identifier" to "Id" with that exact casing, i.e. Server Id.
|
||||
|
||||
## `core/database` crate
|
||||
|
||||
w.r.t. `model.rs` files
|
||||
|
||||
- All struct definitions must be commented.
|
||||
```rust
|
||||
/// Server
|
||||
pub struct Server {
|
||||
/// Name of the server
|
||||
pub name: String,
|
||||
```
|
||||
- Struct definitions should not include derives unless necessary (if additional traits such as Hash are required) and instead use `auto_derived!` and `auto_derived_partial!`.
|
||||
```rust
|
||||
auto_derived_partial!(
|
||||
/// Server
|
||||
pub struct Server { .. },
|
||||
"PartialServer"
|
||||
);
|
||||
```
|
||||
- `auto_derived!` macro accepts multiple entries and should be used as such:
|
||||
|
||||
```rust
|
||||
auto_derived!(
|
||||
/// Optional fields on server object
|
||||
pub enum FieldsServer { .. }
|
||||
|
||||
/// Optional fields on server object
|
||||
pub enum FieldsRole { .. }
|
||||
);
|
||||
```
|
||||
|
||||
- If special serialisation conditions are required, such as checking if a boolean is false, use the existing definitions for these functions from the crate root:
|
||||
```rust
|
||||
#[serde(skip_serializing_if = "crate::if_false", default)]
|
||||
```
|
||||
- `impl` blocks may be defined below the struct definitions and should be ordered in the same order of definition. Methods in the block must follow the same guidelines as traits where-in: methods are ordered in terms of CRUD, there are empty line breaks, and methods are commented.
|
||||
|
||||
w.r.t. `ops` module for models
|
||||
|
||||
- All traits must use a the name format `AbstractPlural` where Plural is the plural form of the collection. e.g. Servers
|
||||
- Traits defined must follow these guidelines:
|
||||
|
||||
- Methods are ordered in terms of CRUD, create-read-update-delete ordering.
|
||||
|
||||
```rust
|
||||
#[async_trait]
|
||||
pub trait AbstractServerMembers: Sync + Send {
|
||||
/// Insert a new server member into the database
|
||||
async fn insert_member(&self, member: &Member) -> Result<()>;
|
||||
|
||||
/// Fetch a server member by their id
|
||||
async fn fetch_member(&self, server_id: &str, user_id: &str) -> Result<Member>;
|
||||
|
||||
/// Update information for a server member
|
||||
async fn update_member(&self, .. ) -> Result<()>;
|
||||
|
||||
/// Delete a server member by their id
|
||||
async fn delete_member(&self, id: &MemberCompositeKey) -> Result<()>;
|
||||
}
|
||||
```
|
||||
|
||||
- There should be an empty line break between each method declaration.
|
||||
- All methods must have an appropriate comment.
|
||||
|
||||
- When implementing the trait defined in `ops.rs` with each driver, the method declaration style should be the same for ease of searching: same ordering, same comments, same line breaks.
|
||||
@@ -64,3 +64,10 @@ services:
|
||||
MAILDEV_WEB_PORT: 8080
|
||||
MAILDEV_INCOMING_USER: smtp
|
||||
MAILDEV_INCOMING_PASS: smtp
|
||||
|
||||
livekit:
|
||||
image: ghcr.io/stoatchat/livekit-server:v1.9.9
|
||||
command: --config /etc/livekit.yml
|
||||
network_mode: "host"
|
||||
volumes:
|
||||
- ./livekit.yml:/etc/livekit.yml
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-bonfire"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
edition = "2021"
|
||||
|
||||
@@ -41,8 +41,8 @@ authifier = { version = "1.0.15" }
|
||||
revolt-result = { path = "../core/result" }
|
||||
revolt-models = { path = "../core/models" }
|
||||
revolt-config = { path = "../core/config" }
|
||||
revolt-database = { path = "../core/database" }
|
||||
revolt-permissions = { version = "0.8.9", path = "../core/permissions" }
|
||||
revolt-database = { path = "../core/database", features = ["voice"] }
|
||||
revolt-permissions = { path = "../core/permissions" }
|
||||
revolt-presence = { path = "../core/presence", features = ["redis-is-patched"] }
|
||||
|
||||
# redis
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::collections::HashSet;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use futures::future::join_all;
|
||||
use revolt_database::{
|
||||
@@ -124,12 +124,7 @@ impl State {
|
||||
.unwrap_or_default();
|
||||
|
||||
// Fetch all memberships with their corresponding servers.
|
||||
let members: Vec<Member> = db.fetch_all_memberships(&user.id).await?;
|
||||
self.cache.members = members
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|x| (x.id.server.clone(), x))
|
||||
.collect();
|
||||
let mut members: Vec<Member> = db.fetch_all_memberships(&user.id).await?;
|
||||
|
||||
let server_ids: Vec<String> = members.iter().map(|x| x.id.server.clone()).collect();
|
||||
let servers = db.fetch_servers(&server_ids).await?;
|
||||
@@ -158,6 +153,51 @@ impl State {
|
||||
}
|
||||
}
|
||||
|
||||
let voice_states = if fields.voice_states {
|
||||
let mut voice_state_server_members: HashMap<String, HashSet<String>> = HashMap::new();
|
||||
|
||||
// fetch voice states for all the channels we can see
|
||||
let mut voice_states = Vec::new();
|
||||
|
||||
for channel in channels.iter().filter(|c| {
|
||||
matches!(
|
||||
c,
|
||||
Channel::DirectMessage { .. }
|
||||
| Channel::Group { .. }
|
||||
| Channel::TextChannel { voice: Some(_), .. }
|
||||
)
|
||||
}) {
|
||||
if let Ok(Some(voice_state)) = get_channel_voice_state(channel).await {
|
||||
if let Some(server) = channel.server() {
|
||||
let set = voice_state_server_members.entry(server.to_string()).or_default();
|
||||
|
||||
for participant in &voice_state.participants {
|
||||
user_ids.insert(participant.id.clone());
|
||||
set.insert(participant.id.clone());
|
||||
}
|
||||
} else {
|
||||
for participant in &voice_state.participants {
|
||||
user_ids.insert(participant.id.clone());
|
||||
}
|
||||
}
|
||||
|
||||
voice_states.push(voice_state);
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch all the members for for the participants who are in a server
|
||||
for (server, user_ids) in voice_state_server_members {
|
||||
let user_ids = user_ids.into_iter().collect::<Vec<_>>();
|
||||
let voice_members = db.fetch_members(&server, &user_ids).await?;
|
||||
|
||||
members.extend(voice_members);
|
||||
}
|
||||
|
||||
Some(voice_states)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
// Fetch presence data for known users.
|
||||
let online_ids = filter_online(&user_ids.iter().cloned().collect::<Vec<String>>()).await;
|
||||
|
||||
@@ -171,6 +211,12 @@ impl State {
|
||||
)
|
||||
.await?;
|
||||
|
||||
self.cache.members = members
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|x| (x.id.server.clone(), x))
|
||||
.collect();
|
||||
|
||||
// Fetch customisations.
|
||||
let emojis = if fields.emojis {
|
||||
Some(
|
||||
@@ -212,28 +258,6 @@ impl State {
|
||||
None
|
||||
};
|
||||
|
||||
let voice_states = if fields.voice_states {
|
||||
// fetch voice states for all the channels we can see
|
||||
let mut voice_states = Vec::new();
|
||||
|
||||
for channel in channels.iter().filter(|c| {
|
||||
matches!(
|
||||
c,
|
||||
Channel::DirectMessage { .. }
|
||||
| Channel::Group { .. }
|
||||
| Channel::TextChannel { voice: Some(_), .. }
|
||||
)
|
||||
}) {
|
||||
if let Ok(Some(voice_state)) = get_channel_voice_state(channel).await {
|
||||
voice_states.push(voice_state)
|
||||
}
|
||||
}
|
||||
|
||||
Some(voice_states)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
// Copy data into local state cache.
|
||||
self.cache.users = users.iter().cloned().map(|x| (x.id.clone(), x)).collect();
|
||||
self.cache
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
use std::{env, sync::Arc};
|
||||
use std::env;
|
||||
|
||||
use async_std::net::TcpListener;
|
||||
use revolt_presence::clear_region;
|
||||
use once_cell::sync::OnceCell;
|
||||
use revolt_database::voice::VoiceClient;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
@@ -14,15 +12,6 @@ pub mod events;
|
||||
mod database;
|
||||
mod websocket;
|
||||
|
||||
pub static VOICE_CLIENT: OnceCell<Arc<VoiceClient>> = OnceCell::new();
|
||||
|
||||
pub fn get_voice_client() -> Arc<VoiceClient> {
|
||||
VOICE_CLIENT
|
||||
.get()
|
||||
.expect("get_voice_client called before set")
|
||||
.clone()
|
||||
}
|
||||
|
||||
#[async_std::main]
|
||||
async fn main() {
|
||||
// Configure requirements for Bonfire.
|
||||
@@ -35,8 +24,6 @@ async fn main() {
|
||||
clear_region(None).await;
|
||||
}
|
||||
|
||||
VOICE_CLIENT.set(Arc::new(VoiceClient::from_revolt_config().await)).unwrap();
|
||||
|
||||
// Setup a TCP listener to accept WebSocket connections on.
|
||||
// By default, we bind to port 14703 on all interfaces.
|
||||
let bind = env::var("HOST").unwrap_or_else(|_| "0.0.0.0:14703".into());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-coalesced"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>", "Zomatree <me@zomatree.live>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-config"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -37,4 +37,4 @@ sentry = { version = "0.31.5", optional = true }
|
||||
sentry-anyhow = { version = "0.38.1", optional = true }
|
||||
|
||||
# Core
|
||||
revolt-result = { version = "0.8.9", path = "../result", optional = true }
|
||||
revolt-result = { version = "0.9.1", path = "../result", optional = true }
|
||||
|
||||
@@ -94,7 +94,7 @@ message_queue = "notifications.origin.message"
|
||||
mass_mention_queue = "notifications.origin.mass_mention" # handles messages that contain role or everyone mentions
|
||||
fr_accepted_queue = "notifications.ingest.fr_accepted" # friend request accepted
|
||||
fr_received_queue = "notifications.ingest.fr_received" # friend request received
|
||||
dm_call_queue = "notifications.ingest.dm_call" # friend request received
|
||||
dm_call_queue = "notifications.ingest.dm_call" # direct message voice call
|
||||
generic_queue = "notifications.ingest.generic" # generic messages (title + body)
|
||||
ack_queue = "notifications.process.ack" # updates badges for apple devices
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-database"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -18,25 +18,26 @@ async-std-runtime = ["async-std", "authifier/async-std-runtime"]
|
||||
rocket-impl = ["rocket", "schemars", "revolt_okapi", "revolt_rocket_okapi", "authifier/rocket_impl"]
|
||||
axum-impl = ["axum"]
|
||||
redis-is-patched = ["revolt-presence/redis-is-patched"]
|
||||
voice = ["livekit-api", "livekit-protocol", "livekit-runtime"]
|
||||
|
||||
# Default Features
|
||||
default = ["mongodb", "async-std-runtime", "tasks"]
|
||||
|
||||
[dependencies]
|
||||
# Core
|
||||
revolt-config = { version = "0.8.9", path = "../config", features = [
|
||||
revolt-config = { version = "0.9.1", path = "../config", features = [
|
||||
"report-macros",
|
||||
] }
|
||||
revolt-result = { version = "0.8.9", path = "../result" }
|
||||
revolt-models = { version = "0.8.9", path = "../models", features = [
|
||||
revolt-result = { version = "0.9.1", path = "../result" }
|
||||
revolt-models = { version = "0.9.1", path = "../models", features = [
|
||||
"validator",
|
||||
] }
|
||||
revolt-presence = { version = "0.8.9", path = "../presence" }
|
||||
revolt-permissions = { version = "0.8.9", path = "../permissions", features = [
|
||||
revolt-presence = { version = "0.9.1", path = "../presence" }
|
||||
revolt-permissions = { version = "0.9.1", path = "../permissions", features = [
|
||||
"serde",
|
||||
"bson",
|
||||
] }
|
||||
revolt-parser = { version = "0.8.9", path = "../parser" }
|
||||
revolt-parser = { version = "0.9.1", path = "../parser" }
|
||||
|
||||
# Utility
|
||||
log = "0.4"
|
||||
@@ -98,6 +99,6 @@ authifier = { version = "1.0.15" }
|
||||
amqprs = { version = "1.7.0" }
|
||||
|
||||
# Voice
|
||||
livekit-api = "0.4.4"
|
||||
livekit-protocol = "0.4.0"
|
||||
livekit-runtime = { version = "0.3.1", features = ["tokio"] }
|
||||
livekit-api = { version = "0.4.4", optional = true}
|
||||
livekit-protocol = { version = "0.4.0", optional = true }
|
||||
livekit-runtime = { version = "0.3.1", features = ["tokio"], optional = true }
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
],
|
||||
"roles": {
|
||||
"__ID:5__": {
|
||||
"_id": "__ID:5__",
|
||||
"name": "Moderator",
|
||||
"permissions": {
|
||||
"a": 545270208,
|
||||
@@ -55,6 +56,7 @@
|
||||
"rank": 1
|
||||
},
|
||||
"__ID:6__": {
|
||||
"_id": "__ID:6__",
|
||||
"name": "Owner",
|
||||
"permissions": {
|
||||
"a": 0,
|
||||
|
||||
@@ -295,7 +295,9 @@ pub enum EventV1 {
|
||||
},
|
||||
UserMoveVoiceChannel {
|
||||
node: String,
|
||||
token: String
|
||||
from: String,
|
||||
to: String,
|
||||
token: String,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ pub mod tasks;
|
||||
mod amqp;
|
||||
pub use amqp::amqp::AMQP;
|
||||
|
||||
#[cfg(feature = "voice")]
|
||||
pub mod voice;
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ struct MigrationInfo {
|
||||
revision: i32,
|
||||
}
|
||||
|
||||
pub const LATEST_REVISION: i32 = 48; // MUST BE +1 to last migration
|
||||
pub const LATEST_REVISION: i32 = 50; // MUST BE +1 to last migration
|
||||
|
||||
pub async fn migrate_database(db: &MongoDb) {
|
||||
let migrations = db.col::<Document>("migrations");
|
||||
@@ -1246,8 +1246,8 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
||||
.expect("Failed to update voice channels");
|
||||
};
|
||||
|
||||
if revision <= 47 {
|
||||
info!("Running migration [revision 47 / 29-04-2025]: Add Video to default permissions");
|
||||
if revision <= 48 {
|
||||
info!("Running migration [revision 48 / 22-10-2025]: Add Video + Listen to default permissions");
|
||||
|
||||
db.col::<Document>("servers")
|
||||
.update_many(
|
||||
@@ -1255,7 +1255,7 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
||||
doc! {
|
||||
"$bit": {
|
||||
"default_permissions": {
|
||||
"or": ChannelPermission::Video as i64
|
||||
"or": (ChannelPermission::Video + ChannelPermission::Speak + ChannelPermission::Listen) as i64
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1264,6 +1264,48 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
||||
.expect("Failed to update default_permissions");
|
||||
};
|
||||
|
||||
if revision <= 49 {
|
||||
info!("Running migration [revision 49 / 12-12-2025]: Add _id key to roles");
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
struct Server {
|
||||
#[serde(rename = "_id")]
|
||||
pub id: String,
|
||||
#[serde(default = "HashMap::<String, Document>::new")]
|
||||
pub roles: HashMap<String, Document>,
|
||||
}
|
||||
|
||||
let mut servers = db
|
||||
.db()
|
||||
.collection::<Server>("servers")
|
||||
.find(doc! {
|
||||
"roles": {
|
||||
"$exists": true,
|
||||
"$ne": {}
|
||||
}
|
||||
})
|
||||
.await
|
||||
.unwrap()
|
||||
.map(|res| res.expect("Failed to decode Server { id, roles }"));
|
||||
|
||||
while let Some(server) = servers.next().await {
|
||||
let mut doc = doc! {};
|
||||
|
||||
for id in server.roles.keys() {
|
||||
doc.insert(
|
||||
format!("roles.{id}._id"),
|
||||
id,
|
||||
);
|
||||
}
|
||||
|
||||
db.db()
|
||||
.collection::<Server>("servers")
|
||||
.update_one(doc! { "_id": &server.id }, doc! { "$set": doc })
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
};
|
||||
|
||||
// Reminder to update LATEST_REVISION when adding new migrations.
|
||||
LATEST_REVISION.max(revision)
|
||||
}
|
||||
|
||||
@@ -443,7 +443,8 @@ impl Message {
|
||||
}
|
||||
|
||||
// Verify replies are valid.
|
||||
let mut replies = HashSet::new();
|
||||
let mut replies = Vec::new();
|
||||
|
||||
if let Some(entries) = data.replies {
|
||||
if entries.len() > config.features.limits.global.message_replies {
|
||||
return Err(create_error!(TooManyReplies {
|
||||
@@ -451,6 +452,8 @@ impl Message {
|
||||
}));
|
||||
}
|
||||
|
||||
replies.reserve(entries.len());
|
||||
|
||||
for ReplyIntent {
|
||||
id,
|
||||
mention,
|
||||
@@ -464,7 +467,12 @@ impl Message {
|
||||
user_mentions.insert(message.author.to_owned());
|
||||
}
|
||||
|
||||
replies.insert(message.id);
|
||||
// This is O(n^2), but this is faster than a HashSet
|
||||
// when n < 20; as long as the message_replies limit
|
||||
// is reasonable, this will be fast.
|
||||
if !replies.contains(&message.id) {
|
||||
replies.push(message.id);
|
||||
}
|
||||
}
|
||||
// If the referenced message doesn't exist and fail_if_not_exists
|
||||
// is set to false, send the message without the reply.
|
||||
@@ -537,9 +545,7 @@ impl Message {
|
||||
}
|
||||
|
||||
if !replies.is_empty() {
|
||||
message
|
||||
.replies
|
||||
.replace(replies.into_iter().collect::<Vec<String>>());
|
||||
message.replies.replace(replies);
|
||||
}
|
||||
|
||||
// Calculate final message flags
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use iso8601_timestamp::Timestamp;
|
||||
use revolt_permissions::{calculate_channel_permissions, ChannelPermission};
|
||||
use revolt_result::{create_error, Result};
|
||||
use crate::voice::get_channel_voice_state;
|
||||
|
||||
use crate::{
|
||||
events::client::EventV1, util::permissions::DatabasePermissionQuery, Channel,
|
||||
@@ -148,10 +147,12 @@ impl Member {
|
||||
|
||||
let emojis = db.fetch_emoji_by_parent_id(&server.id).await?;
|
||||
|
||||
#[allow(unused_mut)]
|
||||
let mut voice_states = Vec::new();
|
||||
|
||||
#[cfg(feature = "voice")]
|
||||
for channel in &channels {
|
||||
if let Ok(Some(voice_state)) = get_channel_voice_state(channel).await {
|
||||
if let Ok(Some(voice_state)) = crate::voice::get_channel_voice_state(channel).await {
|
||||
voice_states.push(voice_state)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,8 +336,8 @@ impl IntoDocumentPath for FieldsMember {
|
||||
FieldsMember::Nickname => "nickname",
|
||||
FieldsMember::Roles => "roles",
|
||||
FieldsMember::Timeout => "timeout",
|
||||
FieldsMember::CanPublish => "is_publishing",
|
||||
FieldsMember::CanReceive => "is_receiving",
|
||||
FieldsMember::CanPublish => "can_publish",
|
||||
FieldsMember::CanReceive => "can_receive",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@ auto_derived_partial!(
|
||||
auto_derived_partial!(
|
||||
/// Role
|
||||
pub struct Role {
|
||||
/// Unique Id
|
||||
#[serde(rename = "_id")]
|
||||
pub id: String,
|
||||
/// Role name
|
||||
pub name: String,
|
||||
/// Permissions available to this role
|
||||
@@ -246,7 +249,6 @@ impl Server {
|
||||
role.update(
|
||||
db,
|
||||
&self.id,
|
||||
role_id,
|
||||
PartialRole {
|
||||
permissions: Some(permissions),
|
||||
..Default::default()
|
||||
@@ -297,6 +299,7 @@ impl Role {
|
||||
/// Into optional struct
|
||||
pub fn into_optional(self) -> PartialRole {
|
||||
PartialRole {
|
||||
id: Some(self.id),
|
||||
name: Some(self.name),
|
||||
permissions: Some(self.permissions),
|
||||
colour: self.colour,
|
||||
@@ -306,20 +309,29 @@ impl Role {
|
||||
}
|
||||
|
||||
/// Create a role
|
||||
pub async fn create(&self, db: &Database, server_id: &str) -> Result<String> {
|
||||
let role_id = Ulid::new().to_string();
|
||||
db.insert_role(server_id, &role_id, self).await?;
|
||||
pub async fn create(db: &Database, server: &Server, name: String) -> Result<Self> {
|
||||
let role = Role {
|
||||
id: Ulid::new().to_string(),
|
||||
name,
|
||||
// Rank of the new role should be below the lowest role
|
||||
rank: server.roles.len() as i64,
|
||||
colour: None,
|
||||
hoist: false,
|
||||
permissions: Default::default(),
|
||||
};
|
||||
|
||||
db.insert_role(&server.id, &role).await?;
|
||||
|
||||
EventV1::ServerRoleUpdate {
|
||||
id: server_id.to_string(),
|
||||
role_id: role_id.to_string(),
|
||||
data: self.clone().into_optional().into(),
|
||||
id: server.id.clone(),
|
||||
role_id: role.id.clone(),
|
||||
data: role.clone().into_optional().into(),
|
||||
clear: vec![],
|
||||
}
|
||||
.p(server_id.to_string())
|
||||
.p(server.id.clone())
|
||||
.await;
|
||||
|
||||
Ok(role_id)
|
||||
Ok(role)
|
||||
}
|
||||
|
||||
/// Update server data
|
||||
@@ -327,7 +339,6 @@ impl Role {
|
||||
&mut self,
|
||||
db: &Database,
|
||||
server_id: &str,
|
||||
role_id: &str,
|
||||
partial: PartialRole,
|
||||
remove: Vec<FieldsRole>,
|
||||
) -> Result<()> {
|
||||
@@ -337,14 +348,14 @@ impl Role {
|
||||
|
||||
self.apply_options(partial.clone());
|
||||
|
||||
db.update_role(server_id, role_id, &partial, remove.clone())
|
||||
db.update_role(server_id, &self.id, &partial, remove.clone())
|
||||
.await?;
|
||||
|
||||
EventV1::ServerRoleUpdate {
|
||||
id: server_id.to_string(),
|
||||
role_id: role_id.to_string(),
|
||||
role_id: self.id.clone(),
|
||||
data: partial.into(),
|
||||
clear: vec![],
|
||||
clear: remove.into_iter().map(Into::into).collect(),
|
||||
}
|
||||
.p(server_id.to_string())
|
||||
.await;
|
||||
@@ -360,15 +371,15 @@ impl Role {
|
||||
}
|
||||
|
||||
/// Delete a role
|
||||
pub async fn delete(self, db: &Database, server_id: &str, role_id: &str) -> Result<()> {
|
||||
pub async fn delete(self, db: &Database, server_id: &str) -> Result<()> {
|
||||
EventV1::ServerRoleDelete {
|
||||
id: server_id.to_string(),
|
||||
role_id: role_id.to_string(),
|
||||
role_id: self.id.clone(),
|
||||
}
|
||||
.p(server_id.to_string())
|
||||
.await;
|
||||
|
||||
db.delete_role(server_id, role_id).await
|
||||
db.delete_role(server_id, &self.id).await
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ pub trait AbstractServers: Sync + Send {
|
||||
async fn delete_server(&self, id: &str) -> Result<()>;
|
||||
|
||||
/// Insert a new role into server object
|
||||
async fn insert_role(&self, server_id: &str, role_id: &str, role: &Role) -> Result<()>;
|
||||
async fn insert_role(&self, server_id: &str, role: &Role) -> Result<()>;
|
||||
|
||||
/// Update an existing role on a server
|
||||
async fn update_role(
|
||||
|
||||
@@ -69,7 +69,7 @@ impl AbstractServers for MongoDb {
|
||||
}
|
||||
|
||||
/// Insert a new role into server object
|
||||
async fn insert_role(&self, server_id: &str, role_id: &str, role: &Role) -> Result<()> {
|
||||
async fn insert_role(&self, server_id: &str, role: &Role) -> Result<()> {
|
||||
self.col::<Document>(COL)
|
||||
.update_one(
|
||||
doc! {
|
||||
@@ -77,7 +77,7 @@ impl AbstractServers for MongoDb {
|
||||
},
|
||||
doc! {
|
||||
"$set": {
|
||||
"roles.".to_owned() + role_id: to_document(role)
|
||||
"roles.".to_owned() + &role.id: to_document(role)
|
||||
.map_err(|_| create_database_error!("to_document", "role"))?
|
||||
}
|
||||
},
|
||||
|
||||
@@ -72,10 +72,10 @@ impl AbstractServers for ReferenceDb {
|
||||
}
|
||||
|
||||
/// Insert a new role into server object
|
||||
async fn insert_role(&self, server_id: &str, role_id: &str, role: &Role) -> Result<()> {
|
||||
async fn insert_role(&self, server_id: &str, role: &Role) -> Result<()> {
|
||||
let mut servers = self.servers.lock().await;
|
||||
if let Some(server) = servers.get_mut(server_id) {
|
||||
server.roles.insert(role_id.to_string(), role.clone());
|
||||
server.roles.insert(role.id.clone(), role.clone());
|
||||
Ok(())
|
||||
} else {
|
||||
Err(create_error!(NotFound))
|
||||
|
||||
@@ -896,6 +896,7 @@ impl From<SystemMessageChannels> for crate::SystemMessageChannels {
|
||||
impl From<crate::Role> for Role {
|
||||
fn from(value: crate::Role) -> Self {
|
||||
Role {
|
||||
id: value.id,
|
||||
name: value.name,
|
||||
permissions: value.permissions,
|
||||
colour: value.colour,
|
||||
@@ -908,6 +909,7 @@ impl From<crate::Role> for Role {
|
||||
impl From<Role> for crate::Role {
|
||||
fn from(value: Role) -> crate::Role {
|
||||
crate::Role {
|
||||
id: value.id,
|
||||
name: value.name,
|
||||
permissions: value.permissions,
|
||||
colour: value.colour,
|
||||
@@ -920,6 +922,7 @@ impl From<Role> for crate::Role {
|
||||
impl From<crate::PartialRole> for PartialRole {
|
||||
fn from(value: crate::PartialRole) -> Self {
|
||||
PartialRole {
|
||||
id: value.id,
|
||||
name: value.name,
|
||||
permissions: value.permissions,
|
||||
colour: value.colour,
|
||||
@@ -932,6 +935,7 @@ impl From<crate::PartialRole> for PartialRole {
|
||||
impl From<PartialRole> for crate::PartialRole {
|
||||
fn from(value: PartialRole) -> crate::PartialRole {
|
||||
crate::PartialRole {
|
||||
id: value.id,
|
||||
name: value.name,
|
||||
permissions: value.permissions,
|
||||
colour: value.colour,
|
||||
|
||||
@@ -16,7 +16,7 @@ mod voice_client;
|
||||
pub use voice_client::VoiceClient;
|
||||
|
||||
async fn get_connection() -> Result<Conn> {
|
||||
_get_connection().await.to_internal_error()
|
||||
_get_connection().await.map_err(|_| create_error!(InternalError))
|
||||
}
|
||||
|
||||
pub async fn raise_if_in_voice(user: &User, channel_id: &str) -> Result<()> {
|
||||
@@ -35,7 +35,7 @@ pub async fn raise_if_in_voice(user: &User, channel_id: &str) -> Result<()> {
|
||||
.to_internal_error()?
|
||||
> 0
|
||||
{
|
||||
Err(create_error!(NotConnected))
|
||||
Err(create_error!(AlreadyConnected))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
@@ -564,3 +564,35 @@ pub async fn get_call_notification_recipients(
|
||||
.await
|
||||
.to_internal_error()
|
||||
}
|
||||
|
||||
pub async fn remove_user_from_voice_channels(db: &Database, voice_client: &VoiceClient, user_id: &str) -> Result<()> {
|
||||
for channel_id in get_user_voice_channels(user_id).await? {
|
||||
remove_user_from_voice_channel(db, voice_client, &channel_id, user_id).await?;
|
||||
};
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn remove_user_from_voice_channel(db: &Database, voice_client: &VoiceClient, channel_id: &str, user_id: &str) -> Result<()> {
|
||||
if let Some(node) = get_channel_node(channel_id).await? {
|
||||
let _ = voice_client.remove_user(&node, user_id, channel_id).await;
|
||||
}
|
||||
|
||||
let channel = Reference::from_unchecked(channel_id).as_channel(db).await?;
|
||||
|
||||
delete_voice_state(channel_id, channel.server(), user_id).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn delete_voice_channel(voice_client: &VoiceClient, channel_id: &str, server_id: Option<&str>) -> Result<()> {
|
||||
if let Some(users) = get_voice_channel_members(channel_id).await? {
|
||||
let node = get_channel_node(channel_id).await?.unwrap();
|
||||
|
||||
voice_client.delete_room(&node, channel_id).await?;
|
||||
|
||||
delete_channel_voice_state(channel_id, server_id, &users).await?;
|
||||
};
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<!-- Compiled with Bootstrap Email version: 1.6.0 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||
@@ -42,7 +42,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||
<img alt="Revolt Logo" class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
<img alt="Stoat Logo" class="w-24" src="https://stoat.chat/favicon.svg" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -107,7 +107,7 @@
|
||||
</table>
|
||||
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||
This email is intended for {{email}}<br>
|
||||
Sent from Revolt<br>
|
||||
Sent from Stoat<br>
|
||||
Made in Europe
|
||||
</div>
|
||||
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||
|
||||
@@ -1,38 +1,37 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img
|
||||
alt="Revolt Logo"
|
||||
class="ax-center my-10 w-24"
|
||||
src="https://app.revolt.chat/assets/logo_round.png"
|
||||
/>
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Account Deletion</h1>
|
||||
<p>
|
||||
You requested to have your account deleted, if you did not perform
|
||||
this action please take measures to secure your account immediately.
|
||||
</p>
|
||||
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Confirm</a>
|
||||
</div>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Revolt<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img alt="Stoat Logo" class="ax-center my-10 w-24" src="https://stoat.chat/favicon.svg" />
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Account Deletion</h1>
|
||||
<p>
|
||||
You requested to have your account deleted, if you did not perform
|
||||
this action please take measures to secure your account immediately.
|
||||
</p>
|
||||
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Confirm</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Stoat<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@ You requested to have your account deleted, if you did not perform this action p
|
||||
Please navigate to: {{url}}
|
||||
|
||||
This email is intended for {{email}}
|
||||
Sent by Revolt
|
||||
Sent by Stoat
|
||||
Made in Europe
|
||||
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||
|
||||
@@ -4,6 +4,6 @@ Please navigate to: {{url}}
|
||||
|
||||
This email is intended for {{email}}
|
||||
|
||||
This email has no association with Revolt or Revolt Platforms Ltd.
|
||||
This email has no association with Stoat or Revolt Platforms Ltd.
|
||||
Learn more about third party instances here:
|
||||
https://developers.revolt.chat/faq.html
|
||||
https://developers.stoat.chat/faq.html
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<!-- Compiled with Bootstrap Email version: 1.6.0 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||
@@ -42,7 +42,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||
<img class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
<img class="w-24" src="https://stoat.chat/favicon.svg" alt="Stoat Logo" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -120,7 +120,7 @@
|
||||
</table>
|
||||
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||
This email is intended for {{email}}<br>
|
||||
Sent from Revolt<br>
|
||||
Sent from Stoat<br>
|
||||
Made in Europe
|
||||
</div>
|
||||
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
<div class="container">
|
||||
<img
|
||||
class="ax-center my-10 w-24"
|
||||
src="https://app.revolt.chat/assets/logo_round.png"
|
||||
src="https://stoat.chat/favicon.svg"
|
||||
alt="Stoat Logo"
|
||||
/>
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Password Reset</h1>
|
||||
@@ -25,7 +26,7 @@
|
||||
</div>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Revolt<br />
|
||||
Sent from Stoat<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
|
||||
@@ -8,7 +8,7 @@ password on it, click below to continue.
|
||||
Please navigate to: {{url}}
|
||||
|
||||
This email is intended for {{email}}
|
||||
Sent by Revolt
|
||||
Sent by Stoat
|
||||
Made in Europe
|
||||
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<!-- Compiled with Bootstrap Email version: 1.6.0 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||
@@ -42,7 +42,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||
<img class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
<img class="w-24" src="https://stoat.chat/favicon.svg" alt="Stoat Logo" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -104,7 +104,7 @@
|
||||
</table>
|
||||
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||
This email is intended for {{email}}<br>
|
||||
Sent from Revolt<br>
|
||||
Sent from Stoat<br>
|
||||
Made in Europe
|
||||
</div>
|
||||
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img
|
||||
class="ax-center my-10 w-24"
|
||||
src="https://app.revolt.chat/assets/logo_round.png"
|
||||
/>
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Password Reset</h1>
|
||||
<p>You requested a password reset, click below to continue.</p>
|
||||
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Reset</a>
|
||||
</div>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Revolt<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img class="ax-center my-10 w-24" src="https://stoat.chat/favicon.svg" alt="Stoat Logo" />
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Password Reset</h1>
|
||||
<p>You requested a password reset, click below to continue.</p>
|
||||
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Reset</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Stoat<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@ You requested a password reset, if you did not perform this action you can safel
|
||||
Please navigate to: {{url}}
|
||||
|
||||
This email is intended for {{email}}
|
||||
Sent by Revolt
|
||||
Sent by Stoat
|
||||
Made in Europe
|
||||
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<!-- Compiled with Bootstrap Email version: 1.6.0 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||
@@ -42,7 +42,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||
<img alt="Revolt Logo" class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
<img class="w-24" src="https://stoat.chat/favicon.svg" alt="Stoat Logo" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -134,7 +134,7 @@
|
||||
</table>
|
||||
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||
This email is intended for {{email}}<br>
|
||||
Sent from Revolt<br>
|
||||
Sent from Stoat<br>
|
||||
Made in Europe
|
||||
</div>
|
||||
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||
|
||||
@@ -1,46 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img
|
||||
alt="Revolt Logo"
|
||||
class="ax-center my-10 w-24"
|
||||
src="https://app.revolt.chat/assets/logo_round.png"
|
||||
/>
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Account Suspended</h1>
|
||||
<p>Your account has been suspended, for one or more reasons:</p>
|
||||
<ul>
|
||||
{{list}}
|
||||
</ul>
|
||||
<p style="display:{{duration_display}}">
|
||||
You will be able to use your account again in {{duration}} days.
|
||||
</p>
|
||||
<p>
|
||||
Further violations may result in a permanent ban depending on
|
||||
severity, please abide by the
|
||||
<a href="https://revolt.chat/aup">Acceptable Usage Policy</a>.
|
||||
</p>
|
||||
<p>Ban evasion is prohibited and will be dealt with accordingly.</p>
|
||||
</div>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Revolt<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img class="ax-center my-10 w-24" src="https://stoat.chat/favicon.svg" alt="Stoat Logo" />
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Account Suspended</h1>
|
||||
<p>Your account has been suspended, for one or more reasons:</p>
|
||||
<ul>
|
||||
{{list}}
|
||||
</ul>
|
||||
<p style="display:{{duration_display}}">
|
||||
You will be able to use your account again in {{duration}} days.
|
||||
</p>
|
||||
<p>
|
||||
Further violations may result in a permanent ban depending on
|
||||
severity, please abide by the
|
||||
<a href="https://revolt.chat/aup">Acceptable Usage Policy</a>.
|
||||
</p>
|
||||
<p>Ban evasion is prohibited and will be dealt with accordingly.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Stoat<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -8,7 +8,7 @@ Further violations may result in a permanent ban depending on severity, please a
|
||||
Ban evasion is prohibited and will be dealt with accordingly.
|
||||
|
||||
This email is intended for {{email}}
|
||||
Sent by Revolt
|
||||
Sent by Stoat
|
||||
Made in Europe
|
||||
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<!-- Compiled with Bootstrap Email version: 1.5.1 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<!-- Compiled with Bootstrap Email version: 1.6.0 --><meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
||||
@@ -42,7 +42,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="line-height: 24px; font-size: 16px; margin: 0;" align="left">
|
||||
<img alt="Revolt Logo" class="w-24" src="https://app.revolt.chat/assets/logo_round.png" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
<img class="w-24" src="https://stoat.chat/favicon.svg" alt="Stoat Logo" style="height: auto; line-height: 100%; outline: none; text-decoration: none; display: block; width: 96px; border-style: none; border-width: 0;" width="96">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -104,7 +104,7 @@
|
||||
</table>
|
||||
<div class="text-muted text-center" style="color: #718096;" align="center">
|
||||
This email is intended for {{email}}<br>
|
||||
Sent from Revolt<br>
|
||||
Sent from Stoat<br>
|
||||
Made in Europe
|
||||
</div>
|
||||
<table class="s-6 w-full" role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img
|
||||
alt="Revolt Logo"
|
||||
class="ax-center my-10 w-24"
|
||||
src="https://app.revolt.chat/assets/logo_round.png"
|
||||
/>
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Almost there!</h1>
|
||||
<p>To complete your sign up, we just need to verify your email.</p>
|
||||
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Confirm</a>
|
||||
</div>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Revolt<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<style>
|
||||
/* Add custom classes and styles that you want inlined here */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-light">
|
||||
<div class="container">
|
||||
<img class="ax-center my-10 w-24" src="https://stoat.chat/favicon.svg" alt="Stoat Logo" />
|
||||
<div class="card p-6 p-lg-10 space-y-4">
|
||||
<h1 class="h3 fw-700">Almost there!</h1>
|
||||
<p>To complete your sign up, we just need to verify your email.</p>
|
||||
<a class="btn btn-primary p-3 fw-700" href="{{url}}">Confirm</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<div class="text-muted text-center my-6">
|
||||
This email is intended for {{email}}<br />
|
||||
Sent from Stoat<br />
|
||||
Made in Europe
|
||||
</div>
|
||||
<div class="text-muted text-xs my-6 ax-center">
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the
|
||||
laws of England and Wales.<br />
|
||||
Registered Company Number: 16260658<br />
|
||||
Registered Office:<br />
|
||||
Suite 5703 Unit 3A, 34-35 Hatton Garden,<br />
|
||||
Holborn, United Kingdom, EC1N 8DX
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,7 +4,7 @@ To complete your sign up, we just need to verify your email.
|
||||
Please navigate to: {{url}}
|
||||
|
||||
This email is intended for {{email}}
|
||||
Sent by Revolt
|
||||
Sent by Stoat
|
||||
Made in Europe
|
||||
|
||||
Revolt Platforms Ltd. is a company incorporated and registered under the laws of England and Wales.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-files"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -20,10 +20,10 @@ typenum = "1.17.0"
|
||||
aws-config = "1.5.5"
|
||||
aws-sdk-s3 = { version = "1.46.0", features = ["behavior-version-latest"] }
|
||||
|
||||
revolt-config = { version = "0.8.9", path = "../config", features = [
|
||||
revolt-config = { version = "0.9.1", path = "../config", features = [
|
||||
"report-macros",
|
||||
] }
|
||||
revolt-result = { version = "0.8.9", path = "../result" }
|
||||
revolt-result = { version = "0.9.1", path = "../result" }
|
||||
|
||||
# image processing
|
||||
jxl-oxide = "0.8.1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-models"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -20,8 +20,8 @@ default = ["serde", "partials", "rocket"]
|
||||
|
||||
[dependencies]
|
||||
# Core
|
||||
revolt-config = { version = "0.8.9", path = "../config" }
|
||||
revolt-permissions = { version = "0.8.9", path = "../permissions" }
|
||||
revolt-config = { version = "0.9.1", path = "../config" }
|
||||
revolt-permissions = { version = "0.9.1", path = "../permissions" }
|
||||
|
||||
# Utility
|
||||
regex = "1.11"
|
||||
|
||||
@@ -85,6 +85,9 @@ auto_derived_partial!(
|
||||
auto_derived_partial!(
|
||||
/// Role
|
||||
pub struct Role {
|
||||
/// Unique Id
|
||||
#[cfg_attr(feature = "serde", serde(rename = "_id"))]
|
||||
pub id: String,
|
||||
/// Role name
|
||||
pub name: String,
|
||||
/// Permissions available to this role
|
||||
@@ -181,6 +184,7 @@ auto_derived!(
|
||||
}
|
||||
|
||||
/// Response after creating new role
|
||||
// TODO: remove this in favor of just Role
|
||||
pub struct NewRoleResponse {
|
||||
/// Id of the role
|
||||
pub id: String,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-parser"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Zomatree <me@zomatree.live>", "Paul Makles <me@insrt.uk>"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-permissions"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -21,7 +21,7 @@ async-std = { version = "1.8.0", features = ["attributes"] }
|
||||
|
||||
[dependencies]
|
||||
# Core
|
||||
revolt-result = { version = "0.8.9", path = "../result" }
|
||||
revolt-result = { version = "0.9.1", path = "../result" }
|
||||
|
||||
# Utility
|
||||
auto_ops = "0.3.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-presence"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -16,7 +16,7 @@ redis-is-patched = []
|
||||
async-std = { version = "1.8.0", features = ["attributes"] }
|
||||
|
||||
# Config for loading Redis URI
|
||||
revolt-config = { version = "0.8.9", path = "../config" }
|
||||
revolt-config = { version = "0.9.1", path = "../config" }
|
||||
|
||||
[dependencies]
|
||||
# Utility
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-ratelimits"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2024"
|
||||
|
||||
[features]
|
||||
@@ -10,9 +10,9 @@ axum = ["dep:axum", "revolt-database/axum-impl"]
|
||||
default = ["rocket", "axum"]
|
||||
|
||||
[dependencies]
|
||||
revolt-database = { version = "0.8.9", path = "../database"}
|
||||
revolt-result = { version = "0.8.9", path = "../result" }
|
||||
revolt-config = { version = "0.8.9", path = "../config" }
|
||||
revolt-database = { version = "0.9.1", path = "../database"}
|
||||
revolt-result = { version = "0.9.1", path = "../result" }
|
||||
revolt-config = { version = "0.9.1", path = "../config" }
|
||||
|
||||
rocket = { version = "0.5.1", optional = true }
|
||||
revolt_rocket_okapi = { version = "0.10.0", optional = true }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-result"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
@@ -15,8 +15,9 @@ utoipa = ["dep:utoipa"]
|
||||
rocket = ["dep:rocket", "dep:serde_json"]
|
||||
axum = ["dep:axum", "dep:serde_json"]
|
||||
okapi = ["dep:revolt_rocket_okapi", "dep:revolt_okapi", "schemas"]
|
||||
sentry = ["dep:sentry"]
|
||||
|
||||
default = ["serde"]
|
||||
default = ["serde", "sentry"]
|
||||
|
||||
[dependencies]
|
||||
# Serialisation
|
||||
@@ -36,3 +37,5 @@ revolt_okapi = { version = "0.9.1", optional = true }
|
||||
log = "0.4"
|
||||
# Axum
|
||||
axum = { version = "0.7.5", optional = true }
|
||||
|
||||
sentry = { version = "0.31.5", optional = true }
|
||||
@@ -62,6 +62,7 @@ impl IntoResponse for Error {
|
||||
ErrorType::NotPrivileged => StatusCode::FORBIDDEN,
|
||||
ErrorType::CannotGiveMissingPermissions => StatusCode::FORBIDDEN,
|
||||
ErrorType::NotOwner => StatusCode::FORBIDDEN,
|
||||
ErrorType::IsElevated => StatusCode::FORBIDDEN,
|
||||
|
||||
ErrorType::DatabaseError { .. } => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
ErrorType::InternalError => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
|
||||
@@ -139,6 +139,7 @@ pub enum ErrorType {
|
||||
NotPrivileged,
|
||||
CannotGiveMissingPermissions,
|
||||
NotOwner,
|
||||
IsElevated,
|
||||
|
||||
// ? General errors
|
||||
DatabaseError {
|
||||
@@ -226,7 +227,7 @@ pub trait ToRevoltError<T> {
|
||||
fn to_internal_error(self) -> Result<T, Error>;
|
||||
}
|
||||
|
||||
impl<T, E: std::fmt::Debug> ToRevoltError<T> for Result<T, E> {
|
||||
impl<T, E: std::fmt::Debug + std::error::Error> ToRevoltError<T> for Result<T, E> {
|
||||
#[track_caller]
|
||||
fn to_internal_error(self) -> Result<T, Error> {
|
||||
let loc = Location::caller();
|
||||
@@ -234,6 +235,8 @@ impl<T, E: std::fmt::Debug> ToRevoltError<T> for Result<T, E> {
|
||||
self
|
||||
.map_err(|e| {
|
||||
log::error!("{e:?}");
|
||||
#[cfg(feature = "sentry")]
|
||||
sentry::capture_error(&e);
|
||||
|
||||
Error {
|
||||
error_type: ErrorType::InternalError,
|
||||
|
||||
@@ -69,6 +69,7 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
ErrorType::NotPrivileged => Status::Forbidden,
|
||||
ErrorType::CannotGiveMissingPermissions => Status::Forbidden,
|
||||
ErrorType::NotOwner => Status::Forbidden,
|
||||
ErrorType::IsElevated => Status::Forbidden,
|
||||
|
||||
ErrorType::DatabaseError { .. } => Status::InternalServerError,
|
||||
ErrorType::InternalError => Status::InternalServerError,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-crond"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <me@insrt.uk>"]
|
||||
edition = "2021"
|
||||
@@ -16,7 +16,7 @@ log = "0.4"
|
||||
tokio = { version = "1" }
|
||||
|
||||
# Core
|
||||
revolt-database = { version = "0.8.9", path = "../../core/database" }
|
||||
revolt-result = { version = "0.8.9", path = "../../core/result" }
|
||||
revolt-config = { version = "0.8.9", path = "../../core/config" }
|
||||
revolt-files = { version = "0.8.9", path = "../../core/files" }
|
||||
revolt-database = { version = "0.9.1", path = "../../core/database" }
|
||||
revolt-result = { version = "0.9.1", path = "../../core/result" }
|
||||
revolt-config = { version = "0.9.1", path = "../../core/config" }
|
||||
revolt-files = { version = "0.9.1", path = "../../core/files" }
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
[package]
|
||||
name = "revolt-pushd"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
|
||||
[dependencies]
|
||||
revolt-result = { version = "0.8.9", path = "../../core/result" }
|
||||
revolt-config = { version = "0.8.9", path = "../../core/config", features = [
|
||||
revolt-result = { version = "0.9.1", path = "../../core/result" }
|
||||
revolt-config = { version = "0.9.1", path = "../../core/config", features = [
|
||||
"report-macros",
|
||||
"anyhow"
|
||||
] }
|
||||
revolt-database = { version = "0.8.9", path = "../../core/database" }
|
||||
revolt-models = { version = "0.8.9", path = "../../core/models", features = [
|
||||
revolt-database = { version = "0.9.1", path = "../../core/database" }
|
||||
revolt-models = { version = "0.9.1", path = "../../core/models", features = [
|
||||
"validator",
|
||||
] }
|
||||
revolt-presence = { version = "0.8.9", path = "../../core/presence", features = [
|
||||
revolt-presence = { version = "0.9.1", path = "../../core/presence", features = [
|
||||
"redis-is-patched",
|
||||
] }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-voice-ingress"
|
||||
version = "0.7.1"
|
||||
version = "0.9.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
edition = "2021"
|
||||
|
||||
@@ -36,7 +36,7 @@ async-std = { version = "1.8.0", features = [
|
||||
revolt-result = { path = "../../core/result" }
|
||||
revolt-models = { path = "../../core/models" }
|
||||
revolt-config = { path = "../../core/config" }
|
||||
revolt-database = { path = "../../core/database" }
|
||||
revolt-database = { path = "../../core/database", features = ["voice"] }
|
||||
revolt-permissions = { path = "../../core/permissions" }
|
||||
|
||||
# Voice
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use chrono::DateTime;
|
||||
use livekit_api::{access_token::TokenVerifier, webhooks::WebhookReceiver};
|
||||
use livekit_protocol::TrackType;
|
||||
use revolt_database::{
|
||||
@@ -6,18 +5,15 @@ use revolt_database::{
|
||||
iso8601_timestamp::{Duration, Timestamp},
|
||||
util::reference::Reference,
|
||||
voice::{
|
||||
create_voice_state, delete_voice_state, get_call_notification_recipients,
|
||||
get_user_moved_from_voice, get_user_moved_to_voice, get_voice_channel_members,
|
||||
set_channel_call_started_system_message, take_channel_call_started_system_message,
|
||||
create_voice_state, delete_voice_state,
|
||||
get_user_moved_from_voice, get_user_moved_to_voice,
|
||||
update_voice_state_tracks, VoiceClient,
|
||||
},
|
||||
Database, PartialMessage, SystemMessage, AMQP,
|
||||
Database, AMQP,
|
||||
};
|
||||
use revolt_models::v0;
|
||||
use revolt_result::{Result, ToRevoltError};
|
||||
use rocket::{post, State};
|
||||
use rocket_empty::EmptyResponse;
|
||||
use ulid::Ulid;
|
||||
|
||||
use crate::guard::AuthHeader;
|
||||
|
||||
@@ -25,7 +21,7 @@ use crate::guard::AuthHeader;
|
||||
pub async fn ingress(
|
||||
db: &State<Database>,
|
||||
voice_client: &State<VoiceClient>,
|
||||
amqp: &State<AMQP>,
|
||||
_amqp: &State<AMQP>,
|
||||
node: &str,
|
||||
auth_header: AuthHeader<'_>,
|
||||
body: &str,
|
||||
@@ -90,50 +86,51 @@ pub async fn ingress(
|
||||
.await;
|
||||
};
|
||||
|
||||
// TODO: fix `num_participants` being incorrect sometimes see (#457)
|
||||
// First user who joined - send call started system message.
|
||||
if event.room.as_ref().unwrap().num_participants == 1 {
|
||||
let user = Reference::from_unchecked(user_id).as_user(db).await?;
|
||||
// if event.room.as_ref().unwrap().num_participants == 1 {
|
||||
// let user = Reference::from_unchecked(user_id).as_user(db).await?;
|
||||
|
||||
let message_id =
|
||||
Ulid::from_datetime(DateTime::from_timestamp_secs(event.created_at).unwrap())
|
||||
.to_string();
|
||||
// let message_id =
|
||||
// Ulid::from_datetime(DateTime::from_timestamp_secs(event.created_at).unwrap())
|
||||
// .to_string();
|
||||
|
||||
let mut call_started_message = SystemMessage::CallStarted {
|
||||
by: user_id.to_string(),
|
||||
finished_at: None,
|
||||
}
|
||||
.into_message(channel.id().to_string());
|
||||
// let mut call_started_message = SystemMessage::CallStarted {
|
||||
// by: user_id.to_string(),
|
||||
// finished_at: None,
|
||||
// }
|
||||
// .into_message(channel.id().to_string());
|
||||
|
||||
call_started_message.id = message_id;
|
||||
// call_started_message.id = message_id;
|
||||
|
||||
set_channel_call_started_system_message(channel.id(), &call_started_message.id)
|
||||
.await?;
|
||||
// set_channel_call_started_system_message(channel.id(), &call_started_message.id)
|
||||
// .await?;
|
||||
|
||||
call_started_message
|
||||
.send(
|
||||
db,
|
||||
Some(amqp),
|
||||
v0::MessageAuthor::System {
|
||||
username: &user.username,
|
||||
avatar: user.avatar.as_ref().map(|file| file.id.as_ref()),
|
||||
},
|
||||
None,
|
||||
None,
|
||||
&channel,
|
||||
false,
|
||||
)
|
||||
.await?;
|
||||
// call_started_message
|
||||
// .send(
|
||||
// db,
|
||||
// Some(amqp),
|
||||
// v0::MessageAuthor::System {
|
||||
// username: &user.username,
|
||||
// avatar: user.avatar.as_ref().map(|file| file.id.as_ref()),
|
||||
// },
|
||||
// None,
|
||||
// None,
|
||||
// &channel,
|
||||
// false,
|
||||
// )
|
||||
// .await?;
|
||||
|
||||
let recipients = get_call_notification_recipients(&channel_id, &user_id).await?;
|
||||
let now = joined_at.format_short().to_string();
|
||||
// let recipients = get_call_notification_recipients(&channel_id, &user_id).await?;
|
||||
// let now = joined_at.format_short().to_string();
|
||||
|
||||
if let Err(e) = amqp
|
||||
.dm_call_updated(&user.id, channel.id(), Some(&now), false, recipients)
|
||||
.await
|
||||
{
|
||||
revolt_config::capture_error(&e);
|
||||
}
|
||||
}
|
||||
// if let Err(e) = amqp
|
||||
// .dm_call_updated(&user.id, channel.id(), Some(&now), false, recipients)
|
||||
// .await
|
||||
// {
|
||||
// revolt_config::capture_error(&e);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// User left a channel
|
||||
"participant_left" => {
|
||||
@@ -157,50 +154,52 @@ pub async fn ingress(
|
||||
.await;
|
||||
};
|
||||
|
||||
// Update CallStarted system message if everyone has left with the end time
|
||||
let members = get_voice_channel_members(channel_id).await?;
|
||||
// See above for why this is commented out
|
||||
|
||||
if members.is_none_or(|m| m.is_empty()) {
|
||||
// The channel is empty so send out an "end" message for ringing
|
||||
if let Err(e) = amqp
|
||||
.dm_call_updated(user_id, channel_id, None, true, None)
|
||||
.await
|
||||
{
|
||||
revolt_config::capture_internal_error!(&e);
|
||||
}
|
||||
// // Update CallStarted system message if everyone has left with the end time
|
||||
// let members = get_voice_channel_members(channel_id).await?;
|
||||
|
||||
if let Some(system_message_id) =
|
||||
take_channel_call_started_system_message(channel_id).await?
|
||||
{
|
||||
// Could have been deleted
|
||||
if let Ok(mut message) = Reference::from_unchecked(&system_message_id)
|
||||
.as_message(db)
|
||||
.await
|
||||
{
|
||||
if let Some(SystemMessage::CallStarted { finished_at, .. }) =
|
||||
&mut message.system
|
||||
{
|
||||
*finished_at = Some(Timestamp::now_utc());
|
||||
// if members.is_none_or(|m| m.is_empty()) {
|
||||
// // The channel is empty so send out an "end" message for ringing
|
||||
// if let Err(e) = amqp
|
||||
// .dm_call_updated(user_id, channel_id, None, true, None)
|
||||
// .await
|
||||
// {
|
||||
// revolt_config::capture_internal_error!(&e);
|
||||
// }
|
||||
|
||||
message
|
||||
.update(
|
||||
db,
|
||||
PartialMessage {
|
||||
system: message.system.clone(),
|
||||
..Default::default()
|
||||
},
|
||||
Vec::new(),
|
||||
)
|
||||
.await?;
|
||||
} else {
|
||||
log::error!("Broken State: Call started message ID ({}) does not contain a CallStarted system message.", &message.id)
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
// if let Some(system_message_id) =
|
||||
// take_channel_call_started_system_message(channel_id).await?
|
||||
// {
|
||||
// // Could have been deleted
|
||||
// if let Ok(mut message) = Reference::from_unchecked(&system_message_id)
|
||||
// .as_message(db)
|
||||
// .await
|
||||
// {
|
||||
// if let Some(SystemMessage::CallStarted { finished_at, .. }) =
|
||||
// &mut message.system
|
||||
// {
|
||||
// *finished_at = Some(Timestamp::now_utc());
|
||||
|
||||
// message
|
||||
// .update(
|
||||
// db,
|
||||
// PartialMessage {
|
||||
// system: message.system.clone(),
|
||||
// ..Default::default()
|
||||
// },
|
||||
// Vec::new(),
|
||||
// )
|
||||
// .await?;
|
||||
// } else {
|
||||
// log::error!("Broken State: Call started message ID ({}) does not contain a CallStarted system message.", &message.id)
|
||||
// }
|
||||
// };
|
||||
// };
|
||||
// }
|
||||
}
|
||||
// Audio/video track was started/stopped
|
||||
"track_published" | "track_unpublished" => {
|
||||
// Audio/video track was started/stopped/unmuted/muted
|
||||
"track_published" | "track_unpublished" | "track_unmuted" | "track_muted" => {
|
||||
let channel_id = channel_id.to_internal_error()?;
|
||||
let user_id = user_id.to_internal_error()?;
|
||||
let track = event.track.as_ref().to_internal_error()?;
|
||||
@@ -244,7 +243,7 @@ pub async fn ingress(
|
||||
if disconnect {
|
||||
log::debug!("Removing user {user_id} from channel {channel_id} {event:?} due to forbidden track.");
|
||||
|
||||
voice_client.remove_user(node, user_id, channel_id).await?;
|
||||
let _ = voice_client.remove_user(node, user_id, channel_id).await;
|
||||
delete_voice_state(channel_id, channel.server(), user_id).await?;
|
||||
|
||||
return Ok(EmptyResponse);
|
||||
@@ -255,7 +254,7 @@ pub async fn ingress(
|
||||
channel_id,
|
||||
channel.server(),
|
||||
user_id,
|
||||
event.event == "track_published", // to avoid duplicating this entire case twice
|
||||
event.event == "track_published" || event.event == "track_unmuted", // to avoid duplicating this entire case twice
|
||||
track.source,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-delta"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors = ["Paul Makles <paulmakles@gmail.com>"]
|
||||
edition = "2018"
|
||||
@@ -72,6 +72,7 @@ revolt-config = { path = "../core/config" }
|
||||
revolt-database = { path = "../core/database", features = [
|
||||
"rocket-impl",
|
||||
"redis-is-patched",
|
||||
"voice",
|
||||
] }
|
||||
revolt-models = { path = "../core/models", features = [
|
||||
"schemas",
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
],
|
||||
"roles": {
|
||||
"__ID:5__": {
|
||||
"_id": "__ID:5__",
|
||||
"name": "Moderator",
|
||||
"permissions": {
|
||||
"a": 545270216,
|
||||
@@ -55,6 +56,7 @@
|
||||
"rank": 1
|
||||
},
|
||||
"__ID:6__": {
|
||||
"_id": "__ID:6__",
|
||||
"name": "Owner",
|
||||
"permissions": {
|
||||
"a": 0,
|
||||
@@ -63,6 +65,7 @@
|
||||
"rank": 0
|
||||
},
|
||||
"__ID:7__": {
|
||||
"_id": "__ID:7__",
|
||||
"name": "Lower Rank 1",
|
||||
"permissions": {
|
||||
"a": 0,
|
||||
@@ -71,6 +74,7 @@
|
||||
"rank": 2
|
||||
},
|
||||
"__ID:8__": {
|
||||
"_id": "__ID:8__",
|
||||
"name": "Lower Rank 2",
|
||||
"permissions": {
|
||||
"a": 0,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use revolt_database::{util::reference::Reference, voice::{delete_voice_state, get_channel_node, get_user_voice_channels, VoiceClient}, Database, User};
|
||||
use revolt_database::{Database, User, util::reference::Reference, voice::{VoiceClient, remove_user_from_voice_channels}};
|
||||
use revolt_result::{create_error, Result};
|
||||
use rocket::State;
|
||||
use rocket_empty::EmptyResponse;
|
||||
@@ -21,14 +21,7 @@ pub async fn delete_bot(
|
||||
|
||||
bot.delete(db).await?;
|
||||
|
||||
for channel_id in get_user_voice_channels(&bot.id).await? {
|
||||
let node = get_channel_node(&channel_id).await?.unwrap();
|
||||
let channel = Reference::from_unchecked(&channel_id).as_channel(db).await?;
|
||||
|
||||
voice_client.remove_user(&node, &bot.id, &channel_id).await?;
|
||||
|
||||
delete_voice_state(&channel_id, channel.server(), &bot.id).await?;
|
||||
}
|
||||
remove_user_from_voice_channels(db, voice_client, &bot.id).await?;
|
||||
|
||||
Ok(EmptyResponse)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
use revolt_database::{
|
||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||
voice::{
|
||||
delete_channel_voice_state, delete_voice_state, get_channel_node, get_voice_channel_members, is_in_voice_channel, VoiceClient
|
||||
},
|
||||
Channel, Database, PartialChannel, User, AMQP,
|
||||
AMQP, Channel, Database, PartialChannel, User, util::{permissions::DatabasePermissionQuery, reference::Reference}, voice::{
|
||||
VoiceClient, delete_voice_channel, is_in_voice_channel, remove_user_from_voice_channel
|
||||
}
|
||||
};
|
||||
use revolt_models::v0;
|
||||
use revolt_permissions::{calculate_channel_permissions, ChannelPermission};
|
||||
@@ -57,26 +55,14 @@ pub async fn delete(
|
||||
.await?;
|
||||
|
||||
if is_in_voice_channel(&user.id, channel.id()).await? {
|
||||
let node = get_channel_node(channel.id()).await?.unwrap();
|
||||
|
||||
voice_client
|
||||
.remove_user(&node, &user.id, channel.id())
|
||||
.await?;
|
||||
|
||||
delete_voice_state(channel.id(), None, &user.id).await?;
|
||||
remove_user_from_voice_channel(db, voice_client, channel.id(), &user.id).await?;
|
||||
};
|
||||
}
|
||||
Channel::TextChannel { .. } => {
|
||||
permissions.throw_if_lacking_channel_permission(ChannelPermission::ManageChannel)?;
|
||||
channel.delete(db).await?;
|
||||
|
||||
if let Some(users) = get_voice_channel_members(channel.id()).await? {
|
||||
let node = get_channel_node(channel.id()).await?.unwrap();
|
||||
|
||||
voice_client.delete_room(&node, channel.id()).await?;
|
||||
|
||||
delete_channel_voice_state(channel.id(), channel.server(), &users).await?;
|
||||
};
|
||||
delete_voice_channel(voice_client, channel.id(), channel.server()).await?;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use revolt_database::{
|
||||
util::{permissions::DatabasePermissionQuery, reference::Reference}, voice::{delete_channel_voice_state, get_channel_node, get_voice_channel_members, VoiceClient}, Channel, Database, File, PartialChannel, SystemMessage, User, AMQP
|
||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||
voice::{delete_voice_channel, VoiceClient},
|
||||
Channel, Database, File, PartialChannel, SystemMessage, User, AMQP,
|
||||
};
|
||||
use revolt_models::v0;
|
||||
use revolt_permissions::{calculate_channel_permissions, ChannelPermission};
|
||||
@@ -253,21 +255,12 @@ pub async fn edit(
|
||||
.update(
|
||||
db,
|
||||
partial,
|
||||
data.remove
|
||||
.into_iter()
|
||||
.map(|f| f.into())
|
||||
.collect(),
|
||||
data.remove.into_iter().map(|f| f.into()).collect(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
if channel.voice().is_none() {
|
||||
if let Some(users) = get_voice_channel_members(channel.id()).await? {
|
||||
let node = get_channel_node(channel.id()).await?.unwrap();
|
||||
|
||||
voice_client.delete_room(&node, channel.id()).await?;
|
||||
|
||||
delete_channel_voice_state(channel.id(), channel.server(), &users).await?;
|
||||
};
|
||||
delete_voice_channel(voice_client, channel.id(), channel.server()).await?;
|
||||
}
|
||||
|
||||
Ok(Json(channel.into()))
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
use revolt_database::{util::reference::Reference, voice::{delete_voice_state, get_channel_node, is_in_voice_channel, VoiceClient}, Channel, Database, User, AMQP};
|
||||
use revolt_database::{
|
||||
util::reference::Reference,
|
||||
voice::{is_in_voice_channel, remove_user_from_voice_channel, VoiceClient},
|
||||
Channel, Database, User, AMQP,
|
||||
};
|
||||
use revolt_permissions::ChannelPermission;
|
||||
use revolt_result::{create_error, Result};
|
||||
|
||||
@@ -24,7 +28,10 @@ pub async fn remove_member(
|
||||
|
||||
let channel = target.as_channel(db).await?;
|
||||
|
||||
if let Channel::Group { owner, recipients, .. } = &channel {
|
||||
if let Channel::Group {
|
||||
owner, recipients, ..
|
||||
} = &channel
|
||||
{
|
||||
if &user.id != owner {
|
||||
return Err(create_error!(MissingPermission {
|
||||
permission: ChannelPermission::ManageChannel.to_string()
|
||||
@@ -44,14 +51,11 @@ pub async fn remove_member(
|
||||
.remove_user_from_group(db, amqp, &member, Some(&user.id), false)
|
||||
.await?;
|
||||
} else {
|
||||
return Err(create_error!(InvalidOperation))
|
||||
return Err(create_error!(InvalidOperation));
|
||||
};
|
||||
|
||||
if is_in_voice_channel(&user.id, channel.id()).await? {
|
||||
let node = get_channel_node(channel.id()).await?.unwrap();
|
||||
|
||||
voice_client.remove_user(&node, &user.id, channel.id()).await?;
|
||||
delete_voice_state(channel.id(), None, &user.id).await?;
|
||||
if is_in_voice_channel(&member.id, channel.id()).await? {
|
||||
remove_user_from_voice_channel(db, voice_client, channel.id(), &member.id).await?;
|
||||
};
|
||||
|
||||
Ok(EmptyResponse)
|
||||
|
||||
@@ -151,29 +151,20 @@ mod test {
|
||||
name: "Hidden Channel".to_string(),
|
||||
description: None,
|
||||
nsfw: Some(false),
|
||||
voice: None
|
||||
voice: None,
|
||||
},
|
||||
true,
|
||||
)
|
||||
.await
|
||||
.expect("Failed to make new channel");
|
||||
|
||||
let role = Role {
|
||||
name: "Show Hidden Channel".to_string(),
|
||||
permissions: OverrideField { a: 0, d: 0 },
|
||||
colour: None,
|
||||
hoist: false,
|
||||
rank: 5,
|
||||
};
|
||||
|
||||
let role_id = role
|
||||
.create(&harness.db, &server.id)
|
||||
let role = Role::create(&harness.db, &server, "Show Hidden Channel".to_string())
|
||||
.await
|
||||
.expect("Failed to create the role");
|
||||
|
||||
let mut overrides = HashMap::new();
|
||||
overrides.insert(
|
||||
role_id.clone(),
|
||||
role.id.clone(),
|
||||
OverrideField {
|
||||
a: (ChannelPermission::ViewChannel) as i64,
|
||||
d: 0,
|
||||
@@ -281,7 +272,7 @@ mod test {
|
||||
"Mention failed to be scrubbed when the user cannot see the channel"
|
||||
);
|
||||
|
||||
let second_member_roles = vec![role_id.clone()];
|
||||
let second_member_roles = vec![role.id.clone()];
|
||||
let partial = PartialMember {
|
||||
id: None,
|
||||
joined_at: None,
|
||||
@@ -290,7 +281,7 @@ mod test {
|
||||
timeout: None,
|
||||
roles: Some(second_member_roles),
|
||||
can_publish: None,
|
||||
can_receive: None
|
||||
can_receive: None,
|
||||
};
|
||||
second_member
|
||||
.update(&harness.db, partial, vec![])
|
||||
@@ -496,7 +487,7 @@ mod test {
|
||||
let (_, _, other_user) = harness.new_user().await;
|
||||
let (server, _) = harness.new_server(&user).await;
|
||||
let channel = harness.new_channel(&server).await;
|
||||
let (role_id, _role) = harness
|
||||
let role = harness
|
||||
.new_role(
|
||||
&server,
|
||||
1,
|
||||
@@ -518,7 +509,7 @@ mod test {
|
||||
Some(&harness.amqp),
|
||||
channel.clone(),
|
||||
v0::DataMessageSend {
|
||||
content: Some(format!("Mentioning @everyone and role <%{}>", &role_id)),
|
||||
content: Some(format!("Mentioning @everyone and role <%{}>", &role.id)),
|
||||
nonce: None,
|
||||
attachments: None,
|
||||
replies: None,
|
||||
@@ -563,7 +554,7 @@ mod test {
|
||||
Some(&harness.amqp),
|
||||
channel.clone(),
|
||||
v0::DataMessageSend {
|
||||
content: Some(format!("Mentioning `@everyone` and role `<%{}>`", &role_id)),
|
||||
content: Some(format!("Mentioning `@everyone` and role `<%{}>`", &role.id)),
|
||||
nonce: None,
|
||||
attachments: None,
|
||||
replies: None,
|
||||
@@ -605,7 +596,7 @@ mod test {
|
||||
"Role mentions detected when inside codeblock"
|
||||
);
|
||||
|
||||
other_member.roles.push(role_id.clone());
|
||||
other_member.roles.push(role.id.clone());
|
||||
harness
|
||||
.db
|
||||
.update_member(
|
||||
@@ -615,10 +606,10 @@ mod test {
|
||||
id: None,
|
||||
joined_at: None,
|
||||
nickname: None,
|
||||
roles: Some(vec![role_id.clone()]),
|
||||
roles: Some(vec![role.id.clone()]),
|
||||
timeout: None,
|
||||
can_publish: None,
|
||||
can_receive: None
|
||||
can_receive: None,
|
||||
},
|
||||
vec![],
|
||||
)
|
||||
@@ -632,7 +623,7 @@ mod test {
|
||||
Some(&harness.amqp),
|
||||
channel.clone(),
|
||||
v0::DataMessageSend {
|
||||
content: Some(format!("Mentioning @everyone and role <%{}>", &role_id)),
|
||||
content: Some(format!("Mentioning @everyone and role <%{}>", &role.id)),
|
||||
nonce: None,
|
||||
attachments: None,
|
||||
replies: None,
|
||||
|
||||
@@ -79,15 +79,15 @@ pub async fn call(
|
||||
// should only ever loop once but just to cover our backs.
|
||||
|
||||
for channel_id in get_user_voice_channels(&user.id).await? {
|
||||
let node = get_channel_node(&channel_id).await?.unwrap();
|
||||
if let Some(node) = get_channel_node(&channel_id).await? {
|
||||
// if this errors its just a mismatching state - ignore and proceed to still delete our state
|
||||
let _ = voice_client.remove_user(&node, &user.id, &channel_id).await;
|
||||
};
|
||||
|
||||
let channel = Reference::from_unchecked(&channel_id)
|
||||
.as_channel(db)
|
||||
.await?;
|
||||
|
||||
voice_client
|
||||
.remove_user(&node, &user.id, &channel_id)
|
||||
.await?;
|
||||
|
||||
delete_voice_state(&channel_id, channel.server(), &user.id).await?;
|
||||
}
|
||||
} else {
|
||||
@@ -103,7 +103,7 @@ pub async fn call(
|
||||
log::debug!("Created room {}", room.name);
|
||||
|
||||
if let Some(recipients) = recipients {
|
||||
if room.num_participants == 0 {
|
||||
if room.num_participants == 0 && !recipients.is_empty() {
|
||||
set_call_notification_recipients(channel.id(), &user.id, &recipients).await?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ use revolt_database::{Database, User};
|
||||
use revolt_result::Result;
|
||||
|
||||
use rocket::State;
|
||||
use rocket_empty::EmptyResponse;
|
||||
|
||||
/// # Acknowledge Policy Changes
|
||||
///
|
||||
/// Accept/acknowledge changes to platform policy.
|
||||
#[openapi(tag = "Policy")]
|
||||
#[post("/acknowledge")]
|
||||
pub async fn acknowledge_policy_changes(db: &State<Database>, user: User) -> Result<()> {
|
||||
db.acknowledge_policy_changes(&user.id).await
|
||||
pub async fn acknowledge_policy_changes(db: &State<Database>, user: User) -> Result<EmptyResponse> {
|
||||
db.acknowledge_policy_changes(&user.id).await?;
|
||||
Ok(EmptyResponse)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use revolt_database::{events::client::EventV1, Database, Report, Snapshot, SnapshotContent, User};
|
||||
use revolt_models::v0::{ReportStatus, ReportedContent};
|
||||
use revolt_result::{create_error, Result};
|
||||
use rocket_empty::EmptyResponse;
|
||||
use serde::Deserialize;
|
||||
use ulid::Ulid;
|
||||
use validator::Validate;
|
||||
@@ -27,7 +28,7 @@ pub async fn report_content(
|
||||
db: &State<Database>,
|
||||
user: User,
|
||||
data: Json<DataReportContent>,
|
||||
) -> Result<()> {
|
||||
) -> Result<EmptyResponse> {
|
||||
let data = data.into_inner();
|
||||
data.validate().map_err(|error| {
|
||||
create_error!(FailedValidation {
|
||||
@@ -129,5 +130,5 @@ pub async fn report_content(
|
||||
|
||||
EventV1::ReportCreate(report.into()).global().await;
|
||||
|
||||
Ok(())
|
||||
Ok(EmptyResponse)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use revolt_database::{
|
||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||
voice::{delete_voice_state, get_channel_node, get_user_voice_channel_in_server, VoiceClient},
|
||||
voice::{get_user_voice_channel_in_server, remove_user_from_voice_channel, VoiceClient},
|
||||
Database, RemovalIntention, ServerBan, User,
|
||||
};
|
||||
use revolt_models::v0;
|
||||
@@ -58,12 +58,8 @@ pub async fn ban(
|
||||
.await?;
|
||||
|
||||
// If the member is in a voice channel while banned kick them from the voice channel
|
||||
if let Some(channel_id) = get_user_voice_channel_in_server(&user.id, &server.id).await? {
|
||||
let node = get_channel_node(&channel_id).await?.unwrap();
|
||||
|
||||
voice_client.remove_user(&node, &user.id, &channel_id).await?;
|
||||
|
||||
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?
|
||||
if let Some(channel_id) = get_user_voice_channel_in_server(&target.id, &server.id).await? {
|
||||
remove_user_from_voice_channel(db, voice_client, &channel_id, &target.id).await?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ pub async fn edit(
|
||||
let mut query = DatabasePermissionQuery::new(db, &user).server(&server);
|
||||
let permissions = calculate_server_permissions(&mut query).await;
|
||||
|
||||
// Fetch target permissions
|
||||
let mut target_query = DatabasePermissionQuery::new(db, &target_user).server(&server).member(&member);
|
||||
let target_permissions = calculate_server_permissions(&mut target_query).await;
|
||||
|
||||
// Check permissions in server
|
||||
if data.nickname.is_some() || data.remove.contains(&v0::FieldsMember::Nickname) {
|
||||
if user.id == member.id.user {
|
||||
@@ -73,8 +77,14 @@ pub async fn edit(
|
||||
}
|
||||
|
||||
if data.timeout.is_some() || data.remove.contains(&v0::FieldsMember::Timeout) {
|
||||
if data.timeout.is_some() && member.id.user == user.id {
|
||||
return Err(create_error!(CannotTimeoutYourself));
|
||||
if data.timeout.is_some() {
|
||||
if member.id.user == user.id {
|
||||
return Err(create_error!(CannotTimeoutYourself));
|
||||
}
|
||||
|
||||
if target_permissions.has_channel_permission(ChannelPermission::TimeoutMembers) {
|
||||
return Err(create_error!(IsElevated))
|
||||
}
|
||||
}
|
||||
|
||||
permissions.throw_if_lacking_channel_permission(ChannelPermission::TimeoutMembers)?;
|
||||
@@ -217,9 +227,11 @@ pub async fn edit(
|
||||
|
||||
EventV1::UserMoveVoiceChannel {
|
||||
node: new_node,
|
||||
from: channel,
|
||||
to: new_voice_channel.id().to_string(),
|
||||
token,
|
||||
}
|
||||
.p_user(target_user.id.clone(), db)
|
||||
.private(target_user.id.clone())
|
||||
.await;
|
||||
};
|
||||
} else if can_publish.is_some() || can_receive.is_some() || remove_contains_voice {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use revolt_database::{
|
||||
util::{permissions::DatabasePermissionQuery, reference::Reference},
|
||||
voice::{delete_voice_state, get_channel_node, get_user_voice_channel_in_server, VoiceClient},
|
||||
voice::{get_user_voice_channel_in_server, remove_user_from_voice_channel, VoiceClient},
|
||||
Database, RemovalIntention, User,
|
||||
};
|
||||
use revolt_permissions::{calculate_server_permissions, ChannelPermission};
|
||||
@@ -46,12 +46,8 @@ pub async fn kick(
|
||||
.remove(db, &server, RemovalIntention::Kick, false)
|
||||
.await?;
|
||||
|
||||
if let Some(channel_id) = get_user_voice_channel_in_server(&user.id, &server.id).await? {
|
||||
let node = get_channel_node(&channel_id).await?.unwrap();
|
||||
|
||||
voice_client.remove_user(&node, &user.id, &channel_id).await?;
|
||||
|
||||
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?;
|
||||
if let Some(channel_id) = get_user_voice_channel_in_server(&target.id, &server.id).await? {
|
||||
remove_user_from_voice_channel(db, voice_client, &channel_id, &target.id).await?;
|
||||
};
|
||||
|
||||
Ok(EmptyResponse)
|
||||
|
||||
@@ -40,17 +40,10 @@ pub async fn create(
|
||||
}));
|
||||
};
|
||||
|
||||
let role = Role {
|
||||
name: data.name,
|
||||
// Rank of the new role should be below the lowest role
|
||||
rank: server.roles.len() as i64,
|
||||
colour: None,
|
||||
hoist: false,
|
||||
permissions: Default::default(),
|
||||
};
|
||||
let role = Role::create(db, &server, data.name).await?;
|
||||
|
||||
Ok(Json(v0::NewRoleResponse {
|
||||
id: role.create(db, &server.id).await?,
|
||||
id: role.id.clone(),
|
||||
role: role.into(),
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ pub async fn delete(
|
||||
return Err(create_error!(NotElevated));
|
||||
}
|
||||
|
||||
role.delete(db, &server.id, &role_id).await?;
|
||||
role.delete(db, &server.id).await?;
|
||||
|
||||
for channel_id in &server.channels {
|
||||
let channel = Reference::from_unchecked(channel_id).as_channel(db).await?;
|
||||
|
||||
@@ -61,7 +61,6 @@ pub async fn edit(
|
||||
role.update(
|
||||
db,
|
||||
&server.id,
|
||||
&role_id,
|
||||
partial,
|
||||
remove.into_iter().map(Into::into).collect(),
|
||||
)
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
use revolt_database::{
|
||||
util::reference::Reference,
|
||||
voice::{delete_channel_voice_state, delete_voice_state, get_channel_node, get_user_voice_channel_in_server, get_voice_channel_members, VoiceClient},
|
||||
voice::{
|
||||
delete_voice_channel, get_user_voice_channel_in_server, remove_user_from_voice_channel,
|
||||
VoiceClient,
|
||||
},
|
||||
Database, RemovalIntention, User,
|
||||
};
|
||||
use revolt_models::v0;
|
||||
@@ -26,25 +29,13 @@ pub async fn delete(
|
||||
|
||||
if server.owner == user.id {
|
||||
for channel_id in &server.channels {
|
||||
if let Some(users) = get_voice_channel_members(channel_id).await? {
|
||||
let node = get_channel_node(channel_id).await?.unwrap();
|
||||
|
||||
voice_client.delete_room(&node, channel_id).await?;
|
||||
|
||||
delete_channel_voice_state(channel_id, Some(&server.id), &users).await?;
|
||||
};
|
||||
delete_voice_channel(voice_client, channel_id, Some(&server.id)).await?;
|
||||
}
|
||||
|
||||
server.delete(db).await
|
||||
} else {
|
||||
if let Some(channel_id) = get_user_voice_channel_in_server(&user.id, &server.id).await? {
|
||||
if server.channels.iter().any(|c| c == &channel_id) {
|
||||
let node = get_channel_node(&channel_id).await?.unwrap();
|
||||
|
||||
voice_client.remove_user(&node, &user.id, &channel_id).await?;
|
||||
|
||||
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?;
|
||||
}
|
||||
remove_user_from_voice_channel(db, voice_client, &channel_id, &user.id).await?;
|
||||
};
|
||||
|
||||
member
|
||||
|
||||
@@ -217,7 +217,6 @@ pub struct GithubComment {
|
||||
position: Option<u32>,
|
||||
reactions: Option<GithubReactions>,
|
||||
updated_at: Value,
|
||||
url: String,
|
||||
user: GithubUser,
|
||||
}
|
||||
|
||||
@@ -701,7 +700,7 @@ fn safe_from_str<T: for<'de> Deserialize<'de>>(data: &str) -> Result<T> {
|
||||
match serde_json::from_str(data) {
|
||||
Ok(output) => Ok(output),
|
||||
Err(err) => {
|
||||
log::error!("{err:?}");
|
||||
revolt_config::capture_internal_error!(err);
|
||||
Err(create_error!(InvalidOperation))
|
||||
}
|
||||
}
|
||||
@@ -753,12 +752,12 @@ pub async fn webhook_execute_github(
|
||||
db: &State<Database>,
|
||||
amqp: &State<AMQP>,
|
||||
webhook_id: Reference<'_>,
|
||||
token: String,
|
||||
token: &str,
|
||||
event: EventHeader<'_>,
|
||||
data: String,
|
||||
) -> Result<()> {
|
||||
let webhook = webhook_id.as_webhook(db).await?;
|
||||
webhook.assert_token(&token)?;
|
||||
webhook.assert_token(token)?;
|
||||
|
||||
let channel = db.fetch_channel(&webhook.channel_id).await?;
|
||||
let event = convert_event(&data, &event)?;
|
||||
@@ -897,10 +896,11 @@ pub async fn webhook_execute_github(
|
||||
url: Some(event.sender.html_url),
|
||||
title: Some(event.sender.login),
|
||||
description: Some(format!(
|
||||
"#### [{}] New discussion #{}: {}\n{}",
|
||||
"#### [[{}] New discussion #{}: {}]({})\n{}",
|
||||
event.repository.full_name,
|
||||
discussion.number,
|
||||
discussion.title,
|
||||
discussion.html_url,
|
||||
shorten_text(&discussion.body, 450)
|
||||
)),
|
||||
colour: Some(LIGHT_ORANGE.to_string()),
|
||||
@@ -911,10 +911,11 @@ pub async fn webhook_execute_github(
|
||||
url: Some(answer.comment.user.html_url),
|
||||
title: Some(answer.comment.user.login),
|
||||
description: Some(format!(
|
||||
"#### [{}] discussion #{} marked answered: {}\n{}",
|
||||
"#### [[{}] Discussion #{} marked answered: {}]({})\n{}",
|
||||
event.repository.full_name,
|
||||
discussion.number,
|
||||
discussion.title,
|
||||
answer.comment.html_url,
|
||||
shorten_text(&answer.comment.body, 450)
|
||||
)),
|
||||
colour: Some(LIGHT_ORANGE.to_string()),
|
||||
@@ -930,10 +931,11 @@ pub async fn webhook_execute_github(
|
||||
url: Some(comment.comment.user.html_url),
|
||||
title: Some(comment.comment.user.login),
|
||||
description: Some(format!(
|
||||
"[{}] New comment on discussion #{}: {}\n{}",
|
||||
"#### [[{}] New comment on discussion #{}: {}]({})\n{}",
|
||||
event.repository.full_name,
|
||||
discussion.number,
|
||||
discussion.title,
|
||||
comment.comment.html_url,
|
||||
shorten_text(&comment.comment.body, 450)
|
||||
)),
|
||||
colour: Some(LIGHT_ORANGE.to_string()),
|
||||
@@ -1002,7 +1004,7 @@ pub async fn webhook_execute_github(
|
||||
event.repository.full_name,
|
||||
issue.number,
|
||||
issue.title,
|
||||
issue.html_url,
|
||||
comment.html_url,
|
||||
shorten_text(&comment.body, 450)
|
||||
)),
|
||||
colour: Some(LIGHT_ORANGE.to_string()),
|
||||
|
||||
@@ -6,7 +6,7 @@ use futures::StreamExt;
|
||||
use rand::Rng;
|
||||
use redis_kiss::redis::aio::PubSub;
|
||||
use revolt_database::{
|
||||
events::client::EventV1, Channel, Database, Member, Message, Server, User, AMQP,
|
||||
events::client::EventV1, Channel, Database, Member, Message, PartialRole, Server, User, AMQP,
|
||||
};
|
||||
use revolt_database::{util::idempotency::IdempotencyKey, Role};
|
||||
use revolt_models::v0;
|
||||
@@ -139,21 +139,26 @@ impl TestHarness {
|
||||
server: &Server,
|
||||
rank: i64,
|
||||
overrides: Option<OverrideField>,
|
||||
) -> (String, Role) {
|
||||
let role = Role {
|
||||
name: TestHarness::rand_string(),
|
||||
permissions: overrides.unwrap_or(OverrideField { a: 0, d: 0 }),
|
||||
rank,
|
||||
colour: None,
|
||||
hoist: false,
|
||||
};
|
||||
|
||||
let id = role
|
||||
.create(&self.db, &server.id)
|
||||
) -> Role {
|
||||
let mut role = Role::create(&self.db, &server, TestHarness::rand_string())
|
||||
.await
|
||||
.expect("Failed to create test role");
|
||||
|
||||
(id, role)
|
||||
if let Some(overrides) = overrides {
|
||||
role.update(
|
||||
&self.db,
|
||||
&server.id,
|
||||
PartialRole {
|
||||
permissions: Some(overrides),
|
||||
..Default::default()
|
||||
},
|
||||
Vec::new(),
|
||||
)
|
||||
.await
|
||||
.expect("Failed to set test role overrides");
|
||||
};
|
||||
|
||||
role
|
||||
}
|
||||
|
||||
pub async fn new_channel(&self, server: &Server) -> Channel {
|
||||
@@ -165,7 +170,7 @@ impl TestHarness {
|
||||
name: "Test Channel".to_string(),
|
||||
description: None,
|
||||
nsfw: Some(false),
|
||||
voice: None
|
||||
voice: None,
|
||||
},
|
||||
true,
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-autumn"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
|
||||
@@ -43,16 +43,16 @@ tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
|
||||
# Core crates
|
||||
revolt-files = { version = "0.8.9", path = "../../core/files" }
|
||||
revolt-config = { version = "0.8.9", path = "../../core/config" }
|
||||
revolt-database = { version = "0.8.9", path = "../../core/database", features = [
|
||||
revolt-files = { version = "0.9.1", path = "../../core/files" }
|
||||
revolt-config = { version = "0.9.1", path = "../../core/config" }
|
||||
revolt-database = { version = "0.9.1", path = "../../core/database", features = [
|
||||
"axum-impl",
|
||||
] }
|
||||
revolt-result = { version = "0.8.9", path = "../../core/result", features = [
|
||||
revolt-result = { version = "0.9.1", path = "../../core/result", features = [
|
||||
"utoipa",
|
||||
"axum",
|
||||
] }
|
||||
revolt-ratelimits = { version = "0.8.9", path = "../../core/ratelimits", features = ["axum"] }
|
||||
revolt-ratelimits = { version = "0.9.1", path = "../../core/ratelimits", features = ["axum"] }
|
||||
|
||||
# Axum / web server
|
||||
tempfile = "3.12.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-gifbox"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
|
||||
@@ -16,19 +16,19 @@ tokio = { version = "1.0", features = ["full"] }
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
|
||||
# Core crates
|
||||
revolt-config = { version = "0.8.9", path = "../../core/config" }
|
||||
revolt-models = { version = "0.8.9", path = "../../core/models" }
|
||||
revolt-result = { version = "0.8.9", path = "../../core/result", features = [
|
||||
revolt-config = { version = "0.9.1", path = "../../core/config" }
|
||||
revolt-models = { version = "0.9.1", path = "../../core/models" }
|
||||
revolt-result = { version = "0.9.1", path = "../../core/result", features = [
|
||||
"utoipa",
|
||||
"axum",
|
||||
] }
|
||||
revolt-coalesced = { version = "0.8.9", path = "../../core/coalesced", features = [
|
||||
revolt-coalesced = { version = "0.9.1", path = "../../core/coalesced", features = [
|
||||
"queue",
|
||||
] }
|
||||
revolt-database = { version = "0.8.9", path = "../../core/database", features = [
|
||||
revolt-database = { version = "0.9.1", path = "../../core/database", features = [
|
||||
"axum-impl",
|
||||
] }
|
||||
revolt-ratelimits = { version = "0.8.9", path = "../../core/ratelimits", features = [
|
||||
revolt-ratelimits = { version = "0.9.1", path = "../../core/ratelimits", features = [
|
||||
"axum",
|
||||
] }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "revolt-january"
|
||||
version = "0.8.9"
|
||||
version = "0.9.1"
|
||||
edition = "2021"
|
||||
license = "AGPL-3.0-or-later"
|
||||
|
||||
@@ -32,13 +32,13 @@ tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
|
||||
# Core crates
|
||||
revolt-config = { version = "0.8.9", path = "../../core/config" }
|
||||
revolt-models = { version = "0.8.9", path = "../../core/models" }
|
||||
revolt-result = { version = "0.8.9", path = "../../core/result", features = [
|
||||
revolt-config = { version = "0.9.1", path = "../../core/config" }
|
||||
revolt-models = { version = "0.9.1", path = "../../core/models" }
|
||||
revolt-result = { version = "0.9.1", path = "../../core/result", features = [
|
||||
"utoipa",
|
||||
"axum",
|
||||
] }
|
||||
revolt-files = { version = "0.8.9", path = "../../core/files" }
|
||||
revolt-files = { version = "0.9.1", path = "../../core/files" }
|
||||
|
||||
# Axum / web server
|
||||
axum = { version = "0.7.5" }
|
||||
|
||||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
book
|
||||
@@ -1,6 +0,0 @@
|
||||
[book]
|
||||
authors = []
|
||||
language = "en"
|
||||
multilingual = false
|
||||
src = "src"
|
||||
title = "Revolt Backend"
|
||||
@@ -1,8 +0,0 @@
|
||||
# Summary
|
||||
|
||||
- [Introduction](./hello.md)
|
||||
- [Project Structure]()
|
||||
- [Creating new API features](./new_features.md)
|
||||
- [Testing]()
|
||||
- [Writing a new database test]()
|
||||
- [Writing a new API test]()
|
||||
@@ -1,5 +0,0 @@
|
||||
# Revolt Backend
|
||||
|
||||
Welcome to the developer documentation for the Revolt backend.
|
||||
|
||||
This is very much incomplete and needs more work!
|
||||
20
docs/.gitignore
vendored
Normal file
20
docs/.gitignore
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# Dependencies
|
||||
/node_modules
|
||||
|
||||
# Production
|
||||
/build
|
||||
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
41
docs/README.md
Normal file
41
docs/README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Website
|
||||
|
||||
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
|
||||
## Local Development
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
||||
## Deployment
|
||||
|
||||
Using SSH:
|
||||
|
||||
```bash
|
||||
USE_SSH=true yarn deploy
|
||||
```
|
||||
|
||||
Not using SSH:
|
||||
|
||||
```bash
|
||||
GIT_USER=<Your GitHub username> yarn deploy
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
||||
11
docs/default.nix
Normal file
11
docs/default.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
pkgs ? import <nixpkgs> { },
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
nodejs
|
||||
nodejs.pkgs.pnpm
|
||||
];
|
||||
}
|
||||
10
docs/docs/developers/api/_category_.json
Normal file
10
docs/docs/developers/api/_category_.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"label": "API",
|
||||
"position": 2,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"description": "Connecting and consuming the Stoat API"
|
||||
},
|
||||
"collapsed": false,
|
||||
"collapsible": true
|
||||
}
|
||||
15
docs/docs/developers/api/authentication.md
Normal file
15
docs/docs/developers/api/authentication.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Authentication
|
||||
|
||||
To authenticate with the API, you must first acquire a bot token or user token:
|
||||
|
||||
- **Bot:** create one from user settings in the client
|
||||
- **User:** copy one from client or authenticate through API
|
||||
|
||||
Then you may provide these through either:
|
||||
|
||||
| Type | Header |
|
||||
| :---: | :---------------: |
|
||||
| Bot | `X-Bot-Token` |
|
||||
| User | `X-Session-Token` |
|
||||
|
||||
When dealing with an authenticated route.
|
||||
1
docs/docs/developers/api/permission_hierarchy.svg
Normal file
1
docs/docs/developers/api/permission_hierarchy.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 74 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user