A fork of Gitea (see branch `mj`) adding Majority Judgment Polls 𐄷 over Issues and Merge Requests. https://git.mieuxvoter.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
6.8 KiB

2 years ago
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>
2 years ago
2 years ago
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>
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
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
4 years ago
2 years ago
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>
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
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
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. module code.gitea.io/gitea
  2. go 1.14
  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-20210301195521-1fe1c9a555e7
  8. gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e
  9. gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e
  10. gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee
  11. gitea.com/lunny/levelqueue v0.3.0
  12. github.com/Microsoft/go-winio v0.4.16 // indirect
  13. github.com/NYTimes/gziphandler v1.1.1
  14. github.com/PuerkitoBio/goquery v1.5.1
  15. github.com/RoaringBitmap/roaring v0.5.5 // indirect
  16. github.com/alecthomas/chroma v0.8.2
  17. github.com/andybalholm/brotli v1.0.1 // indirect
  18. github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
  19. github.com/blevesearch/bleve/v2 v2.0.2
  20. github.com/boombuler/barcode v1.0.1 // indirect
  21. github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b // indirect
  22. github.com/caddyserver/certmagic v0.12.0
  23. github.com/chi-middleware/proxy v1.1.1
  24. github.com/couchbase/go-couchbase v0.0.0-20210224140812-5740cd35f448 // indirect
  25. github.com/couchbase/gomemcached v0.1.2 // indirect
  26. github.com/couchbase/goutils v0.0.0-20210118111533-e33d3ffb5401 // indirect
  27. github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
  28. github.com/denisenkom/go-mssqldb v0.9.0
  29. github.com/dgrijalva/jwt-go v3.2.0+incompatible
  30. github.com/dlclark/regexp2 v1.4.0 // indirect
  31. github.com/dustin/go-humanize v1.0.0
  32. github.com/editorconfig/editorconfig-core-go/v2 v2.4.1
  33. github.com/emirpasic/gods v1.12.0
  34. github.com/ethantkoenig/rupture v1.0.0
  35. github.com/gliderlabs/ssh v0.3.2
  36. github.com/glycerine/go-unsnap-stream v0.0.0-20210130063903-47dfef350d96 // indirect
  37. github.com/go-asn1-ber/asn1-ber v1.5.3 // indirect
  38. github.com/go-chi/chi v1.5.4
  39. github.com/go-chi/cors v1.1.1
  40. github.com/go-enry/go-enry/v2 v2.6.1
  41. github.com/go-git/go-billy/v5 v5.0.0
  42. github.com/go-git/go-git/v5 v5.2.0
  43. github.com/go-ldap/ldap/v3 v3.2.4
  44. github.com/go-openapi/errors v0.20.0 // indirect
  45. github.com/go-openapi/validate v0.20.2 // indirect
  46. github.com/go-redis/redis/v8 v8.6.0
  47. github.com/go-sql-driver/mysql v1.5.0
  48. github.com/go-swagger/go-swagger v0.26.1
  49. github.com/go-testfixtures/testfixtures/v3 v3.5.0
  50. github.com/gobwas/glob v0.2.3
  51. github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
  52. github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
  53. github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
  54. github.com/golang/snappy v0.0.3 // indirect
  55. github.com/google/go-github/v32 v32.1.0
  56. github.com/google/uuid v1.2.0
  57. github.com/gorilla/context v1.1.1
  58. github.com/gorilla/mux v1.8.0 // indirect
  59. github.com/gorilla/sessions v1.2.1 // indirect
  60. github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
  61. github.com/hashicorp/go-retryablehttp v0.6.8 // indirect
  62. github.com/hashicorp/go-version v1.2.1
  63. github.com/huandu/xstrings v1.3.2
  64. github.com/imdario/mergo v0.3.11 // indirect
  65. github.com/issue9/assert v1.3.2 // indirect
  66. github.com/issue9/identicon v1.0.1
  67. github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7
  68. github.com/json-iterator/go v1.1.10
  69. github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
  70. github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
  71. github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
  72. github.com/klauspost/compress v1.11.8
  73. github.com/klauspost/pgzip v1.2.5 // indirect
  74. github.com/lafriks/xormstore v1.4.0
  75. github.com/lib/pq v1.9.0
  76. github.com/libdns/libdns v0.2.0 // indirect
  77. github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
  78. github.com/mailru/easyjson v0.7.7 // indirect
  79. github.com/markbates/goth v1.67.1
  80. github.com/mattn/go-isatty v0.0.12
  81. github.com/mattn/go-runewidth v0.0.10 // indirect
  82. github.com/mattn/go-sqlite3 v1.14.6
  83. github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81
  84. github.com/mgechev/revive v1.0.3
  85. github.com/mholt/acmez v0.1.3 // indirect
  86. github.com/mholt/archiver/v3 v3.5.0
  87. github.com/microcosm-cc/bluemonday v1.0.7
  88. github.com/miekg/dns v1.1.40 // indirect
  89. github.com/minio/md5-simd v1.1.2 // indirect
  90. github.com/minio/minio-go/v7 v7.0.10
  91. github.com/minio/sha256-simd v1.0.0 // indirect
  92. github.com/mitchellh/go-homedir v1.1.0
  93. github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
  94. github.com/msteinert/pam v0.0.0-20201130170657-e61372126161
  95. github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
  96. github.com/niklasfasching/go-org v1.4.0
  97. github.com/olekukonko/tablewriter v0.0.5 // indirect
  98. github.com/oliamb/cutter v0.2.2
  99. github.com/olivere/elastic/v7 v7.0.22
  100. github.com/pelletier/go-toml v1.8.1
  101. github.com/pierrec/lz4/v4 v4.1.3 // indirect
  102. github.com/pkg/errors v0.9.1
  103. github.com/pquerna/otp v1.3.0
  104. github.com/prometheus/client_golang v1.9.0
  105. github.com/prometheus/common v0.18.0 // indirect
  106. github.com/prometheus/procfs v0.6.0 // indirect
  107. github.com/quasoft/websspi v1.0.0
  108. github.com/rivo/uniseg v0.2.0 // indirect
  109. github.com/russross/blackfriday/v2 v2.1.0 // indirect
  110. github.com/sergi/go-diff v1.1.0
  111. github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
  112. github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
  113. github.com/spf13/afero v1.5.1 // indirect
  114. github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
  115. github.com/stretchr/testify v1.7.0
  116. github.com/syndtr/goleveldb v1.0.0
  117. github.com/tinylib/msgp v1.1.5 // indirect
  118. github.com/tstranex/u2f v1.0.0
  119. github.com/ulikunitz/xz v0.5.10 // indirect
  120. github.com/unknwon/com v1.0.1
  121. github.com/unknwon/i18n v0.0.0-20200823051745-09abd91c7f2c
  122. github.com/unknwon/paginater v0.0.0-20200328080006-042474bd0eae
  123. github.com/unrolled/render v1.1.1
  124. github.com/urfave/cli v1.22.5
  125. github.com/willf/bitset v1.1.11 // indirect
  126. github.com/xanzy/go-gitlab v0.44.0
  127. github.com/xanzy/ssh-agent v0.3.0 // indirect
  128. github.com/yohcop/openid-go v1.0.0
  129. github.com/yuin/goldmark v1.3.3
  130. github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691
  131. github.com/yuin/goldmark-meta v1.0.0
  132. go.jolheiser.com/hcaptcha v0.0.4
  133. go.jolheiser.com/pwn v0.0.3
  134. go.uber.org/multierr v1.6.0 // indirect
  135. go.uber.org/zap v1.16.0 // indirect
  136. golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83
  137. golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
  138. golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93
  139. golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44
  140. golang.org/x/text v0.3.5
  141. golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
  142. golang.org/x/tools v0.1.0
  143. gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
  144. gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
  145. gopkg.in/ini.v1 v1.62.0
  146. gopkg.in/yaml.v2 v2.4.0
  147. mvdan.cc/xurls/v2 v2.2.0
  148. strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
  149. xorm.io/builder v0.3.9
  150. xorm.io/xorm v1.0.7
  151. )
  152. replace github.com/hashicorp/go-version => github.com/6543/go-version v1.2.4