From 04d68d2570941137b3a9ee34885777feb43988fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6nig?= Date: Tue, 29 May 2018 10:18:06 +0200 Subject: [PATCH] code: Rename flaskbotrc to botserverrc. --- frontend_tests/casper_tests/06-settings.js | 14 +++++++------- frontend_tests/node_tests/settings_bots.js | 4 ++-- static/js/settings.js | 2 +- static/js/settings_bots.js | 6 +++--- static/templates/settings/bot-settings.handlebars | 2 +- templates/zerver/api/deploying-bots.md | 10 +++++----- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/frontend_tests/casper_tests/06-settings.js b/frontend_tests/casper_tests/06-settings.js index b2984213bd..9063a3b6d9 100644 --- a/frontend_tests/casper_tests/06-settings.js +++ b/frontend_tests/casper_tests/06-settings.js @@ -8,7 +8,7 @@ common.start_and_log_in(); // var form_sel = 'form[action^="/json/settings"]'; var regex_zuliprc = /^data:application\/octet-stream;charset=utf-8,\[api\]\nemail=.+\nkey=.+\nsite=.+\n$/; -var regex_flaskbotrc = /^data:application\/octet-stream;charset=utf-8,\[\]\nemail=.+\nkey=.+\nsite=.+\n$/; +var regex_botserverrc = /^data:application\/octet-stream;charset=utf-8,\[\]\nemail=.+\nkey=.+\nsite=.+\n$/; casper.then(function () { var menu_selector = '#settings-dropdown'; @@ -142,14 +142,14 @@ casper.then(function () { }); casper.then(function () { - casper.waitUntilVisible('#download_flaskbotrc', function () { - casper.click("#download_flaskbotrc"); + casper.waitUntilVisible('#download_botserverrc', function () { + casper.click("#download_botserverrc"); - casper.waitUntilVisible('#download_flaskbotrc[href^="data:application"]', function () { + casper.waitUntilVisible('#download_botserverrc[href^="data:application"]', function () { casper.test.assertMatch( - decodeURIComponent(casper.getElementsAttribute('#download_flaskbotrc', 'href')), - regex_flaskbotrc, - 'Looks like a flaskbotrc file'); + decodeURIComponent(casper.getElementsAttribute('#download_botserverrc', 'href')), + regex_botserverrc, + 'Looks like a botserverrc file'); }); }); }); diff --git a/frontend_tests/node_tests/settings_bots.js b/frontend_tests/node_tests/settings_bots.js index bc93f4cabf..c83e9f13d4 100644 --- a/frontend_tests/node_tests/settings_bots.js +++ b/frontend_tests/node_tests/settings_bots.js @@ -46,12 +46,12 @@ run_test('generate_zuliprc_content', () => { assert.equal(content, expected); }); -run_test('generate_flaskbotrc_content', () => { +run_test('generate_botserverrc_content', () => { var user = { email: "vabstest-bot@zulip.com", api_key: "nSlA0mUm7G42LP85lMv7syqFTzDE2q34", }; - var content = settings_bots.generate_flaskbotrc_content(user.email, user.api_key); + var content = settings_bots.generate_botserverrc_content(user.email, user.api_key); var expected = "[]\nemail=vabstest-bot@zulip.com\n" + "key=nSlA0mUm7G42LP85lMv7syqFTzDE2q34\n" + "site=https://chat.example.com\n"; diff --git a/static/js/settings.js b/static/js/settings.js index 25a5afb0be..7d60e81dfa 100644 --- a/static/js/settings.js +++ b/static/js/settings.js @@ -139,7 +139,7 @@ function _setup_page() { full_name: people.my_full_name(), page_params: page_params, zuliprc: 'zuliprc', - flaskbotrc: 'flaskbotrc', + botserverrc: 'botserverrc', timezones: moment.tz.names(), admin_only_bot_creation: page_params.is_admin || page_params.realm_bot_creation_policy !== diff --git a/static/js/settings_bots.js b/static/js/settings_bots.js index 4d2a8e5e96..035e2ef751 100644 --- a/static/js/settings_bots.js +++ b/static/js/settings_bots.js @@ -110,7 +110,7 @@ exports.generate_zuliprc_content = function (email, api_key) { "\n"; }; -exports.generate_flaskbotrc_content = function (email, api_key) { +exports.generate_botserverrc_content = function (email, api_key) { return "[]" + "\nemail=" + email + "\nkey=" + api_key + @@ -177,12 +177,12 @@ exports.set_up = function () { $('#config_inputbox').children().hide(); $("[name*='"+selected_embedded_bot+"']").show(); - $('#download_flaskbotrc').click(function () { + $('#download_botserverrc').click(function () { var OUTGOING_WEBHOOK_BOT_TYPE_INT = 3; var content = ""; _.each(bot_data.get_all_bots_for_current_user(), function (bot) { if (bot.is_active && bot.bot_type === OUTGOING_WEBHOOK_BOT_TYPE_INT) { - content += exports.generate_flaskbotrc_content(bot.email, bot.api_key); + content += exports.generate_botserverrc_content(bot.email, bot.api_key); } }); $(this).attr("href", "data:application/octet-stream;charset=utf-8," + encodeURIComponent(content)); diff --git a/static/templates/settings/bot-settings.handlebars b/static/templates/settings/bot-settings.handlebars index be6a72c97f..7eb55e1877 100644 --- a/static/templates/settings/bot-settings.handlebars +++ b/static/templates/settings/bot-settings.handlebars @@ -7,7 +7,7 @@
{{t 'Download config of all active outgoing webhook bots in Zulip Botserver format.' }} - +
diff --git a/templates/zerver/api/deploying-bots.md b/templates/zerver/api/deploying-bots.md index 4f191afdc8..4defcf50ed 100644 --- a/templates/zerver/api/deploying-bots.md +++ b/templates/zerver/api/deploying-bots.md @@ -76,11 +76,11 @@ pip install zulip_botserver The Zulip botserver also supports running multiple bots from a single botserver process. You can do this with the following procedure. -1. Download the `flaskbotrc` from the `your-bots` settings page, using +1. Download the `botserverrc` from the `your-bots` settings page, using the "Download config of all active outgoing webhook bots in Zulip Botserver format." option at the top. -1. Open the `flaskbotrc`. It should contain one or more sections that look like this: +1. Open the `botserverrc`. It should contain one or more sections that look like this: ``` [] email=foo-bot@hostname @@ -99,11 +99,11 @@ key=dOHHlyqgpt5g0tVuVl6NHxDLlc9eFRX4 site=http://hostname ``` -3. Run the Zulip Botserver by passing the `flaskbotrc` to it. The +3. Run the Zulip Botserver by passing the `botserverrc` to it. The command format is: ``` - zulip-bot-server --config-file + zulip-bot-server --config-file ``` If omitted, `hostname` defaults to `127.0.0.1` and `port` to `5002`. @@ -131,7 +131,7 @@ running it manually. * Copy the following section into your existing supervisord config file. [program:zulip-bot-server] - command=zulip-bot-server --config-file= + command=zulip-bot-server --config-file= --hostname
--port startsecs=3 stdout_logfile=/var/log/zulip-botserver.log ; all output of your botserver will be logged here