Browse Source

Auto Builds via Travis (#1)

keep-history
Nemo 3 years ago committed by GitHub
parent
commit
6dedef95ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .gitignore
  2. 36
      .travis.yml
  3. 21
      README.md
  4. 22
      ci.sh
  5. BIN
      deploy-key.enc
  6. 18
      result.txt
  7. 27
      scan.sh
  8. 6
      template.md
  9. 1532
      tlds.txt
  10. 4
      website/.gitignore
  11. 4
      website/Gemfile
  12. 69
      website/Gemfile.lock
  13. 9
      website/_config.yml
  14. 1
      website/_data/.gitignore
  15. 28
      website/_layouts/default.html
  16. 31
      website/_layouts/home.html
  17. 165
      website/assets/sakura.css

2
.gitignore vendored

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
tlds.txt
deploy-key

36
.travis.yml

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
language: ruby
env:
global:
- GIT_REMOTE: git@github.com:captn3m0/tld-a-record.git
addons:
apt:
packages:
# required to avoid SSL errors
- libcurl4-openssl-dev
- dnsutils
- idn
rvm:
- 2.6.3
before_install:
- openssl aes-256-cbc -K $encrypted_9e883639804e_key -iv $encrypted_9e883639804e_iv -in deploy-key.enc -out deploy-key -d
- chmod 600 deploy-key
- eval `ssh-agent -s`
- ssh-add deploy-key
- git config user.name "TLD List Bot"
- git config user.email "tld-bot@captnemo.in"
# Update bundler: https://docs.travis-ci.com/user/languages/ruby/
- gem update --system
- gem install bundler
script:
- wget "https://data.iana.org/TLD/tlds-alpha-by-domain.txt" --output-document tlds.txt
- ./scan.sh
- curl 'https://ipapi.co/yaml/' > website/_data/ip.json
- echo "This scan was last run on $(date)" >> template.md
- cp tlds.txt website/
- cp template.md website/index.md
- ./ci.sh
# branch whitelist, only for GitHub Pages
branches:
except:
# gh-pages is automatically committed
- gh-pages

21
README.md

@ -1,22 +1,3 @@ @@ -1,22 +1,3 @@
# tld-a-record
List of TLDs with A records
AI has address 209.59.119.34
ARAB has address 127.0.53.53
BH has address 10.10.10.10
BH has address 88.201.27.211
CM has address 195.24.205.60
DK has address 193.163.102.58
GG has address 87.117.196.80
JE has address 87.117.196.80
PN has address 80.68.93.100
POLITIE has address 127.0.53.53
TK has address 217.119.57.22
UZ has address 91.212.89.8
WS has address 64.70.19.33
XN--L1ACC has address 180.149.98.78
XN--L1ACC has address 202.170.80.40
XN--L1ACC has address 218.100.84.27
XN--MXTQ1M has address 127.0.53.53
XN--NGBRX has address 127.0.53.53
Build scripts that maintain https://tld.captnemo.in, which is a list of all TLDs with A records.

22
ci.sh

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Run the scan
cd website
bundle install
bundle show
bundle exec jekyll build --verbose --destination _site
if ([ $TRAVIS_BRANCH == "master" ] && [ $TRAVIS_PULL_REQUEST == "false" ]); then
cd _site
git init
git remote add origin "$GIT_REMOTE"
git add .
git commit -m "Deploy to GitHub Pages"
git push --force --quiet origin master:gh-pages > /dev/null 2>&1
echo 'Build successful, deployed to gh-pages.'
else
echo "Build successful, but not deploying!"
fi

BIN
deploy-key.enc

Binary file not shown.

18
result.txt

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
AI has address 209.59.119.34
ARAB has address 127.0.53.53
BH has address 88.201.27.211
BH has address 10.10.10.10
CM has address 195.24.205.60
DK has address 193.163.102.58
GG has address 87.117.196.80
JE has address 87.117.196.80
PN has address 80.68.93.100
POLITIE has address 127.0.53.53
TK has address 217.119.57.22
UZ has address 91.212.89.8
WS has address 64.70.19.33
XN--L1ACC has address 218.100.84.27
XN--L1ACC has address 202.170.80.40
XN--L1ACC has address 180.149.98.78
XN--MXTQ1M has address 127.0.53.53
XN--NGBRX has address 127.0.53.53

27
scan.sh

@ -1,7 +1,26 @@ @@ -1,7 +1,26 @@
#!/bin/bash
wget "https://data.iana.org/TLD/tlds-alpha-by-domain.txt" --output-document tlds.txt
# This script runs a scan for all available TLDs, and notes
# down the TLDs that resolve to `website/template.md`
#
# It also puts some information about the IP Adress from where
# the scan was run (might be relevant for DNS lookups) into
# `website/_data/ip.json`. Structure is at ipapi.co
(for domain in $(grep -v '^#' tlds.txt); do
host -W 1 -t A "${domain}."
done) | grep -v 'has no A record'
for domain in $(grep -v '^#' tlds.txt); do
RESULT=$(dig +time=1 +tries=1 +short "$domain" | head -c -1 | tr '\n' '@' | sed 's/@/`,`/g' | grep -v "connection timed out")
if [ ! -z "$RESULT" ]; then
echo $domain
DOMAIN_REAL="$domain"
# Very crude regex for punycode domains
if [[ $(echo "$domain" | grep -E "^XN--[[:upper:]]+$") ]]; then
DOMAIN_REAL=$(idn --idna-to-unicode "$domain")
fi
echo "|$DOMAIN_REAL|$domain|[http](http://$domain)|[https](https://$domain)|\`$RESULT\`|" >> template.md
fi
done
curl 'https://ipapi.co/yaml/' > website/_data/ip.json
echo >> template.md
echo "This scan was last run on $(date)" >> template.md

6
template.md

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
---
layout: home
---
|domain|punycode|http|https|lookup|
|------|--------|----|-----|------|

1532
tlds.txt

File diff suppressed because it is too large Load Diff

4
website/.gitignore vendored

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
_site
.sass-cache
.jekyll-metadata
vendor

4
website/Gemfile

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
source 'https://rubygems.org'
gem 'jekyll'
gem 'jekyll-theme-dinky', group: :jekyll_plugins

69
website/Gemfile.lock

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
concurrent-ruby (1.1.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.11.1)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.6)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-theme-dinky (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (1.17.0)
liquid (4.0.3)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (3.7.0)
ruby_dep (1.5.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
PLATFORMS
ruby
DEPENDENCIES
jekyll
jekyll-theme-dinky
BUNDLED WITH
2.0.2

9
website/_config.yml

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
email: tld@captnemo.in
baseurl: "/tld-a-record" # the subpath of your site, e.g. /blog
url: "https://captnemo.in" # the base hostname & protocol for your site, e.g. http://example.com
site:
github:
repository_url: https://github.com/captn3m0/tld-a-record/
title: TLDs with A Records
description: List of TLDs with A Records
markdown: kramdown

1
website/_data/.gitignore vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
ip.json

28
website/_layouts/default.html

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
<!doctype html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="{{ '/assets/sakura.css' | relative_url }}">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>{{site.title}}</title>
</head>
<body>
<div class="wrapper">
<header>
<h1 class="header">{{ site.title | default: site.github.repository_name }}</h1>
<p class="header">{{ site.description | default: site.github.project_tagline }}</p>
<ul>
<li><a class="buttons github" href="{{ site.github.repository_url }}">View On GitHub</a></li>
</ul>
</header>
<section>
{{ content }}
</section>
</div>
</body>
</html>

31
website/_layouts/home.html

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
---
layout: default
---
{{content}}
<hr>
<h2>Source</h2>
<table>
<tbody>
<tr>
<td>IP</td>
<td>{{site.data.ip.ip}}</td>
</tr>
<tr>
<td>ASN</td>
<td>{{site.data.ip.asn}}</td>
</tr>
<tr>
<td>Org</td>
<td>{{site.data.ip.org}}</td>
</tr>
</tbody>
</table>
<hr>
<p>A list of all TLDs scanned is available at <a href="tlds.txt">tlds.txt</a>.

165
website/assets/sakura.css

@ -0,0 +1,165 @@ @@ -0,0 +1,165 @@
/* Sakura.css v1.0.0
* ================
* Minimal css theme.
* Project: https://github.com/oxalorg/sakura
*/
/* Body */
html {
font-size: 62.5%;
font-family: serif; }
body {
font-size: 1.8rem;
line-height: 1.618;
max-width: 38em;
margin: auto;
color: #4a4a4a;
background-color: #f9f9f9;
padding: 13px; }
@media (max-width: 684px) {
body {
font-size: 1.53rem; } }
@media (max-width: 382px) {
body {
font-size: 1.35rem; } }
h1, h2, h3, h4, h5, h6 {
line-height: 1.1;
font-family: Verdana, Geneva, sans-serif;
font-weight: 700;
overflow-wrap: break-word;
word-wrap: break-word;
-ms-word-break: break-all;
word-break: break-word;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto; }
h1 {
font-size: 2.35em; }
h2 {
font-size: 2.00em; }
h3 {
font-size: 1.75em; }
h4 {
font-size: 1.5em; }
h5 {
font-size: 1.25em; }
h6 {
font-size: 1em; }
small, sub, sup {
font-size: 75%; }
hr {
border-color: #2c8898; }
a {
text-decoration: none;
color: #2c8898; }
a:hover {
color: #982c61;
border-bottom: 2px solid #4a4a4a; }
ul {
padding-left: 1.4em; }
li {
margin-bottom: 0.4em; }
blockquote {
font-style: italic;
margin-left: 1.5em;
padding-left: 1em;
border-left: 3px solid #2c8898; }
img {
max-width: 100%; }
/* Pre and Code */
pre {
background-color: #f1f1f1;
display: block;
padding: 1em;
overflow-x: auto; }
code {
font-size: 0.9em;
padding: 0 0.5em;
background-color: #f1f1f1;
white-space: pre-wrap; }
pre > code {
padding: 0;
background-color: transparent;
white-space: pre; }
/* Tables */
table {
text-align: justify;
width: 100%;
border-collapse: collapse; }
td, th {
padding: 0.5em;
border-bottom: 1px solid #f1f1f1; }
/* Buttons, forms and input */
input, textarea {
border: 1px solid #4a4a4a; }
input:focus, textarea:focus {
border: 1px solid #2c8898; }
textarea {
width: 100%; }
.button, button, input[type="submit"], input[type="reset"], input[type="button"] {
display: inline-block;
padding: 5px 10px;
text-align: center;
text-decoration: none;
white-space: nowrap;
background-color: #2c8898;
color: #f9f9f9;
border-radius: 1px;
border: 1px solid #2c8898;
cursor: pointer;
box-sizing: border-box; }
.button[disabled], button[disabled], input[type="submit"][disabled], input[type="reset"][disabled], input[type="button"][disabled] {
cursor: default;
opacity: .5; }
.button:focus, .button:hover, button:focus, button:hover, input[type="submit"]:focus, input[type="submit"]:hover, input[type="reset"]:focus, input[type="reset"]:hover, input[type="button"]:focus, input[type="button"]:hover {
background-color: #982c61;
border-color: #982c61;
color: #f9f9f9;
outline: 0; }
textarea, select, input[type] {
color: #4a4a4a;
padding: 6px 10px;
/* The 6px vertically centers text on FF, ignored by Webkit */
margin-bottom: 10px;
background-color: #f1f1f1;
border: 1px solid #f1f1f1;
border-radius: 4px;
box-shadow: none;
box-sizing: border-box; }
textarea:focus, select:focus, input[type]:focus {
border: 1px solid #2c8898;
outline: 0; }
input[type="checkbox"]:focus {
outline: 1px dotted #2c8898; }
label, legend, fieldset {
display: block;
margin-bottom: .5rem;
font-weight: 600; }
Loading…
Cancel
Save