Users must now set the AOC_USER_AGENT environment variable to download puzzle inputs.
Before (v0.2.0):
export AOC_SESSION="your_session_cookie"
cargo run --bin aoc download 2024 1Now (v0.3.0):
export AOC_SESSION="your_session_cookie"
export AOC_USER_AGENT="github.com/yourname/your-repo (your@email.com)"
cargo run --bin aoc download 2024 1The previous version used a hardcoded User-Agent that referenced the template author's GitHub repository. This caused:
- Attribution issues: All users' requests appeared to come from the same source
- Rate limiting concerns: Shared User-Agent could lead to collective rate limits
- Poor etiquette: Not following best practices for automated web requests
Add this to your shell profile (.bashrc, .zshrc, etc.):
export AOC_USER_AGENT="github.com/yourname/your-repo (your@email.com)"Or set it temporarily in your current session:
export AOC_USER_AGENT="github.com/yourname/your-repo (your@email.com)"If you forget to set AOC_USER_AGENT, you will see:
Error: AOC_USER_AGENT environment variable not set.
Please set it to identify yourself, e.g.:
export AOC_USER_AGENT="github.com/yourname/your-repo (contact@email.com)"
This helps website admins contact you if there are issues with your requests.
aoc-lib/src/utils/input.rs- Now requiresAOC_USER_AGENTenvironment variableREADME.md- Updated documentation for both required environment variables.gitignore- Updated comment to mention both env vars
- Pull the latest changes
- Set the
AOC_USER_AGENTenvironment variable - Continue using the template as before
This is a MINOR version bump (0.2.0 to 0.3.0) rather than a PATCH because:
- It introduces a breaking change (new required environment variable)
- Existing users must take action to continue using the download feature
- The API contract has changed
This change is about proper attribution and internet etiquette, not security. User-Agent headers are public information and do not expose credentials.
As noted by the Advent of Code creator in this Reddit post, automated tools should identify themselves properly to help with debugging and prevent issues.
Why we're doing this:
- Proper attribution - Your requests should identify you, not the template author
- Internet etiquette - Following community guidelines for automated requests
- Avoiding shared rate limits - If many users share one User-Agent, they share rate limits
For more information about being a good citizen when making automated requests to Advent of Code: