diff --git a/blueprints/navi-music/docker-compose.yml b/blueprints/navi-music/docker-compose.yml new file mode 100644 index 000000000..d0fd9543c --- /dev/null +++ b/blueprints/navi-music/docker-compose.yml @@ -0,0 +1,31 @@ +services: + navi-music: + # 4.1.0 is the newest release that can boot without a YouTube OAuth2 refresh + # token; 4.1.1+ throws at startup ("YouTube OAuth token is mandatory") unless + # a valid token obtained via an interactive device-code flow is provided, so + # newer tags can never boot with template defaults. + image: anvian/navi-music:4.1.0 + restart: unless-stopped + # NaviMusic logs (rather than throws) when DISCORD_TOKEN is empty or invalid, + # then exits 0 because no JDA threads keep the JVM alive. Keep the container + # running in that case so first-time users see the instructions in the logs + # instead of a restart loop; real crashes (non-zero exits) still propagate to + # the restart policy. + entrypoint: + - sh + - -c + - >- + java $$JAVA_OPTS -jar /app/NaviMusic.jar nogui --spring.profiles.active=prod; + code=$$?; + if [ "$$code" -eq 0 ]; then + echo "NaviMusic is idle. Set DISCORD_TOKEN (and optionally Spotify/YouTube credentials) in the Environment tab, then redeploy."; + tail -f /dev/null; + fi; + exit $$code + environment: + DISCORD_TOKEN: ${DISCORD_TOKEN} + SPOTIFY_CLIENT_ID: ${SPOTIFY_CLIENT_ID} + SPOTIFY_CLIENT_SECRET: ${SPOTIFY_CLIENT_SECRET} + YOUTUBE_POTOKEN: ${YOUTUBE_POTOKEN} + YOUTUBE_VISITOR: ${YOUTUBE_VISITOR} + YOUTUBE_OAUTH2: ${YOUTUBE_OAUTH2} diff --git a/blueprints/navi-music/meta.json b/blueprints/navi-music/meta.json new file mode 100644 index 000000000..a5aefed5b --- /dev/null +++ b/blueprints/navi-music/meta.json @@ -0,0 +1,17 @@ +{ + "id": "navi-music", + "name": "NaviMusic", + "version": "4.1.0", + "description": "A Discord music bot that plays YouTube and Spotify tracks and playlists in voice channels.", + "logo": "navi-music.png", + "links": { + "github": "https://github.com/andre-carbajal/NaviMusic", + "website": "https://github.com/andre-carbajal/NaviMusic", + "docs": "https://github.com/andre-carbajal/NaviMusic#configuration" + }, + "tags": [ + "discord", + "music", + "bot" + ] +} diff --git a/blueprints/navi-music/navi-music.png b/blueprints/navi-music/navi-music.png new file mode 100755 index 000000000..ec554749a Binary files /dev/null and b/blueprints/navi-music/navi-music.png differ diff --git a/blueprints/navi-music/template.toml b/blueprints/navi-music/template.toml new file mode 100644 index 000000000..cc4a40cce --- /dev/null +++ b/blueprints/navi-music/template.toml @@ -0,0 +1,12 @@ +[config] +env = [ + # Required: create a Discord bot and paste its token. + "DISCORD_TOKEN=", + # Optional but recommended for Spotify links: https://developer.spotify.com/dashboard + "SPOTIFY_CLIENT_ID=", + "SPOTIFY_CLIENT_SECRET=", + # Optional YouTube tweaks (leave empty to use the default anonymous clients). + "YOUTUBE_POTOKEN=", + "YOUTUBE_VISITOR=", + "YOUTUBE_OAUTH2=", +]