Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
dist
.env
.env.local
*.log
.git
.gitignore
.DS_Store
docs/.vitepress/cache
docs/.vitepress/dist
data
12 changes: 9 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
# WARNING: Using self-bots violates Discord ToS - use at your own risk
DISCORD_TOKEN=your_discord_user_token_here

# Owner ID - Your MAIN account's user ID (the account that controls the bot)
# Right-click your profile → Copy User ID (requires Developer Mode)
OWNER_ID=your_main_account_user_id_here
# Allowed Users - Comma-separated user IDs who can control the bot
# Right-click user → Copy User ID (requires Developer Mode)
# Leave empty to only allow the bot's own account
ALLOWED_USERS=

# Allowed Roles - Comma-separated role IDs that can control the bot
# Right-click role → Copy Role ID (requires Developer Mode)
# Users with ANY of these roles can use the bot
ALLOWED_ROLES=

# Allowed Guilds - Comma-separated server IDs (leave empty for all servers)
# Right-click server → Copy Server ID (requires Developer Mode)
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
- master
tags:
- 'v*'
pull_request:
branches:
- main
- master
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy Docs to GitHub Pages

on:
push:
branches:
- main
- master
paths:
- 'docs/**'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies
run: cd docs && bun install

- name: Build docs
run: cd docs && bun run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/.vitepress/dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Dependencies
node_modules/
docs/node_modules/
docs/.vitepress/cache

# Build output
dist/
docs/dist/

# Environment
.env
Expand Down Expand Up @@ -34,3 +37,4 @@ yarn-error.log*
# Temporary files
tmp/
temp/
data/
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Build stage
FROM oven/bun:latest AS base
WORKDIR /app

# Install dependencies
FROM base AS install
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile --production

# Release stage
FROM base AS release

# Install FFmpeg
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg && \
rm -rf /var/lib/apt/lists/*

# Copy dependencies
COPY --from=install /app/node_modules ./node_modules

# Copy source
COPY . .

# Build TypeScript
RUN bun run build

# Create data directory
RUN mkdir -p /app/data

# Set environment
ENV NODE_ENV=production

# Volume for persistent data
VOLUME ["/app/data"]

# Run the app
CMD ["bun", "start"]
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.8'

services:
schrostream:
build: .
container_name: schrostream
restart: unless-stopped
network_mode: host
environment:
- DISCORD_TOKEN=${DISCORD_TOKEN}
- PLEX_URL=${PLEX_URL}
- PLEX_TOKEN=${PLEX_TOKEN}
- COMMAND_PREFIX=${COMMAND_PREFIX:-!}
- ALLOWED_USERS=${ALLOWED_USERS:-}
- ALLOWED_ROLES=${ALLOWED_ROLES:-}
- ALLOWED_GUILDS=${ALLOWED_GUILDS:-}
- DEFAULT_QUALITY=${DEFAULT_QUALITY:-1080}
- MAX_BITRATE=${MAX_BITRATE:-8000}
- AUDIO_BITRATE=${AUDIO_BITRATE:-192}
- PLEX_CLIENT_IDENTIFIER=${PLEX_CLIENT_IDENTIFIER:-SchroStream}
volumes:
- ./data:/app/data
64 changes: 64 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { defineConfig } from 'vitepress'

export default defineConfig({
title: 'SchroStream',
description: 'Discord Plex Streaming Self-Bot Documentation',

head: [
['link', { rel: 'icon', href: '/favicon.ico' }]
],

themeConfig: {
logo: '/logo.png',

nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide/getting-started' },
{ text: 'GitHub', link: 'https://github.com/moderniselife/SchroStream' }
],

sidebar: [
{
text: 'Introduction',
items: [
{ text: 'What is SchroStream?', link: '/guide/introduction' },
{ text: 'Getting Started', link: '/guide/getting-started' },
]
},
{
text: 'Setup',
items: [
{ text: 'Prerequisites', link: '/guide/prerequisites' },
{ text: 'Discord Token', link: '/guide/discord-token' },
{ text: 'Plex Token', link: '/guide/plex-token' },
{ text: 'Configuration', link: '/guide/configuration' },
]
},
{
text: 'Deployment',
items: [
{ text: 'Local Installation', link: '/guide/local-install' },
{ text: 'Docker', link: '/guide/docker' },
{ text: 'Docker Compose', link: '/guide/docker-compose' },
]
},
{
text: 'Usage',
items: [
{ text: 'Commands', link: '/guide/commands' },
{ text: 'Permissions', link: '/guide/permissions' },
{ text: 'Troubleshooting', link: '/guide/troubleshooting' },
]
}
],

socialLinks: [
{ icon: 'github', link: 'https://github.com/moderniselife/SchroStream' }
],

footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2024 SchroStream'
}
}
})
Loading
Loading