mirror of https://github.com/zulip/zulip.git
bots: Move zephyr-related files to api/integrations/zephyr/.
This commit is contained in:
parent
2f21290407
commit
ccb4c5c26f
|
@ -18,7 +18,7 @@ open(api_key_path, "w").write(api_key + "\n")
|
||||||
|
|
||||||
# Setup supervisord configuration
|
# Setup supervisord configuration
|
||||||
supervisor_path = "/etc/supervisor/conf.d/%s.conf" % (program_name,)
|
supervisor_path = "/etc/supervisor/conf.d/%s.conf" % (program_name,)
|
||||||
template = "/home/zulip/zulip/bots/zmirror_private.conf.template"
|
template = "/home/zulip/zulip/api/integrations/zephyr/zmirror_private.conf.template"
|
||||||
template_data = open(template).read()
|
template_data = open(template).read()
|
||||||
session_path = "/home/zulip/zephyr_sessions/%s" % (program_name,)
|
session_path = "/home/zulip/zephyr_sessions/%s" % (program_name,)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[program:zmirror-USERNAME]
|
[program:zmirror-USERNAME]
|
||||||
command=/home/zulip/zulip/bots/zephyr_mirror_backend.py --root-path=/home/zulip/zulip --user=USERNAME --log-path=/home/zulip/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/zulip/zephyr_sessions/%(program_name)s --api-key-file=/home/zulip/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/zulip/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios --site=https://zephyr.zulipchat.com
|
command=/home/zulip/zulip/api/integrations/zephyr/zephyr_mirror_backend.py --root-path=/home/zulip/zulip --user=USERNAME --log-path=/home/zulip/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/zulip/zephyr_sessions/%(program_name)s --api-key-file=/home/zulip/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/zulip/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios --site=https://zephyr.zulipchat.com
|
||||||
priority=200 ; the relative start priority (default 999)
|
priority=200 ; the relative start priority (default 999)
|
||||||
autostart=true ; start at supervisord start (default: true)
|
autostart=true ; start at supervisord start (default: true)
|
||||||
autorestart=true ; whether/when to restart (default: unexpected)
|
autorestart=true ; whether/when to restart (default: unexpected)
|
|
@ -22,5 +22,5 @@ SHELL=/bin/bash
|
||||||
# For more information see the manual pages of crontab(5) and cron(8)
|
# For more information see the manual pages of crontab(5) and cron(8)
|
||||||
#
|
#
|
||||||
# m h dom mon dow command
|
# m h dom mon dow command
|
||||||
35 * * * * zulip /home/zulip/zulip/bots/zmirror-renew-kerberos
|
35 * * * * zulip /home/zulip/zulip/api/integrations/zephyr/zmirror-renew-kerberos
|
||||||
*/2 * * * * zulip /home/zulip/zulip/bots/check-mirroring --sharded &> /var/lib/nagios_state/check-mirroring-results-tmp; mv /var/lib/nagios_state/check-mirroring-results-tmp /var/lib/nagios_state/check-mirroring-results
|
*/2 * * * * zulip /home/zulip/zulip/api/integrations/zephyr/check-mirroring --sharded &> /var/lib/nagios_state/check-mirroring-results-tmp; mv /var/lib/nagios_state/check-mirroring-results-tmp /var/lib/nagios_state/check-mirroring-results
|
||||||
|
|
|
@ -4,4 +4,4 @@ if [ "$(hostname)" = "staging.zulip.net" ]; then
|
||||||
else
|
else
|
||||||
site="https://api.zulip.com"
|
site="https://api.zulip.com"
|
||||||
fi
|
fi
|
||||||
/home/zulip/deployments/current/bots/check_send_receive.py --munin "$1" --site="$site"
|
/home/zulip/deployments/current/api/integrations/zephyr/check_send_receive.py --munin "$1" --site="$site"
|
||||||
|
|
|
@ -98,7 +98,7 @@ define command{
|
||||||
|
|
||||||
define command{
|
define command{
|
||||||
command_name check_sync_public_streams
|
command_name check_sync_public_streams
|
||||||
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_rsa -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_procs -u zulip -c 1:1 -a "/home/zulip/zulip/bots/sync-public-streams"'
|
command_line /usr/lib/nagios/plugins/check_by_ssh -p $ARG1$ -l nagios -t 30 -i /var/lib/nagios/.ssh/id_rsa -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/check_procs -u zulip -c 1:1 -a "/home/zulip/zulip/api/integrations/zephyr/sync-public-streams"'
|
||||||
}
|
}
|
||||||
|
|
||||||
define command{
|
define command{
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
Nagios plugin to check that Zephyr mirror forwarding is running.
|
Nagios plugin to check that Zephyr mirror forwarding is running.
|
||||||
|
|
||||||
This script just checks the contents of a file. The forwarding test
|
This script just checks the contents of a file. The forwarding test
|
||||||
itself lives in api/bots/check-mirroring and should be run out of cron.
|
itself lives in api/integrations/zephyr/check-mirroring and should be
|
||||||
|
run out of cron.
|
||||||
|
|
||||||
See bots/zephyr-mirror-crontab for the crontab details.
|
See puppet/zulip_ops/files/cron.d/zephyr-mirror for the crontab details.
|
||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
if False:
|
if False:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[program:zmirror]
|
[program:zmirror]
|
||||||
command=/home/zulip/zulip/bots/zephyr_mirror.py --root-path=/home/zulip/ --user=tabbott/extra --forward-class-messages --log-path=/home/zulip/logs/mirror-log --on-startup-command="/home/zulip/zulip/bots/zmirror-renew-kerberos"
|
command=/home/zulip/zulip/api/integrations/zephyr/zephyr_mirror.py --root-path=/home/zulip/ --user=tabbott/extra --forward-class-messages --log-path=/home/zulip/logs/mirror-log --on-startup-command="/home/zulip/zulip/api/integrations/zephyr/zmirror-renew-kerberos"
|
||||||
priority=200 ; the relative start priority (default 999)
|
priority=200 ; the relative start priority (default 999)
|
||||||
autostart=true ; start at supervisord start (default: true)
|
autostart=true ; start at supervisord start (default: true)
|
||||||
autorestart=true ; whether/when to restart (default: unexpected)
|
autorestart=true ; whether/when to restart (default: unexpected)
|
||||||
|
@ -11,7 +11,7 @@ stdout_logfile=/var/log/zulip/zmirror.log ; stdout log path, NONE for no
|
||||||
environment=HOME="/home/zulip",USER="zulip"
|
environment=HOME="/home/zulip",USER="zulip"
|
||||||
|
|
||||||
[program:sync-public-streams]
|
[program:sync-public-streams]
|
||||||
command=/home/zulip/zulip/bots/sync-public-streams
|
command=/home/zulip/zulip/api/integrations/zephyr/sync-public-streams
|
||||||
priority=200 ; the relative start priority (default 999)
|
priority=200 ; the relative start priority (default 999)
|
||||||
autostart=true ; start at supervisord start (default: true)
|
autostart=true ; start at supervisord start (default: true)
|
||||||
autorestart=true ; whether/when to restart (default: unexpected)
|
autorestart=true ; whether/when to restart (default: unexpected)
|
||||||
|
|
|
@ -80,7 +80,7 @@ class zulip_ops::nagios {
|
||||||
mode => 644,
|
mode => 644,
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => "root",
|
group => "root",
|
||||||
source => '/root/zulip/bots/zuliprc.nagios',
|
source => '/root/zulip/api/integrations/zephyr/zuliprc.nagios',
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { "fix_nagios_permissions":
|
exec { "fix_nagios_permissions":
|
||||||
|
|
|
@ -36,7 +36,7 @@ exclude_common += ['contrib_bots/bots']
|
||||||
exclude_py2 = [] # type: List[str]
|
exclude_py2 = [] # type: List[str]
|
||||||
|
|
||||||
exclude_py3 = """
|
exclude_py3 = """
|
||||||
bots/process_ccache
|
api/integrations/zephyr/process_ccache
|
||||||
""".split()
|
""".split()
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")
|
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")
|
||||||
|
|
|
@ -71,7 +71,7 @@ class ZephyrTest(ZulipTestCase):
|
||||||
'ssh',
|
'ssh',
|
||||||
'server',
|
'server',
|
||||||
'--',
|
'--',
|
||||||
'/home/zulip/zulip/bots/process_ccache',
|
'/home/zulip/zulip/api/integrations/zephyr/process_ccache',
|
||||||
'starnine',
|
'starnine',
|
||||||
get_user(email, realm).api_key,
|
get_user(email, realm).api_key,
|
||||||
'MTIzNA=='])
|
'MTIzNA=='])
|
||||||
|
@ -98,7 +98,7 @@ class ZephyrTest(ZulipTestCase):
|
||||||
'ssh',
|
'ssh',
|
||||||
'server',
|
'server',
|
||||||
'--',
|
'--',
|
||||||
'/home/zulip/zulip/bots/process_ccache',
|
'/home/zulip/zulip/api/integrations/zephyr/process_ccache',
|
||||||
'starnine',
|
'starnine',
|
||||||
get_user(email, realm).api_key,
|
get_user(email, realm).api_key,
|
||||||
'MTIzNA=='])
|
'MTIzNA=='])
|
||||||
|
|
|
@ -47,7 +47,7 @@ def webathena_kerberos_login(request, user_profile,
|
||||||
# TODO: Send these data via (say) rabbitmq
|
# TODO: Send these data via (say) rabbitmq
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(["ssh", settings.PERSONAL_ZMIRROR_SERVER, "--",
|
subprocess.check_call(["ssh", settings.PERSONAL_ZMIRROR_SERVER, "--",
|
||||||
"/home/zulip/zulip/bots/process_ccache",
|
"/home/zulip/zulip/api/integrations/zephyr/process_ccache",
|
||||||
force_str(user),
|
force_str(user),
|
||||||
force_str(user_profile.api_key),
|
force_str(user_profile.api_key),
|
||||||
force_str(base64.b64encode(ccache))])
|
force_str(base64.b64encode(ccache))])
|
||||||
|
|
Loading…
Reference in New Issue