Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

A web form that captures the requirements for a DNS change • This repository is defined and managed in Terraform

License

Notifications You must be signed in to change notification settings

ministryofjustice/operations-engineering-dns-form

Repository files navigation

DNS Form

repo standards badge

This repository contains a Flask web application designed to structure DNS change requests for the Operations Engineering team. The goal of the DNS Form is to automate and streamline the process of handling DNS changes, which were previously submitted via email. By using this application, Operations Engineering can track requests more effectively and introduce automation into the DNS change workflow.

Why It Exists

Previously, DNS change requests were sent via email, triggering a manual process that required coordination between various team members. The DNS Form replaces this ad-hoc approach by providing a structured and automated solution. By using this tool, the Operations Engineering team can:

  • Track DNS change requests in a structured and organized manner.
  • Automate the creation of GitHub issues and pull requests for DNS changes.
  • Ensure validation and proper formatting of DNS requests, reducing errors and manual intervention.

Features

  • Authentication: Only authenticated users can access the DNS request form.
  • DNS Request Submission: Users can submit DNS change requests through a web form.
  • GitHub Integration: Automatically creates an issue and pull request for DNS changes in a GitHub repository.
  • Form Validation: Ensures that DNS records are properly formatted before submission.

Prerequisites

  • Python 3.x
  • Flask
  • GitHub Integration for issue and pull request creation
  • Authentication: The app uses a custom authentication middleware, and users must be logged in to submit requests.

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Install dependencies: Use pip to install the required dependencies:

    pip install -r requirements.txt
  3. Set up environment variables:

    • Configure the necessary environment variables for GitHub integration, and authentication. Example .env file:
      FLASK_APP=app
      FLASK_ENV=development
      GITHUB_API_TOKEN=your_github_token
  4. Run the Flask application:

    flask run

    The app will be available at http://localhost:5000.

Usage

  1. Login: Authenticate through the Auth0 configured authentication system.
  2. Submit DNS Request: Fill out the DNS request form and submit.
  3. Issue and PR Creation: The application will automatically create a GitHub issue and a pull request for the requested DNS changes.

Running Tests

To run the unit tests for the application:

  1. Install test dependencies:

    pip install -r requirements-dev.txt
  2. Run the tests:

    python -m unittest discover

Contributions

Contributions to this repository are welcome. Please follow the code of conduct and ensure your changes are tested before submitting a pull request.