feat: Add dynamic TLD using python
Some checks failed
Build Docker / Build Image (push) Failing after 14s
Some checks failed
Build Docker / Build Image (push) Failing after 14s
This commit is contained in:
parent
5767060441
commit
18b18bc2a2
42
.gitea/workflows/build.yml
Normal file
42
.gitea/workflows/build.yml
Normal file
@ -0,0 +1,42 @@
|
||||
name: Build Docker
|
||||
run-name: Build Docker Images
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
Build Image:
|
||||
runs-on: [ubuntu-latest, arm]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install Docker
|
||||
run : |
|
||||
apt-get install ca-certificates curl gnupg
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
apt-get update
|
||||
apt-get install docker-ce-cli -y
|
||||
- name: Build Docker image
|
||||
run : |
|
||||
cd master
|
||||
echo "${{ secrets.DOCKERGIT_TOKEN }}" | docker login git.woodburn.au -u nathanwoodburn --password-stdin
|
||||
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
||||
tag=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
|
||||
tag=${tag//\//-}
|
||||
tag_num=${GITHUB_RUN_NUMBER}
|
||||
echo "tag_num=$tag_num"
|
||||
|
||||
if [[ "$tag" == "main" ]]; then
|
||||
tag="latest"
|
||||
else
|
||||
tag_num="${tag}-${tag_num}"
|
||||
fi
|
||||
|
||||
|
||||
docker build -t nic:$tag_num .
|
||||
docker tag nic:$tag_num git.woodburn.au/nathanwoodburn/nic:$tag_num
|
||||
docker push git.woodburn.au/nathanwoodburn/nic:$tag_num
|
||||
docker tag nic:$tag_num git.woodburn.au/nathanwoodburn/nic:$tag
|
||||
docker push git.woodburn.au/nathanwoodburn/nic:$tag
|
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
flask
|
||||
python-dotenv
|
21
server.py
Normal file
21
server.py
Normal file
@ -0,0 +1,21 @@
|
||||
from flask import Flask, make_response, redirect, request, jsonify, render_template, send_from_directory
|
||||
import os
|
||||
import dotenv
|
||||
|
||||
app = Flask(__name__)
|
||||
dotenv.load_dotenv()
|
||||
|
||||
@app.route('/assets/<path:path>')
|
||||
def send_report(path):
|
||||
return send_from_directory('templates/assets', path)
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
# Get host from request
|
||||
host = request.headers.get('host')
|
||||
|
||||
return render_template('index.html', tld=host)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=False, port=5000, host='0.0.0.0')
|
11
templates/assets/css/index.css
Normal file
11
templates/assets/css/index.css
Normal file
@ -0,0 +1,11 @@
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
padding-left: 5%;
|
||||
}
|
Before Width: | Height: | Size: 4.3 MiB After Width: | Height: | Size: 4.3 MiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||
<title>.tas/ domains</title>
|
||||
<title>.{{tld}}/ domains</title>
|
||||
<meta name="description" content=".tas/ domains">
|
||||
<link rel="icon" type="image/png" sizes="1024x1024" href="assets/img/favicon.png">
|
||||
<link rel="icon" type="image/png" sizes="1024x1024" href="assets/img/favicon.png">
|
||||
@ -12,15 +12,16 @@
|
||||
<link rel="icon" type="image/png" sizes="1024x1024" href="assets/img/favicon.png">
|
||||
<link rel="icon" type="image/png" sizes="1024x1024" href="assets/img/favicon.png">
|
||||
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="assets/css/index.css">
|
||||
</head>
|
||||
|
||||
<body style="background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5) 100%), url("assets/img/background.jpg") no-repeat, #000000;background-size: auto, cover, auto;color: white;">
|
||||
<nav class="navbar navbar-dark navbar-expand">
|
||||
<div class="container-fluid"><a class="navbar-brand" href="/" style="font-size: 30px;font-weight: bold;color: white;">.TLD/</a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="container-fluid"><a class="navbar-brand" href="/" style="font-size: 30px;font-weight: bold;color: white;">.{{tld}}/</a><button data-bs-toggle="collapse" class="navbar-toggler" data-bs-target="#navcol-1"><span class="visually-hidden">Toggle navigation</span><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navcol-1">
|
||||
<ul class="navbar-nav ms-auto" style="font-size: 20px;font-weight: bold;">
|
||||
<li class="nav-item"><a class="nav-link active" href="/">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="https://reg.woodburn.au/tld/tas">Get yourname.tld/</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="https://reg.woodburn.au/tld/{{tld}}">Get yourname.{{tld}}/</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="https://hns.au" target="_blank">HNSAU</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -29,20 +30,17 @@
|
||||
<header>
|
||||
<div class="container">
|
||||
<div style="text-align: center;">
|
||||
<<<<<<< HEAD
|
||||
<h1 class="display-1 text-center" style="font-weight: bold;margin: 0px;">.tld domains</h1><span style="font-weight: bold;font-size: 40px;"><br>The domain name for...<br><br></span>
|
||||
=======
|
||||
<h1 class="display-1 text-center" style="font-weight: bold;margin: 0px;">.tld domains</h1><span style="font-weight: bold;font-size: 40px;"><br>The domain name for Tasmanian residents and businesses.<br><br></span>
|
||||
>>>>>>> main
|
||||
<h1 class="display-1 text-center" style="font-weight: bold;margin: 0px;">.{{tld}} domains</h1><span style="font-weight: bold;font-size: 40px;"><br>The domain name for your next project<br><br></span>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<section style="font-size: 25px;">
|
||||
<div class="text-center" id="pricing">
|
||||
<p class="text-center" style="font-weight: bold;">.tld/ domains now available for registration at Woodburn Registry.</p><span>Get yourname.tld/ for $5/yr.<br>Price will likely be increasing to $10/yr</span>
|
||||
<p class="text-center" style="font-weight: bold;">.{{tld}}/ domains now available for registration at Woodburn Registry.</p><span>Get yourname.{{tld}}/</span>
|
||||
</div>
|
||||
</section>
|
||||
<footer style="font-size: 25px;background: black;color: white;margin-top: 250px;"><span>© 2023 .tld/</span></footer><script src="https://nathan.woodburn/handshake.js" domain="nic.tld"></script>
|
||||
<footer style="font-size: 25px;background: black;color: white;margin-top: 250px;"><span>© 2023 .{{tld}}/</span></footer>
|
||||
<!-- <script src="https://nathan.woodburn/handshake.js" domain="nic.tld"></script> -->
|
||||
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user