techanon / vroxy

Self-hosted YoutubeDL proxy
ISC License
29 stars 10 forks source link

Vroxy

Self-hosted light-weight server proxy for YoutubeDL, originally designed for use in VRChat.

Currently in alpha.

Usage

Access the url via https://mydomain/?url=https://youtube.com/watch?v=VIDEO_ID to receive a 307 redirect to the direct link video url.

Optional parameters

If you specified authorization tokens in your configuration, use one of the following to authorize yourself:

Configuration

Use the following environment variables to configure the server.

Name Purpose Default
VROXY_HOST The host the server should bind to. 0.0.0.0
PORT Port the server should bind to. 8008
VROXY_WHITELIST Path to a whitelist file No whitelist
VROXY_AUTH_TOKENS comma separated list of bearer tokens. Enables authorization. Unauthorized access allowed

Whitelist file

You may provide a whitelist file path via VROXY_WHITELIST. This is a text file where each line is a domain pattern to whitelist. You may specify:

We include an example config which attempts to match the VRChat Video Player Whitelist.

Deployment

Prerequisites:

Debian/Ubuntu Setup:

Pull the repo's install script and run it:

curl -o vroxy_install.sh https://raw.githubusercontent.com/techanon/vroxy/master/vroxy_install_deb.sh\
  && sudo bash ./vroxy_install.sh

After install

Generic Setup:

Docker deployment

In general you can deploy ghcr.io/techanon/vroxy:dev to any platform that supports running docker containers.

VPS

On a bare VPS with Docker and docker-compose installed:

  1. Clone the repo
  2. Copy example.ini to setup.ini and fill in the proper values
  3. docker-compose up -d

Google Cloud Platform: Cloud Run

  1. Push your docker container to Google Cloud Registry or use the official one:
  2. All the default settings should just work. But you might want to take care to look at the following settings:
    • Set maximum replicas to 1
    • Allow all traffic
    • Allow unauthenticated invocations
  3. After a short initialization time, you should have a public service up and running

Development

Docker development

Using make is optional if you already know how to use docker-compose.

To build the docker containers:

make

Run the tests:

make test
make test-e2e

To launch a shell inside the dev container:

make sh

To run the local development server:

docker-compose up