Fix API broken

This commit is contained in:
Unknwon 2014-10-18 23:26:55 -04:00
parent 9e3a1bc11a
commit 3abc41ccca
10 changed files with 12 additions and 10 deletions

View file

@ -46,7 +46,7 @@ The goal of this project is to make the easiest, fastest and most painless way t
- Slack webhook integration - Slack webhook integration
- Supports MySQL, PostgreSQL and SQLite3 - Supports MySQL, PostgreSQL and SQLite3
- Social account login(GitHub, Google, QQ, Weibo) - Social account login(GitHub, Google, QQ, Weibo)
- Multi-language support(English, Simplified Chinese, Traditional Chinese, Germany, French, Dutch etc.) - Multi-language support(English, Simplified Chinese, Traditional Chinese, Germany, French, Dutch, and [more](https://crowdin.com/project/gogs))
## System Requirements ## System Requirements
@ -73,6 +73,7 @@ There are 5 ways to install Gogs:
- Usage and modification from [beego](http://beego.me) modules. - Usage and modification from [beego](http://beego.me) modules.
- Thanks [lavachen](http://www.lavachen.cn/) and [Rocker](http://weibo.com/rocker1989) for designing Logo. - Thanks [lavachen](http://www.lavachen.cn/) and [Rocker](http://weibo.com/rocker1989) for designing Logo.
- Thanks [gobuild.io](http://gobuild.io) for providing binary compile and download service. - Thanks [gobuild.io](http://gobuild.io) for providing binary compile and download service.
- Thanks to [Crowdin](https://crowdin.com/project/gogs) for providing open source translation plan.
## Contributors ## Contributors

View file

@ -37,7 +37,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
- Slack Web 钩子集成 - Slack Web 钩子集成
- 支持 MySQL、PostgreSQL 以及 SQLite3 数据库 - 支持 MySQL、PostgreSQL 以及 SQLite3 数据库
- 社交帐号登录GitHub、Google、QQ、微博 - 社交帐号登录GitHub、Google、QQ、微博
- 多语言支持(英文、简体中文、繁体中文、德语、法语、荷兰语等等 - 多语言支持(英文、简体中文、繁体中文、德语、法语、荷兰语以及 [更多]([more](https://crowdin.com/project/gogs))
## 系统要求 ## 系统要求
@ -64,6 +64,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
- 基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改的系统监视状态。 - 基于 [GoBlog](https://github.com/fuxiaohei/goblog) 修改的系统监视状态。
- 感谢 [gobuild.io](http://gobuild.io) 提供二进制编译与下载服务。 - 感谢 [gobuild.io](http://gobuild.io) 提供二进制编译与下载服务。
- 感谢 [lavachen](http://www.lavachen.cn/) 和 [Rocker](http://weibo.com/rocker1989) 设计的 Logo。 - 感谢 [lavachen](http://www.lavachen.cn/) 和 [Rocker](http://weibo.com/rocker1989) 设计的 Logo。
- 感谢 [Crowdin](https://crowdin.com/project/gogs) 提供免费的开源项目本地化支持。
## 贡献成员 ## 贡献成员

View file

@ -71,7 +71,7 @@ func checkVersion() {
log.Fatal(4, "Package i18n version is too old, did you forget to update?(github.com/macaron-contrib/i18n)") log.Fatal(4, "Package i18n version is too old, did you forget to update?(github.com/macaron-contrib/i18n)")
} }
sessionVer := git.MustParseVersion(session.Version()) sessionVer := git.MustParseVersion(session.Version())
if sessionVer.LessThan(git.MustParseVersion("0.0.1")) { if sessionVer.LessThan(git.MustParseVersion("0.0.3")) {
log.Fatal(4, "Package session version is too old, did you forget to update?(github.com/macaron-contrib/session)") log.Fatal(4, "Package session version is too old, did you forget to update?(github.com/macaron-contrib/session)")
} }
} }

View file

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.5.5.1015 Beta" const APP_VER = "0.5.5.1018 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View file

@ -147,7 +147,7 @@ func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interfa
ctx.Resp.Header().Set("Expires", "0") ctx.Resp.Header().Set("Expires", "0")
ctx.Resp.Header().Set("Cache-Control", "must-revalidate") ctx.Resp.Header().Set("Cache-Control", "must-revalidate")
ctx.Resp.Header().Set("Pragma", "public") ctx.Resp.Header().Set("Pragma", "public")
http.ServeContent(ctx.Resp, ctx.Req, name, modtime, r) http.ServeContent(ctx.Resp, ctx.Req.Request, name, modtime, r)
} }
// Contexter initializes a classic context for a request. // Contexter initializes a classic context for a request.

View file

@ -5,7 +5,6 @@
package v1 package v1
import ( import (
"io/ioutil"
"strings" "strings"
"github.com/gogits/gogs/modules/auth/apiv1" "github.com/gogits/gogs/modules/auth/apiv1"
@ -34,7 +33,7 @@ func Markdown(ctx *middleware.Context, form apiv1.MarkdownForm) {
// Render a Markdown document in raw mode. // Render a Markdown document in raw mode.
func MarkdownRaw(ctx *middleware.Context) { func MarkdownRaw(ctx *middleware.Context) {
body, err := ioutil.ReadAll(ctx.Req.Body) body, err := ctx.Req.Body().Bytes()
if err != nil { if err != nil {
ctx.JSON(422, base.ApiJsonErr{err.Error(), DOC_URL}) ctx.JSON(422, base.ApiJsonErr{err.Error(), DOC_URL})
return return

View file

@ -229,6 +229,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
setting.Cfg.SetValue("log", "MODE", "file") setting.Cfg.SetValue("log", "MODE", "file")
setting.Cfg.SetValue("security", "INSTALL_LOCK", "true") setting.Cfg.SetValue("security", "INSTALL_LOCK", "true")
setting.Cfg.SetValue("security", "SECRET_KEY", base.GetRandomString(15))
os.MkdirAll("custom/conf", os.ModePerm) os.MkdirAll("custom/conf", os.ModePerm)
if err := goconfig.SaveConfigFile(setting.Cfg, path.Join(setting.CustomPath, "conf/app.ini")); err != nil { if err := goconfig.SaveConfigFile(setting.Cfg, path.Join(setting.CustomPath, "conf/app.ini")); err != nil {

View file

@ -204,7 +204,7 @@ func Http(ctx *middleware.Context) {
config := Config{setting.RepoRootPath, "git", true, true, f} config := Config{setting.RepoRootPath, "git", true, true, f}
handler := HttpBackend(&config) handler := HttpBackend(&config)
handler(ctx.Resp, ctx.Req) handler(ctx.Resp, ctx.Req.Request)
} }
type route struct { type route struct {

View file

@ -229,7 +229,7 @@ func SignUpPost(ctx *middleware.Context, cpt *captcha.Captcha, form auth.Registe
return return
} }
if !cpt.VerifyReq(ctx.Req) { if !cpt.VerifyReq(ctx.Req.Request) {
ctx.Data["Err_Captcha"] = true ctx.Data["Err_Captcha"] = true
ctx.RenderWithErr(ctx.Tr("form.captcha_incorrect"), SIGNUP, &form) ctx.RenderWithErr(ctx.Tr("form.captcha_incorrect"), SIGNUP, &form)
return return

View file

@ -1 +1 @@
0.5.5.1015 Beta 0.5.5.1018 Beta