Giter Site home page Giter Site logo

freshp0325 / dns-tool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from do-community/dns-tool

1.0 0.0 0.0 12.54 MB

A set of browser-based DNS tools for DigitalOcean Community.

Home Page: https://do.co/dns-lookup

License: Apache License 2.0

HTML 0.99% TypeScript 41.31% JavaScript 1.52% Vue 55.20% CSS 0.99%

dns-tool's Introduction

Community DNS Tools

A set of browser-based DNS tools for DigitalOcean Community.


DNS Lookup

A simple browser-based tool to perform DNS lookups. Type a domain, search, and instantly get results.


SPF Explainer

A tool that explains a domain's SPF records. Search a domain and either explore its records or evaluate an IP for mail sending.

Development/Building

To setup the build/develop environment, you will need to run npm i with Node 12+ installed. This will install the dependencies to allow you to build the project.

To develop for the DNS tool run npm run dev:tools:dns-lookup, and to develop for the SPF explainer run npm run dev:tools:spf-explainer.
This will start a development server that will automatically reload the codebase when changes occur.

If you wish to host these tools on a service, simply run npm run build. This will run all the necessary build scripts automatically to build all the tools present in the source folder.
You can then take the dist folder and put it on your web server/bucket. The dist folder will contain the folders dns-lookup and spf-explainer which will each have their respective tools inside.

GitHub Actions is setup to do this automatically for this repository to deploy to gh-pages. It is also configured to deploy each PR commit to DigitalOcean Spaces for PR previews.

Source Structure

All the source for the tools is located within the src directory.

In this directory, there is the src/shared directory which contains centralised assets and source for the tools, such as the main Community styling which is located in src/shared/scss and the generic templates used by all tools in src/shared/templates.

Within this directory are also the main tool source directories (src/dns-lookup & src/spf-explainer).
These directories contain the specific source for that tool, which includes custom templates and style inheritance from the centralised styles.

Anything that is data which is used in a tool should be stored in src/<tool name>/data. Any helper functions should be stored in src/<tool name>/utils. Vue templates should be stored in src/<tool name>/templates with a name that makes sense for what it does. The src/<tool name>/index.html file should only be used to handle basic head information and initialise the app.

The build directory contains all the scripts needed to successfully build the tools into a minimal number of assets.

build/cleanDist.js is a simple script that creates the dist directory if it does not exist and then ensures that it is completely empty so that the build script has a fresh beginning.

build/fetchTemplate.js handles pulling down the blank DigitalOcean Community template page, converting it to be a PostHTML-Extend template and save it to build/base.html.

build/buildSVGs.js takes all SVG files located in src/shared/assets and converts them to JS strings (saved to build/svg/<name>.svg.js) that allow Vue/Parcel to include the SVGs inline.

build/buildTool.js is the main script file for the build process a tool in src. This builds out the mount.js file first, then compiles the scss/style.scss file to style.css, both using Parcel. Finally, the script uses PostHTML to bundle the index.html file, making use of the generate DigitalOcean Community template at build/base.html.

Contributing

If you are contributing, please read the contributing file before submitting your pull requests.

Thanks

Thanks to Cloudflare for their great WHOIS/DNS-over-HTTPS APIs. You can learn more about the importance of DNS-over-HTTPS and how to use it here.

Thanks to Matthew Gall for his wonderful WHOIS API.

dns-tool's People

Contributors

iamjsd avatar mattipv4 avatar amnotadev avatar

Stargazers

FreshP0325 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.