forked from Gitlink/gitea-1120-rc1
Compare commits
50 Commits
master
...
develop_wm
Author | SHA1 | Date |
---|---|---|
|
07ea81beda | |
|
0c897c660f | |
|
2b54b5c39a | |
|
9d53ff793b | |
|
3072fc7e4e | |
|
b228c9f602 | |
|
f13f296790 | |
|
64ef5a1567 | |
|
b8599a9fa2 | |
|
fd05b7938e | |
|
89eb38f44c | |
|
5decf76ec3 | |
|
925a7b18cb | |
|
6f2fdf1159 | |
|
98122e3cb6 | |
|
fd02b7beb9 | |
|
10e2b49064 | |
|
554fd29ebb | |
|
e6c3986962 | |
|
ad679b575e | |
|
e26a306415 | |
|
c2392616b5 | |
|
0e9fd60786 | |
|
7e486f8038 | |
|
3e792b0c0f | |
|
6b34e16a7c | |
|
d3f8e67e57 | |
|
2d5a3202bd | |
|
7a98e1ad9a | |
|
94d7873f11 | |
|
a22ccad9f9 | |
|
23f2dc9c23 | |
|
d9495f6822 | |
|
30537e038a | |
|
ca7dad0ebc | |
|
8033fc6a45 | |
|
757a3816f7 | |
|
dbd0b2661e | |
|
611e58f5ae | |
|
3b5dff2e23 | |
|
aa27fd6457 | |
|
ac62431593 | |
|
2a73cddad1 | |
|
fa35eaab21 | |
|
8e64f038ac | |
|
1014b45ec1 | |
|
6050736a0b | |
|
8609403fe9 | |
|
747b6205e2 | |
|
9c568c2a59 |
|
@ -994,7 +994,9 @@ func (repo *Repository) cloneLink(isWiki bool) *CloneLink {
|
||||||
func (repo *Repository) CloneLink() (cl *CloneLink) {
|
func (repo *Repository) CloneLink() (cl *CloneLink) {
|
||||||
return repo.cloneLink(false)
|
return repo.cloneLink(false)
|
||||||
}
|
}
|
||||||
|
func (repo *Repository) CloneWikiLink() (cl *CloneLink) {
|
||||||
|
return repo.cloneLink(true)
|
||||||
|
}
|
||||||
// CheckCreateRepository check if could created a repository
|
// CheckCreateRepository check if could created a repository
|
||||||
func CheckCreateRepository(doer, u *User, name string) error {
|
func CheckCreateRepository(doer, u *User, name string) error {
|
||||||
if !doer.CanCreateRepo() {
|
if !doer.CanCreateRepo() {
|
||||||
|
|
|
@ -55,6 +55,13 @@ func IsValidHookContentType(name string) bool {
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsValidHookHttpMethod(name string) bool {
|
||||||
|
if name == "POST" || name == "GET" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// HookEvents is a set of web hook events
|
// HookEvents is a set of web hook events
|
||||||
type HookEvents struct {
|
type HookEvents struct {
|
||||||
Create bool `json:"create"`
|
Create bool `json:"create"`
|
||||||
|
@ -115,6 +122,7 @@ type Webhook struct {
|
||||||
HookTaskType HookTaskType
|
HookTaskType HookTaskType
|
||||||
Meta string `xorm:"TEXT"` // store hook-specific attributes
|
Meta string `xorm:"TEXT"` // store hook-specific attributes
|
||||||
LastStatus HookStatus // Last delivery status
|
LastStatus HookStatus // Last delivery status
|
||||||
|
BranchFilter string `xorm:"TEXT"`
|
||||||
|
|
||||||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||||
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
|
||||||
|
@ -748,6 +756,18 @@ func (t *HookTask) simpleMarshalJSON(v interface{}) string {
|
||||||
return string(p)
|
return string(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetHookTasksByRepoIDAndHookID(repoID int64, hookID int64, listOptions ListOptions) ([]*HookTask, error) {
|
||||||
|
if listOptions.Page == 0 {
|
||||||
|
hookTasks := make([]*HookTask, 0, 5)
|
||||||
|
return hookTasks, x.Find(&hookTasks, &HookTask{RepoID: repoID, HookID: hookID})
|
||||||
|
}
|
||||||
|
|
||||||
|
sess := listOptions.getPaginatedSession()
|
||||||
|
hookTasks := make([]*HookTask, 0, listOptions.PageSize)
|
||||||
|
|
||||||
|
return hookTasks, sess.Find(&hookTasks, &HookTask{RepoID: repoID, HookID: hookID})
|
||||||
|
}
|
||||||
|
|
||||||
// HookTasks returns a list of hook tasks by given conditions.
|
// HookTasks returns a list of hook tasks by given conditions.
|
||||||
func HookTasks(hookID int64, page int) ([]*HookTask, error) {
|
func HookTasks(hookID int64, page int) ([]*HookTask, error) {
|
||||||
tasks := make([]*HookTask, 0, setting.Webhook.PagingNum)
|
tasks := make([]*HookTask, 0, setting.Webhook.PagingNum)
|
||||||
|
|
|
@ -234,7 +234,7 @@ func ReferencesGitRepo(allowEmpty bool) macaron.Handler {
|
||||||
// NotFound handles 404s for APIContext
|
// NotFound handles 404s for APIContext
|
||||||
// String will replace message, errors will be added to a slice
|
// String will replace message, errors will be added to a slice
|
||||||
func (ctx *APIContext) NotFound(objs ...interface{}) {
|
func (ctx *APIContext) NotFound(objs ...interface{}) {
|
||||||
var message = "Not Found"
|
var message = "Not Found (ownerName,repo etc...)"
|
||||||
var errors []string
|
var errors []string
|
||||||
for _, obj := range objs {
|
for _, obj := range objs {
|
||||||
// Ignore nil
|
// Ignore nil
|
||||||
|
@ -255,3 +255,94 @@ func (ctx *APIContext) NotFound(objs ...interface{}) {
|
||||||
"errors": errors,
|
"errors": errors,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ctx *APIContext) FileNameError(objs ...interface{}){
|
||||||
|
var message = "FileName too long"
|
||||||
|
var errors []string
|
||||||
|
|
||||||
|
for _, obj := range objs {
|
||||||
|
// Ignore nil
|
||||||
|
if obj == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if err, ok := obj.(error); ok {
|
||||||
|
errors = append(errors, err.Error())
|
||||||
|
} else {
|
||||||
|
message = obj.(string)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ctx.JSON(500, map[string]interface{}{
|
||||||
|
"message": message,
|
||||||
|
"documentation_url": setting.API.SwaggerURL,
|
||||||
|
"errors": errors,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func (ctx *APIContext) SameFileNameError(objs ...interface{}){
|
||||||
|
var message = "Same name exists"
|
||||||
|
var errors []string
|
||||||
|
|
||||||
|
for _, obj := range objs {
|
||||||
|
// Ignore nil
|
||||||
|
if obj == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if err, ok := obj.(error); ok {
|
||||||
|
errors = append(errors, err.Error())
|
||||||
|
} else {
|
||||||
|
message = obj.(string)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ctx.JSON(500, map[string]interface{}{
|
||||||
|
"message": message,
|
||||||
|
"documentation_url": setting.API.SwaggerURL,
|
||||||
|
"errors": errors,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ctx *APIContext) FileExistError(objs ...interface{}){
|
||||||
|
var message = "file does not exist"
|
||||||
|
var errors []string
|
||||||
|
|
||||||
|
for _, obj := range objs {
|
||||||
|
// Ignore nil
|
||||||
|
if obj == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if err, ok := obj.(error); ok {
|
||||||
|
errors = append(errors, err.Error())
|
||||||
|
} else {
|
||||||
|
message = obj.(string)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ctx.JSON(500, map[string]interface{}{
|
||||||
|
"message": message,
|
||||||
|
"documentation_url": setting.API.SwaggerURL,
|
||||||
|
"errors": errors,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func (ctx *APIContext) CheckHasWiki(objs ...interface{}){
|
||||||
|
var message = "No wikies"
|
||||||
|
var errors []string
|
||||||
|
|
||||||
|
for _, obj := range objs {
|
||||||
|
// Ignore nil
|
||||||
|
if obj == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if err, ok := obj.(error); ok {
|
||||||
|
errors = append(errors, err.Error())
|
||||||
|
} else {
|
||||||
|
message = obj.(string)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ctx.JSON(500, map[string]interface{}{
|
||||||
|
"message": message,
|
||||||
|
"documentation_url": setting.API.SwaggerURL,
|
||||||
|
"errors": errors,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ type Context struct {
|
||||||
|
|
||||||
Repo *Repository
|
Repo *Repository
|
||||||
Org *Organization
|
Org *Organization
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsUserSiteAdmin returns true if current user is a site admin
|
// IsUserSiteAdmin returns true if current user is a site admin
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
package convert
|
package convert
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -255,6 +256,7 @@ func ToHook(repoLink string, w *models.Webhook) *api.Hook {
|
||||||
config := map[string]string{
|
config := map[string]string{
|
||||||
"url": w.URL,
|
"url": w.URL,
|
||||||
"content_type": w.ContentType.Name(),
|
"content_type": w.ContentType.Name(),
|
||||||
|
"http_method": w.HTTPMethod,
|
||||||
}
|
}
|
||||||
if w.HookTaskType == models.SLACK {
|
if w.HookTaskType == models.SLACK {
|
||||||
s := webhook.GetSlackHook(w)
|
s := webhook.GetSlackHook(w)
|
||||||
|
@ -265,14 +267,45 @@ func ToHook(repoLink string, w *models.Webhook) *api.Hook {
|
||||||
}
|
}
|
||||||
|
|
||||||
return &api.Hook{
|
return &api.Hook{
|
||||||
ID: w.ID,
|
ID: w.ID,
|
||||||
Type: w.HookTaskType.Name(),
|
Type: w.HookTaskType.Name(),
|
||||||
URL: fmt.Sprintf("%s/settings/hooks/%d", repoLink, w.ID),
|
URL: fmt.Sprintf("%s/settings/hooks/%d", repoLink, w.ID),
|
||||||
Active: w.IsActive,
|
BranchFilter: w.HookEvent.BranchFilter,
|
||||||
Config: config,
|
Active: w.IsActive,
|
||||||
Events: w.EventsArray(),
|
Config: config,
|
||||||
Updated: w.UpdatedUnix.AsTime(),
|
Events: w.EventsArray(),
|
||||||
Created: w.CreatedUnix.AsTime(),
|
Updated: w.UpdatedUnix.AsTime(),
|
||||||
|
Created: w.CreatedUnix.AsTime(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToHookTask(t *models.HookTask) *api.HookTask {
|
||||||
|
config := map[string]string{
|
||||||
|
"url": t.URL,
|
||||||
|
"content_type": t.ContentType.Name(),
|
||||||
|
"http_method": t.HTTPMethod,
|
||||||
|
}
|
||||||
|
|
||||||
|
payloadContent := make(map[string]interface{})
|
||||||
|
requestContent := make(map[string]interface{})
|
||||||
|
responseContent := make(map[string]interface{})
|
||||||
|
_ = json.Unmarshal([]byte(t.PayloadContent), &payloadContent)
|
||||||
|
_ = json.Unmarshal([]byte(t.RequestContent), &requestContent)
|
||||||
|
_ = json.Unmarshal([]byte(t.ResponseContent), &responseContent)
|
||||||
|
|
||||||
|
return &api.HookTask{
|
||||||
|
ID: t.ID,
|
||||||
|
UUID: t.UUID,
|
||||||
|
Type: t.Type.Name(),
|
||||||
|
Config: config,
|
||||||
|
PayloadContent: payloadContent,
|
||||||
|
EventType: string(t.EventType),
|
||||||
|
IsSSL: t.IsSSL,
|
||||||
|
IsDelivered: t.IsDelivered,
|
||||||
|
Delivered: t.Delivered,
|
||||||
|
IsSucceed: t.IsSucceed,
|
||||||
|
RequestContent: requestContent,
|
||||||
|
ResponseContent: responseContent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,6 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
commits, err := repo.parsePrettyFormatLogToList(stdout)
|
commits, err := repo.parsePrettyFormatLogToList(stdout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -206,6 +205,19 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) {
|
||||||
return commits.Front().Value.(*Commit), nil
|
return commits.Front().Value.(*Commit), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetFirstAndLastCommitByPath returns the first commit and the last commit of relative path.
|
||||||
|
func (repo *Repository) GetFirstAndLastCommitByPath(revision, relpath string) (*Commit, *Commit, error) {
|
||||||
|
stdout, err := NewCommand("log", revision, prettyLogFormat, "--", relpath).RunInDirBytes(repo.Path)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
commits, err := repo.parsePrettyFormatLogToList(stdout)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
return commits.Front().Value.(*Commit), commits.Back().Value.(*Commit), nil
|
||||||
|
}
|
||||||
|
|
||||||
// CommitsRangeSize the default commits range size
|
// CommitsRangeSize the default commits range size
|
||||||
var CommitsRangeSize = 50
|
var CommitsRangeSize = 50
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,13 @@ var (
|
||||||
|
|
||||||
// Hook a hook is a web hook when one repository changed
|
// Hook a hook is a web hook when one repository changed
|
||||||
type Hook struct {
|
type Hook struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
URL string `json:"-"`
|
URL string `json:"-"`
|
||||||
Config map[string]string `json:"config"`
|
Config map[string]string `json:"config"`
|
||||||
Events []string `json:"events"`
|
Events []string `json:"events"`
|
||||||
Active bool `json:"active"`
|
Active bool `json:"active"`
|
||||||
|
BranchFilter string `json:"branch_filter"`
|
||||||
// swagger:strfmt date-time
|
// swagger:strfmt date-time
|
||||||
Updated time.Time `json:"updated_at"`
|
Updated time.Time `json:"updated_at"`
|
||||||
// swagger:strfmt date-time
|
// swagger:strfmt date-time
|
||||||
|
@ -34,6 +35,21 @@ type Hook struct {
|
||||||
// HookList represents a list of API hook.
|
// HookList represents a list of API hook.
|
||||||
type HookList []*Hook
|
type HookList []*Hook
|
||||||
|
|
||||||
|
type HookTask struct {
|
||||||
|
ID int64 `json:"id"`
|
||||||
|
UUID string `json:"uuid"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
Config map[string]string `json:"config"`
|
||||||
|
PayloadContent map[string]interface{} `json:"payload_content"`
|
||||||
|
EventType string `json:"event_type"`
|
||||||
|
IsSSL bool `json:"is_ssl"`
|
||||||
|
IsDelivered bool `json:"is_delivered"`
|
||||||
|
Delivered int64 `json:"delivered"`
|
||||||
|
IsSucceed bool `json:"is_succeed"`
|
||||||
|
RequestContent map[string]interface{} `json:"request_info"`
|
||||||
|
ResponseContent map[string]interface{} `json:"response_content"`
|
||||||
|
}
|
||||||
|
|
||||||
// CreateHookOptionConfig has all config options in it
|
// CreateHookOptionConfig has all config options in it
|
||||||
// required are "content_type" and "url" Required
|
// required are "content_type" and "url" Required
|
||||||
type CreateHookOptionConfig map[string]string
|
type CreateHookOptionConfig map[string]string
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* @Date: 2021-08-06 14:28:55
|
||||||
|
* @LastEditors: viletyy
|
||||||
|
* @LastEditTime: 2021-08-19 18:00:34
|
||||||
|
* @FilePath: /gitea-1120-rc1/modules/structs/wiki.go
|
||||||
|
*/
|
||||||
|
package structs
|
||||||
|
|
||||||
|
type WikiesResponse struct {
|
||||||
|
WikiMeta
|
||||||
|
WikiCloneLink CloneLink `json:"wiki_clone_link"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiMeta struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Commit WikiCommit `json:"commit"`
|
||||||
|
FirstCommit WikiCommit `json:"-"`
|
||||||
|
//WikiCloneLink CloneLink `json:"wiki_clone_link"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiCommit struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
Author WikiUser `json:"author"`
|
||||||
|
Commiter WikiUser `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiUser struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Email string `json:"email"`
|
||||||
|
When int64 `json:"when"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiResponse struct {
|
||||||
|
WikiMeta
|
||||||
|
CommitCounts int64 `json:"commit_counts"`
|
||||||
|
MdContent string `json:"md_content"`
|
||||||
|
SimpleContent string `json:"simple_content"`
|
||||||
|
WikiCloneLink CloneLink `json:"wiki_clone_link"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type WikiOption struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Content string `json:"content"`
|
||||||
|
CommitMessage string `json:"commit_message"`
|
||||||
|
}
|
||||||
|
type CloneLink struct {
|
||||||
|
SSH string `json:"ssh"`
|
||||||
|
HTTPS string `json:"https"`
|
||||||
|
}
|
|
@ -0,0 +1,314 @@
|
||||||
|
/*
|
||||||
|
* @Date: 2021-08-06 09:53:43
|
||||||
|
* @LastEditors: viletyy
|
||||||
|
* @LastEditTime: 2021-08-19 17:58:21
|
||||||
|
* @FilePath: /gitea-1120-rc1/modules/wikies/wiki.go
|
||||||
|
*/
|
||||||
|
package wikies
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/models"
|
||||||
|
repo_module "code.gitea.io/gitea/modules/repository"
|
||||||
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
|
"code.gitea.io/gitea/modules/sync"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
"github.com/unknwon/com"
|
||||||
|
|
||||||
|
//"github.com/unknwon/com"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
//"code.gitea.io/gitea/modules/wikies"
|
||||||
|
"code.gitea.io/gitea/modules/context"
|
||||||
|
"code.gitea.io/gitea/modules/git"
|
||||||
|
"code.gitea.io/gitea/modules/log"
|
||||||
|
wiki_service "code.gitea.io/gitea/services/wiki"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
reservedWikiNames = []string{"_pages", "_new", "_edit", "raw"}
|
||||||
|
wikiWorkingPool = sync.NewExclusivePool()
|
||||||
|
)
|
||||||
|
|
||||||
|
func nameAllowed(name string) error {
|
||||||
|
if util.IsStringInSlice(name, reservedWikiNames) {
|
||||||
|
return models.ErrWikiReservedName{
|
||||||
|
Title: name,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func InitWiki(repo *models.Repository) error {
|
||||||
|
if repo.HasWiki() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := git.InitRepository(repo.WikiPath(), true); err != nil {
|
||||||
|
return fmt.Errorf("InitRepository: %v", err)
|
||||||
|
} else if err = repo_module.CreateDelegateHooks(repo.WikiPath()); err != nil {
|
||||||
|
return fmt.Errorf("createDelegateHooks: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func FindWikiRepoCommit(ctx *context.APIContext) (*git.Repository, *git.Commit, error) {
|
||||||
|
wikiRepo, err := git.OpenRepository(ctx.Repo.Repository.WikiPath())
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("OpenRepository", err)
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
commit, err := wikiRepo.GetBranchCommit("master")
|
||||||
|
if err != nil {
|
||||||
|
return wikiRepo, nil, err
|
||||||
|
}
|
||||||
|
return wikiRepo, commit, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func WikiContentsByName(ctx *context.APIContext, commit *git.Commit, wikiName string) ([]byte, *git.TreeEntry, string, bool) {
|
||||||
|
pageFilename := wiki_service.NameToFilename(wikiName)
|
||||||
|
entry, err := findEntryForFile(commit, pageFilename)
|
||||||
|
if err != nil && !git.IsErrNotExist(err) {
|
||||||
|
ctx.ServerError("findEntryForFile", err)
|
||||||
|
return nil, nil, "", false
|
||||||
|
} else if entry == nil {
|
||||||
|
return nil, nil, "", true
|
||||||
|
}
|
||||||
|
return wikiContentsByEntry(ctx, entry), entry, pageFilename, false
|
||||||
|
}
|
||||||
|
|
||||||
|
func findEntryForFile(commit *git.Commit, target string) (*git.TreeEntry, error) {
|
||||||
|
entry, err := commit.GetTreeEntryByPath(target)
|
||||||
|
if err != nil && !git.IsErrNotExist(err) {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if entry != nil {
|
||||||
|
return entry, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Then the unescaped, shortest alternative
|
||||||
|
var unescapedTarget string
|
||||||
|
if unescapedTarget, err = url.QueryUnescape(target); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return commit.GetTreeEntryByPath(unescapedTarget)
|
||||||
|
}
|
||||||
|
|
||||||
|
func wikiContentsByEntry(ctx *context.APIContext, entry *git.TreeEntry) []byte {
|
||||||
|
reader, err := entry.Blob().DataAsync()
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("Blob.Data", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
defer reader.Close()
|
||||||
|
content, err := ioutil.ReadAll(reader)
|
||||||
|
if err != nil {
|
||||||
|
ctx.ServerError("ReadAll", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return content
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateWikiPage(doer *models.User, repo *models.Repository, wikiName, content, message string) error {
|
||||||
|
return updateWikiPage(doer, repo, "", wikiName, content, message, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
func EditWikiPage(doer *models.User, repo *models.Repository, oldWikiName, newWikiName, content, message string) error {
|
||||||
|
return updateWikiPage(doer, repo, oldWikiName, newWikiName, content, message, false)
|
||||||
|
}
|
||||||
|
func updateWikiPage(doer *models.User, repo *models.Repository, oldWikiName, newWikiName, content, message string, isNew bool) (err error) {
|
||||||
|
if err = nameAllowed(newWikiName); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
wikiWorkingPool.CheckIn(com.ToStr(repo.ID))
|
||||||
|
defer wikiWorkingPool.CheckOut(com.ToStr(repo.ID))
|
||||||
|
|
||||||
|
if err = InitWiki(repo); err != nil {
|
||||||
|
return fmt.Errorf("InitWiki: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
hasMasterBranch := git.IsBranchExist(repo.WikiPath(), "master")
|
||||||
|
|
||||||
|
basePath, err := models.CreateTemporaryPath("update-wiki")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
if err := models.RemoveTemporaryPath(basePath); err != nil {
|
||||||
|
log.Error("Merge: RemoveTemporaryPath: %s", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
cloneOpts := git.CloneRepoOptions{
|
||||||
|
Bare: true,
|
||||||
|
Shared: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
if hasMasterBranch {
|
||||||
|
cloneOpts.Branch = "master"
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := git.Clone(repo.WikiPath(), basePath, cloneOpts); err != nil {
|
||||||
|
log.Error("Failed to clone repository: %s (%v)", repo.FullName(), err)
|
||||||
|
return fmt.Errorf("Failed to clone repository: %s (%v)", repo.FullName(), err)
|
||||||
|
}
|
||||||
|
|
||||||
|
gitRepo, err := git.OpenRepository(basePath)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("Unable to open temporary repository: %s (%v)", basePath, err)
|
||||||
|
return fmt.Errorf("Failed to open new temporary repository in: %s %v", basePath, err)
|
||||||
|
}
|
||||||
|
defer gitRepo.Close()
|
||||||
|
|
||||||
|
if hasMasterBranch {
|
||||||
|
if err := gitRepo.ReadTreeToIndex("HEAD"); err != nil {
|
||||||
|
log.Error("Unable to read HEAD tree to index in: %s %v", basePath, err)
|
||||||
|
return fmt.Errorf("Unable to read HEAD tree to index in: %s %v", basePath, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newWikiPath := wiki_service.NameToFilename(newWikiName)
|
||||||
|
if isNew {
|
||||||
|
filesInIndex, err := gitRepo.LsFiles(newWikiPath)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if util.IsStringInSlice(newWikiPath, filesInIndex) {
|
||||||
|
return models.ErrWikiAlreadyExist{
|
||||||
|
Title: newWikiPath,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
oldWikiPath := wiki_service.NameToFilename(oldWikiName)
|
||||||
|
filesInIndex, err := gitRepo.LsFiles(oldWikiPath)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if util.IsStringInSlice(oldWikiPath, filesInIndex) {
|
||||||
|
err := gitRepo.RemoveFilesFromIndex(oldWikiPath)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME: The wiki doesn't have lfs support at present - if this changes need to check attributes here
|
||||||
|
|
||||||
|
objectHash, err := gitRepo.HashObject(strings.NewReader(content))
|
||||||
|
if err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := gitRepo.AddObjectToIndex("100644", objectHash, newWikiPath); err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
tree, err := gitRepo.WriteTree()
|
||||||
|
if err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
commitTreeOpts := git.CommitTreeOpts{
|
||||||
|
Message: message,
|
||||||
|
}
|
||||||
|
|
||||||
|
sign, signingKey, _ := repo.SignWikiCommit(doer)
|
||||||
|
if sign {
|
||||||
|
commitTreeOpts.KeyID = signingKey
|
||||||
|
} else {
|
||||||
|
commitTreeOpts.NoGPGSign = true
|
||||||
|
}
|
||||||
|
if hasMasterBranch {
|
||||||
|
commitTreeOpts.Parents = []string{"HEAD"}
|
||||||
|
}
|
||||||
|
commitHash, err := gitRepo.CommitTree(doer.NewGitSig(), tree, commitTreeOpts)
|
||||||
|
if err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := git.Push(basePath, git.PushOptions{
|
||||||
|
Remote: "origin",
|
||||||
|
Branch: fmt.Sprintf("%s:%s%s", commitHash.String(), git.BranchPrefix, "master"),
|
||||||
|
Env: models.FullPushingEnvironment(
|
||||||
|
doer,
|
||||||
|
doer,
|
||||||
|
repo,
|
||||||
|
repo.Name+".wiki",
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
}); err != nil {
|
||||||
|
log.Error("%v", err)
|
||||||
|
if git.IsErrPushOutOfDate(err) || git.IsErrPushRejected(err) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return fmt.Errorf("Push: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewWikiPost response for wiki create request
|
||||||
|
func NewWikiPost(ctx *context.APIContext, form api.WikiOption) {
|
||||||
|
ctx.Data["Title"] = ctx.Tr("repo.wiki.new_page")
|
||||||
|
ctx.Data["PageIsWiki"] = true
|
||||||
|
ctx.Data["RequireSimpleMDE"] = true
|
||||||
|
if util.IsEmptyString(form.Name) {
|
||||||
|
//ctx.RenderWithErr(ctx.Tr("repo.issues.new.title_empty"), nil, form)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
wikiName := wiki_service.NormalizeWikiName(form.Name)
|
||||||
|
if len(form.CommitMessage) == 0 {
|
||||||
|
form.CommitMessage = ctx.Tr("repo.editor.add", form.Name)
|
||||||
|
}
|
||||||
|
if err := wiki_service.AddWikiPage(ctx.User, ctx.Repo.Repository, wikiName, form.Content, form.CommitMessage); err != nil {
|
||||||
|
|
||||||
|
if models.IsErrWikiReservedName(err) {
|
||||||
|
ctx.Data["Err_Title"] = true
|
||||||
|
//ctx.RenderWithErr(ctx.Tr("repo.wiki.reserved_page", wikiName), tplWikiNew, &form)
|
||||||
|
} else if models.IsErrWikiAlreadyExist(err) {
|
||||||
|
ctx.Data["Err_Title"] = true
|
||||||
|
//ctx.RenderWithErr(ctx.Tr("repo.wiki.page_already_exists"), tplWikiNew, &form)
|
||||||
|
} else {
|
||||||
|
//ctx.ServerError("AddWikiPage", err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//ctx.Redirect(ctx.Repo.RepoLink + "/wiki/" + wiki_service.NameToSubURL(wikiName))
|
||||||
|
}
|
||||||
|
func EditWikiPost(ctx *context.APIContext, form api.WikiOption) {
|
||||||
|
|
||||||
|
|
||||||
|
oldWikiName := wiki_service.NormalizeWikiName(ctx.Params(":page"))
|
||||||
|
newWikiName := wiki_service.NormalizeWikiName(form.Name)
|
||||||
|
|
||||||
|
//newWikiName, _= url.QueryUnescape(newWikiName)
|
||||||
|
_, commit, _ := FindWikiRepoCommit(ctx)
|
||||||
|
|
||||||
|
if _, _, _, noEntry := WikiContentsByName(ctx, commit, newWikiName); oldWikiName != newWikiName && !noEntry {
|
||||||
|
ctx.Error(http.StatusConflict, "WikiNameAlreadyExist", "wiki名称已存在")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if len(form.CommitMessage) == 0 {
|
||||||
|
form.CommitMessage = ctx.Tr("repo.editor.update", form.Name)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := wiki_service.EditWikiPage(ctx.User, ctx.Repo.Repository, oldWikiName, newWikiName, form.Content, form.CommitMessage); err != nil {
|
||||||
|
ctx.ServerError("EditWikiPage", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
|
@ -65,6 +65,9 @@
|
||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
"code.gitea.io/gitea/modules/auth"
|
"code.gitea.io/gitea/modules/auth"
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
|
@ -81,13 +84,38 @@ import (
|
||||||
_ "code.gitea.io/gitea/routers/api/v1/swagger" // for swagger generation
|
_ "code.gitea.io/gitea/routers/api/v1/swagger" // for swagger generation
|
||||||
"code.gitea.io/gitea/routers/api/v1/user"
|
"code.gitea.io/gitea/routers/api/v1/user"
|
||||||
"code.gitea.io/gitea/routers/api/v1/viewfile"
|
"code.gitea.io/gitea/routers/api/v1/viewfile"
|
||||||
"net/http"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"gitea.com/macaron/binding"
|
"gitea.com/macaron/binding"
|
||||||
"gitea.com/macaron/macaron"
|
"gitea.com/macaron/macaron"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func MustEnableWiki(ctx *context.Context) {
|
||||||
|
if !ctx.Repo.CanRead(models.UnitTypeWiki) &&
|
||||||
|
!ctx.Repo.CanRead(models.UnitTypeExternalWiki) {
|
||||||
|
if log.IsTrace() {
|
||||||
|
log.Trace("Permission Denied: User %-v cannot read %-v or %-v of repo %-v\n"+
|
||||||
|
"User in repo has Permissions: %-+v",
|
||||||
|
ctx.User,
|
||||||
|
models.UnitTypeWiki,
|
||||||
|
models.UnitTypeExternalWiki,
|
||||||
|
ctx.Repo.Repository,
|
||||||
|
ctx.Repo.Permission)
|
||||||
|
}
|
||||||
|
ctx.NotFound("MustEnableWiki", nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
unit, err := ctx.Repo.Repository.GetUnit(models.UnitTypeExternalWiki)
|
||||||
|
if err == nil {
|
||||||
|
ctx.Redirect(unit.ExternalWikiConfig().ExternalWikiURL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
func sudo() macaron.Handler {
|
func sudo() macaron.Handler {
|
||||||
return func(ctx *context.APIContext) {
|
return func(ctx *context.APIContext) {
|
||||||
sudo := ctx.Query("sudo")
|
sudo := ctx.Query("sudo")
|
||||||
|
@ -206,7 +234,7 @@ func reqBasicAuth() macaron.Handler {
|
||||||
return func(ctx *context.APIContext) {
|
return func(ctx *context.APIContext) {
|
||||||
|
|
||||||
if !ctx.Context.IsBasicAuth {
|
if !ctx.Context.IsBasicAuth {
|
||||||
// fmt.Println("***********:",http.StatusUnauthorized)
|
// fmt.Println("***********:",http.StatusUnauthorized)
|
||||||
ctx.Context.Error(http.StatusUnauthorized)
|
ctx.Context.Error(http.StatusUnauthorized)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -551,7 +579,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
Patch(notify.ReadThread)
|
Patch(notify.ReadThread)
|
||||||
}, reqToken())
|
}, reqToken())
|
||||||
|
|
||||||
|
|
||||||
m.Group("/users", func() {
|
m.Group("/users", func() {
|
||||||
m.Get("/search", user.Search)
|
m.Get("/search", user.Search)
|
||||||
|
|
||||||
|
@ -585,7 +612,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
})
|
})
|
||||||
}, reqToken())
|
}, reqToken())
|
||||||
|
|
||||||
|
|
||||||
//数据统计
|
//数据统计
|
||||||
m.Group("/activity", func() {
|
m.Group("/activity", func() {
|
||||||
m.Get("", report.GetActivity)
|
m.Get("", report.GetActivity)
|
||||||
|
@ -653,9 +679,8 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
|
|
||||||
m.Combo("/repositories/:id", reqToken()).Get(repo.GetByID)
|
m.Combo("/repositories/:id", reqToken()).Get(repo.GetByID)
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
m.Group("/repos", func() {
|
m.Group("/repos", func() {
|
||||||
|
|
||||||
m.Get("/search", repo.Search)
|
m.Get("/search", repo.Search)
|
||||||
|
|
||||||
m.Get("/issues/search", repo.SearchIssues)
|
m.Get("/issues/search", repo.SearchIssues)
|
||||||
|
@ -672,28 +697,28 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
|
|
||||||
m.Get("/ext", viewfile.RepoRefByType(context.RepoRefBranch), viewfile.ViewFile)
|
m.Get("/ext", viewfile.RepoRefByType(context.RepoRefBranch), viewfile.ViewFile)
|
||||||
m.Get("/branch/*", viewfile.RepoRefByType(context.RepoRefBranch), viewfile.ViewFile)
|
m.Get("/branch/*", viewfile.RepoRefByType(context.RepoRefBranch), viewfile.ViewFile)
|
||||||
m.Get("/tag/*",viewfile.RepoRefByType(context.RepoRefTag), viewfile.ViewFile)
|
m.Get("/tag/*", viewfile.RepoRefByType(context.RepoRefTag), viewfile.ViewFile)
|
||||||
m.Get("/commit/*", viewfile.RepoRefByType(context.RepoRefCommit), viewfile.ViewFile)
|
m.Get("/commit/*", viewfile.RepoRefByType(context.RepoRefCommit), viewfile.ViewFile)
|
||||||
|
|
||||||
//update by 2021-01-12 end 引用自定义包;
|
//update by 2021-01-12 end 引用自定义包;
|
||||||
|
|
||||||
// alter on 2021/01/15
|
// alter on 2021/01/15
|
||||||
m.Get("", viewfile.Readme) // reqRepoReader(models.UnitTypeCode),
|
m.Get("", viewfile.Readme) // reqRepoReader(models.UnitTypeCode),
|
||||||
},reqToken())
|
}, reqToken())
|
||||||
|
|
||||||
m.Group("/count", func() {
|
m.Group("/count", func() {
|
||||||
m.Get("", viewfile.CommitCount) //****
|
m.Get("", viewfile.CommitCount) //****
|
||||||
})
|
})
|
||||||
m.Group("/releases", func() {
|
m.Group("/releases", func() {
|
||||||
m.Get("/latest", viewfile.LatestRelease) //响应数据待确认 to do;
|
m.Get("/latest", viewfile.LatestRelease) //响应数据待确认 to do;
|
||||||
})
|
})
|
||||||
//
|
//
|
||||||
m.Group("/find", func() {
|
m.Group("/find", func() {
|
||||||
m.Get("", viewfile.FindFiles) //文件搜索 ****
|
m.Get("", viewfile.FindFiles) //文件搜索 ****
|
||||||
})
|
})
|
||||||
|
|
||||||
m.Group("/contributors", func() {
|
m.Group("/contributors", func() {
|
||||||
m.Get("", report.GetContributors) //获取仓库的所有构建者信息 ****
|
m.Get("", report.GetContributors) //获取仓库的所有构建者信息 ****
|
||||||
})
|
})
|
||||||
|
|
||||||
m.Combo("").Get(reqAnyRepoReader(), repo.Get).
|
m.Combo("").Get(reqAnyRepoReader(), repo.Get).
|
||||||
|
@ -703,6 +728,17 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
m.Combo("/notifications").
|
m.Combo("/notifications").
|
||||||
Get(reqToken(), notify.ListRepoNotifications).
|
Get(reqToken(), notify.ListRepoNotifications).
|
||||||
Put(reqToken(), notify.ReadRepoNotifications)
|
Put(reqToken(), notify.ReadRepoNotifications)
|
||||||
|
|
||||||
|
m.Group("/wikies", func() {
|
||||||
|
m.Combo("").Get(repo.WikiList).
|
||||||
|
Post(bind(api.WikiOption{}), repo.CreateWiki)
|
||||||
|
m.Group("/:page", func() {
|
||||||
|
m.Combo("").Get(repo.GetWiki).
|
||||||
|
Patch(bind(api.WikiOption{}), repo.EditWiki).
|
||||||
|
Delete(repo.DeleteWiki)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
m.Group("/hooks", func() {
|
m.Group("/hooks", func() {
|
||||||
m.Combo("").Get(repo.ListHooks).
|
m.Combo("").Get(repo.ListHooks).
|
||||||
Post(bind(api.CreateHookOption{}), repo.CreateHook)
|
Post(bind(api.CreateHookOption{}), repo.CreateHook)
|
||||||
|
@ -711,7 +747,9 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
Patch(bind(api.EditHookOption{}), repo.EditHook).
|
Patch(bind(api.EditHookOption{}), repo.EditHook).
|
||||||
Delete(repo.DeleteHook)
|
Delete(repo.DeleteHook)
|
||||||
m.Post("/tests", context.RepoRef(), repo.TestHook)
|
m.Post("/tests", context.RepoRef(), repo.TestHook)
|
||||||
|
m.Get("/hooktasks", repo.ListHookTask)
|
||||||
})
|
})
|
||||||
|
|
||||||
m.Group("/git", func() {
|
m.Group("/git", func() {
|
||||||
m.Combo("").Get(repo.ListGitHooks)
|
m.Combo("").Get(repo.ListGitHooks)
|
||||||
m.Group("/:id", func() {
|
m.Group("/:id", func() {
|
||||||
|
@ -954,8 +992,8 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
// Organizations
|
// Organizations
|
||||||
m.Get("/user/orgs", reqToken(), org.ListMyOrgs)
|
m.Get("/user/orgs", reqToken(), org.ListMyOrgs)
|
||||||
m.Get("/users/:username/orgs", org.ListUserOrgs)
|
m.Get("/users/:username/orgs", org.ListUserOrgs)
|
||||||
// modified on 2021-01-14 begin 创建组织时返回默认的团队 begin
|
// modified on 2021-01-14 begin 创建组织时返回默认的团队 begin
|
||||||
//m.Post("/orgs", reqToken(), bind(api.CreateOrgOption{}), org.Create)
|
//m.Post("/orgs", reqToken(), bind(api.CreateOrgOption{}), org.Create)
|
||||||
m.Post("/orgs", reqToken(), bind(api.CreateOrgOption{}), org.CreateExt)
|
m.Post("/orgs", reqToken(), bind(api.CreateOrgOption{}), org.CreateExt)
|
||||||
// modified on 2021-01-14 begin 创建组织时返回默认的团队 end
|
// modified on 2021-01-14 begin 创建组织时返回默认的团队 end
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
package repo
|
package repo
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
_ "fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"code.gitea.io/gitea/models"
|
"code.gitea.io/gitea/models"
|
||||||
|
@ -264,3 +265,56 @@ func DeleteHook(ctx *context.APIContext) {
|
||||||
}
|
}
|
||||||
ctx.Status(http.StatusNoContent)
|
ctx.Status(http.StatusNoContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ListHookTask(ctx *context.APIContext) {
|
||||||
|
// swagger:operation GET /repos/{owner}/{repo}/hooks/{id}/hooktasks repository repoGetHookTasks
|
||||||
|
// ---
|
||||||
|
// summary: Get a hooktasks
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
|
// parameters:
|
||||||
|
// - name: owner
|
||||||
|
// in: path
|
||||||
|
// description: owner of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: repo
|
||||||
|
// in: path
|
||||||
|
// description: name of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: id
|
||||||
|
// in: path
|
||||||
|
// description: id of the hook
|
||||||
|
// type: integer
|
||||||
|
// format: int64
|
||||||
|
// required: true
|
||||||
|
// - name: page
|
||||||
|
// in: query
|
||||||
|
// description: page number of results to return (1-based)
|
||||||
|
// type: integer
|
||||||
|
// - name: limit
|
||||||
|
// in: query
|
||||||
|
// description: page size of results
|
||||||
|
// type: integer
|
||||||
|
// responses:
|
||||||
|
// "200":
|
||||||
|
// "$ref": "#/responses/HookTaskList"
|
||||||
|
hook, err := utils.GetRepoHook(ctx, ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
|
||||||
|
if err != nil {
|
||||||
|
ctx.NotFound()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
hookTasks, err := models.GetHookTasksByRepoIDAndHookID(ctx.Repo.Repository.ID, hook.ID, utils.GetListOptions(ctx))
|
||||||
|
if err != nil {
|
||||||
|
ctx.Error(http.StatusInternalServerError, "GetHookTasksByRepoIDAndHookID", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
apiHookTasks := make([]*api.HookTask, len(hookTasks))
|
||||||
|
for i := range hookTasks {
|
||||||
|
apiHookTasks[i] = convert.ToHookTask(hookTasks[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.JSON(http.StatusOK, &apiHookTasks)
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,416 @@
|
||||||
|
package repo
|
||||||
|
|
||||||
|
//
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"sort"
|
||||||
|
|
||||||
|
"code.gitea.io/gitea/models"
|
||||||
|
"code.gitea.io/gitea/modules/context"
|
||||||
|
"code.gitea.io/gitea/modules/markup/markdown"
|
||||||
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
"code.gitea.io/gitea/modules/wikies"
|
||||||
|
wiki_service "code.gitea.io/gitea/services/wiki"
|
||||||
|
)
|
||||||
|
|
||||||
|
func WikiList(ctx *context.APIContext) {
|
||||||
|
// swagger:operation GET /repos/{owner}/{repo}/wikies repository repoWikiList
|
||||||
|
// ---
|
||||||
|
// summary: List the wikies in a repository
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
|
// parameters:
|
||||||
|
// - name: owner
|
||||||
|
// in: path
|
||||||
|
// description: owner of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: repo
|
||||||
|
// in: path
|
||||||
|
// description: name of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// responses:
|
||||||
|
// "200":
|
||||||
|
// "$ref": "#/responses/WikiList"
|
||||||
|
|
||||||
|
if !ctx.Repo.Repository.HasWiki() {
|
||||||
|
ctx.CheckHasWiki()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
repository := ctx.Repo.Repository
|
||||||
|
wikiCloneLink := repository.CloneWikiLink()
|
||||||
|
wikiRepo, commit, err := wikies.FindWikiRepoCommit(ctx)
|
||||||
|
if err != nil {
|
||||||
|
if wikiRepo != nil {
|
||||||
|
wikiRepo.Close()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
entries, err := commit.ListEntries()
|
||||||
|
if err != nil {
|
||||||
|
if wikiRepo != nil {
|
||||||
|
wikiRepo.Close()
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wikiesList := make([]api.WikiesResponse, 0, len(entries))
|
||||||
|
for _, entry := range entries {
|
||||||
|
if !entry.IsRegular() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
//c, err := wikiRepo.GetCommitByPath(entry.Name())
|
||||||
|
lastCommit, firstCommit, err := wikiRepo.GetFirstAndLastCommitByPath("master", entry.Name())
|
||||||
|
if err != nil {
|
||||||
|
if wikiRepo != nil {
|
||||||
|
wikiRepo.Close()
|
||||||
|
}
|
||||||
|
ctx.ServerError("GetCommit", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wikiName, err := wiki_service.FilenameToName(entry.Name())
|
||||||
|
if err != nil {
|
||||||
|
if models.IsErrWikiInvalidFileName(err) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if wikiRepo != nil {
|
||||||
|
wikiRepo.Close()
|
||||||
|
}
|
||||||
|
ctx.ServerError("WikiFilenameToName", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wikiesList = append(wikiesList, api.WikiesResponse{
|
||||||
|
WikiCloneLink: api.CloneLink{
|
||||||
|
HTTPS: wikiCloneLink.HTTPS,
|
||||||
|
SSH: wikiCloneLink.SSH,
|
||||||
|
},
|
||||||
|
WikiMeta: api.WikiMeta{
|
||||||
|
Name: wikiName,
|
||||||
|
Commit: api.WikiCommit{
|
||||||
|
Author: api.WikiUser{
|
||||||
|
Name: lastCommit.Author.Name,
|
||||||
|
Email: lastCommit.Author.Email,
|
||||||
|
When: lastCommit.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
Commiter: api.WikiUser{
|
||||||
|
Name: lastCommit.Committer.Name,
|
||||||
|
Email: lastCommit.Committer.Email,
|
||||||
|
When: lastCommit.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
ID: lastCommit.ID.String(),
|
||||||
|
Message: lastCommit.Message(),
|
||||||
|
},
|
||||||
|
FirstCommit: api.WikiCommit{
|
||||||
|
Author: api.WikiUser{
|
||||||
|
Name: firstCommit.Author.Name,
|
||||||
|
Email: firstCommit.Author.Email,
|
||||||
|
When: firstCommit.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
Commiter: api.WikiUser{
|
||||||
|
Name: firstCommit.Committer.Name,
|
||||||
|
Email: firstCommit.Committer.Email,
|
||||||
|
When: firstCommit.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
ID: firstCommit.ID.String(),
|
||||||
|
Message: firstCommit.Message(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据创建时间,按最新的时间排序
|
||||||
|
sort.Slice(wikiesList, func(i, j int) bool {
|
||||||
|
return wikiesList[i].FirstCommit.Author.When > wikiesList[j].FirstCommit.Author.When
|
||||||
|
})
|
||||||
|
ctx.JSON(http.StatusOK, wikiesList)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetWiki(ctx *context.APIContext) {
|
||||||
|
// swagger:operation GET /repos/{owner}/{repo}/wikies/{pagename} repository repoGetWiki
|
||||||
|
// ---
|
||||||
|
// summary: Get a Wiki
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
|
// parameters:
|
||||||
|
// - name: owner
|
||||||
|
// in: path
|
||||||
|
// description: owner of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: repo
|
||||||
|
// in: path
|
||||||
|
// description: name of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: pagename
|
||||||
|
// in: path
|
||||||
|
// description: name of the wikipage
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// responses:
|
||||||
|
// "200":
|
||||||
|
// "$ref": "#/responses/Wiki"
|
||||||
|
|
||||||
|
wikiRepo, commit, _ := wikies.FindWikiRepoCommit(ctx)
|
||||||
|
repository := ctx.Repo.Repository
|
||||||
|
wikiCloneLink := repository.CloneWikiLink()
|
||||||
|
pageName := wiki_service.NormalizeWikiName(ctx.Params(":page"))
|
||||||
|
if len(pageName) == 0 {
|
||||||
|
pageName = "Home"
|
||||||
|
}
|
||||||
|
data, entry, pageFilename, noEntry := wikies.WikiContentsByName(ctx, commit, pageName)
|
||||||
|
if noEntry {
|
||||||
|
ctx.NotFound()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if entry == nil || ctx.Written() {
|
||||||
|
if wikiRepo != nil {
|
||||||
|
wikiRepo.Close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
metas := ctx.Repo.Repository.ComposeDocumentMetas()
|
||||||
|
PageContent := markdown.RenderWiki(data, ctx.Repo.RepoLink, metas)
|
||||||
|
|
||||||
|
c, err := wikiRepo.GetCommitByPath(entry.Name())
|
||||||
|
if err != nil {
|
||||||
|
if models.IsErrWikiInvalidFileName(err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
|
||||||
|
wiki := api.WikiResponse{
|
||||||
|
WikiCloneLink: api.CloneLink{
|
||||||
|
HTTPS: wikiCloneLink.HTTPS,
|
||||||
|
SSH: wikiCloneLink.SSH,
|
||||||
|
},
|
||||||
|
WikiMeta: api.WikiMeta{
|
||||||
|
Name: pageName,
|
||||||
|
Commit: api.WikiCommit{
|
||||||
|
Author: api.WikiUser{
|
||||||
|
Name: c.Author.Name,
|
||||||
|
Email: c.Author.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
Commiter: api.WikiUser{
|
||||||
|
Name: c.Committer.Name,
|
||||||
|
Email: c.Committer.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
ID: c.ID.String(),
|
||||||
|
Message: c.Message(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
CommitCounts: commitsCount,
|
||||||
|
MdContent: string(data),
|
||||||
|
SimpleContent: PageContent,
|
||||||
|
}
|
||||||
|
ctx.JSON(http.StatusOK, wiki)
|
||||||
|
}
|
||||||
|
|
||||||
|
func CreateWiki(ctx *context.APIContext, form api.WikiOption) {
|
||||||
|
// swagger:operation POST /repos/{owner}/{repo}/wikies repository repoCreateWiki
|
||||||
|
// ---
|
||||||
|
// summary: Create a wiki in a repository
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
|
// parameters:
|
||||||
|
// - name: owner
|
||||||
|
// in: path
|
||||||
|
// description: owner of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: repo
|
||||||
|
// in: path
|
||||||
|
// description: name of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: body
|
||||||
|
// in: body
|
||||||
|
// schema:
|
||||||
|
// "$ref": "#/definitions/WikiOption"
|
||||||
|
// responses:
|
||||||
|
// "200":
|
||||||
|
// "$ref": "#/responses/Wiki"
|
||||||
|
|
||||||
|
err1 := wiki_service.CheckFile(form.Name)
|
||||||
|
if err1 != nil {
|
||||||
|
ctx.FileNameError()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
repository := ctx.Repo.Repository
|
||||||
|
wikiCloneLink := repository.CloneWikiLink()
|
||||||
|
if util.IsEmptyString(form.Name) {
|
||||||
|
//ctx.RenderWithErr(ctx.Tr("repo.issues.new.title_empty"), nil, form)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
wikiName := wiki_service.NormalizeWikiName(form.Name)
|
||||||
|
if len(form.CommitMessage) == 0 {
|
||||||
|
form.CommitMessage = ctx.Tr("repo.editor.add", form.Name)
|
||||||
|
}
|
||||||
|
if err := wiki_service.AddWikiPage(ctx.User, ctx.Repo.Repository, wikiName, form.Content, form.CommitMessage); err != nil {
|
||||||
|
|
||||||
|
if models.IsErrWikiReservedName(err) {
|
||||||
|
ctx.Error(http.StatusInternalServerError, "WikiNameIsReservedPage", "wiki名称是被保留的.")
|
||||||
|
} else if models.IsErrWikiAlreadyExist(err) {
|
||||||
|
ctx.Error(http.StatusConflict, "WikiNameAlreadyExist", "wiki名称已存在")
|
||||||
|
} else {
|
||||||
|
ctx.Error(http.StatusInternalServerError, "AddWikiPage", err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wikiRepo, commit, _ := wikies.FindWikiRepoCommit(ctx)
|
||||||
|
data, entry, pageFilename, _ := wikies.WikiContentsByName(ctx, commit, form.Name)
|
||||||
|
metas := ctx.Repo.Repository.ComposeDocumentMetas()
|
||||||
|
PageContent := markdown.RenderWiki(data, ctx.Repo.RepoLink, metas)
|
||||||
|
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
|
||||||
|
c, err := wikiRepo.GetCommitByPath(entry.Name())
|
||||||
|
if err != nil {
|
||||||
|
if models.IsErrWikiInvalidFileName(err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wiki := api.WikiResponse{
|
||||||
|
WikiCloneLink: api.CloneLink{
|
||||||
|
HTTPS: wikiCloneLink.HTTPS,
|
||||||
|
SSH: wikiCloneLink.SSH,
|
||||||
|
},
|
||||||
|
WikiMeta: api.WikiMeta{
|
||||||
|
Name: form.Name,
|
||||||
|
Commit: api.WikiCommit{
|
||||||
|
Author: api.WikiUser{
|
||||||
|
Name: c.Author.Name,
|
||||||
|
Email: c.Author.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
Commiter: api.WikiUser{
|
||||||
|
Name: c.Committer.Name,
|
||||||
|
Email: c.Committer.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
ID: c.ID.String(),
|
||||||
|
Message: c.Message(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
CommitCounts: commitsCount,
|
||||||
|
MdContent: string(data),
|
||||||
|
SimpleContent: PageContent,
|
||||||
|
}
|
||||||
|
ctx.JSON(http.StatusOK, wiki)
|
||||||
|
}
|
||||||
|
|
||||||
|
func EditWiki(ctx *context.APIContext, form api.WikiOption) {
|
||||||
|
// swagger:operation PATCH /repos/{owner}/{repo}/wikies/{pagename} repository repoEditWiki
|
||||||
|
// ---
|
||||||
|
// summary: Edit a wiki in a repository
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
|
// parameters:
|
||||||
|
// - name: owner
|
||||||
|
// in: path
|
||||||
|
// description: owner of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: repo
|
||||||
|
// in: path
|
||||||
|
// description: name of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: pagename
|
||||||
|
// in: path
|
||||||
|
// description: name of the wiki
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: body
|
||||||
|
// in: body
|
||||||
|
// schema:
|
||||||
|
// "$ref": "#/definitions/WikiOption"
|
||||||
|
// responses:
|
||||||
|
// "201":
|
||||||
|
// "$ref": "#/responses/Wiki"
|
||||||
|
|
||||||
|
//Determine the byte size
|
||||||
|
newWikiName := wiki_service.NormalizeWikiName(form.Name)
|
||||||
|
err1 := wiki_service.CheckFile(newWikiName)
|
||||||
|
if err1 != nil {
|
||||||
|
ctx.FileNameError()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
wikies.EditWikiPost(ctx,form)
|
||||||
|
wikiRepo, commit1, _ := wikies.FindWikiRepoCommit(ctx)
|
||||||
|
data, entry, pageFilename, _ := wikies.WikiContentsByName(ctx, commit1,form.Name)
|
||||||
|
|
||||||
|
c, err := wikiRepo.GetCommitByPath(entry.Name())
|
||||||
|
if err != nil {
|
||||||
|
if models.IsErrWikiInvalidFileName(err) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
commitsCount, _ := wikiRepo.FileCommitsCount("master", pageFilename)
|
||||||
|
metas := ctx.Repo.Repository.ComposeDocumentMetas()
|
||||||
|
PageContent := markdown.RenderWiki(data, ctx.Repo.RepoLink, metas)
|
||||||
|
|
||||||
|
wiki := api.WikiResponse{
|
||||||
|
WikiMeta: api.WikiMeta{
|
||||||
|
Name: form.Name,
|
||||||
|
Commit: api.WikiCommit{
|
||||||
|
Author: api.WikiUser{
|
||||||
|
Name: c.Author.Name,
|
||||||
|
Email: c.Author.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
Commiter: api.WikiUser{
|
||||||
|
Name: c.Committer.Name,
|
||||||
|
Email: c.Committer.Email,
|
||||||
|
When: c.Author.When.Unix(),
|
||||||
|
},
|
||||||
|
ID: c.ID.String(),
|
||||||
|
Message: c.Message(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
CommitCounts: commitsCount,
|
||||||
|
MdContent: string(data),
|
||||||
|
SimpleContent: PageContent,
|
||||||
|
}
|
||||||
|
ctx.JSON(http.StatusOK, wiki)
|
||||||
|
}
|
||||||
|
func DeleteWiki(ctx *context.APIContext) {
|
||||||
|
// swagger:operation DELETE /repos/{owner}/{repo}/wikies/{pagename} repository repoDeleteWiki
|
||||||
|
// ---
|
||||||
|
// summary: Delete a wiki in a repository
|
||||||
|
// produces:
|
||||||
|
// - application/json
|
||||||
|
// parameters:
|
||||||
|
// - name: owner
|
||||||
|
// in: path
|
||||||
|
// description: owner of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: repo
|
||||||
|
// in: path
|
||||||
|
// description: name of the repo
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// - name: pagename
|
||||||
|
// in: path
|
||||||
|
// description: name of the wiki
|
||||||
|
// type: string
|
||||||
|
// required: true
|
||||||
|
// responses:
|
||||||
|
// "204":
|
||||||
|
// "$ref": "#/responses/empty"
|
||||||
|
// "500":
|
||||||
|
// "$ref": "#/responses/noFound"
|
||||||
|
|
||||||
|
wikiName := wiki_service.NormalizeWikiName(ctx.Params(":page"))
|
||||||
|
if len(wikiName) == 0 {
|
||||||
|
wikiName = "Home"
|
||||||
|
}
|
||||||
|
|
||||||
|
err2 := wiki_service.DeleteWikiPage(ctx.User, ctx.Repo.Repository, wikiName)
|
||||||
|
if err2 != nil {
|
||||||
|
ctx.FileExistError()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,6 +23,9 @@ type swaggerParameterBodies struct {
|
||||||
// in:body
|
// in:body
|
||||||
DeleteEmailOption api.DeleteEmailOption
|
DeleteEmailOption api.DeleteEmailOption
|
||||||
|
|
||||||
|
// in:body
|
||||||
|
WikiOption api.WikiOption
|
||||||
|
|
||||||
// in:body
|
// in:body
|
||||||
CreateHookOption api.CreateHookOption
|
CreateHookOption api.CreateHookOption
|
||||||
// in:body
|
// in:body
|
||||||
|
|
|
@ -85,6 +85,20 @@ type swaggerResponseReferenceList struct {
|
||||||
Body []api.Reference `json:"body"`
|
Body []api.Reference `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wiki
|
||||||
|
// swagger:response Wiki
|
||||||
|
type swaggerResponseWiki struct {
|
||||||
|
// in:body
|
||||||
|
Body api.WikiResponse `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// WikiList
|
||||||
|
// swagger:response WikiList
|
||||||
|
type swaggerResponseWikiList struct {
|
||||||
|
// in:body
|
||||||
|
Body api.WikiesResponse `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
// Hook
|
// Hook
|
||||||
// swagger:response Hook
|
// swagger:response Hook
|
||||||
type swaggerResponseHook struct {
|
type swaggerResponseHook struct {
|
||||||
|
@ -99,6 +113,13 @@ type swaggerResponseHookList struct {
|
||||||
Body []api.Hook `json:"body"`
|
Body []api.Hook `json:"body"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HookTaskList
|
||||||
|
// swagger:response HookTaskList
|
||||||
|
type swaggerResponseHookTaskList struct {
|
||||||
|
// in:body
|
||||||
|
Body []api.HookTask `json:"body"`
|
||||||
|
}
|
||||||
|
|
||||||
// GitHook
|
// GitHook
|
||||||
// swagger:response GitHook
|
// swagger:response GitHook
|
||||||
type swaggerResponseGitHook struct {
|
type swaggerResponseGitHook struct {
|
||||||
|
|
|
@ -66,6 +66,11 @@ func CheckCreateHookOption(ctx *context.APIContext, form *api.CreateHookOption)
|
||||||
ctx.Error(http.StatusUnprocessableEntity, "", "Invalid content type")
|
ctx.Error(http.StatusUnprocessableEntity, "", "Invalid content type")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !models.IsValidHookHttpMethod(form.Config["http_method"]) {
|
||||||
|
ctx.Error(http.StatusUnprocessableEntity, "", "Invalid http method")
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,13 +106,14 @@ func addHook(ctx *context.APIContext, form *api.CreateHookOption, orgID, repoID
|
||||||
if len(form.Events) == 0 {
|
if len(form.Events) == 0 {
|
||||||
form.Events = []string{"push"}
|
form.Events = []string{"push"}
|
||||||
}
|
}
|
||||||
|
|
||||||
w := &models.Webhook{
|
w := &models.Webhook{
|
||||||
OrgID: orgID,
|
OrgID: orgID,
|
||||||
RepoID: repoID,
|
RepoID: repoID,
|
||||||
URL: form.Config["url"],
|
URL: form.Config["url"],
|
||||||
ContentType: models.ToHookContentType(form.Config["content_type"]),
|
ContentType: models.ToHookContentType(form.Config["content_type"]),
|
||||||
Secret: form.Config["secret"],
|
Secret: form.Config["secret"],
|
||||||
HTTPMethod: "POST",
|
HTTPMethod: form.Config["http_method"],
|
||||||
HookEvent: &models.HookEvent{
|
HookEvent: &models.HookEvent{
|
||||||
ChooseEvents: true,
|
ChooseEvents: true,
|
||||||
HookEvents: models.HookEvents{
|
HookEvents: models.HookEvents{
|
||||||
|
@ -211,6 +217,9 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *models.Webho
|
||||||
if url, ok := form.Config["url"]; ok {
|
if url, ok := form.Config["url"]; ok {
|
||||||
w.URL = url
|
w.URL = url
|
||||||
}
|
}
|
||||||
|
if secret, ok := form.Config["secret"]; ok {
|
||||||
|
w.Secret = secret
|
||||||
|
}
|
||||||
if ct, ok := form.Config["content_type"]; ok {
|
if ct, ok := form.Config["content_type"]; ok {
|
||||||
if !models.IsValidHookContentType(ct) {
|
if !models.IsValidHookContentType(ct) {
|
||||||
ctx.Error(http.StatusUnprocessableEntity, "", "Invalid content type")
|
ctx.Error(http.StatusUnprocessableEntity, "", "Invalid content type")
|
||||||
|
@ -219,6 +228,14 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *models.Webho
|
||||||
w.ContentType = models.ToHookContentType(ct)
|
w.ContentType = models.ToHookContentType(ct)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if hm, ok := form.Config["http_method"]; ok {
|
||||||
|
if !models.IsValidHookHttpMethod(hm) {
|
||||||
|
ctx.Error(http.StatusUnprocessableEntity, "", "Invalid http method")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
w.HTTPMethod = hm
|
||||||
|
}
|
||||||
|
|
||||||
if w.HookTaskType == models.SLACK {
|
if w.HookTaskType == models.SLACK {
|
||||||
if channel, ok := form.Config["channel"]; ok {
|
if channel, ok := form.Config["channel"]; ok {
|
||||||
meta, err := json.Marshal(&webhook.SlackMeta{
|
meta, err := json.Marshal(&webhook.SlackMeta{
|
||||||
|
@ -244,18 +261,25 @@ func editHook(ctx *context.APIContext, form *api.EditHookOption, w *models.Webho
|
||||||
w.SendEverything = false
|
w.SendEverything = false
|
||||||
w.ChooseEvents = true
|
w.ChooseEvents = true
|
||||||
w.Create = com.IsSliceContainsStr(form.Events, string(models.HookEventCreate))
|
w.Create = com.IsSliceContainsStr(form.Events, string(models.HookEventCreate))
|
||||||
w.Push = com.IsSliceContainsStr(form.Events, string(models.HookEventPush))
|
|
||||||
w.PullRequest = com.IsSliceContainsStr(form.Events, string(models.HookEventPullRequest))
|
|
||||||
w.Create = com.IsSliceContainsStr(form.Events, string(models.HookEventCreate))
|
|
||||||
w.Delete = com.IsSliceContainsStr(form.Events, string(models.HookEventDelete))
|
w.Delete = com.IsSliceContainsStr(form.Events, string(models.HookEventDelete))
|
||||||
w.Fork = com.IsSliceContainsStr(form.Events, string(models.HookEventFork))
|
w.Fork = com.IsSliceContainsStr(form.Events, string(models.HookEventFork))
|
||||||
w.Issues = com.IsSliceContainsStr(form.Events, string(models.HookEventIssues))
|
w.Issues = com.IsSliceContainsStr(form.Events, string(models.HookEventIssues))
|
||||||
w.IssueComment = com.IsSliceContainsStr(form.Events, string(models.HookEventIssueComment))
|
w.Issues = issuesHook(form.Events, "issues_only")
|
||||||
|
w.IssueAssign = issuesHook(form.Events, string(models.HookEventIssueAssign))
|
||||||
|
w.IssueLabel = issuesHook(form.Events, string(models.HookEventIssueLabel))
|
||||||
|
w.IssueMilestone = issuesHook(form.Events, string(models.HookEventIssueMilestone))
|
||||||
|
w.IssueComment = issuesHook(form.Events, string(models.HookEventIssueComment))
|
||||||
w.Push = com.IsSliceContainsStr(form.Events, string(models.HookEventPush))
|
w.Push = com.IsSliceContainsStr(form.Events, string(models.HookEventPush))
|
||||||
w.PullRequest = com.IsSliceContainsStr(form.Events, string(models.HookEventPullRequest))
|
w.PullRequest = pullHook(form.Events, "pull_request_only")
|
||||||
|
w.PullRequestAssign = pullHook(form.Events, string(models.HookEventPullRequestAssign))
|
||||||
|
w.PullRequestLabel = pullHook(form.Events, string(models.HookEventPullRequestLabel))
|
||||||
|
w.PullRequestMilestone = pullHook(form.Events, string(models.HookEventPullRequestMilestone))
|
||||||
|
w.PullRequestComment = pullHook(form.Events, string(models.HookEventPullRequestComment))
|
||||||
|
w.PullRequestReview = pullHook(form.Events, "pull_request_review")
|
||||||
|
w.PullRequestSync = pullHook(form.Events, string(models.HookEventPullRequestSync))
|
||||||
w.Repository = com.IsSliceContainsStr(form.Events, string(models.HookEventRepository))
|
w.Repository = com.IsSliceContainsStr(form.Events, string(models.HookEventRepository))
|
||||||
w.Release = com.IsSliceContainsStr(form.Events, string(models.HookEventRelease))
|
w.Release = com.IsSliceContainsStr(form.Events, string(models.HookEventRelease))
|
||||||
w.BranchFilter = form.BranchFilter
|
w.HookEvent.BranchFilter = form.BranchFilter
|
||||||
|
|
||||||
if err := w.UpdateEvent(); err != nil {
|
if err := w.UpdateEvent(); err != nil {
|
||||||
ctx.Error(http.StatusInternalServerError, "UpdateEvent", err)
|
ctx.Error(http.StatusInternalServerError, "UpdateEvent", err)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
package wiki
|
package wiki
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
@ -65,6 +66,16 @@ func FilenameToName(filename string) (string, error) {
|
||||||
}
|
}
|
||||||
return NormalizeWikiName(unescaped), nil
|
return NormalizeWikiName(unescaped), nil
|
||||||
}
|
}
|
||||||
|
// check filename
|
||||||
|
func CheckFile(filename string) error {
|
||||||
|
if(len(filename) <= 150 ){
|
||||||
|
return nil
|
||||||
|
}else {
|
||||||
|
err := errors.New("The name is too long, please be less than 200 bytes")
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// InitWiki initializes a wiki for repository,
|
// InitWiki initializes a wiki for repository,
|
||||||
// it does nothing when repository already has wiki.
|
// it does nothing when repository already has wiki.
|
||||||
|
@ -134,6 +145,10 @@ func updateWikiPage(doer *models.User, repo *models.Repository, oldWikiName, new
|
||||||
}
|
}
|
||||||
|
|
||||||
newWikiPath := NameToFilename(newWikiName)
|
newWikiPath := NameToFilename(newWikiName)
|
||||||
|
|
||||||
|
//进行url解码
|
||||||
|
//newWikiPath, _ = url.QueryUnescape(newWikiPath)
|
||||||
|
|
||||||
if isNew {
|
if isNew {
|
||||||
filesInIndex, err := gitRepo.LsFiles(newWikiPath)
|
filesInIndex, err := gitRepo.LsFiles(newWikiPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -170,6 +185,8 @@ func updateWikiPage(doer *models.User, repo *models.Repository, oldWikiName, new
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("newWikiPath======================",newWikiPath)
|
||||||
|
|
||||||
if err := gitRepo.AddObjectToIndex("100644", objectHash, newWikiPath); err != nil {
|
if err := gitRepo.AddObjectToIndex("100644", objectHash, newWikiPath); err != nil {
|
||||||
log.Error("%v", err)
|
log.Error("%v", err)
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -3988,6 +3988,59 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/repos/{owner}/{repo}/hooks/{id}/hooktasks": {
|
||||||
|
"get": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Get a hooktasks",
|
||||||
|
"operationId": "repoGetHookTasks",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"description": "id of the hook",
|
||||||
|
"name": "id",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "page number of results to return (1-based)",
|
||||||
|
"name": "page",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "page size of results",
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"$ref": "#/responses/HookTaskList"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/repos/{owner}/{repo}/hooks/{id}/tests": {
|
"/repos/{owner}/{repo}/hooks/{id}/tests": {
|
||||||
"post": {
|
"post": {
|
||||||
"produces": [
|
"produces": [
|
||||||
|
@ -8847,6 +8900,203 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/repos/{owner}/{repo}/wikies": {
|
||||||
|
"get": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "List the wikies in a repository",
|
||||||
|
"operationId": "repoWikiList",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"$ref": "#/responses/WikiList"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Create a wiki in a repository",
|
||||||
|
"operationId": "repoCreateWiki",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiOption"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"$ref": "#/responses/Wiki"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/repos/{owner}/{repo}/wikies/{pagename}": {
|
||||||
|
"get": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Get a Wiki",
|
||||||
|
"operationId": "repoGetWiki",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the wikipage",
|
||||||
|
"name": "pagename",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"$ref": "#/responses/Wiki"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Delete a wiki in a repository",
|
||||||
|
"operationId": "repoDeleteWiki",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the wiki",
|
||||||
|
"name": "pagename",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"204": {
|
||||||
|
"$ref": "#/responses/empty"
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"$ref": "#/responses/noFound"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"patch": {
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"repository"
|
||||||
|
],
|
||||||
|
"summary": "Edit a wiki in a repository",
|
||||||
|
"operationId": "repoEditWiki",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "owner of the repo",
|
||||||
|
"name": "owner",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the repo",
|
||||||
|
"name": "repo",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "name of the wiki",
|
||||||
|
"name": "pagename",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "body",
|
||||||
|
"in": "body",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiOption"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"201": {
|
||||||
|
"$ref": "#/responses/Wiki"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/repositories/{id}": {
|
"/repositories/{id}": {
|
||||||
"get": {
|
"get": {
|
||||||
"produces": [
|
"produces": [
|
||||||
|
@ -11214,6 +11464,20 @@
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
},
|
},
|
||||||
|
"CloneLink": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"https": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "HTTPS"
|
||||||
|
},
|
||||||
|
"ssh": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "SSH"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
"Comment": {
|
"Comment": {
|
||||||
"description": "Comment represents a comment on a commit or issue",
|
"description": "Comment represents a comment on a commit or issue",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -13348,6 +13612,10 @@
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"x-go-name": "Active"
|
"x-go-name": "Active"
|
||||||
},
|
},
|
||||||
|
"branch_filter": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "BranchFilter"
|
||||||
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
|
@ -13384,6 +13652,74 @@
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
},
|
},
|
||||||
|
"HookTask": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"config": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"x-go-name": "Config"
|
||||||
|
},
|
||||||
|
"delivered": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "Delivered"
|
||||||
|
},
|
||||||
|
"event_type": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "EventType"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "ID"
|
||||||
|
},
|
||||||
|
"is_delivered": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-go-name": "IsDelivered"
|
||||||
|
},
|
||||||
|
"is_ssl": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-go-name": "IsSSL"
|
||||||
|
},
|
||||||
|
"is_succeed": {
|
||||||
|
"type": "boolean",
|
||||||
|
"x-go-name": "IsSucceed"
|
||||||
|
},
|
||||||
|
"payload_content": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"x-go-name": "PayloadContent"
|
||||||
|
},
|
||||||
|
"request_info": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"x-go-name": "RequestContent"
|
||||||
|
},
|
||||||
|
"response_content": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
|
"x-go-name": "ResponseContent"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Type"
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "UUID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
"Identity": {
|
"Identity": {
|
||||||
"description": "Identity for a person's identity like an author or committer",
|
"description": "Identity for a person's identity like an author or committer",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -15166,6 +15502,105 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiCommit": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"author": {
|
||||||
|
"$ref": "#/definitions/WikiUser"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "ID"
|
||||||
|
},
|
||||||
|
"message": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Message"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiOption": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"commit_message": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "CommitMessage"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Content"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"commit": {
|
||||||
|
"$ref": "#/definitions/WikiCommit"
|
||||||
|
},
|
||||||
|
"commit_counts": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "CommitCounts"
|
||||||
|
},
|
||||||
|
"md_content": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "MdContent"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
},
|
||||||
|
"simple_content": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "SimpleContent"
|
||||||
|
},
|
||||||
|
"wiki_clone_link": {
|
||||||
|
"$ref": "#/definitions/CloneLink"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiUser": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"email": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Email"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
},
|
||||||
|
"when": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64",
|
||||||
|
"x-go-name": "When"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
|
},
|
||||||
|
"WikiesResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"commit": {
|
||||||
|
"$ref": "#/definitions/WikiCommit"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"x-go-name": "Name"
|
||||||
|
},
|
||||||
|
"wiki_clone_link": {
|
||||||
|
"$ref": "#/definitions/CloneLink"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"x-go-package": "code.gitea.io/gitea/modules/structs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"responses": {
|
"responses": {
|
||||||
|
@ -15429,6 +15864,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"HookTaskList": {
|
||||||
|
"description": "HookTaskList",
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/HookTask"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Issue": {
|
"Issue": {
|
||||||
"description": "Issue",
|
"description": "Issue",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
@ -15808,6 +16252,18 @@
|
||||||
"$ref": "#/definitions/WatchInfo"
|
"$ref": "#/definitions/WatchInfo"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Wiki": {
|
||||||
|
"description": "Wiki",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"WikiList": {
|
||||||
|
"description": "WikiList",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/WikiesResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
"empty": {
|
"empty": {
|
||||||
"description": "APIEmpty is an empty response"
|
"description": "APIEmpty is an empty response"
|
||||||
},
|
},
|
||||||
|
@ -15939,4 +16395,4 @@
|
||||||
"TOTPHeader": []
|
"TOTPHeader": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -58,7 +58,6 @@ github.com/PuerkitoBio/goquery
|
||||||
# github.com/PuerkitoBio/purell v1.1.1
|
# github.com/PuerkitoBio/purell v1.1.1
|
||||||
github.com/PuerkitoBio/purell
|
github.com/PuerkitoBio/purell
|
||||||
# github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
|
# github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
|
||||||
## explicit
|
|
||||||
github.com/PuerkitoBio/urlesc
|
github.com/PuerkitoBio/urlesc
|
||||||
# github.com/RoaringBitmap/roaring v0.4.23
|
# github.com/RoaringBitmap/roaring v0.4.23
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -101,15 +100,12 @@ github.com/andybalholm/brotli
|
||||||
# github.com/andybalholm/cascadia v1.1.0
|
# github.com/andybalholm/cascadia v1.1.0
|
||||||
github.com/andybalholm/cascadia
|
github.com/andybalholm/cascadia
|
||||||
# github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239
|
# github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239
|
||||||
## explicit
|
|
||||||
github.com/anmitsu/go-shlex
|
github.com/anmitsu/go-shlex
|
||||||
# github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
|
# github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
|
||||||
github.com/asaskevich/govalidator
|
github.com/asaskevich/govalidator
|
||||||
# github.com/aymerick/douceur v0.2.0
|
# github.com/aymerick/douceur v0.2.0
|
||||||
## explicit
|
|
||||||
github.com/aymerick/douceur/css
|
github.com/aymerick/douceur/css
|
||||||
# github.com/beorn7/perks v1.0.1
|
# github.com/beorn7/perks v1.0.1
|
||||||
## explicit
|
|
||||||
github.com/beorn7/perks/quantile
|
github.com/beorn7/perks/quantile
|
||||||
# github.com/bgentry/speakeasy v0.1.0
|
# github.com/bgentry/speakeasy v0.1.0
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -180,7 +176,6 @@ github.com/chris-ramon/douceur/parser
|
||||||
github.com/couchbase/gomemcached
|
github.com/couchbase/gomemcached
|
||||||
github.com/couchbase/gomemcached/client
|
github.com/couchbase/gomemcached/client
|
||||||
# github.com/couchbase/goutils v0.0.0-20191018232750-b49639060d85
|
# github.com/couchbase/goutils v0.0.0-20191018232750-b49639060d85
|
||||||
## explicit
|
|
||||||
github.com/couchbase/goutils/logging
|
github.com/couchbase/goutils/logging
|
||||||
github.com/couchbase/goutils/scramsha
|
github.com/couchbase/goutils/scramsha
|
||||||
# github.com/couchbase/vellum v1.0.1
|
# github.com/couchbase/vellum v1.0.1
|
||||||
|
@ -199,7 +194,6 @@ github.com/couchbaselabs/go-couchbase
|
||||||
# github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
|
# github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
|
||||||
github.com/danwakefield/fnmatch
|
github.com/danwakefield/fnmatch
|
||||||
# github.com/davecgh/go-spew v1.1.1
|
# github.com/davecgh/go-spew v1.1.1
|
||||||
## explicit
|
|
||||||
github.com/davecgh/go-spew/spew
|
github.com/davecgh/go-spew/spew
|
||||||
# github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc
|
# github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -211,7 +205,6 @@ github.com/denisenkom/go-mssqldb/internal/querytext
|
||||||
## explicit
|
## explicit
|
||||||
github.com/dgrijalva/jwt-go
|
github.com/dgrijalva/jwt-go
|
||||||
# github.com/dlclark/regexp2 v1.2.0
|
# github.com/dlclark/regexp2 v1.2.0
|
||||||
## explicit
|
|
||||||
github.com/dlclark/regexp2
|
github.com/dlclark/regexp2
|
||||||
github.com/dlclark/regexp2/syntax
|
github.com/dlclark/regexp2/syntax
|
||||||
# github.com/dsnet/compress v0.0.1
|
# github.com/dsnet/compress v0.0.1
|
||||||
|
@ -245,10 +238,8 @@ github.com/ethantkoenig/rupture
|
||||||
# github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870
|
# github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870
|
||||||
## explicit
|
## explicit
|
||||||
# github.com/fatih/color v1.9.0
|
# github.com/fatih/color v1.9.0
|
||||||
## explicit
|
|
||||||
github.com/fatih/color
|
github.com/fatih/color
|
||||||
# github.com/fatih/structtag v1.2.0
|
# github.com/fatih/structtag v1.2.0
|
||||||
## explicit
|
|
||||||
github.com/fatih/structtag
|
github.com/fatih/structtag
|
||||||
# github.com/fsnotify/fsnotify v1.4.7
|
# github.com/fsnotify/fsnotify v1.4.7
|
||||||
github.com/fsnotify/fsnotify
|
github.com/fsnotify/fsnotify
|
||||||
|
@ -269,7 +260,6 @@ github.com/go-enry/go-enry/v2/regex
|
||||||
# github.com/go-enry/go-oniguruma v1.2.1
|
# github.com/go-enry/go-oniguruma v1.2.1
|
||||||
github.com/go-enry/go-oniguruma
|
github.com/go-enry/go-oniguruma
|
||||||
# github.com/go-git/gcfg v1.5.0
|
# github.com/go-git/gcfg v1.5.0
|
||||||
## explicit
|
|
||||||
github.com/go-git/gcfg
|
github.com/go-git/gcfg
|
||||||
github.com/go-git/gcfg/scanner
|
github.com/go-git/gcfg/scanner
|
||||||
github.com/go-git/gcfg/token
|
github.com/go-git/gcfg/token
|
||||||
|
@ -327,19 +317,12 @@ github.com/go-git/go-git/v5/utils/merkletrie/filesystem
|
||||||
github.com/go-git/go-git/v5/utils/merkletrie/index
|
github.com/go-git/go-git/v5/utils/merkletrie/index
|
||||||
github.com/go-git/go-git/v5/utils/merkletrie/internal/frame
|
github.com/go-git/go-git/v5/utils/merkletrie/internal/frame
|
||||||
github.com/go-git/go-git/v5/utils/merkletrie/noder
|
github.com/go-git/go-git/v5/utils/merkletrie/noder
|
||||||
# github.com/go-macaron/gzip v0.0.0-20200329073552-98214d7a897e
|
|
||||||
## explicit
|
|
||||||
# github.com/go-macaron/toolbox v0.0.0-20200329073429-4401f4ce0f55
|
|
||||||
## explicit
|
|
||||||
# github.com/go-openapi/analysis v0.19.5
|
# github.com/go-openapi/analysis v0.19.5
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/analysis
|
github.com/go-openapi/analysis
|
||||||
github.com/go-openapi/analysis/internal
|
github.com/go-openapi/analysis/internal
|
||||||
# github.com/go-openapi/errors v0.19.2
|
# github.com/go-openapi/errors v0.19.2
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/errors
|
github.com/go-openapi/errors
|
||||||
# github.com/go-openapi/inflect v0.19.0
|
# github.com/go-openapi/inflect v0.19.0
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/inflect
|
github.com/go-openapi/inflect
|
||||||
# github.com/go-openapi/jsonpointer v0.19.3
|
# github.com/go-openapi/jsonpointer v0.19.3
|
||||||
github.com/go-openapi/jsonpointer
|
github.com/go-openapi/jsonpointer
|
||||||
|
@ -347,11 +330,9 @@ github.com/go-openapi/jsonpointer
|
||||||
## explicit
|
## explicit
|
||||||
github.com/go-openapi/jsonreference
|
github.com/go-openapi/jsonreference
|
||||||
# github.com/go-openapi/loads v0.19.3
|
# github.com/go-openapi/loads v0.19.3
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/loads
|
github.com/go-openapi/loads
|
||||||
github.com/go-openapi/loads/fmts
|
github.com/go-openapi/loads/fmts
|
||||||
# github.com/go-openapi/runtime v0.19.5
|
# github.com/go-openapi/runtime v0.19.5
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/runtime
|
github.com/go-openapi/runtime
|
||||||
github.com/go-openapi/runtime/logger
|
github.com/go-openapi/runtime/logger
|
||||||
github.com/go-openapi/runtime/middleware
|
github.com/go-openapi/runtime/middleware
|
||||||
|
@ -360,16 +341,12 @@ github.com/go-openapi/runtime/middleware/header
|
||||||
github.com/go-openapi/runtime/middleware/untyped
|
github.com/go-openapi/runtime/middleware/untyped
|
||||||
github.com/go-openapi/runtime/security
|
github.com/go-openapi/runtime/security
|
||||||
# github.com/go-openapi/spec v0.19.3
|
# github.com/go-openapi/spec v0.19.3
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/spec
|
github.com/go-openapi/spec
|
||||||
# github.com/go-openapi/strfmt v0.19.3
|
# github.com/go-openapi/strfmt v0.19.3
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/strfmt
|
github.com/go-openapi/strfmt
|
||||||
# github.com/go-openapi/swag v0.19.5
|
# github.com/go-openapi/swag v0.19.5
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/swag
|
github.com/go-openapi/swag
|
||||||
# github.com/go-openapi/validate v0.19.3
|
# github.com/go-openapi/validate v0.19.3
|
||||||
## explicit
|
|
||||||
github.com/go-openapi/validate
|
github.com/go-openapi/validate
|
||||||
# github.com/go-redis/redis v6.15.2+incompatible
|
# github.com/go-redis/redis v6.15.2+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -384,7 +361,6 @@ github.com/go-redis/redis/internal/util
|
||||||
## explicit
|
## explicit
|
||||||
github.com/go-sql-driver/mysql
|
github.com/go-sql-driver/mysql
|
||||||
# github.com/go-stack/stack v1.8.0
|
# github.com/go-stack/stack v1.8.0
|
||||||
## explicit
|
|
||||||
github.com/go-stack/stack
|
github.com/go-stack/stack
|
||||||
# github.com/go-swagger/go-swagger v0.21.0
|
# github.com/go-swagger/go-swagger v0.21.0
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -418,20 +394,17 @@ github.com/gogs/cron
|
||||||
# github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe
|
# github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe
|
||||||
github.com/golang-sql/civil
|
github.com/golang-sql/civil
|
||||||
# github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721
|
# github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721
|
||||||
## explicit
|
|
||||||
github.com/golang/gddo/httputil
|
github.com/golang/gddo/httputil
|
||||||
github.com/golang/gddo/httputil/header
|
github.com/golang/gddo/httputil/header
|
||||||
# github.com/golang/protobuf v1.4.1
|
# github.com/golang/protobuf v1.4.1
|
||||||
## explicit
|
## explicit
|
||||||
github.com/golang/protobuf/proto
|
github.com/golang/protobuf/proto
|
||||||
# github.com/golang/snappy v0.0.1
|
# github.com/golang/snappy v0.0.1
|
||||||
## explicit
|
|
||||||
github.com/golang/snappy
|
github.com/golang/snappy
|
||||||
# github.com/google/go-github/v32 v32.1.0
|
# github.com/google/go-github/v32 v32.1.0
|
||||||
## explicit
|
## explicit
|
||||||
github.com/google/go-github/v32/github
|
github.com/google/go-github/v32/github
|
||||||
# github.com/google/go-querystring v1.0.0
|
# github.com/google/go-querystring v1.0.0
|
||||||
## explicit
|
|
||||||
github.com/google/go-querystring/query
|
github.com/google/go-querystring/query
|
||||||
# github.com/google/uuid v1.1.1
|
# github.com/google/uuid v1.1.1
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -440,10 +413,8 @@ github.com/google/uuid
|
||||||
## explicit
|
## explicit
|
||||||
github.com/gorilla/context
|
github.com/gorilla/context
|
||||||
# github.com/gorilla/css v1.0.0
|
# github.com/gorilla/css v1.0.0
|
||||||
## explicit
|
|
||||||
github.com/gorilla/css/scanner
|
github.com/gorilla/css/scanner
|
||||||
# github.com/gorilla/handlers v1.4.2
|
# github.com/gorilla/handlers v1.4.2
|
||||||
## explicit
|
|
||||||
github.com/gorilla/handlers
|
github.com/gorilla/handlers
|
||||||
# github.com/gorilla/mux v1.7.3
|
# github.com/gorilla/mux v1.7.3
|
||||||
github.com/gorilla/mux
|
github.com/gorilla/mux
|
||||||
|
@ -483,7 +454,6 @@ github.com/jaytaylor/html2text
|
||||||
# github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
|
# github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99
|
||||||
github.com/jbenet/go-context/io
|
github.com/jbenet/go-context/io
|
||||||
# github.com/jessevdk/go-flags v1.4.0
|
# github.com/jessevdk/go-flags v1.4.0
|
||||||
## explicit
|
|
||||||
github.com/jessevdk/go-flags
|
github.com/jessevdk/go-flags
|
||||||
# github.com/jmhodges/levigo v1.0.0
|
# github.com/jmhodges/levigo v1.0.0
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -519,7 +489,6 @@ github.com/klauspost/compress/zstd/internal/xxhash
|
||||||
# github.com/klauspost/pgzip v1.2.1
|
# github.com/klauspost/pgzip v1.2.1
|
||||||
github.com/klauspost/pgzip
|
github.com/klauspost/pgzip
|
||||||
# github.com/kr/pretty v0.1.0
|
# github.com/kr/pretty v0.1.0
|
||||||
## explicit
|
|
||||||
github.com/kr/pretty
|
github.com/kr/pretty
|
||||||
# github.com/kr/text v0.2.0
|
# github.com/kr/text v0.2.0
|
||||||
github.com/kr/text
|
github.com/kr/text
|
||||||
|
@ -536,10 +505,8 @@ github.com/lib/pq/scram
|
||||||
## explicit
|
## explicit
|
||||||
github.com/lunny/dingtalk_webhook
|
github.com/lunny/dingtalk_webhook
|
||||||
# github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de
|
# github.com/lunny/log v0.0.0-20160921050905-7887c61bf0de
|
||||||
## explicit
|
|
||||||
github.com/lunny/log
|
github.com/lunny/log
|
||||||
# github.com/lunny/nodb v0.0.0-20160621015157-fc1ef06ad4af
|
# github.com/lunny/nodb v0.0.0-20160621015157-fc1ef06ad4af
|
||||||
## explicit
|
|
||||||
github.com/lunny/nodb
|
github.com/lunny/nodb
|
||||||
github.com/lunny/nodb/config
|
github.com/lunny/nodb/config
|
||||||
github.com/lunny/nodb/store
|
github.com/lunny/nodb/store
|
||||||
|
@ -580,7 +547,6 @@ github.com/mattn/go-runewidth
|
||||||
## explicit
|
## explicit
|
||||||
github.com/mattn/go-sqlite3
|
github.com/mattn/go-sqlite3
|
||||||
# github.com/matttproud/golang_protobuf_extensions v1.0.1
|
# github.com/matttproud/golang_protobuf_extensions v1.0.1
|
||||||
## explicit
|
|
||||||
github.com/matttproud/golang_protobuf_extensions/pbutil
|
github.com/matttproud/golang_protobuf_extensions/pbutil
|
||||||
# github.com/mcuadros/go-version v0.0.0-20190308113854-92cdf37c5b75
|
# github.com/mcuadros/go-version v0.0.0-20190308113854-92cdf37c5b75
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -620,7 +586,6 @@ github.com/niklasfasching/go-org/org
|
||||||
# github.com/nwaples/rardecode v1.0.0
|
# github.com/nwaples/rardecode v1.0.0
|
||||||
github.com/nwaples/rardecode
|
github.com/nwaples/rardecode
|
||||||
# github.com/olekukonko/tablewriter v0.0.4
|
# github.com/olekukonko/tablewriter v0.0.4
|
||||||
## explicit
|
|
||||||
github.com/olekukonko/tablewriter
|
github.com/olekukonko/tablewriter
|
||||||
# github.com/oliamb/cutter v0.2.2
|
# github.com/oliamb/cutter v0.2.2
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -633,17 +598,14 @@ github.com/olivere/elastic/v7/uritemplates
|
||||||
# github.com/pelletier/go-toml v1.4.0
|
# github.com/pelletier/go-toml v1.4.0
|
||||||
github.com/pelletier/go-toml
|
github.com/pelletier/go-toml
|
||||||
# github.com/philhofer/fwd v1.0.0
|
# github.com/philhofer/fwd v1.0.0
|
||||||
## explicit
|
|
||||||
github.com/philhofer/fwd
|
github.com/philhofer/fwd
|
||||||
# github.com/pierrec/lz4 v2.0.5+incompatible
|
# github.com/pierrec/lz4 v2.0.5+incompatible
|
||||||
## explicit
|
|
||||||
github.com/pierrec/lz4
|
github.com/pierrec/lz4
|
||||||
github.com/pierrec/lz4/internal/xxh32
|
github.com/pierrec/lz4/internal/xxh32
|
||||||
# github.com/pkg/errors v0.9.1
|
# github.com/pkg/errors v0.9.1
|
||||||
## explicit
|
## explicit
|
||||||
github.com/pkg/errors
|
github.com/pkg/errors
|
||||||
# github.com/pmezard/go-difflib v1.0.0
|
# github.com/pmezard/go-difflib v1.0.0
|
||||||
## explicit
|
|
||||||
github.com/pmezard/go-difflib/difflib
|
github.com/pmezard/go-difflib/difflib
|
||||||
# github.com/pquerna/otp v1.2.0
|
# github.com/pquerna/otp v1.2.0
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -659,7 +621,6 @@ github.com/prometheus/client_golang/prometheus/promhttp
|
||||||
## explicit
|
## explicit
|
||||||
github.com/prometheus/client_model/go
|
github.com/prometheus/client_model/go
|
||||||
# github.com/prometheus/common v0.6.0
|
# github.com/prometheus/common v0.6.0
|
||||||
## explicit
|
|
||||||
github.com/prometheus/common/expfmt
|
github.com/prometheus/common/expfmt
|
||||||
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
|
github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
|
||||||
github.com/prometheus/common/model
|
github.com/prometheus/common/model
|
||||||
|
@ -684,8 +645,9 @@ github.com/shurcooL/httpfs/vfsutil
|
||||||
## explicit
|
## explicit
|
||||||
github.com/shurcooL/vfsgen
|
github.com/shurcooL/vfsgen
|
||||||
# github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d
|
# github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d
|
||||||
## explicit
|
|
||||||
github.com/siddontang/go-snappy/snappy
|
github.com/siddontang/go-snappy/snappy
|
||||||
|
# github.com/smartystreets/goconvey v1.6.4
|
||||||
|
## explicit
|
||||||
# github.com/spf13/afero v1.2.2
|
# github.com/spf13/afero v1.2.2
|
||||||
github.com/spf13/afero
|
github.com/spf13/afero
|
||||||
github.com/spf13/afero/mem
|
github.com/spf13/afero/mem
|
||||||
|
@ -696,7 +658,6 @@ github.com/spf13/jwalterweatherman
|
||||||
# github.com/spf13/pflag v1.0.5
|
# github.com/spf13/pflag v1.0.5
|
||||||
github.com/spf13/pflag
|
github.com/spf13/pflag
|
||||||
# github.com/spf13/viper v1.4.0
|
# github.com/spf13/viper v1.4.0
|
||||||
## explicit
|
|
||||||
github.com/spf13/viper
|
github.com/spf13/viper
|
||||||
# github.com/steveyen/gtreap v0.1.0
|
# github.com/steveyen/gtreap v0.1.0
|
||||||
github.com/steveyen/gtreap
|
github.com/steveyen/gtreap
|
||||||
|
@ -705,7 +666,6 @@ github.com/steveyen/gtreap
|
||||||
github.com/stretchr/testify/assert
|
github.com/stretchr/testify/assert
|
||||||
github.com/stretchr/testify/require
|
github.com/stretchr/testify/require
|
||||||
# github.com/syndtr/goleveldb v1.0.0
|
# github.com/syndtr/goleveldb v1.0.0
|
||||||
## explicit
|
|
||||||
github.com/syndtr/goleveldb/leveldb
|
github.com/syndtr/goleveldb/leveldb
|
||||||
github.com/syndtr/goleveldb/leveldb/cache
|
github.com/syndtr/goleveldb/leveldb/cache
|
||||||
github.com/syndtr/goleveldb/leveldb/comparer
|
github.com/syndtr/goleveldb/leveldb/comparer
|
||||||
|
@ -724,7 +684,6 @@ github.com/syndtr/goleveldb/leveldb/util
|
||||||
## explicit
|
## explicit
|
||||||
github.com/tinylib/msgp/msgp
|
github.com/tinylib/msgp/msgp
|
||||||
# github.com/toqueteos/webbrowser v1.2.0
|
# github.com/toqueteos/webbrowser v1.2.0
|
||||||
## explicit
|
|
||||||
github.com/toqueteos/webbrowser
|
github.com/toqueteos/webbrowser
|
||||||
# github.com/tstranex/u2f v1.0.0
|
# github.com/tstranex/u2f v1.0.0
|
||||||
## explicit
|
## explicit
|
||||||
|
@ -778,7 +737,6 @@ github.com/yuin/goldmark-meta
|
||||||
# go.etcd.io/bbolt v1.3.4
|
# go.etcd.io/bbolt v1.3.4
|
||||||
go.etcd.io/bbolt
|
go.etcd.io/bbolt
|
||||||
# go.mongodb.org/mongo-driver v1.1.1
|
# go.mongodb.org/mongo-driver v1.1.1
|
||||||
## explicit
|
|
||||||
go.mongodb.org/mongo-driver/bson
|
go.mongodb.org/mongo-driver/bson
|
||||||
go.mongodb.org/mongo-driver/bson/bsoncodec
|
go.mongodb.org/mongo-driver/bson/bsoncodec
|
||||||
go.mongodb.org/mongo-driver/bson/bsonrw
|
go.mongodb.org/mongo-driver/bson/bsonrw
|
||||||
|
@ -814,7 +772,6 @@ golang.org/x/crypto/ssh/agent
|
||||||
golang.org/x/crypto/ssh/internal/bcrypt_pbkdf
|
golang.org/x/crypto/ssh/internal/bcrypt_pbkdf
|
||||||
golang.org/x/crypto/ssh/knownhosts
|
golang.org/x/crypto/ssh/knownhosts
|
||||||
# golang.org/x/mod v0.2.0
|
# golang.org/x/mod v0.2.0
|
||||||
## explicit
|
|
||||||
golang.org/x/mod/module
|
golang.org/x/mod/module
|
||||||
golang.org/x/mod/semver
|
golang.org/x/mod/semver
|
||||||
# golang.org/x/net v0.0.0-20200602114024-627f9648deb9
|
# golang.org/x/net v0.0.0-20200602114024-627f9648deb9
|
||||||
|
@ -891,7 +848,6 @@ golang.org/x/tools/internal/gopathwalk
|
||||||
golang.org/x/tools/internal/imports
|
golang.org/x/tools/internal/imports
|
||||||
golang.org/x/tools/internal/packagesinternal
|
golang.org/x/tools/internal/packagesinternal
|
||||||
# golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
|
# golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
|
||||||
## explicit
|
|
||||||
golang.org/x/xerrors
|
golang.org/x/xerrors
|
||||||
golang.org/x/xerrors/internal
|
golang.org/x/xerrors/internal
|
||||||
# google.golang.org/appengine v1.6.5
|
# google.golang.org/appengine v1.6.5
|
||||||
|
@ -907,7 +863,6 @@ google.golang.org/appengine/internal/remote_api
|
||||||
google.golang.org/appengine/internal/urlfetch
|
google.golang.org/appengine/internal/urlfetch
|
||||||
google.golang.org/appengine/urlfetch
|
google.golang.org/appengine/urlfetch
|
||||||
# google.golang.org/protobuf v1.22.0
|
# google.golang.org/protobuf v1.22.0
|
||||||
## explicit
|
|
||||||
google.golang.org/protobuf/encoding/prototext
|
google.golang.org/protobuf/encoding/prototext
|
||||||
google.golang.org/protobuf/encoding/protowire
|
google.golang.org/protobuf/encoding/protowire
|
||||||
google.golang.org/protobuf/internal/descfmt
|
google.golang.org/protobuf/internal/descfmt
|
||||||
|
@ -950,10 +905,7 @@ gopkg.in/ini.v1
|
||||||
# gopkg.in/ldap.v3 v3.0.2
|
# gopkg.in/ldap.v3 v3.0.2
|
||||||
## explicit
|
## explicit
|
||||||
gopkg.in/ldap.v3
|
gopkg.in/ldap.v3
|
||||||
# gopkg.in/macaron.v1 v1.4.0
|
|
||||||
## explicit
|
|
||||||
# gopkg.in/warnings.v0 v0.1.2
|
# gopkg.in/warnings.v0 v0.1.2
|
||||||
## explicit
|
|
||||||
gopkg.in/warnings.v0
|
gopkg.in/warnings.v0
|
||||||
# gopkg.in/yaml.v2 v2.3.0
|
# gopkg.in/yaml.v2 v2.3.0
|
||||||
## explicit
|
## explicit
|
||||||
|
|
Loading…
Reference in New Issue