Port from monorepo

This commit is contained in:
paul 2020-08-13 04:47:48 +02:00
commit e931310141
5 changed files with 172 additions and 0 deletions

67
Dockerfile Normal file
View file

@ -0,0 +1,67 @@
FROM debian:buster
EXPOSE 6600
RUN \
DEBIAN_FRONTEND=noninteractive \
apt-get clean \
&& apt-get update \
&& apt-get install --no-install-recommends -qy \
mpd mpc tmux bzip2 patch curl libyaml-dev git libopus-dev \
build-essential zlib1g zlib1g-dev libssl-dev ruby \
ruby-dev rubygems automake autoconf libtool psmisc \
util-linux supervisor ca-certificates libogg-dev python-pip \
ffmpeg cron \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /opt/musicbot/src
RUN \
git clone https://github.com/dafoxia/mumble-ruby.git \
&& git clone https://github.com/dafoxia/celt-ruby.git \
&& git clone https://github.com/dafoxia/opus-ruby.git \
&& git clone https://github.com/mumble-voip/celt-0.7.0.git celt \
&& git clone https://github.com/dafoxia/mumble-ruby-pluginbot.git \
&& (cd mumble-ruby-pluginbot && git checkout -b devel --track origin/devel)
RUN rm /opt/musicbot/src/mumble-ruby-pluginbot/plugins/radiostream.rb
WORKDIR /opt/musicbot/src/mumble-ruby
RUN gem build mumble-ruby.gemspec
RUN gem install mumble-ruby-*.gem
RUN gem install ruby-mpd
RUN gem install crack
WORKDIR /opt/musicbot/src/celt-ruby
RUN gem build celt-ruby.gemspec
RUN gem install celt-ruby
WORKDIR /opt/musicbot/src/celt
RUN \
./autogen.sh &&\
./configure --prefix=/opt/musicbot/src/celt &&\
make &&\
make install
WORKDIR /opt/musicbot/src/opus-ruby
RUN gem build opus-ruby.gemspec
RUN gem install opus-ruby
RUN pip install youtube-dl
WORKDIR /opt/musicbot
ADD conf/config.yml /opt/musicbot/src/mumble-ruby-pluginbot/config/config.yml
ADD conf/supervisord.conf /etc/supervisor/conf.d/
ADD conf/mpd.conf /opt/musicbot/src/mumble-ruby-pluginbot/plugins/mpd.conf
ADD conf/crontab.txt /tmp/crontab.txt
RUN chown -R daemon: /opt/musicbot
RUN chown daemon: /var/lib/mpd/music
RUN crontab /tmp/crontab.txt
ENTRYPOINT [ "supervisord" ]

60
conf/config.yml Normal file
View file

@ -0,0 +1,60 @@
---
config:
version: 2.2
debug: false
language: en
main:
remoteui: false
tempdir: "/opt/musicbot/temp/"
ducking: false
automute_if_alone: false
stop_on_unregistered: false
channel_notify: 0
controllable: true
control:
string: "."
message:
private_only: false
registered_only: true
historysize: 20
display:
comment:
set: true
user:
whitelisted:
superuser:
banned:
bound:
certfolder: "/opt/musicbot/certs/"
fifo: "/opt/musicbot/mpd.fifo"
logo: "../config/logo/logo.html"
timer:
ticks: 3600
blacklisted_commands: "settings bind unbind reset restart blacklist ducking duckvol bitrate framesize debug gotobed wakeup follow unfollow stick unstick history automute file"
mumble:
use_vbr: true
bitrate: 96000
host: mumble.zom.bi
port: 64738
name: musicbot
password: ''
channel: "Bots"
plugin:
mpd:
volume: 40
host: localhost
port: 6600
musicfolder: "/var/lib/mpd/music/"
youtube:
youtube_dl:
path: "youtube-dl"
soundcloud:
youtube_dl:
path: "youtube-dl"
bandcamp:
youtube_dl:
path: "youtube-dl"

1
conf/crontab.txt Normal file
View file

@ -0,0 +1 @@
0 9 * * * pip install -U youtube-dl >/dev/null 2>&1

27
conf/mpd.conf Normal file
View file

@ -0,0 +1,27 @@
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
db_file "/opt/musicbot/tag_cache"
log_file "/opt/musicbot/mpd.log"
pid_file "/opt/musicbot/pid"
state_file "/opt/musicbot/state"
sticker_file "/opt/musicbot/sticker.sql"
user "daemon"
bind_to_address "0.0.0.0"
port "6600"
input {
plugin "curl"
}
audio_output {
type "fifo"
name "FIFO-Bot1"
path "/opt/musicbot/mpd.fifo"
format "48000:16:2"
mixer_type "software"
}
filesystem_charset "UTF-8"
id3v1_encoding "UTF-8"
buffer_before_play "20%"
audio_buffer_size "20480"
max_output_buffer_size "32768"

17
conf/supervisord.conf Normal file
View file

@ -0,0 +1,17 @@
[supervisord]
nodaemon=true
[program:mpd]
user = daemon
command = mpd --no-daemon /opt/musicbot/mpd.conf
[program:ruby]
user = daemon
command = ruby pluginbot.rb --config=/opt/musicbot/config.yml
environment = LD_LIBRARY_PATH=/opt/musicbot/src/celt/lib/
directory = /opt/musicbot/src/mumble-ruby-pluginbot/core
[program:cron]
command = cron -f -L 1
autostart=true
autorestart=true