-
Notifications
You must be signed in to change notification settings - Fork 25
feat(docs): Add visit tracking #280
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
Draft
muscariello
wants to merge
5
commits into
main
Choose a base branch
from
279-docs-collect-stats-about-docsagntcyorg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+957
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add secure visit tracker using GitHub Issues API - Implement GitHub Actions workflows for processing visits - Add CLI test scripts for validation (test-tracking-*.sh) - Add browser automation test (test-tracking.js) - Update Taskfile with 'task test:tracking' command - Include visit tracker script in MkDocs configuration The tracking system: - Collects page visit data in localStorage - Submits via GitHub Issues (no tokens exposed) - Processes with GitHub Actions - Respects privacy (Do Not Track, localhost disabled) - Includes comprehensive testing suite Signed-off-by: Luca Muscariello <[email protected]>
2 tasks
Only keep process-visits-secure.yml which uses GitHub secrets for secure gist access. Signed-off-by: Luca Muscariello <[email protected]>
ramizpolic
reviewed
Oct 13, 2025
Test scripts moved to local-only usage: - Removed test-tracking-simple.sh - Removed test-tracking-flow.sh - Removed test-tracking.js - Removed test:tracking tasks from Taskfile - Reverted .gitignore changes These scripts remain available locally for manual testing. Signed-off-by: Luca Muscariello <[email protected]>
Add secure validation layer to prevent malicious data submission: - New validation script (validate_visit_data.py): * Size limits: 1MB max issue, 100 visits per issue * Field whitelisting and type validation * Path traversal prevention (no .. or ~) * Safe character sets for all fields * ISO timestamp validation * Domain validation for referrers - Updated workflow (process-visits-secure.yml): * Validates all data before processing * Auto-closes invalid issues with explanation * Only processes data after validation success * Proper error handling and logging Security protections: - Prevents code injection attacks - Blocks path traversal attempts - Mitigates XSS via character whitelisting - DoS protection via size limits - No shell command execution of user data Signed-off-by: Luca Muscariello <[email protected]>
Member
Author
|
Check this flow @ramizpolic |
Remove test:tracking tasks from Taskfile.yml: - test:tracking - test:tracking:setup - test:tracking:flow Revert .gitignore changes: - Remove node_modules entry - Remove package-lock.json entry These were part of the test scripts that have been moved to local-only usage. Signed-off-by: Luca Muscariello <[email protected]>
Member
Author
|
We keep this on hold as a user must be authenticated in github to post. This is not always true and when true it does not work for privacy issues. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a privacy-first visit tracking system for docs.agntcy.org.
Changes
Core Implementation
docs/javascripts/visit-tracker-secure.js): Secure client-side tracking using GitHub Issues APIprocess-visits-secure.yml): Secure workflow for processing visit data using GitHub secretsprocess_visits.py): Python script to process and store visit data in gistConfiguration
mkdocs.ymlto include tracking scriptFeatures
✅ Privacy First
✅ Secure Architecture
✅ Developer Friendly
.github/How It Works
Security
Related Issue
Closes #279