-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor Python files into separate directory to increase project structure * Updated Logo to v0.4 * Add small webserver to show current status and last updates * Add small webserver to show current status and last updates * Initial work for webserver * Big changes to the webserver Finished Layout Finished Section that writes update information to html file * Added .github to .dockerign * Update Standard intervall to 10 mins and version to :latest * Updated resolver for current public ip to use Cloudflare Added config option for public ip determination, either "CLOUDFLARE" for cloudflare or any other string to use "https://ident.me" * Added server_start command to init.sh Needs testing and might be reverted * Add query for port from config file and pass it to server run function * Fix imports in Python owl module * Fix file location relations * Formatting echo messages Modify init.sh for startup, still testing * Update init.sh to run cron as daemon and not in foreground * Update imports, resolve conflict of module folder name and module name * Update gitignore * Update bump_version.yml * Version 0.4.1 --------- Co-authored-by: Simon_Bot <[email protected]>
- Loading branch information
Showing
19 changed files
with
271 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ venv | |
__pycache__ | ||
.idea | ||
.gitignore | ||
.github | ||
.git | ||
config.json | ||
docker-compose.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ docker-compose.yml | |
venv | ||
__pycache__ | ||
.idea | ||
index.html | ||
mycron | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
version: '3.8' | ||
services: | ||
dns-owl: | ||
image: ghcr.io/simonl169/dns-owl:v0.2 | ||
image: ghcr.io/simonl169/dns-owl:latest | ||
environment: | ||
- TZ=Europe/Berlin | ||
- CRONVARS2=*/1 * * * * | ||
- CRONVARS2=*/10 * * * * | ||
volumes: | ||
- ./config.json:/app/config.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
python -c 'from owl import *; starting_message()' # Run starting message and logo | ||
python -c 'from owl.owl_logo import *; starting_message()' # Run starting message and logo | ||
python main.py # Run Update once directly at the start | ||
echo "$CRONVARS2" "cd /app && python main.py" > mycron | ||
crontab mycron | ||
crond -f | ||
crond | ||
python -m start_server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
import dns_functions as dns | ||
import owl as owl | ||
from owl import dns_functions as dns | ||
from owl.config import load_config | ||
|
||
if __name__ == "__main__": | ||
|
||
# owl.print_owl() | ||
print(f"{'':#<40}") | ||
ip = dns.get_current_public_ip() | ||
|
||
ip_provider = load_config('./config.json')['PUBLIC_IP_CHECK'] | ||
|
||
ip = dns.get_current_public_ip(ip_provider) | ||
|
||
dns.update_all_ip(ip) | ||
|
||
print(f"\tAdd some part to update the index.html") | ||
|
||
print(f"\tDone updating, sleep until next CRON schedule...") |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ def load_config(filename: str): | |
with open(filename, 'r') as f: | ||
data = json.load(f) | ||
return data | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
body { | ||
font-family: "Helvetica Neue", Helvetica, Arial; | ||
font-size: 14px; | ||
line-height: 20px; | ||
font-weight: 400; | ||
color: #3b3b3b; | ||
-webkit-font-smoothing: antialiased; | ||
font-smoothing: antialiased; | ||
background: #2b2b2b; | ||
} | ||
@media screen and (max-width: 580px) { | ||
body { | ||
font-size: 16px; | ||
line-height: 22px; | ||
} | ||
} | ||
|
||
.wrapper { | ||
margin: 0 auto; | ||
padding: 40px; | ||
max-width: 800px; | ||
} | ||
|
||
.table { | ||
margin: 0 0 40px 0; | ||
width: 100%; | ||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); | ||
display: table; | ||
} | ||
@media screen and (max-width: 580px) { | ||
.table { | ||
display: block; | ||
} | ||
} | ||
|
||
.row { | ||
display: table-row; | ||
background: #f6f6f6; | ||
} | ||
.row:nth-of-type(odd) { | ||
background: #e9e9e9; | ||
} | ||
.row.header { | ||
font-weight: 900; | ||
color: #ffffff; | ||
background: #ea6153; | ||
} | ||
.row.green { | ||
background: #27ae60; | ||
} | ||
.row.blue { | ||
background: #2980b9; | ||
} | ||
@media screen and (max-width: 580px) { | ||
.row { | ||
padding: 14px 0 7px; | ||
display: block; | ||
} | ||
.row.header { | ||
padding: 0; | ||
height: 6px; | ||
} | ||
.row.header .cell { | ||
display: none; | ||
} | ||
.row .cell { | ||
margin-bottom: 10px; | ||
} | ||
.row .cell:before { | ||
margin-bottom: 3px; | ||
content: attr(data-title); | ||
min-width: 98px; | ||
font-size: 10px; | ||
line-height: 10px; | ||
font-weight: bold; | ||
text-transform: uppercase; | ||
color: #969696; | ||
display: block; | ||
} | ||
} | ||
|
||
.cell { | ||
padding: 6px 12px; | ||
display: table-cell; | ||
} | ||
@media screen and (max-width: 580px) { | ||
.cell { | ||
padding: 2px 16px; | ||
display: block; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!-- index.html --> | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>DNS OWL Status Server</title> | ||
<link rel="stylesheet" href="./owl/style.css"> | ||
</head> | ||
<body> | ||
|
||
<div class="wrapper"> | ||
<div class="table"> | ||
<div class="row header green"> | ||
<div class="cell"> | ||
Domain | ||
</div> | ||
<div class="cell"> | ||
Old IP Address | ||
</div> | ||
<div class="cell"> | ||
New IP Address | ||
</div> | ||
<div class="cell"> | ||
Result | ||
</div> | ||
</div> | ||
{% for domain in domain_list %} | ||
<div class="row"> | ||
<div class="cell" data-title="Domain"> | ||
{{ domain['RECORD_NAME'] }} | ||
</div> | ||
<div class="cell" data-title="Old IP"> | ||
{{ domain['OLD_IP'] }} | ||
</div> | ||
<div class="cell" data-title="New IP"> | ||
{{ domain['NEW_IP'] }} | ||
</div> | ||
<div class="cell" data-title="Result"> | ||
{{ domain['RESULT'] }} | ||
</div> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
<h1> | ||
Updated on : {{ updated_on }} | ||
</h1> | ||
</body> | ||
|
||
</html> | ||
|
Oops, something went wrong.