{"id":27372699,"url":"https://github.com/x011/root-zone-database","last_synced_at":"2025-10-24T13:12:03.105Z","repository":{"id":282747911,"uuid":"949524545","full_name":"x011/Root-Zone-Database","owner":"x011","description":"This project automatically retrieves and parses the IANA Root Zone Database webpage and updates a JSON file in the repository with the current top-level domain (TLD) data. The JSON file maps each TLD (with its leading dot) to its associated type and TLD manager information.","archived":false,"fork":false,"pushed_at":"2025-04-13T02:39:52.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T10:14:57.836Z","etag":null,"topics":["domains","root-domain","tld"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x011.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-16T16:48:18.000Z","updated_at":"2025-04-13T02:39:56.000Z","dependencies_parsed_at":"2025-03-16T18:50:38.973Z","dependency_job_id":"bd001acf-ad8a-47b6-b2ab-48863c7ee5b0","html_url":"https://github.com/x011/Root-Zone-Database","commit_stats":null,"previous_names":["x011/root-zone-database"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x011%2FRoot-Zone-Database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x011%2FRoot-Zone-Database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x011%2FRoot-Zone-Database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x011%2FRoot-Zone-Database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x011","download_url":"https://codeload.github.com/x011/Root-Zone-Database/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695479,"owners_count":21146956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["domains","root-domain","tld"],"created_at":"2025-04-13T10:15:02.809Z","updated_at":"2025-10-24T13:12:03.020Z","avatar_url":"https://github.com/x011.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Root Zone Database Updater\n\nThis project automatically retrieves and parses the IANA Root Zone Database webpage and updates a JSON file in the repository with the current top-level domain (TLD) data. The JSON file maps each TLD (with its leading dot) to its associated type and TLD manager information.\n\n## Features\n\n- **Automated Updates:**  \n  Uses a Python script to fetch the [IANA Root Zone Database](https://www.iana.org/domains/root/db) page and extract the TLD information.\n  \n- **JSON Output:**  \n  The extracted data is stored in a JSON file (`tld_data.json`) with the following structure:\n  \n  ```json\n  {\n      \".aaa\": {\n          \"tld type\": \"generic\",\n          \"tld manager\": \"American Automobile Association, Inc.\"\n      },\n      \".aarp\": {\n          \"tld type\": \"generic\",\n          \"tld manager\": \"AARP\"\n      }\n      // More entries...\n  }\n\n\n- **GitHub Actions Integration:**  \n  The project includes a GitHub Actions workflow that:\n  - Runs on every push to the `main` (or `master`) branch.\n  - Is scheduled to run every day at midnight.\n\n## File Structure\n\n```\n.\n├── .github\n│   └── workflows\n│       └── update_content.yml   # GitHub Actions workflow file\n├── scripts\n│   └── update_content.py        # Python script to fetch, parse, and update the JSON file\n├── requirements.txt             # Python dependencies\n├── tld_data.json                # Output JSON file with TLD information (auto-generated)\n└── README.md                    # This file\n```\n\n## Setup and Installation\n\n1. **Clone the Repository:**\n\n   ```bash\n   git clone https://github.com/yourusername/Root-Zone-Database.git\n   cd Root-Zone-Database\n   ```\n\n2. **Install Dependencies:**\n\n   The project requires Python (3.x) along with the `requests` and `beautifulsoup4` libraries. You can install them using pip:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n   If you don't have a `requirements.txt` yet, create one with the following content:\n\n   ```\n   requests\n   beautifulsoup4\n   ```\n\n## Running the Script Locally\n\nYou can test the script locally by running:\n\n```bash\npython scripts/update_content.py\n```\n\nThis command fetches the latest TLD data from IANA, processes the webpage, and updates the `tld_data.json` file in the repository.\n\n## GitHub Actions Workflow\n\nThe project includes a GitHub Actions workflow defined in `.github/workflows/update_tld.yml`. This workflow:\n\n- **Triggers on:**\n  - Every push to the repository's default branch.\n  - A scheduled cron job (e.g., every hour).\n  \n- **Steps:**\n  1. **Checkout Repository:** Retrieves the latest code.\n  2. **Set Up Python:** Installs the desired Python version.\n  3. **Install Dependencies:** Installs required libraries using `requirements.txt`.\n  4. **Run Update Script:** Executes `scripts/update_content.py` to update the TLD data.\n\n### Example Workflow Snippet\n\n```yaml\nname: Update Root Zone Database\n\non:\n  schedule:\n    - cron: '0 0 * * *'  # Runs once a day; adjust as needed\n  workflow_dispatch:     # Allows manual triggering\n\njobs:\n  update-content:\n    runs-on: ubuntu-latest\n\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v3\n\n    - name: Set up Python\n      uses: actions/setup-python@v4\n      with:\n        python-version: '3.x'\n\n    - name: Install dependencies\n      run: |\n        python -m pip install --upgrade pip\n        pip install requests beautifulsoup4\n\n    - name: Run Root Zone Database update script\n      run: python scripts/update_content.py\n\n    - name: Commit and push changes\n      run: |\n        git config --local user.email \"github-actions[bot]@users.noreply.github.com\"\n        git config --local user.name \"github-actions[bot]\"\n        git add .\n        git diff --cached --quiet || (git commit -m \"Update content via GitHub Action\" \u0026\u0026 git push)\n\n```\n\n## Authentication Note\n\n- **Personal Access Token (PAT):**  \n  When pushing changes that include workflow files, GitHub requires that your PAT includes the `workflow` scope. If you encounter authentication issues, please generate a new PAT with the appropriate scopes and update your Git credentials.\n\n- **SSH Alternative:**  \n  Alternatively, you can set up SSH authentication to avoid HTTPS PAT issues.\n\n## Troubleshooting\n\n- **Workflow Failures:**  \n  Check the **Actions** tab in your GitHub repository for detailed logs.\n- **Authentication Issues:**  \n  Ensure your PAT has the required scopes or consider switching to SSH.\n\n## License\n\nThis project is licensed under the (GNU General Public License v3 (GPLv3))[https://www.gnu.org/licenses/gpl-3.0.en.html].\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx011%2Froot-zone-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx011%2Froot-zone-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx011%2Froot-zone-database/lists"}