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

feat: online services #1166

Merged
merged 11 commits into from
Nov 2, 2024
Merged

feat: online services #1166

merged 11 commits into from
Nov 2, 2024

Conversation

GeopJr
Copy link
Owner

@GeopJr GeopJr commented Oct 18, 2024

Online Services at https://api.tuba.geopjr.dev/

Okay let's get over the controversial part first,

Analytics

Opt-in & anonymized preference analytics used for research purposes only. Aka, send me your preferences so I know what should be removed or what should be default.

Tuba will send them bi-weekly to https://api.tuba.geopjr.dev/. The server's source code is also added to this repo in this PR.

The analytics object will look like the following (pre-viewable in Tuba's settings):

{
  "accounts" : [
    "8db74bcf-3ba2-486a-b09b-bd9fd5c175f1",
    "dd5e7d52-7830-4cd8-a154-3a271a7ca1ba",
    "c664f69f-06fd-4aca-8381-ef27b28ebc45",
    "17d6cc52-3ea4-4f5e-95cc-79821655e34c",
    "9e34d77e-6344-4b4e-86c7-bb49b6211121",
    "0c604c54-15a9-43eb-b4e3-11d986ee33d3"
  ],
  "analytics" : {
    "color-scheme" : "TUBA_COLOR_SCHEME_SYSTEM",
    "timeline-page-size" : "20",
    "live-updates" : "TRUE",
    "public-live-updates" : "FALSE",
    "show-spoilers" : "FALSE",
    "show-preview-cards" : "TRUE",
    "larger-font-size" : "FALSE",
    "larger-line-height" : "FALSE",
    "aggressive-resolving" : "FALSE",
    "strip-tracking" : "TRUE",
    "scale-emoji-hover" : "FALSE",
    "letterbox-media" : "FALSE",
    "media-viewer-expand-pictures" : "TRUE",
    "enlarge-custom-emojis" : "FALSE",
    "use-blurhash" : "TRUE",
    "group-push-notifications" : "FALSE",
    "advanced-boost-dialog" : "TRUE",
    "reply-to-old-post-reminder" : "TRUE",
    "spellchecker-enabled" : "TRUE",
    "darken-images-on-dark-mode" : "FALSE",
    "media-viewer-last-used-volume" : "1.000000",
    "monitor-network" : "TRUE",
    "dim-trivial-notifications" : "FALSE",
    "analytics" : "TRUE",
    "update-contributors" : "TRUE"
  }
}

Sensitive settings like proxy are not included. The accounts array are the Tuba internal UUIDs for the accounts - THEY ARE NOT ASSOCIATED WITH OR DERIVED BY THE ACTUAL ACCOUNTS. They are included so the server knows what database entries to replace. I'm only interested in the data at the moment, not historical preference changes.

Contributors

The server has the ability to gather all github profiles from sponsors and contributors, extract fedi profiles from the profile data (yes, not only mastodon), hash them and serve them. You can see it live at https://api.tuba.geopjr.dev/v1/supporters

Since they are to be consumed by Tuba, the hashing algorithm is the same as g_str_hash. They are prone to collisions and are unsalted, but they fit their purpose which is to be consumed by Tuba.

Every Tuba release will come with at the time's supporter hashes bundled in. Users can choose to enable (aka OPT-IN) bi-weekly updates to that endpoint.

Supporters will get something fancy on their profiles as a thank you, not sure what yet, maybe a badge, maybe a discord-like decoration 🤷 for now it makes their profile yellow as a placeholder.

@GeopJr
Copy link
Owner Author

GeopJr commented Oct 18, 2024

(I also need people to test this)

@LukaszH77
Copy link
Contributor

(I also need people to test this)

On it!

Zrzut ekranu z 2024-10-18 08-07-33

@GeopJr
Copy link
Owner Author

GeopJr commented Oct 18, 2024

Thank you :)

Here's what was saved, let me know if something is wrong:

{
  "color-scheme": "TUBA_COLOR_SCHEME_SYSTEM",
  "timeline-page-size": "10",
  "live-updates": "TRUE",
  "public-live-updates": "FALSE",
  "show-spoilers": "FALSE",
  "show-preview-cards": "TRUE",
  "larger-font-size": "FALSE",
  "larger-line-height": "TRUE",
  "aggressive-resolving": "FALSE",
  "strip-tracking": "TRUE",
  "scale-emoji-hover": "TRUE",
  "letterbox-media": "TRUE",
  "media-viewer-expand-pictures": "FALSE",
  "enlarge-custom-emojis": "TRUE",
  "use-blurhash": "TRUE",
  "group-push-notifications": "TRUE",
  "advanced-boost-dialog": "TRUE",
  "reply-to-old-post-reminder": "TRUE",
  "spellchecker-enabled": "TRUE",
  "darken-images-on-dark-mode": "TRUE",
  "media-viewer-last-used-volume": "0,300003",
  "monitor-network": "TRUE",
  "dim-trivial-notifications": "TRUE",
  "analytics": "TRUE",
  "update-contributors": "TRUE"
}

edit: (also you are a contributor, so you should also be able to see the different style on your profile)

@LukaszH77
Copy link
Contributor

I think it looks right for the settings I was able to recognize. What is "aggresive-resolving"?

Once the contributors gsetting change (manually or via the bi-weekly updates), it's over for the bundled hashes. Next update won't just overwrite them. So now, if someone enabled bi-weeklies once, updated their gsetting and disabled them, Tuba will attempt to reset them to the bundled ones.
@GeopJr
Copy link
Owner Author

GeopJr commented Oct 18, 2024

What is "aggresive-resolving"

Leftover from Tootle, the default is false. When you click a link on a post, Tuba checks if there's an @ or /user/ in the URL and if there is, it will attempt to make your instance resolve it (so it opens a fedi link directly instead of opening it in your browser). With aggressive resolving on, it skips the @ and /user/ check and just asks your instance to resolve it right away.

It's somewhat of a privacy hole if you don't trust your instance, because if you click e.g. https://tuba.geopjr.dev/, it will be sent to your instance and your instance admins could keep logs and see what links you click etc.

@GeopJr GeopJr marked this pull request as ready for review November 2, 2024 19:24
@GeopJr GeopJr merged commit 2e6d66c into main Nov 2, 2024
5 checks passed
@GeopJr GeopJr deleted the feat/online-services branch November 2, 2024 19:33
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

Successfully merging this pull request may close these issues.

2 participants