Update README.md and some fixes.
This commit is contained in:
@@ -43,6 +43,18 @@ doUpdate: true # set it to true to enable updater
|
|||||||
domains: [] # subdomains that you want auto-update (Example: { "name": "www.example.com", "proxied": true })
|
domains: [] # subdomains that you want auto-update (Example: { "name": "www.example.com", "proxied": true })
|
||||||
zone: null # zone of your domain name (such as example.com)
|
zone: null # zone of your domain name (such as example.com)
|
||||||
ddnsBroadcastCode: code-here # IMPORTANT: Replace it that only you know
|
ddnsBroadcastCode: code-here # IMPORTANT: Replace it that only you know
|
||||||
|
maintenancePageURL: "" # Maintenance page url (set it to an existing URL if you would use maintenance mode)
|
||||||
|
```
|
||||||
|
|
||||||
|
For dns item, use this template:
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"name": "www.example.com", # DNS name
|
||||||
|
"proxied": false, # Enable proxy (Enable this if you want to hide your server's real IP)
|
||||||
|
"type": "A", # or "CNAME", "AAA", "TEXT", "MX"
|
||||||
|
"allowMaintenance": true # Redirect to maintenancePage if maintenance mode is enabled.
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Remember to restart the tool after you save the config file.
|
Remember to restart the tool after you save the config file.
|
||||||
@@ -92,7 +92,7 @@ class CloudflareHelper(Helper):
|
|||||||
)
|
)
|
||||||
await message.channel.send(result)
|
await message.channel.send(result)
|
||||||
|
|
||||||
@self.dc.handle_command("/cf:enable-maintenance", help="Enable maintenance mode")
|
@self.dc.handle_command("/cf:maintenance", help="Toggle maintenance mode")
|
||||||
async def enable_maintenance(client, message):
|
async def enable_maintenance(client, message):
|
||||||
guild = getattr(message, "guild", None)
|
guild = getattr(message, "guild", None)
|
||||||
if guild is None:
|
if guild is None:
|
||||||
@@ -100,7 +100,14 @@ class CloudflareHelper(Helper):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if self.is_allowed_broadcast_server(guild.name):
|
if self.is_allowed_broadcast_server(guild.name):
|
||||||
await message.channel.send(f"Updating DDNS...")
|
if not self.is_maintenance:
|
||||||
|
self.is_maintenance = True
|
||||||
|
self.update_ddns()
|
||||||
|
await message.channel.send(f"Maintenance mode is enabled. Updating DDNS...")
|
||||||
|
else:
|
||||||
|
self.is_maintenance = False
|
||||||
|
self.update_ddns()
|
||||||
|
await message.channel.send(f"Maintenance mode is disabled. Updating DDNS...")
|
||||||
else:
|
else:
|
||||||
await message.channel.send(f"Unsupported server: {guild.name}")
|
await message.channel.send(f"Unsupported server: {guild.name}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user