mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat(provider): Implement AutoDNS
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {Button, Checkbox, Form, FormInstance, Input, Popconfirm, Select, Space, Typography} from "antd";
|
||||
import {Alert, Button, Checkbox, Form, FormInstance, Input, Popconfirm, Select, Space, Typography } from "antd";
|
||||
import React, {useState} from "react";
|
||||
import {Connector, ConnectorProvider} from "../../../utils/api/connectors";
|
||||
import {t} from "ttag";
|
||||
@@ -132,6 +132,68 @@ export function ConnectorForm({form, onCreate}: { form: FormInstance, onCreate:
|
||||
</Form.Item>
|
||||
</>
|
||||
}
|
||||
{
|
||||
provider === ConnectorProvider.AUTODNS && <>
|
||||
<Alert message={t`Because of some limitations in API of AutoDNS, we suggest to create an dedicated user for API with limited rights.`} type="info" />
|
||||
<br />
|
||||
<Form.Item
|
||||
label={t`AutoDNS Username`}
|
||||
name={['authData', 'username']}
|
||||
help={<Typography.Text
|
||||
type='secondary'>{t`Attention: AutoDNS do not support 2-Factor Authentication on API Users for automated systems`}</Typography.Text>}
|
||||
rules={[{required: true, message: t`Required`}]}>
|
||||
<Input autoComplete='off' required={true}/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t`AutoDNS Password`}
|
||||
name={['authData', 'password']}
|
||||
rules={[{required: true, message: t`Required`}]}
|
||||
required={true}>
|
||||
<Input.Password autoComplete='off' required={true} placeholder=''/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t`Domain Contact Handle ID`}
|
||||
name={['authData', 'contactid']}
|
||||
help={<Typography.Text
|
||||
type='secondary'>{t`The Contact ID for ownership of registered Domains. `}<a href="https://cloud.autodns.com/contacts/domain">{t`You got from this page`}</a></Typography.Text>}
|
||||
rules={[{required: true, message: t`Required`}]}
|
||||
required={true}>
|
||||
<Input autoComplete='off' required={true} placeholder=''/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t`Context Value`}
|
||||
name={['authData', 'context']}
|
||||
help={<Typography.Text
|
||||
type='secondary'>{t`If you not sure, use the default value 4`}</Typography.Text>}
|
||||
|
||||
required={false}>
|
||||
<Input autoComplete='off' required={false} placeholder='4' />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t`DNS Entry for Domain`}
|
||||
name={['authData', 'dns_ip']}
|
||||
help={<Typography.Text
|
||||
type='secondary'>{t`It is required, that a domain, which should registerd, is available in DNS`}</Typography.Text>}
|
||||
|
||||
required={false}>
|
||||
<Input autoComplete='off' required={false} placeholder='4' />
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item
|
||||
valuePropName="checked"
|
||||
label={t`Owner confirmation`}
|
||||
name={['authData', 'ownerConfirm']}
|
||||
|
||||
rules={[{required: true, message: t`Required`}]}
|
||||
>
|
||||
<Checkbox
|
||||
required={true}>{t`Owner confirms his consent of domain order jobs`}</Checkbox>
|
||||
</Form.Item>
|
||||
|
||||
</>
|
||||
}
|
||||
|
||||
{
|
||||
provider !== undefined && <>
|
||||
|
||||
@@ -2,7 +2,8 @@ import {request} from "./index";
|
||||
|
||||
export enum ConnectorProvider {
|
||||
OVH = 'ovh',
|
||||
GANDI = 'gandi'
|
||||
GANDI = 'gandi',
|
||||
AUTODNS = 'autodns',
|
||||
}
|
||||
|
||||
export type Connector = {
|
||||
|
||||
@@ -15,6 +15,7 @@ export const helpGetTokenLink = (provider?: string) => {
|
||||
return <Typography.Link target='_blank' href="https://admin.gandi.net/organizations/account/pat">
|
||||
{t`Retrieve a Personal Access Token from your customer account on the Provider's website`}
|
||||
</Typography.Link>
|
||||
|
||||
default:
|
||||
return <></>
|
||||
|
||||
@@ -27,6 +28,8 @@ export const tosHyperlink = (provider?: string) => {
|
||||
return 'https://www.ovhcloud.com/fr/terms-and-conditions/contracts/'
|
||||
case ConnectorProvider.GANDI:
|
||||
return 'https://www.gandi.net/en/contracts/terms-of-service'
|
||||
case ConnectorProvider.AUTODNS:
|
||||
return 'https://www.internetx.com/agb/'
|
||||
default:
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Config;
|
||||
|
||||
use App\Config\Provider\AutodnsProvider;
|
||||
use App\Config\Provider\GandiProvider;
|
||||
use App\Config\Provider\OvhProvider;
|
||||
|
||||
@@ -9,12 +10,14 @@ enum ConnectorProvider: string
|
||||
{
|
||||
case OVH = 'ovh';
|
||||
case GANDI = 'gandi';
|
||||
case AUTODNS = 'autodns';
|
||||
|
||||
public function getConnectorProvider(): string
|
||||
{
|
||||
return match ($this) {
|
||||
ConnectorProvider::OVH => OvhProvider::class,
|
||||
ConnectorProvider::GANDI => GandiProvider::class
|
||||
ConnectorProvider::GANDI => GandiProvider::class,
|
||||
ConnectorProvider::AUTODNS => AutodnsProvider::class,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
1347
src/Config/Provider/AutodnsProvider.php
Normal file
1347
src/Config/Provider/AutodnsProvider.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user