├── .replit ├── LICENSE ├── README.md ├── application.yml ├── replit.nix └── start.sh /.replit: -------------------------------------------------------------------------------- 1 | run = ["bash", "start.sh"] 2 | 3 | entrypoint = "start.sh" 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 S Dip 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Where I can host ? 4 | [Windows](https://github.com/brblacky/lavalink-server#windows) 5 | • [Linux](https://github.com/brblacky/lavalink-server#linux) 6 | • [replit](https://github.com/brblacky/lavalink-server#replit) 7 | 8 | ## what is pm2 9 | 10 | PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications **alive forever**, to reload them without downtime and to facilitate common system admin tasks. 11 | 12 | ## Windows 13 | - download and install java [here](https://adoptopenjdk.net/) 14 | 15 | **Note**: _Java v11 or newer is required to run the Lavalink.jar. Java v13 is recommended._ If you are using **sdkman** then _its a manager, not Java, you have to install sdkman and use sdkman to install Java_ 16 | 17 | **Warning**: Java v14 has issues with Lavalink. 18 | 19 | - download or gitclone 20 | ```cmd 21 | git clone https://github.com/brblacky/lavalink-server.git 22 | ``` 23 | 24 | - go into the folder with `lavalink-server` 25 | 26 | - edit `application.yml` Password and port 27 | 28 | - run for: double click on `start.sh` 29 | 30 | **pm2** 31 | 32 | - install node.js 33 | - install pm2 `npm i pm2` 34 | - run `pm2 start java -- -jar Lavalink.jar` 35 | 36 | 37 | ## Linux 38 | - download curl 39 | ```cmd 40 | sudo apt install -y curl 41 | ``` 42 | 43 | **Note**: _Java v11 or newer is required to run the Lavalink.jar. Java v13 is recommended._ If you are using **sdkman** then _its a manager, not Java, you have to install sdkman and use sdkman to install Java_ 44 | 45 | **Warning**: Java v14 has issues with Lavalink. 46 | 47 | - download or gitclone 48 | ```cmd 49 | git clone https://github.com/brblacky/lavalink-server.git 50 | ``` 51 | - cd `lavalink-server` 52 | 53 | - Run lavalink and install java 54 | `chmod +x start.sh` 55 | 56 | To run your script : `./start.sh` 57 | Another option is as follows to execute shell script: `sh start.sh` OR `bash start.sh` Or `sudo bash start.sh` 58 | 59 | **pm2** 60 | 61 | - install node.js 62 | ```cmd 63 | sudo apt update 64 | ``` 65 | ```cmd 66 | sudo apt install nodejs 67 | 68 | ``` 69 | 70 | - install pm2 `npm i pm2` 71 | - run `pm2 start java -- -jar Lavalink.jar` 72 | 73 | 74 | ## replit 75 | 76 | [![Run on Repl.it](https://repl.it/badge/github/brblacky/lavalink-server)](https://repl.it/github/brblacky/lavalink-server) 77 | 78 | **Connecting** 79 | - Lavalink's port will always 443 in replit 80 | - Default password `youshallnotpass` 81 | - using custom lavalink client 82 | 83 | **Important notes** 84 | - To keep this 24/7 you need to make an account on UptimeRobot service, and make HTTP request to your app every 5 minutes. For example, if your app is named `lavalink-repl` and your repl username is `ahmasa` then make HTTP request to `https://lavalink-repl.ahmasa.repl.co` 85 | - Do not forget to set your password (in `application.yml` file) 86 | - Connection to node must be secured E.g https/wss 87 | 88 | **example** 89 | ```js 90 | 91 | "host": "lavalink.brblacky1.repl.co", 92 | "password": "LAVA", 93 | "port": 443, 94 | "identifier": "lavalink 5", 95 | "secure": true 96 | 97 | ``` 98 | -------------------------------------------------------------------------------- /application.yml: -------------------------------------------------------------------------------- 1 | server: # REST and WS server 2 | port: 2333 3 | address: 0.0.0.0 4 | lavalink: 5 | server: 6 | password: "coders" 7 | sources: 8 | youtube: true 9 | bandcamp: true 10 | soundcloud: true 11 | twitch: true 12 | vimeo: true 13 | mixer: true 14 | http: true 15 | local: false 16 | bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses 17 | frameBufferDurationMs: 5000 # How many milliseconds of audio to keep buffered 18 | youtubePlaylistLoadLimit: 6 # Number of pages at 100 each 19 | playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds 20 | youtubeSearchEnabled: true 21 | soundcloudSearchEnabled: true 22 | gc-warnings: true 23 | #ratelimit: 24 | #ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks 25 | #excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink 26 | #strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch 27 | #searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing 28 | #retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times 29 | 30 | metrics: 31 | prometheus: 32 | enabled: false 33 | endpoint: /metrics 34 | 35 | sentry: 36 | dsn: "" 37 | environment: "" 38 | # tags: 39 | # some_key: some_value 40 | # another_key: another_value 41 | 42 | logging: 43 | file: 44 | max-history: 30 45 | max-size: 1GB 46 | path: ./logs/ 47 | 48 | level: 49 | root: INFO 50 | lavalink: INFO 51 | -------------------------------------------------------------------------------- /replit.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | deps = [ 3 | pkgs.fetchutils 4 | pkgs.jdk 5 | pkgs.bashInteractive 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | 2 | curl "https://ci.fredboat.com/repository/download/Lavalink_Build/.lastSuccessful/Lavalink.jar?guest=1&branch=refs/heads/dev" -o Lavalink.jar 3 | echo Lavalink.jar is downloaded... 4 | 5 | java -jar Lavalink.jar 6 | --------------------------------------------------------------------------------