Git Product home page Git Product logo

gopher's Introduction

#Gopher

Golang**(www.golangtc.com)源代码.

##Requirements

  • Go1.2+
  • MongoDB
  • github.com/gorilla/mux
  • github.com/gorilla/sessions
  • github.com/qiniu/bytes
  • github.com/qiniu/rpc
  • github.com/qiniu/api.v6
  • labix.org/v2/mgo
  • code.google.com/p/go-uuid/uuid
  • github.com/jimmykuu/webhelpers
  • github.com/jimmykuu/wtforms
  • github.com/deferpanic/deferclient/deferclient

##Install

$ go get github.com/jimmykuu/gopher/server

复制文件 etc/config.json.default 并改名为 etc/config.json 作为配置文件

  • superusers: 内容为用户名,如果没有管理员,内容为"",如果有多个,用英文逗号隔开
  • analytics_file: 内容为统计分析代码的文件名
  • time_zone_offset: 时差,跟UTC的时间差,单位小时
  • github_login_redirect: 第三方登录失败无法获取cookie跳转地址
  • github_login_success_redirect: 第三放登录成功后跳转地址
  • cookie_secure: 第三方登录需要使用HTTPS,当设置为false供本地测试使用
  • deferpanic_api_key: deferpanic.com的Api Key,用于监控panic

内容如下:

{
    "host": "http://localhost:8888",
    "port": 8888,
    "db": "localhost:27017",
    "cookie_secret": "05e0ba2eca9411e18155109add4b8aac",
    "smtp_username": "[email protected]",
    "smtp_password": "password",
    "smtp_host": "smtp.example.com",
    "smtp_addr": "smtp.example.com:25",
    "from_email": "[email protected]",
    "superusers": "jimmykuu,another",
    "analytics_file": "",
    "time_zone_offset": 8,
    "static_file_version": 1,
    "go_get_path": "/tmp/download",
    "packages_download_path": "/var/go/gopher/static/download/packages",
    "public_salt": "",
	"github_auth_client_id": "example",
	"github_auth_client_secret": "example",
	"github_login_redirect": "/",
	"github_login_success_redirect": "/auth/signup",
	"deferpanic_api_key": ""
}

需要先启动MongoDB

生成私钥和证书,会在当前目录生成key.pemcert.pem

go run $GOROOT/src/crypto/tls/generate_cert.go --host 域名

Linux/Unix/OS X:

$ $GOPATH/bin/server

Windows:

> $GOPATH\bin\server.exe

或者:

$ go build -o binary github.com/jimmykuu/gopher/server
$ ./binary

##Contributors

##License

Copyright (c) 2012-2015

Released under the MIT license:

gopher's People

Contributors

jimmykuu avatar ggaaooppeenngg avatar fanflash avatar wangtuanjie avatar

Watchers

查金民 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.