botamusique: drop (#536182)
This commit is contained in:
@@ -233,9 +233,7 @@ nixos/modules/installer/tools/nix-fallback-paths.nix @Artturin @Ericson2314 @lo
|
||||
/doc/toolchains/llvm.chapter.md @NixOS/llvm
|
||||
|
||||
# Audio
|
||||
/nixos/modules/services/audio/botamusique.nix @mweinelt
|
||||
/nixos/modules/services/audio/snapserver.nix @mweinelt
|
||||
/nixos/tests/botamusique.nix @mweinelt
|
||||
/nixos/tests/snapcast.nix @mweinelt
|
||||
|
||||
# Browsers
|
||||
|
||||
@@ -429,7 +429,6 @@
|
||||
./services/amqp/activemq/default.nix
|
||||
./services/amqp/rabbitmq.nix
|
||||
./services/audio/alsa.nix
|
||||
./services/audio/botamusique.nix
|
||||
./services/audio/gmediarender.nix
|
||||
./services/audio/gonic.nix
|
||||
./services/audio/goxlr-utility.nix
|
||||
|
||||
@@ -150,6 +150,9 @@ in
|
||||
] "The baget module was removed due to the upstream package being unmaintained.")
|
||||
(mkRemovedOptionModule [ "services" "beegfs" ] "The BeeGFS module has been removed")
|
||||
(mkRemovedOptionModule [ "services" "beegfsEnable" ] "The BeeGFS module has been removed")
|
||||
(mkRemovedOptionModule [ "services" "botamusique" ]
|
||||
"The botamusique module has been removed. The project was archived upstream in 2024: https://github.com/azlux/botamusique"
|
||||
)
|
||||
(mkRemovedOptionModule [
|
||||
"services"
|
||||
"cgmanager"
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.botamusique;
|
||||
|
||||
format = pkgs.formats.ini { };
|
||||
configFile = format.generate "botamusique.ini" cfg.settings;
|
||||
in
|
||||
{
|
||||
options.services.botamusique = {
|
||||
enable = lib.mkEnableOption "botamusique, a bot to play audio streams on mumble";
|
||||
|
||||
package = lib.mkPackageOption pkgs "botamusique" { };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type =
|
||||
with lib.types;
|
||||
submodule {
|
||||
freeformType = format.type;
|
||||
options = {
|
||||
server.host = lib.mkOption {
|
||||
type = types.str;
|
||||
default = "localhost";
|
||||
example = "mumble.example.com";
|
||||
description = "Hostname of the mumble server to connect to.";
|
||||
};
|
||||
|
||||
server.port = lib.mkOption {
|
||||
type = types.port;
|
||||
default = 64738;
|
||||
description = "Port of the mumble server to connect to.";
|
||||
};
|
||||
|
||||
bot.username = lib.mkOption {
|
||||
type = types.str;
|
||||
default = "botamusique";
|
||||
description = "Name the bot should appear with.";
|
||||
};
|
||||
|
||||
bot.comment = lib.mkOption {
|
||||
type = types.str;
|
||||
default = "Hi, I'm here to play radio, local music or youtube/soundcloud music. Have fun!";
|
||||
description = "Comment displayed for the bot.";
|
||||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
description = ''
|
||||
Your {file}`configuration.ini` as a Nix attribute set. Look up
|
||||
possible options in the [configuration.example.ini](https://github.com/azlux/botamusique/blob/master/configuration.example.ini).
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.botamusique = {
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
unitConfig.Documentation = "https://github.com/azlux/botamusique/wiki";
|
||||
|
||||
environment.HOME = "/var/lib/botamusique";
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${cfg.package}/bin/botamusique --config ${configFile}";
|
||||
Restart = "always"; # the bot exits when the server connection is lost
|
||||
|
||||
# Hardening
|
||||
CapabilityBoundingSet = [ "" ];
|
||||
DynamicUser = true;
|
||||
IPAddressDeny = [
|
||||
"link-local"
|
||||
"multicast"
|
||||
];
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = true;
|
||||
ProcSubset = "pid";
|
||||
PrivateDevices = true;
|
||||
PrivateUsers = true;
|
||||
PrivateTmp = true;
|
||||
ProtectClock = true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectHome = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectProc = "invisible";
|
||||
ProtectSystem = "strict";
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_INET6"
|
||||
];
|
||||
StateDirectory = "botamusique";
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [
|
||||
"@system-service @resources"
|
||||
"~@privileged"
|
||||
];
|
||||
UMask = "0077";
|
||||
WorkingDirectory = "/var/lib/botamusique";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -303,7 +303,6 @@ in
|
||||
bootspec = handleTestOn [ "x86_64-linux" ] ./bootspec.nix { };
|
||||
borgbackup = runTest ./borgbackup.nix;
|
||||
borgmatic = runTest ./borgmatic.nix;
|
||||
botamusique = runTest ./botamusique.nix;
|
||||
bpf = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./bpf.nix;
|
||||
bpftune = runTest ./bpftune.nix;
|
||||
breitbandmessung = runTest ./breitbandmessung.nix;
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
{
|
||||
name = "botamusique";
|
||||
|
||||
nodes = {
|
||||
machine = {
|
||||
networking.extraHosts = ''
|
||||
127.0.0.1 all.api.radio-browser.info
|
||||
'';
|
||||
|
||||
services.murmur = {
|
||||
enable = true;
|
||||
registerName = "NixOS tests";
|
||||
};
|
||||
|
||||
services.botamusique = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
channel = "NixOS tests";
|
||||
};
|
||||
bot = {
|
||||
version = false;
|
||||
auto_check_update = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
machine.wait_for_unit("murmur.service")
|
||||
machine.wait_for_unit("botamusique.service")
|
||||
|
||||
machine.sleep(10)
|
||||
|
||||
machine.wait_until_succeeds(
|
||||
"journalctl -u murmur.service -e | grep -q '<1:botamusique(-1)> Authenticated'"
|
||||
)
|
||||
|
||||
with subtest("Check systemd hardening"):
|
||||
output = machine.execute("systemctl show botamusique.service")[1]
|
||||
machine.log(output)
|
||||
output = machine.execute("systemd-analyze security botamusique.service")[1]
|
||||
machine.log(output)
|
||||
'';
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
diff --git a/mumbleBot.py b/mumbleBot.py
|
||||
index 11bc480..7395f41 100644
|
||||
--- a/mumbleBot.py
|
||||
+++ b/mumbleBot.py
|
||||
@@ -188,11 +188,14 @@ class MumbleBot:
|
||||
th.start()
|
||||
|
||||
last_startup_version = var.db.get("bot", "version", fallback=None)
|
||||
- if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version):
|
||||
- var.db.set("bot", "version", self.version)
|
||||
- if var.config.getboolean("bot", "auto_check_update"):
|
||||
- changelog = util.fetch_changelog()
|
||||
- self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog))
|
||||
+ try:
|
||||
+ if not last_startup_version or version.parse(last_startup_version) < version.parse(self.version):
|
||||
+ var.db.set("bot", "version", self.version)
|
||||
+ if var.config.getboolean("bot", "auto_check_update"):
|
||||
+ changelog = util.fetch_changelog()
|
||||
+ self.send_channel_msg(tr("update_successful", version=self.version, changelog=changelog))
|
||||
+ except version.InvalidVersion:
|
||||
+ pass
|
||||
|
||||
# Set the CTRL+C shortcut
|
||||
def ctrl_caught(self, signal, frame):
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git a/util.py b/util.py
|
||||
index bfec1ed..5147757 100644
|
||||
--- a/util.py
|
||||
+++ b/util.py
|
||||
@@ -132,6 +132,7 @@ def check_update(current_version):
|
||||
|
||||
|
||||
def update(current_version):
|
||||
+ return "Can't update Nix installation at runtime"
|
||||
global log
|
||||
|
||||
target = var.config.get('bot', 'target_version')
|
||||
@@ -1,167 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
python3Packages,
|
||||
ffmpeg-headless,
|
||||
makeWrapper,
|
||||
nixosTests,
|
||||
nodejs,
|
||||
npmHooks,
|
||||
fetchNpmDeps,
|
||||
|
||||
# For the update script
|
||||
coreutils,
|
||||
curl,
|
||||
nix-prefetch-git,
|
||||
prefetch-npm-deps,
|
||||
jq,
|
||||
writeShellScript,
|
||||
}:
|
||||
let
|
||||
srcJson = lib.importJSON ./src.json;
|
||||
src = fetchFromGitHub {
|
||||
owner = "azlux";
|
||||
repo = "botamusique";
|
||||
inherit (srcJson) rev sha256;
|
||||
};
|
||||
|
||||
# Python needed to instantiate the html templates
|
||||
buildPython = python3Packages.python.withPackages (ps: [ ps.jinja2 ]);
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "botamusique";
|
||||
version = srcJson.version;
|
||||
|
||||
inherit src;
|
||||
|
||||
npmDeps = fetchNpmDeps {
|
||||
src = "${src}/web";
|
||||
hash = srcJson.npmDepsHash;
|
||||
};
|
||||
|
||||
npmRoot = "web";
|
||||
|
||||
patches = [
|
||||
# botamusique by default resolves relative state paths by first checking
|
||||
# whether it exists in the working directory, then falls back to using the
|
||||
# installation directory. With Nix however, the installation directory is
|
||||
# not writable, so that won't work. So we change this so that it uses
|
||||
# relative paths unconditionally, whether they exist or not.
|
||||
./unconditional-relative-state-paths.patch
|
||||
|
||||
# We can't update the package at runtime with NixOS, so this patch makes
|
||||
# the !update command mention that
|
||||
./no-runtime-update.patch
|
||||
|
||||
# Fix passing of invalid "git" version into version.parse, which results
|
||||
# in an InvalidVersion exception. The upstream fix is insufficient, so
|
||||
# we carry the correct patch downstream for now.
|
||||
./catch-invalid-versions.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# However, the function that's patched above is also used for
|
||||
# configuration.default.ini, which is in the installation directory
|
||||
# after all. So we need to counter-patch it here so it can find it absolutely
|
||||
substituteInPlace mumbleBot.py \
|
||||
--replace "configuration.default.ini" "$out/share/botamusique/configuration.default.ini" \
|
||||
--replace "version = 'git'" "version = '${version}'"
|
||||
'';
|
||||
|
||||
env.NODE_OPTIONS = "--openssl-legacy-provider";
|
||||
|
||||
nativeBuildInputs = [
|
||||
makeWrapper
|
||||
nodejs
|
||||
npmHooks.npmConfigHook
|
||||
python3Packages.wrapPython
|
||||
];
|
||||
|
||||
pythonPath = with python3Packages; [
|
||||
audioop-lts
|
||||
flask
|
||||
magic
|
||||
mutagen
|
||||
packaging
|
||||
pillow
|
||||
pymumble
|
||||
pyradios
|
||||
requests
|
||||
yt-dlp
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# Generates artifacts in ./static
|
||||
(
|
||||
cd web
|
||||
npm run build
|
||||
)
|
||||
|
||||
# Fills out http templates
|
||||
${buildPython}/bin/python scripts/translate_templates.py --lang-dir lang/ --template-dir templates/
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share $out/bin
|
||||
cp -r . $out/share/botamusique
|
||||
chmod +x $out/share/botamusique/mumbleBot.py
|
||||
wrapPythonProgramsIn $out/share/botamusique "$out ''${pythonPath[*]}"
|
||||
|
||||
# Convenience binary and wrap with ffmpeg dependency
|
||||
makeWrapper $out/share/botamusique/mumbleBot.py $out/bin/botamusique \
|
||||
--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = writeShellScript "botamusique-updater" ''
|
||||
export PATH=${
|
||||
lib.makeBinPath [
|
||||
coreutils
|
||||
curl
|
||||
nix-prefetch-git
|
||||
jq
|
||||
prefetch-npm-deps
|
||||
]
|
||||
}
|
||||
set -ex
|
||||
|
||||
OWNER=azlux
|
||||
REPO=botamusique
|
||||
VERSION="$(curl https://api.github.com/repos/$OWNER/$REPO/releases/latest | jq -r '.tag_name')"
|
||||
|
||||
nix-prefetch-git --rev "$VERSION" --url https://github.com/$OWNER/$REPO | \
|
||||
jq > "${toString ./src.json}" \
|
||||
--arg version "$VERSION" \
|
||||
'.version |= $version'
|
||||
path="$(jq '.path' -r < "${toString ./src.json}")"
|
||||
|
||||
tmp="$(mktemp -d)"
|
||||
trap 'rm -rf "$tmp"' exit
|
||||
|
||||
npmHash="$(prefetch-npm-deps $path/web/package-lock.json)"
|
||||
jq '. + { npmDepsHash: "'"$npmHash"'" }' < "${toString ./src.json}" > "$tmp/src.json"
|
||||
mv "$tmp/src.json" "${toString ./src.json}"
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
inherit (nixosTests) botamusique;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Bot to play youtube / soundcloud / radio / local music on Mumble";
|
||||
homepage = "https://github.com/azlux/botamusique";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.all;
|
||||
maintainers = [ ];
|
||||
mainProgram = "botamusique";
|
||||
};
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"url": "https://github.com/azlux/botamusique",
|
||||
"rev": "9b9b4e40ce7b077ebfa3b9be08d32025d1e43bc3",
|
||||
"date": "2021-10-27T02:29:59+02:00",
|
||||
"path": "/nix/store/9gxn2bw0757yrmx0xhhwq642lixyy88x-botamusique",
|
||||
"sha256": "07n6nyi84ddqp2x8xrds7q83yfqapl5qhkcprzjsmvxhv4a3ar8q",
|
||||
"fetchLFS": false,
|
||||
"fetchSubmodules": false,
|
||||
"deepClone": false,
|
||||
"leaveDotGit": false,
|
||||
"version": "7.2.2",
|
||||
"npmDepsHash": "sha256-IzEO7TFqIZUkhNGf0pnHbK/WFexF27RPD9lkYvmFmDw="
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
diff --git a/util.py b/util.py
|
||||
index bfec1ed..0546772 100644
|
||||
--- a/util.py
|
||||
+++ b/util.py
|
||||
@@ -22,16 +22,7 @@ log = logging.getLogger("bot")
|
||||
|
||||
|
||||
def solve_filepath(path):
|
||||
- if not path:
|
||||
- return ''
|
||||
-
|
||||
- if path[0] == '/':
|
||||
- return path
|
||||
- elif os.path.exists(path):
|
||||
- return path
|
||||
- else:
|
||||
- mydir = os.path.dirname(os.path.realpath(__file__))
|
||||
- return mydir + '/' + path
|
||||
+ return path
|
||||
|
||||
|
||||
def get_recursive_file_list_sorted(path):
|
||||
@@ -409,6 +409,7 @@ mapAliases {
|
||||
bob = throw "'bob' has been removed as it is unmaintained upstream and has vulnerable dependencies."; # Added 2025-12-29
|
||||
bodyclose = throw "'bodyclose' has been removed because it was broken for an entire release cycle."; # Added 2026-05-31
|
||||
boost177 = throw "Boost 1.77 has been removed as it is obsolete and no longer used by anything in Nixpkgs"; # Added 2026-04-20
|
||||
botamusique = throw "botamusique has been removed as upstream stopped maintenance"; # Added 2026-06-28
|
||||
botan2 = throw "botan2 has been removed as it is EOL"; # Added 2025-10-20
|
||||
bower2nix = throw "bower2nix has been removed as bower was removed. It is recommended to migrate to yarn."; # Added 2025-09-17
|
||||
boxfs = throw "'boxfs' has been removed, as it depends on unsupported fuse2 and unmaintained upstream"; # Added 2026-05-30
|
||||
|
||||
Reference in New Issue
Block a user