Commit Graph

14213 Commits (c88963261cd96fc46688f9a5b4d51ce77c5ccbfc)

Author SHA1 Message Date
Earl Warren c88963261c
F3: Gitea driver and CLI
user, topic, project, label, milestone, repository, pull_request,
release, asset, comment, reaction, review providers

Signed-off-by: Earl Warren <contact@earl-warren.org>
2022-11-30 17:23:21 +01:00
Loïc Dachary e302cf89d8
git should ignore GNU/Emacs backups
Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-28 14:32:13 +01:00
Loïc Dachary a21a8d1863 [DOCS] document the forgejo-federation feature branch
Also group branches into categories as the F3 branch is motivated
because it contributes to federation.

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-28 10:46:06 +00:00
oliverpool 1681e37fbb split contributing documentation based on audience 2022-11-28 09:11:12 +01:00
Loïc Dachary 5908c21516
[DOCS] complete CONTRIBUTING.md
Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-27 17:12:02 +01:00
Loïc Dachary 8b1c304d82
[DOCS] Forgejo is inspired by Forĝejo not identical
Fixes: https://codeberg.org/forgejo/forgejo/issues/55

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 16:05:56 +01:00
Loïc Dachary 89aaf88fa2 [DOCS] the feature-ci branch has commits related to Woodpecker CI
Fixes: https://codeberg.org/forgejo/forgejo/issues/32

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 07:33:52 +00:00
Loïc Dachary f37bda8aba
[DOCS] document the {v1.18/,}forgejo-{ci,development} branches
Fixes: https://codeberg.org/forgejo/forgejo/issues/32

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 01:51:41 +01:00
Loïc Dachary 95b89180a5
[DOCS] define the Forgejo release number convention
Fixes: https://codeberg.org/forgejo/forgejo/issues/43

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:20:20 +01:00
Caesar Schinas 7af1457faf
Add Matrix and Fedi links to Readme 2022-11-26 00:16:30 +01:00
Loïc Dachary eb7bb3ea83
CONTRIBUTING.md: merge WORKFLOW.md & RELEASE.md
Having the development documentation in a single file may not be the best structure but it is how Gitea does it and there is value in keeping something familiar to existing contributors.

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:16:20 +01:00
Otto b8587f8383
Update README as per !21 2022-11-26 00:16:05 +01:00
Otto b262308667
README draft with skeleton 2022-11-26 00:16:00 +01:00
Loïc Dachary e60e5e6907
RELEASE.md: the release GPG key email is now release@forgejo.org
Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:15:55 +01:00
Loïc Dachary 611b114f1b
RELEASE.md: document the release process
Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:15:50 +01:00
Loïc Dachary b1a18b845d
RELEASE.md: add email of the release-team user
Fixes: https://codeberg.org/forgejo/forgejo/issues/6

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:15:43 +01:00
Caesar Schinas ebf577fcf8
Fix incorrect GPG key in issue template 2022-11-26 00:14:27 +01:00
Caesar Schinas ad36290d47
Update issue templates for Forgejo 2022-11-26 00:14:13 +01:00
Gusted a35b97e6b6
Add `--expert` option for subkey creation
- If this isn't specified, the ECC option wouldn't be shown.
2022-11-26 00:14:04 +01:00
Loïc Dachary 2c1f372d68
delete Gitea specific files that need rewriting for Forgejo
Although it would be possible to modify these files, it would create
conflicts when rebasing. Instead, this commit removes them entirely
and another commit can start from scratch, borrowing content from the
original files.

The drawback of this approach is that some content updates from Gitea
that also need updating in Forgejo will have to be copy/pasted
instead of being merged.

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:13:59 +01:00
Loïc Dachary e32ca83cbe
Release management documentation
Fixes: https://codeberg.org/Forgejo/forgejo/issues/4

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:13:54 +01:00
Loïc Dachary a99deecbcd
Forgejo development workflow
Fixes: https://codeberg.org/forgejo/forgejo/issues/5

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-26 00:13:49 +01:00
Loïc Dachary d3b008fab9
workaround: deactivate test-sqlite because it is too slow
Refs: https://codeberg.org/forgejo/forgejo/issues/31

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-25 20:09:57 +01:00
Loïc Dachary e2426ca0f2
workaround: Dockerfile for codeberg.org corrupted container images
https://codeberg.org/forgejo/forgejo/issues/26
https://codeberg.org/Codeberg/Community/issues/800

sed -i -e 's|^FROM.*golang.*|FROM codeberg.org/forgejo/golang:1.19-alpine3.16 AS build-env|' Dockerfile
sed -i -e 's|^FROM.*alpine:.*|FROM codeberg.org/forgejo/alpine:3.16.3|' Dockerfile

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-25 20:09:48 +01:00
Loïc Dachary 0c7a1bf11a
implementation: forgejo container images
Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-25 20:09:44 +01:00
Loïc Dachary 446e235742
implementation: Woodpecker based CI
Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-25 20:09:34 +01:00
Loïc Dachary 054925327f
implementation: publish forgejo- binaries instead of gitea-
Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-25 20:09:24 +01:00
Loïc Dachary 6fddbf49f0
upstream: remove unstable test
Fixes: https://codeberg.org/forgejo/forgejo/issues/30

Signed-off-by: Loïc Dachary <loic@dachary.org>
2022-11-25 20:09:11 +01:00
Meisam abecf632d2
add rel="me" to org.website link (#21941)
This lets organizations verify their link on 3rd party websites.
2022-11-25 09:33:37 -06:00
KN4CK3R 7a4f7b35e3
Fix typo in sidebar (#21934)
Same as #21922 
I used the npm file as template which was a bad idea to spot these
casing errors...
2022-11-25 17:52:23 +08:00
Percy Ma b91167b772
fix(web): keep the pages of the navigation in the center (#21867)
Keep the pages of the navigation in the center

<table>
  <tr>
    <th>Before</th>
    <th>After</th>
  </tr>

  <tr>
    <td>
<img width="200" alt="image"
src="https://user-images.githubusercontent.com/45708948/202838756-d6d57b3f-8144-4a43-a33b-ea7c8ab3a495.png">
</td>
    <td>
<img width="192" alt="image"
src="https://user-images.githubusercontent.com/45708948/202838740-bbae1e86-b14c-421d-92d4-d0e53d5952a2.png">
</td>
  </tr>
</table>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2022-11-25 14:37:02 +08:00
KN4CK3R a1ae83f36e
Workaround for container registry push/pull errors (#21862)
This PR addresses #19586

I added a mutex to the upload version creation which will prevent the
push errors when two requests try to create these database entries. I'm
not sure if this should be the final solution for this problem.

I added a workaround to allow a reupload of missing blobs. Normally a
reupload is skipped because the database knows the blob is already
present. The workaround checks if the blob exists on the file system.
This should not be needed anymore with the above fix so I marked this
code to be removed with Gitea v1.20.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-25 13:47:46 +08:00
silverwind 9ce5e092f3
Fix scroll over mermaid frame (#21925)
When starting a scroll while the mouse is over a mermaid diagram, the
scroll sometimes propagates to the iframe, preventing the parent page
from scrolling. Fix this by disabling scroll inside the iframe. This is
not a problem because those frames are never meant to scroll. Bug seems
to affect Firefox only.


![scroll](https://user-images.githubusercontent.com/115237/203847578-6831e3c8-9df4-4577-8501-822fb9ea1278.gif)
2022-11-24 20:56:57 +00:00
KN4CK3R fc7a2d5a95
Add support for HEAD requests in Maven registry (#21834)
Related #18543

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-24 16:25:13 +02:00
Xinyu Zhou 26f941fbda
Fix button in branch list, avoid unexpected page jump before restore branch actually done (#21562)
This patch:
- Use `<button>` replace anchor link `<a>` in **_Delete/Restore
Branch_** button to avoid unexpected page jump before restore branch
actually done.
- Also replace right side buttons with `<button>` in branch list, let
some screen readers know they are buttons.


## Before
click restore branch -> restore triggered -> page refreshed, but branch
status not update -> manually refresh page

<details>


https://user-images.githubusercontent.com/76462613/197389108-5a0bd259-0455-40b2-92ac-4326900276f8.mp4

</details>

## After
waiting restore done -> page refresh -> branch status update

<details>


https://user-images.githubusercontent.com/76462613/197428683-616fcbd2-70f9-4572-bf76-e0b7f77b6dd7.mp4

</details>

Signed-off-by: baronbunny <its@baronbunny.cn>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2022-11-24 20:29:43 +08:00
KN4CK3R b2269dedf2
Fix typo in sidebar (#21922) 2022-11-24 18:31:32 +08:00
silverwind b97548a2ee
Fix table misalignments and tweak webhook and githook lists (#21917)
- Fix regression from #21893 which had misaligned a few tables like repo
lists and e-mails
- Bring githooks list in line with webhooks list for styling
- Change webhook list icons to just colored dots, like githook list
- Increase size of dot in webhook and githook list from 16 to 22px
2022-11-24 00:43:07 -06:00
Xinyu Zhou 09b7d8198c
Fix flex layout for repo list icons (#21896)
#20241 Added a tooltip, which does not satisfy the flex layout, and the
icons are not aligned

Signed-off-by: Xinyu Zhou <i@sourcehut.net>
2022-11-23 22:01:30 -06:00
Jason Song 702f4b521e
Add index for access_token (#21908)
The `token_last_eight` field has been used in `GetAccessTokenBySHA `:
2022-11-23 20:49:41 -06:00
Xinyu Zhou e483ec3a00
Fix vertical align of committer avatar rendered by email address (#21884)
Committer avatar rendered by `func AvatarByEmail` are not vertical align
as `func Avatar` does.

- Replace literals `ui avatar` and `ui avatar vm` with the constant
`DefaultAvatarClass`
2022-11-23 15:57:37 -06:00
Xinyu Zhou a3c09fb36d
Improve docker rootless documentation (#21913)
Emphasize folder creation/permission granting

Signed-off-by: Xinyu Zhou <i@sourcehut.net>

Signed-off-by: Xinyu Zhou <i@sourcehut.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-11-23 13:01:38 -05:00
zeripath 787f6c3227
Ensure that Webhook tasks are not double delivered (#21558)
When re-retrieving hook tasks from the DB double check if they have not
been delivered in the meantime. Further ensure that tasks are marked as
delivered when they are being delivered.

In addition:
* Improve the error reporting and make sure that the webhook task
population script runs in a separate goroutine.
* Only get hook task IDs out of the DB instead of the whole task when
repopulating the queue
* When repopulating the queue make the DB request paged

Ref #17940 

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-23 22:10:04 +08:00
zeripath 4c00d8f916
Move migration test fixtures to the correct directories (#21901)
Unfortunately #21549 changed the name of Testcases without changing
their associated fixture directories.

Fix #21854

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-23 18:24:55 +08:00
kolaente 13746f070d
feat: add button to quickly clear merge message (#21548)
This PR adds a button to allow quickly clearing the merge message of a
PR. The button will remove everything but the git trailers.

I found myself often pruning the commit message before merging,
especially for PRs generated by renovate - renovate puts a very long and
detailed comment with the full changelog in each PR it opens. This
clutters the commit message. However, I want to explicitly preserve the
git commit trailers. Doing this manually works, but having a button is a
lot easier.

Screenshot:

![image](https://user-images.githubusercontent.com/13721712/197337525-d456d0f8-1f7c-43a9-815d-ca93b1e7a90a.png)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2022-11-23 18:24:03 +08:00
zeripath 4d42cbbcc2
Handle empty author names (#21902)
Although git does expect that author names should be of the form: `NAME
<EMAIL>` some users have been able to create commits with: `<EMAIL>`

Fix #21900

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-23 08:52:57 +08:00
silverwind ee21d5453f
Move all remaining colors into CSS variables (#21903)
This should eliminate all non-variable color usage in the styles, making
gitea fully themeable via CSS variables. Also, it adds a linter to
enforce variables for colors.
2022-11-23 08:22:27 +08:00
Xinyu Zhou 68e934ab5d
Add option to enable CAPTCHA validation for login (#21638)
Enable this to require captcha validation for user login. You also must
enable `ENABLE_CAPTCHA`.

Summary:
- Consolidate CAPTCHA template
- add CAPTCHA handle and context
- add `REQUIRE_CAPTCHA_FOR_LOGIN` config and docs
- Consolidate CAPTCHA set-up and verification code 

Partially resolved #6049 

Signed-off-by: Xinyu Zhou <i@sourcehut.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2022-11-22 21:13:18 +00:00
zeripath e77b76425e
Prepend refs/heads/ to issue template refs (#20461)
Fix #20456

At some point during the 1.17 cycle abbreviated refishs to issue
branches started breaking. This is likely due serious inconsistencies in
our management of refs throughout Gitea - which is a bug needing to be
addressed in a different PR. (Likely more than one)

We should try to use non-abbreviated `fullref`s as much as possible.
That is where a user has inputted a abbreviated `refish` we should add
`refs/heads/` if it is `branch` etc. I know people keep writing and
merging PRs that remove prefixes from stored content but it is just
wrong and it keeps causing problems like this. We should only remove the
prefix at the time of
presentation as the prefix is the only way of knowing umambiguously and
permanently if the `ref` is referring to a `branch`, `tag` or `commit` /
`SHA`. We need to make it so that every ref has the appropriate prefix,
and probably also need to come up with some definitely unambiguous way
of storing `SHA`s if they're used in a `ref` or `refish` field. We must
not store a potentially
ambiguous `refish` as a `ref`. (Especially when referring a `tag` -
there is no reason why users cannot create a `branch` with the same
short name as a `tag` and vice versa and any attempt to prevent this
will fail. You can even create a `branch` and a
`tag` that matches the `SHA` pattern.)

To that end in order to fix this bug, when parsing issue templates check
the provided `Ref` (here a `refish` because almost all users do not know
or understand the subtly), if it does not start with `refs/` add the
`BranchPrefix` to it. This allows people to make their templates refer
to a `tag` but not to a `SHA` directly. (I don't think that is
particularly unreasonable but if people disagree I can make the `refish`
be checked to see if it matches the `SHA` pattern.)

Next we need to handle the issue links that are already written. The
links here are created with `git.RefURL`

Here we see there is a bug introduced in #17551 whereby the provided
`ref` argument can be double-escaped so we remove the incorrect external
escape. (The escape added in #17551 is in the right place -
unfortunately I missed that the calling function was doing the wrong
thing.)

Then within `RefURL()` we check if an unprefixed `ref` (therefore
potentially a `refish`) matches the `SHA` pattern before assuming that
is actually a `commit` - otherwise is assumed to be a `branch`. This
will handle most of the problem cases excepting the very unusual cases
where someone has deliberately written a `branch` to look like a `SHA1`.

But please if something is called a `ref` or interpreted as a `ref` make
it a full-ref before storing or using it. By all means if something is a
`branch` assume the prefix is removed but always add it back in if you
are using it as a `ref`. Stop storing abbreviated `branch` names and
`tag` names - which are `refish` as a `ref`. It will keep on causing
problems like this.

Fix #20456

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-22 20:58:49 +08:00
Felipe Leopoldo Sologuren Gutiérrez 1d52228ee7
Fixes #21895: standardize UTC tz for util tests (#21897)
Standardize UTC timezone for `translateMonth` and `translateDay` tests.
2022-11-22 16:46:29 +08:00
mpeter50 371dd96e3e
Clarify logging documentation (#21665)
My pull request changes the logging documentation that is visible here:
https://docs.gitea.io/en-us/logging-configuration/
The reason behind the changes is that for some time I've found the
logging documentation confusing, and wanted to give a try at making it
more clear.

---

If you find the existing changes to be ok, please don't merge yet, as I
have further ideas which I want to discuss with you before making the
changes.

### Swap the "Log Groups" and "Log outputs" sections.
I want to move the "Log outputs" section before the "Log Groups"
section. The reason is that the "Log Groups" section refers to ini
sections that are only later explained, and to concepts that are general
and should be documented in "Log outputs" or a different section.

This change is essentially a swap of the "Log Groups" and "Log outputs"
sections. That way the doumentation would follow the structure in which
the ini file is built: first explaining the outer sections, and then the
inner ones ([log], [log.name], [log.name.default], ...)

### Explain the workings of ambigous settings below the settings listing
Right now the basics of a setting is shown later than the explanation of
its special workings, for example with `FILE_NAME` at [the file output
mode](https://docs.gitea.io/en-us/logging-configuration/#file-mode)
(well, if the first changes are taken into account).

Currently I have `TODO` witten at 2 settings, which I have to figure out
how do they exactly work before I can document them.

### New section about [log]
New section after "Collecting Logs for Help" about how the top level
[log] itself works and what can go there.
Currently, variables that directly go into [log] are noted throughout
the whole document.

---

Please let me know what you think about the changes.

A counterargument that I myself see is that some of this is already
present in the cheatsheet, but I think it would be better to have [this
document](https://docs.gitea.io/en-us/logging-configuration/) as a
throrough explanation of how logging is configured, and the cheatsheet
would only have a short outline of the possible sections and variables.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-22 09:04:29 +08:00