Skip to content

Commit 7a2c215

Browse files
Merge pull request #182 from floriegl/master
Update from floriegl's fork
2 parents f4ef7a2 + 45faa8b commit 7a2c215

File tree

114 files changed

+2376
-14540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+2376
-14540
lines changed

.env.example

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
# only used for docker
22

3-
DOMAIN=
43
PORT=
54

65
# Spotify Client / Secret; make an application over here: https://developer.spotify.com/my-applications/
76
SPOTIFYCLIENT=
87
SPOTIFYSECRET=
98

10-
# Only needed if you're doing oauth logins
11-
GOOGLECLIENT=
12-
GOOGLESECRET=
13-
149
# This can be obtained from here: https://developers.google.com/youtube/v3/getting-started
1510
YOUTUBE_API_KEY=
1611

1712
# database setup, can be left untouched if the database isn't manually exposed
18-
SQL_USERNAME=eternal_user
19-
SQL_PASSWORD=36ngEC5AmoLT6x
20-
SQL_TYPE=mysql
21-
SQL_HOST=db
22-
SQL_PORT=3306
23-
SQL_DATABASE_NAME=eternaljukebox
13+
#SQL_USERNAME=eternal_user
14+
#SQL_PASSWORD=36ngEC5AmoLT6x
15+
#SQL_TYPE=mysql
16+
#SQL_HOST=db
17+
#SQL_PORT=3306
18+
#SQL_DATABASE_NAME=eternaljukebox
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v3
15+
-
16+
name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
18+
-
19+
name: Login to Docker Hub
20+
uses: docker/login-action@v2
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
-
25+
name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v2
27+
-
28+
name: Build and push
29+
uses: docker/build-push-action@v4
30+
with:
31+
context: .
32+
platforms: linux/amd64,linux/arm64/v8
33+
file: ./Dockerfile
34+
push: true
35+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/eternaljukebox:latest

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ trid_audio/
5656
working/
5757
!/src/main/kotlin/org/abimon/eternalJukebox/data/audio
5858
/data/
59-
/database/
59+
/database/*
60+
!/database/eternal_jukebox.mv.db.init
6061
web
6162

6263
# ignore config files
@@ -66,3 +67,6 @@ config.json
6667

6768
# docker-compose environment
6869
.env
70+
71+
build/
72+
bin/

Authentication.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

Dockerfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
# set up the main image with dependencies first, to avoid re-doing this after each build
2-
FROM adoptopenjdk:8-jdk-hotspot as deps
2+
FROM amazoncorretto:11-alpine as deps
33

44
WORKDIR /EternalJukebox
55

6-
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp \
7-
&& chmod a+rx /usr/local/bin/yt-dlp \
8-
&& apt-get update \
9-
&& apt-get install ffmpeg gettext python3 -y \
10-
&& apt-get clean \
6+
RUN wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp \
7+
&& chmod a+rx /usr/local/bin/yt-dlp
8+
9+
RUN apk update \
10+
&& apk add ffmpeg gettext python3 \
1111
&& touch hikari.properties
1212

1313
# build jar with gradle
1414

15-
FROM gradle:jdk8 as gradle-build
15+
FROM gradle:8-jdk11 as gradle-build
1616

1717
WORKDIR /home/gradle/project
1818

19-
2019
# Only copy dependency-related files
2120
COPY build.gradle gradle.propertie* settings.gradle ./EternalJukebox/
2221

@@ -26,12 +25,13 @@ RUN gradle clean shadowJar --no-daemon > /dev/null 2>&1 || true
2625

2726
COPY . ./EternalJukebox
2827

29-
RUN cd EternalJukebox\
30-
&& gradle clean shadowJar --no-daemon
28+
WORKDIR /home/gradle/project/EternalJukebox
29+
30+
RUN gradle clean shadowJar --no-daemon
3131

3232
# build web with jekyll
3333

34-
FROM jekyll/jekyll:stable as jekyll-build
34+
FROM rockstorm/jekyll:latest as jekyll-build
3535

3636
WORKDIR /EternalJukebox
3737

@@ -49,4 +49,4 @@ COPY --from=gradle-build /home/gradle/project/EternalJukebox/build/libs/* ./
4949
# envsubst is used so environment variables can be used instead of a config file
5050

5151
CMD envsubst < "/EternalJukebox/envvar_config.yaml" > "/EternalJukebox/config.yaml"\
52-
&& java -jar EternalJukebox.jar
52+
&& java -jar EternalJukebox-all.jar

Dockerfile.dev

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# set up the main image with dependencies first, to avoid re-doing this after each build
2+
FROM amazoncorretto:11-alpine as deps
3+
4+
WORKDIR /EternalJukebox
5+
6+
RUN wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp \
7+
&& chmod a+rx /usr/local/bin/yt-dlp
8+
9+
RUN apk update \
10+
&& apk add ffmpeg gettext python3 \
11+
&& touch hikari.properties
12+
13+
# build jar with gradle
14+
15+
FROM gradle:8-jdk11 as gradle-build
16+
17+
WORKDIR /home/gradle/project
18+
19+
# Only copy dependency-related files
20+
COPY build.gradle gradle.propertie* settings.gradle ./EternalJukebox/
21+
22+
# Only download dependencies
23+
# Eat the expected build failure since no source code has been copied yet
24+
RUN gradle clean shadowJar --no-daemon > /dev/null 2>&1 || true
25+
26+
COPY . ./EternalJukebox
27+
28+
WORKDIR /home/gradle/project/EternalJukebox
29+
30+
# Do not build on the dev docker container
31+
# We'll use the mounted from the host machine becuase that's faster
32+
#RUN gradle clean shadowJar --no-daemon
33+
34+
# build web with jekyll
35+
36+
FROM rockstorm/jekyll:latest as jekyll-build
37+
38+
WORKDIR /EternalJukebox
39+
40+
COPY --from=gradle-build /home/gradle/project/EternalJukebox .
41+
42+
RUN chmod -R 777 . && jekyll build --source _web --destination web
43+
44+
# copy into main image
45+
46+
FROM deps as main
47+
48+
COPY --from=jekyll-build /EternalJukebox/ ./
49+
COPY --from=gradle-build /home/gradle/project/EternalJukebox/build/libs/* ./
50+
51+
# envsubst is used so environment variables can be used instead of a config file
52+
53+
CMD envsubst < "/EternalJukebox/envvar_config.yaml" > "/EternalJukebox/config.yaml"\
54+
&& java -jar EternalJukebox-all.jar

README.md

Lines changed: 61 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,124 @@
11
# EternalJukebox
22

3-
The source files for the EternalJukebox, a rehosting of the Infinite Jukebox.
4-
This repo contains everything you need to host the EternalJukebox on your own server!
3+
This repository is a fork which fixes bugs because the upstream repo is unmaintained.
54

6-
You can visit the official site [here](https://eternalbox.dev/), in case you want to mess around with it without doing all the hard stuff.
5+
You can visit the hosted instance of this repository [here](https://eternalbox.floriegl.tech), in case you want to mess around with it without doing all the hard stuff.
6+
7+
The source files for the EternalJukebox, a rehosting of the Infinite Jukebox.
8+
This repo contains everything you need to host the EternalJukebox on your own server!
79

810
# Docker Install
911

10-
## Prerequesits
12+
## Prerequisites
1113

1214
You need to install [docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/)
1315

14-
Then, download or clone the repository.
15-
1616
## Configuration
1717

18-
To configure, rename `.env.example` to `.env` and change the appropriate values. For advanced configuration edit `envvar_config.yaml`.
18+
To configure, grab `.env.example` from this repository, rename it to `.env` and change the appropriate values.
19+
20+
You'll also need `envvar_config.yaml`, but only edit this if you want some advanced configuration.
1921

2022
## Running
2123

22-
To start, run `docker-compose up -d` in the repositories directory. To stop, run `docker-compose down`.
24+
You can use the following `docker-compose.yaml` as a starting point to run the application without needing a database running, if you want to use a db refer to the main `docker-compose.yaml`.
25+
26+
```yaml
27+
version: "3"
28+
29+
services:
30+
main:
31+
image: daviirodrig/eternaljukebox
32+
ports:
33+
- 8080:8080
34+
env_file:
35+
- .env
36+
volumes:
37+
- "./envvar_config.yaml:/EternalJukebox/envvar_config.yaml"
38+
```
2339
24-
If you change anything in the repository, like pulling updates, run `docker-compose build` to re-build the application.
40+
To start, run `docker compose up -d` in the folder containing `envvar_config.yaml`, `.env` and `docker-compose.yaml`. To stop, run `docker compose down`.
2541

26-
If you want to change the port from 8080, edit `docker-compose.yml` line 9, to be `- <your port>:8080`
42+
If you want to you can upgrade the image by pulling the newest with `docker pull daviirodrig/eternaljukebox` and then restart with `docker compose down` and `docker compose up -d`
43+
44+
If you want to change the port from 8080, edit `docker-compose.yml` port, to be `- <your port>:8080`
2745

2846
# Manual Install
2947

3048
## Prerequisites
3149

3250
### Java:
51+
3352
##### Windows
34-
Download and install Java from https://www.java.com/en/download/
53+
54+
Download and install Java from https://www.java.com/en/download/
55+
3556
##### Debian-based Linux distributions
36-
For Ubuntu or Debian-based distributions execute `sudo apt-get install default-jre` in the terminal
57+
58+
For Ubuntu or Debian-based distributions execute `sudo apt-get install default-jre` in the terminal
59+
3760
##### Fedora and CentOS
38-
There is a tutorial for installing java on Fedora and CentOS at https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora
61+
62+
There is a tutorial for installing java on Fedora and CentOS at https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora
3963

4064
### Yt-dlp (a more up-to-date fork of Youtube-dl):
65+
4166
##### Windows
67+
4268
Download the .exe at https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe and place it in `C:\Windows\`, or in another folder on the PATH.
69+
4370
##### Linux
44-
Use these commands in the terminal to install youtube-dl on Linux:
45-
`sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp`
71+
72+
Use these commands in the terminal to install youtube-dl on Linux:
73+
`sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp`
4674
`sudo chmod a+rx /usr/local/bin/yt-dlp`
4775

4876
### ffmpeg:
77+
4978
##### Windows
79+
5080
Download the exe from https://ffmpeg.zeranoe.com/builds/ and place it in `C:\Windows\`, or in another folder on teh PATH.
81+
5182
##### Linux
83+
5284
ffmpeg is available to download in most distributions using `sudo apt-get install ffmpeg` or equivalent
5385

5486
## Getting the project files:
87+
5588
The whole process of obtaining project files is much easier now, as the build process is streamlined through Jenkins.
5689

5790
The project site is over [here](https://jenkins.abimon.org/job/EternalJukebox/), and contains the individual files to download, or an all-in-one zip for all the files. Alternatively, the files can be found over at a permanent server [here](https://abimon.org/eternal_jukebox)
5891

5992
## Configuring
93+
6094
First thing to do is create a new file called either `config.yaml` or `config.json` (YAML tends to be easier to write, but takes up slightly more space), then open it with notepad/notepad++ on Windows and whatever text editor you like on Linux (for example nano: `nano config.json`)
6195

62-
Now you should go to https://developer.spotify.com/my-applications/ and log in to your spotify account.
63-
Then click the "Create an app" button and a new page should popup.
64-
There give it a name and description and click create.
65-
It should send you to the new app's page, the only thing you need from here is your Client ID and Client Secret
66-
(Note: Never share these with anyone!)
96+
Now you should go to https://developer.spotify.com/my-applications/ and log in to your spotify account.
97+
Then click the "Create an app" button and a new page should popup.
98+
There give it a name and description and click create.
99+
It should send you to the new app's page, the only thing you need from here is your Client ID and Client Secret
100+
(Note: Never share these with anyone!)
67101

68102
You will also need a Youtube Data API key, which you can find about how to obtain [here](https://developers.google.com/youtube/v3/getting-started).
69103

70104
There are a variety of config options (documentation coming soon) that allow most portions of the EternalJukebox to be configured, and these can be entered here.
71105

72106
## Starting the server:
73107

74-
First you need to open the Terminal or Command Prompt.
75-
Then make sure its running in the folder that your EternalJukebox.jar is in, once again to do this use the `cd` command.
108+
First you need to open the Terminal or Command Prompt.
109+
Then make sure its running in the folder that your EternalJukebox.jar is in, once again to do this use the `cd` command.
76110
Then execute the jar with `java -jar EternalJukebox.jar`
77111

78-
If everything went right it should say `Listening at http://0.0.0.0:11037`
112+
If everything went right it should say `Listening at http://0.0.0.0:11037`
79113

80-
you should now be able to connect to it with a browser through http://localhost:11037
114+
you should now be able to connect to it with a browser through http://localhost:11037
81115

82-
Congrats you did it!
116+
Congrats you did it!
83117

84118
## Manually Building
119+
85120
This is not recommended unless you're making some modifications, and as such should only be performed by more advanced users
86121

87-
You'll need to obtain a copy of [Gradle](https://gradle.org/install/), likely a [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), and [Jekyll](https://jekyllrb.com/). You'll also need the project files in some capacity, be it `git clone` or downloading the archive from GitHub.
122+
You'll need to obtain a copy of [Gradle](https://gradle.org/install/), likely a [JDK](https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html), and [Jekyll](https://jekyllrb.com/). You'll also need the project files in some capacity, be it `git clone` or downloading the archive from GitHub.
88123

89124
From there, building in Gradle is simple; just run `gradle clean shadowJar` from the project file directory. That should produce a jar file in `build/libs` that will work for you. In addition, you'll need to build the Jekyll webpages, which can be done by running `jekyll build --source _web --destination web`

_web/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: The Eternal Jukebox
2-
url: https://eternal.abimon.org
2+
url: https://eternalbox.floriegl.tech
33

44
defaults:
55
-

_web/_data/faq.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ faq:
5555
- question: Who made this?
5656
id: creator
5757
answer: "The original site was made by [Paul Lamere](http://twitter.com/plamere) at [Music Hack Day Boston](http://boston.musichackday.org/) on November 11, 2012 (More info at [Music Machinery](http://musicmachinery.com/2012/11/12/the-infinite-jukebox/) ), and used to be hosted over [here.](http://labs.echonest.com/Uploader/index.html)
58-
This site is a rework of the original project, and is now hosted by [UnderMybrella]({{ site.data.var.git }})."
58+
This site is a rework of the original project, and it was hosted by [UnderMybrella](https://github.com/UnderMybrella/EternalJukebox) and [daviirodrig](https://github.com/daviirodrig/EternalJukebox), but this instance is hosted by [floriegl]({{ site.data.var.git }})"
5959

6060
- question: Help! My audio seems to be jumping randomly!
6161
id: random-jump

_web/_data/var.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cdn: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7"
2-
git: "https://github.com/UnderMybrella/EternalJukebox"
1+
cdn: "https://maxcdn.bootstrapcdn.com"
2+
git: "https://github.com/floriegl/EternalJukebox"
33
jquery: "https://code.jquery.com"
4-
version: "1-1-1"
4+
version: "1-2-1"

0 commit comments

Comments
 (0)