Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d2cfbcf34 | ||
| 698df31c33 | |||
|
|
f463c403ac | ||
| beade733f6 | |||
|
|
1cc8b93f82 | ||
|
|
ba423dab24 | ||
| 7553608544 | |||
|
|
e9e79c1b19 | ||
| 98c8f65854 | |||
|
|
fa8eb8b5fe | ||
| d879649851 | |||
|
|
3c566c25e1 | ||
| 1c946f5b16 | |||
|
|
e9856e6bbb | ||
| 3d6f61098f | |||
| 4430c562c1 |
@@ -5,9 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
|
||||||
- cron: '28 5 * * *'
|
|
||||||
# workflow_run support in Gitea can be tricky, keeping it but might need adjustment
|
|
||||||
workflow_run:
|
workflow_run:
|
||||||
workflows: ["Sync Repo"]
|
workflows: ["Sync Repo"]
|
||||||
types:
|
types:
|
||||||
@@ -80,15 +77,11 @@ jobs:
|
|||||||
echo "Repo URL not found in Dockerargs."
|
echo "Repo URL not found in Dockerargs."
|
||||||
echo "upstream_needs_update=false" >> "$GITHUB_OUTPUT"
|
echo "upstream_needs_update=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "build_args=" >> "$GITHUB_OUTPUT"
|
echo "build_args=" >> "$GITHUB_OUTPUT"
|
||||||
echo "repo_url=" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "repo_branch=" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "No Dockerargs found."
|
echo "No Dockerargs found."
|
||||||
echo "upstream_needs_update=false" >> "$GITHUB_OUTPUT"
|
echo "upstream_needs_update=false" >> "$GITHUB_OUTPUT"
|
||||||
echo "build_args=" >> "$GITHUB_OUTPUT"
|
echo "build_args=" >> "$GITHUB_OUTPUT"
|
||||||
echo "repo_url=" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "repo_branch=" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check if any tags exist
|
- name: Check if any tags exist
|
||||||
@@ -269,6 +262,11 @@ jobs:
|
|||||||
git commit -m "Update manifest version to ${{ steps.version.outputs.VERSION }} [▶️]" || echo "Nothing to commit"
|
git commit -m "Update manifest version to ${{ steps.version.outputs.VERSION }} [▶️]" || echo "Nothing to commit"
|
||||||
git push origin main
|
git push origin main
|
||||||
|
|
||||||
|
- name: 🛠 Install zip
|
||||||
|
if: steps.check_commits.outputs.commit_count != '0'
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y zip
|
||||||
|
|
||||||
- name: 📦 Create ZIP package (excluding certain files)
|
- name: 📦 Create ZIP package (excluding certain files)
|
||||||
if: steps.check_commits.outputs.commit_count != '0'
|
if: steps.check_commits.outputs.commit_count != '0'
|
||||||
run: |
|
run: |
|
||||||
@@ -323,18 +321,17 @@ jobs:
|
|||||||
ZIP_NAME="${{ steps.version.outputs.ZIP_NAME }}"
|
ZIP_NAME="${{ steps.version.outputs.ZIP_NAME }}"
|
||||||
FILE_PATH="./$ZIP_NAME"
|
FILE_PATH="./$ZIP_NAME"
|
||||||
|
|
||||||
curl -s -X POST "${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets" \
|
curl --fail -s -X POST "${{ gitea.api_url }}/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets?name=$ZIP_NAME" \
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||||
-H "Content-Type: application/zip" \
|
-H "Content-Type: application/zip" \
|
||||||
--data-binary @"$FILE_PATH" \
|
--data-binary @"$FILE_PATH"
|
||||||
-o /dev/null
|
|
||||||
|
|
||||||
# ----- Docker steps -----
|
# ----- Docker steps -----
|
||||||
- name: Clone Upstream Code (if needed)
|
- name: Clone Upstream Code (if needed)
|
||||||
if: steps.check_commits.outputs.commit_count != '0' && (steps.check_upstream.outputs.upstream_needs_update == 'true' || steps.check_upstream.outputs.repo_url != '')
|
if: steps.check_commits.outputs.commit_count != '0' && (steps.check_upstream.outputs.upstream_needs_update == 'true' || steps.check_upstream.outputs.repo_url != '')
|
||||||
run: |
|
run: |
|
||||||
rm -rf upstream_src
|
rm -rf upstream_src
|
||||||
git clone --depth 1 --branch ${{ steps.check_upstream.outputs.repo_branch }} ${{ steps.check_upstream.outputs.repo_url }} upstream_src
|
git clone --depth 1 --branch ${{ steps.check_upstream.outputs.repo_branch }} ${{ steps.check_upstream.outputs.repo_url }} upstream_src
|
||||||
|
|
||||||
- name: 🔍 Check if Dockerfile exists
|
- name: 🔍 Check if Dockerfile exists
|
||||||
if: steps.check_commits.outputs.commit_count != '0' || steps.check_upstream.outputs.upstream_needs_update == 'true'
|
if: steps.check_commits.outputs.commit_count != '0' || steps.check_upstream.outputs.upstream_needs_update == 'true'
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
name: Update AWS SDK PHAR
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '34 3 * * *' # 03:34 UTC == 00:34 BRT
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
download-aws-sdk:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
actions: write # needed to dispatch another workflow
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Download AWS SDK PHAR
|
|
||||||
run: |
|
|
||||||
mkdir -p vendor
|
|
||||||
wget https://github.com/aws/aws-sdk-php/releases/latest/download/aws.phar -O vendor/aws.phar
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
|
||||||
id: commit_step
|
|
||||||
run: |
|
|
||||||
git config --global --add safe.directory '*'
|
|
||||||
git config user.name "Gitea Actions"
|
|
||||||
git config user.email "actions@git.icc.gg"
|
|
||||||
git add vendor/aws.phar
|
|
||||||
|
|
||||||
# If there are changes, commit & push; set output flag accordingly
|
|
||||||
if git diff --quiet && git diff --staged --quiet; then
|
|
||||||
echo "No changes to commit"
|
|
||||||
echo "changes_committed=false" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
git commit -m "Update AWS SDK PHAR [▶️]"
|
|
||||||
git push origin HEAD:main
|
|
||||||
echo "changes_committed=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
59
.gitea/workflows/update_readme.yml
Normal file
59
.gitea/workflows/update_readme.yml
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Update README
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 4 * * *" # Every day at 4 AM UTC
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-readme:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
SOURCE_REPO: ivancarlos/.gitea
|
||||||
|
SOURCE_BRANCH: main
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout current repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Checkout source README template
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ env.SOURCE_REPO }}
|
||||||
|
ref: ${{ env.SOURCE_BRANCH }}
|
||||||
|
token: ${{ secrets.CR_PAT }}
|
||||||
|
path: source_readme
|
||||||
|
|
||||||
|
- name: Update README.md (footer only)
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# --- Extract footer block from source (everything from <!-- footer --> onward) ---
|
||||||
|
FOOTER=$(awk '/<!-- footer -->/{flag=1}flag' source_readme/README.md)
|
||||||
|
|
||||||
|
# --- Replace everything after <!-- footer --> with FOOTER ---
|
||||||
|
awk -v footer="$FOOTER" '
|
||||||
|
/<!-- footer -->/ {
|
||||||
|
print footer
|
||||||
|
found=1
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
{ print }
|
||||||
|
' README.md > README.tmp && mv README.tmp README.md
|
||||||
|
|
||||||
|
- name: Remove source_readme from git index
|
||||||
|
run: rm -rf source_readme
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
run: |
|
||||||
|
git config user.name "Gitea Actions"
|
||||||
|
git config user.email "actions@git.icc.gg"
|
||||||
|
git add README.md
|
||||||
|
git commit -m "Sync README from template [▶️]" || echo "Nothing to commit"
|
||||||
|
git push origin ${{ github.ref_name }}
|
||||||
14
Dockerfile
14
Dockerfile
@@ -1,11 +1,21 @@
|
|||||||
FROM php:8.4-fpm-alpine
|
FROM php:8.4-fpm-alpine
|
||||||
|
|
||||||
# Install Nginx and MariaDB client; install PHP extensions (mysqli) and clean up
|
# Install Nginx and MariaDB client; install PHP extensions (mysqli) and clean up
|
||||||
RUN apk add --no-cache --update nginx \
|
RUN apk add --no-cache --update nginx git unzip \
|
||||||
&& docker-php-ext-install mysqli \
|
&& docker-php-ext-install mysqli \
|
||||||
&& rm -rf /var/cache/apk/* /tmp/*
|
&& rm -rf /var/cache/apk/* /tmp/*
|
||||||
|
|
||||||
# Copy your application code
|
# Install Composer
|
||||||
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
# Copy only composer files first to leverage Docker cache
|
||||||
|
COPY composer.json /var/www/html/
|
||||||
|
|
||||||
|
# Increase timeout and install dependencies
|
||||||
|
ENV COMPOSER_PROCESS_TIMEOUT=2000
|
||||||
|
RUN composer install --no-dev --optimize-autoloader
|
||||||
|
|
||||||
|
# Copy the rest of the application code
|
||||||
COPY . /var/www/html/
|
COPY . /var/www/html/
|
||||||
|
|
||||||
# Create nginx.conf directly in the Docker build
|
# Create nginx.conf directly in the Docker build
|
||||||
|
|||||||
37
README.md
37
README.md
@@ -1,22 +1,10 @@
|
|||||||
# DDNS on Route53
|
# DDNS on Route53
|
||||||
Router friendly client to update AWS Route53 entries for Dynamic DNS funtionality
|
Router friendly client to update AWS Route53 entries for Dynamic DNS funtionality
|
||||||
|
|
||||||
<!-- buttons -->
|
|
||||||
[](https://github.com/ivancarlosti/ddnsonroute53/stargazers)
|
|
||||||
[](https://github.com/sponsors/ivancarlosti)
|
|
||||||
[](https://github.com/sponsors/ivancarlosti)
|
|
||||||
[](https://github.com/ivancarlosti/ddnsonroute53/pulse)
|
|
||||||
[](https://github.com/ivancarlosti/ddnsonroute53/issues)
|
|
||||||
[](LICENSE)
|
|
||||||
[](https://github.com/ivancarlosti/ddnsonroute53/commits)
|
|
||||||
[](https://github.com/ivancarlosti/ddnsonroute53/security)
|
|
||||||
[](https://github.com/ivancarlosti/ddnsonroute53?tab=coc-ov-file)
|
|
||||||
[][sponsor]
|
|
||||||
<!-- endbuttons -->
|
|
||||||
|
|
||||||
## Requirement:
|
## Requirement:
|
||||||
|
|
||||||
* [Docker Compose](https://docs.docker.com/engine/install/)
|
* [Docker Compose](https://docs.docker.com/engine/install/)
|
||||||
|
* Domain zone on AWS Route 53
|
||||||
* MySQL/MariaDB
|
* MySQL/MariaDB
|
||||||
* Keycloak for SSO
|
* Keycloak for SSO
|
||||||
|
|
||||||
@@ -84,18 +72,8 @@ Example: `https://[FQDN]:[PASSWORD]@subdomain.example.com/update.php?hostname=[F
|
|||||||
TP-Link Omada Update URL:
|
TP-Link Omada Update URL:
|
||||||
* `https://[USERNAME]:[PASSWORD]@subdomain.example.com/update.php?hostname=[DOMAIN]&myip=[IP]`
|
* `https://[USERNAME]:[PASSWORD]@subdomain.example.com/update.php?hostname=[DOMAIN]&myip=[IP]`
|
||||||
|
|
||||||
## To Do:
|
Unifi Cloud Gateway custom server:
|
||||||
|
* `subdomain.example.com/update.php?hostname=%h&myip=%i`
|
||||||
* HTML beautification
|
|
||||||
* Build releases using Compose to populate AWS SDK dinamically
|
|
||||||
|
|
||||||
## Hosting note:
|
|
||||||
|
|
||||||
Using PHP with the Suhosin patch is not recommended, but is common on some Ubuntu and Debian distributions. To modify `suhosin.ini`, add the following line.
|
|
||||||
|
|
||||||
```
|
|
||||||
suhosin.executor.include.whitelist = phar
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- footer -->
|
<!-- footer -->
|
||||||
---
|
---
|
||||||
@@ -110,14 +88,7 @@ suhosin.executor.include.whitelist = phar
|
|||||||
[**buying me a coffee**][buymeacoffee], [**donate by paypal**][paypal], [**sponsor this project**][sponsor] or just [**leave a star**](../..)⭐
|
[**buying me a coffee**][buymeacoffee], [**donate by paypal**][paypal], [**sponsor this project**][sponsor] or just [**leave a star**](../..)⭐
|
||||||
|Thanks for your support, it is much appreciated!|
|
|Thanks for your support, it is much appreciated!|
|
||||||
|
|
||||||
[cc]: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-code-of-conduct-to-your-project
|
[ivancarlos]: https://ivancarlos.me
|
||||||
[contributing]: https://docs.github.com/en/articles/setting-guidelines-for-repository-contributors
|
|
||||||
[security]: https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository
|
|
||||||
[support]: https://docs.github.com/en/articles/adding-support-resources-to-your-project
|
|
||||||
[it]: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
|
|
||||||
[prt]: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
|
|
||||||
[funding]: https://docs.github.com/en/articles/displaying-a-sponsor-button-in-your-repository
|
|
||||||
[ivancarlos]: https://ivancarlos.it
|
|
||||||
[buymeacoffee]: https://www.buymeacoffee.com/ivancarlos
|
[buymeacoffee]: https://www.buymeacoffee.com/ivancarlos
|
||||||
[paypal]: https://icc.gg/donate
|
[paypal]: https://icc.gg/donate
|
||||||
[sponsor]: https://github.com/sponsors/ivancarlosti
|
[sponsor]: https://github.com/sponsors/ivancarlosti
|
||||||
|
|||||||
5
composer.json
Normal file
5
composer.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"aws/aws-sdk-php": "^3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "5.0.1",
|
"version": "6.1.1",
|
||||||
"author": "Ivan Carlos"
|
"author": "Ivan Carlos"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
include '../dbconfig.php';
|
include '../dbconfig.php';
|
||||||
require '../vendor/aws.phar';
|
require '../vendor/autoload.php';
|
||||||
|
|
||||||
use Aws\Route53\Route53Client;
|
use Aws\Route53\Route53Client;
|
||||||
use Aws\Exception\AwsException;
|
use Aws\Exception\AwsException;
|
||||||
@@ -40,10 +40,10 @@ if ($aws_result = $link->query($aws_sql)) {
|
|||||||
// Initialize the Route53 client
|
// Initialize the Route53 client
|
||||||
try {
|
try {
|
||||||
$route53 = new Route53Client([
|
$route53 = new Route53Client([
|
||||||
'version' => 'latest',
|
'version' => 'latest',
|
||||||
'region' => $region,
|
'region' => $region,
|
||||||
'credentials' => [
|
'credentials' => [
|
||||||
'key' => $access_key_id,
|
'key' => $access_key_id,
|
||||||
'secret' => $secret_access_key,
|
'secret' => $secret_access_key,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
@@ -86,7 +86,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['add_ddns'])) {
|
|||||||
'ResourceRecordSet' => [
|
'ResourceRecordSet' => [
|
||||||
'Name' => $ddns_fqdn . '.',
|
'Name' => $ddns_fqdn . '.',
|
||||||
'Type' => 'A',
|
'Type' => 'A',
|
||||||
'TTL' => (int)$ttl,
|
'TTL' => (int) $ttl,
|
||||||
'ResourceRecords' => [
|
'ResourceRecords' => [
|
||||||
[
|
[
|
||||||
'Value' => $initial_ip,
|
'Value' => $initial_ip,
|
||||||
@@ -101,7 +101,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['add_ddns'])) {
|
|||||||
// Create the DNS record in Route53
|
// Create the DNS record in Route53
|
||||||
$result = $route53->changeResourceRecordSets([
|
$result = $route53->changeResourceRecordSets([
|
||||||
'HostedZoneId' => $hosted_zone_id,
|
'HostedZoneId' => $hosted_zone_id,
|
||||||
'ChangeBatch' => $changeBatch,
|
'ChangeBatch' => $changeBatch,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Insert the new DDNS entry into the database
|
// Insert the new DDNS entry into the database
|
||||||
@@ -168,7 +168,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update_ip'])) {
|
|||||||
'ResourceRecordSet' => [
|
'ResourceRecordSet' => [
|
||||||
'Name' => $ddns_fqdn . '.',
|
'Name' => $ddns_fqdn . '.',
|
||||||
'Type' => 'A',
|
'Type' => 'A',
|
||||||
'TTL' => (int)$new_ttl,
|
'TTL' => (int) $new_ttl,
|
||||||
'ResourceRecords' => [
|
'ResourceRecords' => [
|
||||||
[
|
[
|
||||||
'Value' => $new_ip,
|
'Value' => $new_ip,
|
||||||
@@ -183,7 +183,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['update_ip'])) {
|
|||||||
// Update the DNS record in Route53
|
// Update the DNS record in Route53
|
||||||
$result = $route53->changeResourceRecordSets([
|
$result = $route53->changeResourceRecordSets([
|
||||||
'HostedZoneId' => $hosted_zone_id,
|
'HostedZoneId' => $hosted_zone_id,
|
||||||
'ChangeBatch' => $changeBatch,
|
'ChangeBatch' => $changeBatch,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Update the IP and TTL in the database
|
// Update the IP and TTL in the database
|
||||||
@@ -237,7 +237,7 @@ if (isset($_GET['delete'])) {
|
|||||||
'ResourceRecordSet' => [
|
'ResourceRecordSet' => [
|
||||||
'Name' => $ddns_fqdn . '.',
|
'Name' => $ddns_fqdn . '.',
|
||||||
'Type' => 'A',
|
'Type' => 'A',
|
||||||
'TTL' => (int)$ttl,
|
'TTL' => (int) $ttl,
|
||||||
'ResourceRecords' => [
|
'ResourceRecords' => [
|
||||||
[
|
[
|
||||||
'Value' => $last_ipv4,
|
'Value' => $last_ipv4,
|
||||||
@@ -252,7 +252,7 @@ if (isset($_GET['delete'])) {
|
|||||||
// Delete the DNS record in Route53
|
// Delete the DNS record in Route53
|
||||||
$result = $route53->changeResourceRecordSets([
|
$result = $route53->changeResourceRecordSets([
|
||||||
'HostedZoneId' => $hosted_zone_id,
|
'HostedZoneId' => $hosted_zone_id,
|
||||||
'ChangeBatch' => $changeBatch,
|
'ChangeBatch' => $changeBatch,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Delete the DDNS entry from the database
|
// Delete the DDNS entry from the database
|
||||||
@@ -284,6 +284,7 @@ if ($result = $link->query($sql)) {
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
@@ -295,25 +296,30 @@ if ($result = $link->query($sql)) {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
th.sortable:hover {
|
th.sortable:hover {
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
}
|
}
|
||||||
|
|
||||||
th.sortable::after {
|
th.sortable::after {
|
||||||
content: '↕';
|
content: '↕';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
th.sortable.asc::after {
|
th.sortable.asc::after {
|
||||||
content: '↑';
|
content: '↑';
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
th.sortable.desc::after {
|
th.sortable.desc::after {
|
||||||
content: '↓';
|
content: '↓';
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>Manage DDNS Entries</h1>
|
<h1>Manage DDNS Entries</h1>
|
||||||
@@ -329,7 +335,8 @@ if ($result = $link->query($sql)) {
|
|||||||
<h2>Add New DDNS Entry</h2>
|
<h2>Add New DDNS Entry</h2>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<label>DDNS FQDN:</label>
|
<label>DDNS FQDN:</label>
|
||||||
<input type="text" name="ddns_fqdn" required placeholder="subdomain.<?php echo htmlspecialchars($approved_fqdn); ?>">
|
<input type="text" name="ddns_fqdn" required
|
||||||
|
placeholder="subdomain.<?php echo htmlspecialchars($approved_fqdn); ?>">
|
||||||
|
|
||||||
<label>DDNS Password:</label>
|
<label>DDNS Password:</label>
|
||||||
<input type="password" name="ddns_password" required>
|
<input type="password" name="ddns_password" required>
|
||||||
@@ -347,51 +354,58 @@ if ($result = $link->query($sql)) {
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<h2>DDNS Entries</h2>
|
<h2>DDNS Entries</h2>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table id="ddnsTable">
|
<table id="ddnsTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="sortable" data-type="string">FQDN</th>
|
<th class="sortable" data-type="string">FQDN</th>
|
||||||
<th class="sortable" data-type="string">Password</th>
|
<th class="sortable" data-type="string">Password</th>
|
||||||
<th class="sortable" data-type="string">Last IPv4</th>
|
<th class="sortable" data-type="string">Last IPv4</th>
|
||||||
<th class="sortable" data-type="number">TTL</th>
|
<th class="sortable" data-type="number">TTL</th>
|
||||||
<th class="sortable" data-type="string">Last Update</th>
|
<th class="sortable" data-type="string">Last Update</th>
|
||||||
<th>Update IP/TTL</th>
|
<th>Update IP/TTL</th>
|
||||||
<th>Logs</th>
|
<th>Logs</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($ddns_entries as $entry): ?>
|
<?php foreach ($ddns_entries as $entry): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php echo htmlspecialchars($entry['ddns_fqdn']); ?></td>
|
<td><?php echo htmlspecialchars($entry['ddns_fqdn']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($entry['ddns_password']); ?></td>
|
<td><?php echo htmlspecialchars($entry['ddns_password']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($entry['last_ipv4']); ?></td>
|
<td><?php echo htmlspecialchars($entry['last_ipv4']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($entry['ttl']); ?></td>
|
<td><?php echo htmlspecialchars($entry['ttl']); ?></td>
|
||||||
<td><?php echo htmlspecialchars($entry['last_update']); ?></td>
|
<td><?php echo htmlspecialchars($entry['last_update']); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<form method="post" style="display:inline; max-width: none;">
|
<form method="post" style="display:inline; max-width: none;">
|
||||||
<input type="hidden" name="ddns_id" value="<?php echo $entry['id']; ?>">
|
<input type="hidden" name="ddns_id" value="<?php echo $entry['id']; ?>">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<input type="text" name="new_ip" placeholder="New IP" required style="width: 120px;">
|
<input type="text" name="new_ip" placeholder="New IP" required
|
||||||
<input type="number" name="new_ttl" placeholder="TTL" min="1" required style="width: 80px;">
|
style="width: 120px;">
|
||||||
<input type="submit" name="update_ip" value="Update" style="padding: 0.5rem;">
|
<input type="number" name="new_ttl" placeholder="TTL" min="1" required
|
||||||
</div>
|
style="width: 80px;">
|
||||||
</form>
|
<input type="submit" name="update_ip" value="Update" style="padding: 0.5rem;">
|
||||||
</td>
|
</div>
|
||||||
<td>
|
</form>
|
||||||
<a href="view_logs.php?ddns_id=<?php echo $entry['id']; ?>" class="btn" style="padding: 0.25rem 0.5rem; font-size: 0.875rem;">Logs</a>
|
</td>
|
||||||
</td>
|
<td>
|
||||||
<td>
|
<a href="view_logs.php?ddns_id=<?php echo $entry['id']; ?>" class="btn"
|
||||||
<a href="manage_ddns.php?delete=<?php echo $entry['id']; ?>" onclick="return confirm('Are you sure you want to delete this DDNS entry?');" class="btn btn-danger" style="padding: 0.25rem 0.5rem; font-size: 0.875rem;">Delete</a>
|
style="padding: 0.25rem 0.5rem; font-size: 0.875rem;">Logs</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td>
|
||||||
<?php endforeach; ?>
|
<a href="manage_ddns.php?delete=<?php echo $entry['id']; ?>"
|
||||||
</tbody>
|
onclick="return confirm('Are you sure you want to delete this DDNS entry?');"
|
||||||
</table>
|
class="btn btn-danger"
|
||||||
|
style="padding: 0.25rem 0.5rem; font-size: 0.875rem;">Delete</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><a href="dashboard.php">Back to Dashboard</a></p>
|
<p><a href="dashboard.php">Back to Dashboard</a></p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
include '../dbconfig.php';
|
include '../dbconfig.php';
|
||||||
require '../vendor/aws.phar';
|
require '../vendor/autoload.php';
|
||||||
|
|
||||||
use Aws\Route53\Route53Client;
|
use Aws\Route53\Route53Client;
|
||||||
use Aws\Exception\AwsException;
|
use Aws\Exception\AwsException;
|
||||||
|
|||||||
BIN
vendor/aws.phar
vendored
BIN
vendor/aws.phar
vendored
Binary file not shown.
Reference in New Issue
Block a user