2
0
Fork
You've already forked Altbot
0

User id hashes for privacy #39

Merged
micr0-dev merged 4 commits from fix/userIDHashes into main 2025年01月21日 21:31:26 +01:00
micr0-dev commented 2025年01月21日 21:17:34 +01:00 (Migrated from github.com)
Copy link

This pull request includes several changes to improve the metrics management system and update the alt text reminder functionality. The most important changes include adding user ID hashing, modifying the metrics manager to handle existing data, and updating the alt text check queue to use a different identifier.

Metrics Management Improvements:

  • metrics.go: Added SHA-256 hashing for user IDs to enhance privacy. This includes a new hashUserID function and modifications to the MetricEvent struct to store hashed user IDs. [1] [2] [3]
  • metrics.go: Implemented the loadAndHashExistingData function to load existing data and ensure all user IDs are hashed. This function is called during the initialization of the MetricsManager.
  • metrics.go: Modified the saveToFile method to include an optional locking mechanism to ensure thread safety.
  • metrics.go: Moved the run method to the end of the file and reintroduced it with necessary changes to call saveToFile with locking.

Alt Text Reminder Update:

  • main.go: Changed the queuePostForAltTextCheck function to use replyPost.Account.ID instead of replyPost.Account.Acct for queuing alt text checks.
This pull request includes several changes to improve the metrics management system and update the alt text reminder functionality. The most important changes include adding user ID hashing, modifying the metrics manager to handle existing data, and updating the alt text check queue to use a different identifier. ### Metrics Management Improvements: * [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L14-R16): Added SHA-256 hashing for user IDs to enhance privacy. This includes a new `hashUserID` function and modifications to the `MetricEvent` struct to store hashed user IDs. [[1]](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L14-R16) [[2]](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877R32-R38) [[3]](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L70-R110) * [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877R50-R98): Implemented the `loadAndHashExistingData` function to load existing data and ensure all user IDs are hashed. This function is called during the initialization of the `MetricsManager`. * [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L136-L154): Modified the `saveToFile` method to include an optional locking mechanism to ensure thread safety. * [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877R232-R245): Moved the `run` method to the end of the file and reintroduced it with necessary changes to call `saveToFile` with locking. ### Alt Text Reminder Update: * [`main.go`](diffhunk://#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261L767-R766): Changed the `queuePostForAltTextCheck` function to use `replyPost.Account.ID` instead of `replyPost.Account.Acct` for queuing alt text checks.
micr0-dev commented 2025年01月21日 21:31:09 +01:00 (Migrated from github.com)
Copy link

fuck it

fuck it
micr0-dev commented 2025年01月21日 21:31:15 +01:00 (Migrated from github.com)
Copy link

fixes #38

fixes #38
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Schoeneh/Altbot!39
Reference in a new issue
Schoeneh/Altbot
No description provided.
Delete branch "fix/userIDHashes"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?