aboutsummaryrefslogtreecommitdiffstats
path: root/build
Commit message (Collapse)AuthorAgeFilesLines
* Consume hcaptcha and pwn deps (#22610)John Olheiser2023-01-291-2/+5
| | | | | | | | | | | This PR just consumes the [hcaptcha](https://gitea.com/jolheiser/hcaptcha) and [haveibeenpwned](https://gitea.com/jolheiser/pwn) modules directly into Gitea. Also let this serve as a notice that I'm fine with transferring my license (which was already MIT) from my own name to "The Gitea Authors". Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Change use of Walk to WalkDir to improve disk performance (#22462)Felipe Leopoldo Sologuren Gutiérrez2023-01-161-2/+6
| | | | | | | | | | | | | As suggest by Go developers, use `filepath.WalkDir` instead of `filepath.Walk` because [*Walk is less efficient than WalkDir, introduced in Go 1.16, which avoids calling `os.Lstat` on every file or directory visited](https://pkg.go.dev/path/filepath#Walk). This proposition address that, in a similar way as https://github.com/go-gitea/gitea/pull/22392 did. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix unstable emoji sort (#22346)KN4CK3R2023-01-051-0/+4
| | | Without the second sort every generate run produces a different result.
* Update Emoji dataset to Unicode 14 (#22342)isla w2023-01-041-1/+1
| | | | | | | | | | | | | | Gitea emoji dataset was out of date because it gets manually built and hasn't been rebuilt since it was added. This means Gitea doesn't recognize some newer emoji or changes to existing ones. After changing the max unicode version to 14 I just ran: `go run build/generate-emoji.go` This should address the initial issue seen in #22153 where Gitea doesn't recognize a standard alias used elsewhere when importing content. 14 is the latest supported version from the upstream source as 15 is not widely supported (in their opinion) yet
* Update JS dependencies and eslint (#22190)silverwind2022-12-202-4/+4
| | | | | | | - Update all JS dependencies to latest version - Enable unicorn/prefer-node-protocol and autofix issues - Regenerate SVGs - Add some comments to eslint rules - Tested build, Mermaid and Katex rendering
* Implement FSFE REUSE for golang files (#21840)flynnnnnnnnnn2022-11-277-16/+9
| | | | | | | | | Change all license headers to comply with REUSE specification. Fix #16132 Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Simplify fmt-check (#21458)silverwind2022-10-162-13/+5
| | | | | | | | | `fmt-check` now simply does `fmt` before and relies on `git diff` like other checks like 'tidy-check' already do, so we can remove the argument in the tool that handles printing changed files. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use own Go version instead of hardcoded 1.17 for `make fmt` (#21457)Yarden Shoham2022-10-151-1/+12
| | | | | | | | We should make sure we're using the same version across the codebase. * We upgraded in #19918 but forgot about the following line https://github.com/go-gitea/gitea/blob/6bb6a108e0c03b323402b452fc05c6845f7d00df/build/code-batch-process.go#L273 Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* [API] teamSearch show teams with no members if user is admin (#21204)65432022-09-191-2/+2
| | | close #21176
* Generate go-licenses during tidy again (#21108)silverwind2022-09-091-1/+9
| | | | | | | | | | | | | | We can not have the `frontend` target depend on golang because of they way drone is set up. Move the `go-licenses` generation back into `tidy` where it will now also be checked for consistency during `tidy-check`. (I assume all `main` branch builds should currently fail [like this](https://drone.gitea.io/go-gitea/gitea/60244/1/11)). The reasony why it shouldn't be treated the same as for example `go generate` is because output files are checked in. tidy is imho the optimal target to run this after. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Rewrite go license generator in go (#21078)silverwind2022-09-072-30/+74
| | | | | | | | | | This removes the JS dependency in the checks pipeline. JSON output is different because the previous JS did indent the license data differently and a JSON key was changed, but the end result is the same as it gets re-indented by wepack. Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Add go licenses to licenses.txt (#21034)silverwind2022-09-041-0/+30
| | | | | | | `make go-licenses` will generate `assets/go-licenses.json` which is then included in the webpack build. This step depends on both go and node being present, so unfortunately, I could not automate the generation by hooking it up to `tidy` as that target is triggered on CI where we do not have a docker image with both go an node. It should be ran from time to time, ideally after each go mod update.
* Kd/ci playwright go test (#20123)Kyle D2022-09-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add initial playwright config * Simplify Makefile * Simplify Makefile * Use correct config files * Update playwright settings * Fix package-lock file * Don't use test logger for e2e tests * fix frontend lint * Allow passing TEST_LOGGER variable * Init postgres database * use standard gitea env variables * Update playwright * update drone * Move empty env var to commands * Cleanup * Move integrations to subfolder * tests integrations to tests integraton * Run e2e tests with go test * Fix linting * install CI deps * Add files to ESlint * Fix drone typo * Don't log to console in CI * Use go test http server * Add build step before tests * Move shared init function to common package * fix drone * Clean up tests * Fix linting * Better mocking for page + version string * Cleanup test generation * Remove dependency on gitea binary * Fix linting * add initial support for running specific tests * Add ACCEPT_VISUAL variable * don't require git-lfs * Add initial documentation * Review feedback * Add logged in session test * Attempt fixing drone race * Cleanup and bump version * Bump deps * Review feedback * simplify installation * Fix ci * Update install docs
* Go 1.19 format (#20758)John Olheiser2022-08-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 1.19 gofumpt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Change CSV test Signed-off-by: jolheiser <john.olheiser@gmail.com> * Commit whitespace fixes from @zeripath Co-authored-by: zeripath <art27@cantab.net> * Update emoji Signed-off-by: jolheiser <john.olheiser@gmail.com> * bump swagger & fix generate-swagger Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* chore: remove broken gitea-format-imports (#20952)Jason Song2022-08-251-26/+0
|
* Remove deprecated licenses (#20222)Gusted2022-08-221-0/+8
|
* Modernize JS build scripts (#19824)silverwind2022-06-062-33/+28
| | | | | | | | | | - Remove __dirname, use file URLs instead - Upgrade fabric dependency - Use fs/promises syntax, this breaks node 12 but we require 14 already The change in public/img/favicon.svg is not caused by the fabric upgrade, but it seems it was not properly generated when introduced. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add the possibility to allow the user to have a favicon which differs from ↵Jan-Eric Schober2022-05-231-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the main logo (#18542) * Changed the filename of the favicon SVG This allows the user to have a favicon which differs from the logo. * Added favicon.svg This is needed to accommodate the changes for allowing the user to have a differing logo and favicon * Adjusted page to accommodate what icon is used as favicon * Added functionality to also generate the favicon.svg via generate-images.js * Adjusted the description for the new favicon compatibility Co-authored-by: silverwind <me@silverwind.io> * Updated generate-images.js to generate favicons from a separate favicons.svg file This belongs to PR #18542. * Added description on how custom favicons can be generated * Replaced space indents with tabs * Synced changes with current state of the file * Synced changes with current state of the file Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Remove legacy `+build:` constraint (#19582)wxiaoguang2022-05-027-7/+0
| | | Go 1.17 and later use modern `//go:build` constraints, the old `// +build:` constraints should be removed.
* Use `go run` for tool dependencies, require go 1.17 (#18874)silverwind2022-03-151-3/+3
| | | | | | | | | | This ensures the tools only run in the versions we've tested and it also does not polute PATH with those tools so they are truly isolated. This syntax of `go run` requires go 1.17, so the minimum version is set accordingly. Fixes: https://github.com/go-gitea/gitea/issues/18867 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix `make fmt` and `make fmt-check` (#18633)silverwind2022-02-062-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Run 'make fmt' 'make fmt' currently produces this change, I'm not sure how CI did not fail on it, I made sure I have `mvdan.cc/gofumpt@latest`. * Fix 'make fmt-check' `make fmt-check` did not run all commands that `make fmt` did, resulting in missed diffs. Fix that by just depending on the `fmt` target. Includes: https://github.com/go-gitea/gitea/pull/18633 * Make gitea-fmt work with -l and -d and integrate gofumpt This implements -l, -w and -d with gitea-fmt and merges gofumpt. Signed-off-by: Andrew Thornton <art27@cantab.net> * as per silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review * use -l instead of -d for fmt-check Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net>
* format with gofumpt (#18184)65432022-01-207-25/+20
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Fix documents for development and bug report (#18249)wxiaoguang2022-01-131-2/+2
|
* Don't store assets modified time into generated files (#18193)Lunny Xiao2022-01-061-5/+10
|
* Update JS dependencies, adjust eslint config (#17904)silverwind2021-12-042-2/+2
| | | | | - Update all JS dependencies to latest versions - Add new lint rules, enable es2022 eslint parser features - Disable github/no-then, I feel the rule was too restricting
* Fix code formating (#17830)mscherer2021-11-271-1/+1
| | | * fix formatter, format imports first, then go fmt
* Add new JS linter rules (#17699)silverwind2021-11-222-2/+2
| | | | | | | | | | | | | | | | | | | | * Add new JS linter rules Adds a few useful rules from eslint-plugin-github. Notable changes: - Forbid dataset usage, its camel-casing behaviour makes it hard to grep for attributes. - Forbid .then() and .catch(), we should generally prefer await for new code. For rare cases where they are useful, a eslint-disable-line directive can be set. - Add docs js to linting * also enable github/array-foreach * small tweak Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Better builtin avatar generator (#17707)wxiaoguang2021-11-201-2/+2
| | | | | | | This PR fixes the builtin avatar generator. 1. The random background color makes some images very dirty. So now we only use white background for avatars. 2. We use left-right mirror avatars to satisfy #14799 3. Fix a small padding error in the algorithm
* Prepare and check test env during CI (#17725)wxiaoguang2021-11-192-0/+35
| | | | | | | | | | This PR should resolve the permission problems during CI, if the uid doesn't match, a more clear message is shown. * CI fails with unknown permission problems #17710 The new drone step dependencies: (root)prepare-test-env -> (gitea)build -> (gitea)test
* A better go code formatter, and now `make fmt` can run in Windows (#17684)wxiaoguang2021-11-174-0/+623
| | | | * go build / format tools * re-format imports
* Remove deprecated `extendDefaultPlugins` method of svgo (#17399)Mashiro2021-10-221-3/+4
|
* refactor: move from io/ioutil to io and os package (#17109)Eng Zer Jun2021-09-224-13/+11
| | | | | | | | | The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use filename as id/class prefix. (#16997)KN4CK3R2021-09-091-0/+1
| | | | | | | | | | | Currently the svg minifier (`make svg`) rewrites all `id` and `class` attributes in svg files. Every file gets the ids `a, b, ...`. If multiple svgs with ids are used on a page these ids are conflicting and the results are broken images. | minified ids | unique ids | | - | - | | ![grafik](https://user-images.githubusercontent.com/1666336/132579375-59d3996f-c4e5-43b8-8c8d-82280c90d9e3.png) | ![grafik](https://user-images.githubusercontent.com/1666336/132579413-05bf9285-4e3b-4d0d-8f95-90b212405b05.png) | This PR adds a prefix (the filename) to every id/class. Follow up problem: Because we embed svg images there are duplicated ids if one svg image is used multiple times on a page. As those ids refer to the same content it may be no real problem because browser handle that fine.
* Enable race detector for CI (#1441)Mura Li2021-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Enable race detector by default Set RACE_ENABLED=0 to disable it when release * Disable race detector for release builds * use `true` * fix * debug issue * fix * verbose * clean * Fix wrong merge * Fix coverage merge Co-authored-by: Mura Li <typeless@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add bundle download for repository (#14538)John Olheiser2021-08-245-0/+5
| | | | | | | | | | | | | | | | | * Add bundle download Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix fmt Signed-off-by: jolheiser <john.olheiser@gmail.com> * Fix build tags Signed-off-by: jolheiser <john.olheiser@gmail.com> * Download specific commit Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Update JS dependencies (#16708)silverwind2021-08-171-13/+8
| | | | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies - Adapt to recent webpack changes - Add new lint rules and fix issues - Regenerate SVGs and update svgo api usage Fixes: https://github.com/go-gitea/gitea/pull/16492 * adapt jest config and sort keys Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add an abstract json layout to make it's easier to change json library (#16528)Lunny Xiao2021-07-241-3/+1
| | | | | | | | | | | * Add an abstract json layout to make it's easier to change json library * Fix import * Fix import sequence * Fix blank lines * Fix blank lines
* Use binary version of revive linter (#15739)silverwind2021-05-091-325/+0
| | | | Use the common `go get` method to install and run the revive linter, removing the useless build/lint.go and related vendor libraries.
* Make build scripts compatible with node 12 (#15479)silverwind2021-04-152-2/+4
| | | | | | | | | | * Make build scripts compatible with node 12 "fs/promises" is not in node 12, use a more compatible way to import it. Also, lock major down versions of the image build dependencies to prevent future surprises. * add node_modules dependency
* Add frontend testing, require node 12 (#15315)silverwind2021-04-082-15/+13
| | | | | | | | | | - Add basic frontend unit testing infrastructure using jest in ESM mode - Rename 'make test' to 'make test-backend' - Introduce 'make test-frontend' and 'make test' that runs both - Bump Node.js requirement to v12. v10 will be EOL in less than a month. - Convert all build-related JS files to ESM. I opted to run frontend tests run as part of the compliance pipeline because they complete fast and are not platform-specific like the golang tests.
* Update JS dependencies (#15033)silverwind2021-03-222-29/+19
| | | | | | | | | | | | | * Update JS dependencies - Update all JS dependencies - For octicons, rename trashcan to trash - For svgo, migrate to v2 api, output seems to have slightly changed but icons look the same - For stylelint, update config, fix custom property duplicates - For monaco, drop legacy Edge support - For eslint, enable new rules, fix new issues - For less-loader, remove deprecated import syntax * update svgo usage in generate-images and rebuild logo.svg with it
* Migrate to use jsoniter instead of encoding/json (#14841)zeripath2021-03-011-1/+4
| | | | | | | | | | * Migrate to use jsoniter * fix tests * update gitea.com/go-chi/binding Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix typo in generate-emoji.go (#14570)Ikko Ashimine2021-02-041-1/+1
| | | | | modifer -> modifier Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use gitea.svg for public/img/gitea-gitea.svg instead of logo.svg (#14479)Kyle D2021-01-271-1/+1
|
* Consolidate Logos and update README header (#14136)silverwind2021-01-011-39/+18
| | | | | | | | | | | | | | | | | | | | * Consolidate Logos and update README header - Remove unused `logo-lg.png`, `logo-sm.png` and `logo-192.png`. - Consolidate `favicon.svg` and `logo.svg` to just `logo.svg`. - Remove Safari Mask icon, it seems to work fine with just `favicon.png` (no SVG support). - Remove Fluid Icon. It only served Firefox and SVG works just fine there. - Update customization instructions. - Update README.md to use SVG icon, increase logo size and center it and badges. * Update README_ZH.md Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * Update README_ZH.md Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* gitea png to logo (#13974)Kyle D2020-12-181-9/+28
| | | | | | | | | | | * gitea png to logo.svg * gitea safari svg to logo * minify svgs * Update english docs * Update missing section on customizing logo
* Clean up SVG (#13680)techknowlogick2020-12-171-19/+2
| | | | | | | | | | | | | | | * Clean up SVG * update per feedback * fix css style * Delete gitea.png * no new line at end of file * fix newline? Co-authored-by: 6543 <6543@obermui.de>
* Improve migrate page and add card CSS (#13751)silverwind2020-12-051-11/+19
| | | | | | | - Use original gitea logo on migrate page - Add card styles and map colors to css vars - Tweak migrate page, adding hover effect to cards Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Format files (#13698)65432020-11-281-2/+2
| | | | | | | | | | | | | | | | * align "make help" * format * untouch build/generate-svg.js * untouch .eslintrc * combine editorconfig's * rm editorconfig Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* update revive lint to latest commit (#12921)techknowlogick2020-09-221-2/+2
| | | | | | | * update revive lint to latest commit * make fmt * change import