Giter Site home page Giter Site logo

cloudflare-ddns.php's People

Contributors

davtur19 avatar peppelg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cloudflare-ddns.php's Issues

sto codice fa :shit:

mancanza di uso delle env var

define('CLOUDFLARE_API_KEY', 'Your cloudflare api key');
define('CLOUDFLARE_EMAIL', 'Your cloudflare email');
define('DOMAIN', 'example.com');
define('CLOUDFLARE_RECORD', 'AArecord.example.com');
define('CLOUDFLARE_RECORD_PROXIED', true);
define('CHECK_SECONDS', 120);

non usi classi

echo 'Cloudflare API Key: ' . CLOUDFLARE_API_KEY . PHP_EOL . 'Cloudflare email: ' . CLOUDFLARE_EMAIL . PHP_EOL . 'Domain: ' . DOMAIN . PHP_EOL . 'Record: ' . CLOUDFLARE_RECORD . PHP_EOL . 'Check every ' . CHECK_SECONDS . ' seconds.' . PHP_EOL . 'Status: ';

hardcodi l'hostname delle api

curl_setopt($ch, CURLOPT_URL, 'https://api.cloudflare.com/client/v4/zones?name=' . urlencode(DOMAIN));

'https://api.cloudflare.com/client/v4/zones/' . CLOUDFLARE_ID . '/dns_records?type=A&name=' . urlencode(CLOUDFLARE_RECORD));

define messi fuori il top level

define('CLOUDFLARE_RECORD_ID', $result['result'][0]['id']);

uso di servizi di terze parti per avere l'ippi

$ip = file_get_contents('https://ipv4.myip.info/');

mancaza di uso delle exception

die('Error.' . PHP_EOL);

die('Record not found.' . PHP_EOL);

print di roba che dovrebbe essere secreta (potrebbe finire tra i log del supervisor)

echo 'Cloudflare API Key: ' . CLOUDFLARE_API_KEY . PHP_EOL . 'Cloudflare email: ' . CLOUDFLARE_EMAIL . PHP_EOL . 'Domain: ' . DOMAIN . PHP_EOL . 'Record: ' . CLOUDFLARE_RECORD . PHP_EOL . 'Check every ' . CHECK_SECONDS . ' seconds.' . PHP_EOL . 'Status: ';

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.