top
(README.org)
* EVEMuGate
Goals - Randomly copied and pasted from the forums

DaVinci:
  - Proper registration form (letters/symbols/registry checks).
  - User's info and control panel (something like we have now, but a bit improved)
  - Mailbox (ingame-one, that will be able to view and compose the mails, that could be seen by both client and web)
  - Maybe, some sort of chat (long-term goal to make an out-of-game trade/collaboration/chillout channels)

    Allan:
    - password reset. not sure what verification we'll need for that. i can reset password, but not retrieve.
    - industry is mostly complete (~95%). it is not mem-cached either. this system can be managed from a web-based application. it will take some pretty complicated sql to correctly setup and use factorys out-of-game, but im sure it can be done.

    Also, I apologize in advance for Github's botched rendering of org files...

* Building
** Dependencies
Install Go, make sure paths are setup correctly and $GOPATH/bin is in your
$PATH

- go-bindata: Code generation to embedd assets into binaries
  `go get -u github.com/jteeuwen/go-bindata/...`
   
- go-bindata-assetfs: Host go-bindata assets as a FileSystem
  `go get github.com/elazarl/go-bindata-assetfs/...`
 
- gorilla/mux: Request routing
  `go get github.com/gorilla/mux`

- gorilla/csrf: CSRF middleware
  `go get github.com/gorilla/csrf`

- gorilla/context: Store state between middleware and handlers
  `go get github.com/gorilla/context`
   
- gorilla/sessions: Client side sessions
  `go get github.com/gorilla/sessions`
   
- go-sql-driver/mysql: MySQL Driver
  `go get github.com/go-sql-driver/mysql`


** Compiling
just `make` that shiet.  We'll generate the embedded assets and compile the code.

* Configuration
We have a single configuration file that will be created the first time you start the EVEMu Gate.
  
#+BEGIN_SRC JSON
{
  "mysql-server":"10.0.0.10:3306",
  "mysql-user":"user",
  "mysql-pass":"password",
  "mysql-db":"evemu",
  "gate-host":":8080",
  "secret":"this should be random",
  "csrf-token":""
}
#+END_SRC
  
All of this is pretty self-explainatory.
  
secret should be a faily long random string use something like
`openssl rand -base64 128` to generate it.

csrf-token should be a 32 byte random string

* Middleware stack and template variables
** $.user - SetUser
In the middleware SetUser we set the context variable `user` to a struct of
of type Account.  If the ID is 0 you can safely assume that the user is logged out
** $.server - SetServerStatus
In the middleware SetUserStatus we set the context variable `server` to a boolean
representing if the server is online
** $.error
In the event an error occurs we set the context variable `error` to an error interface
This is usually used in the event of a 500 error or the database.  Handlers should make
their own call to DoTemplate
** $.csrfField - gorilla/csrf
{{$.csrfField}} should go in any POST field to prevent CSRF attacks.  If this field is 
ommited no handler will get a POST request.

Imports 6 package(s) ΒΆ

  1. github.com/go-sql-driver/mysql
  2. github.com/elazarl/go-bindata-assetfs
  3. github.com/gorilla/sessions
  4. github.com/gorilla/context
  5. github.com/gorilla/csrf
  6. github.com/gorilla/mux