From 0d077e7f41baffb61f8f3531b25ae60dc62566d9 Mon Sep 17 00:00:00 2001
From: Tim Abbott
Date: Wed, 24 Jul 2013 17:53:39 -0400
Subject: [PATCH] [manual] Use api.zulip.com to access the Humbug API.
This needs to be deployed after the nginx configuration is deployed.
(imported from commit 167a3d9d27595d40883bb400ebcc44c4ad9b6a2f)
---
api/examples/curl-examples | 4 ++--
api/humbug/__init__.py | 4 ++--
api/integrations/git/humbug_git_config.py | 2 +-
.../jira/org/humbug/jira/HumbugListener.groovy | 8 ++------
api/integrations/svn/humbug_svn_config.py | 2 +-
api/integrations/trac/humbug_trac_config.py | 2 +-
api/setup.py | 2 +-
bots/check-mirroring | 2 +-
bots/feedback-bot | 4 ++--
bots/zephyr_mirror_backend.py | 2 +-
.../files/nagios_plugins/check_send_receive_time | 6 +++---
templates/zephyr/api_content.json | 4 ++--
templates/zephyr/integrations.html | 10 +++++-----
13 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/api/examples/curl-examples b/api/examples/curl-examples
index 033c0b6638..1feaf847fc 100755
--- a/api/examples/curl-examples
+++ b/api/examples/curl-examples
@@ -1,13 +1,13 @@
#!/bin/sh
# Two quick API tests using curl
-curl https://api.humbughq.com/v1/send_message \
+curl https://api.zulip.com/v1/send_message \
-d "api-key=BOT_API_KEY" \
-d "email=BOT_EMAIL" \
-d "type=private" -d "content=test" \
-d "to=RECIPIENT_EMAIL"
-curl https://api.humbughq.com/v1/get_messages \
+curl https://api.zulip.com/v1/get_messages \
-d "api-key=BOT_API_KEY" \
-d "email=BOT_EMAIL"
diff --git a/api/humbug/__init__.py b/api/humbug/__init__.py
index 7c2f5b7ad7..1b0750ec82 100644
--- a/api/humbug/__init__.py
+++ b/api/humbug/__init__.py
@@ -94,8 +94,8 @@ class Client(object):
site = "https://" + site
self.base_url = site
else:
- 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 = "https://api.zulip.com"
+ if self.base_url != "https://api.zulip.com" and not self.base_url.endswith("/api"):
self.base_url += "/api"
if not self.base_url.endswith("/"):
self.base_url += "/"
diff --git a/api/integrations/git/humbug_git_config.py b/api/integrations/git/humbug_git_config.py
index 6d5517c739..552da7a464 100644
--- a/api/integrations/git/humbug_git_config.py
+++ b/api/integrations/git/humbug_git_config.py
@@ -54,4 +54,4 @@ def commit_notice_destination(repo, branch, commit):
HUMBUG_API_PATH = None
# This should not need to change unless you have a custom Humbug subdomain.
-HUMBUG_SITE = "https://api.humbughq.com"
+HUMBUG_SITE = "https://api.zulip.com"
diff --git a/api/integrations/jira/org/humbug/jira/HumbugListener.groovy b/api/integrations/jira/org/humbug/jira/HumbugListener.groovy
index c1e440fa3f..24d972490e 100644
--- a/api/integrations/jira/org/humbug/jira/HumbugListener.groovy
+++ b/api/integrations/jira/org/humbug/jira/HumbugListener.groovy
@@ -32,7 +32,7 @@ class HumbugListener extends AbstractIssueEventListener {
String issueBaseUrl = "https://jira.COMPANY.com/browse/"
// Your humbug domain, only change if you have a custom one
- String domain = ""
+ String base_url = "https://api.zulip.com"
@Override
void workflowEvent(IssueEvent event) {
@@ -142,10 +142,6 @@ class HumbugListener extends AbstractIssueEventListener {
}
String humbugUrl(method) {
- String url = "humbughq.com"
- if (domain != "") {
- url = domain + "." + url
- }
- return "https://" + url + "/api/v1/" + method
+ return base_url + "/v1/" + method
}
}
diff --git a/api/integrations/svn/humbug_svn_config.py b/api/integrations/svn/humbug_svn_config.py
index 814ae94e98..4cedcacafd 100644
--- a/api/integrations/svn/humbug_svn_config.py
+++ b/api/integrations/svn/humbug_svn_config.py
@@ -54,4 +54,4 @@ def commit_notice_destination(path, commit):
HUMBUG_API_PATH = None
# This should not need to change unless you have a custom Humbug subdomain.
-HUMBUG_SITE = "https://api.humbughq.com"
+HUMBUG_SITE = "https://api.zulip.com"
diff --git a/api/integrations/trac/humbug_trac_config.py b/api/integrations/trac/humbug_trac_config.py
index af646f17a2..06cca4fa00 100644
--- a/api/integrations/trac/humbug_trac_config.py
+++ b/api/integrations/trac/humbug_trac_config.py
@@ -49,4 +49,4 @@ TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment",
HUMBUG_API_PATH = None
# This should not need to change unless you have a custom Humbug subdomain.
-HUMBUG_SITE = "https://api.humbughq.com"
+HUMBUG_SITE = "https://api.zulip.com"
diff --git a/api/setup.py b/api/setup.py
index 70be8e463b..d38fae40da 100644
--- a/api/setup.py
+++ b/api/setup.py
@@ -24,7 +24,7 @@ setup(name='humbug',
'License :: OSI Approved :: MIT License',
'Topic :: Communications :: Chat',
],
- url='https://humbughq.com/dist/api/',
+ url='https://www.zulip.com/dist/api/',
packages=['humbug'],
data_files=[('share/humbug/examples', ["examples/humbugrc", "examples/send-message", "examples/subscribe",
"examples/get-public-streams", "examples/unsubscribe",
diff --git a/bots/check-mirroring b/bots/check-mirroring
index e3530bd694..79331ddb08 100755
--- a/bots/check-mirroring
+++ b/bots/check-mirroring
@@ -15,7 +15,7 @@ parser.add_option('--verbose',
action='store_true')
parser.add_option('--site',
dest='site',
- default="https://api.humbughq.com",
+ default="https://api.zulip.com",
action='store')
parser.add_option('--sharded',
default=False,
diff --git a/bots/feedback-bot b/bots/feedback-bot
index a675060256..0d003bc8e7 100755
--- a/bots/feedback-bot
+++ b/bots/feedback-bot
@@ -36,12 +36,12 @@ prod_client = humbug.Client(
email="feedback@zulip.com",
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
verbose=True,
- site="https://api.humbughq.com")
+ site="https://api.zulip.com")
staging_client = humbug.Client(
email="feedback@zulip.com",
api_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
verbose=True,
- site="https://staging.humbughq.com/api")
+ site="https://staging.zulip.com/api")
def forward_message(message):
if message["type"] != "private" or len(message["display_recipient"]) != 2:
diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py
index 33ce2d2f86..d7c28347c1 100755
--- a/bots/zephyr_mirror_backend.py
+++ b/bots/zephyr_mirror_backend.py
@@ -70,7 +70,7 @@ class RandomExponentialBackoff(CountingBackoff):
print message
time.sleep(delay)
-DEFAULT_SITE = "https://api.humbughq.com"
+DEFAULT_SITE = "https://api.zulip.com"
class States:
Startup, HumbugToZephyr, ZephyrToHumbug, ChildSending = range(4)
diff --git a/servers/puppet/modules/humbug/files/nagios_plugins/check_send_receive_time b/servers/puppet/modules/humbug/files/nagios_plugins/check_send_receive_time
index d953e591fb..d48508fdc3 100755
--- a/servers/puppet/modules/humbug/files/nagios_plugins/check_send_receive_time
+++ b/servers/puppet/modules/humbug/files/nagios_plugins/check_send_receive_time
@@ -26,7 +26,7 @@ usage = """Usage: send-receive.py [options] [config]
parser = optparse.OptionParser(usage=usage)
parser.add_option('--site',
dest='site',
- default="https://api.humbughq.com",
+ default="https://api.zulip.com",
action='store')
parser.add_option('--nagios',
@@ -92,14 +92,14 @@ if "staging" in options.site:
sender_key = "dfe1c934d555f4b9538d0d4cfd3069c2"
recipient = "othello@zulip.com"
recipient_key = "4e5d97591bec64bf57d2698ffbb563e3"
- site = "https://staging.humbughq.com/api"
+ site = "https://staging.zulip.com/api"
else:
# cordelia and iago are default users on prod
sender = "iago@zulip.com"
sender_key = "d43b53c27a8106195b46781abc67901a"
recipient = "cordelia@zulip.com"
recipient_key = "24cf18de98d5c31da9c6c79f0cbec195"
- site = "https://api.humbughq.com"
+ site = "https://api.zulip.com"
humbug_sender = humbug.Client(
email=sender,
diff --git a/templates/zephyr/api_content.json b/templates/zephyr/api_content.json
index 257844cc0a..dca621d304 100644
--- a/templates/zephyr/api_content.json
+++ b/templates/zephyr/api_content.json
@@ -21,7 +21,7 @@
],
"example_request": {
"python": "",
- "curl": "curl -G https://api.humbughq.com/v1/messages/latest \\\n -u othello-bot@example.com:a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5 \\\n -d \"last=102345\"\n
"
+ "curl": "curl -G https://api.zulip.com/v1/messages/latest \\\n -u othello-bot@example.com:a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5 \\\n -d \"last=102345\"\n
"
}
},
{
@@ -54,7 +54,7 @@
],
"example_request": {
"python": "\nclient.send_message({\n \"type\": \"private\",\n \"to\": \"wdaher@example.com\",\n \"content\": \"I come not, friends, to steal away your hearts.\"\n})\nclient.send_message({\n \"type\": \"stream\",\n \"to\": \"Denmark\",\n \"subject\": \"Castle\",\n \"content\": \"Something is rotten in the state of Denmark.\"\n})\n \n",
- "curl": "Stream message
\ncurl https://api.humbughq.com/v1/messages \\\n -u BOT_EMAIL_ADDRESS:BOT_API_KEY \\\n -d \"type=stream\" \\\n -d \"to=Denmark\" \\\n -d \"subject=Castle\" \\\n -d \"content=Something is rotten in the state of Denmark.\"\n
\nPrivate message
\ncurl https://api.humbughq.com/v1/messages \\\n -u BOT_EMAIL_ADDRESS:BOT_API_KEY \\\n -d \"type=private\" \\\n -d \"to=wdaher@example.com\" \\\n -d \"content=I come not, friends, to steal away your hearts.\"\n
"
+ "curl": "Stream message
\ncurl https://api.zulip.com/v1/messages \\\n -u BOT_EMAIL_ADDRESS:BOT_API_KEY \\\n -d \"type=stream\" \\\n -d \"to=Denmark\" \\\n -d \"subject=Castle\" \\\n -d \"content=Something is rotten in the state of Denmark.\"\n
\nPrivate message
\ncurl https://api.zulip.com/v1/messages \\\n -u BOT_EMAIL_ADDRESS:BOT_API_KEY \\\n -d \"type=private\" \\\n -d \"to=wdaher@example.com\" \\\n -d \"content=I come not, friends, to steal away your hearts.\"\n
"
}
}
]
diff --git a/templates/zephyr/integrations.html b/templates/zephyr/integrations.html
index ed62cbc441..b2cdfc1c95 100644
--- a/templates/zephyr/integrations.html
+++ b/templates/zephyr/integrations.html
@@ -69,7 +69,7 @@
Choose the Webhooks integration from the list presented. Make sure to replace the @ in the bot's email address with %40,
as Beanstalk's website will incorrectly refuse to parse a username containing a @.
- In the URL field, enter https://bot_email:bot_api_key@humbughq.com/api/v1/external/beanstalk:
+ In the URL field, enter https://bot_email:bot_api_key@api.zulip.com/v1/external/beanstalk:
Congratulations! You're done!
Whenever you do a
@@ -255,7 +255,7 @@ following, to the stream commits with a subject that matches the re
Give your new web hook a name, and for the URL provide the following:
- https://api.humbughq.com/v1/external/jira?api_key=abcdefgh&stream=jira
+ https://api.zulip.com/v1/external/jira?api_key=abcdefgh&stream=jira
where api_key is the API key of your Zulip bot,
@@ -288,7 +288,7 @@ following, to the stream commits with a subject that matches the re
SSL Setup
As Zulip is using a StartCOM SSL certificate that is not recognized by default in the Java installation shipped with JIRA,
you will need to tell JIRA about the certificate. Navigate to Administration > System > Configure SSL and in
- the Import SSL Certificates field, enter https://www.humbughq.com. After clicking Save Certificates,
+ the Import SSL Certificates field, enter https://api.zulip.com. After clicking Save Certificates,
follow the on-screen instructions and restart JIRA for it to recognize the proper certificates.
Zulip Integration
Copy the folder integrations/jira/org/ (from the tarball you downloaded above) to your JIRA classes folder.
@@ -383,7 +383,7 @@ key=NAGIOS_BOT_API_KEY
Zulip supports Pivotal Tracker integration and can notify you of changes to the stories in your Pivotal Tracker project. In the Settings page
for your project, choose the Integrations tab. Scroll down to the Activity Web Hook section, and enter the following url:
-x https://api.humbughq.com/v1/external/pivotal?api_key=abcdefgh&stream=pivotal
+x https://api.zulip.com/v1/external/pivotal?api_key=abcdefgh&stream=pivotal
where api_key is the API key of your Zulip bot,
and stream is the stream name you want the
@@ -406,7 +406,7 @@ x
https://api.humbughq.com/v1/external/pivotal?api_key=abcdefgh&am
"Alerting notifications". On the "Webhook" tab, enter the following
webhook URL:
- https://api.humbughq.com/v1/external/newrelic?api_key=abcdefgh&stream=newrelic
+ https://api.zulip.com/v1/external/newrelic?api_key=abcdefgh&stream=newrelic
where api_key is the API key of your Zulip bot,
and stream is the stream name you want the