Merge branch 'master' into branch-special-chars

This commit is contained in:
nubenum 2018-06-13 20:35:12 +02:00
commit 06991dfb69
96 changed files with 1522 additions and 485 deletions

View File

@ -75,6 +75,7 @@ pipeline:
- make lint - make lint
- make fmt-check - make fmt-check
- make swagger-check - make swagger-check
- make swagger-validate
- make misspell-check - make misspell-check
- make test-vendor - make test-vendor
- make build - make build

View File

@ -4,6 +4,21 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io). been added to each release, please refer to the [blog](https://blog.gitea.io).
## [1.4.2](https://github.com/go-gitea/gitea/releases/tag/v1.4.2) - 2018-06-04
* BUGFIXES
* Adjust z-index for floating labels (#3939) (#3950)
* Add missing token validation on application settings page (#3976) #3978
* Webhook and hook_task clean up (#4006)
* Fix webhook bug of response info is not displayed in UI (#4023)
* Fix writer cannot read bare repo guide (#4033) (#4039)
* Don't force due date to current time (#3830) (#4057)
* Fix wiki redirects (#3919) (#4065)
* Fix attachment ENABLED (#4064) (#4066)
* Added deletion of an empty line at the end of file (#4054) (#4074)
* Use ResolveReference instead of path.Join (#4073)
* Fix #4081 Check for leading / in base before removing it (#4083)
* Respository's home page not updated after first push (#4075)
## [1.4.1](https://github.com/go-gitea/gitea/releases/tag/v1.4.1) - 2018-05-03 ## [1.4.1](https://github.com/go-gitea/gitea/releases/tag/v1.4.1) - 2018-05-03
* BREAKING * BREAKING
* Add "error" as reserved username (#3882) (#3886) * Add "error" as reserved username (#3882) (#3886)

View File

@ -69,7 +69,7 @@ and keep the compatibility on upgrade. To make sure you are
running the test suite exactly like we do, you should install running the test suite exactly like we do, you should install
the CLI for [Drone CI](https://github.com/drone/drone), as the CLI for [Drone CI](https://github.com/drone/drone), as
we are using the server for continous testing, following [these we are using the server for continous testing, following [these
instructions](http://readme.drone.io/usage/getting-started-cli). After that, instructions](http://docs.drone.io/cli-installation/). After that,
you can simply call `drone exec --local --build-event "pull_request"` within you can simply call `drone exec --local --build-event "pull_request"` within
your working directory and it will try to run the test suite locally. your working directory and it will try to run the test suite locally.
@ -114,7 +114,7 @@ pull request workflow to do that. And, we also use [LGTM](http://lgtm.co)
to ensure every PR is reviewed by at least 2 maintainers. to ensure every PR is reviewed by at least 2 maintainers.
Please try to make your pull request easy to review for us. And, please read Please try to make your pull request easy to review for us. And, please read
the *[How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/devel/pull-requests.md#best-practices-for-faster-reviews)* guide; the *[How to get faster PR reviews](https://github.com/kubernetes/community/blob/261cb0fd089b64002c91e8eddceebf032462ccd6/contributors/guide/pull-requests.md#best-practices-for-faster-reviews)* guide;
it has lots of useful tips for any project you may want to contribute. it has lots of useful tips for any project you may want to contribute.
Some of the key points: Some of the key points:
@ -201,6 +201,10 @@ an advisor has time to code review, we will gladly welcome them back
to the maintainers team. If a maintainer is inactive for more than 3 to the maintainers team. If a maintainer is inactive for more than 3
months and forgets to leave the maintainers team, the owners may move months and forgets to leave the maintainers team, the owners may move
him or her from the maintainers team to the advisors team. him or her from the maintainers team to the advisors team.
For security reasons, Maintainers should use 2FA for their accounts and
if possible provide gpg signed commits.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
https://help.github.com/articles/signing-commits-with-gpg/
## Owners ## Owners
@ -211,6 +215,9 @@ be the main owner, and the other two the assistant owners. When the new
owners have been elected, the old owners will give up ownership to the owners have been elected, the old owners will give up ownership to the
newly elected owners. If an owner is unable to do so, the other owners newly elected owners. If an owner is unable to do so, the other owners
will assist in ceding ownership to the newly elected owners. will assist in ceding ownership to the newly elected owners.
For security reasons, Owners or any account with write access (like a bot)
must use 2FA.
https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
After the election, the new owners should proactively agree After the election, the new owners should proactively agree
with our [CONTRIBUTING](CONTRIBUTING.md) requirements in the with our [CONTRIBUTING](CONTRIBUTING.md) requirements in the

2
Gopkg.lock generated
View File

@ -5,7 +5,7 @@
branch = "master" branch = "master"
name = "code.gitea.io/git" name = "code.gitea.io/git"
packages = ["."] packages = ["."]
revision = "0077debc17a58c821f4e62e815a54c1ab52da157" revision = "31f4b8e8c805438ac6d8914b38accb1d8aaf695e"
[[projects]] [[projects]]
branch = "master" branch = "master"

View File

@ -22,3 +22,4 @@ Peter Žeby <morlinest@gmail.com> (@morlinest)
Matti Ranta <matti@mdranta.net> (@techknowlogick) Matti Ranta <matti@mdranta.net> (@techknowlogick)
Michael Lustfield <mtecknology@debian.org> (@MTecknology) Michael Lustfield <mtecknology@debian.org> (@MTecknology)
Jonas Franz <info@jonasfranz.software> (@JonasFranzDEV) Jonas Franz <info@jonasfranz.software> (@JonasFranzDEV)
Flynn Lufmons <fluf@warpmail.net> (@flufmonster)

View File

@ -100,6 +100,13 @@ swagger-check: generate-swagger
exit 1; \ exit 1; \
fi; fi;
.PHONY: swagger-validate
swagger-validate:
@hash swagger > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
$(GO) get -u github.com/go-swagger/go-swagger/cmd/swagger; \
fi
swagger validate ./public/swagger.v1.json
.PHONY: errcheck .PHONY: errcheck
errcheck: errcheck:
@hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \ @hash errcheck > /dev/null 2>&1; if [ $$? -ne 0 ]; then \

View File

@ -12,13 +12,6 @@
[![Help Contribute to Open Source](https://www.codetriage.com/go-gitea/gitea/badges/users.svg)](https://www.codetriage.com/go-gitea/gitea) [![Help Contribute to Open Source](https://www.codetriage.com/go-gitea/gitea/badges/users.svg)](https://www.codetriage.com/go-gitea/gitea)
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backer/badge.svg?label=backer&color=brightgreen)](https://opencollective.com/gitea) [![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backer/badge.svg?label=backer&color=brightgreen)](https://opencollective.com/gitea)
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|
## Purpose ## Purpose
The goal of this project is to make the easiest, fastest, and most The goal of this project is to make the easiest, fastest, and most
@ -91,8 +84,24 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
<a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/gitea/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a> <a href="https://opencollective.com/gitea/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gitea/sponsor/9/avatar.svg"></a>
## FAQ
**How do you pronounce Gitea?**
Gitea is pronounced [/ɡɪti:/](https://youtu.be/EM71-2uDAoY) as in "gi-tea" with a hard g.
## License ## License
This project is licensed under the MIT License. This project is licensed under the MIT License.
See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file See the [LICENSE](https://github.com/go-gitea/gitea/blob/master/LICENSE) file
for the full license text. for the full license text.
## Screenshots
Looking for an overview of the interface? Check it out!
| | | |
|:---:|:---:|:---:|
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Wiki](https://image.ibb.co/dYV9YG/9.png)|
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|

View File

@ -73,6 +73,11 @@ var (
Value: "", Value: "",
Usage: "New password to set for user", Usage: "New password to set for user",
}, },
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
}, },
} }
@ -123,6 +128,10 @@ func runChangePassword(c *cli.Context) error {
return err return err
} }
if c.IsSet("config") {
setting.CustomConf = c.String("config")
}
if err := initDB(); err != nil { if err := initDB(); err != nil {
return err return err
} }

View File

@ -268,7 +268,7 @@ func runServ(c *cli.Context) error {
claims := jwt.MapClaims{ claims := jwt.MapClaims{
"repo": repo.ID, "repo": repo.ID,
"op": lfsVerb, "op": lfsVerb,
"exp": now.Add(5 * time.Minute).Unix(), "exp": now.Add(setting.LFS.HTTPAuthExpiry).Unix(),
"nbf": now.Unix(), "nbf": now.Unix(),
} }
if user != nil { if user != nil {

View File

@ -24,8 +24,8 @@
# Default values # Default values
NAME=gitea NAME=gitea
GITEA_HOME=/home/git/gitea GITEA_HOME=/var/lib/${NAME}
GITEA_PATH=${GITEA_HOME}/$NAME GITEA_PATH=/usr/local/bin/${NAME}
GITEA_USER=git GITEA_USER=git
SERVICENAME="Gitea - Git with a cup of tea" SERVICENAME="Gitea - Git with a cup of tea"
LOCKFILE=/var/lock/subsys/gitea LOCKFILE=/var/lock/subsys/gitea
@ -49,11 +49,11 @@ DAEMON_OPTS="--check $NAME"
start() { start() {
cd ${GITEA_HOME} cd ${GITEA_HOME}
echo -n "Starting ${SERVICENAME}: " echo -n "Starting ${SERVICENAME}: "
daemon $DAEMON_OPTS "${GITEA_PATH} web > ${LOGFILE} 2>&1 &" daemon $DAEMON_OPTS "${GITEA_PATH} web -c /etc/${NAME}/app.ini > ${LOGFILE} 2>&1 &"
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL = 0 ] && touch ${LOCKFILE} [ $RETVAL = 0 ] && touch ${LOCKFILE}
return $RETVAL return $RETVAL
} }
@ -63,7 +63,7 @@ stop() {
killproc ${NAME} killproc ${NAME}
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL = 0 ] && rm -f ${LOCKFILE} [ $RETVAL = 0 ] && rm -f ${LOCKFILE}
} }
case "$1" in case "$1" in

View File

@ -14,17 +14,20 @@
# Do NOT "set -e" # Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script # PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
DESC="Git with a cup of tea" DESC="Gitea - Git with a cup of tea"
NAME=gitea NAME=gitea
SERVICEVERBOSE=yes SERVICEVERBOSE=yes
PIDFILE=/var/run/$NAME.pid PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME SCRIPTNAME=/etc/init.d/$NAME
WORKINGDIR=/home/git/gitea WORKINGDIR=/var/lib/$NAME
DAEMON=$WORKINGDIR/$NAME DAEMON=/usr/local/bin/$NAME
DAEMON_ARGS="web" DAEMON_ARGS="web -c /etc/$NAME/app.ini"
USER=git USER=git
USERBIND="setcap cap_net_bind_service=+ep" USERBIND=""
# If you want to bind Gitea to a port below 1024 uncomment
# the line below
#USERBIND="setcap cap_net_bind_service=+ep"
STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/1/KILL/5}" STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/1/KILL/5}"
# Read configuration variable file if it is present # Read configuration variable file if it is present
@ -36,7 +39,7 @@ STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/1/KILL/5}"
do_start() do_start()
{ {
$USERBIND $DAEMON $USERBIND $DAEMON
sh -c "USER=$USER start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \\ sh -c "USER=$USER HOME=/home/$USER GITEA_WORK_DIR=$WORKINGDIR start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \\
--background --chdir $WORKINGDIR --chuid $USER \\ --background --chdir $WORKINGDIR --chuid $USER \\
--exec $DAEMON -- $DAEMON_ARGS" --exec $DAEMON -- $DAEMON_ARGS"
} }

View File

@ -19,9 +19,9 @@ load_rc_config $name
: ${gitea_user:="git"} : ${gitea_user:="git"}
: ${gitea_enable:="NO"} : ${gitea_enable:="NO"}
: ${gitea_directory:="/home/git"} : ${gitea_directory:="/var/lib/gitea"}
command="${gitea_directory}/gitea web" command="/usr/local/bin/gitea web -c /etc/gitea/app.ini"
procname="$(echo $command |cut -d' ' -f1)" procname="$(echo $command |cut -d' ' -f1)"
pidfile="${gitea_directory}/${name}.pid" pidfile="${gitea_directory}/${name}.pid"
@ -33,6 +33,7 @@ gitea_start() {
cd ${gitea_directory} cd ${gitea_directory}
export USER=${gitea_user} export USER=${gitea_user}
export HOME=/usr/home/${gitea_user} export HOME=/usr/home/${gitea_user}
export GITEA_WORK_DIR=${gitea_directory}
/usr/sbin/daemon -f -u ${gitea_user} -p ${pidfile} $command /usr/sbin/daemon -f -u ${gitea_user} -p ${pidfile} $command
} }

View File

@ -1,11 +1,11 @@
#!/sbin/openrc-run #!/sbin/openrc-run
DIR=/home/git/gitea DIR=/var/lib/gitea
USER=git USER=git
start_stop_daemon_args="--user ${USER} --chdir ${DIR}" start_stop_daemon_args="--user ${USER} --chdir ${DIR}"
command="${DIR}/gitea" command="/usr/local/bin/gitea"
command_args="web" command_args="web -c /etc/gitea/app.ini"
command_background=yes command_background=yes
pidfile=/var/run/gitea.pid pidfile=/var/run/gitea.pid

View File

@ -2,11 +2,11 @@
# #
# $OpenBSD$ # $OpenBSD$
daemon="/home/git/gitea/gitea" daemon="/usr/local/bin/gitea"
daemon_user="git" daemon_user="git"
daemon_flags="web" daemon_flags="web -c /etc/gitea/app.ini"
gitea_directory="/home/git/gitea" gitea_directory="/var/lib/gitea"
rc_bg=YES rc_bg=YES

View File

@ -18,10 +18,10 @@
# Default values # Default values
NAME=gitea NAME=gitea
GITEA_HOME=/home/git/gitea GITEA_HOME=/var/lib/$NAME
GITEA_PATH=${GITEA_HOME}/$NAME GITEA_PATH=/usr/local/bin/$NAME
GITEA_USER=git GITEA_USER=git
SERVICENAME="Git - with a cup of tea" SERVICENAME="Gitea - Git with a cup of tea"
LOCKFILE=/var/lock/subsys/gitea LOCKFILE=/var/lock/subsys/gitea
LOGPATH=${GITEA_HOME}/log LOGPATH=${GITEA_HOME}/log
LOGFILE=${LOGPATH}/error.log LOGFILE=${LOGPATH}/error.log
@ -58,7 +58,7 @@ case "$1" in
# return skipped as service is already running # return skipped as service is already running
(exit 5) (exit 5)
else else
su - ${GITEA_USER} -c "USER=${GITEA_USER} ${GITEA_PATH} web 2>&1 >>${LOGFILE} &" su - ${GITEA_USER} -c "USER=${GITEA_USER} GITEA_WORK_DIR=${GITEA_HOME} ${GITEA_PATH} web -c /etc/${NAME}/app.ini 2>&1 >>${LOGFILE} &"
fi fi
# Remember status and be verbose # Remember status and be verbose

View File

@ -18,10 +18,10 @@ RestartSec=2s
Type=simple Type=simple
User=git User=git
Group=git Group=git
WorkingDirectory=/home/git/gitea WorkingDirectory=/var/lib/gitea/
ExecStart=/home/git/gitea/gitea web ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
Restart=always Restart=always
Environment=USER=git HOME=/home/git Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# If you want to bind Gitea to a port below 1024 uncomment # If you want to bind Gitea to a port below 1024 uncomment
# the two values below # the two values below
### ###

View File

@ -189,6 +189,8 @@ LFS_START_SERVER = false
LFS_CONTENT_PATH = data/lfs LFS_CONTENT_PATH = data/lfs
; LFS authentication secret, change this yourself ; LFS authentication secret, change this yourself
LFS_JWT_SECRET = LFS_JWT_SECRET =
; LFS authentication validity period (in time.Duration), pushes taking longer than this may fail.
LFS_HTTP_AUTH_EXPIRY = 20m
; Define allowed algorithms and their minimum key length (use -1 to disable a type) ; Define allowed algorithms and their minimum key length (use -1 to disable a type)
[ssh.minimum_key_sizes] [ssh.minimum_key_sizes]
@ -412,7 +414,7 @@ ENABLE_FEDERATED_AVATAR = false
[attachment] [attachment]
; Whether attachments are enabled. Defaults to `true` ; Whether attachments are enabled. Defaults to `true`
ENABLE = true ENABLED = true
; Path for attachments. Defaults to `data/attachments` ; Path for attachments. Defaults to `data/attachments`
PATH = data/attachments PATH = data/attachments
; One or more allowed types, e.g. image/jpeg|image/png ; One or more allowed types, e.g. image/jpeg|image/png

View File

@ -115,6 +115,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
- `LFS_START_SERVER`: **false**: Enables git-lfs support. - `LFS_START_SERVER`: **false**: Enables git-lfs support.
- `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files. - `LFS_CONTENT_PATH`: **./data/lfs**: Where to store LFS files.
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string. - `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
- `LFS_HTTP_AUTH_EXPIRY`: **20m**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
- `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests - `REDIRECT_OTHER_PORT`: **false**: If true and `PROTOCOL` is https, redirects http requests
on another (https) port. on another (https) port.
- `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true. - `PORT_TO_REDIRECT`: **80**: Port used when `REDIRECT_OTHER_PORT` is true.

View File

@ -37,6 +37,7 @@ _Symbols used in table:_
<td>GitLab CE</td> <td>GitLab CE</td>
<td>GitLab EE</td> <td>GitLab EE</td>
<td>BitBucket</td> <td>BitBucket</td>
<td>RhodeCode CE</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -48,6 +49,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Issue tracker</td> <td>Issue tracker</td>
@ -57,6 +59,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Pull/Merge requests</td> <td>Pull/Merge requests</td>
@ -66,6 +69,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Squash merging</td> <td>Squash merging</td>
@ -75,6 +79,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Rebase merging</td> <td>Rebase merging</td>
@ -84,6 +89,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Pull/Merge request inline comments</td> <td>Pull/Merge request inline comments</td>
@ -93,6 +99,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Pull/Merge request approval</td> <td>Pull/Merge request approval</td>
@ -102,6 +109,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Merge conflict resolution</td> <td>Merge conflict resolution</td>
@ -111,6 +119,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Restrict push and merge access to certain users</td> <td>Restrict push and merge access to certain users</td>
@ -120,6 +129,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Markdown support</td> <td>Markdown support</td>
@ -129,6 +139,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Issues and pull/merge requests templates</td> <td>Issues and pull/merge requests templates</td>
@ -138,6 +149,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Revert specific commits or a merge request</td> <td>Revert specific commits or a merge request</td>
@ -147,6 +159,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Labels</td> <td>Labels</td>
@ -156,6 +169,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Time tracking</td> <td>Time tracking</td>
@ -165,6 +179,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Multiple assignees for issues</td> <td>Multiple assignees for issues</td>
@ -174,6 +189,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Related issues</td> <td>Related issues</td>
@ -183,6 +199,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Confidential issues</td> <td>Confidential issues</td>
@ -192,6 +209,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Comment reactions</td> <td>Comment reactions</td>
@ -201,6 +219,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Lock Discussion</td> <td>Lock Discussion</td>
@ -210,6 +229,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Batch issue handling</td> <td>Batch issue handling</td>
@ -219,6 +239,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Issue Boards</td> <td>Issue Boards</td>
@ -228,6 +249,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Create new branches from issues</td> <td>Create new branches from issues</td>
@ -237,6 +259,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Commit graph</td> <td>Commit graph</td>
@ -246,6 +269,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Web code editor</td> <td>Web code editor</td>
@ -255,6 +279,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Branch manager</td> <td>Branch manager</td>
@ -264,6 +289,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Create new branches</td> <td>Create new branches</td>
@ -273,6 +299,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Repository topics</td> <td>Repository topics</td>
@ -282,6 +309,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Repository code search</td> <td>Repository code search</td>
@ -291,6 +319,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Global code search</td> <td>Global code search</td>
@ -300,6 +329,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Issue search</td> <td>Issue search</td>
@ -309,6 +339,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Global issue search</td> <td>Global issue search</td>
@ -318,6 +349,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Git LFS 2.0</td> <td>Git LFS 2.0</td>
@ -327,6 +359,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Integrated Git-powered wiki</td> <td>Integrated Git-powered wiki</td>
@ -336,6 +369,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Static Git-powered pages</td> <td>Static Git-powered pages</td>
@ -345,6 +379,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Group Milestones</td> <td>Group Milestones</td>
@ -354,6 +389,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Granular user roles (Code, Issues, Wiki etc)</td> <td>Granular user roles (Code, Issues, Wiki etc)</td>
@ -363,6 +399,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Cherry-picking changes</td> <td>Cherry-picking changes</td>
@ -372,6 +409,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>GPG Signed Commits</td> <td>GPG Signed Commits</td>
@ -381,6 +419,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Reject unsigned commits</td> <td>Reject unsigned commits</td>
@ -390,6 +429,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Verified Committer</td> <td>Verified Committer</td>
@ -399,6 +439,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Subgroups: groups within groups</td> <td>Subgroups: groups within groups</td>
@ -408,6 +449,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Custom Git Hooks</td> <td>Custom Git Hooks</td>
@ -417,6 +459,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Repository Activity page</td> <td>Repository Activity page</td>
@ -426,6 +469,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Deploy Tokens</td> <td>Deploy Tokens</td>
@ -435,6 +479,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Repository Tokens with write rights</td> <td>Repository Tokens with write rights</td>
@ -444,6 +489,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Easy upgrade process</td> <td>Easy upgrade process</td>
@ -453,6 +499,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Built-in Container Registry</td> <td>Built-in Container Registry</td>
@ -462,6 +509,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>External git mirroring</td> <td>External git mirroring</td>
@ -471,6 +519,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>AD / LDAP integration</td> <td>AD / LDAP integration</td>
@ -480,6 +529,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Multiple LDAP / AD server support</td> <td>Multiple LDAP / AD server support</td>
@ -489,6 +539,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>LDAP user synchronization</td> <td>LDAP user synchronization</td>
@ -498,6 +549,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>OpenId Connect support</td> <td>OpenId Connect support</td>
@ -507,6 +559,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td>?</td> <td>?</td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>OAuth 2.0 integration (external authorization)</td> <td>OAuth 2.0 integration (external authorization)</td>
@ -516,6 +569,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td>?</td> <td>?</td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Act as OAuth 2.0 provider</td> <td>Act as OAuth 2.0 provider</td>
@ -525,6 +579,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Two factor authentication (2FA)</td> <td>Two factor authentication (2FA)</td>
@ -534,6 +589,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>FIDO U2F (2FA)</td> <td>FIDO U2F (2FA)</td>
@ -543,6 +599,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Webhook support</td> <td>Webhook support</td>
@ -552,6 +609,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Mattermost/Slack integration</td> <td>Mattermost/Slack integration</td>
@ -561,6 +619,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Discord integration</td> <td>Discord integration</td>
@ -570,6 +629,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Built-in CI/CD</td> <td>Built-in CI/CD</td>
@ -579,6 +639,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>External CI/CD status display</td> <td>External CI/CD status display</td>
@ -588,6 +649,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Multiple database support</td> <td>Multiple database support</td>
@ -597,6 +659,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Multiple OS support</td> <td>Multiple OS support</td>
@ -606,6 +669,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr> <tr>
<td>Low resource usage (RAM/CPU)</td> <td>Low resource usage (RAM/CPU)</td>
@ -615,6 +679,7 @@ _Symbols used in table:_
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -20,8 +20,8 @@ embedded assets. This can be different for older releases. Choose the file match
the destination platform from the [downloads page](https://dl.gitea.io/gitea), copy the destination platform from the [downloads page](https://dl.gitea.io/gitea), copy
the URL and replace the URL within the commands below: the URL and replace the URL within the commands below:
``` ```sh
wget -O gitea https://dl.gitea.io/gitea/1.3.2/gitea-1.3.2-linux-amd64 wget -O gitea https://dl.gitea.io/gitea/1.4.2/gitea-1.4.2-linux-amd64
chmod +x gitea chmod +x gitea
``` ```
@ -34,6 +34,54 @@ location. When launched manually, Gitea can be killed using `Ctrl+C`.
./gitea web ./gitea web
``` ```
## Recommended server configuration
### Prepare environment
Check that git is installed on the server, if it is not install it first.
```sh
git --version
```
Create user to run gitea (ex. `git`)
```sh
adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \
git
```
### Create required directory structure
```sh
mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
chown git:git /var/lib/gitea/{data,indexers,log}
chmod 750 /var/lib/gitea/{data,indexers,log}
mkdir /etc/gitea
chown root:git /etc/gitea
chmod 770 /etc/gitea
```
**NOTE:** `/etc/gitea` is temporary set with write rights for user `git` so that Web installer could write configuration file. After installation is done it is recommended to set rights to read-only using:
```
chmod 750 /etc/gitea
chmod 644 /etc/gitea/app.ini
```
### Copy gitea binary to global location
```
cp gitea /usr/local/bin/gitea
```
### Create service file to start gitea automatically
See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}})
## Troubleshooting ## Troubleshooting
### Old glibc versions ### Old glibc versions

View File

@ -17,16 +17,13 @@ menu:
## Debian ## Debian
The only distribution that has any "official" package of Gitea is Debian. This is currently Although there is a package of Gitea in Debian's [contrib](https://wiki.debian.org/SourcesList),
in Debian's [contrib](https://wiki.debian.org/SourcesList). This is (currently) only available it is not supported directly by us.
in Debian testing and unstable (but should be installable/functional on stable).
- Edit /etc/apt/sourced.list Unfortunately the package is not maintained anymore and broken because of missing sources.
- Add "contrib" to "deb http://deb.debian.org/debian unstable main contrib" Please follow the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide instead.
- apt-get update
- apt-get install gitea
For other distributions, see the [deployment from binary]({{< relref "from-binary.en-us.md" >}}) guide. Should the packages get updated and fixed, we will provide up-to-date installation instructions here.
## Windows ## Windows

View File

@ -231,7 +231,7 @@ You can configure some of Gitea's settings via environment variables:
* `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title. * `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title.
* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment. * `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
* `SSH_DOMAIN`: **localhost**: Domain name of this server, used for displayed clone UR in Gitea's UI. * `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed clone URL in Gitea's UI.
* `SSH_PORT`: **22**: SSH port displayed in clone URL. * `SSH_PORT`: **22**: SSH port displayed in clone URL.
* `DISABLE_SSH`: **false**: Disable SSH feature when it's not available. * `DISABLE_SSH`: **false**: Disable SSH feature when it's not available.
* `HTTP_PORT`: **3000**: HTTP listen port. * `HTTP_PORT`: **3000**: HTTP listen port.

View File

@ -20,7 +20,7 @@ file can be unpacked and used to restore an instance.
## Backup Command (`dump`) ## Backup Command (`dump`)
Switch to the user running gitea: `su git`. Run `./gitea dump` in the gitea installation Switch to the user running gitea: `su git`. Run `./gitea dump -c /path/to/app.ini` in the gitea installation
directory. There should be some output similar to the following: directory. There should be some output similar to the following:
``` ```
@ -34,7 +34,8 @@ directory. There should be some output similar to the following:
Inside the `gitea-dump-1482906742.zip` file, will be the following: Inside the `gitea-dump-1482906742.zip` file, will be the following:
* `custom/conf/app.ini` - Server config. * `custom` - All config or customerize files in `custom/`.
* `data` - Data directory in <GITEA_WORK_DIR>, except sessions if you are using file session. This directory includes `attachments`, `avatars`, `lfs`, `indexers`, sqlite file if you are using sqlite.
* `gitea-db.sql` - SQL dump of database * `gitea-db.sql` - SQL dump of database
* `gitea-repo.zip` - Complete copy of the repository directory. * `gitea-repo.zip` - Complete copy of the repository directory.
* `log/` - Various logs. They are not needed for a recovery or migration. * `log/` - Various logs. They are not needed for a recovery or migration.

View File

@ -0,0 +1,60 @@
---
date: "2018-06-06T09:33:00+08:00"
title: "使用: 备份与恢复"
slug: "backup-and-restore"
weight: 11
toc: true
draft: false
menu:
sidebar:
parent: "usage"
name: "备份与恢复"
weight: 11
identifier: "backup-and-restore"
---
# 备份与恢复
Gitea 已经实现了 `dump` 命令可以用来备份所有需要的文件到一个zip压缩文件。该压缩文件可以被用来进行数据恢复。
## 备份命令 (`dump`)
先转到git用户的权限: `su git`. 再Gitea目录运行 `./gitea dump`。一般会显示类似如下的输出:
```
2016/12/27 22:32:09 Creating tmp work dir: /tmp/gitea-dump-417443001
2016/12/27 22:32:09 Dumping local repositories.../home/git/gitea-repositories
2016/12/27 22:32:22 Dumping database...
2016/12/27 22:32:22 Packing dump files...
2016/12/27 22:32:34 Removing tmp work dir: /tmp/gitea-dump-417443001
2016/12/27 22:32:34 Finish dumping in file gitea-dump-1482906742.zip
```
最后生成的 `gitea-dump-1482906742.zip` 文件将会包含如下内容:
* `custom` - 所有保存在 `custom/` 目录下的配置和自定义的文件。
* `data` - 数据目录下的所有内容不包含使用文件session的文件。该目录包含 `attachments`, `avatars`, `lfs`, `indexers`, 如果使用sqlite 还会包含 sqlite 数据库文件。
* `gitea-db.sql` - 数据库dump出来的 SQL。
* `gitea-repo.zip` - Git仓库压缩文件。
* `log/` - Logs文件如果用作迁移不是必须的。
中间备份文件将会在临时目录进行创建,如果您要重新指定临时目录,可以用 `--tempdir` 参数,或者用 `TMPDIR` 环境变量。
## Restore Command (`restore`)
当前还没有恢复命令,恢复需要人工进行。主要是把文件和数据库进行恢复。
例如:
```
apt-get install gitea
unzip gitea-dump-1482906742.zip
cd gitea-dump-1482906742
mv custom/conf/app.ini /etc/gitea/conf/app.ini
unzip gitea-repo.zip
mv gitea-repo/* /var/lib/gitea/repositories/
chown -R gitea:gitea /etc/gitea/conf/app.ini /var/lib/gitea/repositories/
mysql -u$USER -p$PASS $DATABASE <gitea-db.sql
# or sqlite3 $DATABASE_PATH <gitea-db.sql
service gitea restart
```

View File

@ -62,6 +62,7 @@ Admin operations:
- Options: - Options:
- `--username value`, `-u value`: Username. Required. - `--username value`, `-u value`: Username. Required.
- `--password value`, `-p value`: New password. Required. - `--password value`, `-p value`: New password. Required.
- `--config path`: Gitea configuration file path. Optional. (default: custom/conf/app.ini).
- Examples: - Examples:
- `gitea admin change-password --username myname --password asecurepassword` - `gitea admin change-password --username myname --password asecurepassword`
- `regenerate` - `regenerate`

View File

@ -0,0 +1,46 @@
---
date: "2018-06-02T11:00:00+02:00"
title: "Usage: HTTPS setup"
slug: "https-setup"
weight: 12
toc: true
draft: false
menu:
sidebar:
parent: "usage"
name: "HTTPS setup"
weight: 12
identifier: "https-setup"
---
# HTTPS setup to encrypt connections to Gitea
## Using built-in server
Before you enable HTTPS make sure that you have valid SSL/TLS certificates.
You could use self-generated certificates for evaluation and testing. Please run `gitea cert --host [HOST]` to generate a self signed certificate.
To use Gitea's built-in HTTPS support you must change your `app.ini` file:
```ini
[server]
PROTOCOL=https
ROOT_URL = `https://git.example.com:3000/`
HTTP_PORT = 3000
CERT_FILE = cert.pem
KEY_FILE = key.pem
```
To learn more about the config values, please checkout the [Config Cheat Sheet](../config-cheat-sheet#server).
## Using reverse proxy
Setup up your reverse proxy like shown in the [reverse proxy guide](../reverse-proxies).
After that, enable HTTPS by following one of these guides:
* [nginx](https://nginx.org/en/docs/http/configuring_https_servers.html)
* [apache2/httpd](https://httpd.apache.org/docs/2.4/ssl/ssl_howto.html)
* [caddy](https://caddyserver.com/docs/tls)
Note: You connection between your reverse proxy and gitea might be unencrypted. To encrypt it too follow the [built-in server guide](#using-built-in-server) and change
the proxy url to `https://[URL]`.

View File

@ -13,7 +13,7 @@ Make sure to perform a clean build before running tests:
## Run all tests via local drone ## Run all tests via local drone
``` ```
drone exec --local --build.event "pull_request" drone exec --local --build-event "pull_request"
``` ```
## Run sqlite integrations tests ## Run sqlite integrations tests

View File

@ -102,7 +102,7 @@ func IsErrEmailAlreadyUsed(err error) bool {
} }
func (err ErrEmailAlreadyUsed) Error() string { func (err ErrEmailAlreadyUsed) Error() string {
return fmt.Sprintf("e-mail has been used [email: %s]", err.Email) return fmt.Sprintf("e-mail already in use [email: %s]", err.Email)
} }
// ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error. // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
@ -117,7 +117,7 @@ func IsErrOpenIDAlreadyUsed(err error) bool {
} }
func (err ErrOpenIDAlreadyUsed) Error() string { func (err ErrOpenIDAlreadyUsed) Error() string {
return fmt.Sprintf("OpenID has been used [oid: %s]", err.OpenID) return fmt.Sprintf("OpenID already in use [oid: %s]", err.OpenID)
} }
// ErrUserOwnRepos represents a "UserOwnRepos" kind of error. // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.

View File

@ -147,6 +147,10 @@ func (c *Comment) AfterLoad(session *xorm.Session) {
// AfterDelete is invoked from XORM after the object is deleted. // AfterDelete is invoked from XORM after the object is deleted.
func (c *Comment) AfterDelete() { func (c *Comment) AfterDelete() {
if c.ID <= 0 {
return
}
_, err := DeleteAttachmentsByComment(c.ID, true) _, err := DeleteAttachmentsByComment(c.ID, true)
if err != nil { if err != nil {

View File

@ -448,6 +448,11 @@ func DeleteReleaseByID(id int64, u *User, delTag bool) error {
} }
} }
rel.Repo = repo
if err = rel.LoadAttributes(); err != nil {
return fmt.Errorf("LoadAttributes: %v", err)
}
mode, _ := accessLevel(x, u.ID, rel.Repo) mode, _ := accessLevel(x, u.ID, rel.Repo)
if err := PrepareWebhooks(rel.Repo, HookEventRelease, &api.ReleasePayload{ if err := PrepareWebhooks(rel.Repo, HookEventRelease, &api.ReleasePayload{
Action: api.HookReleaseDeleted, Action: api.HookReleaseDeleted,

View File

@ -1848,6 +1848,9 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
if _, err = sess.In("issue_id", issueIDs).Delete(&IssueUser{}); err != nil { if _, err = sess.In("issue_id", issueIDs).Delete(&IssueUser{}); err != nil {
return err return err
} }
if _, err = sess.In("issue_id", issueIDs).Delete(&Reaction{}); err != nil {
return err
}
attachments := make([]*Attachment, 0, 5) attachments := make([]*Attachment, 0, 5)
if err = sess. if err = sess.

View File

@ -371,7 +371,7 @@ func (f *MergePullRequestForm) Validate(ctx *macaron.Context, errs binding.Error
// NewReleaseForm form for creating release // NewReleaseForm form for creating release
type NewReleaseForm struct { type NewReleaseForm struct {
TagName string `binding:"Required"` TagName string `binding:"Required;GitRefName"`
Target string `form:"tag_target" binding:"Required"` Target string `form:"tag_target" binding:"Required"`
Title string `binding:"Required"` Title string `binding:"Required"`
Content string Content string

View File

@ -136,10 +136,11 @@ var (
} }
LFS struct { LFS struct {
StartServer bool `ini:"LFS_START_SERVER"` StartServer bool `ini:"LFS_START_SERVER"`
ContentPath string `ini:"LFS_CONTENT_PATH"` ContentPath string `ini:"LFS_CONTENT_PATH"`
JWTSecretBase64 string `ini:"LFS_JWT_SECRET"` JWTSecretBase64 string `ini:"LFS_JWT_SECRET"`
JWTSecretBytes []byte `ini:"-"` JWTSecretBytes []byte `ini:"-"`
HTTPAuthExpiry time.Duration `ini:"LFS_HTTP_AUTH_EXPIRY"`
} }
// Security settings // Security settings
@ -828,6 +829,8 @@ func NewContext() {
LFS.ContentPath = filepath.Join(AppWorkPath, LFS.ContentPath) LFS.ContentPath = filepath.Join(AppWorkPath, LFS.ContentPath)
} }
LFS.HTTPAuthExpiry = sec.Key("LFS_HTTP_AUTH_EXPIRY").MustDuration(20 * time.Minute)
if LFS.StartServer { if LFS.StartServer {
if err := os.MkdirAll(LFS.ContentPath, 0700); err != nil { if err := os.MkdirAll(LFS.ContentPath, 0700); err != nil {
@ -947,7 +950,7 @@ func NewContext() {
AttachmentAllowedTypes = strings.Replace(sec.Key("ALLOWED_TYPES").MustString("image/jpeg,image/png,application/zip,application/gzip"), "|", ",", -1) AttachmentAllowedTypes = strings.Replace(sec.Key("ALLOWED_TYPES").MustString("image/jpeg,image/png,application/zip,application/gzip"), "|", ",", -1)
AttachmentMaxSize = sec.Key("MAX_SIZE").MustInt64(4) AttachmentMaxSize = sec.Key("MAX_SIZE").MustInt64(4)
AttachmentMaxFiles = sec.Key("MAX_FILES").MustInt(5) AttachmentMaxFiles = sec.Key("MAX_FILES").MustInt(5)
AttachmentEnabled = sec.Key("ENABLE").MustBool(true) AttachmentEnabled = sec.Key("ENABLED").MustBool(true)
TimeFormatKey := Cfg.Section("time").Key("FORMAT").MustString("RFC1123") TimeFormatKey := Cfg.Section("time").Key("FORMAT").MustString("RFC1123")
TimeFormat = map[string]string{ TimeFormat = map[string]string{

View File

@ -7,6 +7,7 @@ package util
import ( import (
"net/url" "net/url"
"path" "path"
"strings"
"code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/log"
) )
@ -56,16 +57,25 @@ func Max(a, b int) int {
// URLJoin joins url components, like path.Join, but preserving contents // URLJoin joins url components, like path.Join, but preserving contents
func URLJoin(base string, elems ...string) string { func URLJoin(base string, elems ...string) string {
u, err := url.Parse(base) if !strings.HasSuffix(base, "/") {
base += "/"
}
baseURL, err := url.Parse(base)
if err != nil { if err != nil {
log.Error(4, "URLJoin: Invalid base URL %s", base) log.Error(4, "URLJoin: Invalid base URL %s", base)
return "" return ""
} }
joinArgs := make([]string, 0, len(elems)+1) joinedPath := path.Join(elems...)
joinArgs = append(joinArgs, u.Path) argURL, err := url.Parse(joinedPath)
joinArgs = append(joinArgs, elems...) if err != nil {
u.Path = path.Join(joinArgs...) log.Error(4, "URLJoin: Invalid arg %s", joinedPath)
return u.String() return ""
}
joinedURL := baseURL.ResolveReference(argURL).String()
if !baseURL.IsAbs() && !strings.HasPrefix(base, "/") {
return joinedURL[1:] // Removing leading '/' if needed
}
return joinedURL
} }
// Min min of two ints // Min min of two ints

View File

@ -30,6 +30,14 @@ func TestURLJoin(t *testing.T) {
"a", "b/c/"), "a", "b/c/"),
newTest("a/b/d", newTest("a/b/d",
"a/", "b/c/", "/../d/"), "a/", "b/c/", "/../d/"),
newTest("https://try.gitea.io/a/b/c#d",
"https://try.gitea.io", "a/b", "c#d"),
newTest("/a/b/d",
"/a/", "b/c/", "/../d/"),
newTest("/a/b/c",
"/a", "b/c/"),
newTest("/a/b/c#hash",
"/a", "b/c#hash"),
} { } {
assert.Equal(t, test.Expected, URLJoin(test.Base, test.Elements...)) assert.Equal(t, test.Expected, URLJoin(test.Base, test.Elements...))
} }

View File

@ -19,7 +19,7 @@ const (
) )
var ( var (
// GitRefNamePattern is regular expression wirh unallowed characters in git reference name // GitRefNamePattern is regular expression with unallowed characters in git reference name
GitRefNamePattern = regexp.MustCompile("[^\\d\\w-_\\./]") GitRefNamePattern = regexp.MustCompile("[^\\d\\w-_\\./]")
) )

View File

@ -79,7 +79,6 @@ has_unconfirmed_mail=Здравейте %s, имате непотвърден а
resend_mail=Щракнете тук, за да се изпрати ново писмо за потвърждение resend_mail=Щракнете тук, за да се изпрати ново писмо за потвърждение
reset_password=Нулиране на паролата reset_password=Нулиране на паролата
reset_password_helper=Щракнете тук, за да нулирате паролата си reset_password_helper=Щракнете тук, за да нулирате паролата си
password_too_short=Размерът на паролата не може да бъде по-малък от %d знака.
[mail] [mail]
activate_account=Моля активирайте Вашия профил activate_account=Моля активирайте Вашия профил
@ -606,9 +605,7 @@ config.db_config=Настройки на базата данни
config.db_type=Тип config.db_type=Тип
config.db_host=Сървър config.db_host=Сървър
config.db_name=Име config.db_name=Име
config.db_ssl_mode_helper=(само за postgres)
config.db_path=Път config.db_path=Път
config.db_path_helper=(за "sqlite3" и "tidb")
config.service_config=Настройка на услугата config.service_config=Настройка на услугата
config.show_registration_button=Покажи бутон за регистрация config.show_registration_button=Покажи бутон за регистрация

View File

@ -79,7 +79,6 @@ has_unconfirmed_mail=Zdravím, %s, máte nepotvrzenou e-mailovou adresu (<b>%s</
resend_mail=Klikněte zde pro odeslání aktivačního e-mailu resend_mail=Klikněte zde pro odeslání aktivačního e-mailu
reset_password=Obnova vašeho hesla reset_password=Obnova vašeho hesla
reset_password_helper=Klikněte zde pro obnovu vašeho hesla reset_password_helper=Klikněte zde pro obnovu vašeho hesla
password_too_short=Délka hesla musí být minimálně %d znaků.
[mail] [mail]
activate_account=Prosíme, aktivujte si váš účet activate_account=Prosíme, aktivujte si váš účet
@ -603,9 +602,7 @@ config.db_config=Nastavení databáze
config.db_type=Typ config.db_type=Typ
config.db_host=Server config.db_host=Server
config.db_name=Název config.db_name=Název
config.db_ssl_mode_helper=(pouze pro 'postgres')
config.db_path=Cesta config.db_path=Cesta
config.db_path_helper=(pro "sqlite3" a "tidb")
config.service_config=Nastavení služby config.service_config=Nastavení služby
config.show_registration_button=Ukázat tlačítko registrace config.show_registration_button=Ukázat tlačítko registrace

View File

@ -213,7 +213,6 @@ send_reset_mail=E-Mail zum Passwort-zurücksetzen erneut verschicken
reset_password=Passwort zurücksetzen reset_password=Passwort zurücksetzen
invalid_code=Dein Bestätigungs-Code ist ungültig oder abgelaufen. invalid_code=Dein Bestätigungs-Code ist ungültig oder abgelaufen.
reset_password_helper=Passwort zurückzusetzen reset_password_helper=Passwort zurückzusetzen
password_too_short=Das Passwort muss mindenstens %d Zeichen lang sein.
non_local_account=Benutzer, die nicht von Gitea verwaltet werden können ihre Passwörter nicht über das Web Interface ändern. non_local_account=Benutzer, die nicht von Gitea verwaltet werden können ihre Passwörter nicht über das Web Interface ändern.
verify=Verifizieren verify=Verifizieren
scratch_code=Einmalpasswort scratch_code=Einmalpasswort
@ -693,6 +692,8 @@ issues.filter_sort.recentupdate=Kürzlich aktualisiert
issues.filter_sort.leastupdate=Am Längsten nicht aktualisiert issues.filter_sort.leastupdate=Am Längsten nicht aktualisiert
issues.filter_sort.mostcomment=Am meisten kommentiert issues.filter_sort.mostcomment=Am meisten kommentiert
issues.filter_sort.leastcomment=Am wenigsten kommentiert issues.filter_sort.leastcomment=Am wenigsten kommentiert
issues.filter_sort.moststars=Meiste Favoriten
issues.filter_sort.feweststars=Wenigste Favoriten
issues.filter_sort.mostforks=Meiste Forks issues.filter_sort.mostforks=Meiste Forks
issues.filter_sort.fewestforks=Wenigste Forks issues.filter_sort.fewestforks=Wenigste Forks
issues.action_open=Öffnen issues.action_open=Öffnen
@ -1388,6 +1389,7 @@ auths.attribute_username_placeholder=Leerlassen, um den in Gitea eingegebenen Be
auths.attribute_name=Vornamensattribut auths.attribute_name=Vornamensattribut
auths.attribute_surname=Nachnamensattribut auths.attribute_surname=Nachnamensattribut
auths.attribute_mail=E-Mail Attribut auths.attribute_mail=E-Mail Attribut
auths.attribute_ssh_public_key=Öffentliches SSH-Schlüssel Attribut
auths.attributes_in_bind=Hole Attribute im Bind-Kontext auths.attributes_in_bind=Hole Attribute im Bind-Kontext
auths.use_paged_search=Seitensuche verwenden auths.use_paged_search=Seitensuche verwenden
auths.search_page_size=Seitengröße auths.search_page_size=Seitengröße
@ -1472,9 +1474,7 @@ config.db_host=Host
config.db_name=Name config.db_name=Name
config.db_user=Benutzername config.db_user=Benutzername
config.db_ssl_mode=SSL config.db_ssl_mode=SSL
config.db_ssl_mode_helper=(nur für "postgres")
config.db_path=Verzeichnis config.db_path=Verzeichnis
config.db_path_helper=(für "sqlite3" und "tidb")
config.service_config=Service-Konfiguration config.service_config=Service-Konfiguration
config.register_email_confirm=E-Mail-Bestätigung benötigt zum Registrieren config.register_email_confirm=E-Mail-Bestätigung benötigt zum Registrieren

View File

@ -213,7 +213,7 @@ send_reset_mail = Click here to resend your password reset email
reset_password = Reset Your Password reset_password = Reset Your Password
invalid_code = Your confirmation code is invalid or has expired. invalid_code = Your confirmation code is invalid or has expired.
reset_password_helper = Click here to reset your password reset_password_helper = Click here to reset your password
password_too_short = Password length cannot be less then %d. password_too_short = Password length cannot be less than %d characters.
non_local_account = Non-local users can not update their password through the Gitea web interface. non_local_account = Non-local users can not update their password through the Gitea web interface.
verify = Verify verify = Verify
scratch_code = Scratch code scratch_code = Scratch code
@ -1475,9 +1475,7 @@ config.db_host = Host
config.db_name = Name config.db_name = Name
config.db_user = Username config.db_user = Username
config.db_ssl_mode = SSL config.db_ssl_mode = SSL
config.db_ssl_mode_helper = (for "postgres" only)
config.db_path = Path config.db_path = Path
config.db_path_helper = (for "sqlite3" and "tidb")
config.service_config = Service Configuration config.service_config = Service Configuration
config.register_email_confirm = Require Email Confirmation to Register config.register_email_confirm = Require Email Confirmation to Register

View File

@ -96,7 +96,6 @@ email_not_associate=Esta dirección de correo electrónico no esta asociada a ni
send_reset_mail=Haz clic aquí para reenviar tu email de restauración de contraseña send_reset_mail=Haz clic aquí para reenviar tu email de restauración de contraseña
reset_password=Restablecer su contraseña reset_password=Restablecer su contraseña
reset_password_helper=Haga Clic aquí para restablecer su contraseña reset_password_helper=Haga Clic aquí para restablecer su contraseña
password_too_short=La longitud de la contraseña no puede ser menor a %d.
verify=Verificar verify=Verificar
twofa_scratch_used=Ya has utilizado el código. Has sido redirigido a la página de configuración de dos factores poder remover la inscripción del dispositivo o generar un nuevo código. twofa_scratch_used=Ya has utilizado el código. Has sido redirigido a la página de configuración de dos factores poder remover la inscripción del dispositivo o generar un nuevo código.
twofa_scratch_token_incorrect=El código cero es incorrecto. twofa_scratch_token_incorrect=El código cero es incorrecto.
@ -741,9 +740,7 @@ config.ssh_minimum_key_sizes=Tamaños de clave mínimos
config.db_config=Configuración de la Base de Datos config.db_config=Configuración de la Base de Datos
config.db_type=Tipo config.db_type=Tipo
config.db_name=Nombre config.db_name=Nombre
config.db_ssl_mode_helper=(sólo para "postgres")
config.db_path=Ruta config.db_path=Ruta
config.db_path_helper=(para "sqlite3" y "tidb")
config.service_config=Configuración del servicio config.service_config=Configuración del servicio
config.show_registration_button=Mostrar Botón de Registro config.show_registration_button=Mostrar Botón de Registro

View File

@ -82,7 +82,6 @@ has_unconfirmed_mail=Hei %s, sinulla on varmistamaton sähköposti osoite (<b>%s
resend_mail=Klikkaa tästä uudelleenlähettääksesi aktivointi sähköpostisi resend_mail=Klikkaa tästä uudelleenlähettääksesi aktivointi sähköpostisi
reset_password=Nollaa salasanasi reset_password=Nollaa salasanasi
reset_password_helper=Klikkaa tästä nollataksesi salasanasi reset_password_helper=Klikkaa tästä nollataksesi salasanasi
password_too_short=Salasanan pituus ei voi olla vähemmän kuin %d merkkiä.
verify=Vahvista verify=Vahvista
[mail] [mail]
@ -585,9 +584,7 @@ config.db_config=Tietokannan asetukset
config.db_type=Tyyppi config.db_type=Tyyppi
config.db_host=Isäntä config.db_host=Isäntä
config.db_name=Nimi config.db_name=Nimi
config.db_ssl_mode_helper=(vain "postgres")
config.db_path=Polku config.db_path=Polku
config.db_path_helper=("sqlite3" ja "tidb")
config.service_config=Palvelu asetukset config.service_config=Palvelu asetukset
config.show_registration_button=Näytä rekisteröidy painike config.show_registration_button=Näytä rekisteröidy painike

View File

@ -97,7 +97,6 @@ email_not_associate=L'adresse e-mail n'est associée à aucun compte.
send_reset_mail=Cliquez ici pour renvoyer le mail de réinitialisation de votre mot de passe send_reset_mail=Cliquez ici pour renvoyer le mail de réinitialisation de votre mot de passe
reset_password=Réinitialiser le mot de passe reset_password=Réinitialiser le mot de passe
reset_password_helper=Cliquez ici pour réinitialiser votre mot de passe reset_password_helper=Cliquez ici pour réinitialiser votre mot de passe
password_too_short=Le mot de passe doit contenir %d caractères minimum.
verify=Vérifier verify=Vérifier
scratch_code=Code de secours scratch_code=Code de secours
use_scratch_code=Utiliser un code de secours use_scratch_code=Utiliser un code de secours
@ -818,9 +817,7 @@ config.db_config=Configuration de la base de données
config.db_type=Type config.db_type=Type
config.db_host=Hôte config.db_host=Hôte
config.db_name=Nom config.db_name=Nom
config.db_ssl_mode_helper=("postgres" uniquement)
config.db_path=Emplacement config.db_path=Emplacement
config.db_path_helper=(pour « sqlite3 » et « TIDB »)
config.service_config=Configuration du service config.service_config=Configuration du service
config.show_registration_button=Afficher le bouton d'enregistrement config.show_registration_button=Afficher le bouton d'enregistrement

View File

@ -101,7 +101,6 @@ email_not_associate=Az email cím nincsen hozzárendelve egyetlen fiókhoz sem.
send_reset_mail=Kattints ide hogy újraküldd a jelszó visszaállító emailt send_reset_mail=Kattints ide hogy újraküldd a jelszó visszaállító emailt
reset_password=Jelszó visszaállítása reset_password=Jelszó visszaállítása
reset_password_helper=Kattintson ide, hogy visszaállítsa a jelszavát reset_password_helper=Kattintson ide, hogy visszaállítsa a jelszavát
password_too_short=A jelszó nem lehet rövidebb, mint %d karakter.
verify=Ellenőrzés verify=Ellenőrzés
scratch_code=Kaparós kód scratch_code=Kaparós kód
use_scratch_code=Kaparós kód használata use_scratch_code=Kaparós kód használata
@ -835,9 +834,7 @@ config.db_config=Adatbázis Konfiguráció
config.db_type=Típus config.db_type=Típus
config.db_host=Kiszolgáló config.db_host=Kiszolgáló
config.db_name=Név config.db_name=Név
config.db_ssl_mode_helper=(csak "postgres"-nek)
config.db_path=Elérési út config.db_path=Elérési út
config.db_path_helper=("sqlite3" és "tidb"-nek)
config.service_config=Szolgáltatás konfiguráció config.service_config=Szolgáltatás konfiguráció
config.show_registration_button=Regisztráció gomb megjelenítése config.show_registration_button=Regisztráció gomb megjelenítése

View File

@ -97,7 +97,6 @@ email_not_associate=Alamat surel tidak terhubung dengan akun apapun.
send_reset_mail=Klik di sini untuk mengirim ulang surel pengaturan ulang kata sandi send_reset_mail=Klik di sini untuk mengirim ulang surel pengaturan ulang kata sandi
reset_password=Atur Ulang Kata Sandi Anda reset_password=Atur Ulang Kata Sandi Anda
reset_password_helper=Klik di sini untuk mengatur ulang kata sandi anda reset_password_helper=Klik di sini untuk mengatur ulang kata sandi anda
password_too_short=Panjang kata sandi tidak boleh kurang dari %d.
verify=Verifikasi verify=Verifikasi
scratch_code=Kode coretan scratch_code=Kode coretan
use_scratch_code=Gunakan kode coretan use_scratch_code=Gunakan kode coretan
@ -807,9 +806,7 @@ config.ssh_minimum_key_sizes=Ukuran kunci minimum
config.db_config=Konfigurasi basis data config.db_config=Konfigurasi basis data
config.db_name=Nama config.db_name=Nama
config.db_ssl_mode_helper=(untuk "postgres" saja)
config.db_path=Jalur config.db_path=Jalur
config.db_path_helper=(untuk "sqlite3 dan "tidb")
config.service_config=Konfigurasi layanan config.service_config=Konfigurasi layanan
config.show_registration_button=Tampilkan tombol mendaftar config.show_registration_button=Tampilkan tombol mendaftar

View File

@ -97,7 +97,6 @@ email_not_associate=L'indirizzo email non è associato ad alcuna conta.
send_reset_mail=Clicca qui per inviare nuovamente la tua email di reimpostazione della password send_reset_mail=Clicca qui per inviare nuovamente la tua email di reimpostazione della password
reset_password=Reimposta la tua Password reset_password=Reimposta la tua Password
reset_password_helper=Clicca qui per reimpostare la password reset_password_helper=Clicca qui per reimpostare la password
password_too_short=La lunghezza della password non può essere meno %d caratteri.
verify=Verifica verify=Verifica
scratch_code=Codice Gratta e Vinci scratch_code=Codice Gratta e Vinci
use_scratch_code=Utilizza un codice di zero use_scratch_code=Utilizza un codice di zero
@ -638,9 +637,7 @@ config.ssh_minimum_key_sizes=Dimensioni minime della chiave
config.db_config=Configurazione Database config.db_config=Configurazione Database
config.db_type=Tipo config.db_type=Tipo
config.db_name=Nome config.db_name=Nome
config.db_ssl_mode_helper=(solo per "postgres")
config.db_path=Percorso config.db_path=Percorso
config.db_path_helper=(per "sqlite3" e "tidb")
config.service_config=Configurazione Servizio config.service_config=Configurazione Servizio
config.show_registration_button=Mostra Pulsane Registrazione config.show_registration_button=Mostra Pulsane Registrazione

View File

@ -101,7 +101,6 @@ email_not_associate=このEメールアドレスは、どのアカウントに
send_reset_mail=パスワードリセットメールを再送するにはここをクリックしてください send_reset_mail=パスワードリセットメールを再送するにはここをクリックしてください
reset_password=パスワードリセット reset_password=パスワードリセット
reset_password_helper=パスワードをリセットするにはここをクリック reset_password_helper=パスワードをリセットするにはここをクリック
password_too_short=%d文字未満のパスワードは設定できません。
verify=確認 verify=確認
scratch_code=スクラッチコード scratch_code=スクラッチコード
use_scratch_code=スクラッチコードを使う use_scratch_code=スクラッチコードを使う
@ -833,9 +832,7 @@ config.db_config=データベースの構成
config.db_type=タイプ config.db_type=タイプ
config.db_host=ホスト config.db_host=ホスト
config.db_name=名前 config.db_name=名前
config.db_ssl_mode_helper=(「postgres」のみ
config.db_path=パス config.db_path=パス
config.db_path_helper=("sqlite3"および"tidb"のみ)
config.service_config=サービスの構成 config.service_config=サービスの構成
config.show_registration_button=登録ボタンを表示します。 config.show_registration_button=登録ボタンを表示します。

View File

@ -97,7 +97,6 @@ email_not_associate=이 이메일 주소로 등록된 계정이 없습니다.
send_reset_mail=여기를 눌러 비밀번호 초기화 메일을 재전송 send_reset_mail=여기를 눌러 비밀번호 초기화 메일을 재전송
reset_password=비밀번호 초기화 reset_password=비밀번호 초기화
reset_password_helper=이곳을 눌러 비밀번호를 재설정 reset_password_helper=이곳을 눌러 비밀번호를 재설정
password_too_short=비밀번호의 길이는 %d글자 미만일 수 없습니다.
verify=확인 verify=확인
scratch_code=스크래치 코드 scratch_code=스크래치 코드
use_scratch_code=스크래치 코드 사용 use_scratch_code=스크래치 코드 사용
@ -687,9 +686,7 @@ config.db_config=데이터베이스 설정
config.db_type=유형 config.db_type=유형
config.db_host=호스트 config.db_host=호스트
config.db_name=이름 config.db_name=이름
config.db_ssl_mode_helper=("postgres" 전용)
config.db_path=경로 config.db_path=경로
config.db_path_helper=("sqlite3" 및 "tidb"만)
config.service_config=서비스 설정 config.service_config=서비스 설정
config.show_registration_button=등록 버튼을 표시 config.show_registration_button=등록 버튼을 표시

View File

@ -75,7 +75,6 @@ active_your_account=Aktyvinkite savo paskyrą
resend_mail=Spauskite čia norėdami persiųsti aktyvacijos laišką resend_mail=Spauskite čia norėdami persiųsti aktyvacijos laišką
reset_password=Atstatyti slaptažodį reset_password=Atstatyti slaptažodį
reset_password_helper=Paspauskite čia norėdami pakeisti savo slaptažodį reset_password_helper=Paspauskite čia norėdami pakeisti savo slaptažodį
password_too_short=Slaptažodis negali būti trumpesnis nei %d simbolių.
verify=Patikrinti verify=Patikrinti
[mail] [mail]

View File

@ -101,7 +101,6 @@ email_not_associate=Šī e-pasta adrese nav saistīta ar nevienu kontu.
send_reset_mail=Spiediet šeit, lai nosūtītu paroles maiņas vēstuli uz Jūsu e-pastu send_reset_mail=Spiediet šeit, lai nosūtītu paroles maiņas vēstuli uz Jūsu e-pastu
reset_password=Atjaunot savu paroli reset_password=Atjaunot savu paroli
reset_password_helper=Nospiediet šeit, lai atjaunotu paroli reset_password_helper=Nospiediet šeit, lai atjaunotu paroli
password_too_short=Paroles garums nedrīkst būt mazāks par %d.
verify=Pārbaudīt verify=Pārbaudīt
scratch_code=Vienreizējais kods scratch_code=Vienreizējais kods
use_scratch_code=Izmantot vienreizējo kodu use_scratch_code=Izmantot vienreizējo kodu
@ -833,9 +832,7 @@ config.db_config=Datu bāzes konfigurācija
config.db_type=Veids config.db_type=Veids
config.db_host=Resursdators config.db_host=Resursdators
config.db_name=Nosaukums config.db_name=Nosaukums
config.db_ssl_mode_helper=(tikai PostgreSQL datu bāzei)
config.db_path=Ceļš config.db_path=Ceļš
config.db_path_helper=(priekš "sqlite3" and "tidb")
config.service_config=Pakalpojuma konfigurācija config.service_config=Pakalpojuma konfigurācija
config.show_registration_button=Rādīt reģistrēšanās pogu config.show_registration_button=Rādīt reģistrēšanās pogu

View File

@ -101,7 +101,6 @@ email_not_associate=Dit emailadres is niet gekoppeld aan een account.
send_reset_mail=Klik hier om de wachtwoord reset mail (nogmaals) te versturen send_reset_mail=Klik hier om de wachtwoord reset mail (nogmaals) te versturen
reset_password=Reset uw wachtwoord reset_password=Reset uw wachtwoord
reset_password_helper=Klik hier om uw wachtwoord opnieuw in te stellen. reset_password_helper=Klik hier om uw wachtwoord opnieuw in te stellen.
password_too_short=De lengte van uw wachtwoord moet minimaal %d karakters zijn.
verify=Verifiëren verify=Verifiëren
scratch_code=Eenmalige code scratch_code=Eenmalige code
use_scratch_code=Gebruik een eenmalige code use_scratch_code=Gebruik een eenmalige code
@ -784,9 +783,7 @@ config.db_config=Databaseconfiguratie
config.db_type=Type config.db_type=Type
config.db_host=Host config.db_host=Host
config.db_name=Naam config.db_name=Naam
config.db_ssl_mode_helper=(alleen voor "postgres")
config.db_path=Pad config.db_path=Pad
config.db_path_helper=(voor "sqlite3" en "tidb")
config.service_config=Serviceconfiguratie config.service_config=Serviceconfiguratie
config.show_registration_button=Registeren knop weergeven config.show_registration_button=Registeren knop weergeven

View File

@ -97,7 +97,6 @@ email_not_associate=Adres e-mail nie jest powiązany z żadnym kontem.
send_reset_mail=Kliknij tutaj, aby ponownie wysłać e-mail resetowania hasła send_reset_mail=Kliknij tutaj, aby ponownie wysłać e-mail resetowania hasła
reset_password=Resetowanie hasła reset_password=Resetowanie hasła
reset_password_helper=Kliknij tutaj, aby zresetować hasło reset_password_helper=Kliknij tutaj, aby zresetować hasło
password_too_short=Długość hasła nie może być mniejsza niż %d znaków.
verify=Potwierdź verify=Potwierdź
scratch_code=Kod jednorazowy scratch_code=Kod jednorazowy
use_scratch_code=Użyj kodu jednorazowego use_scratch_code=Użyj kodu jednorazowego
@ -816,9 +815,7 @@ config.db_config=Konfiguracja bazy danych
config.db_type=Typ config.db_type=Typ
config.db_host=Serwer config.db_host=Serwer
config.db_name=Nazwa config.db_name=Nazwa
config.db_ssl_mode_helper=(tylko dla „postgres”)
config.db_path=Ścieżka config.db_path=Ścieżka
config.db_path_helper=(dla „sqlite3” i „tidb”)
config.service_config=Konfiguracja usługi config.service_config=Konfiguracja usługi
config.show_registration_button=Pokazuj przycisk rejestracji config.show_registration_button=Pokazuj przycisk rejestracji

View File

@ -213,7 +213,7 @@ send_reset_mail=Clique aqui para re-enviar seu e-mail de redefinição de senha
reset_password=Redefinir sua senha reset_password=Redefinir sua senha
invalid_code=Seu código de confirmação é inválido ou expirou. invalid_code=Seu código de confirmação é inválido ou expirou.
reset_password_helper=Clique aqui para redefinir sua senha reset_password_helper=Clique aqui para redefinir sua senha
password_too_short=O comprimento da senha não pode ser menor que %d. password_too_short=A senha deve ter %d ou mais caracteres.
non_local_account=Usuários não-locais não podem atualizar sua senha através da interface web do Gitea. non_local_account=Usuários não-locais não podem atualizar sua senha através da interface web do Gitea.
verify=Verificar verify=Verificar
scratch_code=Código de backup scratch_code=Código de backup
@ -1475,9 +1475,7 @@ config.db_host=Servidor
config.db_name=Nome config.db_name=Nome
config.db_user=Nome de usuário config.db_user=Nome de usuário
config.db_ssl_mode=SSL config.db_ssl_mode=SSL
config.db_ssl_mode_helper=(apenas para "postgres")
config.db_path=Caminho config.db_path=Caminho
config.db_path_helper=(para "sqlite3" e "tidb")
config.service_config=Configuração do serviço config.service_config=Configuração do serviço
config.register_email_confirm=Exigir confirmação de e-mail para se cadastrar config.register_email_confirm=Exigir confirmação de e-mail para se cadastrar

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,6 @@ has_unconfirmed_mail=Здраво, %s! Имате непотврђену адр
resend_mail=Кликните овде да поново пошаљете писмо resend_mail=Кликните овде да поново пошаљете писмо
reset_password=Ресет лозинке reset_password=Ресет лозинке
reset_password_helper=Кликните овде да ресетујете вашу лозинку reset_password_helper=Кликните овде да ресетујете вашу лозинку
password_too_short=Лозинка неможе бити краћа од %d карактера.
[mail] [mail]
activate_account=Молимо вас активирајте ваш налог activate_account=Молимо вас активирајте ваш налог
@ -601,9 +600,7 @@ config.db_config=Конфигурација базе података
config.db_type=Тип config.db_type=Тип
config.db_host=Хост config.db_host=Хост
config.db_name=Име config.db_name=Име
config.db_ssl_mode_helper=(само за postgres)
config.db_path=Пут config.db_path=Пут
config.db_path_helper=(за "sqlite3" и "tidb")
config.service_config=Подешавања сервиса config.service_config=Подешавања сервиса
config.show_registration_button=Прикажи дугме за регистрацију config.show_registration_button=Прикажи дугме за регистрацију

View File

@ -97,7 +97,6 @@ email_not_associate=Denna e-postadress är inte knutet till något konto.
send_reset_mail=Klicka här för att skicka e-post med lösenordsåterställning igen send_reset_mail=Klicka här för att skicka e-post med lösenordsåterställning igen
reset_password=Återställ ditt lösenord reset_password=Återställ ditt lösenord
reset_password_helper=Klicka här för att återställa ditt lösenord reset_password_helper=Klicka här för att återställa ditt lösenord
password_too_short=Lösenordet får ej vara kortare än %d tecken.
verify=Verifiera verify=Verifiera
scratch_code=Skrapkod scratch_code=Skrapkod
use_scratch_code=Använd en skrapkod use_scratch_code=Använd en skrapkod
@ -738,9 +737,7 @@ config.db_config=Databaskonfiguration
config.db_type=Typ config.db_type=Typ
config.db_host=Värd config.db_host=Värd
config.db_name=Namn config.db_name=Namn
config.db_ssl_mode_helper=(endast för "postgres")
config.db_path=Sökväg config.db_path=Sökväg
config.db_path_helper=(för "sqlite3" och "tidb")
config.service_config=Tjänstkonfiguration config.service_config=Tjänstkonfiguration
config.show_registration_button=Visa registreringsknapp config.show_registration_button=Visa registreringsknapp

View File

@ -97,7 +97,6 @@ email_not_associate=Bu e-posta adresi hiçbir hesap ile ilişkilendirilmemiştir
send_reset_mail=Parola sıfırlama e-postasını (yeniden) göndermek için buraya tıklayın send_reset_mail=Parola sıfırlama e-postasını (yeniden) göndermek için buraya tıklayın
reset_password=Parolanızı Sıfırlayın reset_password=Parolanızı Sıfırlayın
reset_password_helper=Parolanızı sıfırlamak için buraya tıklayın reset_password_helper=Parolanızı sıfırlamak için buraya tıklayın
password_too_short=Parola uzunluğu %d karakterden az olamaz.
verify=Doğrula verify=Doğrula
scratch_code=Çizgi kodu scratch_code=Çizgi kodu
use_scratch_code=Bir çizgi kodu kullanınız use_scratch_code=Bir çizgi kodu kullanınız
@ -802,9 +801,7 @@ config.db_config=Veritabanı Yapılandırması
config.db_type=Türü config.db_type=Türü
config.db_host=Sunucu config.db_host=Sunucu
config.db_name=İsim config.db_name=İsim
config.db_ssl_mode_helper=(sadece "postgres" için)
config.db_path=Yol config.db_path=Yol
config.db_path_helper=("sqlite3" ve "tidb" için)
config.service_config=Servis Yapılandırması config.service_config=Servis Yapılandırması
config.show_registration_button=Kaydolma Tuşunu Göster config.show_registration_button=Kaydolma Tuşunu Göster

View File

@ -31,6 +31,14 @@ twofa=Двофакторна авторизація
twofa_scratch=Двофакторний одноразовий пароль twofa_scratch=Двофакторний одноразовий пароль
passcode=Код доступу passcode=Код доступу
u2f_insert_key=Вставте ключ безпеки
u2f_sign_in=Натисніть кнопку на ключі безпеки. Якщо не вдається знайти кнопки, повторно вставте ключ.
u2f_press_button=Будь ласка, натисніть кнопку на ключі захисту...
u2f_use_twofa=Використовуйте дво-факторний код з вашого телефону
u2f_error=Неможливо прочитати ваш ключ безпеки!
u2f_unsupported_browser=Ваш браузер не підтримує U2F ключі. Будь ласка, спробуйте інший браузер.
u2f_error_1=Сталася невідома помилка. Спробуйте ще раз.
u2f_error_3=Сервер не може обробити, ваш запит.
u2f_reload=Оновити u2f_reload=Оновити
repository=Репозиторій repository=Репозиторій
@ -131,6 +139,7 @@ confirm_password=Підтвердження пароля
admin_email=Адреса електронної пошти admin_email=Адреса електронної пошти
install_btn_confirm=Встановлення Gitea install_btn_confirm=Встановлення Gitea
test_git_failed=Не в змозі перевірити 'git' команду: %v test_git_failed=Не в змозі перевірити 'git' команду: %v
invalid_db_setting=Налаштування бази даних є некоректними: %v
save_config_failed=Не в змозі зберегти конфігурацію: %v save_config_failed=Не в змозі зберегти конфігурацію: %v
invalid_admin_setting=Неприпустимі налаштування облікового запису адміністратора: %v invalid_admin_setting=Неприпустимі налаштування облікового запису адміністратора: %v
install_success=Ласкаво просимо! Дякуємо вам за вибір Gitea. Розважайтеся, і будьте обережні! install_success=Ласкаво просимо! Дякуємо вам за вибір Gitea. Розважайтеся, і будьте обережні!
@ -190,7 +199,6 @@ send_reset_mail=Натисніть сюди, щоб відправити лис
reset_password=Скинути пароль reset_password=Скинути пароль
invalid_code=Цей код підтвердження недійсний або закінчився. invalid_code=Цей код підтвердження недійсний або закінчився.
reset_password_helper=Натисніть тут для скидання пароля reset_password_helper=Натисніть тут для скидання пароля
password_too_short=Довжина пароля не може бути меншою за %d.
non_local_account=Нелокальні акаунти не можуть змінити пароль через Gitea. non_local_account=Нелокальні акаунти не можуть змінити пароль через Gitea.
verify=Підтвердити verify=Підтвердити
scratch_code=Одноразовий пароль scratch_code=Одноразовий пароль
@ -256,8 +264,14 @@ team_name_been_taken=Назва команди вже зайнято.
email_been_used=Ця електронна адреса вже використовується. email_been_used=Ця електронна адреса вже використовується.
openid_been_used=OpenID адреса '%s' вже використовується. openid_been_used=OpenID адреса '%s' вже використовується.
username_password_incorrect=Неправильне ім'я користувача або пароль. username_password_incorrect=Неправильне ім'я користувача або пароль.
enterred_invalid_repo_name=Невірно введено ім'я репозиторію.
enterred_invalid_owner_name=Ім'я нового власника не є дійсним.
enterred_invalid_password=Введений вами пароль некоректний.
user_not_exist=Даний користувач не існує. user_not_exist=Даний користувач не існує.
cannot_add_org_to_team=Організацію неможливо додати як учасника команди.
invalid_ssh_key=Неможливо перевірити ваш SSH ключ: %s
invalid_gpg_key=Неможливо перевірити ваш GPG ключ: %s
auth_failed=Помилка автентифікації: %v auth_failed=Помилка автентифікації: %v
@ -292,6 +306,7 @@ twofa=Двофакторна авторизація
account_link=Прив'язані облікові записи account_link=Прив'язані облікові записи
organization=Організації organization=Організації
uid=Ідентифікатор Uid uid=Ідентифікатор Uid
u2f=Ключі безпеки
public_profile=Загальнодоступний профіль public_profile=Загальнодоступний профіль
profile_desc=Ваша адреса електронної пошти використовуватиметься для сповіщення та інших операцій. profile_desc=Ваша адреса електронної пошти використовуватиметься для сповіщення та інших операцій.
@ -305,6 +320,7 @@ continue=Продовжити
cancel=Відміна cancel=Відміна
language=Мова language=Мова
lookup_avatar_by_mail=Знайти Аватар за адресою електронної пошти
federated_avatar_lookup=Знайти зовнішній аватар federated_avatar_lookup=Знайти зовнішній аватар
enable_custom_avatar=Увімкнути користувацькі аватари enable_custom_avatar=Увімкнути користувацькі аватари
choose_new_avatar=Оберіть новий аватар choose_new_avatar=Оберіть новий аватар
@ -328,9 +344,13 @@ primary=Основний
primary_email=Зробити основним primary_email=Зробити основним
delete_email=Видалити delete_email=Видалити
email_deletion=Видалити адресу електронної пошти email_deletion=Видалити адресу електронної пошти
openid_deletion=Видалити адресу OpenID
add_new_email=Додати нову адресу електронної пошти add_new_email=Додати нову адресу електронної пошти
add_new_openid=Додати новий OpenID URI
add_email=Додати адресу електронної пошти add_email=Додати адресу електронної пошти
add_openid=Додати OpenID URI
add_email_confirmation_sent=Електронний лист із підтвердженням було відправлено на '%s', будь ласка, перевірте вашу поштову скриньку протягом наступних %s, щоб підтвердити адресу. add_email_confirmation_sent=Електронний лист із підтвердженням було відправлено на '%s', будь ласка, перевірте вашу поштову скриньку протягом наступних %s, щоб підтвердити адресу.
add_email_success=Додано нову адресу електронної пошти.
keep_email_private=Приховати адресу електронної пошти keep_email_private=Приховати адресу електронної пошти
keep_email_private_popup=Вашу адресу електронної пошти буде приховано від інших користувачів. keep_email_private_popup=Вашу адресу електронної пошти буде приховано від інших користувачів.
@ -345,6 +365,8 @@ subkeys=Підключі
key_id=ID ключа key_id=ID ключа
key_name=Ім'я ключа key_name=Ім'я ключа
key_content=Зміст key_content=Зміст
add_key_success=SSH ключ '%s' додано.
add_gpg_key_success=GPG ключ '%s' додано.
delete_key=Видалити delete_key=Видалити
ssh_key_deletion=Видалити SSH ключ ssh_key_deletion=Видалити SSH ключ
gpg_key_deletion=Видалити GPG ключ gpg_key_deletion=Видалити GPG ключ
@ -378,15 +400,20 @@ access_token_deletion=Видалити токен доступу
twofa_disable=Вимкнути двофакторну автентифікацію twofa_disable=Вимкнути двофакторну автентифікацію
or_enter_secret=Або введіть секрет: %s or_enter_secret=Або введіть секрет: %s
passcode_invalid=Некоректний пароль. Спробуй ще раз.
u2f_register_key=Додати ключ безпеки
u2f_nickname=Псевдонім u2f_nickname=Псевдонім
u2f_delete_key=Видалити ключ безпеки
manage_account_links=Керування обліковими записами manage_account_links=Керування обліковими записами
remove_account_link=Видалити облікові записи remove_account_link=Видалити облікові записи
orgs_none=Ви не є учасником будь-якої організації. orgs_none=Ви не є учасником будь-якої організації.
repos_none=У вас немає власних репозиторіїв
delete_account=Видалити ваш обліковий запис delete_account=Видалити ваш обліковий запис
delete_prompt=Ця операція остаточно видалить обліковий запис користувача. Це <strong>НЕ МОЖЛИВО</strong> відмінити.
confirm_delete_account=Підтвердження видалення confirm_delete_account=Підтвердження видалення
delete_account_title=Видалити цей обліковий запис delete_account_title=Видалити цей обліковий запис
@ -410,6 +437,7 @@ create_repo=Створити репозиторій
default_branch=Головна гілка default_branch=Головна гілка
mirror_prune=Очистити mirror_prune=Очистити
mirror_interval=Інтервал дзеркалювання (доступні значення 'h', 'm', 's') mirror_interval=Інтервал дзеркалювання (доступні значення 'h', 'm', 's')
mirror_interval_invalid=Інтервал дзеркалювання є неприпустимим.
mirror_address=Клонування з URL-адреси mirror_address=Клонування з URL-адреси
mirror_last_synced=Остання синхронізація mirror_last_synced=Остання синхронізація
watchers=Спостерігачі watchers=Спостерігачі
@ -419,11 +447,12 @@ pick_reaction=Залиште свою оцінку
reactions_more=додати %d більше reactions_more=додати %d більше
form.reach_limit_of_creation=Ви досягли максимальної кількості %d створених репозиторіїв. form.reach_limit_of_creation=Ви досягли максимальної кількості %d створених репозиторіїв.
form.name_reserved=Назву репозиторію '%s' зарезервовано.
need_auth=Клонувати з авторизацією need_auth=Клонувати з авторизацією
migrate_type=Тип міграції migrate_type=Тип міграції
migrate_type_helper=Даний репозиторій буде <span class="text blue">дзеркалом</span> migrate_type_helper=Даний репозиторій буде <span class="text blue">дзеркалом</span>
migrate_repo=Перенесення репозиторія migrate_repo=Перенести репозиторій
migrate.clone_address=Міграція / клонувати з URL-адреси migrate.clone_address=Міграція / клонувати з URL-адреси
migrate.clone_address_desc=URL-адреса HTTP(S) або Git "clone" існуючого репозиторія migrate.clone_address_desc=URL-адреса HTTP(S) або Git "clone" існуючого репозиторія
migrate.clone_local_path=або шлях до локального серверу migrate.clone_local_path=або шлях до локального серверу
@ -435,6 +464,7 @@ mirror_from=дзеркало
forked_from=форк від forked_from=форк від
fork_from_self=Ви не можете форкнути репозиторій, так як ви його власник. fork_from_self=Ви не можете форкнути репозиторій, так як ви його власник.
copy_link=Копіювати copy_link=Копіювати
copy_link_success=Посилання було скопійоване
copy_link_error=Натисніть ⌘-C або Ctrl-C, щоб скопіювати copy_link_error=Натисніть ⌘-C або Ctrl-C, щоб скопіювати
copied=Скопійовано copied=Скопійовано
unwatch=Не стежити unwatch=Не стежити
@ -462,12 +492,14 @@ pulls=Запити на злиття
labels=Мітки labels=Мітки
milestones=Етап milestones=Етап
commits=Коміти commits=Коміти
commit=Змина commit=Коміт
releases=Релізи releases=Релізи
file_raw=Неформатований file_raw=Неформатований
file_history=Історія file_history=Історія
file_view_raw=Перегляд Raw file_view_raw=Перегляд Raw
file_permalink=Постійне посилання file_permalink=Постійне посилання
file_too_large=Цей файл завеликий щоб бути показаним.
video_not_supported_in_browser=Ваш браузер не підтримує тег 'video' HTML5.
stored_lfs=Збережено з Git LFS stored_lfs=Збережено з Git LFS
commit_graph=Графік комітів commit_graph=Графік комітів
@ -475,11 +507,13 @@ editor.new_file=Новий файл
editor.upload_file=Завантажити файл editor.upload_file=Завантажити файл
editor.edit_file=Редагування файлу editor.edit_file=Редагування файлу
editor.preview_changes=Попередній перегляд змін editor.preview_changes=Попередній перегляд змін
editor.cannot_edit_non_text_files=Бінарні файли не можливо редагувати у веб-інтерфейсі.
editor.edit_this_file=Редагувати файл editor.edit_this_file=Редагувати файл
editor.must_be_on_a_branch=Ви повинні бути у гілці щоб зробити, або запропонувати зміни до цього файлу. editor.must_be_on_a_branch=Ви повинні бути у гілці щоб зробити, або запропонувати зміни до цього файлу.
editor.fork_before_edit=Необхідно зробити форк цього репозиторій, щоб внести або запропонувати зміни в цей файл. editor.fork_before_edit=Необхідно зробити форк цього репозиторій, щоб внести або запропонувати зміни в цей файл.
editor.delete_this_file=Видалити файл editor.delete_this_file=Видалити файл
editor.must_have_write_access=Ви повинні мати доступ на запис щоб запропонувати зміни до цього файлу. editor.must_have_write_access=Ви повинні мати доступ на запис щоб запропонувати зміни до цього файлу.
editor.file_delete_success=Файл '%s' видалено.
editor.name_your_file=Дайте назву файлу… editor.name_your_file=Дайте назву файлу…
editor.or=або editor.or=або
editor.cancel_lower=Скасувати editor.cancel_lower=Скасувати
@ -493,7 +527,10 @@ editor.commit_directly_to_this_branch=Зробіть коміт прямо в г
editor.create_new_branch=Створити <strong>нову гілку</strong> для цього коміту та відкрити запит на злиття. editor.create_new_branch=Створити <strong>нову гілку</strong> для цього коміту та відкрити запит на злиття.
editor.new_branch_name_desc=Ім'я нової гілки… editor.new_branch_name_desc=Ім'я нової гілки…
editor.cancel=Відміна editor.cancel=Відміна
editor.filename_cannot_be_empty=Ім'я файлу не може бути порожнім.
editor.branch_already_exists=Гілка '%s' вже присутня в репозиторії. editor.branch_already_exists=Гілка '%s' вже присутня в репозиторії.
editor.directory_is_a_file=Ім'я каталогу "%s" уже використовується як ім'я файлу в цьому репозиторії.
editor.file_already_exists=Файл з назвою "%s" уже існує у цьому репозиторію.
editor.no_changes_to_show=Нема змін для показу. editor.no_changes_to_show=Нема змін для показу.
editor.fail_to_update_file=Не вдалося оновити/створити файл '%s' через помилку: %v editor.fail_to_update_file=Не вдалося оновити/створити файл '%s' через помилку: %v
editor.add_subdir=Додати каталог… editor.add_subdir=Додати каталог…
@ -509,6 +546,7 @@ commits.message=Повідомлення
commits.date=Дата commits.date=Дата
commits.older=Давніше commits.older=Давніше
commits.newer=Новіше commits.newer=Новіше
commits.signed_by=Підписано
ext_issues=Зов. Проблеми ext_issues=Зов. Проблеми
@ -559,6 +597,7 @@ issues.filter_sort.recentupdate=Нещодавно оновлено
issues.filter_sort.leastupdate=Найдавніше оновлені issues.filter_sort.leastupdate=Найдавніше оновлені
issues.filter_sort.mostcomment=Найбільш коментовані issues.filter_sort.mostcomment=Найбільш коментовані
issues.filter_sort.leastcomment=Найменш коментовані issues.filter_sort.leastcomment=Найменш коментовані
issues.filter_sort.mostforks=Найбільше форків
issues.action_open=Відкрити issues.action_open=Відкрити
issues.action_close=Закрити issues.action_close=Закрити
issues.action_label=Мітка issues.action_label=Мітка
@ -600,6 +639,7 @@ issues.label_edit=Редагувати
issues.label_delete=Видалити issues.label_delete=Видалити
issues.label_modify=Редагувати мітку issues.label_modify=Редагувати мітку
issues.label_deletion=Видалити мітку issues.label_deletion=Видалити мітку
issues.label_deletion_success=Мітку було видалено.
issues.label.filter_sort.alphabetically=За алфавітом issues.label.filter_sort.alphabetically=За алфавітом
issues.label.filter_sort.reverse_alphabetically=З кінця алфавіту issues.label.filter_sort.reverse_alphabetically=З кінця алфавіту
issues.label.filter_sort.by_size=Розмір issues.label.filter_sort.by_size=Розмір
@ -653,6 +693,8 @@ pulls.has_merged=Запит на злиття було об'єднано.
pulls.can_auto_merge_desc=Цей запит можна об'єднати автоматично. pulls.can_auto_merge_desc=Цей запит можна об'єднати автоматично.
pulls.cannot_auto_merge_desc=Цей запит на злиття не може бути злитий автоматично через конфлікти. pulls.cannot_auto_merge_desc=Цей запит на злиття не може бути злитий автоматично через конфлікти.
pulls.cannot_auto_merge_helper=Злийте вручну для вирішення конфліктів. pulls.cannot_auto_merge_helper=Злийте вручну для вирішення конфліктів.
pulls.no_merge_desc=Цей запити на злиття неможливо злити, оскільки всі параметри об'єднання репозиторія вимкнено.
pulls.no_merge_helper=Увімкніть параметри злиття в налаштуваннях репозиторія або злийте запити на злиття вручну.
pulls.merge_pull_request=Об'єднати запит на злиття pulls.merge_pull_request=Об'єднати запит на злиття
pulls.rebase_merge_pull_request=Зробити Rebase і злити pulls.rebase_merge_pull_request=Зробити Rebase і злити
pulls.squash_merge_pull_request=Об'єднати (Squash) і злити pulls.squash_merge_pull_request=Об'єднати (Squash) і злити
@ -755,6 +797,7 @@ settings.use_internal_wiki=Використовувати вбудовані В
settings.use_external_wiki=Використовувати зовнішні Вікі settings.use_external_wiki=Використовувати зовнішні Вікі
settings.external_wiki_url=URL зовнішньої вікі settings.external_wiki_url=URL зовнішньої вікі
settings.issues_desc=Увімкнути відстеження проблем в репозиторію settings.issues_desc=Увімкнути відстеження проблем в репозиторію
settings.use_internal_issue_tracker=Використовувати вбудовану систему відстеження проблем
settings.external_tracker_url=URL зовнішньої системи відстеження проблем settings.external_tracker_url=URL зовнішньої системи відстеження проблем
settings.tracker_url_format=Формат URL зовнішнього трекера задач settings.tracker_url_format=Формат URL зовнішнього трекера задач
settings.tracker_issue_style.numeric=Цифровий settings.tracker_issue_style.numeric=Цифровий
@ -783,6 +826,7 @@ settings.transfer_owner=Новий власник
settings.make_transfer=Здіснити перенесення settings.make_transfer=Здіснити перенесення
settings.confirm_delete=Видалити репозиторій settings.confirm_delete=Видалити репозиторій
settings.add_collaborator=Додати співавтора settings.add_collaborator=Додати співавтора
settings.add_collaborator_success=Додано співавтора.
settings.delete_collaborator=Видалити settings.delete_collaborator=Видалити
settings.collaborator_deletion=Видалити співавтора settings.collaborator_deletion=Видалити співавтора
settings.search_user_placeholder=Пошук користувача… settings.search_user_placeholder=Пошук користувача…
@ -844,6 +888,8 @@ settings.add_deploy_key=Додати ключ для розгортування
settings.is_writable=Увімкнути доступ для запису settings.is_writable=Увімкнути доступ для запису
settings.title=Заголовок settings.title=Заголовок
settings.deploy_key_content=Зміст settings.deploy_key_content=Зміст
settings.deploy_key_deletion=Видалити ключ для розгортування
settings.deploy_key_deletion_success=Ключі розгортання було видалено.
settings.branches=Гілки settings.branches=Гілки
settings.protected_branch=Захист гілки settings.protected_branch=Захист гілки
settings.protected_branch_can_push=Дозволити push? settings.protected_branch_can_push=Дозволити push?
@ -853,6 +899,7 @@ settings.protect_whitelist_search_users=Пошук користувачів…
settings.protect_whitelist_search_teams=Пошук команд… settings.protect_whitelist_search_teams=Пошук команд…
settings.add_protected_branch=Увімкнути захист settings.add_protected_branch=Увімкнути захист
settings.delete_protected_branch=Вимкнути захист settings.delete_protected_branch=Вимкнути захист
settings.protected_branch_deletion=Відключити захист гілки
settings.choose_branch=Оберіть гілку… settings.choose_branch=Оберіть гілку…
settings.no_protected_branch=Немає захищених гілок. settings.no_protected_branch=Немає захищених гілок.
@ -892,6 +939,8 @@ release.save_draft=Зберегти чернетку
release.edit_release=Оновити реліз release.edit_release=Оновити реліз
release.delete_release=Видалити реліз release.delete_release=Видалити реліз
release.deletion=Видалити реліз release.deletion=Видалити реліз
release.deletion_success=Реліз, було видалено.
release.tag_name_invalid=Неприпустиме ім'я тега.
release.downloads=Завантажити release.downloads=Завантажити
branch.name=Ім'я гілки branch.name=Ім'я гілки
@ -899,9 +948,13 @@ branch.search=Пошук гілок
branch.delete_head=Видалити branch.delete_head=Видалити
branch.delete=Видалити гілку '%s' branch.delete=Видалити гілку '%s'
branch.delete_html=Видалити гілку branch.delete_html=Видалити гілку
branch.deletion_success=Гілка '%s' видалена.
branch.deletion_failed=Не вдалося видалити гілку "%s".
branch.create_from=з '%s' branch.create_from=з '%s'
branch.create_success=Створено гілку "%s".
branch.branch_already_exists=Гілка '%s' вже присутня в репозиторії. branch.branch_already_exists=Гілка '%s' вже присутня в репозиторії.
branch.deleted_by=Видалено %s branch.deleted_by=Видалено %s
branch.restore_success=Гілку "%s" відновлено.
topic.manage_topics=Керувати тематичними мітками topic.manage_topics=Керувати тематичними мітками
topic.done=Готово topic.done=Готово
@ -921,9 +974,11 @@ org_desc=Опис
team_name=Назва команди team_name=Назва команди
team_desc=Опис team_desc=Опис
team_name_helper=Назва команди має бути простою та зрозумілою. team_name_helper=Назва команди має бути простою та зрозумілою.
team_desc_helper=Опишіть мету або роль команди.
team_permission_desc=Права доступу team_permission_desc=Права доступу
team_unit_desc=Дозволити доступ до розділів репозиторію team_unit_desc=Дозволити доступ до розділів репозиторію
form.name_reserved=Назву організації '%s' зарезервовано.
settings=Налаштування settings=Налаштування
settings.options=Організація settings.options=Організація
@ -931,6 +986,9 @@ settings.full_name=Повне ім'я
settings.website=Веб-сайт settings.website=Веб-сайт
settings.location=Розташування settings.location=Розташування
settings.update_settings=Оновити налаштування settings.update_settings=Оновити налаштування
settings.update_setting_success=Налаштування організації оновлені.
settings.change_orgname_prompt=Ця зміна змінить посилання на організацію.
settings.update_avatar_success=Аватар організації оновлений.
settings.delete=Видалити організацію settings.delete=Видалити організацію
settings.delete_account=Видалити цю організацію settings.delete_account=Видалити цю організацію
settings.confirm_delete_account=Підтвердіть видалення settings.confirm_delete_account=Підтвердіть видалення
@ -962,6 +1020,7 @@ teams.update_settings=Оновити налаштування
teams.delete_team=Видалити команду teams.delete_team=Видалити команду
teams.add_team_member=Додати учасника команди teams.add_team_member=Додати учасника команди
teams.delete_team_title=Видалити команду teams.delete_team_title=Видалити команду
teams.delete_team_success=Команду було видалено.
teams.read_permission_desc=Ця команда має доступ для <strong>читання</strong>: учасники можуть переглядати та клонувати репозиторії. teams.read_permission_desc=Ця команда має доступ для <strong>читання</strong>: учасники можуть переглядати та клонувати репозиторії.
teams.write_permission_desc=Ця команда надає доступ на <strong>запис</strong>: учасники можуть отримувати й виконувати push команди до репозитрію. teams.write_permission_desc=Ця команда надає доступ на <strong>запис</strong>: учасники можуть отримувати й виконувати push команди до репозитрію.
teams.admin_permission_desc=Ця команда надає <strong>адміністраторський</strong> доступ: учасники можуть читати, виконувати push команди та додавати співробітників до репозиторію. teams.admin_permission_desc=Ця команда надає <strong>адміністраторський</strong> доступ: учасники можуть читати, виконувати push команди та додавати співробітників до репозиторію.
@ -985,23 +1044,29 @@ last_page=Остання
total=Разом: %d total=Разом: %d
dashboard.statistic=Підсумок dashboard.statistic=Підсумок
dashboard.operations=Технічне обслуговування
dashboard.system_status=Статус системи dashboard.system_status=Статус системи
dashboard.operation_name=Назва операції dashboard.operation_name=Назва операції
dashboard.operation_switch=Перемкнути dashboard.operation_switch=Перемкнути
dashboard.operation_run=Запустити dashboard.operation_run=Запустити
dashboard.delete_inactivate_accounts=Видалити всі неактивні облікові записи dashboard.delete_inactivate_accounts=Видалити всі неактивні облікові записи
dashboard.delete_inactivate_accounts_success=Усі неактивні облікові записи успішно видалено. dashboard.delete_inactivate_accounts_success=Усі неактивні облікові записи успішно видалено.
dashboard.delete_repo_archives=Видалити всі архіви репозиторіїв
dashboard.git_gc_repos_success=Всі репозиторії завершили збирання сміття. dashboard.git_gc_repos_success=Всі репозиторії завершили збирання сміття.
dashboard.server_uptime=Uptime серверу dashboard.server_uptime=Uptime серверу
dashboard.current_goroutine=Поточна кількість Goroutines
dashboard.current_memory_usage=Поточне використання пам'яті dashboard.current_memory_usage=Поточне використання пам'яті
dashboard.total_memory_allocated=Виділено пам'яті загалом dashboard.total_memory_allocated=Виділено пам'яті загалом
dashboard.memory_obtained=Отримано пам'яті dashboard.memory_obtained=Отримано пам'яті
dashboard.pointer_lookup_times=Пошуків вказівника
dashboard.memory_allocate_times=Виділення пам'яті
dashboard.current_heap_usage=Поточне використання динамічної пам'яті dashboard.current_heap_usage=Поточне використання динамічної пам'яті
dashboard.heap_memory_obtained=Отримано динамічної пам'яті dashboard.heap_memory_obtained=Отримано динамічної пам'яті
dashboard.heap_memory_idle=Не використовується динамічною пам'яттю dashboard.heap_memory_idle=Не використовується динамічною пам'яттю
dashboard.heap_memory_in_use=Використовується динамічною пам'яттю dashboard.heap_memory_in_use=Використовується динамічною пам'яттю
dashboard.heap_memory_released=Звільнено динамічної пам'яті dashboard.heap_memory_released=Звільнено динамічної пам'яті
dashboard.heap_objects=Об'єктів динамічної пам'яті dashboard.heap_objects=Об'єктів динамічної пам'яті
dashboard.bootstrap_stack_usage=Використання стеку Bootstrap
dashboard.stack_memory_obtained=Зайнято пам'яті стеком dashboard.stack_memory_obtained=Зайнято пам'яті стеком
dashboard.mspan_structures_usage=Використання структур MSpan dashboard.mspan_structures_usage=Використання структур MSpan
dashboard.mspan_structures_obtained=Отримано структур MSpan dashboard.mspan_structures_obtained=Отримано структур MSpan
@ -1029,6 +1094,7 @@ users.send_register_notify=Надіслати повідомлення про р
users.edit=Редагувати users.edit=Редагувати
users.auth_source=Джерело автентифікації users.auth_source=Джерело автентифікації
users.local=Локальні users.local=Локальні
users.update_profile_success=Обліковий запис користувача було оновлено.
users.edit_account=Редагувати обліковий запис users.edit_account=Редагувати обліковий запис
users.max_repo_creation=Максимальна кількість репозиторіїв users.max_repo_creation=Максимальна кількість репозиторіїв
users.max_repo_creation_desc=(Введіть -1, щоб використовувати глобальний ліміт за замовчуванням.) users.max_repo_creation_desc=(Введіть -1, щоб використовувати глобальний ліміт за замовчуванням.)
@ -1040,6 +1106,7 @@ users.allow_import_local=Може імпортувати локальні реп
users.allow_create_organization=Може створювати організацій users.allow_create_organization=Може створювати організацій
users.update_profile=Оновити обліковий запис users.update_profile=Оновити обліковий запис
users.delete_account=Видалити цей обліковий запис users.delete_account=Видалити цей обліковий запис
users.deletion_success=Обліковий запис користувача було видалено.
orgs.org_manage_panel=Керування організаціями orgs.org_manage_panel=Керування організаціями
orgs.name=Назва orgs.name=Назва
@ -1047,7 +1114,7 @@ orgs.teams=Команди
orgs.members=Учасники orgs.members=Учасники
orgs.new_orga=Нова організація orgs.new_orga=Нова організація
repos.repo_manage_panel=Керування організаціями repos.repo_manage_panel=Керування репозиторіями
repos.owner=Власник repos.owner=Власник
repos.name=Назва repos.name=Назва
repos.private=Приватний repos.private=Приватний
@ -1062,6 +1129,7 @@ auths.new=Додати джерело автентифікації
auths.name=Ім'я auths.name=Ім'я
auths.type=Тип auths.type=Тип
auths.enabled=Увімкнено auths.enabled=Увімкнено
auths.syncenabled=Увімкнути синхронізацію користувача
auths.updated=Оновлено auths.updated=Оновлено
auths.auth_type=Тип автентифікації auths.auth_type=Тип автентифікації
auths.auth_name=Назва автентифікації auths.auth_name=Назва автентифікації
@ -1069,8 +1137,11 @@ auths.security_protocol=Протокол безпеки
auths.domain=Домен auths.domain=Домен
auths.host=Хост auths.host=Хост
auths.port=Порт auths.port=Порт
auths.bind_dn=Прив'язати DN
auths.bind_password=Прив'язати пароль
auths.user_base=База пошуку користувачів auths.user_base=База пошуку користувачів
auths.user_dn=DN користувача auths.user_dn=DN користувача
auths.attribute_username=Атрибут імені користувача
auths.search_page_size=Розмір сторінки auths.search_page_size=Розмір сторінки
auths.filter=Користувацький фільтр auths.filter=Користувацький фільтр
auths.admin_filter=Фільтр адміністратора auths.admin_filter=Фільтр адміністратора
@ -1082,6 +1153,7 @@ auths.enable_tls=Увімкнути TLS-шифрування
auths.skip_tls_verify=Пропустити перевірку TLS auths.skip_tls_verify=Пропустити перевірку TLS
auths.pam_service_name=Ім'я служби PAM auths.pam_service_name=Ім'я служби PAM
auths.oauth2_provider=Постачальник OAuth2 auths.oauth2_provider=Постачальник OAuth2
auths.oauth2_clientID=ID клієнта (ключ)
auths.oauth2_clientSecret=Ключ клієнта auths.oauth2_clientSecret=Ключ клієнта
auths.oauth2_tokenURL=URL токену auths.oauth2_tokenURL=URL токену
auths.oauth2_authURL=URL авторизації auths.oauth2_authURL=URL авторизації
@ -1121,6 +1193,7 @@ config.script_type=Тип скрипта
config.ssh_config=Конфігурація SSH config.ssh_config=Конфігурація SSH
config.ssh_enabled=Увімкнено config.ssh_enabled=Увімкнено
config.ssh_start_builtin_server=Використовувати вбудований сервер
config.ssh_domain=Домен сервера config.ssh_domain=Домен сервера
config.ssh_port=Порт config.ssh_port=Порт
config.ssh_listen_port=Порт що прослуховується config.ssh_listen_port=Порт що прослуховується
@ -1136,9 +1209,7 @@ config.db_host=Хост
config.db_name=Ім'я config.db_name=Ім'я
config.db_user=Ім'я кристувача config.db_user=Ім'я кристувача
config.db_ssl_mode=SSL config.db_ssl_mode=SSL
config.db_ssl_mode_helper=(тільки для "postgres")
config.db_path=Шлях config.db_path=Шлях
config.db_path_helper=(для "sqlite3" і "tidb")
config.service_config=Конфігурація сервісу config.service_config=Конфігурація сервісу
config.register_email_confirm=Потрібно підтвердити електронну пошту для реєстрації config.register_email_confirm=Потрібно підтвердити електронну пошту для реєстрації
@ -1189,6 +1260,7 @@ config.session_life_time=Час життя сесії
config.https_only=Тільки HTTPS config.https_only=Тільки HTTPS
config.cookie_life_time=Час життя cookie-файлу config.cookie_life_time=Час життя cookie-файлу
config.picture_config=Налаштування фотографії або аватари
config.picture_service=Сервіс зображень config.picture_service=Сервіс зображень
config.disable_gravatar=Вимкнути Gravatar config.disable_gravatar=Вимкнути Gravatar
config.enable_federated_avatar=Увімкнути зовнішні аватари config.enable_federated_avatar=Увімкнути зовнішні аватари
@ -1213,12 +1285,14 @@ monitor.name=Ім'я
monitor.schedule=Розклад monitor.schedule=Розклад
monitor.next=Наступного разу monitor.next=Наступного разу
monitor.previous=Попереднього разу monitor.previous=Попереднього разу
monitor.execute_times=Кількість виконань
monitor.process=Запущені процеси monitor.process=Запущені процеси
monitor.desc=Опис monitor.desc=Опис
monitor.start=Час початку monitor.start=Час початку
monitor.execute_time=Час виконання monitor.execute_time=Час виконання
notices.system_notice_list=Сповіщення системи notices.system_notice_list=Сповіщення системи
notices.view_detail_header=Переглянути деталі повідомлення
notices.actions=Дії notices.actions=Дії
notices.select_all=Вибрати все notices.select_all=Вибрати все
notices.deselect_all=Скасувати виділення notices.deselect_all=Скасувати виділення
@ -1273,6 +1347,7 @@ raw_minutes=хвилини
[dropzone] [dropzone]
default_message=Перетягніть файли або натисніть тут, щоб завантажити. default_message=Перетягніть файли або натисніть тут, щоб завантажити.
invalid_input_type=Ви не можете завантажувати файли цього типу.
file_too_big=Розмір файлу ({{filesize}} MB), що більше ніж максимальний розмір: ({{maxFilesize}} MB). file_too_big=Розмір файлу ({{filesize}} MB), що більше ніж максимальний розмір: ({{maxFilesize}} MB).
remove_file=Видалити файл remove_file=Видалити файл
@ -1288,6 +1363,7 @@ mark_as_unread=Позначити як непрочитане
mark_all_as_read=Позначити всі як прочитані mark_all_as_read=Позначити всі як прочитані
[gpg] [gpg]
error.generate_hash=Не вдалося згенерувати хеш коміту
error.not_signed_commit=Непідписаний коміт error.not_signed_commit=Непідписаний коміт
[units] [units]

View File

@ -213,7 +213,6 @@ send_reset_mail=单击此处(重新)发送您的密码重置邮件
reset_password=重置密码 reset_password=重置密码
invalid_code=此确认密钥无效或已过期。 invalid_code=此确认密钥无效或已过期。
reset_password_helper=单击此处重置密码 reset_password_helper=单击此处重置密码
password_too_short=密码长度不能少于 %d 位!
non_local_account=非本地帐户不能通过 Gitea 的 web 界面更改密码。 non_local_account=非本地帐户不能通过 Gitea 的 web 界面更改密码。
verify=验证 verify=验证
scratch_code=验证口令 scratch_code=验证口令
@ -1475,9 +1474,7 @@ config.db_host=主机
config.db_name=数据库名称 config.db_name=数据库名称
config.db_user=用户名 config.db_user=用户名
config.db_ssl_mode=SSL config.db_ssl_mode=SSL
config.db_ssl_mode_helper=(仅限 "postgres" 使用)
config.db_path=数据库路径 config.db_path=数据库路径
config.db_path_helper=(用于 "sqlite3" 和 "tidb"
config.service_config=服务配置 config.service_config=服务配置
config.register_email_confirm=需要电子邮件确认注册 config.register_email_confirm=需要电子邮件确认注册

View File

@ -94,7 +94,6 @@ email_not_associate=此電子郵件地址未與任何帳戶連結
send_reset_mail=點選此處重發您的密碼重製郵件 send_reset_mail=點選此處重發您的密碼重製郵件
reset_password=重置密碼 reset_password=重置密碼
reset_password_helper=單擊此處重置密碼 reset_password_helper=單擊此處重置密碼
password_too_short=密碼長度不能少於 %d 位!
verify=驗證 verify=驗證
scratch_code=備用碼 scratch_code=備用碼
use_scratch_code=使用備用碼 use_scratch_code=使用備用碼
@ -737,9 +736,7 @@ config.db_config=資料庫設定
config.db_type=資料庫類型 config.db_type=資料庫類型
config.db_host=主機地址 config.db_host=主機地址
config.db_name=資料庫名稱 config.db_name=資料庫名稱
config.db_ssl_mode_helper=(僅限 "postgres" 使用)
config.db_path=資料庫路徑 config.db_path=資料庫路徑
config.db_path_helper=(用於 "sqlite3" 和 "tidb"
config.service_config=服務設定 config.service_config=服務設定
config.show_registration_button=顯示註冊按鈕 config.show_registration_button=顯示註冊按鈕

View File

@ -97,7 +97,6 @@ email_not_associate=此電子郵件地址未與任何帳戶連結
send_reset_mail=點選此處重發您的密碼重製郵件 send_reset_mail=點選此處重發您的密碼重製郵件
reset_password=重置密碼 reset_password=重置密碼
reset_password_helper=單擊此處重置密碼 reset_password_helper=單擊此處重置密碼
password_too_short=密碼長度不能少於 %d 位!
verify=驗證 verify=驗證
scratch_code=備用碼 scratch_code=備用碼
use_scratch_code=使用備用碼 use_scratch_code=使用備用碼
@ -808,9 +807,7 @@ config.db_config=資料庫設定
config.db_type=資料庫類型 config.db_type=資料庫類型
config.db_host=主機地址 config.db_host=主機地址
config.db_name=資料庫名稱 config.db_name=資料庫名稱
config.db_ssl_mode_helper=(僅限 "postgres" 使用)
config.db_path=資料庫路徑 config.db_path=資料庫路徑
config.db_path_helper=(用於 "sqlite3" 和 "tidb"
config.service_config=服務設定 config.service_config=服務設定
config.show_registration_button=顯示註冊按鈕 config.show_registration_button=顯示註冊按鈕

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,10 @@
line-height: 1.6 !important; line-height: 1.6 !important;
word-wrap: break-word; word-wrap: break-word;
&.ui.segment {
padding: 3em;
}
&.file-view { &.file-view {
padding: 2em 2em 2em !important; padding: 2em 2em 2em !important;
} }

551
public/swagger.v1.json vendored
View File

@ -321,9 +321,13 @@
"operationId": "renderMarkdownRaw", "operationId": "renderMarkdownRaw",
"parameters": [ "parameters": [
{ {
"type": "string", "description": "Request body to render",
"name": "body", "name": "body",
"in": "body" "in": "body",
"required": true,
"schema": {
"type": "string"
}
} }
], ],
"responses": { "responses": {
@ -448,6 +452,15 @@
], ],
"summary": "List an organization's webhooks", "summary": "List an organization's webhooks",
"operationId": "orgListHooks", "operationId": "orgListHooks",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"$ref": "#/responses/HookList" "$ref": "#/responses/HookList"
@ -468,6 +481,15 @@
], ],
"summary": "Create a hook", "summary": "Create a hook",
"operationId": "orgCreateHook", "operationId": "orgCreateHook",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"201": { "201": {
"$ref": "#/responses/Hook" "$ref": "#/responses/Hook"
@ -485,6 +507,22 @@
], ],
"summary": "Get a hook", "summary": "Get a hook",
"operationId": "orgGetHook", "operationId": "orgGetHook",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the hook to get",
"name": "id",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"$ref": "#/responses/Hook" "$ref": "#/responses/Hook"
@ -500,6 +538,22 @@
], ],
"summary": "Delete a hook", "summary": "Delete a hook",
"operationId": "orgDeleteHook", "operationId": "orgDeleteHook",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the hook to delete",
"name": "id",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"204": { "204": {
"$ref": "#/responses/empty" "$ref": "#/responses/empty"
@ -518,6 +572,22 @@
], ],
"summary": "Update a hook", "summary": "Update a hook",
"operationId": "orgEditHook", "operationId": "orgEditHook",
"parameters": [
{
"type": "string",
"description": "name of the organization",
"name": "org",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the hook to update",
"name": "id",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"$ref": "#/responses/Hook" "$ref": "#/responses/Hook"
@ -994,7 +1064,7 @@
} }
} }
}, },
"/repos/{owner}/{repo}/archive/{filepath}": { "/repos/{owner}/{repo}/archive/{archive}": {
"get": { "get": {
"produces": [ "produces": [
"application/json" "application/json"
@ -1028,7 +1098,9 @@
} }
], ],
"responses": { "responses": {
"200": {} "200": {
"description": "success"
}
} }
} }
}, },
@ -1338,7 +1410,9 @@
} }
], ],
"responses": { "responses": {
"200": {} "200": {
"description": "success"
}
} }
} }
}, },
@ -1526,6 +1600,47 @@
} }
} }
}, },
"delete": {
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Delete a hook in a repository",
"operationId": "repoDeleteHook",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the hook to delete",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
},
"404": {
"$ref": "#/responses/notFound"
}
}
},
"patch": { "patch": {
"produces": [ "produces": [
"application/json" "application/json"
@ -1550,6 +1665,13 @@
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "index of the hook",
"name": "id",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -1821,6 +1943,100 @@
} }
} }
}, },
"/repos/{owner}/{repo}/issues/{id}/times": {
"get": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "List an issue's tracked times",
"operationId": "issueTrackedTimes",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "index of the issue",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/TrackedTimeList"
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Add a tracked time to a issue",
"operationId": "issueAddTime",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "index of the issue to add tracked time to",
"name": "id",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/AddTimeOption"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/TrackedTime"
},
"400": {
"$ref": "#/responses/error"
},
"403": {
"$ref": "#/responses/error"
}
}
}
},
"/repos/{owner}/{repo}/issues/{index}": { "/repos/{owner}/{repo}/issues/{index}": {
"get": { "get": {
"produces": [ "produces": [
@ -1937,7 +2153,7 @@
{ {
"type": "integer", "type": "integer",
"description": "index of the issue", "description": "index of the issue",
"name": "id", "name": "index",
"in": "path", "in": "path",
"required": true "required": true
}, },
@ -1984,7 +2200,7 @@
{ {
"type": "integer", "type": "integer",
"description": "index of the issue", "description": "index of the issue",
"name": "id", "name": "index",
"in": "path", "in": "path",
"required": true "required": true
}, },
@ -2328,100 +2544,6 @@
} }
} }
}, },
"/repos/{owner}/{repo}/issues/{index}/times": {
"get": {
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "List an issue's tracked times",
"operationId": "issueTrackedTimes",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "index of the issue",
"name": "repo",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/TrackedTimeList"
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"issue"
],
"summary": "Add a tracked time to a issue",
"operationId": "issueAddTime",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "index of the issue to add tracked time to",
"name": "id",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/AddTimeOption"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/TrackedTime"
},
"400": {
"$ref": "#/responses/error"
},
"403": {
"$ref": "#/responses/error"
}
}
}
},
"/repos/{owner}/{repo}/keys": { "/repos/{owner}/{repo}/keys": {
"get": { "get": {
"produces": [ "produces": [
@ -2777,7 +2899,7 @@
"issue" "issue"
], ],
"summary": "Get all of a repository's milestones", "summary": "Get all of a repository's milestones",
"operationId": "issueGetMilestones", "operationId": "issueGetMilestonesList",
"parameters": [ "parameters": [
{ {
"type": "string", "type": "string",
@ -2792,13 +2914,6 @@
"name": "repo", "name": "repo",
"in": "path", "in": "path",
"required": true "required": true
},
{
"type": "integer",
"description": "id of the milestone to get",
"name": "id",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -2859,6 +2974,29 @@
], ],
"summary": "Get a milestone", "summary": "Get a milestone",
"operationId": "issueGetMilestone", "operationId": "issueGetMilestone",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the milestone",
"name": "id",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"$ref": "#/responses/Milestone" "$ref": "#/responses/Milestone"
@ -2889,7 +3027,7 @@
{ {
"type": "integer", "type": "integer",
"description": "id of the milestone to delete", "description": "id of the milestone to delete",
"name": "body", "name": "id",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -2927,6 +3065,13 @@
"in": "path", "in": "path",
"required": true "required": true
}, },
{
"type": "integer",
"description": "id of the milestone",
"name": "id",
"in": "path",
"required": true
},
{ {
"name": "body", "name": "body",
"in": "body", "in": "body",
@ -3261,7 +3406,9 @@
} }
], ],
"responses": { "responses": {
"200": {} "200": {
"description": "success"
}
} }
} }
}, },
@ -3973,7 +4120,7 @@
} }
} }
}, },
"/repos/{owner}/{repo}/times/{tracker}": { "/repos/{owner}/{repo}/times/{user}": {
"get": { "get": {
"produces": [ "produces": [
"application/json" "application/json"
@ -4013,49 +4160,6 @@
} }
} }
}, },
"/repos/{user}/{repo}/hooks/{id}": {
"delete": {
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Delete a hook in a repository",
"operationId": "repoDeleteHook",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "id of the hook to delete",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
},
"404": {
"$ref": "#/responses/notFound"
}
}
}
},
"/repositories/{id}": { "/repositories/{id}": {
"get": { "get": {
"produces": [ "produces": [
@ -4232,7 +4336,7 @@
"organization" "organization"
], ],
"summary": "Remove a team member", "summary": "Remove a team member",
"operationId": "orgAddTeamMember", "operationId": "orgRemoveTeamMember",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -4291,7 +4395,7 @@
"organization" "organization"
], ],
"summary": "Add a repository to a team", "summary": "Add a repository to a team",
"operationId": "orgAddTeamMember", "operationId": "orgAddTeamRepository",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -4330,7 +4434,7 @@
"organization" "organization"
], ],
"summary": "Remove a repository from a team", "summary": "Remove a repository from a team",
"operationId": "orgAddTeamMember", "operationId": "orgRemoveTeamRepository",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "integer",
@ -4373,10 +4477,10 @@
"operationId": "topicSearch", "operationId": "topicSearch",
"parameters": [ "parameters": [
{ {
"type": "integer", "type": "string",
"description": "id of the repo to get", "description": "keywords to search",
"name": "keyword", "name": "q",
"in": "path", "in": "query",
"required": true "required": true
} }
], ],
@ -4503,7 +4607,7 @@
} }
} }
}, },
"/user/following/{followee}": { "/user/following/{username}": {
"get": { "get": {
"tags": [ "tags": [
"user" "user"
@ -4514,7 +4618,7 @@
{ {
"type": "string", "type": "string",
"description": "username of followed user", "description": "username of followed user",
"name": "followee", "name": "username",
"in": "path", "in": "path",
"required": true "required": true
} }
@ -4527,9 +4631,7 @@
"$ref": "#/responses/notFound" "$ref": "#/responses/notFound"
} }
} }
} },
},
"/user/following/{username}": {
"put": { "put": {
"tags": [ "tags": [
"user" "user"
@ -4999,7 +5101,8 @@
"type": "string", "type": "string",
"description": "username of user", "description": "username of user",
"name": "username", "name": "username",
"in": "path" "in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -5273,7 +5376,8 @@
"type": "string", "type": "string",
"description": "username of the user", "description": "username of the user",
"name": "username", "name": "username",
"in": "path" "in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -5293,6 +5397,15 @@
], ],
"summary": "List the authenticated user's access tokens", "summary": "List the authenticated user's access tokens",
"operationId": "userGetTokens", "operationId": "userGetTokens",
"parameters": [
{
"type": "string",
"description": "username of user",
"name": "username",
"in": "path",
"required": true
}
],
"responses": { "responses": {
"200": { "200": {
"$ref": "#/responses/AccessTokenList" "$ref": "#/responses/AccessTokenList"
@ -5315,8 +5428,10 @@
{ {
"type": "string", "type": "string",
"x-go-name": "Name", "x-go-name": "Name",
"name": "name", "description": "username of user",
"in": "query" "name": "username",
"in": "path",
"required": true
} }
], ],
"responses": { "responses": {
@ -7376,11 +7491,13 @@
"description": "AccessTokenList represents a list of API access token." "description": "AccessTokenList represents a list of API access token."
}, },
"Attachment": { "Attachment": {
"description": "Attachment",
"schema": { "schema": {
"$ref": "#/definitions/Attachment" "$ref": "#/definitions/Attachment"
} }
}, },
"AttachmentList": { "AttachmentList": {
"description": "AttachmentList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7389,11 +7506,13 @@
} }
}, },
"Branch": { "Branch": {
"description": "Branch",
"schema": { "schema": {
"$ref": "#/definitions/Branch" "$ref": "#/definitions/Branch"
} }
}, },
"BranchList": { "BranchList": {
"description": "BranchList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7402,11 +7521,13 @@
} }
}, },
"Comment": { "Comment": {
"description": "Comment",
"schema": { "schema": {
"$ref": "#/definitions/Comment" "$ref": "#/definitions/Comment"
} }
}, },
"CommentList": { "CommentList": {
"description": "CommentList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7415,11 +7536,13 @@
} }
}, },
"DeployKey": { "DeployKey": {
"description": "DeployKey",
"schema": { "schema": {
"$ref": "#/definitions/DeployKey" "$ref": "#/definitions/DeployKey"
} }
}, },
"DeployKeyList": { "DeployKeyList": {
"description": "DeployKeyList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7428,6 +7551,7 @@
} }
}, },
"EmailList": { "EmailList": {
"description": "EmailList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7436,11 +7560,13 @@
} }
}, },
"GPGKey": { "GPGKey": {
"description": "GPGKey",
"schema": { "schema": {
"$ref": "#/definitions/GPGKey" "$ref": "#/definitions/GPGKey"
} }
}, },
"GPGKeyList": { "GPGKeyList": {
"description": "GPGKeyList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7449,6 +7575,7 @@
} }
}, },
"Hook": { "Hook": {
"description": "Hook",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7457,6 +7584,7 @@
} }
}, },
"HookList": { "HookList": {
"description": "HookList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7465,11 +7593,13 @@
} }
}, },
"Issue": { "Issue": {
"description": "Issue",
"schema": { "schema": {
"$ref": "#/definitions/Issue" "$ref": "#/definitions/Issue"
} }
}, },
"IssueList": { "IssueList": {
"description": "IssueList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7478,11 +7608,13 @@
} }
}, },
"Label": { "Label": {
"description": "Label",
"schema": { "schema": {
"$ref": "#/definitions/Label" "$ref": "#/definitions/Label"
} }
}, },
"LabelList": { "LabelList": {
"description": "LabelList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7494,11 +7626,13 @@
"description": "MarkdownRender is a rendered markdown document" "description": "MarkdownRender is a rendered markdown document"
}, },
"Milestone": { "Milestone": {
"description": "Milestone",
"schema": { "schema": {
"$ref": "#/definitions/Milestone" "$ref": "#/definitions/Milestone"
} }
}, },
"MilestoneList": { "MilestoneList": {
"description": "MilestoneList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7507,11 +7641,13 @@
} }
}, },
"Organization": { "Organization": {
"description": "Organization",
"schema": { "schema": {
"$ref": "#/definitions/Organization" "$ref": "#/definitions/Organization"
} }
}, },
"OrganizationList": { "OrganizationList": {
"description": "OrganizationList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7520,11 +7656,13 @@
} }
}, },
"PublicKey": { "PublicKey": {
"description": "PublicKey",
"schema": { "schema": {
"$ref": "#/definitions/PublicKey" "$ref": "#/definitions/PublicKey"
} }
}, },
"PublicKeyList": { "PublicKeyList": {
"description": "PublicKeyList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7533,11 +7671,13 @@
} }
}, },
"PullRequest": { "PullRequest": {
"description": "PullRequest",
"schema": { "schema": {
"$ref": "#/definitions/PullRequest" "$ref": "#/definitions/PullRequest"
} }
}, },
"PullRequestList": { "PullRequestList": {
"description": "PullRequestList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7546,11 +7686,13 @@
} }
}, },
"Release": { "Release": {
"description": "Release",
"schema": { "schema": {
"$ref": "#/definitions/Release" "$ref": "#/definitions/Release"
} }
}, },
"ReleaseList": { "ReleaseList": {
"description": "ReleaseList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7559,11 +7701,13 @@
} }
}, },
"Repository": { "Repository": {
"description": "Repository",
"schema": { "schema": {
"$ref": "#/definitions/Repository" "$ref": "#/definitions/Repository"
} }
}, },
"RepositoryList": { "RepositoryList": {
"description": "RepositoryList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7572,24 +7716,25 @@
} }
}, },
"SearchResults": { "SearchResults": {
"description": "SearchResults",
"schema": { "schema": {
"$ref": "#/definitions/SearchResults" "$ref": "#/definitions/SearchResults"
},
"headers": {
"body": {}
} }
}, },
"ServerVersion": { "ServerVersion": {
"description": "ServerVersion",
"schema": { "schema": {
"$ref": "#/definitions/ServerVersion" "$ref": "#/definitions/ServerVersion"
} }
}, },
"Status": { "Status": {
"description": "Status",
"schema": { "schema": {
"$ref": "#/definitions/Status" "$ref": "#/definitions/Status"
} }
}, },
"StatusList": { "StatusList": {
"description": "StatusList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7598,11 +7743,13 @@
} }
}, },
"Team": { "Team": {
"description": "Team",
"schema": { "schema": {
"$ref": "#/definitions/Team" "$ref": "#/definitions/Team"
} }
}, },
"TeamList": { "TeamList": {
"description": "TeamList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7611,11 +7758,13 @@
} }
}, },
"TrackedTime": { "TrackedTime": {
"description": "TrackedTime",
"schema": { "schema": {
"$ref": "#/definitions/TrackedTime" "$ref": "#/definitions/TrackedTime"
} }
}, },
"TrackedTimeList": { "TrackedTimeList": {
"description": "TrackedTimeList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7624,11 +7773,13 @@
} }
}, },
"User": { "User": {
"description": "User",
"schema": { "schema": {
"$ref": "#/definitions/User" "$ref": "#/definitions/User"
} }
}, },
"UserList": { "UserList": {
"description": "UserList",
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
@ -7637,6 +7788,7 @@
} }
}, },
"WatchInfo": { "WatchInfo": {
"description": "WatchInfo",
"schema": { "schema": {
"$ref": "#/definitions/WatchInfo" "$ref": "#/definitions/WatchInfo"
} }
@ -7670,42 +7822,9 @@
"description": "APINotFound is a not found empty response" "description": "APINotFound is a not found empty response"
}, },
"parameterBodies": { "parameterBodies": {
"description": "parameterBodies",
"schema": { "schema": {
"$ref": "#/definitions/EditAttachmentOptions" "$ref": "#/definitions/EditAttachmentOptions"
},
"headers": {
"AddCollaboratorOption": {},
"AddTimeOption": {},
"CreateEmailOption": {},
"CreateForkOption": {},
"CreateHookOption": {},
"CreateIssueCommentOption": {},
"CreateIssueOption": {},
"CreateKeyOption": {},
"CreateLabelOption": {},
"CreateMilestoneOption": {},
"CreateOrgOption": {},
"CreatePullRequestOption": {},
"CreateReleaseOption": {},
"CreateRepoOption": {},
"CreateStatusOption": {},
"CreateTeamOption": {},
"CreateUserOption": {},
"DeleteEmailOption": {},
"EditAttachmentOptions": {},
"EditHookOption": {},
"EditIssueCommentOption": {},
"EditIssueOption": {},
"EditLabelOption": {},
"EditMilestoneOption": {},
"EditOrgOption": {},
"EditPullRequestOption": {},
"EditReleaseOption": {},
"EditTeamOption": {},
"EditUserOption": {},
"IssueLabelsOption": {},
"MarkdownOption": {},
"MigrateRepoForm": {}
} }
}, },
"redirect": { "redirect": {
@ -7745,24 +7864,16 @@
}, },
"security": [ "security": [
{ {
"BasicAuth": [ "BasicAuth": []
"[]"
]
}, },
{ {
"Token": [ "Token": []
"[]"
]
}, },
{ {
"AccessToken": [ "AccessToken": []
"[]"
]
}, },
{ {
"AuthorizationHeaderToken": [ "AuthorizationHeaderToken": []
"[]"
]
} }
] ]
} }

View File

@ -15,10 +15,7 @@ File(s): /vendor/plugins/clipboard/clipboard.min.js
Version: 1.5.9 Version: 1.5.9
File(s): /vendor/plugins/gitgraph/gitgraph.js File(s): /vendor/plugins/gitgraph/gitgraph.js
Version: 9b492e8bf1ddf7908a4997b8f83fa38a809a9da3 Version: 745f604212e2abfe2f0a59169ea530857b46625c
File(s): /vendor/plugins/autolink/autolink.js
Version: 741f66f
File(s): /vendor/plugins/vue/vue.min.js File(s): /vendor/plugins/vue/vue.min.js
Version: 2.1.10 Version: 2.1.10
@ -50,6 +47,9 @@ Version: 1.10.1
File(s): /vendor/plugins/pdfjs/ File(s): /vendor/plugins/pdfjs/
Version: 1.4.20 Version: 1.4.20
File(s): /vendor/plugins/u2f/
Version: 1.0.8
File(s): /vendor/assets/font-awesome/fonts/ File(s): /vendor/assets/font-awesome/fonts/
Version: 4.6.0 Version: 4.6.0

View File

@ -45,11 +45,6 @@
<td><a href="https://github.com/bluef/gitgraph.js/blob/master/LICENSE">BSD 3-Clause</a></td> <td><a href="https://github.com/bluef/gitgraph.js/blob/master/LICENSE">BSD 3-Clause</a></td>
<td><a href="https://github.com/bluef/gitgraph.js">gitgraph.js-latest</a></td> <td><a href="https://github.com/bluef/gitgraph.js">gitgraph.js-latest</a></td>
</tr> </tr>
<tr>
<td><a href="/vendor/plugins/autolink/autolink.js">autolink.min.js</a></td>
<td><a href="https://github.com/egoist/autolink.js/blob/master/LICENSE">Expat</a></td>
<td><a href="https://github.com/egoist/autolink.js">autolink.js-latest</a></td>
</tr>
<tr> <tr>
<td><a href="/vendor/plugins/vue/vue.min.js">vue.min.js</a></td> <td><a href="/vendor/plugins/vue/vue.min.js">vue.min.js</a></td>
<td><a href="https://github.com/vuejs/vue/blob/dev/LICENSE">Expat</a></td> <td><a href="https://github.com/vuejs/vue/blob/dev/LICENSE">Expat</a></td>

View File

@ -126,7 +126,20 @@ var gitGraph = function (canvas, rawGraphList, config) {
!(row[i - 2] && row[i] === "_" && row[i - 2] === "|")) {} !(row[i - 2] && row[i] === "_" && row[i - 2] === "|")) {}
return i; return i;
} };
var findLineBreak = function (row) {
if (!row) {
return -1
}
var i = row.length;
while (i-- &&
!(row[i - 1] && row[i - 2] && row[i] === " " && row[i - 1] === "|" && row[i - 2] === "_")) {}
return i;
};
var genNewFlow = function () { var genNewFlow = function () {
var newId; var newId;
@ -138,21 +151,21 @@ var gitGraph = function (canvas, rawGraphList, config) {
return {id:newId, color:"#" + newId}; return {id:newId, color:"#" + newId};
}; };
//draw method //Draw methods
var drawLineRight = function (x, y, color) { var drawLine = function (moveX, moveY, lineX, lineY, color) {
ctx.strokeStyle = color; ctx.strokeStyle = color;
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(x, y + config.unitSize / 2); ctx.moveTo(moveX, moveY);
ctx.lineTo(x + config.unitSize, y + config.unitSize / 2); ctx.lineTo(lineX, lineY);
ctx.stroke(); ctx.stroke();
}; };
var drawLineRight = function (x, y, color) {
drawLine(x, y + config.unitSize / 2, x + config.unitSize, y + config.unitSize / 2, color);
};
var drawLineUp = function (x, y, color) { var drawLineUp = function (x, y, color) {
ctx.strokeStyle = color; drawLine(x, y + config.unitSize / 2, x, y - config.unitSize / 2, color);
ctx.beginPath();
ctx.moveTo(x, y + config.unitSize / 2);
ctx.lineTo(x, y - config.unitSize / 2);
ctx.stroke();
}; };
var drawNode = function (x, y, color) { var drawNode = function (x, y, color) {
@ -166,37 +179,28 @@ var gitGraph = function (canvas, rawGraphList, config) {
}; };
var drawLineIn = function (x, y, color) { var drawLineIn = function (x, y, color) {
ctx.strokeStyle = color; drawLine(x + config.unitSize, y + config.unitSize / 2, x, y - config.unitSize / 2, color);
ctx.beginPath();
ctx.moveTo(x + config.unitSize, y + config.unitSize / 2);
ctx.lineTo(x, y - config.unitSize / 2);
ctx.stroke();
}; };
var drawLineOut = function (x, y, color) { var drawLineOut = function (x, y, color) {
ctx.strokeStyle = color; drawLine(x, y + config.unitSize / 2, x + config.unitSize, y - config.unitSize / 2, color);
ctx.beginPath();
ctx.moveTo(x, y + config.unitSize / 2);
ctx.lineTo(x + config.unitSize, y - config.unitSize / 2);
ctx.stroke();
}; };
var draw = function (graphList) { var draw = function (graphList) {
var colomn, colomnIndex, prevColomn, condenseIndex; var colomn, colomnIndex, prevColomn, condenseIndex, breakIndex = -1;
var x, y; var x, y;
var color; var color;
var nodePos, outPos; var nodePos;
var tempFlow; var tempFlow;
var prevRowLength = 0; var prevRowLength = 0;
var flowSwapPos = -1; var flowSwapPos = -1;
var lastLinePos; var lastLinePos;
var i, k, l; var i, l;
var condenseCurrentLength, condensePrevLength = 0, condenseNextLength = 0; var condenseCurrentLength, condensePrevLength = 0, condenseNextLength = 0;
var inlineIntersect = false; var inlineIntersect = false;
//initiate for first row //initiate color array for first row
for (i = 0, l = graphList[0].length; i < l; i++) { for (i = 0, l = graphList[0].length; i < l; i++) {
if (graphList[0][i] !== "_" && graphList[0][i] !== " ") { if (graphList[0][i] !== "_" && graphList[0][i] !== " ") {
flows.push(genNewFlow()); flows.push(genNewFlow());
@ -275,6 +279,7 @@ var gitGraph = function (canvas, rawGraphList, config) {
colomnIndex = 0; //reset index colomnIndex = 0; //reset index
condenseIndex = 0; condenseIndex = 0;
condensePrevLength = 0; condensePrevLength = 0;
breakIndex = -1; //reset break index
while (colomnIndex < currentRow.length) { while (colomnIndex < currentRow.length) {
colomn = currentRow[colomnIndex]; colomn = currentRow[colomnIndex];
@ -282,6 +287,18 @@ var gitGraph = function (canvas, rawGraphList, config) {
++condensePrevLength; ++condensePrevLength;
} }
//check and fix line break in next row
if (colomn === "/" && currentRow[colomnIndex - 1] && currentRow[colomnIndex - 1] === "|") {
if ((breakIndex = findLineBreak(nextRow)) !== -1) {
nextRow.splice(breakIndex, 1);
}
}
//if line break found replace all '/' with '|' after breakIndex in previous row
if (breakIndex !== - 1 && colomn === "/" && colomnIndex > breakIndex) {
currentRow[colomnIndex] = "|";
colomn = "|";
}
if (colomn === " " && if (colomn === " " &&
currentRow[colomnIndex + 1] && currentRow[colomnIndex + 1] &&
currentRow[colomnIndex + 1] === "_" && currentRow[colomnIndex + 1] === "_" &&
@ -294,7 +311,7 @@ var gitGraph = function (canvas, rawGraphList, config) {
colomn = "/"; colomn = "/";
} }
//create new flow only when no intersetc happened //create new flow only when no intersect happened
if (flowSwapPos === -1 && if (flowSwapPos === -1 &&
colomn === "/" && colomn === "/" &&
currentRow[colomnIndex - 1] && currentRow[colomnIndex - 1] &&
@ -415,4 +432,4 @@ var gitGraph = function (canvas, rawGraphList, config) {
init(); init();
draw(graphList); draw(graphList);
}; };
// @end-license // @end-license

View File

@ -20,10 +20,10 @@
// - text/html // - text/html
// //
// Security: // Security:
// - BasicAuth: [] // - BasicAuth :
// - Token: [] // - Token :
// - AccessToken: [] // - AccessToken :
// - AuthorizationHeaderToken: [] // - AuthorizationHeaderToken :
// //
// SecurityDefinitions: // SecurityDefinitions:
// BasicAuth: // BasicAuth:

View File

@ -62,9 +62,12 @@ func MarkdownRaw(ctx *context.APIContext) {
// --- // ---
// summary: Render raw markdown as HTML // summary: Render raw markdown as HTML
// parameters: // parameters:
// - name: body // - name: body
// in: body // in: body
// type: string // description: Request body to render
// required: true
// schema:
// type: string
// consumes: // consumes:
// - text/plain // - text/plain
// produces: // produces:

View File

@ -20,6 +20,12 @@ func ListHooks(ctx *context.APIContext) {
// summary: List an organization's webhooks // summary: List an organization's webhooks
// produces: // produces:
// - application/json // - application/json
// parameters:
// - name: org
// in: path
// description: name of the organization
// type: string
// required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/HookList" // "$ref": "#/responses/HookList"
@ -43,6 +49,17 @@ func GetHook(ctx *context.APIContext) {
// summary: Get a hook // summary: Get a hook
// produces: // produces:
// - application/json // - application/json
// parameters:
// - name: org
// in: path
// description: name of the organization
// type: string
// required: true
// - name: id
// in: path
// description: id of the hook to get
// type: integer
// required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/Hook" // "$ref": "#/responses/Hook"
@ -64,9 +81,17 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
// - application/json // - application/json
// produces: // produces:
// - application/json // - application/json
// parameters:
// - name: org
// in: path
// description: name of the organization
// type: string
// required: true
// responses: // responses:
// "201": // "201":
// "$ref": "#/responses/Hook" // "$ref": "#/responses/Hook"
//TODO in body params
if !utils.CheckCreateHookOption(ctx, &form) { if !utils.CheckCreateHookOption(ctx, &form) {
return return
} }
@ -82,9 +107,22 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
// - application/json // - application/json
// produces: // produces:
// - application/json // - application/json
// parameters:
// - name: org
// in: path
// description: name of the organization
// type: string
// required: true
// - name: id
// in: path
// description: id of the hook to update
// type: integer
// required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/Hook" // "$ref": "#/responses/Hook"
//TODO in body params
hookID := ctx.ParamsInt64(":id") hookID := ctx.ParamsInt64(":id")
utils.EditOrgHook(ctx, &form, hookID) utils.EditOrgHook(ctx, &form, hookID)
} }
@ -96,6 +134,17 @@ func DeleteHook(ctx *context.APIContext) {
// summary: Delete a hook // summary: Delete a hook
// produces: // produces:
// - application/json // - application/json
// parameters:
// - name: org
// in: path
// description: name of the organization
// type: string
// required: true
// - name: id
// in: path
// description: id of the hook to delete
// type: integer
// required: true
// responses: // responses:
// "204": // "204":
// "$ref": "#/responses/empty" // "$ref": "#/responses/empty"

View File

@ -51,6 +51,7 @@ func ListUserOrgs(ctx *context.APIContext) {
// in: path // in: path
// description: username of user // description: username of user
// type: string // type: string
// required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/OrganizationList" // "$ref": "#/responses/OrganizationList"

View File

@ -227,7 +227,7 @@ func AddTeamMember(ctx *context.APIContext) {
// RemoveTeamMember api for remove one member from a team // RemoveTeamMember api for remove one member from a team
func RemoveTeamMember(ctx *context.APIContext) { func RemoveTeamMember(ctx *context.APIContext) {
// swagger:operation DELETE /teams/{id}/members/{username} organization orgAddTeamMember // swagger:operation DELETE /teams/{id}/members/{username} organization orgRemoveTeamMember
// --- // ---
// summary: Remove a team member // summary: Remove a team member
// produces: // produces:
@ -306,7 +306,7 @@ func getRepositoryByParams(ctx *context.APIContext) *models.Repository {
// AddTeamRepository api for adding a repository to a team // AddTeamRepository api for adding a repository to a team
func AddTeamRepository(ctx *context.APIContext) { func AddTeamRepository(ctx *context.APIContext) {
// swagger:operation PUT /teams/{id}/repos/{org}/{repo} organization orgAddTeamMember // swagger:operation PUT /teams/{id}/repos/{org}/{repo} organization orgAddTeamRepository
// --- // ---
// summary: Add a repository to a team // summary: Add a repository to a team
// produces: // produces:
@ -350,7 +350,7 @@ func AddTeamRepository(ctx *context.APIContext) {
// RemoveTeamRepository api for removing a repository from a team // RemoveTeamRepository api for removing a repository from a team
func RemoveTeamRepository(ctx *context.APIContext) { func RemoveTeamRepository(ctx *context.APIContext) {
// swagger:operation DELETE /teams/{id}/repos/{org}/{repo} organization orgAddTeamMember // swagger:operation DELETE /teams/{id}/repos/{org}/{repo} organization orgRemoveTeamRepository
// --- // ---
// summary: Remove a repository from a team // summary: Remove a repository from a team
// description: This does not delete the repository, it only removes the // description: This does not delete the repository, it only removes the

View File

@ -36,7 +36,8 @@ func GetRawFile(ctx *context.APIContext) {
// type: string // type: string
// required: true // required: true
// responses: // responses:
// 200: // 200:
// description: success
if !ctx.Repo.HasAccess() { if !ctx.Repo.HasAccess() {
ctx.Status(404) ctx.Status(404)
return return
@ -63,7 +64,7 @@ func GetRawFile(ctx *context.APIContext) {
// GetArchive get archive of a repository // GetArchive get archive of a repository
func GetArchive(ctx *context.APIContext) { func GetArchive(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/archive/{filepath} repository repoGetArchive // swagger:operation GET /repos/{owner}/{repo}/archive/{archive} repository repoGetArchive
// --- // ---
// summary: Get an archive of a repository // summary: Get an archive of a repository
// produces: // produces:
@ -85,7 +86,8 @@ func GetArchive(ctx *context.APIContext) {
// type: string // type: string
// required: true // required: true
// responses: // responses:
// 200: // 200:
// description: success
repoPath := models.RepoPath(ctx.Params(":username"), ctx.Params(":reponame")) repoPath := models.RepoPath(ctx.Params(":username"), ctx.Params(":reponame"))
gitRepo, err := git.OpenRepository(repoPath) gitRepo, err := git.OpenRepository(repoPath)
if err != nil { if err != nil {
@ -121,7 +123,8 @@ func GetEditorconfig(ctx *context.APIContext) {
// type: string // type: string
// required: true // required: true
// responses: // responses:
// 200: // 200:
// description: success
ec, err := ctx.Repo.GetEditorconfig() ec, err := ctx.Repo.GetEditorconfig()
if err != nil { if err != nil {
if git.IsErrNotExist(err) { if git.IsErrNotExist(err) {

View File

@ -189,6 +189,11 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
// description: name of the repo // description: name of the repo
// type: string // type: string
// required: true // required: true
// - name: id
// in: path
// description: index of the hook
// type: integer
// required: true
// - name: body // - name: body
// in: body // in: body
// schema: // schema:
@ -202,7 +207,7 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
// DeleteHook delete a hook of a repository // DeleteHook delete a hook of a repository
func DeleteHook(ctx *context.APIContext) { func DeleteHook(ctx *context.APIContext) {
// swagger:operation DELETE /repos/{user}/{repo}/hooks/{id} repository repoDeleteHook // swagger:operation DELETE /repos/{owner}/{repo}/hooks/{id} repository repoDeleteHook
// --- // ---
// summary: Delete a hook in a repository // summary: Delete a hook in a repository
// produces: // produces:

View File

@ -31,7 +31,7 @@ func ListIssueComments(ctx *context.APIContext) {
// description: name of the repo // description: name of the repo
// type: string // type: string
// required: true // required: true
// - name: id // - name: index
// in: path // in: path
// description: index of the issue // description: index of the issue
// type: integer // type: integer
@ -139,7 +139,7 @@ func CreateIssueComment(ctx *context.APIContext, form api.CreateIssueCommentOpti
// description: name of the repo // description: name of the repo
// type: string // type: string
// required: true // required: true
// - name: id // - name: index
// in: path // in: path
// description: index of the issue // description: index of the issue
// type: integer // type: integer

View File

@ -21,7 +21,7 @@ func trackedTimesToAPIFormat(trackedTimes []*models.TrackedTime) []*api.TrackedT
// ListTrackedTimes list all the tracked times of an issue // ListTrackedTimes list all the tracked times of an issue
func ListTrackedTimes(ctx *context.APIContext) { func ListTrackedTimes(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/issues/{index}/times issue issueTrackedTimes // swagger:operation GET /repos/{owner}/{repo}/issues/{id}/times issue issueTrackedTimes
// --- // ---
// summary: List an issue's tracked times // summary: List an issue's tracked times
// produces: // produces:
@ -37,7 +37,7 @@ func ListTrackedTimes(ctx *context.APIContext) {
// description: name of the repo // description: name of the repo
// type: string // type: string
// required: true // required: true
// - name: repo // - name: id
// in: path // in: path
// description: index of the issue // description: index of the issue
// type: integer // type: integer
@ -70,7 +70,7 @@ func ListTrackedTimes(ctx *context.APIContext) {
// AddTime adds time manual to the given issue // AddTime adds time manual to the given issue
func AddTime(ctx *context.APIContext, form api.AddTimeOption) { func AddTime(ctx *context.APIContext, form api.AddTimeOption) {
// swagger:operation Post /repos/{owner}/{repo}/issues/{index}/times issue issueAddTime // swagger:operation Post /repos/{owner}/{repo}/issues/{id}/times issue issueAddTime
// --- // ---
// summary: Add a tracked time to a issue // summary: Add a tracked time to a issue
// consumes: // consumes:
@ -132,7 +132,7 @@ func AddTime(ctx *context.APIContext, form api.AddTimeOption) {
// ListTrackedTimesByUser lists all tracked times of the user // ListTrackedTimesByUser lists all tracked times of the user
func ListTrackedTimesByUser(ctx *context.APIContext) { func ListTrackedTimesByUser(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/times/{tracker} user userTrackedTimes // swagger:operation GET /repos/{owner}/{repo}/times/{user} user userTrackedTimes
// --- // ---
// summary: List a user's tracked times in a repo // summary: List a user's tracked times in a repo
// produces: // produces:

View File

@ -16,30 +16,7 @@ import (
// ListMilestones list all the milestones for a repository // ListMilestones list all the milestones for a repository
func ListMilestones(ctx *context.APIContext) { func ListMilestones(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone // swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestonesList
// ---
// summary: Get a milestone
// produces:
// - application/json
// responses:
// "200":
// "$ref": "#/responses/Milestone"
milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID)
if err != nil {
ctx.Error(500, "GetMilestonesByRepoID", err)
return
}
apiMilestones := make([]*api.Milestone, len(milestones))
for i := range milestones {
apiMilestones[i] = milestones[i].APIFormat()
}
ctx.JSON(200, &apiMilestones)
}
// GetMilestone get a milestone for a repository
func GetMilestone(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestones
// --- // ---
// summary: Get all of a repository's milestones // summary: Get all of a repository's milestones
// produces: // produces:
@ -55,6 +32,29 @@ func GetMilestone(ctx *context.APIContext) {
// description: name of the repo // description: name of the repo
// type: string // type: string
// required: true // required: true
// responses:
// "200":
// "$ref": "#/responses/MilestoneList"
milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID)
if err != nil {
ctx.Error(500, "GetMilestonesByRepoID", err)
return
}
apiMilestones := make([]*api.Milestone, len(milestones))
for i := range milestones {
apiMilestones[i] = milestones[i].APIFormat()
}
ctx.JSON(200, &apiMilestones)
}
// GetMilestone get a milestone for a repository
func GetMilestone(ctx *context.APIContext) {
// swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone
// ---
// summary: Get a milestone
// produces:
// - application/json
// parameters: // parameters:
// - name: owner // - name: owner
// in: path // in: path
@ -68,12 +68,12 @@ func GetMilestone(ctx *context.APIContext) {
// required: true // required: true
// - name: id // - name: id
// in: path // in: path
// description: id of the milestone to get // description: id of the milestone
// type: integer // type: integer
// required: true // required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/MilestoneList" // "$ref": "#/responses/Milestone"
milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id")) milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id"))
if err != nil { if err != nil {
if models.IsErrMilestoneNotExist(err) { if models.IsErrMilestoneNotExist(err) {
@ -152,6 +152,11 @@ func EditMilestone(ctx *context.APIContext, form api.EditMilestoneOption) {
// description: name of the repo // description: name of the repo
// type: string // type: string
// required: true // required: true
// - name: id
// in: path
// description: id of the milestone
// type: integer
// required: true
// - name: body // - name: body
// in: body // in: body
// schema: // schema:
@ -202,7 +207,7 @@ func DeleteMilestone(ctx *context.APIContext) {
// description: name of the repo // description: name of the repo
// type: string // type: string
// required: true // required: true
// - name: body // - name: id
// in: path // in: path
// description: id of the milestone to delete // description: id of the milestone to delete
// type: integer // type: integer

View File

@ -508,13 +508,13 @@ func TopicSearch(ctx *context.Context) {
// --- // ---
// summary: search topics via keyword // summary: search topics via keyword
// produces: // produces:
// - application/json // - application/json
// parameters: // parameters:
// - name: keyword // - name: q
// in: path // in: query
// description: id of the repo to get // description: keywords to search
// type: integer // required: true
// required: true // type: string
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/Repository" // "$ref": "#/responses/Repository"

View File

@ -8,60 +8,70 @@ import (
api "code.gitea.io/sdk/gitea" api "code.gitea.io/sdk/gitea"
) )
// Issue
// swagger:response Issue // swagger:response Issue
type swaggerResponseIssue struct { type swaggerResponseIssue struct {
// in:body // in:body
Body api.Issue `json:"body"` Body api.Issue `json:"body"`
} }
// IssueList
// swagger:response IssueList // swagger:response IssueList
type swaggerResponseIssueList struct { type swaggerResponseIssueList struct {
// in:body // in:body
Body []api.Issue `json:"body"` Body []api.Issue `json:"body"`
} }
// Comment
// swagger:response Comment // swagger:response Comment
type swaggerResponseComment struct { type swaggerResponseComment struct {
// in:body // in:body
Body api.Comment `json:"body"` Body api.Comment `json:"body"`
} }
// CommentList
// swagger:response CommentList // swagger:response CommentList
type swaggerResponseCommentList struct { type swaggerResponseCommentList struct {
// in:body // in:body
Body []api.Comment `json:"body"` Body []api.Comment `json:"body"`
} }
// Label
// swagger:response Label // swagger:response Label
type swaggerResponseLabel struct { type swaggerResponseLabel struct {
// in:body // in:body
Body api.Label `json:"body"` Body api.Label `json:"body"`
} }
// LabelList
// swagger:response LabelList // swagger:response LabelList
type swaggerResponseLabelList struct { type swaggerResponseLabelList struct {
// in:body // in:body
Body []api.Label `json:"body"` Body []api.Label `json:"body"`
} }
// Milestone
// swagger:response Milestone // swagger:response Milestone
type swaggerResponseMilestone struct { type swaggerResponseMilestone struct {
// in:body // in:body
Body api.Milestone `json:"body"` Body api.Milestone `json:"body"`
} }
// MilestoneList
// swagger:response MilestoneList // swagger:response MilestoneList
type swaggerResponseMilestoneList struct { type swaggerResponseMilestoneList struct {
// in:body // in:body
Body []api.Milestone `json:"body"` Body []api.Milestone `json:"body"`
} }
// TrackedTime
// swagger:response TrackedTime // swagger:response TrackedTime
type swaggerResponseTrackedTime struct { type swaggerResponseTrackedTime struct {
// in:body // in:body
Body api.TrackedTime `json:"body"` Body api.TrackedTime `json:"body"`
} }
// TrackedTimeList
// swagger:response TrackedTimeList // swagger:response TrackedTimeList
type swaggerResponseTrackedTimeList struct { type swaggerResponseTrackedTimeList struct {
// in:body // in:body

View File

@ -8,36 +8,42 @@ import (
api "code.gitea.io/sdk/gitea" api "code.gitea.io/sdk/gitea"
) )
// PublicKey
// swagger:response PublicKey // swagger:response PublicKey
type swaggerResponsePublicKey struct { type swaggerResponsePublicKey struct {
// in:body // in:body
Body api.PublicKey `json:"body"` Body api.PublicKey `json:"body"`
} }
// PublicKeyList
// swagger:response PublicKeyList // swagger:response PublicKeyList
type swaggerResponsePublicKeyList struct { type swaggerResponsePublicKeyList struct {
// in:body // in:body
Body []api.PublicKey `json:"body"` Body []api.PublicKey `json:"body"`
} }
// GPGKey
// swagger:response GPGKey // swagger:response GPGKey
type swaggerResponseGPGKey struct { type swaggerResponseGPGKey struct {
// in:body // in:body
Body api.GPGKey `json:"body"` Body api.GPGKey `json:"body"`
} }
// GPGKeyList
// swagger:response GPGKeyList // swagger:response GPGKeyList
type swaggerResponseGPGKeyList struct { type swaggerResponseGPGKeyList struct {
// in:body // in:body
Body []api.GPGKey `json:"body"` Body []api.GPGKey `json:"body"`
} }
// DeployKey
// swagger:response DeployKey // swagger:response DeployKey
type swaggerResponseDeployKey struct { type swaggerResponseDeployKey struct {
// in:body // in:body
Body api.DeployKey `json:"body"` Body api.DeployKey `json:"body"`
} }
// DeployKeyList
// swagger:response DeployKeyList // swagger:response DeployKeyList
type swaggerResponseDeployKeyList struct { type swaggerResponseDeployKeyList struct {
// in:body // in:body

View File

@ -8,6 +8,7 @@ import (
api "code.gitea.io/sdk/gitea" api "code.gitea.io/sdk/gitea"
) )
// ServerVersion
// swagger:response ServerVersion // swagger:response ServerVersion
type swaggerResponseServerVersion struct { type swaggerResponseServerVersion struct {
// in:body // in:body

View File

@ -12,57 +12,90 @@ import (
// not actually a response, just a hack to get go-swagger to include definitions // not actually a response, just a hack to get go-swagger to include definitions
// of the various XYZOption structs // of the various XYZOption structs
// parameterBodies
// swagger:response parameterBodies // swagger:response parameterBodies
type swaggerParameterBodies struct { type swaggerParameterBodies struct {
// in:body
AddCollaboratorOption api.AddCollaboratorOption AddCollaboratorOption api.AddCollaboratorOption
// in:body
CreateEmailOption api.CreateEmailOption CreateEmailOption api.CreateEmailOption
// in:body
DeleteEmailOption api.DeleteEmailOption DeleteEmailOption api.DeleteEmailOption
// in:body
CreateHookOption api.CreateHookOption CreateHookOption api.CreateHookOption
EditHookOption api.EditHookOption // in:body
EditHookOption api.EditHookOption
// in:body
CreateIssueOption api.CreateIssueOption CreateIssueOption api.CreateIssueOption
EditIssueOption api.EditIssueOption // in:body
EditIssueOption api.EditIssueOption
// in:body
CreateIssueCommentOption api.CreateIssueCommentOption CreateIssueCommentOption api.CreateIssueCommentOption
EditIssueCommentOption api.EditIssueCommentOption // in:body
EditIssueCommentOption api.EditIssueCommentOption
// in:body
IssueLabelsOption api.IssueLabelsOption IssueLabelsOption api.IssueLabelsOption
// in:body
CreateKeyOption api.CreateKeyOption CreateKeyOption api.CreateKeyOption
// in:body
CreateLabelOption api.CreateLabelOption CreateLabelOption api.CreateLabelOption
EditLabelOption api.EditLabelOption // in:body
EditLabelOption api.EditLabelOption
// in:body
MarkdownOption api.MarkdownOption MarkdownOption api.MarkdownOption
// in:body
CreateMilestoneOption api.CreateMilestoneOption CreateMilestoneOption api.CreateMilestoneOption
EditMilestoneOption api.EditMilestoneOption // in:body
EditMilestoneOption api.EditMilestoneOption
// in:body
CreateOrgOption api.CreateOrgOption CreateOrgOption api.CreateOrgOption
EditOrgOption api.EditOrgOption // in:body
EditOrgOption api.EditOrgOption
// in:body
CreatePullRequestOption api.CreatePullRequestOption CreatePullRequestOption api.CreatePullRequestOption
EditPullRequestOption api.EditPullRequestOption // in:body
EditPullRequestOption api.EditPullRequestOption
// in:body
CreateReleaseOption api.CreateReleaseOption CreateReleaseOption api.CreateReleaseOption
EditReleaseOption api.EditReleaseOption // in:body
EditReleaseOption api.EditReleaseOption
// in:body
CreateRepoOption api.CreateRepoOption CreateRepoOption api.CreateRepoOption
// in:body
CreateForkOption api.CreateForkOption CreateForkOption api.CreateForkOption
// in:body
CreateStatusOption api.CreateStatusOption CreateStatusOption api.CreateStatusOption
// in:body
CreateTeamOption api.CreateTeamOption CreateTeamOption api.CreateTeamOption
EditTeamOption api.EditTeamOption // in:body
EditTeamOption api.EditTeamOption
// in:body
AddTimeOption api.AddTimeOption AddTimeOption api.AddTimeOption
// in:body
CreateUserOption api.CreateUserOption CreateUserOption api.CreateUserOption
EditUserOption api.EditUserOption // in:body
EditUserOption api.EditUserOption
// in:body
MigrateRepoForm auth.MigrateRepoForm MigrateRepoForm auth.MigrateRepoForm
// in:body
EditAttachmentOptions api.EditAttachmentOptions EditAttachmentOptions api.EditAttachmentOptions
} }

View File

@ -8,24 +8,28 @@ import (
api "code.gitea.io/sdk/gitea" api "code.gitea.io/sdk/gitea"
) )
// Organization
// swagger:response Organization // swagger:response Organization
type swaggerResponseOrganization struct { type swaggerResponseOrganization struct {
// in:body // in:body
Body api.Organization `json:"body"` Body api.Organization `json:"body"`
} }
// OrganizationList
// swagger:response OrganizationList // swagger:response OrganizationList
type swaggerResponseOrganizationList struct { type swaggerResponseOrganizationList struct {
// in:body // in:body
Body []api.Organization `json:"body"` Body []api.Organization `json:"body"`
} }
// Team
// swagger:response Team // swagger:response Team
type swaggerResponseTeam struct { type swaggerResponseTeam struct {
// in:body // in:body
Body api.Team `json:"body"` Body api.Team `json:"body"`
} }
// TeamList
// swagger:response TeamList // swagger:response TeamList
type swaggerResponseTeamList struct { type swaggerResponseTeamList struct {
// in:body // in:body

View File

@ -8,95 +8,112 @@ import (
api "code.gitea.io/sdk/gitea" api "code.gitea.io/sdk/gitea"
) )
// Repository
// swagger:response Repository // swagger:response Repository
type swaggerResponseRepository struct { type swaggerResponseRepository struct {
// in:body // in:body
Body api.Repository `json:"body"` Body api.Repository `json:"body"`
} }
// RepositoryList
// swagger:response RepositoryList // swagger:response RepositoryList
type swaggerResponseRepositoryList struct { type swaggerResponseRepositoryList struct {
// in:body // in:body
Body []api.Repository `json:"body"` Body []api.Repository `json:"body"`
} }
// Branch
// swagger:response Branch // swagger:response Branch
type swaggerResponseBranch struct { type swaggerResponseBranch struct {
// in:body // in:body
Body api.Branch `json:"body"` Body api.Branch `json:"body"`
} }
// BranchList
// swagger:response BranchList // swagger:response BranchList
type swaggerResponseBranchList struct { type swaggerResponseBranchList struct {
// in:body // in:body
Body []api.Branch `json:"body"` Body []api.Branch `json:"body"`
} }
// Hook
// swagger:response Hook // swagger:response Hook
type swaggerResponseHook struct { type swaggerResponseHook struct {
// in:body // in:body
Body []api.Branch `json:"body"` Body []api.Branch `json:"body"`
} }
// HookList
// swagger:response HookList // swagger:response HookList
type swaggerResponseHookList struct { type swaggerResponseHookList struct {
// in:body // in:body
Body []api.Branch `json:"body"` Body []api.Branch `json:"body"`
} }
// Release
// swagger:response Release // swagger:response Release
type swaggerResponseRelease struct { type swaggerResponseRelease struct {
// in:body // in:body
Body api.Release `json:"body"` Body api.Release `json:"body"`
} }
// ReleaseList
// swagger:response ReleaseList // swagger:response ReleaseList
type swaggerResponseReleaseList struct { type swaggerResponseReleaseList struct {
// in:body // in:body
Body []api.Release `json:"body"` Body []api.Release `json:"body"`
} }
// PullRequest
// swagger:response PullRequest // swagger:response PullRequest
type swaggerResponsePullRequest struct { type swaggerResponsePullRequest struct {
// in:body // in:body
Body api.PullRequest `json:"body"` Body api.PullRequest `json:"body"`
} }
// PullRequestList
// swagger:response PullRequestList // swagger:response PullRequestList
type swaggerResponsePullRequestList struct { type swaggerResponsePullRequestList struct {
// in:body // in:body
Body []api.PullRequest `json:"body"` Body []api.PullRequest `json:"body"`
} }
// Status
// swagger:response Status // swagger:response Status
type swaggerResponseStatus struct { type swaggerResponseStatus struct {
// in:body // in:body
Body api.Status `json:"body"` Body api.Status `json:"body"`
} }
// StatusList
// swagger:response StatusList // swagger:response StatusList
type swaggerResponseStatusList struct { type swaggerResponseStatusList struct {
// in:body // in:body
Body []api.Status `json:"body"` Body []api.Status `json:"body"`
} }
// WatchInfo
// swagger:response WatchInfo // swagger:response WatchInfo
type swaggerResponseWatchInfo struct { type swaggerResponseWatchInfo struct {
// in:body // in:body
Body api.WatchInfo `json:"body"` Body api.WatchInfo `json:"body"`
} }
// SearchResults
// swagger:response SearchResults // swagger:response SearchResults
type swaggerResponseSearchResults struct { type swaggerResponseSearchResults struct {
// in:body
Body api.SearchResults `json:"body"` Body api.SearchResults `json:"body"`
} }
// AttachmentList
// swagger:response AttachmentList // swagger:response AttachmentList
type swaggerResponseAttachmentList struct { type swaggerResponseAttachmentList struct {
//in: body //in: body
Body []api.Attachment `json:"body"` Body []api.Attachment `json:"body"`
} }
// Attachment
// swagger:response Attachment // swagger:response Attachment
type swaggerResponseAttachment struct { type swaggerResponseAttachment struct {
//in: body //in: body

View File

@ -8,18 +8,21 @@ import (
api "code.gitea.io/sdk/gitea" api "code.gitea.io/sdk/gitea"
) )
// User
// swagger:response User // swagger:response User
type swaggerResponseUser struct { type swaggerResponseUser struct {
// in:body // in:body
Body api.User `json:"body"` Body api.User `json:"body"`
} }
// UserList
// swagger:response UserList // swagger:response UserList
type swaggerResponseUserList struct { type swaggerResponseUserList struct {
// in:body // in:body
Body []api.User `json:"body"` Body []api.User `json:"body"`
} }
// EmailList
// swagger:response EmailList // swagger:response EmailList
type swaggerResponseEmailList struct { type swaggerResponseEmailList struct {
// in:body // in:body

View File

@ -18,6 +18,12 @@ func ListAccessTokens(ctx *context.APIContext) {
// summary: List the authenticated user's access tokens // summary: List the authenticated user's access tokens
// produces: // produces:
// - application/json // - application/json
// parameters:
// - name: username
// in: path
// description: username of user
// type: string
// required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/AccessTokenList" // "$ref": "#/responses/AccessTokenList"
@ -46,6 +52,12 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
// - application/json // - application/json
// produces: // produces:
// - application/json // - application/json
// parameters:
// - name: username
// in: path
// description: username of user
// type: string
// required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/AccessToken" // "$ref": "#/responses/AccessToken"

View File

@ -119,11 +119,11 @@ func checkUserFollowing(ctx *context.APIContext, u *models.User, followID int64)
// CheckMyFollowing whether the given user is followed by the authenticated user // CheckMyFollowing whether the given user is followed by the authenticated user
func CheckMyFollowing(ctx *context.APIContext) { func CheckMyFollowing(ctx *context.APIContext) {
// swagger:operation GET /user/following/{followee} user userCurrentCheckFollowing // swagger:operation GET /user/following/{username} user userCurrentCheckFollowing
// --- // ---
// summary: Check whether a user is followed by the authenticated user // summary: Check whether a user is followed by the authenticated user
// parameters: // parameters:
// - name: followee // - name: username
// in: path // in: path
// description: username of followed user // description: username of followed user
// type: string // type: string

View File

@ -43,6 +43,7 @@ func GetWatchedRepos(ctx *context.APIContext) {
// type: string // type: string
// in: path // in: path
// description: username of the user // description: username of the user
// required: true
// responses: // responses:
// "200": // "200":
// "$ref": "#/responses/RepositoryList" // "$ref": "#/responses/RepositoryList"

View File

@ -105,7 +105,9 @@ func renderDirectory(ctx *context.Context, treeLink string) {
ctx.Data["FileContent"] = string(markup.Render(readmeFile.Name(), buf, treeLink, ctx.Repo.Repository.ComposeMetas())) ctx.Data["FileContent"] = string(markup.Render(readmeFile.Name(), buf, treeLink, ctx.Repo.Repository.ComposeMetas()))
} else { } else {
ctx.Data["IsRenderedHTML"] = true ctx.Data["IsRenderedHTML"] = true
ctx.Data["FileContent"] = string(bytes.Replace(buf, []byte("\n"), []byte(`<br>`), -1)) ctx.Data["FileContent"] = strings.Replace(
gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`, -1,
)
} }
} }
} }
@ -208,7 +210,9 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
ctx.Data["FileContent"] = string(markup.Render(blob.Name(), buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas())) ctx.Data["FileContent"] = string(markup.Render(blob.Name(), buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas()))
} else if readmeExist { } else if readmeExist {
ctx.Data["IsRenderedHTML"] = true ctx.Data["IsRenderedHTML"] = true
ctx.Data["FileContent"] = string(bytes.Replace(buf, []byte("\n"), []byte(`<br>`), -1)) ctx.Data["FileContent"] = strings.Replace(
gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`, -1,
)
} else { } else {
// Building code view blocks with line number on server side. // Building code view blocks with line number on server side.
var fileContent string var fileContent string
@ -223,6 +227,10 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
var output bytes.Buffer var output bytes.Buffer
lines := strings.Split(fileContent, "\n") lines := strings.Split(fileContent, "\n")
//Remove blank line at the end of file
if len(lines) > 0 && lines[len(lines)-1] == "" {
lines = lines[:len(lines)-1]
}
for index, line := range lines { for index, line := range lines {
line = gotemplate.HTMLEscapeString(line) line = gotemplate.HTMLEscapeString(line)
if index != len(lines)-1 { if index != len(lines)-1 {

View File

@ -350,7 +350,7 @@ func NewWikiPost(ctx *context.Context, form auth.NewWikiForm) {
return return
} }
ctx.Redirect(ctx.Repo.RepoLink + "/wiki/" + models.WikiNameToFilename(wikiName)) ctx.Redirect(ctx.Repo.RepoLink + "/wiki/" + models.WikiNameToSubURL(wikiName))
} }
// EditWiki render wiki modify page // EditWiki render wiki modify page
@ -391,7 +391,7 @@ func EditWikiPost(ctx *context.Context, form auth.NewWikiForm) {
return return
} }
ctx.Redirect(ctx.Repo.RepoLink + "/wiki/" + models.WikiNameToFilename(newWikiName)) ctx.Redirect(ctx.Repo.RepoLink + "/wiki/" + models.WikiNameToSubURL(newWikiName))
} }
// DeleteWikiPagePost delete wiki page // DeleteWikiPagePost delete wiki page

View File

@ -191,7 +191,7 @@
</div> </div>
<div class="oauth2_use_custom_url_field oauth2_auth_url required field"> <div class="oauth2_use_custom_url_field oauth2_auth_url required field">
<label for="oauth2_auth_url">{{.i18n.Tr "admin.auths.oauth2_authURL"}}</label> <label for="oauth2_auth_url">{{.i18n.Tr "admin.auths.oauth2_authURL"}}</label>
<input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.AuthURL}}v{{end}}"> <input id="oauth2_auth_url" name="oauth2_auth_url" value="{{if $cfg.CustomURLMapping}}{{$cfg.CustomURLMapping.AuthURL}}{{end}}">
</div> </div>
<div class="oauth2_use_custom_url_field oauth2_token_url required field"> <div class="oauth2_use_custom_url_field oauth2_token_url required field">
<label for="oauth2_token_url">{{.i18n.Tr "admin.auths.oauth2_tokenURL"}}</label> <label for="oauth2_token_url">{{.i18n.Tr "admin.auths.oauth2_tokenURL"}}</label>

View File

@ -92,16 +92,22 @@
<dl class="dl-horizontal admin-dl-horizontal"> <dl class="dl-horizontal admin-dl-horizontal">
<dt>{{.i18n.Tr "admin.config.db_type"}}</dt> <dt>{{.i18n.Tr "admin.config.db_type"}}</dt>
<dd>{{.DbCfg.Type}}</dd> <dd>{{.DbCfg.Type}}</dd>
{{if not (or (eq .DbCfg.Type "sqlite3") (eq .DbCfg.Type "tidb"))}}
<dt>{{.i18n.Tr "admin.config.db_host"}}</dt> <dt>{{.i18n.Tr "admin.config.db_host"}}</dt>
<dd>{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}</dd> <dd>{{if .DbCfg.Host}}{{.DbCfg.Host}}{{else}}-{{end}}</dd>
<dt>{{.i18n.Tr "admin.config.db_name"}}</dt> <dt>{{.i18n.Tr "admin.config.db_name"}}</dt>
<dd>{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}</dd> <dd>{{if .DbCfg.Name}}{{.DbCfg.Name}}{{else}}-{{end}}</dd>
<dt>{{.i18n.Tr "admin.config.db_user"}}</dt> <dt>{{.i18n.Tr "admin.config.db_user"}}</dt>
<dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd> <dd>{{if .DbCfg.User}}{{.DbCfg.User}}{{else}}-{{end}}</dd>
{{end}}
{{if eq .DbCfg.Type "postgres"}}
<dt>{{.i18n.Tr "admin.config.db_ssl_mode"}}</dt> <dt>{{.i18n.Tr "admin.config.db_ssl_mode"}}</dt>
<dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}} {{.i18n.Tr "admin.config.db_ssl_mode_helper"}}</dd> <dd>{{if .DbCfg.SSLMode}}{{.DbCfg.SSLMode}}{{else}}-{{end}}</dd>
{{end}}
{{if or (eq .DbCfg.Type "sqlite3") (eq .DbCfg.Type "tidb")}}
<dt>{{.i18n.Tr "admin.config.db_path"}}</dt> <dt>{{.i18n.Tr "admin.config.db_path"}}</dt>
<dd>{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}} {{.i18n.Tr "admin.config.db_path_helper"}}</dd> <dd>{{if .DbCfg.Path}}{{.DbCfg.Path}}{{else}}-{{end}}</dd>
{{end}}
</dl> </dl>
</div> </div>

View File

@ -49,8 +49,8 @@
<tr> <tr>
<td>{{.PID}}</td> <td>{{.PID}}</td>
<td>{{.Description}}</td> <td>{{.Description}}</td>
<td>{{.Start.FormatLong}}</td> <td>{{DateFmtLong .Start}}</td>
<td>{{TimeSinceUnix .Start $.Lang}}</td> <td>{{TimeSince .Start $.Lang}}</td>
</tr> </tr>
{{end}} {{end}}
</tbody> </tbody>

View File

@ -141,7 +141,7 @@
<div class="ui top secondary stackable main menu following bar light"> <div class="ui top secondary stackable main menu following bar light">
<div class="ui container" id="navbar"> <div class="ui container" id="navbar">
<div class="item brand" style="justify-content: space-between;"> <div class="item brand" style="justify-content: space-between;">
<a href="{{AppSubUrl}}/" href="{{AppSubUrl}}/"> <a href="{{AppSubUrl}}/">
<img class="ui mini image" src="{{AppSubUrl}}/img/gitea-sm.png"> <img class="ui mini image" src="{{AppSubUrl}}/img/gitea-sm.png">
</a> </a>
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle"> <div class="ui basic icon button mobile-only" id="navbar-expand-toggle">

View File

@ -32,7 +32,7 @@
</div> </div>
{{if .CanBeForked}} {{if .CanBeForked}}
<div class="ui compact labeled button" tabindex="0"> <div class="ui compact labeled button" tabindex="0">
<a class="ui compact button {{if not $.CanSignedUserFork}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}> <a class="ui compact button {{if not $.CanSignedUserFork}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}>
<i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}} <i class="octicon octicon-repo-forked"></i>{{$.i18n.Tr "repo.fork"}}
</a> </a>
<a class="ui basic label" href="{{.Link}}/forks"> <a class="ui basic label" href="{{.Link}}/forks">

View File

@ -9,6 +9,8 @@ import (
"container/list" "container/list"
"strconv" "strconv"
"strings" "strings"
"github.com/mcuadros/go-version"
) )
// GetRefCommitID returns the last commit ID string of given reference (branch or tag). // GetRefCommitID returns the last commit ID string of given reference (branch or tag).
@ -274,7 +276,7 @@ func (repo *Repository) CommitsCountBetween(start, end string) (int64, error) {
func (repo *Repository) commitsBefore(id SHA1, limit int) (*list.List, error) { func (repo *Repository) commitsBefore(id SHA1, limit int) (*list.List, error) {
cmd := NewCommand("log") cmd := NewCommand("log")
if limit > 0 { if limit > 0 {
cmd.AddArguments("-"+ strconv.Itoa(limit), prettyLogFormat, id.String()) cmd.AddArguments("-"+strconv.Itoa(limit), prettyLogFormat, id.String())
} else { } else {
cmd.AddArguments(prettyLogFormat, id.String()) cmd.AddArguments(prettyLogFormat, id.String())
} }
@ -316,15 +318,35 @@ func (repo *Repository) getCommitsBeforeLimit(id SHA1, num int) (*list.List, err
} }
func (repo *Repository) getBranches(commit *Commit, limit int) ([]string, error) { func (repo *Repository) getBranches(commit *Commit, limit int) ([]string, error) {
stdout, err := NewCommand("for-each-ref", "--count="+ strconv.Itoa(limit), "--format=%(refname)", "--contains", commit.ID.String(), BranchPrefix).RunInDir(repo.Path) if version.Compare(gitVersion, "2.7.0", ">=") {
stdout, err := NewCommand("for-each-ref", "--count="+strconv.Itoa(limit), "--format=%(refname:strip=2)", "--contains", commit.ID.String(), BranchPrefix).RunInDir(repo.Path)
if err != nil {
return nil, err
}
branches := strings.Fields(stdout)
return branches, nil
}
stdout, err := NewCommand("branch", "--contains", commit.ID.String()).RunInDir(repo.Path)
if err != nil { if err != nil {
return nil, err return nil, err
} }
refs := strings.Split(stdout, "\n") refs := strings.Split(stdout, "\n")
branches := make([]string, len(refs)-1)
for i, ref := range refs[:len(refs)-1] { var max int
branches[i] = strings.TrimPrefix(ref, BranchPrefix) if len(refs) > limit {
max = limit
} else {
max = len(refs) - 1
}
branches := make([]string, max)
for i, ref := range refs[:max] {
parts := strings.Fields(ref)
branches[i] = parts[len(parts)-1]
} }
return branches, nil return branches, nil
} }