Skip to content

Commit 181b68d

Browse files
committed
Merge tag 'v1.11.0-rc1'
* BREAKING * Remove unused endpoints (go-gitea#9538) * Prefix all user-generated IDs in markup (go-gitea#9477) * Enforce Gitea environment for pushes (go-gitea#8982) * Hide some user information via API if user have no enough permission (go-gitea#8655) * Move startpage/homepage translation to crowdin (go-gitea#8596) * FEATURES * Webhooks should only show sender if it makes sense (go-gitea#9601) * Provide Default messages for merges (go-gitea#9393) * Add description to labels on create issue (go-gitea#9392) * Graceful Queues: Issue Indexing and Tasks (go-gitea#9363) * Default NO_REPLY_ADDRESS to DOMAIN (go-gitea#9325) * Allow FCGI over unix sockets (go-gitea#9298) * Graceful: Xorm, RepoIndexer, Cron and Others (go-gitea#9282) * Add API for Reactions (go-gitea#9220) * Graceful: Cancel Process on monitor pages & HammerTime (go-gitea#9213) * Graceful: Allow graceful restart for unix sockets (go-gitea#9113) * Graceful: Allow graceful restart for fcgi (go-gitea#9112) * Sign protected branches (go-gitea#8993) * Add Graceful shutdown for Windows and hooks for shutdown of goroutines (go-gitea#8964) * Add Gitea icon to Emojis (go-gitea#8950) * Expand/Collapse Files and Blob Excerpt while Reviewing/Comparing code (go-gitea#8924) * Allow Custom Reactions (go-gitea#8886) * Close/reopen issues by keywords in titles and comments (go-gitea#8866) * Allow incompletely specified Time Formats (go-gitea#8816) * Prevent upload (overwrite) of lfs locked file (go-gitea#8769) * Template Repositories (go-gitea#8768) * Add /milestones endpoint (go-gitea#8733) * Make repository management section handle lfs locks (go-gitea#8726) * Respect LFS File Lock on UI (go-gitea#8719) * Add team option to grant rights for all organization repositories (go-gitea#8688) * Enabling and disabling the commit button to prevent empty commits (web editor) (go-gitea#8590) * Add setting to disable BASIC authentication (go-gitea#8586) * Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (go-gitea#8528) * Allow Protected Branches to Whitelist Deploy Keys (go-gitea#8483) * Push to create repo (go-gitea#8419) * Sign merges, CRUD, Wiki and Repository initialisation with gpg key (go-gitea#7631) * Add basic repository lfs management (go-gitea#7199) * BUGFIXES * Disable remove button on repository teams when have access to all (go-gitea#9640) * Clean up old references on branch delete (go-gitea#9614) * Hide public repos owned by private orgs (go-gitea#9609) * Fix access issues on milestone and issue overview pages. (go-gitea#9603) * Fix error logged when repos qs is empty (go-gitea#9591) * Dont trigger notification twice on issue assignee change (go-gitea#9582) * Fix mirror pushed commit actions (go-gitea#9572) * Allow only specific columns to be updated on issue via API (go-gitea#9189) (go-gitea#9539) * Fix default avatar for ghost user (go-gitea#9536) * Fix download of release attachments with same name (go-gitea#9529) * Resolve deprecated INI conversion (go-gitea#9525) * Ignore empty avatars during database migration (go-gitea#9520) * Fix deleted branch isn't removed when push the branch again (go-gitea#9516) * Fix repository issues pagination bug when there are more than one label filter (go-gitea#9512) * Fix SetExpr failed (go-gitea#9506) * Remove obsolete file private/push_update.go (go-gitea#9503) * When recreating hooks, delete them first so they are recreated with the umask (go-gitea#9502) * Properly enforce gitea environment for pushes (go-gitea#9501) * Fix datarace on repo indexer queue (go-gitea#9490) * Add call to load repo prior to redirect in add/remove dependency code (go-gitea#9484) * Wrap the code indexer (go-gitea#9476) * Use Req.URL.RequestURI() to cope with FCGI urls (go-gitea#9473) * Set default ssh.minimum_key_sizes (go-gitea#9466) * Fixed issue with paging in /repos/{owner}/{repo}/git/trees/{sha} api (go-gitea#9459) * Fix wrong notification on merge (go-gitea#9450) * Issue with Migration rule v111 (go-gitea#9449) * Trigger webhook when deleting a branch after merging a PR (go-gitea#9424) * Add migration to sanitize repository original_url (go-gitea#9423) * Use OriginalURL instead of CloneAddr in migration logging (go-gitea#9418) * Push update after branch is restored (go-gitea#9416) * Fix wrong migration (go-gitea#9381) * Fix show repositories filter (go-gitea#9234) (go-gitea#9379) * Fix Slack webhook payload title generation to work with Mattermost (go-gitea#9378) * Fix double webhook for new PR (go-gitea#9375) * AuthorizedKeysCommand should not query db directly (go-gitea#9371) * Fix missed change to GetManager() (go-gitea#9361) * Fix cache problem on dashboard (go-gitea#9358) * RepoIndexer: DefaultBranch needs to be prefixed by BranchPrefix (go-gitea#9356) * Fix protected branch using IssueID (go-gitea#9348) * Fix nondeterministic behavior (go-gitea#9341) * Fix PR/issue redirects when having external tracker (go-gitea#9339) * Remove release attachments which repository has been deleted (go-gitea#9334) * Fix issue indexer not triggered when migrating a repository (go-gitea#9332) * Add SyncTags to uploader interface (go-gitea#9326) * Fix bug that release attachment files not deleted when deleting repository (go-gitea#9322) * Only sync tags after all migration release batches are completed (go-gitea#9319) * File Edit: Author/Committer interchanged (go-gitea#9297) * prebuild CSS/JS before xgo release binaries (go-gitea#9293) * Log: Ensure FLAGS=none shows no flags (go-gitea#9287) * Make Diff Detail on Pull Request Changed File UI always on Top (go-gitea#9280) * Switch CSS minifier to cssnano (go-gitea#9260) * Fix latest docker image haven't include static files. (go-gitea#9252) * Don't link wiki revision to commit (go-gitea#9244) * Change review content column to type text in db (go-gitea#9229) * Fixed topic regex pattern and added search by topic links after save (go-gitea#9219) * Add language to user API responce (go-gitea#9215) * Correct tooltip message blocked by dependencies (go-gitea#9211) * Add SimpleMDE and Fix Image Paste for Issue/Comment Editor (go-gitea#9197) * Fix panic when diff (go-gitea#9187) * Fix go-gitea#9151 - smtp logger configuration sendTos should be an array (go-gitea#9154) * Fix max length check and limit in multiple repo forms (go-gitea#9148) * Always Show Password Field on Link Account Sign-in Page (go-gitea#9147) * Properly fix displaying virtual session provider in admin panel (go-gitea#9137) * Fix race condition on indexer (go-gitea#9136) * Fix team links in HTML rendering (go-gitea#9127) * Fix race condition in ReplaceSanitizer (go-gitea#9123) * Fix what information is shown about user in API (go-gitea#9115) * Fix nil context user for template repositories (go-gitea#9099) * Hide given credentials for migrated repos. (go-gitea#9097) * Fix reCAPTCHA API URL (go-gitea#9083) * Fix password checks on admin create/edit user (go-gitea#9076) * Update golang.org/x/crypto vendor to use acme v2 (go-gitea#9056) * Ensure Written is set in GZIP ProxyResponseWriter (go-gitea#9018) * Fix wrong system notice when repository is empty (go-gitea#9010) * Fix broken link to branch from issue list (go-gitea#9003) * Fix bug when pack js (go-gitea#8992) * New review approvals shouldn't require a message (go-gitea#8991) * Shadow password correctly for session config (go-gitea#8984) * Don't send notification on pending reviews (go-gitea#8943) * Fix Notify Create Ref Error on tag creation (go-gitea#8936) * Convert EOL to UNIX-style to render MD properly (go-gitea#8925) * Migrate temp_repo.go to use git.NewCommand (go-gitea#8918) * Fix issue with user.fullname (go-gitea#8902) * Add Close() method to gogitRepository (go-gitea#8901) * Enable punctuations ending mentions (go-gitea#8889) * Fix password complexity check on registration (go-gitea#8887) * Fix require external registration password (go-gitea#8885) * Fix edit content button on migrated issue content (go-gitea#8877) * Fix permission checks for close/reopen from commit (go-gitea#8875) * Fix API Bug (fail on empty assignees) (go-gitea#8873) * Stop using git count-objects and use raw directory size for repository (go-gitea#8848) * Fix count for commit graph last page (go-gitea#8843) * Fix to close opened io resources as soon as not needed (go-gitea#8839) * Improve notification (go-gitea#8835) * Fix new user form for non-local users (go-gitea#8826) * Fix: remove duplicated signed commit icons (go-gitea#8820) * Fix (open/closed) issue count when label excluded (go-gitea#8815) * Fix SSH2 conditional in key parsing code (go-gitea#8806) * Fix 500 when edit hook (go-gitea#8782) * On windows set core.longpaths true (go-gitea#8776) * Fix commit expand button to not go to commit link (go-gitea#8745) * Avoid re-issuing redundant cross-references. (go-gitea#8734) * Fix milestone close timestamp function (go-gitea#8728) * Move webhook codes from service to webhook notification (go-gitea#8712) * Show zero lines on the line counter if the file empty (go-gitea#8700) * Fix deadline on update issue or PR via API (go-gitea#8696) * make call createMilestoneComment on newIssue func (go-gitea#8678) * Send tag create and push webhook when release created on UI (go-gitea#8671) * Prevent chrome download page as html with alt + click (go-gitea#8669) * Fix 500 when getting user as unauthenticated user (go-gitea#8653) * Graceful fixes (go-gitea#8645) * Add SubURL to redirect path (go-gitea#8632) (go-gitea#8634) * Fix extra columns from `label` table (go-gitea#8633) * Add SubURL to redirect path for transferred/renamed repos (go-gitea#8632) * Fix bug when migrate from API (go-gitea#8631) * Allow to merge if file path contains " or \ (go-gitea#8629) * Prevent removal of non-empty emoji panel following selection of duplicate (go-gitea#8609) * Ensure default gpg settings not nil and found commits have reference to repo (go-gitea#8604) * Set webhook Content-Type for application/x-www-form-urlencoded (go-gitea#8599) * Fix go-gitea#8582 by handling empty repos (go-gitea#8587) * Fix of the diff statistics view on pull request's (go-gitea#8581) * Fix bug on pull requests when transfer head repository (go-gitea#8564) * Fix template error on account page (go-gitea#8562) * Allow externalID to be UUID (go-gitea#8551) * Fix ignored error on editorconfig api (go-gitea#8550) * Fix user avatar name (go-gitea#8547) * Ensure that GitRepo is set on Empty repositories (go-gitea#8539) * Add missed close in ServeBlobLFS (go-gitea#8527) * Fix migrate mirror 500 bug (go-gitea#8526) * Fix password complexity regex for special characters (on master) (go-gitea#8525) * ENHANCEMENTS * Add a /user/login landing page option (go-gitea#9622) * Some more e-mail notification fixes (go-gitea#9596) * Add branch protection option to block merge on requested changes. (go-gitea#9592) * Add footer extra links template (go-gitea#9576) * Fix for a wrong URL in activity page of repository. (go-gitea#9571) * Update default issue template (go-gitea#9568) * Change markdown rendering from blackfriday to goldmark (go-gitea#9533) * Extend file create api with dates (go-gitea#9464) * Add ActionCommentPull action (go-gitea#9456) * Response for context on retry database connection (go-gitea#9444) * Refactor webhooks to reduce code duplication (go-gitea#9422) * update couchbase deps for new license (go-gitea#9419) * Add .ignore file for search tools (go-gitea#9417) * Remove unsued struct (go-gitea#9405) * Hide not allowed Reactions (go-gitea#9387) * Remove text from action-only webhooks (go-gitea#9377) * Move PushToBaseRepo from models to services/pull (go-gitea#9352) * Site admin could view org's members (go-gitea#9346) * Sleep longer if request speed is over github limitation (go-gitea#9335) * Refactor comment (go-gitea#9330) * Refactor code indexer (go-gitea#9313) * Remove SavePatch and generate patches on the fly (go-gitea#9302) * Move some pull request functions from models to services (go-gitea#9266) * Update JS dependencies (go-gitea#9255) * Show label list on label set (go-gitea#9251) * Redirect issue if repo has configured external tracker. (go-gitea#9247) * Allow kbd tags (go-gitea#9245) * Remove unused comment actions (go-gitea#9222) * Fixed errors logging in dump.go (go-gitea#9218) * Expose release counter to repo API response (go-gitea#9214) * Make consistent links to repository in the Slack/Mattermost notificiations (go-gitea#9205) * Expose pull request counter to repo API response (go-gitea#9202) * Extend TrackedTimes API (go-gitea#9200) * Extend StopWatch API (go-gitea#9196) * Move code indexer related code to a new package (go-gitea#9191) * Docker: ask s6 to stop all service when gitea stop (go-gitea#9171) * Variable expansion in repository templates (go-gitea#9163) * Add avatar and issue labels to template repositories (go-gitea#9149) * Show single review comments in the PR conversation tab (go-gitea#9143) * Extract createComment (go-gitea#9125) * Move PushUpdateOptions from models to repofiles (go-gitea#9124) * Alternate syntax for cross references (go-gitea#9116) * Add USE_SERVICE_WORKER setting (go-gitea#9110) * Only show part of members on orgnization dashboard and add paging for orgnization members page (go-gitea#9092) * Explore page: Add topic param to pagination (go-gitea#9077) (go-gitea#9078) * Markdown: Sanitizier Configuration (go-gitea#9075) * Add password requirement info on error (go-gitea#9074) * Allow authors to use act keywords in PR content (go-gitea#9059) * Move modules/gzip to gitea.com/macaron/gzip (go-gitea#9058) * Branch protection: Possibility to not use whitelist but allow anyone with write access (go-gitea#9055) * Context menus for comments, add quote reply (go-gitea#9043) * Update branch API endpoint to show effective branch protection. (go-gitea#9031) * Move git graph from models to modules/graph (go-gitea#9027) * Move merge actions to notification (go-gitea#9024) * Move mirror sync actions to notification (go-gitea#9022) * Add retry for migration http/https requests (go-gitea#9019) * Rewrite delivery of issue and comment mails (go-gitea#9009) * Add review comments to mail notifications (go-gitea#8996) * Refactor pull request review (go-gitea#8954) * Githook highlighter (go-gitea#8932) * Add git hooks and webhooks to template repositories; move to services (go-gitea#8926) * Only view branch or tag if it match refType requested. (go-gitea#8899) * Drop Admin attribute based on LDAP when login (continue go-gitea#1743) (go-gitea#8849) * Add additional periods to activity page (go-gitea#8829) * Update go-org to optimize code (go-gitea#8824) * Move some actions to notification/action (go-gitea#8779) * Webhook support custom proxy (go-gitea#8760) * Fix API deadline removal (go-gitea#8759) * Mark review comment as invalidated when file is deleted (go-gitea#8751) * Move pull list code to a separate file (go-gitea#8748) * Move webhook to a standalone package under modules (go-gitea#8747) * Multi repo select on issue page (go-gitea#8741) * apply exclude label on milestone issue list (go-gitea#8739) * Move issue notifications and assignee man (go-gitea#8713) * Move issue change content from models to service (go-gitea#8711) * Move issue change status from models to service (go-gitea#8691) * Move more issue assignee code from models to issue service (go-gitea#8690) * Create PR on Current Repository by Default (go-gitea#8670) * Improve Open Graph Protocol (go-gitea#8637) * Batch hook pre- and post-receive calls (go-gitea#8602) * Improve webhooks (go-gitea#8583) * Move transfer repository and rename repository on a service package and start action notification (go-gitea#8573) * Implement/Fix PR review webhooks (go-gitea#8570) * Rewrite markdown rendering to blackfriday v2 and rewrite orgmode rendering to go-org (go-gitea#8560) * Move some repositories' operations to a standalone service package (go-gitea#8557) * Allow more than 255 characters for tokens in external_login_user table (go-gitea#8554) * Move issue label operations to issue service package (go-gitea#8553) * Adjust error reporting from merge failures and use LC_ALL=C for git (go-gitea#8548) * Mail assignee when issue/pull request is assigned (go-gitea#8546) * Allow committing / adding empty files using the web ui (go-gitea#8420) (go-gitea#8532) * Move sync mirror actions to mirror service package (go-gitea#8518) * Remove arrows on numeric inputs (go-gitea#8516) * Support inline rendering of CUSTOM_URL_SCHEMES (go-gitea#8496) * Recalculate repository access only for specific user (go-gitea#8481) * Add download button for rull request diff- and patch-file (go-gitea#8470) * Add single sign-on support via SSPI on Windows (go-gitea#8463) * Move change issue title from models to issue service package (go-gitea#8456) * Add included tag on branch view (go-gitea#8449) * Make static resouces web browser cache time customized on app.ini (go-gitea#8442) * Enable Uploading/Removing Attachments When Editing an Issue/Comment (go-gitea#8426) * Add pagination to commit graph page (go-gitea#8360) * Use templates for issue e-mail subject and body (go-gitea#8329) * Move clearlabels from models to issue service (go-gitea#8326) * Move AddTestPullRequestTask to pull service package from models (go-gitea#8324) * Team permission to create repository in organization (go-gitea#8312) * Allows external rendering of other filetypes (go-gitea#8300) * Add 'Alt + click' feature to exclude labels (go-gitea#8199) * Configurable close and reopen keywords for PRs (go-gitea#8120) * Configurable URL for static resources (go-gitea#7911) * Unifies commit list in repository commit table and wiki revision page (go-gitea#7907) * Allow cross-repository dependencies on issues (go-gitea#7901) * Auto-subscribe user to repository when they commit/tag to it (go-gitea#7657) * Restore Graceful Restarting & Socket Activation (go-gitea#7274) * wiki - add 'write' 'preview' buttons to wiki edit like in issues (go-gitea#7241) * Change target branch for pull request (go-gitea#6488) * Display PR commits and diffs using base repo rather than forked (go-gitea#3648) * SECURITY * Swagger hide search field (go-gitea#9554) * Add "search" to reserved usernames (go-gitea#9063) * Switch to fomantic-ui (go-gitea#9374) * Only serve attachments when linked to issue/release and if accessible by user (go-gitea#9340) * Hide credentials when submitting migration through API (go-gitea#9102) * TESTING * Add debug option to serv to help debug problems (go-gitea#9492) * Fix the intermittent TestGPGGit failures (go-gitea#9360) * Testing: Update postgres sequences (go-gitea#9304) * Missed defer prepareTestEnv (go-gitea#9285) * Fix "data race" in testlogger (go-gitea#9159) * Yet another attempt to fix the intermittent failure of gpg git test (go-gitea#9146) * integrations: Fix Dropped Test Errors (go-gitea#9040) * services/mirror: fix dropped test errors (go-gitea#9007) * Fix intermittent GPG Git test failure (go-gitea#8968) * Update Github Migration Tests (go-gitea#8893) (go-gitea#8938) * Update heatmap fixtures to restore tests (go-gitea#8615) * TRANSLATION * Fix placeholders in the error message (go-gitea#9060) * Fix spelling of admin.users.max_repo_creation (go-gitea#8934) * Improve german translation of homepage (go-gitea#8549) * BUILD * Update gitea.com/macaron to 1.4.0 (go-gitea#9608) * Upgrade lato fonts to v16. (go-gitea#9498) * Update alpine to 3.11 (go-gitea#9440) * Upgrade blevesearch (go-gitea#9177) * Remove built js/css files from git (go-gitea#9114) * Move semantic.dropdown.custom.js to webpack (go-gitea#9064) * Check compiled files during build (go-gitea#9042) * Enable lazy-loading of gitgraph.js (go-gitea#9036) * Pack web_src/js/draw.js to public/js/index.js (go-gitea#8975) * Modernize js and use babel (go-gitea#8973) * Move index.js to web_src and use webpack to pack them (go-gitea#8598) * Restrict modules/graceful to non-windows build and shim IsChild (go-gitea#8537) * Upgrade gopkg.in/editorconfig/editorconfig-core-go.v1 (go-gitea#8501) * DOCS * Swagger info corrections (go-gitea#9441) (go-gitea#9558) * Add ALLOW_ONLY_EXTERNAL_REGISTRATION to config cheat sheet (go-gitea#8986) * Rephrase comment about RuntimeDirectory option in systemd config (go-gitea#8912) * Explicitly indicate the socket unit to use the service unit "gitea.service" (go-gitea#8804) * Adjust the must-change-password help (go-gitea#8755) * Add notice to docs for migrating from more recent versions of Gogs (go-gitea#8724) * Add explicit info about customization of homepage (go-gitea#8694) * Change external asciidoctor tool to embedded mode (go-gitea#8677) * Add Docker fail2ban configuration (go-gitea#8642) * Correct some outdated statements in the contributing guidelines (go-gitea#8612) * Basic Design guidelines (describing different parts of the code) (go-gitea#8601) * Display Gitea logo in Readme (go-gitea#8592) * Fix building from source docs to ref AppWorkPath (go-gitea#8567) * Update the provided gitea.service to mention socket activation (go-gitea#8531) * Doc added how to setup email (go-gitea#8520) * MISC * Add translatable Powered by Gitea text in footer (go-gitea#9600) * Add contrib/environment-to-ini (go-gitea#9519) * Remove unnecessary loading of settings in update hook (go-gitea#9496) * Update gitignore list (go-gitea#9437) * Update license list (go-gitea#9436) * Fix background reactions in the arc-green theme (go-gitea#9421) * Update and fix chardet import (go-gitea#9351) * Ensure LF on checkouts and in editors (go-gitea#9259) * Fixed topics margin (go-gitea#9248) * Add comment to exported function WindowsServiceName (make revive) (go-gitea#9241) * Remove empty lines on issues/pulls page (go-gitea#9232) * Fix Add Comment Button's "+" Position (go-gitea#9140) * Add first issue comment hashtag (go-gitea#9052) * Change some label colors (go-gitea#9051) * Fix double scroll in branch dropdown (go-gitea#9048) * Add comment highlight when target from url (go-gitea#9047) * Update display of reactions to issues and comments (go-gitea#9038) * Button tooltip formatting under Branches (go-gitea#9034) * Allow setting default branch via API (go-gitea#9030) * Update dashboard context for PR reviews (go-gitea#8995) * Show repository size in repo home page and settings (go-gitea#8940) * Allow to add and remove all repositories to/from team. (go-gitea#8867) * Show due date in dashboard issues list (go-gitea#8860) * Theme arc-green: reverse heatmap colors (go-gitea#8840) * Project files table style update (go-gitea#8757) * gitignore debugging file from vscode (go-gitea#8740) * Add API for Issue set Subscription (go-gitea#8729) * Make 100% width search bar (go-gitea#8710) * Update color theme for heatmap (go-gitea#8709) * Add margin to title_wip_desc (go-gitea#8705) * Improve visibility of "Pending" indicator (go-gitea#8685) * Improve accessibility of dropdown menus (go-gitea#8638) * Make /users/{username}/repos list private repos the current user has access to (go-gitea#8621) * Prevent .code-view from overriding font on icon fonts (go-gitea#8614) * Add id references on all issue events to allow internal linking (go-gitea#8608) * Upgrade xorm to v0.8.0 (go-gitea#8536) * Upgrade gopkg.in/ini.v1 (go-gitea#8500) * Update CodeMirror to version 5.49.0 (go-gitea#8381) * Wiki editor: enable side-by-side button (go-gitea#7242)
2 parents e94c1c4 + bb44769 commit 181b68d

File tree

161 files changed

+7722
-1750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+7722
-1750
lines changed

CHANGELOG.md

+426-26
Large diffs are not rendered by default.

CONTRIBUTING.md

+38
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [Code review](#code-review)
1313
- [Styleguide](#styleguide)
1414
- [Design guideline](#design-guideline)
15+
- [API v1](#api-v1)
1516
- [Developer Certificate of Origin (DCO)](#developer-certificate-of-origin-dco)
1617
- [Release Cycle](#release-cycle)
1718
- [Maintainers](#maintainers)
@@ -177,6 +178,43 @@ To maintain understandable code and avoid circular dependencies it is important
177178
- **templates:** Golang templates for generating the html output.
178179
- **vendor:** External code that Gitea depends on.
179180

181+
## API v1
182+
183+
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [GitHub API v3](https://developer.github.com/v3/).
184+
Thus, Gitea´s API should use the same endpoints and fields as GitHub´s API as far as possible, unless there are good reasons to deviate.
185+
If Gitea provides functionality that GitHub does not, a new endpoint can be created.
186+
If information is provided by Gitea that is not provided by the GitHub API, a new field can be used that doesn't collide with any GitHub fields.
187+
188+
Updating an existing API should not remove existing fields unless there is a really good reason to do so.
189+
The same applies to status responses. If you notice a problem, feel free to leave a comment in the code for future refactoring to APIv2 (which is currently not planned).
190+
191+
All expected results (errors, success, fail messages) should be documented
192+
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L319-L327)).
193+
194+
All JSON input types must be defined as a struct in `models/structs/`
195+
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L76-L91))
196+
and referenced in
197+
[routers/api/v1/swagger/options.go](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/options.go).
198+
They can then be used like the following:
199+
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L318)).
200+
201+
All JSON responses must be defined as a struct in `models/structs/`
202+
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/modules/structs/issue.go#L36-L68))
203+
and referenced in its category in `routers/api/v1/swagger/`
204+
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/swagger/issue.go#L11-L16))
205+
They can be used like the following:
206+
([example](https://github.com/go-gitea/gitea/blob/c620eb5b2d0d874da68ebd734d3864c5224f71f7/routers/api/v1/repo/issue.go#L277-L279))
207+
208+
In general, HTTP methods are chosen as follows:
209+
* **GET** endpoints return requested object and status **OK (200)**
210+
* **DELETE** endpoints return status **No Content (204)**
211+
* **POST** endpoints return status **Created (201)**, used to **create** new objects (e.g. a User)
212+
* **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Obejcts (e.g. User) to something (e.g. Org-Team)
213+
* **PATCH** endpoints return changed object and status **OK (200)**, used to **edit/change** an existing object
214+
215+
216+
An endpoint which changes/edits an object expects all fields to be optional (except ones to identify the object, which are required).
217+
180218

181219
## Developer Certificate of Origin (DCO)
182220

Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,25 @@ all: build
9292

9393
include docker/Makefile
9494

95+
.PHONY: help
96+
help:
97+
@echo "Make Routines:"
98+
@echo " - \"\" equivalent to \"build\""
99+
@echo " - build creates the entire project"
100+
@echo " - clean delete integration files and build files but not css and js files"
101+
@echo " - clean-all delete all generated files (integration test, build, css and js files)"
102+
@echo " - css rebuild only css files"
103+
@echo " - js rebuild only js files"
104+
@echo " - generate run \"make css js\" and \"go generate\""
105+
@echo " - fmt format the code"
106+
@echo " - generate-swagger generate the swagger spec from code comments"
107+
@echo " - swagger-validate check if the swagger spec is valide"
108+
@echo " - revive run code linter revive"
109+
@echo " - misspell check if a word is written wrong"
110+
@echo " - vet examines Go source code and reports suspicious constructs"
111+
@echo " - test run unit test"
112+
@echo " - test-sqlite run integration test for sqlite"
113+
95114
.PHONY: go-check
96115
go-check:
97116
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?\s' | tr '.' ' ');))

cmd/admin.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ var (
155155
microcmdAuthDelete = cli.Command{
156156
Name: "delete",
157157
Usage: "Delete specific auth source",
158+
Flags: []cli.Flag{idFlag},
158159
Action: runDeleteAuth,
159160
}
160161

@@ -533,9 +534,9 @@ func runListAuth(c *cli.Context) error {
533534

534535
// loop through each source and print
535536
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.AlignRight)
536-
fmt.Fprintf(w, "ID\tName\tType\tEnabled")
537+
fmt.Fprintf(w, "ID\tName\tType\tEnabled\n")
537538
for _, source := range loginSources {
538-
fmt.Fprintf(w, "%d\t%s\t%s\t%t", source.ID, source.Name, models.LoginNames[source.Type], source.IsActived)
539+
fmt.Fprintf(w, "%d\t%s\t%s\t%t\n", source.ID, source.Name, models.LoginNames[source.Type], source.IsActived)
539540
}
540541
w.Flush()
541542

custom/conf/app.ini.sample

+35-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ ENABLE_GZIP = false
290290
ENABLE_PPROF = false
291291
; PPROF_DATA_PATH, use an absolute path when you start gitea as service
292292
PPROF_DATA_PATH = data/tmp/pprof
293-
; Landing page, can be "home", "explore", or "organizations"
293+
; Landing page, can be "home", "explore", "organizations" or "login"
294+
; The "login" choice is not a security measure but just a UI flow change, use REQUIRE_SIGNIN_VIEW to force users to log in.
294295
LANDING_PAGE = home
295296
; Enables git-lfs support. true or false, default is false.
296297
LFS_START_SERVER = false
@@ -381,6 +382,39 @@ REPO_INDEXER_INCLUDE =
381382
; A comma separated list of glob patterns to exclude from the index; ; default is empty
382383
REPO_INDEXER_EXCLUDE =
383384

385+
[queue]
386+
; Specific queues can be individually configured with [queue.name]. [queue] provides defaults
387+
;
388+
; General queue queue type, currently support: persistable-channel, channel, level, redis, dummy
389+
; default to persistable-channel
390+
TYPE = persistable-channel
391+
; data-dir for storing persistable queues and level queues, individual queues will be named by their type
392+
DATADIR = queues/
393+
; Default queue length before a channel queue will block
394+
LENGTH = 20
395+
; Batch size to send for batched queues
396+
BATCH_LENGTH = 20
397+
; Connection string for redis queues this will store the redis connection string.
398+
CONN_STR = "addrs=127.0.0.1:6379 db=0"
399+
; Provide the suffix of the default redis queue name - specific queues can be overriden within in their [queue.name] sections.
400+
QUEUE_NAME = "_queue"
401+
; If the queue cannot be created at startup - level queues may need a timeout at startup - wrap the queue:
402+
WRAP_IF_NECESSARY = true
403+
; Attempt to create the wrapped queue at max
404+
MAX_ATTEMPTS = 10
405+
; Timeout queue creation
406+
TIMEOUT = 15m30s
407+
; Create a pool with this many workers
408+
WORKERS = 1
409+
; Dynamically scale the worker pool to at this many workers
410+
MAX_WORKERS = 10
411+
; Add boost workers when the queue blocks for BLOCK_TIMEOUT
412+
BLOCK_TIMEOUT = 1s
413+
; Remove the boost workers after BOOST_TIMEOUT
414+
BOOST_TIMEOUT = 5m
415+
; During a boost add BOOST_WORKERS
416+
BOOST_WORKERS = 5
417+
384418
[admin]
385419
; Disallow regular (non-admin) users from creating organizations.
386420
DISABLE_REGULAR_ORG_CREATION = false

docs/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.10.1
21+
version: 1.10.2
2222

2323
outputs:
2424
home:

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
186186
- `STATIC_ROOT_PATH`: **./**: Upper level of template and static files path.
187187
- `STATIC_CACHE_TIME`: **6h**: Web browser cache time for static resources on `custom/`, `public/` and all uploaded avatars.
188188
- `ENABLE_GZIP`: **false**: Enables application-level GZIP support.
189-
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore\].
189+
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login\].
190190
- `LFS_START_SERVER`: **false**: Enables git-lfs support.
191191
- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files.
192192
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
@@ -226,6 +226,7 @@ relation to port exhaustion.
226226

227227
- `ISSUE_INDEXER_TYPE`: **bleve**: Issue indexer type, currently support: bleve or db, if it's db, below issue indexer item will be invalid.
228228
- `ISSUE_INDEXER_PATH`: **indexers/issues.bleve**: Index file used for issue search.
229+
- The next 4 configuration values are deprecated and should be set in `queue.issue_indexer` however are kept for backwards compatibility:
229230
- `ISSUE_INDEXER_QUEUE_TYPE`: **levelqueue**: Issue indexer queue, currently supports:`channel`, `levelqueue`, `redis`.
230231
- `ISSUE_INDEXER_QUEUE_DIR`: **indexers/issues.queue**: When `ISSUE_INDEXER_QUEUE_TYPE` is `levelqueue`, this will be the queue will be saved path.
231232
- `ISSUE_INDEXER_QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: When `ISSUE_INDEXER_QUEUE_TYPE` is `redis`, this will store the redis connection string.
@@ -239,6 +240,24 @@ relation to port exhaustion.
239240
- `MAX_FILE_SIZE`: **1048576**: Maximum size in bytes of files to be indexed.
240241
- `STARTUP_TIMEOUT`: **30s**: If the indexer takes longer than this timeout to start - fail. (This timeout will be added to the hammer time above for child processes - as bleve will not start until the previous parent is shutdown.) Set to zero to never timeout.
241242

243+
## Queue (`queue` and `queue.*`)
244+
245+
- `TYPE`: **persistable-channel**: General queue type, currently support: `persistable-channel`, `channel`, `level`, `redis`, `dummy`
246+
- `DATADIR`: **queues/**: Base DataDir for storing persistent and level queues. `DATADIR` for inidividual queues can be set in `queue.name` sections but will default to `DATADIR/`**`name`**.
247+
- `LENGTH`: **20**: Maximal queue size before channel queues block
248+
- `BATCH_LENGTH`: **20**: Batch data before passing to the handler
249+
- `CONN_STR`: **addrs=127.0.0.1:6379 db=0**: Connection string for the redis queue type.
250+
- `QUEUE_NAME`: **_queue**: The suffix for default redis queue name. Individual queues will default to **`name`**`QUEUE_NAME` but can be overriden in the specific `queue.name` section.
251+
- `WRAP_IF_NECESSARY`: **true**: Will wrap queues with a timeoutable queue if the selected queue is not ready to be created - (Only relevant for the level queue.)
252+
- `MAX_ATTEMPTS`: **10**: Maximum number of attempts to create the wrapped queue
253+
- `TIMEOUT`: **GRACEFUL_HAMMER_TIME + 30s**: Timeout the creation of the wrapped queue if it takes longer than this to create.
254+
- Queues by default come with a dynamically scaling worker pool. The following settings configure this:
255+
- `WORKERS`: **1**: Number of initial workers for the queue.
256+
- `MAX_WORKERS`: **10**: Maximum number of worker go-routines for the queue.
257+
- `BLOCK_TIMEOUT`: **1s**: If the queue blocks for this time, boost the number of workers - the `BLOCK_TIMEOUT` will then be doubled before boosting again whilst the boost is ongoing.
258+
- `BOOST_TIMEOUT`: **5m**: Boost workers will timeout after this long.
259+
- `BOOST_WORKERS`: **5**: This many workers will be added to the worker pool if there is a boost.
260+
242261
## Admin (`admin`)
243262
- `DEFAULT_EMAIL_NOTIFICATIONS`: **enabled**: Default configuration for email notifications for users (user configurable). Options: enabled, onmention, disabled
244263

@@ -615,6 +634,7 @@ You may redefine `ELEMENT`, `ALLOW_ATTR`, and `REGEXP` multiple times; each time
615634

616635
## Task (`task`)
617636

637+
- Task queue configuration has been moved to `queue.task` however, the below configuration values are kept for backwards compatibilityx:
618638
- `QUEUE_TYPE`: **channel**: Task queue type, could be `channel` or `redis`.
619639
- `QUEUE_LENGTH`: **1000**: Task queue length, available only when `QUEUE_TYPE` is `channel`.
620640
- `QUEUE_CONN_STR`: **addrs=127.0.0.1:6379 db=0**: Task queue connection string, available only when `QUEUE_TYPE` is `redis`. If there redis needs a password, use `addrs=127.0.0.1:6379 password=123 db=0`.

docs/content/doc/advanced/customizing-gitea.en-us.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ environment variable; this can be used to override the default path to something
4444

4545
**Note:** Gitea must perform a full restart to see configuration changes.
4646

47-
## Customizing /robots.txt
48-
49-
To make Gitea serve a custom `/robots.txt` (default: empty 404), create a file called
50-
`robots.txt` in the `custom` folder (or `CustomPath`) with
51-
[expected contents](http://www.robotstxt.org/).
52-
5347
## Serving custom public files
5448

5549
To make Gitea serve custom public files (like pages and images), use the folder
@@ -80,10 +74,10 @@ Dont forget to restart your gitea to apply the changes.
8074

8175
### Adding links and tabs
8276

83-
If all you want is to add extra links to the top navigation bar, or extra tabs to the repository view, you can put them in `extra_links.tmpl` and `extra_tabs.tmpl` inside your `custom/templates/custom/` directory.
77+
If all you want is to add extra links to the top navigation bar or footer, or extra tabs to the repository view, you can put them in `extra_links.tmpl` (links added to the navbar), `extra_links_footer.tmpl` (links added to the left side of footer), and `extra_tabs.tmpl` inside your `custom/templates/custom/` directory.
8478

8579
For instance, let's say you are in Germany and must add the famously legally-required "Impressum"/about page, listing who is responsible for the site's content:
86-
just place it under your "custom/public/" directory (for instance `custom/public/impressum.html`) and put a link to it in `custom/templates/custom/extra_links.tmpl`.
80+
just place it under your "custom/public/" directory (for instance `custom/public/impressum.html`) and put a link to it in either `custom/templates/custom/extra_links.tmpl` or `custom/templates/custom/extra_links_footer.tmpl`.
8781

8882
To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL:
8983
`<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
date: "2019-12-31T13:55:00+05:00"
3+
title: "Advanced: Search Engines Indexation"
4+
slug: "search-engines-indexation"
5+
weight: 30
6+
toc: true
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "advanced"
11+
name: "Search Engines Indexation"
12+
weight: 60
13+
identifier: "search-engines-indexation"
14+
---
15+
16+
# Search engines indexation of your Gitea installation
17+
18+
By default your Gitea installation will be indexed by search engines.
19+
If you don't want your repository to be visible for search engines read further.
20+
21+
## Block search engines indexation using robots.txt
22+
23+
To make Gitea serve a custom `robots.txt` (default: empty 404) for top level installations,
24+
create a file called `robots.txt` in the [`custom` folder or `CustomPath`]({{< relref "doc/advanced/customizing-gitea.en-us.md" >}})
25+
26+
Examples on how to configure the `robots.txt` can be found at [https://moz.com/learn/seo/robotstxt](https://moz.com/learn/seo/robotstxt).
27+
28+
29+
```txt
30+
User-agent: *
31+
Disallow: /
32+
```
33+
34+
If you installed Gitea in a subdirectory, you will need to create or edit the `robots.txt` in the top level directory.
35+
36+
```txt
37+
User-agent: *
38+
Disallow: /gitea/
39+
```

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
gitea.com/macaron/gzip v0.0.0-20191118033930-0c4c5566a0e5
1414
gitea.com/macaron/i18n v0.0.0-20190822004228-474e714e2223
1515
gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a
16-
gitea.com/macaron/macaron v1.3.3-0.20190821202302-9646c0587edb
16+
gitea.com/macaron/macaron v1.4.0
1717
gitea.com/macaron/session v0.0.0-20190821211443-122c47c5f705
1818
gitea.com/macaron/toolbox v0.0.0-20190822013122-05ff0fc766b7
1919
github.com/PuerkitoBio/goquery v1.5.0
@@ -88,7 +88,7 @@ require (
8888
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
8989
github.com/tstranex/u2f v1.0.0
9090
github.com/unknwon/cae v0.0.0-20190822084630-55a0b64484a1
91-
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e
91+
github.com/unknwon/com v1.0.1
9292
github.com/unknwon/i18n v0.0.0-20190805065654-5c6446a380b6
9393
github.com/unknwon/paginater v0.0.0-20151104151617-7748a72e0141
9494
github.com/urfave/cli v1.20.0
@@ -104,7 +104,7 @@ require (
104104
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
105105
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
106106
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
107-
gopkg.in/ini.v1 v1.48.0
107+
gopkg.in/ini.v1 v1.51.1
108108
gopkg.in/ldap.v3 v3.0.2
109109
gopkg.in/src-d/go-billy.v4 v4.3.2
110110
gopkg.in/src-d/go-git.v4 v4.13.1

go.sum

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ gitea.com/macaron/inject v0.0.0-20190805023432-d4c86e31027a/go.mod h1:h6E4kLao1Y
3131
gitea.com/macaron/macaron v1.3.3-0.20190803174002-53e005ff4827/go.mod h1:/rvxMjIkOq4BM8uPUb+VHuU02ZfAO6R4+wD//tiCiRw=
3232
gitea.com/macaron/macaron v1.3.3-0.20190821202302-9646c0587edb h1:amL0md6orTj1tXY16ANzVU9FmzQB+W7aJwp8pVDbrmA=
3333
gitea.com/macaron/macaron v1.3.3-0.20190821202302-9646c0587edb/go.mod h1:0coI+mSPSwbsyAbOuFllVS38awuk9mevhLD52l50Gjs=
34+
gitea.com/macaron/macaron v1.4.0 h1:FY1QDGqyuUzs21K6ChkbYbRUfwL7v2aUrhNEJ0IgsAw=
35+
gitea.com/macaron/macaron v1.4.0/go.mod h1:P7hfDbQjcW22lkYkXlxdRIfWOXxH2+K4EogN4Q0UlLY=
3436
gitea.com/macaron/session v0.0.0-20190821211443-122c47c5f705 h1:mvkQGAlON1Z6Y8pqa/+FpYIskk54mazuECUfZK5oTg0=
3537
gitea.com/macaron/session v0.0.0-20190821211443-122c47c5f705/go.mod h1:1ujH0jD6Ca4iK9NL0Q2a7fG2chvXx5hVa7hBfABwpkA=
3638
gitea.com/macaron/toolbox v0.0.0-20190822013122-05ff0fc766b7 h1:N9QFoeNsUXLhl14mefLzGluqV7w2mGU3u+iZU+jCeWk=
@@ -532,6 +534,8 @@ github.com/unknwon/cae v0.0.0-20190822084630-55a0b64484a1 h1:SpoCl3+Pta5/ubQyF+F
532534
github.com/unknwon/cae v0.0.0-20190822084630-55a0b64484a1/go.mod h1:QaSeRctcea9fK6piJpAMCCPKxzJ01+xFcr2k1m3WRPU=
533535
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM=
534536
github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
537+
github.com/unknwon/com v1.0.1 h1:3d1LTxD+Lnf3soQiD4Cp/0BRB+Rsa/+RTvz8GMMzIXs=
538+
github.com/unknwon/com v1.0.1/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM=
535539
github.com/unknwon/i18n v0.0.0-20190805065654-5c6446a380b6 h1:sRrkJEHtNoaSvyXMbRgofEOX4/3gMiraevQKJdIBhYE=
536540
github.com/unknwon/i18n v0.0.0-20190805065654-5c6446a380b6/go.mod h1:+5rDk6sDGpl3azws3O+f+GpFSyN9GVr0K8cvQLQM2ZQ=
537541
github.com/unknwon/paginater v0.0.0-20151104151617-7748a72e0141 h1:Z79lyIznnziKADUf0J7EP8Z4ZL7YJDiPuaazlfUBSy4=
@@ -721,8 +725,8 @@ gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
721725
gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
722726
gopkg.in/ini.v1 v1.44.2/go.mod h1:M3Cogqpuv0QCi3ExAY5V4uOt4qb/R3xZubo9m8lK5wg=
723727
gopkg.in/ini.v1 v1.46.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
724-
gopkg.in/ini.v1 v1.48.0 h1:URjZc+8ugRY5mL5uUeQH/a63JcHwdX9xZaWvmNWD7z8=
725-
gopkg.in/ini.v1 v1.48.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
728+
gopkg.in/ini.v1 v1.51.1 h1:GyboHr4UqMiLUybYjd22ZjQIKEJEpgtLXtuGbR21Oho=
729+
gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
726730
gopkg.in/ldap.v3 v3.0.2 h1:R6RBtabK6e1GO0eQKtkyOFbAHO73QesLzI2w2DZ6b9w=
727731
gopkg.in/ldap.v3 v3.0.2/go.mod h1:oxD7NyBuxchC+SgJDE1Q5Od05eGt29SDQVBmV+HYbzw=
728732
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=

0 commit comments

Comments
 (0)