<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://bluelinegamestudios.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Node_Chat%2FDocs%2FDev_Setup</id>
		<title>Node Chat/Docs/Dev Setup - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://bluelinegamestudios.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Node_Chat%2FDocs%2FDev_Setup"/>
		<link rel="alternate" type="text/html" href="http://bluelinegamestudios.com/wiki/index.php?title=Node_Chat/Docs/Dev_Setup&amp;action=history"/>
		<updated>2026-04-04T06:41:35Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://bluelinegamestudios.com/wiki/index.php?title=Node_Chat/Docs/Dev_Setup&amp;diff=6&amp;oldid=prev</id>
		<title>Sean Colombo: Pulled over from prior version of wiki</title>
		<link rel="alternate" type="text/html" href="http://bluelinegamestudios.com/wiki/index.php?title=Node_Chat/Docs/Dev_Setup&amp;diff=6&amp;oldid=prev"/>
				<updated>2015-10-09T23:54:45Z</updated>
		
		<summary type="html">&lt;p&gt;Pulled over from prior version of wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;amp;larr; [[Node Chat]] / [[Node Chat/Docs|Docs]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The full stack of chat will run on the devboxes if you enable the extension.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
To set it up:&lt;br /&gt;
&lt;br /&gt;
* Check out the chat repo to &amp;lt;code&amp;gt;/usr/wikia/source/chat&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 git clone https://github.com/SeanColombo/chat&lt;br /&gt;
&lt;br /&gt;
* Edit config/ChatConfig_EXAMPLE.json (and rename it not to have _EXAMPLE in it)) and&lt;br /&gt;
** update &amp;lt;code&amp;gt;&amp;quot;ChatHost&amp;quot;: &amp;quot;dev-chat:8080&amp;quot;&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;&amp;quot;ChatHost&amp;quot;: &amp;quot;dev-chat:9002&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
** change all instances of &amp;lt;code&amp;gt;dev-chat&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;dev-YOURDEVBOX&amp;lt;/code&amp;gt;&lt;br /&gt;
* Add to &amp;lt;code&amp;gt;DevBoxSettings.php&amp;lt;/code&amp;gt;: &amp;lt;code&amp;gt;$wgEnableChat = true;&amp;lt;/code&amp;gt;&lt;br /&gt;
* Install Redis if not already on your dev-box:&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install redis-server&lt;br /&gt;
&lt;br /&gt;
* Make sure redis-server is running locally&lt;br /&gt;
&lt;br /&gt;
  service redis-server start&lt;br /&gt;
&lt;br /&gt;
* run npm install inside the chat main directory&lt;br /&gt;
&lt;br /&gt;
 npm install&lt;br /&gt;
&lt;br /&gt;
== Running Chat ==&lt;br /&gt;
&lt;br /&gt;
* start the chat service&lt;br /&gt;
  cd [PATH TO THE github CHECKOUT]&lt;br /&gt;
  /usr/bin/node server.js loglevel=debug mode=dev basket=1 instance=2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Chat with multiple baskets ==&lt;br /&gt;
If you need to test failover between the multiple baskets, then you can make that happen on dev:&lt;br /&gt;
* Modify &amp;lt;tt&amp;gt;[github clone location]/ChatConfig.json&amp;lt;/tt&amp;gt; to have multiple buckets for dev. For example, change the code to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;dev&amp;quot;:{&lt;br /&gt;
                &amp;quot;ChatHost&amp;quot;: &amp;quot;dev-chat:9000&amp;quot;,&lt;br /&gt;
                &amp;quot;MainChatServers&amp;quot;: {&lt;br /&gt;
                        &amp;quot;1&amp;quot;:[ &amp;quot;dev-chat:9001&amp;quot; , &amp;quot;dev-chat:9002&amp;quot; ],&lt;br /&gt;
                        &amp;quot;2&amp;quot;:[ &amp;quot;dev-chat:9003&amp;quot; , &amp;quot;dev-chat:9004&amp;quot; ] &lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;ApiChatServers&amp;quot;: {&lt;br /&gt;
                        &amp;quot;1&amp;quot;:[ &amp;quot;dev-chat:9101&amp;quot;, &amp;quot;dev-chat:9102&amp;quot; ],&lt;br /&gt;
                        &amp;quot;2&amp;quot;:[ &amp;quot;dev-chat:9103&amp;quot;, &amp;quot;dev-chat:9104&amp;quot; ] &lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;RedisServer&amp;quot;: {&lt;br /&gt;
                        &amp;quot;1&amp;quot;: &amp;quot;127.0.0.1:6379&amp;quot;,&lt;br /&gt;
                        &amp;quot;2&amp;quot;: &amp;quot;127.0.0.1:6379&amp;quot;&lt;br /&gt;
                },&lt;br /&gt;
                &amp;quot;ProxyServer&amp;quot;: &amp;quot;127.0.0.1:6081&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But with your whatever your chat server box is, instead of dev-chat.&lt;br /&gt;
  cd /usr/wikia/source/chat&lt;br /&gt;
  /usr/bin/node server.js loglevel=debug mode=dev basket=1 instance=2&lt;br /&gt;
  /usr/bin/node server.js loglevel=debug mode=dev basket=2 instance=2&lt;br /&gt;
&lt;br /&gt;
* You can move all wikis over to use a different basket by changing wgChatServerBasket in WikiFactory for community.wikia.com to put it in a different basket (all wikis share the setting from Community). - '''TODO:Update this'''&lt;br /&gt;
&lt;br /&gt;
== Testing multiple instances ==&lt;br /&gt;
''' TODO: CHAT PROXY NOTES HERE... need to make some general-purpose proxy rules to keep Chat servers only internally accessible.'''&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
If you get an error on the AJAX request that says:&lt;br /&gt;
&lt;br /&gt;
 io.j[0](new Error(&amp;quot;handshake unauthorized&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
It means that the chat server has probably allocated an instance of the chat for that wiki on somebody else's devbox.  Try using a different test wiki.  If that doesn't work, flush redis cache to reset all chat rooms, then try again:&lt;br /&gt;
&lt;br /&gt;
 $ redis-cli&lt;br /&gt;
 &amp;gt; flushall&lt;br /&gt;
&lt;br /&gt;
== Additional Help ==&lt;br /&gt;
&lt;br /&gt;
* Contact the Social Team to debug if anything goes wrong (it probably will)&lt;br /&gt;
* If the client can't connect, double check the instance number in the http request, it might be 1&lt;br /&gt;
* Contact Owen if you want to set up a full hproxy config for this to run both instances.&lt;/div&gt;</summary>
		<author><name>Sean Colombo</name></author>	</entry>

	</feed>