mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	[manual] Move git checkouts from /home/humbug/humbug to /home/humbug/zulip.
(imported from commit d58be28e57fcb3b5585c0018f1dbb53adf5067df)
This commit is contained in:
		@@ -19,7 +19,7 @@ file(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/humbug/humbug/bots/zmirror_private.conf.template"
 | 
					template = "/home/humbug/zulip/bots/zmirror_private.conf.template"
 | 
				
			||||||
template_data = file(template).read()
 | 
					template_data = file(template).read()
 | 
				
			||||||
session_path = "/home/humbug/zephyr_sessions/%s" % (program_name,)
 | 
					session_path = "/home/humbug/zephyr_sessions/%s" % (program_name,)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,7 @@ if options.sync_subscriptions:
 | 
				
			|||||||
    sys.exit(0)
 | 
					    sys.exit(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if options.forward_class_messages and not options.noshard:
 | 
					if options.forward_class_messages and not options.noshard:
 | 
				
			||||||
    sys.path.append("/home/humbug/humbug")
 | 
					    sys.path.append("/home/humbug/zulip")
 | 
				
			||||||
    if options.on_startup_command is not None:
 | 
					    if options.on_startup_command is not None:
 | 
				
			||||||
        subprocess.call([options.on_startup_command])
 | 
					        subprocess.call([options.on_startup_command])
 | 
				
			||||||
    from zerver.lib.parallel import run_parallel
 | 
					    from zerver.lib.parallel import run_parallel
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
[program:zmirror-USERNAME]
 | 
					[program:zmirror-USERNAME]
 | 
				
			||||||
command=python /home/humbug/humbug/bots/zephyr_mirror_backend.py --root-path=/home/humbug/humbug/bots --user=USERNAME --log-path=/home/humbug/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/humbug/zephyr_sessions/%(program_name)s --api-key-file=/home/humbug/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/humbug/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios
 | 
					command=python /home/humbug/zulip/bots/zephyr_mirror_backend.py --root-path=/home/humbug/zulip/bots --user=USERNAME --log-path=/home/humbug/logs/mirror-log-%(program_name)s --use-sessions --session-path=/home/humbug/zephyr_sessions/%(program_name)s --api-key-file=/home/humbug/api-keys/%(program_name)s --ignore-expired-tickets --nagios-path=/home/humbug/mirror_status/%(program_name)s --nagios-class=zulip-mirror-nagios
 | 
				
			||||||
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)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,5 +30,5 @@ def commit_notice_destination(repo, branch, commit):
 | 
				
			|||||||
    # Return None for cases where you don't want a notice sent
 | 
					    # Return None for cases where you don't want a notice sent
 | 
				
			||||||
    return None
 | 
					    return None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ZULIP_API_PATH = "/home/humbug/humbug/api"
 | 
					ZULIP_API_PATH = "/home/humbug/zulip/api"
 | 
				
			||||||
ZULIP_SITE = "https://staging.zulip.com"
 | 
					ZULIP_SITE = "https://staging.zulip.com"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,5 +10,5 @@ STREAM_FOR_NOTIFICATIONS = "trac"
 | 
				
			|||||||
TRAC_BASE_TICKET_URL = "https://trac.zulip.net/ticket"
 | 
					TRAC_BASE_TICKET_URL = "https://trac.zulip.net/ticket"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", "owner"]
 | 
					TRAC_NOTIFY_FIELDS = ["description", "summary", "resolution", "comment", "owner"]
 | 
				
			||||||
ZULIP_API_PATH = "/home/humbug/humbug/api"
 | 
					ZULIP_API_PATH = "/home/humbug/zulip/api"
 | 
				
			||||||
ZULIP_SITE = "https://staging.zulip.com"
 | 
					ZULIP_SITE = "https://staging.zulip.com"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,7 @@ if ! $(echo "$hostname" | grep -q zulip); then
 | 
				
			|||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
humbug_root=${HUMBUG_ROOT:-$HOME/humbug}
 | 
					humbug_root=${HUMBUG_ROOT:-$HOME/zulip}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
amazon_key_file=$humbug_root/humbug.pem
 | 
					amazon_key_file=$humbug_root/humbug.pem
 | 
				
			||||||
if ! [ -e "$amazon_key_file" ]; then
 | 
					if ! [ -e "$amazon_key_file" ]; then
 | 
				
			||||||
@@ -84,8 +84,8 @@ cp -a /root/humbug/servers/puppet/modules/zulip/files/puppet.conf /etc/puppet/
 | 
				
			|||||||
userdel admin
 | 
					userdel admin
 | 
				
			||||||
passwd -d root
 | 
					passwd -d root
 | 
				
			||||||
puppet apply -e 'class {"zulip": machinetype => "$type"}'
 | 
					puppet apply -e 'class {"zulip": machinetype => "$type"}'
 | 
				
			||||||
cp -a /root/humbug /home/humbug/humbug
 | 
					cp -a /root/humbug /home/humbug/zulip
 | 
				
			||||||
chown -R humbug:humbug /home/humbug/humbug
 | 
					chown -R humbug:humbug /home/humbug/zulip
 | 
				
			||||||
# These server restarting bits should be moveable into puppet-land, ideally
 | 
					# These server restarting bits should be moveable into puppet-land, ideally
 | 
				
			||||||
apt-get -y upgrade
 | 
					apt-get -y upgrade
 | 
				
			||||||
if [ -e "/etc/init.d/nginx" ]; then
 | 
					if [ -e "/etc/init.d/nginx" ]; then
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
MAILTO=root
 | 
					MAILTO=root
 | 
				
			||||||
SHELL=/bin/bash
 | 
					SHELL=/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
0 3 * * * humbug /home/humbug/humbug/servers/puppet/modules/zulip/files/graphite/daily_rsync_backup.sh
 | 
					0 3 * * * humbug /home/humbug/zulip/servers/puppet/modules/zulip/files/graphite/daily_rsync_backup.sh
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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 * * * * humbug /home/humbug/humbug/bots/zmirror-renew-kerberos
 | 
					35 * * * * humbug /home/humbug/zulip/bots/zmirror-renew-kerberos
 | 
				
			||||||
*/2 * * * * humbug /home/humbug/humbug/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 * * * * humbug /home/humbug/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
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -83,7 +83,7 @@ define command{
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
define command{
 | 
					define command{
 | 
				
			||||||
        command_name    check_feedback_bot
 | 
					        command_name    check_feedback_bot
 | 
				
			||||||
        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 humbug -c 1:1 -a "python /home/humbug/humbug/bots/feedback-bot"'
 | 
					        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 humbug -c 1:1 -a "python /home/humbug/zulip/bots/feedback-bot"'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
define command{
 | 
					define command{
 | 
				
			||||||
@@ -103,7 +103,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 humbug -c 1:1 -a "/home/humbug/humbug/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 humbug -c 1:1 -a "/home/humbug/zulip/bots/sync-public-streams"'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
define command{
 | 
					define command{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
[program:feedback-bot]
 | 
					[program:feedback-bot]
 | 
				
			||||||
command=/home/humbug/humbug/bots/feedback-bot
 | 
					command=/home/humbug/zulip/bots/feedback-bot
 | 
				
			||||||
autostart=true
 | 
					autostart=true
 | 
				
			||||||
user=humbug
 | 
					user=humbug
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,7 +27,7 @@ stdout_logfile=/var/log/zulip/carbon-aggregator.log         ; stdout log path, N
 | 
				
			|||||||
directory=/home/humbug/
 | 
					directory=/home/humbug/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[program:zulip-statsd]
 | 
					[program:zulip-statsd]
 | 
				
			||||||
command=node stats.js /home/humbug/humbug/servers/puppet/modules/zulip/files/statsd/local.js
 | 
					command=node stats.js /home/humbug/zulip/servers/puppet/modules/zulip/files/statsd/local.js
 | 
				
			||||||
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)
 | 
				
			||||||
@@ -40,7 +40,7 @@ directory=/home/humbug/statsd
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[program:zulip-graphiti]
 | 
					[program:zulip-graphiti]
 | 
				
			||||||
command=/home/humbug/humbug/tools/run-graphiti
 | 
					command=/home/humbug/zulip/tools/run-graphiti
 | 
				
			||||||
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)
 | 
				
			||||||
stopsignal=TERM                 ; signal used to kill process (default TERM)
 | 
					stopsignal=TERM                 ; signal used to kill process (default TERM)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
[program:zmirror]
 | 
					[program:zmirror]
 | 
				
			||||||
command=python /home/humbug/humbug/bots/zephyr_mirror.py --root-path=/home/humbug/ --user=tabbott/extra --forward-class-messages --log-path=/home/humbug/logs/mirror-log --on-startup-command="/home/humbug/humbug/bots/zmirror-renew-kerberos"
 | 
					command=python /home/humbug/zulip/bots/zephyr_mirror.py --root-path=/home/humbug/ --user=tabbott/extra --forward-class-messages --log-path=/home/humbug/logs/mirror-log --on-startup-command="/home/humbug/zulip/bots/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/humbug",USER="humbug"
 | 
					environment=HOME="/home/humbug",USER="humbug"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[program:sync-public-streams]
 | 
					[program:sync-public-streams]
 | 
				
			||||||
command=python /home/humbug/humbug/bots/sync-public-streams
 | 
					command=python /home/humbug/zulip/bots/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)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,6 @@ class zulip::git {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  file { '/home/git/repositories/eng/zulip.git/hooks/post-receive':
 | 
					  file { '/home/git/repositories/eng/zulip.git/hooks/post-receive':
 | 
				
			||||||
    ensure => 'link',
 | 
					    ensure => 'link',
 | 
				
			||||||
    target => '/home/humbug/humbug/tools/post-receive',
 | 
					    target => '/home/humbug/zulip/tools/post-receive',
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,11 +21,11 @@ class zulip::trac {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  file { '/home/humbug/trac/plugins/zulip_trac.py':
 | 
					  file { '/home/humbug/trac/plugins/zulip_trac.py':
 | 
				
			||||||
    ensure => 'link',
 | 
					    ensure => 'link',
 | 
				
			||||||
    target => '/home/humbug/humbug/api/integrations/trac/zulip_trac.py',
 | 
					    target => '/home/humbug/zulip/api/integrations/trac/zulip_trac.py',
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  file { '/home/humbug/trac/plugins/zulip_trac_config.py':
 | 
					  file { '/home/humbug/trac/plugins/zulip_trac_config.py':
 | 
				
			||||||
    ensure => 'link',
 | 
					    ensure => 'link',
 | 
				
			||||||
    target => '/home/humbug/humbug/bots/zulip_trac_config.py',
 | 
					    target => '/home/humbug/zulip/bots/zulip_trac_config.py',
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  # TODO: Add downloading and installing trac at /home/humbug/trac
 | 
					  # TODO: Add downloading and installing trac at /home/humbug/trac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,7 @@ def update_deployment(server, refname):
 | 
				
			|||||||
                            "/home/humbug/deployments/current/tools/update-deployment", refname])
 | 
					                            "/home/humbug/deployments/current/tools/update-deployment", refname])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def send_deployment_finished_message(branch, message):
 | 
					def send_deployment_finished_message(branch, message):
 | 
				
			||||||
    subprocess.check_call(["/home/humbug/humbug/api/bin/zulip-send", "--user=commit-bot@zulip.com",
 | 
					    subprocess.check_call(["/home/humbug/zulip/api/bin/zulip-send", "--user=commit-bot@zulip.com",
 | 
				
			||||||
                           "--api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "--stream=commits",
 | 
					                           "--api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "--stream=commits",
 | 
				
			||||||
                           "--site=https://staging.zulip.com",
 | 
					                           "--site=https://staging.zulip.com",
 | 
				
			||||||
                           (u"--subject=deploy \u21D2 %s" % (branch,)).encode("utf-8"), "--message=%s" % (message,)])
 | 
					                           (u"--subject=deploy \u21D2 %s" % (branch,)).encode("utf-8"), "--message=%s" % (message,)])
 | 
				
			||||||
@@ -51,7 +51,7 @@ deployments = {
 | 
				
			|||||||
for ln in sys.stdin:
 | 
					for ln in sys.stdin:
 | 
				
			||||||
    oldrev, newrev, refname = ln.strip().split()
 | 
					    oldrev, newrev, refname = ln.strip().split()
 | 
				
			||||||
    if refname in deployments:
 | 
					    if refname in deployments:
 | 
				
			||||||
        p = subprocess.Popen("/home/humbug/humbug/bots/githook-post-receive",
 | 
					        p = subprocess.Popen("/home/humbug/zulip/bots/githook-post-receive",
 | 
				
			||||||
                             stdin=subprocess.PIPE)
 | 
					                             stdin=subprocess.PIPE)
 | 
				
			||||||
        p.communicate(input=ln)
 | 
					        p.communicate(input=ln)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -445,7 +445,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", "humbug@zmirror2.zulip.net", "--",
 | 
					        subprocess.check_call(["ssh", "humbug@zmirror2.zulip.net", "--",
 | 
				
			||||||
                               "/home/humbug/humbug/bots/process_ccache",
 | 
					                               "/home/humbug/zulip/bots/process_ccache",
 | 
				
			||||||
                               user,
 | 
					                               user,
 | 
				
			||||||
                               user_profile.api_key,
 | 
					                               user_profile.api_key,
 | 
				
			||||||
                               base64.b64encode(ccache)])
 | 
					                               base64.b64encode(ccache)])
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user