forked from jmug/stoatchat
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
# 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