Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequence of file link Robot Generate is just numbers #4

Open
AhyaH-YHWH opened this issue Nov 17, 2020 · 10 comments
Open

Sequence of file link Robot Generate is just numbers #4

AhyaH-YHWH opened this issue Nov 17, 2020 · 10 comments

Comments

@AhyaH-YHWH
Copy link

Please generate a random word ( 10 or 15 Characters For Example)
after each message robot receive
and send it to linked channel of Robot, after message itself
say "ra2nd1o5mw3ord"

so the link the bot generate will be ( id number of message in Linked channel of Bot)

https://t.me/FilesBot?start=ra2nd1o5mw3ord_id
https://t.me/FilesBot?start=ra2nd1o5mw3ord_10
instead of

https://t.me/FilesBot?start=view_10_tg
for 10th message in the Linked Channel of Robot

so that random users can't find bot files
Thanks

@AhyaH-YHWH
Copy link
Author

If I have bot username, I will generate all links like
https://t.me/FilesBot?start=view_12_tg
https://t.me/FilesBot?start=view_109_tg

and see the files users forwarded to bot

but this way, Random users can only access Files, if they have exact word in link

@code-rgb
Copy link

@SpEcHiDe time to use uuid :-)

@skrtdev
Copy link
Collaborator

skrtdev commented Dec 27, 2020

Uhm, it makes sense

@SpEcHiDe
Copy link
Owner

I think, need a database if this needs to be implemented.

@skrtdev
Copy link
Collaborator

skrtdev commented Dec 27, 2020

I think, need a database if this needs to be implemented.

No, it’s not needed, you can use some algorithms

@skrtdev
Copy link
Collaborator

skrtdev commented Dec 27, 2020

Wait, it’s not possibile with an algorithm without using a db. Sorry I was wrong.

I’m thinking about it, let’s see if I find something

@SpEcHiDe
Copy link
Owner

it is not impossible, ideally you can use any algorithm which supports 2 way hashing (and returns a hash less than 64 characters), but I think not using a DB is over-engineering the problem..😅

@skrtdev
Copy link
Collaborator

skrtdev commented Dec 27, 2020

Yeah but:

  1. 2 way hashing is useless: everyone can access any file
  2. In order to use DB on heroku you have to use Heroku’s own DB, and this prevent the bot to be hosted in other places

Also, if we’ll use a 2 way hashing, I’d like to use my own base26 encoding, that encodes every int in a string composed by only a-z lowercase letters

@SpEcHiDe
Copy link
Owner

  1. I think we can override DATABASE_URL but I am not sure about it.

@RomanGoddess RomanGoddess mentioned this issue Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@SpEcHiDe @code-rgb @skrtdev @AhyaH-YHWH and others