ftde0 / yt2009

2009 youtube frontend.
Apache License 2.0
193 stars 119 forks source link

How to use auth.html #120

Closed CubeFun closed 3 months ago

CubeFun commented 3 months ago

Hi, im trying to make a private instance for yt2009 and i saw that in the files there is an auth.html file. I wanna know how to impliment it - https://orzeszek.website:5316/ this instance uses it. What im trying to achieve is basically a system where i will create a key that if entered would take you to the website.

ftde0 commented 3 months ago

you need to set your env to prod and add tokens

in case of docker, you're looking at setting YT2009_ENV to prod and setting comma-separated YT2009_TOKENS, for example token1,token2,token3 etc.

in case of a non-docker setup, you can set those in your config.json: env to prod and tokens as an array: ["token1", "token2", "token3"] etc.

within the linked files you can also find variables:

you might also look into enabling gdata_auth so the keys are also enforced on the gdata api, which is used by things like mobile apps.

CubeFun commented 3 months ago

you need to set your env to prod and add tokens

in case of docker, you're looking at setting YT2009_ENV to prod and setting comma-separated YT2009_TOKENS, for example token1,token2,token3 etc.

in case of a non-docker setup, you can set those in your config.json: env to prod and tokens as an array: ["token1", "token2", "token3"] etc.

within the linked files you can also find variables:

  • logged_tokens that will log web page requests made by those to /back/accessdata, along with their IP and timestamp
  • templocked_tokens - tokens that will be redirected to /t.htm on pages that require authorization (such as watchpages)

you might also look into enabling gdata_auth so the keys are also enforced on the gdata api, which is used by things like mobile apps.

Thanks! By the way i have another question, is there a way to refresh the instance without turning it off. What i mean is if i add another token to the file while the website is running it wont update until you turn it off and on.

ftde0 commented 3 months ago

i've never thought about something like this being needed so it's not a thing, sorry

CubeFun commented 3 months ago

i've never thought about something like this being needed so it's not a thing, sorry

Ok