Compare commits
14
Commits
20250930-1
...
20251020-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43118c853c | ||
|
|
6ab264eb36 | ||
|
|
59af536e29 | ||
|
|
5c7eec68d0 | ||
|
|
94d7320e70 | ||
|
|
af78ac0586 | ||
|
|
a42ddcbbfa | ||
|
|
d65c1a1ab3 | ||
|
|
530264f747 | ||
|
|
ae1d4dd264 | ||
|
|
4789dd4847 | ||
|
|
4fb99e3bd0 | ||
|
|
f0a83abcfa | ||
|
|
6f1c715b8c |
@@ -49,13 +49,6 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
# Authenticate with Docker Hub and GHCR
|
# Authenticate with Docker Hub and GHCR
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: docker.io
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Login to Github Container Registry
|
- name: Login to Github Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -72,14 +65,13 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
tags: ghcr.io/${{ github.repository_owner }}/base:latest
|
tags: ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
|
||||||
# revoltchat/server
|
# stoatchat/api
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-delta
|
id: meta-delta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/revoltchat/server
|
ghcr.io/stoatchat/api
|
||||||
ghcr.io/revoltchat/server
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -92,14 +84,13 @@ jobs:
|
|||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta-delta.outputs.labels }}
|
labels: ${{ steps.meta-delta.outputs.labels }}
|
||||||
|
|
||||||
# revoltchat/bonfire
|
# stoatchat/events
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-bonfire
|
id: meta-bonfire
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/revoltchat/bonfire
|
ghcr.io/stoatchat/events
|
||||||
ghcr.io/revoltchat/bonfire
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -112,14 +103,13 @@ jobs:
|
|||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta-bonfire.outputs.labels }}
|
labels: ${{ steps.meta-bonfire.outputs.labels }}
|
||||||
|
|
||||||
# revoltchat/autumn
|
# stoatchat/file-server
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-autumn
|
id: meta-autumn
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/revoltchat/autumn
|
ghcr.io/stoatchat/file-server
|
||||||
ghcr.io/revoltchat/autumn
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -132,14 +122,13 @@ jobs:
|
|||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta-autumn.outputs.labels }}
|
labels: ${{ steps.meta-autumn.outputs.labels }}
|
||||||
|
|
||||||
# revoltchat/january
|
# stoatchat/proxy
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-january
|
id: meta-january
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/revoltchat/january
|
ghcr.io/stoatchat/proxy
|
||||||
ghcr.io/revoltchat/january
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -152,14 +141,13 @@ jobs:
|
|||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta-january.outputs.labels }}
|
labels: ${{ steps.meta-january.outputs.labels }}
|
||||||
|
|
||||||
# revoltchat/gifbox
|
# stoatchat/gifbox
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-gifbox
|
id: meta-gifbox
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/revoltchat/gifbox
|
ghcr.io/stoatchat/gifbox
|
||||||
ghcr.io/revoltchat/gifbox
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -172,14 +160,13 @@ jobs:
|
|||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta-gifbox.outputs.labels }}
|
labels: ${{ steps.meta-gifbox.outputs.labels }}
|
||||||
|
|
||||||
# revoltchat/crond
|
# stoatchat/crond
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-crond
|
id: meta-crond
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/revoltchat/crond
|
ghcr.io/stoatchat/crond
|
||||||
ghcr.io/revoltchat/crond
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -192,14 +179,13 @@ jobs:
|
|||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta-crond.outputs.labels }}
|
labels: ${{ steps.meta-crond.outputs.labels }}
|
||||||
|
|
||||||
# revoltchat/pushd
|
# stoatchat/pushd
|
||||||
- name: Docker meta
|
- name: Docker meta
|
||||||
id: meta-pushd
|
id: meta-pushd
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
docker.io/revoltchat/pushd
|
ghcr.io/stoatchat/pushd
|
||||||
ghcr.io/revoltchat/pushd
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
@@ -211,3 +197,22 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
labels: ${{ steps.meta-pushd.outputs.labels }}
|
labels: ${{ steps.meta-pushd.outputs.labels }}
|
||||||
|
|
||||||
|
# stoatchat/voice-ingress
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta-voice-ingress
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/stoatchat/voice-ingress
|
||||||
|
- name: Publish
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
file: crates/daemons/voice-ingress/Dockerfile
|
||||||
|
tags: ${{ steps.meta-voice-ingress.outputs.tags }}
|
||||||
|
build-args: |
|
||||||
|
BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/base:latest
|
||||||
|
labels: ${{ steps.meta-voice-ingress.outputs.labels }}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ jobs:
|
|||||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: revoltchat/api
|
repository: stoatchat/api
|
||||||
path: api
|
path: api
|
||||||
token: ${{ secrets.PAT }}
|
token: ${{ secrets.PAT }}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
gh api graphql -f query='
|
gh api graphql -f query='
|
||||||
query {
|
query {
|
||||||
organization(login: "revoltchat"){
|
organization(login: "stoatchat"){
|
||||||
projectV2(number: 3) {
|
projectV2(number: 3) {
|
||||||
id
|
id
|
||||||
fields(first:20) {
|
fields(first:20) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
gh api graphql -f query='
|
gh api graphql -f query='
|
||||||
query {
|
query {
|
||||||
organization(login: "revoltchat"){
|
organization(login: "stoatchat"){
|
||||||
projectV2(number: 5) {
|
projectV2(number: 5) {
|
||||||
id
|
id
|
||||||
fields(first:20) {
|
fields(first:20) {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ COPY crates/services/january/Cargo.toml ./crates/services/january/
|
|||||||
COPY crates/services/gifbox/Cargo.toml ./crates/services/gifbox/
|
COPY crates/services/gifbox/Cargo.toml ./crates/services/gifbox/
|
||||||
COPY crates/daemons/crond/Cargo.toml ./crates/daemons/crond/
|
COPY crates/daemons/crond/Cargo.toml ./crates/daemons/crond/
|
||||||
COPY crates/daemons/pushd/Cargo.toml ./crates/daemons/pushd/
|
COPY crates/daemons/pushd/Cargo.toml ./crates/daemons/pushd/
|
||||||
|
COPY crates/daemons/voice-ingress/Cargo.toml ./crates/daemons/voice-ingress/
|
||||||
RUN sh /tmp/build-image-layer.sh deps
|
RUN sh /tmp/build-image-layer.sh deps
|
||||||
|
|
||||||
# Build all apps
|
# Build all apps
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ COPY crates/services/january/Cargo.toml ./crates/services/january/
|
|||||||
COPY crates/services/gifbox/Cargo.toml ./crates/services/gifbox/
|
COPY crates/services/gifbox/Cargo.toml ./crates/services/gifbox/
|
||||||
COPY crates/daemons/crond/Cargo.toml ./crates/daemons/crond/
|
COPY crates/daemons/crond/Cargo.toml ./crates/daemons/crond/
|
||||||
COPY crates/daemons/pushd/Cargo.toml ./crates/daemons/pushd/
|
COPY crates/daemons/pushd/Cargo.toml ./crates/daemons/pushd/
|
||||||
|
COPY crates/daemons/voice-ingress/Cargo.toml ./crates/daemons/voice-ingress/
|
||||||
RUN sh /tmp/build-image-layer.sh deps
|
RUN sh /tmp/build-image-layer.sh deps
|
||||||
|
|
||||||
# Build all apps
|
# Build all apps
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
FROM debian:12 AS debian
|
FROM debian:12 AS debian
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ pub async fn raise_if_in_voice(user: &User, channel_id: &str) -> Result<()> {
|
|||||||
.to_internal_error()?
|
.to_internal_error()?
|
||||||
> 0
|
> 0
|
||||||
{
|
{
|
||||||
Err(create_error!(NotConnected))
|
Err(create_error!(AlreadyConnected))
|
||||||
} else {
|
} else {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -412,7 +412,9 @@ pub async fn sync_voice_permissions(
|
|||||||
server: Option<&Server>,
|
server: Option<&Server>,
|
||||||
role_id: Option<&str>,
|
role_id: Option<&str>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let node = get_channel_node(channel.id()).await?.unwrap();
|
let Some(node) = get_channel_node(channel.id()).await? else {
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
for user_id in get_voice_channel_members(channel.id())
|
for user_id in get_voice_channel_members(channel.id())
|
||||||
.await?
|
.await?
|
||||||
@@ -454,9 +456,9 @@ pub async fn sync_user_voice_permissions(
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.is_none_or(|member| member.roles.iter().any(|r| r == role_id))
|
.is_none_or(|member| member.roles.iter().any(|r| r == role_id))
|
||||||
}) {
|
}) {
|
||||||
let voice_state = get_voice_state(channel_id, server_id, &user.id)
|
let Some(voice_state) = get_voice_state(channel_id, server_id, &user.id).await? else {
|
||||||
.await?
|
return Ok(());
|
||||||
.unwrap();
|
};
|
||||||
|
|
||||||
let mut query = DatabasePermissionQuery::new(db, user)
|
let mut query = DatabasePermissionQuery::new(db, user)
|
||||||
.channel(channel)
|
.channel(channel)
|
||||||
|
|||||||
@@ -232,7 +232,9 @@ impl<T, E: std::fmt::Debug> ToRevoltError<T> for Result<T, E> {
|
|||||||
let loc = Location::caller();
|
let loc = Location::caller();
|
||||||
|
|
||||||
self
|
self
|
||||||
.map_err(|_| {
|
.map_err(|e| {
|
||||||
|
log::error!("{e:?}");
|
||||||
|
|
||||||
Error {
|
Error {
|
||||||
error_type: ErrorType::InternalError,
|
error_type: ErrorType::InternalError,
|
||||||
location: format!("{}:{}:{}", loc.file(), loc.line(), loc.column())
|
location: format!("{}:{}:{}", loc.file(), loc.line(), loc.column())
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
FROM debian:12 AS debian
|
FROM debian:12 AS debian
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
FROM debian:12 AS debian
|
FROM debian:12 AS debian
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
FROM debian:12 AS debian
|
FROM debian:12 AS debian
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
|
|||||||
@@ -214,40 +214,59 @@ pub async fn ingress(
|
|||||||
// forbid any size which goes over the limit and also limit the aspect ratio to stop people from making too tall or too wide and bypassing the limit.
|
// forbid any size which goes over the limit and also limit the aspect ratio to stop people from making too tall or too wide and bypassing the limit.
|
||||||
// TODO: figure out how to track audio stream quality
|
// TODO: figure out how to track audio stream quality
|
||||||
|
|
||||||
if event.event == "track_published"
|
if event.event == "track_published" {
|
||||||
&& (track.r#type == TrackType::Data as i32
|
let mut disconnect = false;
|
||||||
|| (track.r#type == TrackType::Video as i32
|
|
||||||
&& (user_limits.video_resolution[0] != 0
|
|
||||||
&& user_limits.video_resolution[1] != 0
|
|
||||||
&& track.width * track.height
|
|
||||||
> user_limits.video_resolution[0]
|
|
||||||
* user_limits.video_resolution[1])
|
|
||||||
|| (user_limits.video_aspect_ratio[0]
|
|
||||||
!= user_limits.video_aspect_ratio[1]
|
|
||||||
&& !(user_limits.video_aspect_ratio[0]
|
|
||||||
..=user_limits.video_aspect_ratio[1])
|
|
||||||
.contains(&(track.width as f32 / track.height as f32)))))
|
|
||||||
{
|
|
||||||
voice_client.remove_user(node, user_id, channel_id).await?;
|
|
||||||
delete_voice_state(channel_id, channel.server(), user_id).await?;
|
|
||||||
} else {
|
|
||||||
let partial = update_voice_state_tracks(
|
|
||||||
channel_id,
|
|
||||||
channel.server(),
|
|
||||||
user_id,
|
|
||||||
event.event == "track_published", // to avoid duplicating this entire case twice
|
|
||||||
track.source,
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
EventV1::UserVoiceStateUpdate {
|
if track.r#type == TrackType::Data as i32 {
|
||||||
id: user_id.clone(),
|
log::debug!("User published data");
|
||||||
channel_id: channel_id.clone(),
|
disconnect = true;
|
||||||
data: partial,
|
};
|
||||||
}
|
|
||||||
.p(channel_id.clone())
|
if track.r#type == TrackType::Video as i32 {
|
||||||
.await;
|
if user_limits.video_resolution[0] != 0
|
||||||
|
&& user_limits.video_resolution[1] != 0
|
||||||
|
&& track.width * track.height
|
||||||
|
> user_limits.video_resolution[0] * user_limits.video_resolution[1]
|
||||||
|
{
|
||||||
|
log::debug!("User published video with out of bounds resolution");
|
||||||
|
disconnect = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
if user_limits.video_aspect_ratio[0] != user_limits.video_aspect_ratio[1]
|
||||||
|
&& !(user_limits.video_aspect_ratio[0]..=user_limits.video_aspect_ratio[1])
|
||||||
|
.contains(&(track.width as f32 / track.height as f32))
|
||||||
|
{
|
||||||
|
log::debug!("User published video with out of bounds aspect ratio");
|
||||||
|
disconnect = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if disconnect {
|
||||||
|
log::debug!("Removing user {user_id} from channel {channel_id} {event:?} due to forbidden track.");
|
||||||
|
|
||||||
|
let _ = voice_client.remove_user(node, user_id, channel_id).await;
|
||||||
|
delete_voice_state(channel_id, channel.server(), user_id).await?;
|
||||||
|
|
||||||
|
return Ok(EmptyResponse);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
let partial = update_voice_state_tracks(
|
||||||
|
channel_id,
|
||||||
|
channel.server(),
|
||||||
|
user_id,
|
||||||
|
event.event == "track_published", // to avoid duplicating this entire case twice
|
||||||
|
track.source,
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
EventV1::UserVoiceStateUpdate {
|
||||||
|
id: user_id.clone(),
|
||||||
|
channel_id: channel_id.clone(),
|
||||||
|
data: partial,
|
||||||
}
|
}
|
||||||
|
.p(channel_id.clone())
|
||||||
|
.await;
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
FROM debian:12 AS debian
|
FROM debian:12 AS debian
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ pub async fn delete_bot(
|
|||||||
bot.delete(db).await?;
|
bot.delete(db).await?;
|
||||||
|
|
||||||
for channel_id in get_user_voice_channels(&bot.id).await? {
|
for channel_id in get_user_voice_channels(&bot.id).await? {
|
||||||
let node = get_channel_node(&channel_id).await?.unwrap();
|
if let Some(node) = get_channel_node(&channel_id).await? {
|
||||||
let channel = Reference::from_unchecked(&channel_id).as_channel(db).await?;
|
let _ = voice_client.remove_user(&node, &bot.id, &channel_id).await;
|
||||||
|
}
|
||||||
|
|
||||||
voice_client.remove_user(&node, &bot.id, &channel_id).await?;
|
let channel = Reference::from_unchecked(&channel_id).as_channel(db).await?;
|
||||||
|
|
||||||
delete_voice_state(&channel_id, channel.server(), &bot.id).await?;
|
delete_voice_state(&channel_id, channel.server(), &bot.id).await?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,9 +48,10 @@ pub async fn remove_member(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if is_in_voice_channel(&user.id, channel.id()).await? {
|
if is_in_voice_channel(&user.id, channel.id()).await? {
|
||||||
let node = get_channel_node(channel.id()).await?.unwrap();
|
if let Some(node) = get_channel_node(channel.id()).await? {
|
||||||
|
let _ = voice_client.remove_user(&node, &user.id, channel.id()).await;
|
||||||
|
}
|
||||||
|
|
||||||
voice_client.remove_user(&node, &user.id, channel.id()).await?;
|
|
||||||
delete_voice_state(channel.id(), None, &user.id).await?;
|
delete_voice_state(channel.id(), None, &user.id).await?;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -79,15 +79,15 @@ pub async fn call(
|
|||||||
// should only ever loop once but just to cover our backs.
|
// should only ever loop once but just to cover our backs.
|
||||||
|
|
||||||
for channel_id in get_user_voice_channels(&user.id).await? {
|
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)
|
let channel = Reference::from_unchecked(&channel_id)
|
||||||
.as_channel(db)
|
.as_channel(db)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
voice_client
|
|
||||||
.remove_user(&node, &user.id, &channel_id)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
delete_voice_state(&channel_id, channel.server(), &user.id).await?;
|
delete_voice_state(&channel_id, channel.server(), &user.id).await?;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ pub async fn ban(
|
|||||||
|
|
||||||
// If the member is in a voice channel while banned kick them from the voice channel
|
// 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? {
|
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();
|
if let Some(node) = get_channel_node(&channel_id).await?.unwrap() {
|
||||||
|
let _ = voice_client.remove_user(&node, &user.id, &channel_id).await;
|
||||||
voice_client.remove_user(&node, &user.id, &channel_id).await?;
|
}
|
||||||
|
|
||||||
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?
|
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ pub async fn kick(
|
|||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if let Some(channel_id) = get_user_voice_channel_in_server(&user.id, &server.id).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();
|
if let Some(node) = get_channel_node(&channel_id).await? {
|
||||||
|
let _ = voice_client.remove_user(&node, &user.id, &channel_id).await;
|
||||||
voice_client.remove_user(&node, &user.id, &channel_id).await?;
|
}
|
||||||
|
|
||||||
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?;
|
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ pub async fn delete(
|
|||||||
} else {
|
} else {
|
||||||
if let Some(channel_id) = get_user_voice_channel_in_server(&user.id, &server.id).await? {
|
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) {
|
if server.channels.iter().any(|c| c == &channel_id) {
|
||||||
let node = get_channel_node(&channel_id).await?.unwrap();
|
if let Some(node) = get_channel_node(&channel_id).await? {
|
||||||
|
let _ = voice_client.remove_user(&node, &user.id, &channel_id).await;
|
||||||
voice_client.remove_user(&node, &user.id, &channel_id).await?;
|
}
|
||||||
|
|
||||||
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?;
|
delete_voice_state(&channel_id, Some(&server.id), &user.id).await?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
FROM debian:12 AS debian
|
FROM debian:12 AS debian
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
FROM gcr.io/distroless/cc-debian12:nonroot
|
FROM gcr.io/distroless/cc-debian12:nonroot
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/stoatchat/base:latest AS builder
|
||||||
FROM debian:12 AS debian
|
FROM debian:12 AS debian
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
|
|||||||
@@ -20,25 +20,25 @@ fi
|
|||||||
|
|
||||||
TAG=$1-debug
|
TAG=$1-debug
|
||||||
echo "Building images, will tag for ghcr.io with $TAG!"
|
echo "Building images, will tag for ghcr.io with $TAG!"
|
||||||
docker build -t ghcr.io/revoltchat/base:latest -f Dockerfile.useCurrentArch .
|
docker build -t ghcr.io/stoatchat/base:latest -f Dockerfile.useCurrentArch .
|
||||||
docker build -t ghcr.io/revoltchat/server:$TAG - < crates/delta/Dockerfile
|
docker build -t ghcr.io/stoatchat/server:$TAG - < crates/delta/Dockerfile
|
||||||
docker build -t ghcr.io/revoltchat/bonfire:$TAG - < crates/bonfire/Dockerfile
|
docker build -t ghcr.io/stoatchat/bonfire:$TAG - < crates/bonfire/Dockerfile
|
||||||
docker build -t ghcr.io/revoltchat/autumn:$TAG - < crates/services/autumn/Dockerfile
|
docker build -t ghcr.io/stoatchat/autumn:$TAG - < crates/services/autumn/Dockerfile
|
||||||
docker build -t ghcr.io/revoltchat/january:$TAG - < crates/services/january/Dockerfile
|
docker build -t ghcr.io/stoatchat/january:$TAG - < crates/services/january/Dockerfile
|
||||||
docker build -t ghcr.io/revoltchat/gifbox:$TAG - < crates/services/gifbox/Dockerfile
|
docker build -t ghcr.io/stoatchat/gifbox:$TAG - < crates/services/gifbox/Dockerfile
|
||||||
docker build -t ghcr.io/revoltchat/crond:$TAG - < crates/daemons/crond/Dockerfile
|
docker build -t ghcr.io/stoatchat/crond:$TAG - < crates/daemons/crond/Dockerfile
|
||||||
docker build -t ghcr.io/revoltchat/pushd:$TAG - < crates/daemons/pushd/Dockerfile
|
docker build -t ghcr.io/stoatchat/pushd:$TAG - < crates/daemons/pushd/Dockerfile
|
||||||
docker build -t ghcr.io/revoltchat/voice-ingress:$TAG - < crates/daemons/voice-ingress/Dockerfile
|
docker build -t ghcr.io/stoatchat/voice-ingress:$TAG - < crates/daemons/voice-ingress/Dockerfile
|
||||||
|
|
||||||
if [ "$DEBUG" = "true" ]; then
|
if [ "$DEBUG" = "true" ]; then
|
||||||
git restore Cargo.toml
|
git restore Cargo.toml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker push ghcr.io/revoltchat/server:$TAG
|
docker push ghcr.io/stoatchat/server:$TAG
|
||||||
docker push ghcr.io/revoltchat/bonfire:$TAG
|
docker push ghcr.io/stoatchat/bonfire:$TAG
|
||||||
docker push ghcr.io/revoltchat/autumn:$TAG
|
docker push ghcr.io/stoatchat/autumn:$TAG
|
||||||
docker push ghcr.io/revoltchat/january:$TAG
|
docker push ghcr.io/stoatchat/january:$TAG
|
||||||
docker push ghcr.io/revoltchat/gifbox:$TAG
|
docker push ghcr.io/stoatchat/gifbox:$TAG
|
||||||
docker push ghcr.io/revoltchat/crond:$TAG
|
docker push ghcr.io/stoatchat/crond:$TAG
|
||||||
docker push ghcr.io/revoltchat/pushd:$TAG
|
docker push ghcr.io/stoatchat/pushd:$TAG
|
||||||
docker push ghcr.io/revoltchat/voice-ingress:$TAG
|
docker push ghcr.io/stoatchat/voice-ingress:$TAG
|
||||||
|
|||||||
Reference in New Issue
Block a user