mirror of
https://gitlab.com/ArkHost/WHMCS-ArkHost-HetznerVPS.git
synced 2026-07-24 07:45:53 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc9d8a2e1c | ||
|
|
0f96849032 | ||
|
|
cc60ca7103 |
@@ -12,6 +12,7 @@ WHMCS server module for Hetzner Cloud VPS management.
|
||||
|
||||
**Advanced**
|
||||
|
||||
- Cloud-init support for automated server configuration
|
||||
- Floating IP management with reverse DNS
|
||||
- Backup creation and restoration
|
||||
- Firewall rule management
|
||||
@@ -55,11 +56,12 @@ WHMCS server module for Hetzner Cloud VPS management.
|
||||
|
||||
**Module Settings**
|
||||
|
||||
- Server Type: `cx11`, `cx21`, `cx31`, `cx41`, `cx51` , etc.
|
||||
- Operating System: `ubuntu-20.04`, `debian-11`, etc.
|
||||
- Datacenter: `fsn1`, `nbg1`, `hel1`, `ash`, `hil`
|
||||
- Server Type: `cx23`, `cx33`, `cx43`, `cx53` (Cost-Optimized), `cpx11`, `cpx21`, `cax11`, `ccx13`, etc.
|
||||
- Operating System: `ubuntu-22.04`, `debian-11`, `rocky-9`, etc.
|
||||
- Datacenter: `fsn1`, `nbg1`, `hel1`, `ash`, `hil`, `sin`
|
||||
- Backups: On/Off
|
||||
- Create Floating IP: On/Off
|
||||
- Cloud-Init YAML: Optional custom cloud-init configuration
|
||||
|
||||
**Custom Field (Required)**
|
||||
|
||||
@@ -98,6 +100,10 @@ Create in Setup → Products/Services → Configurable Options:
|
||||
- Option Name: `planid`
|
||||
- Option Type: `Dropdown`
|
||||
- Options:
|
||||
- `cx23|CX23 - 2 vCPU, 4 GB RAM, 40 GB Disk, shared (Cost-Optimized)`
|
||||
- `cx33|CX33 - 4 vCPU, 8 GB RAM, 80 GB Disk, shared (Cost-Optimized)`
|
||||
- `cx43|CX43 - 8 vCPU, 16 GB RAM, 160 GB Disk, shared (Cost-Optimized)`
|
||||
- `cx53|CX53 - 16 vCPU, 32 GB RAM, 320 GB Disk, shared (Cost-Optimized)`
|
||||
- `cpx11|CPX 11 - 2 vCPU, 2 GB RAM, 40 GB Disk, shared`
|
||||
- `cpx21|CPX 21 - 3 vCPU, 4 GB RAM, 80 GB Disk, shared`
|
||||
- `cpx31|CPX 31 - 4 vCPU, 8 GB RAM, 160 GB Disk, shared`
|
||||
@@ -121,34 +127,36 @@ Create in Setup → Products/Services → Configurable Options:
|
||||
|
||||
**4\. Operating System**
|
||||
|
||||
- Option Name: `osid`
|
||||
- Option Type: `Dropdown`
|
||||
- Option Name: `osid`
|
||||
- Option Type: `Dropdown`
|
||||
- Options:
|
||||
- `lamp|lamp`
|
||||
-`wordpress|wordpress`
|
||||
-`jitsi|jitsi`
|
||||
-`nextcloud|nextcloud`
|
||||
- `docker-ce|docker-ce`
|
||||
- `gitlab|gitlab`
|
||||
- `debian-11|Debian 11`
|
||||
- `rocky-8|Rocky Linux 8`
|
||||
- `centos-stream-9|CentOS Stream 9`
|
||||
- `debian-12|Debian 12`
|
||||
- `debian-13|Debian 13`
|
||||
- `ubuntu-22.04|Ubuntu 22.04`
|
||||
- `prometheus-grafana|prometheus-grafana`
|
||||
- `rocky-9|Rocky Linux 9`
|
||||
- `wireguard|wireguard`
|
||||
- `owncast|owncast`
|
||||
- `photoprism|photoprism`
|
||||
- `rustdesk|rustdesk`
|
||||
- `centos-stream-9|CentOS Stream 9`
|
||||
- `debian-11|Debian 11`
|
||||
- `ubuntu-24.04|Ubuntu 24.04`
|
||||
- `rocky-8|Rocky Linux 8`
|
||||
- `rocky-9|Rocky Linux 9`
|
||||
- `ubuntu-22.04|Ubuntu 22.04`
|
||||
- `rocky-10|Rocky Linux 10`
|
||||
- `alma-8|AlmaLinux 8`
|
||||
- `alma-9|AlmaLinux 9`
|
||||
- `jitsi|jitsi`
|
||||
- `owncast|owncast`
|
||||
- `alma-10|AlmaLinux 10`
|
||||
- `centos-stream-9|CentOS Stream 9`
|
||||
- `centos-stream-10|CentOS Stream 10`
|
||||
- `opensuse-15|openSUSE 15`
|
||||
- `fedora-41|Fedora 41`
|
||||
- `fedora-42|Fedora 42`
|
||||
- `docker-ce|Docker CE`
|
||||
- `lamp|LAMP Stack`
|
||||
- `wordpress|WordPress`
|
||||
- `nextcloud|Nextcloud`
|
||||
- `gitlab|GitLab`
|
||||
- `jitsi|Jitsi`
|
||||
- `wireguard|WireGuard`
|
||||
- `prometheus-grafana|Prometheus + Grafana`
|
||||
- `owncast|Owncast`
|
||||
- `photoprism|PhotoPrism`
|
||||
- `rustdesk|RustDesk`
|
||||
|
||||
|
||||
|
||||
@@ -183,6 +191,102 @@ This ensures proper key isolation and security for each customer.
|
||||
|
||||
We're exploring secure implementations using cloud-init or per-server user data to enable SSH key management while maintaining proper isolation.
|
||||
|
||||
## Cloud-Init Support
|
||||
|
||||
Cloud-init allows automatic server configuration during first boot. Unlike project-level SSH keys, cloud-init user_data is per-server, ensuring proper isolation in multi-tenant environments.
|
||||
|
||||
**Configuration:**
|
||||
|
||||
1. Navigate to Setup → Products/Services → Products/Services
|
||||
2. Edit your product → Module Settings tab
|
||||
3. Find "Cloud-Init YAML (Optional)" textarea
|
||||
4. Enter your cloud-init configuration in YAML format
|
||||
5. Leave empty to skip cloud-init
|
||||
|
||||
**Common Use Cases:**
|
||||
|
||||
**1. Change APT Mirrors** (original use case - avoid Hetzner mirrors):
|
||||
```yaml
|
||||
#cloud-config
|
||||
apt:
|
||||
primary:
|
||||
- arches: [default]
|
||||
uri: http://de.archive.ubuntu.com/ubuntu/
|
||||
```
|
||||
|
||||
**2. Add SSH Keys** (secure alternative to project-level keys):
|
||||
```yaml
|
||||
#cloud-config
|
||||
users:
|
||||
- name: admin
|
||||
ssh_authorized_keys:
|
||||
- ssh-rsa AAAAB3NzaC1yc2E... user@laptop
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
shell: /bin/bash
|
||||
```
|
||||
|
||||
**3. Install Docker:**
|
||||
```yaml
|
||||
#cloud-config
|
||||
packages:
|
||||
- docker.io
|
||||
- docker-compose
|
||||
|
||||
runcmd:
|
||||
- systemctl enable docker
|
||||
- systemctl start docker
|
||||
```
|
||||
|
||||
**4. Security Hardening:**
|
||||
```yaml
|
||||
#cloud-config
|
||||
packages:
|
||||
- fail2ban
|
||||
- ufw
|
||||
|
||||
runcmd:
|
||||
- ufw default deny incoming
|
||||
- ufw default allow outgoing
|
||||
- ufw allow 22/tcp
|
||||
- ufw --force enable
|
||||
- systemctl enable fail2ban
|
||||
- systemctl start fail2ban
|
||||
```
|
||||
|
||||
**5. Combined Configuration:**
|
||||
```yaml
|
||||
#cloud-config
|
||||
apt:
|
||||
primary:
|
||||
- arches: [default]
|
||||
uri: http://mirror.example.com/ubuntu/
|
||||
|
||||
users:
|
||||
- name: admin
|
||||
ssh_authorized_keys:
|
||||
- ssh-rsa AAAAB3... admin@company
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
|
||||
packages:
|
||||
- fail2ban
|
||||
- ufw
|
||||
- docker.io
|
||||
|
||||
runcmd:
|
||||
- ufw allow 22/tcp
|
||||
- ufw --force enable
|
||||
- systemctl enable docker fail2ban
|
||||
```
|
||||
|
||||
**Important Notes:**
|
||||
|
||||
- YAML must be valid syntax (use a YAML validator if unsure)
|
||||
- If you don't start with `#cloud-config`, the module will add it automatically
|
||||
- Cloud-init runs ONCE on first boot only
|
||||
- Invalid YAML will cause provisioning to fail silently
|
||||
- Maximum size: 32 KiB (Hetzner API limit)
|
||||
- Documentation: https://docs.hetzner.cloud/#servers-create-a-server
|
||||
|
||||
## Screenshots
|
||||

|
||||

|
||||
@@ -234,5 +338,3 @@ Free and open source. Commercial support available.
|
||||
Check out our other WHMCS modules at [arkhost.com/whmcs-modules.php](https://arkhost.com/whmcs-modules.php "https://arkhost.com/whmcs-modules.php")
|
||||
|
||||
© 2025 ArkHost
|
||||
|
||||
<br>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* WHMCS Server Module - Hetzner VPS
|
||||
*
|
||||
* @package WHMCS
|
||||
* @version 1.1
|
||||
* @version 1.1.1
|
||||
* @copyright Copyright (c) ArkHost 2025
|
||||
* @author ArkHost <support@arkhost.com>
|
||||
* @link https://arkhost.com
|
||||
@@ -116,12 +116,12 @@ function ArkHostHetznerVPS_API(array $params) {
|
||||
break;
|
||||
|
||||
case 'Packages':
|
||||
$url .= 'server_types';
|
||||
$url .= 'server_types?per_page=50';
|
||||
$method = 'GET';
|
||||
break;
|
||||
|
||||
case 'Operating Systems':
|
||||
$url .= 'images?type=system';
|
||||
$url .= 'images?type=system&per_page=50';
|
||||
$method = 'GET';
|
||||
break;
|
||||
|
||||
@@ -177,6 +177,20 @@ function ArkHostHetznerVPS_API(array $params) {
|
||||
$data['enable_ipv6'] = false;
|
||||
}
|
||||
|
||||
// Handle Cloud-Init user_data if provided
|
||||
$cloudInitYaml = ArkHostHetznerVPS_GetOption($params, 'cloud_init_yaml');
|
||||
if ($cloudInitYaml && trim($cloudInitYaml) !== '') {
|
||||
// Basic YAML validation - check if it starts with #cloud-config
|
||||
$trimmedYaml = trim($cloudInitYaml);
|
||||
if (strpos($trimmedYaml, '#cloud-config') !== 0) {
|
||||
// Auto-prepend #cloud-config if missing
|
||||
$cloudInitYaml = "#cloud-config\n" . $cloudInitYaml;
|
||||
}
|
||||
|
||||
// Pass as plain text - Hetzner API accepts user_data as plain string (max 32KiB)
|
||||
$data['user_data'] = $cloudInitYaml;
|
||||
}
|
||||
|
||||
// Handle SSH keys from custom field if needed
|
||||
// This would need to be implemented with a custom field
|
||||
break;
|
||||
@@ -239,7 +253,7 @@ function ArkHostHetznerVPS_API(array $params) {
|
||||
break;
|
||||
|
||||
case 'Operating Systems - Server':
|
||||
$url .= 'images?type=system';
|
||||
$url .= 'images?type=system&per_page=50';
|
||||
$method = 'GET';
|
||||
break;
|
||||
|
||||
@@ -495,13 +509,22 @@ function ArkHostHetznerVPS_API(array $params) {
|
||||
}
|
||||
|
||||
// Add new rule to existing rules
|
||||
$newRule = array(
|
||||
'direction' => 'in',
|
||||
'protocol' => strtolower($params['protocol']),
|
||||
// Handle protocol - Hetzner API doesn't accept "ANY", we need to create multiple rules
|
||||
$protocol = strtolower($params['protocol']);
|
||||
$rulesToAdd = array();
|
||||
|
||||
if ($protocol === 'any') {
|
||||
// Create rules for tcp and udp when "ANY" is selected
|
||||
$protocols = array('tcp', 'udp');
|
||||
foreach ($protocols as $proto) {
|
||||
$rule = array(
|
||||
'direction' => isset($params['direction']) ? $params['direction'] : 'in',
|
||||
'protocol' => $proto,
|
||||
);
|
||||
|
||||
// Handle source IPs - ensure CIDR notation
|
||||
if (!empty($params['source']) && $params['source'] !== '0.0.0.0/0' && $params['source'] !== 'Any') {
|
||||
// Handle IPs - use source_ips for inbound, destination_ips for outbound
|
||||
$direction = isset($params['direction']) ? $params['direction'] : 'in';
|
||||
if (!empty($params['source']) && $params['source'] !== 'Any') {
|
||||
$sourceIp = trim($params['source']);
|
||||
// If no CIDR notation, add /32 for IPv4 or /128 for IPv6
|
||||
if (strpos($sourceIp, '/') === false) {
|
||||
@@ -511,26 +534,82 @@ function ArkHostHetznerVPS_API(array $params) {
|
||||
$sourceIp .= '/32';
|
||||
}
|
||||
}
|
||||
$newRule['source_ips'] = array($sourceIp);
|
||||
if ($direction === 'out') {
|
||||
$rule['destination_ips'] = array($sourceIp);
|
||||
$rule['source_ips'] = array();
|
||||
} else {
|
||||
// Empty array means all sources are allowed in Hetzner API
|
||||
$newRule['source_ips'] = array();
|
||||
$rule['source_ips'] = array($sourceIp);
|
||||
$rule['destination_ips'] = array();
|
||||
}
|
||||
} else {
|
||||
// For "Any" or empty, use 0.0.0.0/0 and ::/0 for all IPs
|
||||
if ($direction === 'out') {
|
||||
$rule['destination_ips'] = array('0.0.0.0/0', '::/0');
|
||||
$rule['source_ips'] = array();
|
||||
} else {
|
||||
$rule['source_ips'] = array('0.0.0.0/0', '::/0');
|
||||
$rule['destination_ips'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
// Handle port - Hetzner expects port as a string
|
||||
if (!empty($params['port']) && $params['protocol'] !== 'icmp') {
|
||||
if (!empty($params['port'])) {
|
||||
$rule['port'] = strval($params['port']);
|
||||
}
|
||||
|
||||
$rulesToAdd[] = $rule;
|
||||
}
|
||||
} else {
|
||||
// Single protocol rule
|
||||
$newRule = array(
|
||||
'direction' => isset($params['direction']) ? $params['direction'] : 'in',
|
||||
'protocol' => $protocol,
|
||||
);
|
||||
|
||||
// Handle IPs - use source_ips for inbound, destination_ips for outbound
|
||||
$direction = isset($params['direction']) ? $params['direction'] : 'in';
|
||||
if (!empty($params['source']) && $params['source'] !== 'Any') {
|
||||
$sourceIp = trim($params['source']);
|
||||
// If no CIDR notation, add /32 for IPv4 or /128 for IPv6
|
||||
if (strpos($sourceIp, '/') === false) {
|
||||
if (filter_var($sourceIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$sourceIp .= '/128';
|
||||
} else {
|
||||
$sourceIp .= '/32';
|
||||
}
|
||||
}
|
||||
if ($direction === 'out') {
|
||||
$newRule['destination_ips'] = array($sourceIp);
|
||||
$newRule['source_ips'] = array();
|
||||
} else {
|
||||
$newRule['source_ips'] = array($sourceIp);
|
||||
$newRule['destination_ips'] = array();
|
||||
}
|
||||
} else {
|
||||
// For "Any" or empty, use 0.0.0.0/0 and ::/0 for all IPs
|
||||
if ($direction === 'out') {
|
||||
$newRule['destination_ips'] = array('0.0.0.0/0', '::/0');
|
||||
$newRule['source_ips'] = array();
|
||||
} else {
|
||||
$newRule['source_ips'] = array('0.0.0.0/0', '::/0');
|
||||
$newRule['destination_ips'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
// Handle port - Hetzner expects port as a string
|
||||
if (!empty($params['port']) && $protocol !== 'icmp') {
|
||||
$newRule['port'] = strval($params['port']);
|
||||
}
|
||||
|
||||
// Add description if provided
|
||||
if (!empty($params['note'])) {
|
||||
$newRule['description'] = $params['note'];
|
||||
$rulesToAdd[] = $newRule;
|
||||
}
|
||||
|
||||
// Add the new rule to existing rules
|
||||
// Add the new rules to existing rules
|
||||
// Note: Hetzner only supports ACCEPT rules for inbound traffic
|
||||
// The default policy is DROP for non-matched traffic
|
||||
$existingRules[] = $newRule;
|
||||
foreach ($rulesToAdd as $ruleToAdd) {
|
||||
$existingRules[] = $ruleToAdd;
|
||||
}
|
||||
|
||||
// Update firewall with new rules
|
||||
$updateParams = $params;
|
||||
@@ -569,15 +648,21 @@ function ArkHostHetznerVPS_API(array $params) {
|
||||
|
||||
// Remove the rule with matching ID (we use index as ID)
|
||||
$ruleIdToDelete = $params['rule_id'];
|
||||
$index = 0;
|
||||
$inIndex = 0;
|
||||
$outIndex = 0;
|
||||
foreach ($existingRules as $rule) {
|
||||
if ($rule['direction'] === 'in') {
|
||||
if ('fw_' . $firewallId . '_' . $index != $ruleIdToDelete) {
|
||||
if ('fw_' . $firewallId . '_in_' . $inIndex != $ruleIdToDelete) {
|
||||
$newRules[] = $rule;
|
||||
}
|
||||
$index++;
|
||||
$inIndex++;
|
||||
} else if ($rule['direction'] === 'out') {
|
||||
if ('fw_' . $firewallId . '_out_' . $outIndex != $ruleIdToDelete) {
|
||||
$newRules[] = $rule;
|
||||
}
|
||||
$outIndex++;
|
||||
} else {
|
||||
// Keep outbound rules
|
||||
// Keep other rules
|
||||
$newRules[] = $rule;
|
||||
}
|
||||
}
|
||||
@@ -917,6 +1002,13 @@ function ArkHostHetznerVPS_ConfigOptions() {
|
||||
'Description' => 'Automatically create a floating IP when provisioning this server (additional cost - billed by Hetzner).',
|
||||
'Type' => 'yesno',
|
||||
),
|
||||
'cloud_init_yaml' => array(
|
||||
'FriendlyName' => 'Cloud-Init YAML (Optional)',
|
||||
'Description' => 'Custom cloud-init configuration in YAML format (max 32KiB). Passed as user_data to Hetzner API during server creation. Leave empty to skip cloud-init. <a href="https://docs.hetzner.cloud/#servers-create-a-server" target="_blank">Documentation</a>',
|
||||
'Type' => 'textarea',
|
||||
'Rows' => '10',
|
||||
'Cols' => '60',
|
||||
),
|
||||
);
|
||||
|
||||
try {
|
||||
@@ -1089,6 +1181,11 @@ function ArkHostHetznerVPS_CreateAccount(array $params) {
|
||||
Capsule::table('tblhosting')->where('id', $params['serviceid'])->update([
|
||||
'password' => encrypt($create['root_password'])
|
||||
]);
|
||||
|
||||
// Save the timestamp when password was set for expiration tracking (72 hours)
|
||||
$params['model']->serviceProperties->save([
|
||||
'ArkHostHetznerVPS|Password Set Time' => time()
|
||||
]);
|
||||
}
|
||||
|
||||
// Handle floating IP creation if requested via Configurable Options or Module Settings
|
||||
@@ -1745,17 +1842,27 @@ function ArkHostHetznerVPS_ClientAreaAPI(array $params) {
|
||||
$firewallResult = ArkHostHetznerVPS_API($firewallParams);
|
||||
|
||||
if (isset($firewallResult['firewall']['rules'])) {
|
||||
$inIndex = 0;
|
||||
$outIndex = 0;
|
||||
foreach ($firewallResult['firewall']['rules'] as $rule) {
|
||||
// Process inbound rules
|
||||
if ($rule['direction'] === 'in') {
|
||||
// Handle source IPs
|
||||
$sourceIps = '0.0.0.0/0'; // Default when no source IPs specified
|
||||
// Process both inbound and outbound rules
|
||||
if ($rule['direction'] === 'in' || $rule['direction'] === 'out') {
|
||||
// Handle IPs based on direction
|
||||
$ips = '0.0.0.0/0'; // Default when no IPs specified
|
||||
if ($rule['direction'] === 'out') {
|
||||
// For outbound rules, use destination_ips
|
||||
if (isset($rule['destination_ips']) && is_array($rule['destination_ips'])) {
|
||||
if (!empty($rule['destination_ips'])) {
|
||||
$ips = implode(', ', $rule['destination_ips']);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// For inbound rules, use source_ips
|
||||
if (isset($rule['source_ips']) && is_array($rule['source_ips'])) {
|
||||
if (!empty($rule['source_ips'])) {
|
||||
// Join multiple source IPs with comma
|
||||
$sourceIps = implode(', ', $rule['source_ips']);
|
||||
$ips = implode(', ', $rule['source_ips']);
|
||||
}
|
||||
}
|
||||
// If source_ips is empty array, it means all sources are allowed
|
||||
}
|
||||
|
||||
// Handle port range or single port
|
||||
@@ -1768,21 +1875,23 @@ function ArkHostHetznerVPS_ClientAreaAPI(array $params) {
|
||||
$port = 'Any';
|
||||
}
|
||||
|
||||
// Get description or use firewall name
|
||||
$description = '';
|
||||
if (isset($rule['description']) && !empty($rule['description'])) {
|
||||
$description = $rule['description'];
|
||||
// Generate ID based on direction and index
|
||||
$ruleId = 'fw_' . $firewallId . '_' . $rule['direction'] . '_';
|
||||
if ($rule['direction'] === 'in') {
|
||||
$ruleId .= $inIndex;
|
||||
$inIndex++;
|
||||
} else {
|
||||
$description = 'Firewall: ' . (isset($firewallResult['firewall']['name']) ? $firewallResult['firewall']['name'] : $firewallId);
|
||||
$ruleId .= $outIndex;
|
||||
$outIndex++;
|
||||
}
|
||||
|
||||
$rules[] = array(
|
||||
'id' => 'fw_' . $firewallId . '_' . count($rules),
|
||||
'id' => $ruleId,
|
||||
'direction' => $rule['direction'],
|
||||
'action' => 'ACCEPT',
|
||||
'protocol' => strtoupper($rule['protocol']),
|
||||
'port' => $port,
|
||||
'source' => $sourceIps,
|
||||
'note' => $description
|
||||
'source' => $ips
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1822,6 +1931,11 @@ function ArkHostHetznerVPS_ClientAreaAPI(array $params) {
|
||||
->where('id', $params['serviceid'])
|
||||
->update(['password' => encrypt($result['root_password'])]);
|
||||
|
||||
// Save the timestamp when password was set for expiration tracking (72 hours)
|
||||
$params['model']->serviceProperties->save([
|
||||
'ArkHostHetznerVPS|Password Set Time' => time()
|
||||
]);
|
||||
|
||||
$results['root_password'] = $result['root_password'];
|
||||
$results['message'] = 'Server rebuild initiated. New root password has been saved.';
|
||||
} else {
|
||||
@@ -1858,6 +1972,21 @@ function ArkHostHetznerVPS_ClientAreaAPI(array $params) {
|
||||
$results['result'] = 'error';
|
||||
$results['message'] = 'Invalid floating IP ID for this service';
|
||||
}
|
||||
} else if ($action === 'Reset root') {
|
||||
// Handle password reset from client area
|
||||
$results = array_merge($results, is_array($result) ? $result : array('data' => $result));
|
||||
|
||||
// Store the new root password and timestamp if provided
|
||||
if (isset($result['root_password'])) {
|
||||
Capsule::table('tblhosting')->where('id', $params['serviceid'])->update([
|
||||
'password' => encrypt($result['root_password'])
|
||||
]);
|
||||
|
||||
// Save the timestamp when password was set for expiration tracking (72 hours)
|
||||
$params['model']->serviceProperties->save([
|
||||
'ArkHostHetznerVPS|Password Set Time' => time()
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
$results = array_merge($results, is_array($result) ? $result : array('data' => $result));
|
||||
}
|
||||
@@ -2264,6 +2393,26 @@ function ArkHostHetznerVPS_ClientArea(array $params) {
|
||||
$serverInfo['datacenter'] = isset($serverInfo['datacenter']['description']) ? $serverInfo['datacenter']['description'] : 'N/A';
|
||||
$serverInfo['location'] = isset($serverInfo['datacenter']['location']['city']) ? $serverInfo['datacenter']['location']['city'] : 'N/A';
|
||||
|
||||
// Get root password with expiration check (72 hours)
|
||||
$passwordSetTime = $params['model']->serviceProperties->get('ArkHostHetznerVPS|Password Set Time');
|
||||
$currentTime = time();
|
||||
$expirationPeriod = 72 * 3600; // 72 hours in seconds
|
||||
|
||||
if (!empty($params['password']) && $params['password'] !== 'managed-via-api') {
|
||||
// If no timestamp exists, show the password (backward compatibility or initial setup)
|
||||
// If timestamp exists, check if it's within the 72-hour window
|
||||
if (!$passwordSetTime || ($currentTime - $passwordSetTime) < $expirationPeriod) {
|
||||
// Password is still valid - WHMCS already decrypts it for us in $params
|
||||
// No need to call decrypt() as $params['password'] is already plain text
|
||||
$serverInfo['install_root'] = $params['password'];
|
||||
} else {
|
||||
// Password has expired (timestamp exists and is older than 72 hours)
|
||||
$serverInfo['install_root'] = '';
|
||||
}
|
||||
} else {
|
||||
$serverInfo['install_root'] = '';
|
||||
}
|
||||
|
||||
// For now, always show backups tab - the API will handle permissions
|
||||
$backupsEnabled = true;
|
||||
|
||||
@@ -2359,6 +2508,11 @@ function ArkHostHetznerVPS_ResetRoot(array $params) {
|
||||
Capsule::table('tblhosting')->where('id', $params['serviceid'])->update([
|
||||
'password' => encrypt($result['root_password'])
|
||||
]);
|
||||
|
||||
// Save the timestamp when password was set for expiration tracking (72 hours)
|
||||
$params['model']->serviceProperties->save([
|
||||
'ArkHostHetznerVPS|Password Set Time' => time()
|
||||
]);
|
||||
}
|
||||
} catch (Exception $err) {
|
||||
ArkHostHetznerVPS_Error(__FUNCTION__, $params, $err);
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Herinstalleren';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Firewall';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'De regels worden van boven naar beneden geëvalueerd. Standaard is alles toegestaan. De firewall is alleen beschikbaar op de publieke interface. Alleen het inkomende verkeer wordt gefilterd door de firewall.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Actie';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Poort';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Protocol';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Bron';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Opmerking';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Acties';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Accepteren';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Weggooien';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Poortnummer';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'Bijv.: x.x.x.x/xx (optioneel)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Notities (optioneel)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'De regels moeten worden toegepast om effect te hebben.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Firewall toepassen';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Reddingsmodus';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ': ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Huidige Firewall Regels';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Firewall resources zijn gekoppeld aan servers. Als er geen firewall is gekoppeld, wordt er automatisch een aangemaakt wanneer u uw eerste regel toevoegt.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Richting';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Actie';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Protocol';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Poort';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Verwijderen';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'Firewall wijzigingen worden onmiddellijk toegepast. Het is niet nodig om wijzigingen door te voeren.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Nieuwe Firewall Regel toevoegen';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Regel beschrijving';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'ACCEPTEREN';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'WEGGOOIEN';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'INFO';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'ELKE';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'Inkomend';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'Uitgaand';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Richting';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'Herbouwen zal alle gegevens op de server vernietigen. Een nieuw root wachtwoord wordt gegenereerd en opgeslagen in uw service account.';
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Reinstall';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Firewall';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'The rules are evaluated from the top to the bottom. By default, everything is allowed. The firewall is only available on the public interface. Only the inbound traffic will be filtered by the firewall.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Action';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Port';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Protocol';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Source';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Note';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Actions';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Accept';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Drop';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Port Number';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'Ex: x.x.x.x/xx (optional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Notes (optional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'The rules must be committed in order to take effect.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Commit Firewall';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Rescue Mode';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ': ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Current Firewall Rules';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Firewall resources are attached to servers. If no firewall is attached, one will be created automatically when you add your first rule.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Direction';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Action';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Protocol';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Port';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Remove';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'Firewall changes are applied immediately. There is no need to commit changes.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Add New Firewall Rule';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Rule description';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '80 or 8080-8090';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0 or IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'ACCEPT';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'DROP';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'INFO';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'ANY';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'Incoming';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'Outgoing';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Direction';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'Rebuilding will destroy all data on the server. A new root password will be generated and saved to your service account.';
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Réinstaller';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Pare-feu';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'Les règles sont évaluées de haut en bas. Par défaut, tout est autorisé. Le pare-feu n\'est disponible que sur l\'interface publique. Seul le trafic entrant sera filtré par le pare-feu.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Action';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Port';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Protocole';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Source';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Note';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Actions';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Accepter';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Rejeter';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Numéro de Port';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'Ex : x.x.x.x/xx (optionnel)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Notes (optionnel)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'Les règles doivent être validées pour prendre effet.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Valider le Pare-feu';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Mode de Secours';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ' : ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Règles Actuelles du Pare-feu';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Les ressources de pare-feu sont attachées aux serveurs. Si aucun pare-feu n\'est attaché, un sera créé automatiquement lorsque vous ajouterez votre première règle.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Direction';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Action';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Protocole';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Port';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Supprimer';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'Les changements du pare-feu sont appliqués immédiatement. Il n\'y a pas besoin de valider les changements.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Ajouter une Nouvelle Règle de Pare-feu';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Description de la règle';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'ACCEPTER';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'REJETER';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'INFO';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'TOUT';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'Entrant';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'Sortant';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Direction';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'La reconstruction détruira toutes les données sur le serveur. Un nouveau mot de passe root sera généré et sauvegardé dans votre compte de service.';
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Neuinstallieren';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Firewall';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'Die Regeln werden von oben nach unten ausgewertet. Standardmäßig ist alles erlaubt. Die Firewall ist nur auf der öffentlichen Schnittstelle verfügbar. Nur der eingehende Traffic wird von der Firewall gefiltert.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Aktion';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Port';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Protokoll';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Quelle';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Hinweis';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Aktionen';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Akzeptieren';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Verwerfen';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Port-Nummer';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'z.B.: x.x.x.x/xx (optional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Hinweise (optional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'Die Regeln müssen übernommen werden, um wirksam zu werden.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Firewall übernehmen';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Rettungsmodus';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ': ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Aktuelle Firewall-Regeln';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Firewall-Ressourcen sind an Server angehängt. Wenn keine Firewall angehängt ist, wird automatisch eine erstellt, wenn Sie Ihre erste Regel hinzufügen.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Richtung';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Aktion';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Protokoll';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Port';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Entfernen';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'Firewall-Änderungen werden sofort angewendet. Es ist nicht notwendig, Änderungen zu übernehmen.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Neue Firewall-Regel hinzufügen';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Regelbeschreibung';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'AKZEPTIEREN';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'VERWERFEN';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'INFO';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'ALLE';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'Eingehend';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'Ausgehend';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Richtung';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'Die Neuinstallation wird alle Daten auf dem Server zerstören. Ein neues Root-Passwort wird generiert und in Ihrem Service-Konto gespeichert.';
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Reinstalla';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Firewall';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'Le regole vengono valutate dall\'alto verso il basso. Per impostazione predefinita, tutto è consentito. Il firewall è disponibile solo sull\'interfaccia pubblica. Solo il traffico in entrata verrà filtrato dal firewall.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Azione';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Porta';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Protocollo';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Sorgente';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Nota';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Azioni';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Accetta';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Rilascia';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Numero Porta';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'Es: x.x.x.x/xx (opzionale)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Note (opzionale)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'Le regole devono essere confermate per avere effetto.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Conferma Firewall';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Modalità di Recupero';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ': ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Regole Firewall Attuali';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Le risorse del firewall sono collegate ai server. Se nessun firewall è collegato, ne verrà creato automaticamente uno quando aggiungi la tua prima regola.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Direzione';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Azione';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Protocollo';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Porta';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Rimuovi';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'Le modifiche al firewall vengono applicate immediatamente. Non è necessario confermare le modifiche.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Aggiungi Nuova Regola Firewall';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Descrizione regola';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'ACCETTA';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'RILASCIA';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'INFO';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'QUALSIASI';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'In entrata';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'In uscita';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Direzione';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'La ricostruzione distruggerà tutti i dati sul server. Una nuova password root verrà generata e salvata nel tuo account di servizio.';
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Reinstalar';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Firewall';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'As regras são avaliadas de cima para baixo. Por defeito, tudo é permitido. A firewall está disponível apenas na interface pública. Apenas o tráfego de entrada será filtrado pela firewall.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Acção';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Porto';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Protocolo';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Origem';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Nota';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Acções';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Aceitar';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Descartar';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Número do Porto';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'Ex: x.x.x.x/xx (opcional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Notas (opcional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'As regras devem ser confirmadas para fazer efeito.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Confirmar Firewall';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Modo de Recuperação';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ': ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Regras de Firewall Actuais';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Os recursos de firewall estão anexados aos servidores. Se nenhuma firewall estiver anexada, uma será criada automaticamente quando adicionar a sua primeira regra.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Direção';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Ação';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Protocolo';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Porta';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Remover';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'As alterações da firewall são aplicadas imediatamente. Não há necessidade de confirmar alterações.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Adicionar Nova Regra de Firewall';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Descrição da regra';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'ACEITAR';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'DESCARTAR';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'INFO';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'QUALQUER';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'Entrada';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'Saída';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Direção';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'A reconstrução irá destruir todos os dados no servidor. Uma nova palavra-passe root será gerada e guardada na sua conta de serviço.';
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Переустановить';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Файервол';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'Правила оцениваются сверху вниз. По умолчанию все разрешено. Файервол доступен только на публичном интерфейсе. Файервол фильтрует только входящий трафик.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Действие';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Порт';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Протокол';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Источник';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Примечание';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Действия';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Принять';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Отбросить';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Номер порта';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'Например: x.x.x.x/xx (опционально)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Примечания (опционально)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'Правила должны быть применены, чтобы вступить в силу.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Применить файервол';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Режим восстановления';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ': ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Текущие правила файервола';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Ресурсы файервола прикреплены к серверам. Если файервол не прикреплен, он будет создан автоматически, когда вы добавите первое правило.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Направление';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Действие';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Протокол';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Порт';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Удалить';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'Изменения файервола применяются немедленно. Нет необходимости подтверждать изменения.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Добавить новое правило файервола';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Описание правила';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'ПРИНЯТЬ';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'ОТБРОСИТЬ';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'ИНФО';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'ЛЮБОЙ';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'Входящий';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'Исходящий';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Направление';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'Перестроение уничтожит все данные на сервере. Новый root пароль будет сгенерирован и сохранен в вашей учетной записи службы.';
|
||||
|
||||
@@ -149,20 +149,11 @@ $_ADDONLANG['Settings']['Reinstall']['Submit'] = 'Reinstalar';
|
||||
|
||||
### Firewall
|
||||
$_ADDONLANG['Settings']['Firewall']['Title'] = 'Firewall';
|
||||
$_ADDONLANG['Settings']['Firewall']['Description'] = 'Las reglas se evalúan de arriba hacia abajo. Por defecto, todo está permitido. El firewall solo está disponible en la interfaz pública. Solo el tráfico entrante será filtrado por el firewall.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Action'] = 'Acción';
|
||||
$_ADDONLANG['Settings']['Firewall']['Port'] = 'Puerto';
|
||||
$_ADDONLANG['Settings']['Firewall']['Protocol'] = 'Protocolo';
|
||||
$_ADDONLANG['Settings']['Firewall']['Source'] = 'Origen';
|
||||
$_ADDONLANG['Settings']['Firewall']['Note'] = 'Nota';
|
||||
$_ADDONLANG['Settings']['Firewall']['Actions'] = 'Acciones';
|
||||
$_ADDONLANG['Settings']['Firewall']['Accept'] = 'Aceptar';
|
||||
$_ADDONLANG['Settings']['Firewall']['Drop'] = 'Descartar';
|
||||
$_ADDONLANG['Settings']['Firewall']['PortNumber'] = 'Número de Puerto';
|
||||
$_ADDONLANG['Settings']['Firewall']['SourceLabel'] = 'Ej: x.x.x.x/xx (opcional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Notes'] = 'Notas (opcional)';
|
||||
$_ADDONLANG['Settings']['Firewall']['Warning'] = 'Las reglas deben ser confirmadas para tomar efecto.';
|
||||
$_ADDONLANG['Settings']['Firewall']['Submit'] = 'Confirmar Firewall';
|
||||
|
||||
### Rescue Mode
|
||||
$_ADDONLANG['Settings']['Rescue']['Title'] = 'Modo de Rescate';
|
||||
@@ -222,11 +213,16 @@ $_ADDONLANG['General']['Colon'] = ': ';
|
||||
## Firewall specific
|
||||
$_ADDONLANG['Firewall']['CurrentRules'] = 'Reglas Actuales del Firewall';
|
||||
$_ADDONLANG['Firewall']['ResourcesAttached'] = 'Los recursos del firewall están adjuntos a los servidores. Si no hay firewall adjunto, se creará uno automáticamente cuando agregues tu primera regla.';
|
||||
$_ADDONLANG['Firewall']['Direction'] = 'Dirección';
|
||||
$_ADDONLANG['Firewall']['Action'] = 'Acción';
|
||||
$_ADDONLANG['Firewall']['Protocol'] = 'Protocolo';
|
||||
$_ADDONLANG['Firewall']['Port'] = 'Puerto';
|
||||
$_ADDONLANG['Firewall']['IPCIDR'] = 'IP/CIDR';
|
||||
$_ADDONLANG['Firewall']['Remove'] = 'Eliminar';
|
||||
$_ADDONLANG['Firewall']['ChangesImmediate'] = 'Los cambios del firewall se aplican inmediatamente. No es necesario confirmar cambios.';
|
||||
$_ADDONLANG['Firewall']['AddNewRule'] = 'Agregar Nueva Regla del Firewall';
|
||||
$_ADDONLANG['Firewall']['PortPlaceholder'] = '1-65535';
|
||||
$_ADDONLANG['Firewall']['SourcePlaceholder'] = '0.0.0.0/0';
|
||||
$_ADDONLANG['Firewall']['DescriptionPlaceholder'] = 'Descripción de la regla';
|
||||
$_ADDONLANG['Firewall']['Accept'] = 'ACEPTAR';
|
||||
$_ADDONLANG['Firewall']['Drop'] = 'DESCARTAR';
|
||||
$_ADDONLANG['Firewall']['Info'] = 'INFO';
|
||||
@@ -234,6 +230,9 @@ $_ADDONLANG['Firewall']['Any'] = 'CUALQUIERA';
|
||||
$_ADDONLANG['Firewall']['TCP'] = 'TCP';
|
||||
$_ADDONLANG['Firewall']['UDP'] = 'UDP';
|
||||
$_ADDONLANG['Firewall']['ICMP'] = 'ICMP';
|
||||
$_ADDONLANG['Firewall']['Incoming'] = 'Entrante';
|
||||
$_ADDONLANG['Firewall']['Outgoing'] = 'Saliente';
|
||||
$_ADDONLANG['Settings']['Firewall']['Direction'] = 'Dirección';
|
||||
|
||||
## Reinstall specific
|
||||
$_ADDONLANG['Reinstall']['DestroyWarning'] = 'La reinstalación destruirá todos los datos en el servidor. Se generará una nueva contraseña root y se guardará en tu cuenta de servicio.';
|
||||
|
||||
@@ -676,6 +676,13 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<label class="small text-muted">{$ADDONLANG.Settings.Firewall.Direction}</label>
|
||||
<select class="form-control" id="firewallDirection">
|
||||
<option value="in" selected>{$ADDONLANG.Firewall.Incoming}</option>
|
||||
<option value="out">{$ADDONLANG.Firewall.Outgoing}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label class="small text-muted">{$ADDONLANG.Settings.Firewall.Action}</label>
|
||||
<select class="form-control" id="firewallAction">
|
||||
@@ -692,18 +699,14 @@
|
||||
<option value="ANY">{$ADDONLANG.Firewall.Any}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-3">
|
||||
<label class="small text-muted">{$ADDONLANG.Settings.Firewall.Port}</label>
|
||||
<input class="form-control" id="firewallPort" type="number" min="1" max="65535" placeholder="{$ADDONLANG.Firewall.PortPlaceholder}">
|
||||
<input class="form-control" id="firewallPort" type="text" placeholder="{$ADDONLANG.Firewall.PortPlaceholder}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="small text-muted">{$ADDONLANG.Settings.Firewall.Source}</label>
|
||||
<label class="small text-muted">IP/CIDR</label>
|
||||
<input class="form-control" id="firewallSource" type="text" placeholder="{$ADDONLANG.Firewall.SourcePlaceholder}">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="small text-muted">{$ADDONLANG.Settings.Firewall.Note}</label>
|
||||
<input class="form-control" id="firewallNote" type="text" maxlength="64" placeholder="{$ADDONLANG.Firewall.DescriptionPlaceholder}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right mt-3">
|
||||
<button class="btn btn-success" onclick="addFirewallRule();return false;">
|
||||
@@ -723,12 +726,12 @@
|
||||
<table id="firewallTable" class="table table-hover mb-0">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="100">Action</th>
|
||||
<th width="100">Protocol</th>
|
||||
<th width="100">Port</th>
|
||||
<th>Source</th>
|
||||
<th>Description</th>
|
||||
<th width="80" class="text-center">Remove</th>
|
||||
<th width="80">{$ADDONLANG.Firewall.Direction}</th>
|
||||
<th width="100">{$ADDONLANG.Firewall.Action}</th>
|
||||
<th width="100">{$ADDONLANG.Firewall.Protocol}</th>
|
||||
<th width="100">{$ADDONLANG.Firewall.Port}</th>
|
||||
<th>{$ADDONLANG.Firewall.IPCIDR}</th>
|
||||
<th width="80" class="text-center">{$ADDONLANG.Firewall.Remove}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -224,6 +224,12 @@ function resetRootPassword() {
|
||||
function() {
|
||||
ArkHostHetznerVPS_API('Reset root', true, {}, function(data) {
|
||||
if (data.root_password) {
|
||||
// Update the password field on the page
|
||||
var passwordField = document.getElementById('vpsPassword');
|
||||
if (passwordField) {
|
||||
passwordField.value = data.root_password;
|
||||
}
|
||||
|
||||
// Show password in a special modal or notification
|
||||
var passwordHtml = '<div class="alert alert-success">' +
|
||||
'<h5>' + lang.newRootPassword + '</h5>' +
|
||||
@@ -426,11 +432,11 @@ function ArkHostHetznerVPS_API(action, showAlert, params, callback, errorCallbac
|
||||
}
|
||||
if (action === 'Add Firewall rules') {
|
||||
// Clear the form
|
||||
document.getElementById('firewallDirection').value = 'in';
|
||||
document.getElementById('firewallAction').value = 'ACCEPT';
|
||||
document.getElementById('firewallPort').value = '';
|
||||
document.getElementById('firewallProtocol').value = 'ANY';
|
||||
document.getElementById('firewallSource').value = '';
|
||||
document.getElementById('firewallNote').value = '';
|
||||
|
||||
// Refresh firewall rules after adding
|
||||
setTimeout(function() {
|
||||
@@ -629,13 +635,21 @@ function updateFirewallTable(data) {
|
||||
|
||||
var protocolBadge = '<span class="badge badge-secondary">' + (rule.protocol || lang.firewall.any) + '</span>';
|
||||
|
||||
// Direction badge
|
||||
var directionBadge = '';
|
||||
if (rule.direction === 'out') {
|
||||
directionBadge = '<span class="badge badge-warning"><i class="fa fa-arrow-up mr-1"></i>' + (lang.firewall.outgoing || 'OUT') + '</span>';
|
||||
} else {
|
||||
directionBadge = '<span class="badge badge-info"><i class="fa fa-arrow-down mr-1"></i>' + (lang.firewall.incoming || 'IN') + '</span>';
|
||||
}
|
||||
|
||||
var row = document.createElement('tr');
|
||||
row.innerHTML =
|
||||
'<td>' + directionBadge + '</td>' +
|
||||
'<td>' + actionBadge + '</td>' +
|
||||
'<td>' + protocolBadge + '</td>' +
|
||||
'<td>' + (rule.port || '<span class="text-muted">' + lang.general.any + '</span>') + '</td>' +
|
||||
'<td><code>' + (rule.source || '0.0.0.0/0') + '</code></td>' +
|
||||
'<td>' + (rule.note || '<span class="text-muted">' + lang.general.emptyValue + '</span>') + '</td>' +
|
||||
'<td class="text-center">' +
|
||||
(rule.id !== 'info' ?
|
||||
'<button class="btn btn-sm btn-danger" onclick="deleteFirewallRule(\'' + rule.id + '\'); return false;" title="' + lang.delete + '">' +
|
||||
@@ -652,25 +666,58 @@ function updateFirewallTable(data) {
|
||||
}
|
||||
|
||||
function addFirewallRule() {
|
||||
var direction = document.getElementById('firewallDirection').value;
|
||||
var action = document.getElementById('firewallAction').value;
|
||||
var protocol = document.getElementById('firewallProtocol').value;
|
||||
var port = document.getElementById('firewallPort').value;
|
||||
var source = document.getElementById('firewallSource').value || '0.0.0.0/0';
|
||||
var note = document.getElementById('firewallNote').value;
|
||||
|
||||
// Validate port for TCP/UDP
|
||||
if ((protocol === 'TCP' || protocol === 'UDP') && !port) {
|
||||
if ((protocol === 'TCP' || protocol === 'UDP' || protocol === 'ANY') && !port) {
|
||||
showNotification(lang.messages.portRequired, 'error');
|
||||
document.getElementById('firewallPort').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validate port format (single port or range)
|
||||
if (port) {
|
||||
// Check if it's a range (e.g., "8080-8090")
|
||||
if (port.includes('-')) {
|
||||
var parts = port.split('-');
|
||||
if (parts.length !== 2) {
|
||||
showNotification('Invalid port range format. Use format: 8080-8090', 'error');
|
||||
document.getElementById('firewallPort').focus();
|
||||
return false;
|
||||
}
|
||||
var startPort = parseInt(parts[0]);
|
||||
var endPort = parseInt(parts[1]);
|
||||
if (isNaN(startPort) || isNaN(endPort) || startPort < 1 || startPort > 65535 || endPort < 1 || endPort > 65535) {
|
||||
showNotification('Port range values must be between 1 and 65535', 'error');
|
||||
document.getElementById('firewallPort').focus();
|
||||
return false;
|
||||
}
|
||||
if (startPort >= endPort) {
|
||||
showNotification('Start port must be less than end port', 'error');
|
||||
document.getElementById('firewallPort').focus();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// Single port
|
||||
var portNum = parseInt(port);
|
||||
if (isNaN(portNum) || portNum < 1 || portNum > 65535) {
|
||||
showNotification('Port must be between 1 and 65535', 'error');
|
||||
document.getElementById('firewallPort').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArkHostHetznerVPS_API('Add Firewall rules', true, {
|
||||
direction: direction,
|
||||
firewallAction: action,
|
||||
protocol: protocol,
|
||||
source: source,
|
||||
port: port,
|
||||
note: note
|
||||
port: port
|
||||
});
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user