Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS3AudioBot on raspberry #1029

Open
DAIIIIIIIIIIIIII opened this issue Apr 4, 2023 · 3 comments
Open

TS3AudioBot on raspberry #1029

DAIIIIIIIIIIIIII opened this issue Apr 4, 2023 · 3 comments

Comments

@DAIIIIIIIIIIIIII
Copy link

hello, i wanted to download the bot to my raspberry pi 4, but i am not sure if i can do it. i have installed raspberry pi os lite, but i am uncertain about the type of processor the raspberry mounts (armv7 - armv8)

@DAIIIIIIIIIIIIII DAIIIIIIIIIIIIII changed the title TS2AudioBot on raspberry TS3AudioBot on raspberry Apr 4, 2023
@Snogard
Copy link

Snogard commented May 12, 2023

I'm running mine on a docker container, i used the arm64 build

@paradox-sp
Copy link

I'm running mine on a docker container, i used the arm64 build

can you please share docker compose or docker image
The one you have given in the repo doent work

@Snogard
Copy link

Snogard commented Aug 13, 2023

I use podman to build and run the container, i did try to use alpine but i don't remember the issues i was having so arch it is.

first, dowload the nightly build from here -> https://splamy.de/nightly
then make a folder with those files, and while inside that folder, launch build.sh.

when the build is completed run install.sh

Hope it helps!

tree:

.
├── build.sh
├── install.sh
├── Dockerfile
├── src
│   └── entrypoint.sh
├── ts3audiobot-amd64.tar.gz
└── ts3audiobot-arm64.tar.gz

build.sh:

#!/bin/bash
dockerfile=Dockerfile
tag=ts3audiobot:0.13.0-alpha.41

chmod +x -R src/*

mkdir -p ts3audiobot

file=ts3audiobot-amd64.tar.gz

if [ $(uname -m) == "aarch64" ]; then
    file=ts3audiobot-arm64.tar.gz
else
    file=ts3audiobot-amd64.tar.gz
fi

cp $file ./ts3audiobot/ts3audiobot.tar.gz

cd ts3audiobot
tar xf ts3audiobot.tar.gz
rm ts3audiobot.tar.gz
cd ..

podman pull docker.io/lopsided/archlinux
podman build -f ./$dockerfile -t $tag

Dockerfile:

FROM docker.io/lopsided/archlinux

RUN pacman -Sy --noconfirm icu opus yt-dlp ffmpeg
RUN ln -s /usr/bin/yt-dlp /usr/bin/youtube-dl

RUN mkdir /bot
RUN mkdir /config
RUN mkdir /logs

COPY ts3audiobot /bot

RUN ln -s /logs /bot/logs

ADD src /src
RUN ls /src

ENTRYPOINT "/src/entrypoint.sh"

entrypoint.sh:

#!/bin/bash

fileArray=("bots" "Nlog.config" "rights.toml" "ts3audiobot.db" "ts3audiobot.toml" )

for file in ${fileArray[@]}; do
    src=/bot/$file
    dst=/config/$file

    if [ -e $dst ]; then
        if [ ! -L $src ]; then
            ln -s $dst $src
            echo "Creating symklink $src -> $dst"
        fi
    elif [ -e $src ]; then 
        if [ ! -L $src ]; then
            mv $src $dst
            echo "Moving $src to $dst"
            ln -s $dst $src
            echo "Creating symlink $src $dst"
        else
            rm $src
            echo "Removing broken link $src"
        fi
    fi
done

cd /bot
/bot/TS3AudioBot

install.sh

#!/bin/bash

containerName=ts3audiobot
imageName=localhost/ts3audiobot:0.13.0-alpha.41

dstConfigPath=/mnt/storage/containers/$containerName/config
dstLogsPath=/mnt/storage/containers/$containerName/logs


if [ ! -d  "${dstConfigPath}" ]; then
    echo "Creating folder path at ${dstConfigPath}"
    mkdir -p $dstConfigPath
fi

if [ ! -d  "${dstLogsPath}" ]; then
    echo "Creating folder path at ${dstLogsPath}"
    mkdir -p $dstLogsPath
fi


if podman ps --all | grep -qi ${containerName}; then
    podman stop $containerName
    podman rm $containerName
fi

if [ ! -f $dstConfigPath/rights.toml ] || [ ! -f $dstConfigPath/ts3audiobot.toml ]; then
    echo "The admin uid is the user id that will have admin powers over the bot"
    podman run -it \
        --name $containerName \
        -v $dstConfigPath:/config \
        -v $dstLogsPath:/logs \
        -p 58913:58913/tcp \
        $imageName
else
    podman create \
        --name $containerName \
        -v $dstConfigPath:/config \
        -v $dstLogsPath:/logs \
        -p 58913:58913/tcp \
        $imageName
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants