From eb463000a91281f525aa83781e7bcc9dbf8e350f Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Thu, 1 May 2014 03:27:26 -0400
Subject: [PATCH 1/7] Clean files

---
 README.md                                 | 10 ++---
 README_ZH.md                              | 10 ++---
 doc/install_gogs_from_binary_on_ubuntu.md | 26 ------------
 doc/install_gogs_from_source_on_ubuntu.md | 48 -----------------------
 gogs.go                                   |  2 +-
 templates/base/footer.tmpl                |  2 +-
 6 files changed, 12 insertions(+), 86 deletions(-)
 delete mode 100644 doc/install_gogs_from_binary_on_ubuntu.md
 delete mode 100644 doc/install_gogs_from_source_on_ubuntu.md

diff --git a/README.md b/README.md
index 7166daed7..8e00be526 100644
--- a/README.md
+++ b/README.md
@@ -24,10 +24,10 @@ More importantly, Gogs only needs one binary to setup your own project hosting o
 
 ## Overview
 
-- Please see [Wiki](https://github.com/gogits/gogs/wiki) for project design, known issues, and change log.
+- Please see [Documentation](http://gogs.io/docs/intro/) for project design, known issues, and change log.
 - See [Trello Board](https://trello.com/b/uxAoeLUl/gogs-go-git-service) to follow the develop team.
 - Try it before anything? Do it [online](http://try.gogits.org/Unknown/gogs) or go down to **Installation -> Install from binary** section!
-- Having troubles? Get help from [Troubleshooting](https://github.com/gogits/gogs/wiki/Troubleshooting).
+- Having troubles? Get help from [Troubleshooting](http://gogs.io/docs/intro/troubleshooting.md).
 
 ## Features
 
@@ -49,12 +49,12 @@ More importantly, Gogs only needs one binary to setup your own project hosting o
 
 ## Installation
 
-Make sure you install [Prerequirements](https://github.com/gogits/gogs/wiki/Prerequirements) first.
+Make sure you install [Prerequirements](http://gogs.io/docs/installation/) first.
 
 There are 3 ways to install Gogs:
 
-- [Install from binary](https://github.com/gogits/gogs/wiki/Install-from-binary): **STRONGLY RECOMMENDED**
-- [Install from source](https://github.com/gogits/gogs/wiki/Install-from-source)
+- [Install from binary](http://gogs.io/docs/installation/install_from_binary.md): **STRONGLY RECOMMENDED**
+- [Install from source](http://gogs.io/docs/installation/install_from_source.md)
 - [Ship with Docker](https://github.com/gogits/gogs/tree/master/dockerfiles)
 
 ## Acknowledgments
diff --git a/README_ZH.md b/README_ZH.md
index 177c679a8..e4c92685f 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -15,10 +15,10 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
 
 ## 项目概览
 
-- 有关项目设计、已知问题和变更日志,请通过  [Wiki](https://github.com/gogits/gogs/wiki) 查看。
+- 有关项目设计、已知问题和变更日志,请通过  [使用手册](http://gogs.io/docs/intro/) 查看。
 - 您可以到 [Trello Board](https://trello.com/b/uxAoeLUl/gogs-go-git-service) 跟随开发团队的脚步。
 - 想要先睹为快?通过 [在线体验](http://try.gogits.org/Unknown/gogs) 或查看 **安装部署 -> 二进制安装** 小节。
-- 使用过程中遇到问题?尝试从 [故障排查](https://github.com/gogits/gogs/wiki/Troubleshooting) 页面获取帮助。
+- 使用过程中遇到问题?尝试从 [故障排查](http://gogs.io/docs/intro/troubleshooting.md) 页面获取帮助。
 
 ## 功能特性
 
@@ -41,12 +41,12 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
 
 ## 安装部署
 
-在安装 Gogs 之前,您需要先安装 [基本环境](https://github.com/gogits/gogs/wiki/Prerequirements)。
+在安装 Gogs 之前,您需要先安装 [基本环境](http://gogs.io/docs/installation/)。
 
 然后,您可以通过以下 3 种方式来安装 Gogs:
 
-- [二进制安装](https://github.com/gogits/gogs/wiki/Install-from-binary): **强烈推荐**
-- [源码安装](https://github.com/gogits/gogs/wiki/Install-from-source)
+- [二进制安装](http://gogs.io/docs/installation/install_from_binary.md): **强烈推荐**
+- [源码安装](http://gogs.io/docs/installation/install_from_source.md)
 - [采用 Docker 部署](https://github.com/gogits/gogs/tree/master/dockerfiles)
 
 ## 特别鸣谢
diff --git a/doc/install_gogs_from_binary_on_ubuntu.md b/doc/install_gogs_from_binary_on_ubuntu.md
deleted file mode 100644
index 3b406b364..000000000
--- a/doc/install_gogs_from_binary_on_ubuntu.md
+++ /dev/null
@@ -1,26 +0,0 @@
-### Binary install gogs on ubuntu 14.04 LTS
-
-### create user and install denpendency
-- sudo adduser git
-- sudo apt-get update
-- sudo apt-get upgrade
-- sudo apt-get install git
-- sudo apt-get install mysql-server
-
-### create the database
-- $mysql -u root -p
-- mysql> SET GLOBAL storage_engine = 'InnoDB';
-- mysql> CREATE DATABASE gogs CHARACTER SET utf8 COLLATE utf8_bin;
-- mysql> GRANT ALL PRIVILEGES ON gogs.* TO 'root'@'localhost' IDENTIFIED BY 'password';
-- mysql> FLUSH PRIVILEGES;
-- mysql> QUIT
-
-### install the gogs
-- mkdir gogs
-- cd gogs
-- curl -L http://gobuild.io/github.com/gogits/gogs/v0.3.0/linux/amd64 -o v0.3.0.zip
-- unzip v0.3.0.zip
-- ./start.sh
-
-> The up-to-date binary could be found at
-> http://gobuild.io/download/github.com/gogits/gogs
diff --git a/doc/install_gogs_from_source_on_ubuntu.md b/doc/install_gogs_from_source_on_ubuntu.md
deleted file mode 100644
index b8ae6fc79..000000000
--- a/doc/install_gogs_from_source_on_ubuntu.md
+++ /dev/null
@@ -1,48 +0,0 @@
-##Install gogs under ubuntu 14.04 LTS 32bit from source code
-
-###Requirements
-- Go Programming Language: Version >= 1.2
-- git(bash): Version >= 1.6.6(both server and client) 
-- MySQL: Version >= 5.1 or PostgreSQL or NOTHING. 
-
-### Create the user which will run git
-- sudo  adduser git
-- su git
-
-### Install git and Mysql-server
-- sudo apt-get install git
-- sudo apt-get install mysql-server
-
-### Create database
-- $ mysql -u root -p
-- mysql> SET GLOBAL storage_engine = 'InnoDB';
-- mysql> CREATE DATABASE gogs CHARACTER SET utf8 COLLATE utf8_bin;
-- mysql> GRANT ALL PRIVILEGES ON gogs.* TO 'root'@'localhost' IDENTIFIED BY 'pasword';
-- mysql> FLUSH PRIVILEGES;
-- mysql> QUIT
-
-### install go from source
-- sudo apt-get install build-essential 
-- sudo apt-get install mercurial
-- hg clone -r release https://go.googlecode.com/hg/ /home/git/golang/
- 
-
-- echo export GOROOT=/home/git/golang >>.bashrc
-- echo export GOARCH=386   >>.bashrc 
-- echo export GOOS=linux  >>.bashrc 
-- echo export GOBIN= /home/git/golang/bin  >>.bashrc 
-- echo export GOPATH=$HOME/app/Go   >>.bashrc 
-- echo  PATH=${PATH}: /$HOME/golang/bin  >>.bashrc
-- cd $GOROOT/src
-- ./make.bash
-
-### Download and install dependencies
-- $ go get -u github.com/gogits/gogs
-
-### Build main program
-- $ cd $GOPATH/src/github.com/gogits/gogs
-- $ go build
-- $ ./start.sh
-
-### At present, you could access gogs from http://localhost:3000
-
diff --git a/gogs.go b/gogs.go
index 7f7267ecd..af707862a 100644
--- a/gogs.go
+++ b/gogs.go
@@ -19,7 +19,7 @@ import (
 // Test that go1.2 tag above is included in builds. main.go refers to this definition.
 const go12tag = true
 
-const APP_VER = "0.3.1.0430 Alpha"
+const APP_VER = "0.3.1.0501 Alpha"
 
 func init() {
 	base.AppVer = APP_VER
diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl
index 23a1173f9..b3e3368b4 100644
--- a/templates/base/footer.tmpl
+++ b/templates/base/footer.tmpl
@@ -15,7 +15,7 @@
 	        </div>
 
 	    	<div class="col-md-4">
-	        	<p class="desc"><a href="http://gogits.org">Official Website</a></p>
+	        	<p class="desc"><a href="http://gogs.io">Official Website</a></p>
 	        </div>
     	</div>
     </div>

From dc5546633f391bfc5ca20463baad06919210338d Mon Sep 17 00:00:00 2001
From: Meaglith Ma <genedna@gmail.com>
Date: Thu, 1 May 2014 15:37:24 +0800
Subject: [PATCH 2/7] Remove 'ENV DEBIAN_FRONTEND noninteractive'

---
 dockerfiles/build.sh.bak               | 29 --------------------------
 dockerfiles/images/gogits/Dockerfile   |  2 --
 dockerfiles/images/memcache/Dockerfile |  2 --
 dockerfiles/images/mysql/Dockerfile    |  2 --
 dockerfiles/images/postgres/Dockerfile |  2 --
 dockerfiles/images/redis/Dockerfile    |  2 --
 6 files changed, 39 deletions(-)
 delete mode 100755 dockerfiles/build.sh.bak

diff --git a/dockerfiles/build.sh.bak b/dockerfiles/build.sh.bak
deleted file mode 100755
index 272424c87..000000000
--- a/dockerfiles/build.sh.bak
+++ /dev/null
@@ -1,29 +0,0 @@
-# Configs of the docker images, you might have specify your own configs here.
-# type of database, support 'mysql' and 'postgres'
-DB_TYPE="postgres"
-DB_PASSWORD="YOUR_DB_PASSWORD"
-DB_RUN_NAME="YOUR_DB_RUN_NAME"
-HOST_PORT="YOUR_HOST_PORT"
-
-# Replace the database root password in database image Dockerfile.
-sed -i "s/THE_DB_PASSWORD/$DB_PASSWORD/g" images/$DB_TYPE/Dockerfile
-# Replace the database root password in gogits image deploy.sh file. 
-sed -i "s/THE_DB_PASSWORD/$DB_PASSWORD/g" images/gogits/deploy.sh
-# Replace the database type in gogits image deploy.sh file. 
-sed -i "s/THE_DB_TYPE/$DB_TYPE/g" images/gogits/deploy.sh
-
-# Build the database image
-cd images/$DB_TYPE
-docker build -t gogs/$DB_TYPE .
-#
-## Build the gogits image
-cd ../gogits
-docker build -t gogs/gogits .
-#
-## Run MySQL image with name
-docker run -d --name $DB_RUN_NAME gogs/$DB_TYPE
-#
-## Run gogits image and link it to the database image
-echo "Now we have the $DB_TYPE image(running) and gogs image, use the follow command to start gogs service:"
-echo -e "\033[33m docker run -i -t --link $DB_RUN_NAME:db -p $HOST_PORT:3000 gogs/gogits \033[0m"
-
diff --git a/dockerfiles/images/gogits/Dockerfile b/dockerfiles/images/gogits/Dockerfile
index 7f1514efe..1f67d41ed 100644
--- a/dockerfiles/images/gogits/Dockerfile
+++ b/dockerfiles/images/gogits/Dockerfile
@@ -1,8 +1,6 @@
 FROM stackbrew/ubuntu:13.10
 MAINTAINER  Meaglith Ma <genedna@gmail.com> (@genedna)
 
-ENV DEBIAN_FRONTEND noninteractive
-
 #aliyun#RUN echo "deb http://mirrors.aliyun.com/ubuntu/ saucy main restricted" > /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-updates main restricted" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy universe" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-updates universe" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-updates multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-backports main restricted universe multiverse" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-security main restricted" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-security universe" >> /etc/apt/sources.list && echo "deb http://mirrors.aliyun.com/ubuntu/ saucy-security multiverse" >> /etc/apt/sources.list
 
 #nchc#RUN echo "deb http://free.nchc.org.tw/ubuntu/ saucy main restricted" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy main restricted" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-updates main restricted" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-updates main restricted" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy universe" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy universe" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-updates universe" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-updates universe" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy multiverse" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-updates multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-updates multiverse" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-backports main restricted universe multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-backports main restricted universe multiverse" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-security main restricted" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-security main restricted" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-security universe" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-security universe" >> /etc/apt/source.list && echo "deb http://free.nchc.org.tw/ubuntu/ saucy-security multiverse" >> /etc/apt/source.list && echo "deb-src http://free.nchc.org.tw/ubuntu/ saucy-security multiverse" >> /etc/apt/source.list && echo "deb http://extras.ubuntu.com/ubuntu saucy main" >> /etc/apt/source.list && echo "deb-src http://extras.ubuntu.com/ubuntu saucy main" >> /etc/apt/source.list 
diff --git a/dockerfiles/images/memcache/Dockerfile b/dockerfiles/images/memcache/Dockerfile
index 2466c1f5b..a1a2b6ee4 100644
--- a/dockerfiles/images/memcache/Dockerfile
+++ b/dockerfiles/images/memcache/Dockerfile
@@ -3,8 +3,6 @@ FROM ubuntu
 # Set the file maintainer (your name - the file's author)
 MAINTAINER Borja Burgos <borja@tutum.co>
 
-ENV DEBIAN_FRONTEND noninteractive
-
 # Update the default application repository sources list
 RUN apt-get update
 
diff --git a/dockerfiles/images/mysql/Dockerfile b/dockerfiles/images/mysql/Dockerfile
index 8fff5a194..a9a72e35c 100644
--- a/dockerfiles/images/mysql/Dockerfile
+++ b/dockerfiles/images/mysql/Dockerfile
@@ -3,8 +3,6 @@
 FROM   stackbrew/ubuntu:saucy
 MAINTAINER  Meaglith Ma <genedna@gmail.com> (@genedna)
 
-ENV DEBIAN_FRONTEND noninteractive
-
 RUN apt-get install -y --force-yes software-properties-common
 RUN add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
 RUN apt-get --yes --force-yes update
diff --git a/dockerfiles/images/postgres/Dockerfile b/dockerfiles/images/postgres/Dockerfile
index 0188dd78f..9d76873c9 100644
--- a/dockerfiles/images/postgres/Dockerfile
+++ b/dockerfiles/images/postgres/Dockerfile
@@ -1,8 +1,6 @@
 FROM ubuntu
 MAINTAINER SvenDowideit@docker.com
 
-ENV DEBIAN_FRONTEND noninteractive
-
 # Add the PostgreSQL PGP key to verify their Debian packages.
 # It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc 
 RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
diff --git a/dockerfiles/images/redis/Dockerfile b/dockerfiles/images/redis/Dockerfile
index 93260ccaa..a5b948fb1 100644
--- a/dockerfiles/images/redis/Dockerfile
+++ b/dockerfiles/images/redis/Dockerfile
@@ -1,8 +1,6 @@
 FROM   	    stackbrew/ubuntu:saucy
 MAINTAINER  Meaglith Ma <genedna@gmail.com> (@genedna), Lance Ju <juzhenatpku@gmail.com> (@crystaldust)
 
-ENV         DEBIAN_FRONTEND noninteractive
-
 RUN         apt-get update && apt-get install -y redis-server
 # Usually redis doesn't need a password
 #RUN         sed -i "s/# requirepass foobared/requirepass THE_REDIS_PASSWORD/g" /etc/redis/redis.conf

From 46af92c57e0d0d71f45d13d0b4bacb91ed2db16b Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Thu, 1 May 2014 06:55:39 -0400
Subject: [PATCH 3/7] Clean files

---
 conf/app.ini            | 4 +---
 routers/dev/template.go | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/conf/app.ini b/conf/app.ini
index e7174e225..6dfd198b2 100644
--- a/conf/app.ini
+++ b/conf/app.ini
@@ -15,11 +15,9 @@ LICENSES = Apache v2 License|GPL v2|MIT License|Affero GPL|Artistic License 2.0|
 [server]
 PROTOCOL = http
 DOMAIN = localhost
-ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
+ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:3000/
 ; Disable CDN even in "prod" mode
 OFFLINE_MODE = false
-HTTP_ADDR = 
-HTTP_PORT = 3000
 ; Generate steps:
 ; $ cd path/to/gogs/custom/https
 ; $ go run $GOROOT/src/pkg/crypto/tls/generate_cert.go -ca=true -duration=8760h0m0s -host=myhost.example.com
diff --git a/routers/dev/template.go b/routers/dev/template.go
index 63d5d9a5b..7145bf51f 100644
--- a/routers/dev/template.go
+++ b/routers/dev/template.go
@@ -21,5 +21,6 @@ func TemplatePreview(ctx *middleware.Context, params martini.Params) {
 	ctx.Data["Code"] = "2014031910370000009fff6782aadb2162b4a997acb69d4400888e0b9274657374"
 	ctx.Data["ActiveCodeLives"] = base.Service.ActiveCodeLives / 60
 	ctx.Data["ResetPwdCodeLives"] = base.Service.ResetPwdCodeLives / 60
+	ctx.Data["CurDbValue"] = ""
 	ctx.HTML(200, params["_1"])
 }

From 2a1dc0085b9f7236082f3885fa594ec12d5b0211 Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Thu, 1 May 2014 07:35:21 -0400
Subject: [PATCH 4/7] fix #91

---
 modules/auth/auth.go          |  4 +++-
 modules/base/base.go          |  1 +
 modules/middleware/binding.go | 12 +++++++++---
 templates/base/navbar.tmpl    |  2 +-
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/modules/auth/auth.go b/modules/auth/auth.go
index e493faefe..85df42d8c 100644
--- a/modules/auth/auth.go
+++ b/modules/auth/auth.go
@@ -21,7 +21,7 @@ type Form interface {
 }
 
 type RegisterForm struct {
-	UserName     string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"`
+	UserName     string `form:"username" binding:"Required;AlphaDashDot;MaxSize(30)"`
 	Email        string `form:"email" binding:"Required;Email;MaxSize(50)"`
 	Password     string `form:"passwd" binding:"Required;MinSize(6);MaxSize(30)"`
 	RetypePasswd string `form:"retypepasswd"`
@@ -123,6 +123,8 @@ func validate(errors *base.BindingErrors, data base.TmplData, form Form) {
 				data["ErrorMsg"] = form.Name(field.Name) + " cannot be empty"
 			case base.BindingAlphaDashError:
 				data["ErrorMsg"] = form.Name(field.Name) + " must be valid alpha or numeric or dash(-_) characters"
+			case base.BindingAlphaDashDotError:
+				data["ErrorMsg"] = form.Name(field.Name) + " must be valid alpha or numeric or dash(-_) or dot characters"
 			case base.BindingMinSizeError:
 				data["ErrorMsg"] = form.Name(field.Name) + " must contain at least " + getMinMaxSize(field) + " characters"
 			case base.BindingMaxSizeError:
diff --git a/modules/base/base.go b/modules/base/base.go
index 3e80a436e..e6befb83f 100644
--- a/modules/base/base.go
+++ b/modules/base/base.go
@@ -45,6 +45,7 @@ func (this *BindingErrors) Combine(other BindingErrors) {
 const (
 	BindingRequireError         string = "Required"
 	BindingAlphaDashError       string = "AlphaDash"
+	BindingAlphaDashDotError    string = "AlphaDashDot"
 	BindingMinSizeError         string = "MinSize"
 	BindingMaxSizeError         string = "MaxSize"
 	BindingEmailError           string = "Email"
diff --git a/modules/middleware/binding.go b/modules/middleware/binding.go
index cde9ae9cc..bff34ddde 100644
--- a/modules/middleware/binding.go
+++ b/modules/middleware/binding.go
@@ -180,9 +180,10 @@ func Validate(obj interface{}) martini.Handler {
 }
 
 var (
-	alphaDashPattern = regexp.MustCompile("[^\\d\\w-_]")
-	emailPattern     = regexp.MustCompile("[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[a-zA-Z0-9](?:[\\w-]*[\\w])?")
-	urlPattern       = regexp.MustCompile(`(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?`)
+	alphaDashPattern    = regexp.MustCompile("[^\\d\\w-_]")
+	alphaDashDotPattern = regexp.MustCompile("[^\\d\\w-_\\.]")
+	emailPattern        = regexp.MustCompile("[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[a-zA-Z0-9](?:[\\w-]*[\\w])?")
+	urlPattern          = regexp.MustCompile(`(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?`)
 )
 
 func validateStruct(errors *base.BindingErrors, obj interface{}) {
@@ -227,6 +228,11 @@ func validateStruct(errors *base.BindingErrors, obj interface{}) {
 					errors.Fields[field.Name] = base.BindingAlphaDashError
 					break
 				}
+			case rule == "AlphaDashDot":
+				if alphaDashDotPattern.MatchString(fmt.Sprintf("%v", fieldValue)) {
+					errors.Fields[field.Name] = base.BindingAlphaDashDotError
+					break
+				}
 			case strings.HasPrefix(rule, "MinSize("):
 				min, err := strconv.Atoi(rule[8 : len(rule)-1])
 				if err != nil {
diff --git a/templates/base/navbar.tmpl b/templates/base/navbar.tmpl
index da6865b8e..80085d974 100644
--- a/templates/base/navbar.tmpl
+++ b/templates/base/navbar.tmpl
@@ -3,7 +3,7 @@
         <nav class="nav">
             <a id="nav-logo" class="nav-item pull-left{{if .PageIsHome}} active{{end}}" href="/"><img src="/img/favicon.png" alt="Gogs Logo" id="logo"></a>
             <a class="nav-item pull-left{{if .PageIsUserDashboard}} active{{end}}" href="/">Dashboard</a>
-            <a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" target="_blank" href="https://github.com/gogits/gogs/wiki">Help</a>{{if .IsSigned}}
+            <a class="nav-item pull-left{{if .PageIsHelp}} active{{end}}" target="_blank" href="http://gogs.io/docs">Help</a>{{if .IsSigned}}
             {{if .HasAccess}}<form class="nav-item pull-left{{if .PageIsNewRepo}} active{{end}}" id="nav-search-form">
                 <div class="input-group">
                     <div class="input-group-btn">

From d0ea4c7b686a200af3eca3847909b515c40539ee Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Thu, 1 May 2014 07:59:09 -0400
Subject: [PATCH 5/7] Fix #149

---
 modules/auth/auth.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/auth/auth.go b/modules/auth/auth.go
index 85df42d8c..96e3868ff 100644
--- a/modules/auth/auth.go
+++ b/modules/auth/auth.go
@@ -176,7 +176,7 @@ type InstallForm struct {
 	RunUser         string `form:"run_user"`
 	Domain          string `form:"domain"`
 	AppUrl          string `form:"app_url"`
-	AdminName       string `form:"admin_name" binding:"Required"`
+	AdminName       string `form:"admin_name" binding:"Required;AlphaDashDot;MaxSize(30)"`
 	AdminPasswd     string `form:"admin_pwd" binding:"Required;MinSize(6);MaxSize(30)"`
 	AdminEmail      string `form:"admin_email" binding:"Required;Email;MaxSize(50)"`
 	SmtpHost        string `form:"smtp_host"`

From 89c99167b2916a36ef112125662e014ca5b9da26 Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Thu, 1 May 2014 08:26:41 -0400
Subject: [PATCH 6/7] Fix #149

---
 models/user.go              | 1 +
 modules/auth/user.go        | 1 +
 routers/user/setting.go     | 1 +
 templates/user/profile.tmpl | 1 +
 templates/user/setting.tmpl | 7 +++++++
 5 files changed, 11 insertions(+)

diff --git a/models/user.go b/models/user.go
index 6751d11d4..42b3ebe6a 100644
--- a/models/user.go
+++ b/models/user.go
@@ -46,6 +46,7 @@ type User struct {
 	Id            int64
 	LowerName     string `xorm:"unique not null"`
 	Name          string `xorm:"unique not null"`
+	FullName      string
 	Email         string `xorm:"unique not null"`
 	Passwd        string `xorm:"not null"`
 	LoginType     int
diff --git a/modules/auth/user.go b/modules/auth/user.go
index 973894221..8d60670db 100644
--- a/modules/auth/user.go
+++ b/modules/auth/user.go
@@ -75,6 +75,7 @@ type FeedsForm struct {
 
 type UpdateProfileForm struct {
 	UserName string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"`
+	FullName string `form:"fullname" binding:"MaxSize(40)"`
 	Email    string `form:"email" binding:"Required;Email;MaxSize(50)"`
 	Website  string `form:"website" binding:"MaxSize(50)"`
 	Location string `form:"location" binding:"MaxSize(50)"`
diff --git a/routers/user/setting.go b/routers/user/setting.go
index a55e617f4..f62e93105 100644
--- a/routers/user/setting.go
+++ b/routers/user/setting.go
@@ -54,6 +54,7 @@ func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
 		user.Name = form.UserName
 	}
 
+	user.FullName = form.FullName
 	user.Email = form.Email
 	user.Website = form.Website
 	user.Location = form.Location
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 15d2a0bd5..43ecabfa1 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -6,6 +6,7 @@
             <a href="http://gravatar.com/emails/" class="center-block" data-toggle="tooltip" data-placement="bottom" title="Change your avatar at gravatar.com">
                 <img id="user-avatar" src="{{.Owner.AvatarLink}}?s=200" alt="user-avatar" title="{{.Owner.Name}}"/>
             </a>
+            {{if .Owner.FullName}}<span id="user-name" class="center-block">{{.Owner.FullName}}</span>{{end}}
             <span id="user-name" class="center-block">{{.Owner.Name}}</span>
         </div>
         <div class="profile-info">
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl
index 56d859fe4..bdcf9ce3b 100644
--- a/templates/user/setting.tmpl
+++ b/templates/user/setting.tmpl
@@ -17,6 +17,13 @@
                     </div>
                 </div>
 
+                <div class="form-group">
+                    <label class="col-md-2 control-label">Full Name</label>
+                    <div class="col-md-8">
+                        <input name="fullname" class="form-control" placeholder="Type your full name" value="{{.SignedUser.FullName}}">
+                    </div>
+                </div>
+
                 <div class="form-group">
                     <label class="col-md-2 control-label">Email<strong class="text-danger">*</strong></label>
                     <div class="col-md-8">

From a2333d95d594a6aa4e77e78c2efe32991d3cf1ef Mon Sep 17 00:00:00 2001
From: Unknown <joe2010xtmf@163.com>
Date: Thu, 1 May 2014 08:35:05 -0400
Subject: [PATCH 7/7] Fix #148

---
 models/action.go | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/models/action.go b/models/action.go
index a9a41a9f4..77576a995 100644
--- a/models/action.go
+++ b/models/action.go
@@ -88,12 +88,6 @@ func CommitRepoAction(userId int64, userName, actEmail string,
 		return err
 	}
 
-	if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, ActEmail: actEmail,
-		OpType: opType, Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName}); err != nil {
-		log.Error("action.CommitRepoAction(notify watchers): %d/%s", userId, repoName)
-		return err
-	}
-
 	// Change repository bare status and update last updated time.
 	repo, err := GetRepositoryByName(userId, repoName)
 	if err != nil {
@@ -106,12 +100,24 @@ func CommitRepoAction(userId int64, userName, actEmail string,
 		return err
 	}
 
+	if !repo.IsPrivate {
+		if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, ActEmail: actEmail,
+			OpType: opType, Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName}); err != nil {
+			log.Error("action.CommitRepoAction(notify watchers): %d/%s", userId, repoName)
+			return err
+		}
+	}
+
 	log.Trace("action.CommitRepoAction(end): %d/%s", userId, repoName)
 	return nil
 }
 
 // NewRepoAction adds new action for creating repository.
 func NewRepoAction(user *User, repo *Repository) (err error) {
+	if repo.IsPrivate {
+		return nil
+	}
+
 	if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email,
 		OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoName: repo.Name}); err != nil {
 		log.Error("action.NewRepoAction(notify watchers): %d/%s", user.Id, repo.Name)
@@ -124,6 +130,10 @@ func NewRepoAction(user *User, repo *Repository) (err error) {
 
 // TransferRepoAction adds new action for transfering repository.
 func TransferRepoAction(user, newUser *User, repo *Repository) (err error) {
+	if repo.IsPrivate {
+		return nil
+	}
+
 	if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email,
 		OpType: OP_TRANSFER_REPO, RepoId: repo.Id, RepoName: repo.Name, Content: newUser.Name}); err != nil {
 		log.Error("action.TransferRepoAction(notify watchers): %d/%s", user.Id, repo.Name)