https://github.com/GOATS2K/overpass Skip to content Sign up * Why GitHub? + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} GOATS2K / overpass Public * Notifications * Fork 0 * Star 3 * A self-hosted streaming platform with Discord authentication, auto-recording and more! MIT License 3 stars 0 forks Star Notifications * Code * Issues 13 * Pull requests 0 * Actions * Projects 2 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show Loading {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default Loading View all tags 3 branches 8 tags Code Loading Latest commit @GOATS2K GOATS2K fix(readme): add relative link to example docker-compose file ... 6a7aadf Dec 15, 2021 fix(readme): add relative link to example docker-compose file 6a7aadf Git stats * 111 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time docker fix(dockerfile): run init-db only when no database exists Dec 2, 2021 overpass fix(init-db): add switch to ensure that dockerfile can run migration Dec 2, 2021 .gitignore fix(docker): create startup file to start nginx Dec 2, 2021 Dockerfile fix(dockerfile): run init-db only when no database exists Dec 2, 2021 LICENSE feat(license): MIT License Jan 19, 2021 README.md fix(readme): add relative link to example docker-compose file Dec 15, 2021 app.py feat(config): now we're actually using configs for once - added env c... Jan 19, 2021 config.py fix(config): do not override environment variables if .env file doesn... Dec 2, 2021 docker-compose.example feat(readme): cleanup + docker instructions Dec 15, 2021 poetry.lock chore: update gitignore and lockfile Dec 2, 2021 pyproject.toml feat(pyproject): bump to 0.2.5 Dec 2, 2021 View code [ ] Overpass Dependencies Getting Started Creating the Discord app for Overpass Install Docker Usage Creating a config file Generate a secret key Example config Streaming server setup Running the application Development mode Deploying to production NGINX setup Screenshots README.md Overpass Overpass makes it easy to host your own live streaming server with features such as authentication via Discord, stream playback in your web browser, and an easy way to archive your streams for your users to rewatch! Overpass also lets you run a private instance for a users on a single Discord server. Simply add the server ID of your Discord server to the configuration file and Overpass will take care of the rest. Powered by nginx-rtmp. Dependencies * Python 3.8+ * Nginx with the nginx-rtmp module installed * FFmpeg * A Discord app Getting Started Creating the Discord app for Overpass Navigate to Discord's Developer Portal. * Select "New Application" in the top left corner * Choose a name for your application * Select the "OAuth2" tab * Find the "Client Information" section of the page, and copy your "Client ID" and your "Client Secret" and save these for use in the configuration file * Click "Add redirect" and type in a URI like so: https://overpass.dev/auth/callback - replacing overpass.dev with your domain name. Note: If you wish to develop on Overpass, you will have to add http:/ /localhost:5000/auth/callback to your list of redirect URIs. Install Docker Usage There is a Docker image for Overpass, which you can either build yourself with the Dockerfile, or download from the Docker Hub. This image is pre-configured to run Overpass in production mode with Gunicorn, so if you wish to develop on Overpass, you may need to change docker/startup.sh to execute flask run, and modifying the route to Overpass' API in the nginx configuration. Continue reading if you wish to run Overpass on bare-metal, otherwise, you can use the example Docker Compose file. Creating a config file Note: If you are using Docker, set these values as environment variables. See the example Docker Compose file. You will not have to create the .env file. Generate a secret key Run python -c "import os; print(os.urandom(16))" and copy the output after the byte symbol into OVERPASS_SECRET_KEY Create an empty .env file, in the projects' root directory which contains the following: DISCORD_CLIENT_ID = DISCORD_CLIENT_SECRET = "" DISCORD_REDIRECT_URI = "" DISCORD_GUILD_ID = (if you want to restrict access to the tool to users from a certain guild ID - set one here) OVERPASS_SECRET_KEY = "your generated key here" HLS_PATH = "" REC_PATH = "" RTMP_SERVER = (IP address and port of your RTMP server - as a string) Example config DISCORD_CLIENT_ID = 31040105101013151 DISCORD_CLIENT_SECRET = "1251XXXXXXXXXXXXXXXXXXXXX" DISCORD_REDIRECT_URI = "https://overpass.dev/auth/callback" DISCORD_GUILD_ID = 05105010105619519 OVERPASS_SECRET_KEY = "#\x1an\x1an\x1an\x1an\x1an" HLS_PATH = "/storage/overpass/hls" REC_PATH = "/storage/overpass/archive" RTMP_SERVER = "overpass.dev:1935/live" Streaming server setup * Create the directories you defined in HLS_PATH and REC_PATH and make sure to give www-data write permissions to said folder. Make sure the user the Overpass is running as also has read and write access to the same folders. Remember to change the on_publish and on_done URIs, record_path and hls_path variables to match your environment Edit your nginx.conf file to contain the following information. rtmp { server { listen 1935; on_publish http://127.0.0.1:5000/api/rtmp/connect; on_done http://127.0.0.1:5000/api/rtmp/done; application live { deny play all; live on; record all; record_path /storage/overpass/archive; record_append on; hls on; hls_path /storage/overpass/hls; hls_fragment 2; hls_playlist_length 10; exec_record_done bash -c "/usr/bin/ffmpeg -i $path -acodec copy -vcodec copy -movflags +faststart /your/recording/path/$basename.mp4 && rm $path"; } } } Running the application * Run flask init-db to initialize the database. Development mode * Run flask run Deploying to production In the same folder as Overpass, while in a virtual environment, run the following command: gunicorn -w 10 app:app --timeout 600 --log-level=debug --access-logformat "%({X-Real-IP}i)s %(l)s %(t)s %(b)s '%(f)s' '%(a) s'" --access-logfile '-' NGINX setup location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; } Screenshots Homepage Web Player Archive Profile Page About A self-hosted streaming platform with Discord authentication, auto-recording and more! Topics flask streaming discord self-hosted video-streaming nginx-rtmp Resources Readme License MIT License Stars 3 stars Watchers 1 watching Forks 0 forks Releases 8 Docker update! Latest Dec 15, 2021 + 7 releases Packages 0 No packages published Languages * Python 72.5% * HTML 26.4% * Other 1.1% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.