* Add 'checks' Make and CI tasks
Introduce new "checks" targets that perform tasks that we've been piling
onto the linting tasks. This will make the linter tasks faster and
hopefully encourage some users to use them locally.
* add checks to --help
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix bug preventing transfer to private organization
The code assessing whether a private organization was visible to a user before
allowing transfer was incorrect due to testing membership the wrong way round
This PR fixes this issue and renames the function performing the test to be
clearer.
Further looking at the API for transfer repository - no testing was
performed to ensure that the acting user could actually see the new
owning organization.
Signed-off-by: Andrew Thornton <art27@cantab.net>
* change IsUserPartOfOrg everywhere
#12391 offered to change the default PID file from /var/run/gitea.pid however in discussion it was decided that this could break users of older systems. An alternative was offered that we could make the PID file compile/link time settable.
This PR does this, and changes the name of the setting from CustomPID to simply PIDFile. It also updates the from-source docs to show how to change the compiler settings to do this.
Closes#12391
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Florian Klink <flokli@flokli.de>
* go1.15
* update makefile xgo version
* fix vet issue
* update docs to version of go in use
* add TODO for asyncpreemptoff
Co-authored-by: Lauris BH <lauris@nix.lv>
Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util.
Fix#12339
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
* Add placeholder text for send testing email button in admin/config
* Change placeholder text to expecting email address
* Localize placeholder text
* Apply suggestion from @silverwind
ok
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Handle MSSQL constraints
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update models/migrations/v145.go
* Prevent hang with Sync2
* Agh it's uniques not indexes
* Let us try a different way of finding constraints on the language column
Signed-off-by: Andrew Thornton <art27@cantab.net>
* minor simplification
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Try drop index instead?
Signed-off-by: Andrew Thornton <art27@cantab.net>
This PR prevents 2 further ways of causing the redirect cookie to be set
to redirect back to /user/events
Signed-off-by: Andrew Thornton <art27@cantab.net>
Make previous fix from #12238 more robust since I saw a case where a diff changes only a single character in a chroma class instead of the entire thing. Add another more complicated test to match.
Co-authored-by: Lauris BH <lauris@nix.lv>
* Do not show arrows on comment diffs on pull comment pages
Prior to this PR it was possible that an expansion arrow could be displayed
on comment diffs displayed on the comments pages of pulls
These arrows would not successfully work because they were not attached to
a commit id - nor can they necessarily be.
This PR prevents these from being shown.
Fix#10851
Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per @silverwind
Signed-off-by: Andrew Thornton <art27@cantab.net>
* one more indentation fix
Signed-off-by: Andrew Thornton <art27@cantab.net>
* one more indentation fix
Signed-off-by: Andrew Thornton <art27@cantab.net>
The code for dropTableColumns has a slightly confusing portion whereby the session is committed for MSSQL but not for other variants.
The v102 migration doesn't actually start a transaction so this weirdness does not affect it. However it probably should attempt to run this in a transaction.
Signed-off-by: Andrew Thornton art27@cantab.net
https://github.com/go-gitea/gitea/pull/12346 was using the wrong
selector which affected only the single image view. Use the correct
selector for image diffs. Removal of border-radius is still worth to
keep to override the global 3px on <img>.
Co-authored-by: Lauris BH <lauris@nix.lv>
Rendering the git graph on the server means that we can properly track flows and switch from the Canvas implementation to a SVG implementation.
* This implementation provides a 16 limited color selection
* The uniqued color numbers are also provided
* And there is also a monochrome version
*In addition is a hover highlight that allows users to highlight commits on the same flow.
Closes#12209
Signed-off-by: Andrew Thornton art27@cantab.net
Co-authored-by: silverwind <me@silverwind.io>
For the sake of performance and simplicity, remove this seemingly useless
license header. It's related to LibreJS which we already pretty much
killed of in an earlier commit [1]. Initially added in [2]. Note that
the StaticUrlPrefix here was never actually correctly resolved and has
rendered including the template fences.
[1] https://github.com/go-gitea/gitea/pull/11810
[2] a915a09e4f
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This makes is slightly faster to navigate through the swagger docs by
initially collapsing the tags like 'admin' or 'miscellaneous'.
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
This PR switches off the success reports from the Update Mirrors cron job
as they are too frequent and not necessarily helpful.
Signed-off-by: Andrew Thornton <art27@cantab.net>
* If Description contain more that one line render it
* simpler ...
* only render if description exists
* Fix NPE in tests
* Update routers/user/profile.go
Co-authored-by: zeripath <art27@cantab.net>
* Prevent empty div when editing comment
The template for attachments needs to remove whitespace and return empty when there are no attachments.
Fix#10220
- Add loading spinners on editor and mermaid renderers
- Add error handling and inline error box for mermaid
- Fix Mermaid rendering by using the .init api
In #12379 it was discovered that enry v2 has a maximum language length
of 34 characters which is larger than the 30 previously provided.
This PR updates the language column to 50.
Fix#12379
This should speed up monaco's loading time by splitting the current
3.71MB chunk monaco.js into 63 individual files named 1 to 63.js in
the output directory. There seems to be no way to get a better file
naming scheme unfortunately. I opted to exclude those files in the
webpack output for brevity.