From d92a69c7315285b40e2b1c76ed4bc1242157547e Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Wed, 5 Aug 2015 19:55:25 -0700 Subject: [PATCH] Update pages --- Commands.md | 5 ++- Configuration.md | 19 +++++---- Installing-Shou.md => Installing-Shuo.md | 4 +- Usage.md | 26 ++++++------ Users.md | 53 ++++++++++++++++++++---- _Sidebar.md | 4 +- 6 files changed, 77 insertions(+), 34 deletions(-) rename Installing-Shou.md => Installing-Shuo.md (81%) diff --git a/Commands.md b/Commands.md index 3b46e89..4bbf713 100644 --- a/Commands.md +++ b/Commands.md @@ -1,4 +1,5 @@ -Shou implements most of the IRC commands you may be familiar with. Here's a list of commands you can use: +Shuo implements most of the IRC commands you may be familiar with. Here's +a list of commands you can use: ## /clear @@ -195,4 +196,4 @@ Example: `/voice john` Whois a user on the current network. -Example: `/whois john` \ No newline at end of file +Example: `/whois john` diff --git a/Configuration.md b/Configuration.md index 7de0fa9..26b828c 100644 --- a/Configuration.md +++ b/Configuration.md @@ -1,9 +1,9 @@ -This part of the documentation will focus on the configuration of your Shou server. Start by locating the `config.js` file in the Shout folder. +This part of the documentation will focus on the configuration of your Shuo server. Start by locating the `config.js` file in the Shuo folder. To quickly open the config: -``` -$ shout config +```console +$ shuo config ``` ## public @@ -18,16 +18,19 @@ Listen to connections only from this host. Default `0.0.0.0` will allow connecti The port to listen on. -You can override this setting by starting Shout like this: -`shout start --port 80` +You can override this setting by starting Shuo like this: + +```console +$ shuo start --port 80 +``` ## theme -This setting should point to a stylesheet in your Shout folder. If you want to create your own theme, it's recommended that you add your own stylesheet to `shout/client/themes/`. +This setting should point to a stylesheet in your Shuo folder. If you want to create your own theme, it's recommended that you add your own stylesheet to `shout/client/themes/`. ## home -Use this setting to override the default `HOME` location. The home folder is where Shout will locate the `users/` and `cache/` folder. Leaving this field empty will default to `~/.shout/`. +Use this setting to override the default `HOME` location. The home folder is where Shuo will locate the `users/` and `cache/` folder. Leaving this field empty will default to `~/.shout/`. ## logs @@ -47,4 +50,4 @@ These are the placeholder values displayed in the __Connect__ form: - tls - nick - realname -- join \ No newline at end of file +- join diff --git a/Installing-Shou.md b/Installing-Shuo.md similarity index 81% rename from Installing-Shou.md rename to Installing-Shuo.md index 1873d37..03e247c 100644 --- a/Installing-Shou.md +++ b/Installing-Shuo.md @@ -1,4 +1,4 @@ -Shout requires [nodejs](http://nodejs.org/) and [npm](https://www.npmjs.org/). If you already have them installed on your system, go ahead and install Shout: +Shuo requires [nodejs](http://nodejs.org/) and [npm](https://www.npmjs.org/). If you already have them installed on your system, go ahead and install Shuo: ``` $ sudo npm -g install shou @@ -80,4 +80,4 @@ npm install -g shou # Install complete -When you're done installing Shout, go ahead to [[the next section|Usage]] \ No newline at end of file +When you're done installing Shuo, go ahead to [[the next section|Usage]] diff --git a/Usage.md b/Usage.md index 187c63d..7bb7652 100644 --- a/Usage.md +++ b/Usage.md @@ -1,7 +1,7 @@ Once you've installed Shou, go ahead and run: ``` -$ shout --help +$ shuo --help ``` This will give you an overiew of the commands you can use. @@ -13,7 +13,7 @@ _Start the Shou server._ Example: ``` -$ shout start --port 80 --private +$ shuo start --port 80 --private ``` Options: @@ -30,7 +30,7 @@ _Open the configuration file._ Example: ``` -$ shout config +$ shuo config ``` ## `list` @@ -40,7 +40,7 @@ _List all existing users._ Example: ``` -$ shout list +$ shuo list ``` ## `add []` @@ -50,7 +50,7 @@ _Add a new user._ Example: ``` -$ shout add john +$ shuo add john ``` ## `remove ` @@ -60,7 +60,7 @@ _Remove an existing user._ Example: ``` -$ shout remove john +$ shuo remove john ``` ## `reset ` @@ -70,7 +70,7 @@ _Reset user password._ Example: ``` -$ shout reset john +$ shuo reset john ``` ## `edit ` @@ -80,7 +80,7 @@ _Edit user configuration file._ Example: ``` -$ shout edit john +$ shuo edit john ``` # Options @@ -92,8 +92,8 @@ _Set the home path. This is the location where Shou will look for the `config.js Example: ``` -$ shout --home /app add # add user to /app/users -$ shout --home /app # start server with /app/config.js +$ shuo --home /app add # add user to /app/users +$ shuo --home /app # start server with /app/config.js ``` ## `--help` @@ -103,7 +103,7 @@ _Output usage information._ Example: ``` -$ shout --help +$ shuo --help ``` ## `--version` @@ -113,5 +113,5 @@ _Output the version number._ Example: ``` -$ shout --version -``` \ No newline at end of file +$ shuo --version +``` diff --git a/Users.md b/Users.md index 1589a41..c4c868f 100644 --- a/Users.md +++ b/Users.md @@ -10,7 +10,7 @@ When you start Shout in "private" mode it will load every user found in your `us To add a new user, run this command: ``` -$ shout add +$ shuo add ``` This will create a new user in your `users/` folder. @@ -22,7 +22,7 @@ _Note: By default, users are stored in the `~/.shout/users/` folder. You can cha Open the `user.json` for the specified user: ``` -$ shout edit +$ shuo edit ``` ## Remove user @@ -30,7 +30,7 @@ $ shout edit Simply run: ``` -$ shout remove +$ shuo remove ``` ## List users @@ -38,16 +38,16 @@ $ shout remove This command will print a list of all your existing users: ``` -$ shout list +$ shuo list ``` # User configuration -If you run `shout edit `, the `user.json` file will open. +If you run `shuo edit `, the `user.json` file will open. The user configuration is loaded upon server start. Here's an example of what a `user.json` file might look like: -``` +```json { "user": "example", "password": "password", @@ -67,4 +67,43 @@ The user configuration is loaded upon server start. Here's an example of what a "join": "#foo, #bar" }] } -``` \ No newline at end of file +``` + +For those interested in automating account creation, an account can also be +represented by the following Go structure: + +```go +type User struct { + Username string `json:"user"` + Password string `json:"password"` + Log bool `json:"log"` + Networks []*Network `json:"networks"` +} +type Network struct { + Name string `json:"name"` + Host string `json:"host"` + Port string `json:"port"` + TLS bool `json:"tls"` + Username string `json:"username"` + Realname string `json:"realname"` + Nick string `json:"nick"` + Join string `json:"join"` +} +``` + +Passwords must be encrypted using bcrypt. The following code fragment is known +to work for generating valid passwords: + +```go +import "golang.org/x/crypto/bcrypt" + +func clear(b []byte) { + for i := 0; i < len(b); i++ { + b[i] = 0 + } +} +func Crypt(password []byte) ([]byte, error) { + defer clear(password) + return bcrypt.GenerateFromPassword(password, bcrypt.DefaultCost) +} +``` diff --git a/_Sidebar.md b/_Sidebar.md index 9eb011b..9bcf28f 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -1,10 +1,10 @@ * [[Home|Home]] * Getting Started - * [[Installing Shou|Installing Shou]] + * [[Installing Shuo|Installing Shuo]] * [[Usage|Usage]] * Server * [[Configuration|Configuration]] * [[Users|Users]] * Client * [[Commands|Commands]] - * [[Keyboard Shortcuts|Keyboard Shortcuts]] \ No newline at end of file + * [[Keyboard Shortcuts|Keyboard Shortcuts]]