OnionSproutsBot merge requestshttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests2023-07-09T20:31:12Zhttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/31Expire cache entries after 10minutes2023-07-09T20:31:12Zmeskiomeskio@torproject.orgExpire cache entries after 10minutesAnd make the cache path configurable.
Closes: #53And make the cache path configurable.
Closes: #53meskiomeskio@torproject.orgmeskiomeskio@torproject.orghttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/30typo2023-04-22T10:38:26Zemmapeeltyporeported by translator Xceeder, thanks!
https://www.dictionary.com/e/discreet-vs-discrete/reported by translator Xceeder, thanks!
https://www.dictionary.com/e/discreet-vs-discrete/https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/29Refactoring chat functions into smart plugins2023-04-22T12:22:05ZirlRefactoring chat functions into smart pluginsThe various chat callback functions have been refactored into
three smart plugin modules: welcome, dialogue and tor_browser.
Additionally, there are no longer global variables for the
SQLite3 connection and cursor. There are no more lon...The various chat callback functions have been refactored into
three smart plugin modules: welcome, dialogue and tor_browser.
Additionally, there are no longer global variables for the
SQLite3 connection and cursor. There are no more long-lived
cursor objects and the connection object is stored in a
singleton Database class.
The configuration data has also been moved to its own module
to avoid circular imports.irlirlhttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/28Use logging instead of aiologger2022-12-22T10:02:08Zmeskiomeskio@torproject.orgUse logging instead of aiologgerRollback to f4501d0a45d741c7298aaffc5c598a9cf7f282e6 because aiologger
is giving problems communicating with journald:
https://github.com/async-worker/aiologger/issues/3.7
Closes: #47Rollback to f4501d0a45d741c7298aaffc5c598a9cf7f282e6 because aiologger
is giving problems communicating with journald:
https://github.com/async-worker/aiologger/issues/3.7
Closes: #47meskiomeskio@torproject.orgmeskiomeskio@torproject.orghttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/27Refactor dialogue.py2022-12-21T11:50:21Zn0tooseRefactor dialogue.py- Improve formatting of dialogue.py
- Improve function names in dialogue.py
- Add new FAQ submenu
- Remove all remaining mentions to 'mirrors' from buttons
- Make FAQ prompts sound like questions
- Remove direct mentions of usernames fro...- Improve formatting of dialogue.py
- Improve function names in dialogue.py
- Add new FAQ submenu
- Remove all remaining mentions to 'mirrors' from buttons
- Make FAQ prompts sound like questions
- Remove direct mentions of usernames from translatable strings.
- Split strings in dialogue.py so that any further small changes in the
future will not have as big of an impact on the work of translators.
Some strings that appear in the main menu have also been shortened, as
moving some other UI elements to a different submenu has removed a
certain degree of ambiguity that forced us to use very long strings,
even when the space that is available to us is very limited.
Those changes are based from contributor, user and translator feedback.
This patch is not ready to be merged, as the locale changes have not
been included in the .pot file yet.https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/25improvement: make "Mirrors" word localizable2022-12-03T14:13:59ZWofWcawofwca@protonmail.comimprovement: make "Mirrors" word localizablehttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/24improvement: simplify success messages2022-12-06T01:58:25ZWofWcawofwca@protonmail.comimprovement: simplify success messagesThe `upload_already_done` one was especially redundant and confusing
because it's displayed immediately upon requesting a versionThe `upload_already_done` one was especially redundant and confusing
because it's displayed immediately upon requesting a versionhttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/23Adds IDE files to .gitignore2022-11-16T11:49:30ZirlAdds IDE files to .gitignoreThis pull requests serves two functions:
* making sure I don't accidentally commit my IDE config to the Git repository
* making sure I'm able to push commits to GitLab for this project that can be turned into an MRThis pull requests serves two functions:
* making sure I don't accidentally commit my IDE config to the Git repository
* making sure I'm able to push commits to GitLab for this project that can be turned into an MRirlirlhttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/22Pass variables as parameters to sql2022-11-12T19:10:09Zmeskiomeskio@torproject.orgPass variables as parameters to sqlPrevent sqlinjection.
Thanks to @irl for finding it out.Prevent sqlinjection.
Thanks to @irl for finding it out.meskiomeskio@torproject.orgmeskiomeskio@torproject.orghttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/21Update the global variable on request_tor2022-10-27T16:22:34ZGeopJrUpdate the global variable on request_torFrom my limited understanding of python, setting `response` outside its global declaration will make a new local variable with that name, making the new downloads.json available only in the `request_tor` scope.
This MR marks `response` ...From my limited understanding of python, setting `response` outside its global declaration will make a new local variable with that name, making the new downloads.json available only in the `request_tor` scope.
This MR marks `response` as global.
(To test this, make the `response` in main be the downloads.json of a no-longer-available version (like 10.0.0) and print response["version"] in `download_tor` before and after applying this MR)
Should
fix #45https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/20Handle None language_code returned from Telegram2022-10-27T16:24:58ZGeopJrHandle None language_code returned from TelegramAccording to #45, there's a chance that Telegram will return None as user language_code.
This MR handles that by setting it to "en" if None, else lowercasing it.According to #45, there's a chance that Telegram will return None as user language_code.
This MR handles that by setting it to "en" if None, else lowercasing it.https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/19Help translators do their job better2022-10-26T12:40:25Zn0tooseHelp translators do their job betterAddresses #17.
This MR fixes some maintenance-related problems regarding our source strings and adds a plethora of comments that explain requirements, context and the thinking that went behind the source strings, as well as an overview ...Addresses #17.
This MR fixes some maintenance-related problems regarding our source strings and adds a plethora of comments that explain requirements, context and the thinking that went behind the source strings, as well as an overview as to where the string "fits in". I believed I added an amount of information that was appropriate, on a case-by-case basis.
My goal was to answer as many questions that a translator may have as possible. I used my past experiences as a point of reference. Many comments may seem redundant, but were copied and pasted under the assumption that a translator may not want to look through other "neighboring" translations in order to better understand the greater picture. I believe that such an approach may reduce the amount translations that are half-completed, as I am assuming that multiple different people will work on a specific language throughout the years and will not have a way to communicate with each other when building on top of each others' work.https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/18Add CODE_OF_CONDUCT.md2022-10-27T16:26:33Zn0tooseAdd CODE_OF_CONDUCT.mdLooking for input from members of The Tor Project, Inc., particularly because I am not sure if I've explained the separation between myself, the majority of the AUTHORS and The Tor Project, Inc. well enough.Looking for input from members of The Tor Project, Inc., particularly because I am not sure if I've explained the separation between myself, the majority of the AUTHORS and The Tor Project, Inc. well enough.https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/17Draft: Move dialogue.py to plugins/ folder2023-04-22T12:23:31Zn0tooseDraft: Move dialogue.py to plugins/ folderI basically did literally the exact same thing, it was supposed to work, it never did because Pyrogram threw me an error that it did not load any plugins from the `plugins` folder, and now it just miraculously works.
I'm highly suspicio...I basically did literally the exact same thing, it was supposed to work, it never did because Pyrogram threw me an error that it did not load any plugins from the `plugins` folder, and now it just miraculously works.
I'm highly suspicious of that, and as I intend to make every commit main "ready to be deployed", I am putting the change up for review just to be completely sure that this wasn't just me testing the change on an older version for now.https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/16Abstract dialogue options2022-10-04T11:13:53Zn0tooseAbstract dialogue optionsThis change is part of an ongoing, aggressive effort to clean up the
codebase and add support for sharing Android binaries, so a couple of
changes included here are slightly out-of-scope. Most of them concern
the dialogue options themsel...This change is part of an ongoing, aggressive effort to clean up the
codebase and add support for sharing Android binaries, so a couple of
changes included here are slightly out-of-scope. Most of them concern
the dialogue options themselves.
- Fix type hints for callback queries
- Improve order of imports using isort
- Rename "OnionSproutsBot" Client instance to "Bot" to save columns and
improve clarity
- Apply black's default formatting settings to all source files
- Small string improvements
- Improve comments
- Add type hints
- Fix incorrect type hints
- Fix problem where "Main Menu" button would not pop up when asking for
mirrors.
- Use separate function for error messages
- Error messages now appear only once and are always descriptive
- Use language parameter when possiblehttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/15Fix type hints for callback queries2022-10-03T21:32:30ZzseriFix type hints for callback querieshttps://docs.pyrogram.org/api/types/CallbackQueryhttps://docs.pyrogram.org/api/types/CallbackQueryhttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/14remove code duplication in helpers.py2022-10-04T12:44:35Zzseriremove code duplication in helpers.pyinline the single used 4-line function from helpers.py to bot.py;
all other functions defined in that file were duplicated in ui.py, and unsused.
This commit also fixes a nitpick in ui.py: replace range(len(...)) with enumerate(...)inline the single used 4-line function from helpers.py to bot.py;
all other functions defined in that file were duplicated in ui.py, and unsused.
This commit also fixes a nitpick in ui.py: replace range(len(...)) with enumerate(...)https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/13Switch to using message edits2022-10-04T11:13:52ZStarByteSwitch to using message editsThis cleans up some of the clutter of sending new messages every time the user clicks a button
while also making the UX feel more natural. This has the added benefit of helping with issue #28.
Some messages need to be handled in a specia...This cleans up some of the clutter of sending new messages every time the user clicks a button
while also making the UX feel more natural. This has the added benefit of helping with issue #28.
Some messages need to be handled in a special way if they lack the welcome photo and the user
tries to navigate back to the welcome page (the message is recreated in that case).n0toosen0toosehttps://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/12Draft: Add warning/disclaimer message2023-10-24T11:07:25Zn0tooseDraft: Add warning/disclaimer messageThe goal here is to allow the user to make some sort an informed decision by stating all of the facts *without* scaring them away, unless if we have a reason to. I am seeking for an initial set of feedback regarding the tone, the languag...The goal here is to allow the user to make some sort an informed decision by stating all of the facts *without* scaring them away, unless if we have a reason to. I am seeking for an initial set of feedback regarding the tone, the language and the threat model-related concerns that I am trying to name here. As always, I am acting based on a set of presumptions:
- A person who uses this download method does not have another way to do so.
- Telegram's protocol hasn't been cracked wide open (allowing for the surveillance of all messages exchanged for the platform).
- DPI could be in use.
- The way Telegram is operated is beyond our control and that we should show some reservations.
- If the said user is targeted by every single already has an infected device, then, uh, tough luck.
- Undetectable obfuscation techniques today may be detectable tomorrow.
Additional remarks:
- The text currently ignores the prospect that the user may already be using a traditional VPN service to access Telegram.
This commit has not been tested on a live instance and some things (such as adding the new strings to the `.po` file) will be done later. I believe that this step is slightly sensitive, requires transparency and needs opinions from people that have more experience in this than I do.
TL;DR I need feedback.https://gitlab.torproject.org/tpo/anti-censorship/gettor-project/OnionSproutsBot/-/merge_requests/11Add progress bars when uploading/downloading files2022-09-26T10:32:44ZStarByteAdd progress bars when uploading/downloading filesWhen the bot must download the file from the server and reupload it to
telegram, this can take longer than a few seconds which may have users
wondering what the bot is doing. This patch will help display
information as the bot is downloa...When the bot must download the file from the server and reupload it to
telegram, this can take longer than a few seconds which may have users
wondering what the bot is doing. This patch will help display
information as the bot is downloading and then reuploading the file
to telegram for the user. The message includes time estimates, progress
bars, and percentages to make it as human-friendly as possible during
this process.