[manual] Change API URLs to be based on api.humbughq.com/api.
This must be deployed after we update our running nginx configuration to serve api.humbughq.com. (imported from commit b5c34ebdd595f55eecd6dca6a18a37f105107bd5)
This commit is contained in:
parent
360d78e9a2
commit
5e2979b870
|
@ -15,7 +15,7 @@ parser.add_option('--verbose',
|
||||||
action='store_true')
|
action='store_true')
|
||||||
parser.add_option('--site',
|
parser.add_option('--site',
|
||||||
dest='site',
|
dest='site',
|
||||||
default="https://humbughq.com",
|
default="https://api.humbughq.com",
|
||||||
action='store')
|
action='store')
|
||||||
parser.add_option('--sharded',
|
parser.add_option('--sharded',
|
||||||
default=False,
|
default=False,
|
||||||
|
|
|
@ -36,12 +36,12 @@ prod_client = humbug.Client(
|
||||||
email="feedback@humbughq.com",
|
email="feedback@humbughq.com",
|
||||||
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||||
verbose=True,
|
verbose=True,
|
||||||
site="https://humbughq.com")
|
site="https://api.humbughq.com")
|
||||||
staging_client = humbug.Client(
|
staging_client = humbug.Client(
|
||||||
email="feedback@humbughq.com",
|
email="feedback@humbughq.com",
|
||||||
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
||||||
verbose=True,
|
verbose=True,
|
||||||
site="https://staging.humbughq.com")
|
site="https://staging.humbughq.com/api")
|
||||||
|
|
||||||
def forward_message(message):
|
def forward_message(message):
|
||||||
if message["type"] != "private" or len(message["display_recipient"]) != 2:
|
if message["type"] != "private" or len(message["display_recipient"]) != 2:
|
||||||
|
|
|
@ -70,7 +70,7 @@ class RandomExponentialBackoff(CountingBackoff):
|
||||||
print message
|
print message
|
||||||
time.sleep(delay)
|
time.sleep(delay)
|
||||||
|
|
||||||
DEFAULT_SITE = "https://humbughq.com"
|
DEFAULT_SITE = "https://api.humbughq.com"
|
||||||
|
|
||||||
class States:
|
class States:
|
||||||
Startup, HumbugToZephyr, ZephyrToHumbug, ChildSending = range(4)
|
Startup, HumbugToZephyr, ZephyrToHumbug, ChildSending = range(4)
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Two quick API tests using curl
|
# Two quick API tests using curl
|
||||||
|
|
||||||
curl https://humbughq.com/api/v1/send_message \
|
curl https://api.humbughq.com/v1/send_message \
|
||||||
-d "api-key=BOT_API_KEY" \
|
-d "api-key=BOT_API_KEY" \
|
||||||
-d "email=BOT_EMAIL" \
|
-d "email=BOT_EMAIL" \
|
||||||
-d "type=private" -d "content=test" \
|
-d "type=private" -d "content=test" \
|
||||||
-d "to=RECIPIENT_EMAIL"
|
-d "to=RECIPIENT_EMAIL"
|
||||||
|
|
||||||
curl https://humbughq.com/api/v1/get_messages \
|
curl https://api.humbughq.com/v1/get_messages \
|
||||||
-d "api-key=BOT_API_KEY" \
|
-d "api-key=BOT_API_KEY" \
|
||||||
-d "email=BOT_EMAIL"
|
-d "email=BOT_EMAIL"
|
||||||
|
|
||||||
# Or replace https://humbughq.com with your local test instance
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ assert(LooseVersion(requests.__version__) >= LooseVersion('0.12.1'))
|
||||||
# In newer versions, the 'json' attribute is a function, not a property
|
# In newer versions, the 'json' attribute is a function, not a property
|
||||||
requests_json_is_function = callable(requests.Response.json)
|
requests_json_is_function = callable(requests.Response.json)
|
||||||
|
|
||||||
API_VERSTRING = "/api/v1/"
|
API_VERSTRING = "/v1/"
|
||||||
|
|
||||||
def generate_option_group(parser):
|
def generate_option_group(parser):
|
||||||
group = optparse.OptionGroup(parser, 'API configuration')
|
group = optparse.OptionGroup(parser, 'API configuration')
|
||||||
|
@ -94,7 +94,9 @@ class Client(object):
|
||||||
site = "https://" + site
|
site = "https://" + site
|
||||||
self.base_url = site
|
self.base_url = site
|
||||||
else:
|
else:
|
||||||
self.base_url = "https://humbughq.com"
|
self.base_url = "https://api.humbughq.com"
|
||||||
|
if self.base_url != "https://api.humbughq.com" and not self.base_url.endswith("/api"):
|
||||||
|
self.base_url += "/api"
|
||||||
self.retry_on_errors = retry_on_errors
|
self.retry_on_errors = retry_on_errors
|
||||||
self.client_name = client
|
self.client_name = client
|
||||||
|
|
||||||
|
|
|
@ -54,4 +54,4 @@ def commit_notice_destination(repo, branch, commit):
|
||||||
HUMBUG_API_PATH = None
|
HUMBUG_API_PATH = None
|
||||||
|
|
||||||
# This should not need to change unless you have a custom Humbug subdomain.
|
# This should not need to change unless you have a custom Humbug subdomain.
|
||||||
HUMBUG_SITE = "https://humbughq.com"
|
HUMBUG_SITE = "https://api.humbughq.com"
|
||||||
|
|
|
@ -54,4 +54,4 @@ def commit_notice_destination(path, commit):
|
||||||
HUMBUG_API_PATH = None
|
HUMBUG_API_PATH = None
|
||||||
|
|
||||||
# This should not need to change unless you have a custom Humbug subdomain.
|
# This should not need to change unless you have a custom Humbug subdomain.
|
||||||
HUMBUG_SITE = "https://humbughq.com"
|
HUMBUG_SITE = "https://api.humbughq.com"
|
||||||
|
|
|
@ -49,4 +49,4 @@ TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment",
|
||||||
HUMBUG_API_PATH = None
|
HUMBUG_API_PATH = None
|
||||||
|
|
||||||
# This should not need to change unless you have a custom Humbug subdomain.
|
# This should not need to change unless you have a custom Humbug subdomain.
|
||||||
HUMBUG_SITE = "https://humbughq.com"
|
HUMBUG_SITE = "https://api.humbughq.com"
|
||||||
|
|
Loading…
Reference in a new issue