aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/doc/developers
Commit message (Collapse)AuthorAgeFilesLines
* Restructure documentation. Now the documentation has installation, ↵Lunny Xiao2023-03-2313-1628/+0
| | | | | | | | | | | | | | | | | | | | | | administration, usage, development, contributing the 5 main parts (#23629) - **Installation**: includes how to install Gitea and related other tools, also includes upgrade Gitea - **Administration**: includes how to configure Gitea, customize Gitea and manage Gitea instance out of Gitea admin UI - **Usage**: includes how to use Gitea's functionalities. A sub documentation is about packages, in future we could also include CI/CD and others. - **Development**: includes how to integrate with Gitea's API, how to develop new features within Gitea - **Contributing**: includes how to contribute code to Gitea repositories. After this is merged, I think we can have a sub-documentation of `Usage` part named `Actions` to describe how to use Gitea actions --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Replace Less with CSS (#23481)silverwind2023-03-141-2/+2
| | | | | | | | | | | | Ran most of the Less files through the Less compiler and Prettier and then followed up with a round of manual fixes. The Less compiler had unfortunately stripped all `//` style comments that I had to restore (It did preserve `/* */` comments). Other fixes include duplicate selector removal which were revealed after the transpilation and which weren't caught by stylelint before but now are. Fixes: https://github.com/go-gitea/gitea/issues/15565
* Add user webhooks (#21563)KN4CK3R2023-03-101-0/+1
| | | | | | | Currently we can add webhooks for organizations but not for users. This PR adds the latter. You can access it from the current users settings. ![grafik](https://user-images.githubusercontent.com/1666336/197391408-15dfdc23-b476-4d0c-82f7-9bc9b065988f.png)
* Update hacking-on-gitea-zh_cn documentation (#23315)Lunny Xiao2023-03-061-14/+320
| | | | | | | This PR fix outdated hacking-on-gitea-zh_cn documentation. --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Improve the frontend guideline (#23298)wxiaoguang2023-03-051-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### The CustomEvent prefix There was already `ce-quick-submit`, the `ce-` prefix seems better than `us-`. Rename the only `us-` prefixed `us-load-context-popup` to `ce-` prefixed. ### Styles and Attributes in Go HTML Template https://github.com/go-gitea/gitea/pull/21855#issuecomment-1429643073 Suggest to stick to `class="c1 {{if $var}}c2{{end}}"` The readability and maintainability should be applied to the code which is read by developers, but not for the generated outputs. The template code is the code for developers, while the generated HTML are only for browsers. The `class="c1 {{if $var}}c2{{end}}"` style is clearer for developers and more intuitive, and the generated HTML also makes browsers happy (a few spaces do not affect anything) Think about a more complex case: * `class="{{if $active}}active{{end}} menu item {{if $show}}show{{end}} {{if $warn}}warn{{end}}"` * --vs-- * `class="{{if $active}}active {{end}}menu item{{if $show}} show{{end}}{{if $warn}} warn{{end}}"` The first style make it clearer to see each CSS class name with its `{{if}}` block. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Re-add accidentally removed `hacking-on-gitea.zh-cn.md` (#23297)Lunny Xiao2023-03-041-0/+43
| | | | #21627 accidentally removed the docs file `hacking-on-gitea.zh-cn.md`. This re-adds it and merges some changes from #23289
* Improve frontend guideline (#23252)wxiaoguang2023-03-021-0/+3
| | | | | If an event listener must be `async`, the `e.preventDefault()` should be before any `await`, it's recommended to put it at the beginning of the function.
* Nest metadata in refactoring docs (#23087)techknowlogick2023-02-231-5/+5
| | | | | Whitespace was missing from refactoring docs metadata. backport label applied so it is included in versioned docs.
* Improve frontend guidelines (#23007)wxiaoguang2023-02-211-5/+13
| | | Some were out-dated, some are added.
* Add some guidelines for refactoring (#22880)wxiaoguang2023-02-191-0/+51
| | | | | | Just some brief ideas. Feel free to complete these guidelines, feel free to edit on this PR directly.
* Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, ↵wxiaoguang2023-02-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | remove inline style=display:none (#22950) Close #22847 This PR: * introduce Gitea's own `showElem` and related functions * remove jQuery show/hide * remove .hide class * remove inline style=display:none From now on: do not use: * "[hidden]" attribute: it's too weak, can not be applied to an element with "display: flex" * ".hidden" class: it has been polluted by Fomantic UI in many cases * inline style="display: none": it's difficult to tweak * jQuery's show/hide/toggle: it can not show/hide elements with "display: xxx !important" only use: * this ".gt-hidden" class * showElem/hideElem/toggleElem functions in "utils/dom.js" cc: @silverwind , this is the all-in-one PR
* Fix typo in guidelines-backend.en-us.md (#22690)Ivan Maximov2023-01-311-1/+1
|
* Support scoped access tokens (#20908)Chongyi Zheng2023-01-171-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | This PR adds the support for scopes of access tokens, mimicking the design of GitHub OAuth scopes. The changes of the core logic are in `models/auth` that `AccessToken` struct will have a `Scope` field. The normalized (no duplication of scope), comma-separated scope string will be stored in `access_token` table in the database. In `services/auth`, the scope will be stored in context, which will be used by `reqToken` middleware in API calls. Only OAuth2 tokens will have granular token scopes, while others like BasicAuth will default to scope `all`. A large amount of work happens in `routers/api/v1/api.go` and the corresponding `tests/integration` tests, that is adding necessary scopes to each of the API calls as they fit. - [x] Add `Scope` field to `AccessToken` - [x] Add access control to all API endpoints - [x] Update frontend & backend for when creating tokens - [x] Add a database migration for `scope` column (enable 'all' access to past tokens) I'm aiming to complete it before Gitea 1.19 release. Fixes #4300
* Refactor docs (#21627)Xinyu Zhou2022-10-312-0/+0
| | | | | | | | | | | | | | This patch: - Rename some files( `.md` to `.en-us.md`), fix missed translation copy - Update link which shoud be refer to `../hacking-on-gitea/` instead of `../make/` (outdated) - Update `_redirects`: - redirect `/{zh-cn|fr-fr}/make/` to `../hacking-on-gitea/` - redirect `/zh-cn/third-party-tools/` to `/zh-cn/integrations/` - Delete duplicated/outdated files. - Update menu `weight` of developers.zh-cn.md Signed-off-by: Xinyu Zhou <i@sourcehut.net>
* Record OAuth client type at registration (#21316)M Hickford2022-10-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OAuth spec [defines two types of client](https://datatracker.ietf.org/doc/html/rfc6749#section-2.1), confidential and public. Previously Gitea assumed all clients to be confidential. > OAuth defines two client types, based on their ability to authenticate securely with the authorization server (i.e., ability to > maintain the confidentiality of their client credentials): > > confidential > Clients capable of maintaining the confidentiality of their credentials (e.g., client implemented on a secure server with > restricted access to the client credentials), or capable of secure client authentication using other means. > > **public > Clients incapable of maintaining the confidentiality of their credentials (e.g., clients executing on the device used by the resource owner, such as an installed native application or a web browser-based application), and incapable of secure client authentication via any other means.** > > The client type designation is based on the authorization server's definition of secure authentication and its acceptable exposure levels of client credentials. The authorization server SHOULD NOT make assumptions about the client type. https://datatracker.ietf.org/doc/html/rfc8252#section-8.4 > Authorization servers MUST record the client type in the client registration details in order to identify and process requests accordingly. Require PKCE for public clients: https://datatracker.ietf.org/doc/html/rfc8252#section-8.1 > Authorization servers SHOULD reject authorization requests from native apps that don't use PKCE by returning an error message Fixes #21299 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* inline gitpod image (#21494)techknowlogick2022-10-181-1/+1
| | | | | fix #21492 Co-authored-by: 6543 <6543@obermui.de>
* Refactor Gitpod configuration to improve quick spin up of automated dev ↵Yarden Shoham2022-10-121-0/+6
| | | | | | | | | | | | | | | | | environments (#21411) This commit instructs Gitpod to run `docs` in watch mode in fresh development environments so any dev could start hacking in seconds. Also included some vscode extensions for Vue, Go, and Docker. Try it here: [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/yardenshoham/gitea/tree/gitpod) Signed-off-by: Yarden Shoham <hrsi88@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com>
* Fix broken link to frontend guidelines in hacking guidelines (#21382)Yarden Shoham2022-10-112-1/+1
|
* Fix some typos and update db transaction demo in backend guideline (#21322)rj12022-10-081-18/+14
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix doc and heatmap for the Vue3 refactoring (#21312)wxiaoguang2022-10-021-4/+4
|
* Remove insecure flag from curl (#21074)John Olheiser2022-09-051-1/+1
| | | | | | | | Followup to #21071 Thanks for the catch @wxiaoguang [WRT](https://github.com/go-gitea/gitea/pull/21071#discussion_r962706673) Ref #21071
* Update curl usage in API docs (#21071)John Olheiser2022-09-052-6/+6
|
* Kd/ci playwright go test (#20123)Kyle D2022-09-022-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Add documentation about pagination of the API (#20740)techknowlogick2022-08-091-0/+12
| | | | | | | | | * Add documentation about pagination of the API * Update docs/content/doc/developers/api-usage.en-us.md Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add markdownlint (#20512)silverwind2022-07-287-30/+30
| | | | Add `markdownlint` linter and fix issues. Config is based on the one from electron's repo with a few rules relaxed.
* Use neutral language in comments and docs (#20135)Gusted2022-06-252-3/+3
| | | - Replace `his/her` to `their`, as it's more neutral language.
* Update frontend guideline (#19901)wxiaoguang2022-06-061-11/+21
| | | | | | | * update frontend guideline * "Native" => "Vanilla JS", fix typo comma. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* update documents (#19868)wxiaoguang2022-06-021-45/+1
|
* docs(hacking-on-gitea): fix installation instruction for elasticsearch ↵Yehonatan Ezron2022-05-291-1/+1
| | | | docker (#19829)
* Note where frontend files are located in docs (#19379)ktprograms2022-04-121-1/+7
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update the webauthn_credential_id_sequence in Postgres (#19048)zeripath2022-03-101-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update the webauthn_credential_id_sequence in Postgres There is (yet) another problem with v210 in that Postgres will silently allow preset ID insertions ... but it will not update the sequence value. This PR simply adds a little step to the end of the v210 migration to update the sequence number. Users who have already migrated who find that they cannot insert new webauthn_credentials into the DB can either run: ```bash gitea doctor recreate-table webauthn_credential ``` or ```bash ./gitea doctor --run=check-db-consistency --fix ``` which will fix the bad sequence. Fix #19012 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Disable service worker by default (#18914)silverwind2022-02-261-2/+0
| | | | | | | | The service worker causes a lot of issues with JS errors after instance upgrades while not bringing any real performance gain over regular HTTP caching. Disable it by default for this reason. Maybe later we can remove it completely, as I simply see no benefit in having it.
* Automatically pause queue if index service is unavailable (#15066)Lauris BH2022-01-271-0/+21
| | | | | | * Handle keyword search error when issue indexer service is not available * Implement automatic disabling and resume of code indexer queue
* Revert "Prevent possible XSS when using jQuery (#18289)" (#18293)wxiaoguang2022-01-161-5/+0
| | | This reverts commit 661d3d28e97bb49bef075c0314edad5879148aaa.
* Prevent possible XSS when using jQuery (#18289)Gusted2022-01-161-0/+5
| | | | | | | In the case of misuse or misunderstanding from a developer whereby, if `sel` can receive user-controlled data, jQuery `$(sel)` can lead to the creation of a new element. Current usage is using hard-coded selectors in the templates, but nobody prevents that from expanding to user-controlled somehow.
* Fix documents for development and bug report (#18249)wxiaoguang2022-01-131-14/+14
|
* chore: remove unnecessary section (#18209)Bo-Yi Wu2022-01-111-6/+0
| | | | | | Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix various typos (#18219)luzpaz2022-01-101-2/+2
| | | | | Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby,te,unknwon` Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix typos in docs/content (#18215)Greg Myers2022-01-091-3/+3
|
* tests: s/GITEA_UNIT_TESTS_VERBOSE/GITEA_UNIT_TESTS_LOG_SQL/ (#18142)singuliere2022-01-011-1/+1
| | | | | | | | | | | The GITEA_UNIT_TESTS_VERBOSE variable is an undocumented variable introduced in 2017 (see 1028ef2defd94a64f2433b07fe5d93681864cebb) whose sole purpose has been to log SQL statements when running unit tests. It is renamed for clarity and a warning is displayed for backward compatibility for people and scripts that know about it. The documentation is updated to reflect this change.
* Improve document for developers: Windows CGO, unit test option (#18140)wxiaoguang2021-12-311-2/+12
|
* Fix documents for Windows development (#18109)wxiaoguang2021-12-261-4/+6
| | | * Fix documents for Windows development
* Fix various typos of software names (#18083)qwerty2872021-12-244-11/+11
| | | | | | | | | | | | | | | | * `git` -> `Git` * `Github` and `github` -> `GitHub` * `crowdin` -> `Crowdin` * `git-lfs` -> `Git LFS` * `githooks`, `git hooks`, `git-hooks` -> `Git Hooks` * `discord` -> `Discord` * `2fa` -> `2FA` * `gitlab` and `Gitlab` -> `GitLab` * `web hook` -> `webhook` * `linux` -> `Linux` * `sqlite` -> `SQLite` * `MYSQL` and `mysql` -> `MySQL` * rename refs to `master` branch -> `main` * Fix English grammar
* docs: modules do not rely on models, services do (#17861)singuliere2021-11-301-1/+1
| | | | | | | | services: provide some services for users, usually use database (models) modules: provide some basic functions without database, eg: code parser, etc The major difference is services use database, while modules don’t. Signed-off-by: singuliere <singuliere@autistici.org>
* Fix various typos in docs (#17844)qwerty2872021-11-281-1/+1
|
* Docs: replace `gitea` with `Gitea` (#17838)qwerty2872021-11-282-4/+4
| | | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add documentation for backend development (#17512)Lunny Xiao2021-11-231-0/+115
| | | | | | | | | | | | | | | * Add documentation for backend development * Update backend guidline * More sections * Add modules/setting and modules/git * Uniform gitea as Gitea * some improvements * some improvements
* Fix project board bug and improve documents (#17753)wxiaoguang2021-11-221-0/+26
| | | | * the project board was broken, this PR fixes it, and refactor the code, and we prevent the uncategorized column from being dragged. * improve the frontend guideline (as discussed in https://github.com/go-gitea/gitea/pull/17699)
* fix migrations documents (#17679)Lunny Xiao2021-11-172-6/+6
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix some incorrect async functions, improve frontend document. (#17597)wxiaoguang2021-11-121-0/+59
|