white with the /go/white Command

/go/white makes sure a trusted IP address is never blocked. In one run it: Run it with no argument to whitelist the server's own public IP. This is useful so the server can fetch its own pages with curl and read file content without being challenged by Cloudflare. Pass an IP to whitelist an office, a monitoring service, or your own connection. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Whitelist this server's own public IP
/go/white

# Whitelist a specific IP
/go/white 203.0.113.10

Arguments

Argument Required Default Notes
ip No This server’s public IPv4 address Only the first argument is used. See IP handling.

There are no -- options.

Prerequisites

Requirement Where it comes from
Cloudflare account ID CloudflareAccountID in the Config table of /var/lib/sqlite/config.db
Cloudflare API token CloudflareAPIToken in the same table. It needs permission to read zones and edit firewall access rules.
Domains in Cloudflare Each domain’s zone must exist in that Cloudflare account.
Internet access Needed to detect the server IP and to call the Cloudflare API.

Examples

# Allow the server itself (so it can curl its own sites through Cloudflare)
/go/white

# Allow an office IP on all domains
/go/white 198.51.100.25

# Re-apply an IP that is already in the whitelist file:
# remove its line first, then run the command again
sed -i '/^203.0.113.10$/d' /var/go/etc/white
/go/white 203.0.113.10

# Check what was run and when
tail /var/log/go/white.log

Output

The command prints one progress line per domain, followed by the raw JSON that Cloudflare returns for the rule.

[1/3] Allow 203.0.113.10 for example.com...
{"result":{"id":"...","mode":"whitelist","configuration":{"target":"ip","value":"203.0.113.10"},"notes":"Allow Server IP",...},"success":true,...}

[2/3] blog.example.com (Subdomain)...
[3/3] Cannot Get Zone ID for example.net...

Message Meaning
[N/C] Allow <ip> for <domain>... The Cloudflare rule is being created. The JSON that follows shows whether it worked ("success": true).
[N/C] <domain> (Subdomain)... The domain was recognized as a subdomain and skipped.
[N/C] Cannot Get Zone ID for <domain>... Cloudflare returned no zone for this domain. See Troubleshooting.
IP <ip> found The IP is already in the whitelist file. The command exits with status 1 and does nothing else.

[!NOTE]
C counts every folder in /home whose name contains a dot, but N only advances for root domains. The counter can therefore stop below C. This is cosmetic.

See the full reference at /go/white and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *