Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

go.mod 6.2KB

3 år sedan
Move macaron to chi (#14293) Use [chi](https://github.com/go-chi/chi) instead of the forked [macaron](https://gitea.com/macaron/macaron). Since macaron and chi have conflicts with session share, this big PR becomes a have-to thing. According my previous idea, we can replace macaron step by step but I'm wrong. :( Below is a list of big changes on this PR. - [x] Define `context.ResponseWriter` interface with an implementation `context.Response`. - [x] Use chi instead of macaron, and also a customize `Route` to wrap chi so that the router usage is similar as before. - [x] Create different routers for `web`, `api`, `internal` and `install` so that the codes will be more clear and no magic . - [x] Use https://github.com/unrolled/render instead of macaron's internal render - [x] Use https://github.com/NYTimes/gziphandler instead of https://gitea.com/macaron/gzip - [x] Use https://gitea.com/go-chi/session which is a modified version of https://gitea.com/macaron/session and removed `nodb` support since it will not be maintained. **BREAK** - [x] Use https://gitea.com/go-chi/captcha which is a modified version of https://gitea.com/macaron/captcha - [x] Use https://gitea.com/go-chi/cache which is a modified version of https://gitea.com/macaron/cache - [x] Use https://gitea.com/go-chi/binding which is a modified version of https://gitea.com/macaron/binding - [x] Use https://github.com/go-chi/cors instead of https://gitea.com/macaron/cors - [x] Dropped https://gitea.com/macaron/i18n and make a new one in `code.gitea.io/gitea/modules/translation` - [x] Move validation form structs from `code.gitea.io/gitea/modules/auth` to `code.gitea.io/gitea/modules/forms` to avoid dependency cycle. - [x] Removed macaron log service because it's not need any more. **BREAK** - [x] All form structs have to be get by `web.GetForm(ctx)` in the route function but not as a function parameter on routes definition. - [x] Move Git HTTP protocol implementation to use routers directly. - [x] Fix the problem that chi routes don't support trailing slash but macaron did. - [x] `/api/v1/swagger` now will be redirect to `/api/swagger` but not render directly so that `APIContext` will not create a html render. Notices: - Chi router don't support request with trailing slash - Integration test `TestUserHeatmap` maybe mysql version related. It's failed on my macOS(mysql 5.7.29 installed via brew) but succeed on CI. Co-authored-by: 6543 <6543@obermui.de>
3 år sedan
3 år sedan
3 år sedan
Improve listing performance by using go-git (#6478) * Use go-git for tree reading and commit info lookup. Signed-off-by: Filip Navara <navara@emclient.com> * Use TreeEntry.IsRegular() instead of ObjectType that was removed. Signed-off-by: Filip Navara <navara@emclient.com> * Use the treePath to optimize commit info search. Signed-off-by: Filip Navara <navara@emclient.com> * Extract the latest commit at treePath along with the other commits. Signed-off-by: Filip Navara <navara@emclient.com> * Fix listing commit info for a directory that was created in one commit and never modified after. Signed-off-by: Filip Navara <navara@emclient.com> * Avoid nearly all external 'git' invocations when doing directory listing (.editorconfig code path is still hit). Signed-off-by: Filip Navara <navara@emclient.com> * Use go-git for reading blobs. Signed-off-by: Filip Navara <navara@emclient.com> * Make SHA1 type alias for plumbing.Hash in go-git. Signed-off-by: Filip Navara <navara@emclient.com> * Make Signature type alias for object.Signature in go-git. Signed-off-by: Filip Navara <navara@emclient.com> * Fix GetCommitsInfo for repository with only one commit. Signed-off-by: Filip Navara <navara@emclient.com> * Fix PGP signature verification. Signed-off-by: Filip Navara <navara@emclient.com> * Fix issues with walking commit graph across merges. Signed-off-by: Filip Navara <navara@emclient.com> * Fix typo in condition. Signed-off-by: Filip Navara <navara@emclient.com> * Speed up loading branch list by keeping the repository reference (and thus all the loaded packfile indexes). Signed-off-by: Filip Navara <navara@emclient.com> * Fix lising submodules. Signed-off-by: Filip Navara <navara@emclient.com> * Fix build Signed-off-by: Filip Navara <navara@emclient.com> * Add back commit cache because of name-rev Signed-off-by: Filip Navara <navara@emclient.com> * Fix tests Signed-off-by: Filip Navara <navara@emclient.com> * Fix code style * Fix spelling * Address PR feedback Signed-off-by: Filip Navara <navara@emclient.com> * Update vendor module list Signed-off-by: Filip Navara <navara@emclient.com> * Fix getting trees by commit id Signed-off-by: Filip Navara <navara@emclient.com> * Fix remaining unit test failures * Fix GetTreeBySHA * Avoid running `git name-rev` if not necessary Signed-off-by: Filip Navara <navara@emclient.com> * Move Branch code to git module * Clean up GPG signature verification and fix it for tagged commits * Address PR feedback (import formatting, copyright headers) * Make blob lookup by SHA working * Update tests to use public API * Allow getting content from any type of object through the blob interface * Change test to actually expect the object content that is in the GIT repository * Change one more test to actually expect the object content that is in the GIT repository * Add comments
5 år sedan
3 år sedan
3 år sedan
3 år sedan
3 år sedan
Add single sign-on support via SSPI on Windows (#8463) * Add single sign-on support via SSPI on Windows * Ensure plugins implement interface * Ensure plugins implement interface * Move functions used only by the SSPI auth method to sspi_windows.go * Field SSPISeparatorReplacement of AuthenticationForm should not be required via binding, as binding will insist the field is non-empty even if another login type is selected * Fix breaking of oauth authentication on download links. Do not create new session with SSPI authentication on download links. * Update documentation for the new 'SPNEGO with SSPI' login source * Mention in documentation that ROOT_URL should contain the FQDN of the server * Make sure that Contexter is not checking for active login sources when the ORM engine is not initialized (eg. when installing) * Always initialize and free SSO methods, even if they are not enabled, as a method can be activated while the app is running (from Authentication sources) * Add option in SSPIConfig for removing of domains from logon names * Update helper text for StripDomainNames option * Make sure handleSignIn() is called after a new user object is created by SSPI auth method * Remove default value from text of form field helper Co-Authored-By: Lauris BH <lauris@nix.lv> * Remove default value from text of form field helper Co-Authored-By: Lauris BH <lauris@nix.lv> * Remove default value from text of form field helper Co-Authored-By: Lauris BH <lauris@nix.lv> * Only make a query to the DB to check if SSPI is enabled on handlers that need that information for templates * Remove code duplication * Log errors in ActiveLoginSources Co-Authored-By: Lauris BH <lauris@nix.lv> * Revert suffix of randomly generated E-mails for Reverse proxy authentication Co-Authored-By: Lauris BH <lauris@nix.lv> * Revert unneeded white-space change in template Co-Authored-By: Lauris BH <lauris@nix.lv> * Add copyright comments at the top of new files * Use loopback name for randomly generated emails * Add locale tag for the SSPISeparatorReplacement field with proper casing * Revert casing of SSPISeparatorReplacement field in locale file, moving it up, next to other form fields * Update docs/content/doc/features/authentication.en-us.md Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Remove Priority() method and define the order in which SSO auth methods should be executed in one place * Log authenticated username only if it's not empty * Rephrase helper text for automatic creation of users * Return error if more than one active SSPI auth source is found * Change newUser() function to return error, letting caller log/handle the error * Move isPublicResource, isPublicPage and handleSignIn functions outside SSPI auth method to allow other SSO methods to reuse them if needed * Refactor initialization of the list containing SSO auth methods * Validate SSPI settings on POST * Change SSPI to only perform authentication on its own login page, API paths and download links. Leave Toggle middleware to redirect non authenticated users to login page * Make 'Default language' in SSPI config empty, unless changed by admin * Show error if admin tries to add a second authentication source of type SSPI * Simplify declaration of global variable * Rebuild gitgraph.js on Linux * Make sure config values containing only whitespace are not accepted
4 år sedan
3 år sedan
3 år sedan
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. module code.gitea.io/gitea
  2. go 1.16
  3. require (
  4. cloud.google.com/go v0.78.0 // indirect
  5. code.gitea.io/gitea-vet v0.2.1
  6. code.gitea.io/sdk/gitea v0.14.0
  7. gitea.com/go-chi/binding v0.0.0-20211013065440-d16dc407c2be
  8. gitea.com/go-chi/cache v0.0.0-20211013020926-78790b11abf1
  9. gitea.com/go-chi/captcha v0.0.0-20211013065431-70641c1a35d5
  10. gitea.com/go-chi/session v0.0.0-20211013065435-7d334f340c09
  11. gitea.com/lunny/levelqueue v0.4.1
  12. github.com/Microsoft/go-winio v0.5.0 // indirect
  13. github.com/NYTimes/gziphandler v1.1.1
  14. github.com/ProtonMail/go-crypto v0.0.0-20210705153151-cc34b1f6908b // indirect
  15. github.com/PuerkitoBio/goquery v1.7.0
  16. github.com/RoaringBitmap/roaring v0.9.1 // indirect
  17. github.com/alecthomas/chroma v0.9.2
  18. github.com/andybalholm/brotli v1.0.3 // indirect
  19. github.com/andybalholm/cascadia v1.2.0 // indirect
  20. github.com/blevesearch/bleve/v2 v2.0.6
  21. github.com/boombuler/barcode v1.0.1 // indirect
  22. github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
  23. github.com/caddyserver/certmagic v0.14.1
  24. github.com/chi-middleware/proxy v1.1.1
  25. github.com/couchbase/go-couchbase v0.0.0-20210224140812-5740cd35f448 // indirect
  26. github.com/couchbase/gomemcached v0.1.2 // indirect
  27. github.com/couchbase/goutils v0.0.0-20210118111533-e33d3ffb5401 // indirect
  28. github.com/denisenkom/go-mssqldb v0.10.0
  29. github.com/djherbis/buffer v1.2.0
  30. github.com/djherbis/nio/v3 v3.0.1
  31. github.com/dustin/go-humanize v1.0.0
  32. github.com/editorconfig/editorconfig-core-go/v2 v2.4.2
  33. github.com/emirpasic/gods v1.12.0
  34. github.com/ethantkoenig/rupture v1.0.0
  35. github.com/gliderlabs/ssh v0.3.3
  36. github.com/go-asn1-ber/asn1-ber v1.5.3 // indirect
  37. github.com/go-chi/chi/v5 v5.0.4
  38. github.com/go-chi/cors v1.2.0
  39. github.com/go-enry/go-enry/v2 v2.7.1
  40. github.com/go-git/go-billy/v5 v5.3.1
  41. github.com/go-git/go-git/v5 v5.4.3-0.20210630082519-b4368b2a2ca4
  42. github.com/go-ldap/ldap/v3 v3.3.0
  43. github.com/go-redis/redis/v8 v8.11.0
  44. github.com/go-sql-driver/mysql v1.6.0
  45. github.com/go-swagger/go-swagger v0.27.0
  46. github.com/go-testfixtures/testfixtures/v3 v3.6.1
  47. github.com/gobwas/glob v0.2.3
  48. github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
  49. github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
  50. github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
  51. github.com/golang-jwt/jwt v3.2.2+incompatible
  52. github.com/golang/snappy v0.0.4 // indirect
  53. github.com/google/go-github/v39 v39.2.0
  54. github.com/google/uuid v1.2.0
  55. github.com/gorilla/feeds v1.1.1
  56. github.com/gorilla/mux v1.8.0 // indirect
  57. github.com/gorilla/sessions v1.2.1
  58. github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
  59. github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
  60. github.com/hashicorp/go-version v1.3.1
  61. github.com/hashicorp/golang-lru v0.5.4
  62. github.com/huandu/xstrings v1.3.2
  63. github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7
  64. github.com/json-iterator/go v1.1.11
  65. github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
  66. github.com/kevinburke/ssh_config v1.1.0 // indirect
  67. github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
  68. github.com/klauspost/compress v1.13.1
  69. github.com/klauspost/cpuid/v2 v2.0.9
  70. github.com/klauspost/pgzip v1.2.5 // indirect
  71. github.com/lib/pq v1.10.2
  72. github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
  73. github.com/markbates/goth v1.68.0
  74. github.com/mattn/go-isatty v0.0.13
  75. github.com/mattn/go-runewidth v0.0.13 // indirect
  76. github.com/mattn/go-sqlite3 v1.14.8
  77. github.com/mholt/archiver/v3 v3.5.0
  78. github.com/microcosm-cc/bluemonday v1.0.16
  79. github.com/miekg/dns v1.1.43 // indirect
  80. github.com/minio/md5-simd v1.1.2 // indirect
  81. github.com/minio/minio-go/v7 v7.0.12
  82. github.com/minio/sha256-simd v1.0.0 // indirect
  83. github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
  84. github.com/msteinert/pam v0.0.0-20201130170657-e61372126161
  85. github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
  86. github.com/niklasfasching/go-org v1.5.0
  87. github.com/olekukonko/tablewriter v0.0.5 // indirect
  88. github.com/oliamb/cutter v0.2.2
  89. github.com/olivere/elastic/v7 v7.0.25
  90. github.com/pelletier/go-toml v1.9.0 // indirect
  91. github.com/pierrec/lz4/v4 v4.1.8 // indirect
  92. github.com/pkg/errors v0.9.1
  93. github.com/pquerna/otp v1.3.0
  94. github.com/prometheus/client_golang v1.11.0
  95. github.com/quasoft/websspi v1.0.0
  96. github.com/rs/xid v1.3.0 // indirect
  97. github.com/russross/blackfriday/v2 v2.1.0 // indirect
  98. github.com/sergi/go-diff v1.2.0
  99. github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
  100. github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
  101. github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
  102. github.com/stretchr/testify v1.7.0
  103. github.com/syndtr/goleveldb v1.0.0
  104. github.com/tstranex/u2f v1.0.0
  105. github.com/ulikunitz/xz v0.5.10 // indirect
  106. github.com/unknwon/com v1.0.1
  107. github.com/unknwon/i18n v0.0.0-20210321134014-0ebbf2df1c44
  108. github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae
  109. github.com/unrolled/render v1.4.0
  110. github.com/urfave/cli v1.22.5
  111. github.com/xanzy/go-gitlab v0.50.1
  112. github.com/yohcop/openid-go v1.0.0
  113. github.com/yuin/goldmark v1.4.0
  114. github.com/yuin/goldmark-highlighting v0.0.0-20210516132338-9216f9c5aa01
  115. github.com/yuin/goldmark-meta v1.0.0
  116. go.etcd.io/bbolt v1.3.6 // indirect
  117. go.jolheiser.com/hcaptcha v0.0.4
  118. go.jolheiser.com/pwn v0.0.3
  119. go.uber.org/atomic v1.9.0 // indirect
  120. go.uber.org/multierr v1.7.0 // indirect
  121. go.uber.org/zap v1.19.0 // indirect
  122. golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
  123. golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
  124. golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
  125. golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf
  126. golang.org/x/text v0.3.7
  127. golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
  128. golang.org/x/tools v0.1.0
  129. google.golang.org/protobuf v1.27.1 // indirect
  130. gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
  131. gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
  132. gopkg.in/ini.v1 v1.62.0
  133. gopkg.in/yaml.v2 v2.4.0
  134. mvdan.cc/xurls/v2 v2.2.0
  135. strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
  136. xorm.io/builder v0.3.9
  137. xorm.io/xorm v1.2.5
  138. )
  139. replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
  140. replace github.com/golang-jwt/jwt v3.2.1+incompatible => github.com/golang-jwt/jwt v3.2.2+incompatible