Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs Site] Add product statics back #16114

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13,828 changes: 13,828 additions & 0 deletions public/analytics/static/downloads/main.css

Large diffs are not rendered by default.

480 changes: 480 additions & 0 deletions public/calls/static/calls-api-2024-05-21.yaml

Large diffs are not rendered by default.

Binary file added public/cloudflare-one/static/Cloudflare_CA.crt
Binary file not shown.
18 changes: 18 additions & 0 deletions public/cloudflare-one/static/Cloudflare_CA.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIC6zCCAkygAwIBAgIUI7b68p0pPrCBoW4ptlyvVcPItscwCgYIKoZIzj0EAwQw
gY0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMRgwFgYDVQQKEw9DbG91ZGZsYXJlLCBJbmMxNzA1BgNVBAMT
LkNsb3VkZmxhcmUgZm9yIFRlYW1zIEVDQyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw
HhcNMjAwMjA0MTYwNTAwWhcNMjUwMjAyMTYwNTAwWjCBjTELMAkGA1UEBhMCVVMx
EzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xGDAW
BgNVBAoTD0Nsb3VkZmxhcmUsIEluYzE3MDUGA1UEAxMuQ2xvdWRmbGFyZSBmb3Ig
VGVhbXMgRUNDIENlcnRpZmljYXRlIEF1dGhvcml0eTCBmzAQBgcqhkjOPQIBBgUr
gQQAIwOBhgAEAVdXsX8tpA9NAQeEQalvUIcVaFNDvGsR69ysZxOraRWNGHLfq1mi
P6o3wtmtx/C2OXG01Cw7UFJbKl5MEDxnT2KoAdFSynSJOF2NDoe5LoZHbUW+yR3X
FDl+MF6JzZ590VLGo6dPBf06UsXbH7PvHH2XKtFt8bBXVNMa5a21RdmpD0Pho0Uw
QzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBAjAdBgNVHQ4EFgQU
YBcQng1AEMMNteuRDAMG0/vgFe0wCgYIKoZIzj0EAwQDgYwAMIGIAkIBQU5OTA2h
YqmFk8paan5ezHVLcmcucsfYw4L/wmeEjCkczRmCVNm6L86LjhWU0v0wER0e+lHO
3efvjbsu8gIGSagCQgEBnyYMP9gwg8l96QnQ1khFA1ljFlnqc2XgJHDSaAJC0gdz
+NV3JMeWaD2Rb32jc9r6/a7xY0u0ByqxBQ1OQ0dt7A==
-----END CERTIFICATE-----
176 changes: 176 additions & 0 deletions public/cloudflare-one/static/authenticated-doh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
#!/usr/bin/env python3

import os
import subprocess
import json
import time
from pprint import pprint

verbose = os.environ.get('VERBOSE', False)


def check_for_command(command):
try:
subprocess.check_output(["command", "-v", command])
except:
print(
f"Couldn't find required {command} command.")
exit(1)


check_for_command("jq")
check_for_command("curl")


def read_string_option(env_name, human_name):
v = os.environ.get(env_name, '')
if len(v) == 0:
v = input(f"Please input {human_name} > ")
if len(v) == 0:
print("Invalid {human_name}")
return read_string_option(env_name, human_name)
return v


def request_create_user(user_name, user_email):
url = f"{CF_API}/{account_tag}/access/users"
# could also take a `custom` attribute with a map, e.g. {"custom": { "datacenter": "DFW" }}
body = {'name': user_name, 'email': user_email}
return request_post(url, body)


def request_list_client_ids():
client_ids_response = request_get(
f"{CF_API}/{account_tag}/access/service_tokens/")

return " ".join(response['client_id'] for response in client_ids_response['result'])


def request_create_service_token(service_token_name):
response = request_post(
f"{CF_API}/{account_tag}/access/service_tokens/", {'name': service_token_name})
client_id = response['result']['client_id']
client_secret = response['result']['client_secret']
return (client_id, client_secret)


def request_list_service_tokens():
return request_get(f"{CF_API}/{account_tag}/access/service_tokens/")


def request_enable_service_token_for_doh(service_token_id):
url = f"{CF_API}/{account_tag}/access/organizations/doh/{service_token_id}"
return request_put(url,"")


def request_doh_token(account_tag, user_id, client_id, client_secret):
url = f"https://{team_name}.cloudflareaccess.com/cdn-cgi/access/doh-token?account-id={account_tag}&user-id={user_id}&auth-domain={team_name}.cloudflareaccess.com"
command = ['curl', '-s', url, '-X', 'GET',
'-H', f"Cf-Access-Client-Id: {client_id}",
'-H', f"Cf-Access-Client-Secret: {client_secret}"]
if verbose:
print(f"Issuing request {' '.join(command)}")
response = json.loads(subprocess.check_output(command))
if verbose:
print("Got response:")
pprint(response)
return response['token']


def request_post(url, body):
return request("POST", url, body)

def request_put(url, body):
return request("PUT", url, body)

def request_get(url):
return request("GET", url, None)


def request(method, url, body):
command = ['curl', '-s', url, '-X', method, '-H', f"X-Auth-Email: {email}", '-H',
f"X-Auth-Key: {auth_key}", '-H', 'Content-Type: application/json']
if body:
command.append('--data')
command.append(json.dumps(body))
if verbose:
print(f"Issuing request {' '.join(command)}")
response = json.loads(subprocess.check_output(command))
if 'errors' in response and len(response['errors']) > 0:
pprint(response)
exit(-1)
if verbose:
print("Got response:")
pprint(response)
return response


account_tag = read_string_option('CF_ACCOUNT_TAG', "account tag")
email = read_string_option('CF_EMAIL', "auth email")
auth_key = read_string_option('CF_AUTH_KEY', "auth key")
team_name = read_string_option('CF_TEAM_NAME', "team name")

print(f"Using {account_tag} as account tag")
print(f"Using {email} as auth email")
print(f"Using {team_name} as team name")

CF_API = "https://api.cloudflare.com/client/v4/accounts"

user_id = os.environ.get('USER_ID', "")

if len(user_id) == 0:
print("No USER_ID provided, creating one.")
user_name = input('Please input a user name > ')
user_email = input('Please input a user email > ')
response = request_create_user(user_name, user_email)
user_id = response['result']['id']
user_email = print(f"Created user with ID {user_id}")
else:
print(f"Using USER_ID={user_id}")

client_ids = request_list_client_ids()

client_id = os.environ.get('CLIENT_ID', "")

if len(client_id) == 0:
print(f"Found following client IDs: {client_ids}")
client_id = input(
'Please input service token client ID ("new" to create a new one)> ')

if len(client_id) != 0 and client_id != "new" and client_id not in client_ids:
print("Client ID not found in account")
exit(-1)

client_secret = ""
if client_id == "new":
service_token_name = input('Please input name for service token > ')
client_id, client_secret = request_create_service_token(service_token_name)
print(
f"Created service token with client_id {client_id} and client_secret {client_secret}. You may want to save these secrets.")


if len(client_secret) == 0:
client_secret = read_string_option('CLIENT_SECRET', "client secret")

service_tokens_response = request_list_service_tokens()

service_token_id = [result['id']
for result in service_tokens_response['result'] if result['client_id'] == client_id][0]


print("Enabling DoH token generation for service token")
request_enable_service_token_for_doh(service_token_id)

print("Obtaining new DoH token (this request may fail if the previous ones haven't propagated yet)")
try:
doh_token = request_doh_token(account_tag, user_id, client_id, client_secret)
except json.decoder.JSONDecodeError:
print("Request failed, waiting for 60 seconds before retrying")
time.sleep(60)
doh_token = request_doh_token(account_tag, user_id, client_id, client_secret)
print(f"\n\nGot token: {doh_token}\n")

print("You can now make doh requests such as:\n"
f"curl 'https://{account_tag}.cloudflare-gateway.com/dns-query?name=example.com' \\\n"
" -H 'accept: application/dns-json' \\\n"
f" -H 'CF-Authorization: {doh_token}' | jq")
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIC6zCCAkygAwIBAgIUI7b68p0pPrCBoW4ptlyvVcPItscwCgYIKoZIzj0EAwQw
gY0xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1T
YW4gRnJhbmNpc2NvMRgwFgYDVQQKEw9DbG91ZGZsYXJlLCBJbmMxNzA1BgNVBAMT
LkNsb3VkZmxhcmUgZm9yIFRlYW1zIEVDQyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw
HhcNMjAwMjA0MTYwNTAwWhcNMjUwMjAyMTYwNTAwWjCBjTELMAkGA1UEBhMCVVMx
EzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xGDAW
BgNVBAoTD0Nsb3VkZmxhcmUsIEluYzE3MDUGA1UEAxMuQ2xvdWRmbGFyZSBmb3Ig
VGVhbXMgRUNDIENlcnRpZmljYXRlIEF1dGhvcml0eTCBmzAQBgcqhkjOPQIBBgUr
gQQAIwOBhgAEAVdXsX8tpA9NAQeEQalvUIcVaFNDvGsR69ysZxOraRWNGHLfq1mi
P6o3wtmtx/C2OXG01Cw7UFJbKl5MEDxnT2KoAdFSynSJOF2NDoe5LoZHbUW+yR3X
FDl+MF6JzZ590VLGo6dPBf06UsXbH7PvHH2XKtFt8bBXVNMa5a21RdmpD0Pho0Uw
QzAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBAjAdBgNVHQ4EFgQU
YBcQng1AEMMNteuRDAMG0/vgFe0wCgYIKoZIzj0EAwQDgYwAMIGIAkIBQU5OTA2h
YqmFk8paan5ezHVLcmcucsfYw4L/wmeEjCkczRmCVNm6L86LjhWU0v0wER0e+lHO
3efvjbsu8gIGSagCQgEBnyYMP9gwg8l96QnQ1khFA1ljFlnqc2XgJHDSaAJC0gdz
+NV3JMeWaD2Rb32jc9r6/a7xY0u0ByqxBQ1OQ0dt7A==
-----END CERTIFICATE-----
2 changes: 2 additions & 0 deletions public/cloudflare-one/static/list-test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://example.com
https://example1.com
45 changes: 45 additions & 0 deletions public/cloudflare-one/static/mdm/CloudflareWARP.mobileconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadDisplayName</key>
<string>Cloudflare WARP</string>
<key>PayloadIdentifier</key>
<string>cloudflare_warp</string>
<key>PayloadOrganization</key>
<string>Cloudflare, Ltd.</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadUUID</key>
<string>F5046847-2B1C-4DA0-A872-F6E040B1B20E</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>PayloadContent</key>
<array>
<dict>
<key>organization</key>
<string>your-team-name</string>
<key>auto_connect</key>
<integer>120</integer>
<key>onboarding</key>
<false/>
<key>PayloadDisplayName</key>
<string>Warp Configuration</string>
<key>PayloadIdentifier</key>
<string>com.cloudflare.warp.5A31FA24-FF8C-41EA-989E-F070820F2A80</string>
<key>PayloadOrganization</key>
<string>Cloudflare Ltd.</string>
<key>PayloadType</key>
<string>com.cloudflare.warp</string>
<key>PayloadUUID</key>
<string>5A31FA24-FF8C-41EA-989E-F070820F2A80</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
</dict>
</plist>
19 changes: 19 additions & 0 deletions public/cloudflare-one/static/mdm/com.cloudflare.warp.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>configs</key>
<array>
<dict>
<key>organization</key>
<string>your-team-name</string>
<key>display_name</key>
<string>Company Name</string>
<key>auto_connect</key>
<integer>120</integer>
<key>onboarding</key>
<false/>
</dict>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Warp Configuration</string>
<key>PayloadIdentifier</key>
<string>com.cloudflare.warp.CB8B22D4-50E1-48E8-8874-A7594627013A</string>
<key>PayloadOrganization</key>
<string>Cloudflare Ltd.</string>
<key>PayloadType</key>
<string>com.cloudflare.warp</string>
<key>PayloadUUID</key>
<string>CB8B22D4-50E1-48E8-8874-A7594627013A</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>configs</key>
<array>
<dict>
<key>organization</key>
<string>mycompany</string>
<key>display_name</key>
<string>Production environment</string>
</dict>
<dict>
<key>organization</key>
<string>mycompany</string>
<key>override_api_endpoint</key>
<string>203.0.113.0</string>
<key>override_doh_endpoint</key>
<string>203.0.113.0</string>
<key>override_warp_endpoint</key>
<string>203.0.113.0:2408</string>
<key>display_name</key>
<string>Cloudflare China network</string>
</dict>
<dict>
<key>organization</key>
<string>test-org</string>
<key>display_name</key>
<string>Test environment</string>
</dict>
</array>
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Cloudflare WARP</string>
<key>PayloadIdentifier</key>
<string>cloudflare_warp</string>
<key>PayloadOrganization</key>
<string>Cloudflare, Ltd.</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>2B7763B8-64F6-41EB-AA5E-7761651B8131</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>configs</key>
<array>
<dict>
<key>organization</key>
<string>mycompany</string>
<key>display_name</key>
<string>Production environment</string>
</dict>
<dict>
<key>organization</key>
<string>mycompany</string>
<key>override_api_endpoint</key>
<string>203.0.113.0</string>
<key>override_doh_endpoint</key>
<string>203.0.113.0</string>
<key>override_warp_endpoint</key>
<string>203.0.113.0:2408</string>
<key>display_name</key>
<string>Cloudflare China network</string>
</dict>
<dict>
<key>organization</key>
<string>test-org</string>
<key>display_name</key>
<string>Test environment</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Loading
Loading