algora-io / tv

Open source Twitch for developers
https://algora.tv
Other
1.08k stars 69 forks source link

chore: add stream key support #41

Closed ssddOnTop closed 2 months ago

ssddOnTop commented 6 months ago

I'd like to set a password (aka stream key), to avoid access to bad actors.

Suggestion:

  1. allow us to set a custom password
  2. autogenerate password and add a button to generate a new password
zcesur commented 3 months ago

Thanks for the suggestion!

Let's split up Stream URL into RTMP URL + Stream key and add reset & copy buttons

RTMP URL without a path is likely invalid so we probably also need to append an arbitrary path like /live (so the RTMP URL becomes rtmp://tv.algora.io:9006/live)

Let's also make sure the change is backward compatible such that someone without a stream key inputted into OBS can continue streaming. That'll involve updating the Algora.Pipeline.MessageValidator.validate_connect logic

To reset the key we can use the existing Algora.Accounts.gen_stream_key function

/bounty $75

algora-pbc[bot] commented 3 months ago

## 💎 $75 bounty â€ĸ Algora

### Steps to solve: 1. Start working: Comment /attempt #41 with your implementation plan 2. Submit work: Create a pull request including /claim #41 in the PR body to claim the bounty 3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

### ❗ Important guidelines: - To claim a bounty, you need to provide a short demo video of your changes in your pull request - If anything is unclear, ask for clarification before starting as this will help avoid potential rework - For assistance or questions, join our Discord

Thank you for contributing to algora-io/tv!

Add a bounty â€ĸ Share on socials

Attempt Started (GMT+0) Solution
đŸŸĸ @onyedikachi-david Aug 16, 2024, 2:55:29 PM WIP
đŸŸĸ @lastcanal Sep 17, 2024, 3:51:09 PM #98
onyedikachi-david commented 3 months ago

/attempt #41

Algora profile Completed bounties Tech Active attempts Options
@onyedikachi-david 5 bounties from 2 projects
JavaScript, Shell
īšŸ61
Cancel attempt
lastcanal commented 2 months ago

It looks like the Connect validator message has the app parameter with the url based stream key, while the ReleaseStream message has the real stream_key parameter. In order to support both we will need to coordinate stream key acceptance in the Pipeline. This will prevent double initializing forwarded RTMP connections, etc. and allow the graceful shutdown of the Pipeline on invalid stream keys.

My plan is to move all the setup logic from the Validator into the Pipeline and GenServer call into the pipeline from the validator on both the Connect and ReleaseStream message. I am hoping to delay calling Library.init_livestream! until after the stream is validated, preventing any DB writes before authentication. Also, in order to implement #73 we will need to connect a user to the pipeline before a new video is created or any HLS outputs are connected. This can be accomplished by switching to Tee.Parallel and delaying the creation of the HLS child until the stream is validated, all while removing the need to pass video_id to the validator.

/attempt #41

Algora profile Completed bounties Tech Active attempts Options
@lastcanal 1 algora bounty
Elixir, C++,
JavaScript & more
Cancel attempt
zcesur commented 2 months ago

Sounds great, LFG!

algora-pbc[bot] commented 2 months ago

💡 @lastcanal submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 2 months ago

🎉🎈 @lastcanal has been awarded $100! 🎈🎊