mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 00:00:55 -04:00
Compare commits
No commits in common. "bc21723717a00888722c86641b70371a811867f9" and "cb68e01e22fb20cb0e23090654a4e7285fb8d933" have entirely different histories.
bc21723717
...
cb68e01e22
@ -2568,12 +2568,6 @@ LEVEL = Info
|
|||||||
;DEFAULT_ACTIONS_URL = github
|
;DEFAULT_ACTIONS_URL = github
|
||||||
;; Default artifact retention time in days, default is 90 days
|
;; Default artifact retention time in days, default is 90 days
|
||||||
;ARTIFACT_RETENTION_DAYS = 90
|
;ARTIFACT_RETENTION_DAYS = 90
|
||||||
;; Timeout to stop the task which have running status, but haven't been updated for a long time
|
|
||||||
;ZOMBIE_TASK_TIMEOUT = 10m
|
|
||||||
;; Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time
|
|
||||||
;ENDLESS_TASK_TIMEOUT = 3h
|
|
||||||
;; Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time
|
|
||||||
;ABANDONED_JOB_TIMEOUT = 24h
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
@ -1389,9 +1389,6 @@ PROXY_HOSTS = *.github.com
|
|||||||
- `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
- `STORAGE_TYPE`: **local**: Storage type for actions logs, `local` for local disk or `minio` for s3 compatible object storage service, default is `local` or other name defined with `[storage.xxx]`
|
||||||
- `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
|
- `MINIO_BASE_PATH`: **actions_log/**: Minio base path on the bucket only available when STORAGE_TYPE is `minio`
|
||||||
- `ARTIFACT_RETENTION_DAYS`: **90**: Number of days to keep artifacts. Set to 0 to disable artifact retention. Default is 90 days if not set.
|
- `ARTIFACT_RETENTION_DAYS`: **90**: Number of days to keep artifacts. Set to 0 to disable artifact retention. Default is 90 days if not set.
|
||||||
- `ZOMBIE_TASK_TIMEOUT`: **10m**: Timeout to stop the task which have running status, but haven't been updated for a long time
|
|
||||||
- `ENDLESS_TASK_TIMEOUT`: **3h**: Timeout to stop the tasks which have running status and continuous updates, but don't end for a long time
|
|
||||||
- `ABANDONED_JOB_TIMEOUT`: **24h**: Timeout to cancel the jobs which have waiting status, but haven't been picked by a runner for a long time
|
|
||||||
|
|
||||||
`DEFAULT_ACTIONS_URL` indicates where the Gitea Actions runners should find the actions with relative path.
|
`DEFAULT_ACTIONS_URL` indicates where the Gitea Actions runners should find the actions with relative path.
|
||||||
For example, `uses: actions/checkout@v3` means `https://github.com/actions/checkout@v3` since the value of `DEFAULT_ACTIONS_URL` is `github`.
|
For example, `uses: actions/checkout@v3` means `https://github.com/actions/checkout@v3` since the value of `DEFAULT_ACTIONS_URL` is `github`.
|
||||||
|
112
docs/content/installation/upgrade-from-gogs.en-us.md
Normal file
112
docs/content/installation/upgrade-from-gogs.en-us.md
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
---
|
||||||
|
date: "2016-12-01T16:00:00+02:00"
|
||||||
|
title: "Upgrade from Gogs"
|
||||||
|
slug: "upgrade-from-gogs"
|
||||||
|
sidebar_position: 101
|
||||||
|
toc: false
|
||||||
|
draft: false
|
||||||
|
aliases:
|
||||||
|
- /en-us/upgrade-from-gogs
|
||||||
|
menu:
|
||||||
|
sidebar:
|
||||||
|
parent: "installation"
|
||||||
|
name: "Upgrade From Gogs"
|
||||||
|
sidebar_position: 101
|
||||||
|
identifier: "upgrade-from-gogs"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Upgrade from Gogs
|
||||||
|
|
||||||
|
Gogs, version 0.9.146 and older, can be easily migrated to Gitea.
|
||||||
|
|
||||||
|
There are some basic steps to follow. On a Linux system run as the Gogs user:
|
||||||
|
|
||||||
|
* Create a Gogs backup with `gogs backup`. This creates `gogs-backup-[timestamp].zip` file
|
||||||
|
containing all important Gogs data. You would need it if you wanted to move to the `gogs` back later.
|
||||||
|
* Download the file matching the destination platform from the [downloads page](https://dl.gitea.com/gitea/).
|
||||||
|
It should be `1.0.x` version. Migrating from `gogs` to any other version is impossible.
|
||||||
|
* Put the binary at the desired install location.
|
||||||
|
* Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini`.
|
||||||
|
* Copy custom `templates, public` from `gogs/custom/` to `gitea/custom/`.
|
||||||
|
* For any other custom folders, such as `gitignore, label, license, locale, readme` in
|
||||||
|
`gogs/custom/conf`, copy them to `gitea/custom/options`.
|
||||||
|
* Copy `gogs/data/` to `gitea/data/`. It contains issue attachments and avatars.
|
||||||
|
* Verify by starting Gitea with `gitea web`.
|
||||||
|
* Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file`.
|
||||||
|
* Launch every major version of the binary ( `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → etc ) to migrate database.
|
||||||
|
* If custom or config path was changed, run `Rewrite all update hook of repositories`.
|
||||||
|
|
||||||
|
## Change gogs specific information
|
||||||
|
|
||||||
|
* Rename `gogs-repositories/` to `gitea-repositories/`
|
||||||
|
* Rename `gogs-data/` to `gitea-data/`
|
||||||
|
* In `gitea/custom/conf/app.ini` change:
|
||||||
|
|
||||||
|
FROM:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gogs/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gogs-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gogs/log
|
||||||
|
```
|
||||||
|
|
||||||
|
TO:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gitea/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gitea-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gitea/log
|
||||||
|
```
|
||||||
|
|
||||||
|
* Verify by starting Gitea with `gitea web`
|
||||||
|
|
||||||
|
## Upgrading to most recent `gitea` version
|
||||||
|
|
||||||
|
After successful migration from `gogs` to `gitea 1.0.x`, it is possible to upgrade `gitea` to a modern version
|
||||||
|
in a two steps process.
|
||||||
|
|
||||||
|
Upgrade to [`gitea 1.6.4`](https://dl.gitea.com/gitea/1.6.4/) first. Download the file matching
|
||||||
|
the destination platform from the [downloads page](https://dl.gitea.com/gitea/1.6.4/) and replace the binary.
|
||||||
|
Run Gitea at least once and check that everything works as expected.
|
||||||
|
|
||||||
|
Then repeat the procedure, but this time using the [latest release](https://dl.gitea.com/gitea/@version@/).
|
||||||
|
|
||||||
|
## Upgrading from a more recent version of Gogs
|
||||||
|
|
||||||
|
Upgrading from a more recent version of Gogs (up to `0.11.x`) may also be possible, but will require a bit more work.
|
||||||
|
See [#4286](https://github.com/go-gitea/gitea/issues/4286), which includes various Gogs `0.11.x` versions.
|
||||||
|
|
||||||
|
Upgrading from Gogs `0.12.x` and above will be increasingly more difficult as the projects diverge further apart in configuration and schema.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
* If errors are encountered relating to custom templates in the `gitea/custom/templates`
|
||||||
|
folder, try moving the templates causing the errors away one by one. They may not be
|
||||||
|
compatible with Gitea or an update.
|
||||||
|
|
||||||
|
## Add Gitea to startup on Unix
|
||||||
|
|
||||||
|
Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/main/contrib)
|
||||||
|
with the right environment variables.
|
||||||
|
|
||||||
|
For distros with systemd:
|
||||||
|
|
||||||
|
* Copy the updated script to `/etc/systemd/system/gitea.service`
|
||||||
|
* Add the service to the startup with: `sudo systemctl enable gitea`
|
||||||
|
* Disable old gogs startup script: `sudo systemctl disable gogs`
|
||||||
|
|
||||||
|
For distros with SysVinit:
|
||||||
|
|
||||||
|
* Copy the updated script to `/etc/init.d/gitea`
|
||||||
|
* Add the service to the startup with: `sudo rc-update add gitea`
|
||||||
|
* Disable old gogs startup script: `sudo rc-update del gogs`
|
85
docs/content/installation/upgrade-from-gogs.fr-fr.md
Normal file
85
docs/content/installation/upgrade-from-gogs.fr-fr.md
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
---
|
||||||
|
date: "2017-08-23T09:00:00+02:00"
|
||||||
|
title: "Mise à jour depuis Gogs"
|
||||||
|
slug: "upgrade-from-gogs"
|
||||||
|
sidebar_position: 101
|
||||||
|
toc: false
|
||||||
|
draft: false
|
||||||
|
aliases:
|
||||||
|
- /fr-fr/upgrade-from-gogs
|
||||||
|
menu:
|
||||||
|
sidebar:
|
||||||
|
parent: "installation"
|
||||||
|
name: "Depuis Gogs"
|
||||||
|
sidebar_position: 101
|
||||||
|
identifier: "upgrade-from-gogs"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Mise à jour depuis Gogs
|
||||||
|
|
||||||
|
À partir de la version 0.9.146 (schéma de la base de données : version 15) de Gogs, Il est possible de migrer vers Gitea simplement et sans encombre.
|
||||||
|
|
||||||
|
Veuillez suivre les étapes ci-dessous. Sur Unix, toute les commandes s'exécutent en tant que l'utilisateur utilisé pour votre installation de Gogs :
|
||||||
|
|
||||||
|
* Crééer une sauvegarde de Gogs avec la commande `gogs dump`. Le fichier nouvellement créé `gogs-dump-[timestamp].zip` contient toutes les données de votre instance de Gogs.
|
||||||
|
* Téléchargez le fichier correspondant à votre plateforme à partir de la [page de téléchargements](https://dl.gitea.com/gitea).
|
||||||
|
* Mettez la binaire dans le répertoire d'installation souhaité.
|
||||||
|
* Copiez le fichier `gogs/custom/conf/app.ini` vers `gitea/custom/conf/app.ini`.
|
||||||
|
* Si vous avez personnalisé les répertoires `templates, public` dans `gogs/custom/`, copiez-les vers `gitea/custom/`.
|
||||||
|
* Si vous avez d'autres répertoires personnalisés comme `gitignore, label, license, locale, readme` dans `gogs/custom/conf` copiez-les vers `gitea/custom/options`.
|
||||||
|
* Copiez le répertoire `gogs/data/` vers `gitea/data/`.
|
||||||
|
* Vérifiez votre installation en exécutant Gitea avec la commande `gitea web`.
|
||||||
|
* Lancez le binaire de version majeure en version majeure ( `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → etc ) afin de récupérer les migrations de base de données.
|
||||||
|
* Connectez vous au panel d'administration de Gitea et exécutez l'action `Rewrite '.ssh/authorized_keys' file`, puis l'action `Rewrite all update hook of repositories` (obligatoire si le chemin menant à votre configuration personnalisée à changé).
|
||||||
|
|
||||||
|
## Modifier les informations spécifiques de gogs
|
||||||
|
|
||||||
|
* Renommez `gogs-repositories/` vers `gitea-repositories/`
|
||||||
|
* Renommez `gogs-data/` to `gitea-data/`
|
||||||
|
* Dans votre fichier `gitea/custom/conf/app.ini`, modifiez les éléments suivants:
|
||||||
|
|
||||||
|
DE :
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gogs/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gogs-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gogs/log
|
||||||
|
```
|
||||||
|
|
||||||
|
VERS :
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gitea/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gitea-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gitea/log
|
||||||
|
```
|
||||||
|
|
||||||
|
* Vérifiez votre installation en exécutant Gitea avec la commande `gitea web`.
|
||||||
|
|
||||||
|
## Dépannage
|
||||||
|
|
||||||
|
* Si vous rencontrez des erreurs relatives à des modèles personnalisés dans le dossier `gitea/custom/templates`, essayez de déplacer un par un les modèles provoquant les erreurs. Il est possible qu'ils ne soient pas compatibles avec Gitea.
|
||||||
|
|
||||||
|
## Démarrer automatiquement Gitea (Unix)
|
||||||
|
|
||||||
|
Distributions utilisant systemd:
|
||||||
|
|
||||||
|
* Copiez le script mis à jour vers `/etc/systemd/system/gitea.service`
|
||||||
|
* Ajoutez le service avec la commande `sudo systemctl enable gitea`
|
||||||
|
* Désactivez Gogs avec la commande `sudo systemctl disable gogs`
|
||||||
|
|
||||||
|
Distributions utilisant SysVinit:
|
||||||
|
|
||||||
|
* Copiez le script mis à jour vers `/etc/init.d/gitea`
|
||||||
|
* Ajoutez le service avec la commande `sudo rc-update add gitea`
|
||||||
|
* Désactivez Gogs avec la commande `sudo rc-update del gogs`
|
101
docs/content/installation/upgrade-from-gogs.zh-cn.md
Normal file
101
docs/content/installation/upgrade-from-gogs.zh-cn.md
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
---
|
||||||
|
date: "2016-12-01T16:00:00+02:00"
|
||||||
|
title: "从 Gogs 升级"
|
||||||
|
slug: "upgrade-from-gogs"
|
||||||
|
sidebar_position: 101
|
||||||
|
toc: false
|
||||||
|
draft: false
|
||||||
|
aliases:
|
||||||
|
- /zh-cn/upgrade-from-gogs
|
||||||
|
menu:
|
||||||
|
sidebar:
|
||||||
|
parent: "installation"
|
||||||
|
name: "从 Gogs 升级"
|
||||||
|
sidebar_position: 101
|
||||||
|
identifier: "upgrade-from-gogs"
|
||||||
|
---
|
||||||
|
|
||||||
|
# 从 Gogs 升级
|
||||||
|
|
||||||
|
如果你正在运行Gogs 0.9.146以下版本,你可以平滑的升级到Gitea。该升级需要如下的步骤:
|
||||||
|
|
||||||
|
* 使用 `gogs backup` 创建 Gogs 备份。这会创建一个名为 `gogs-backup-[时间戳].zip` 的文件,其中包含所有重要的 Gogs 数据。如果您将来想要返回到 `gogs`,您会需要这个备份文件。
|
||||||
|
* 从 [下载页面](https://dl.gitea.com/gitea/) 下载适用于目标平台的文件。应该选择 `1.0.x` 版本。从 `gogs` 迁移到其他任何版本是不可能的。
|
||||||
|
* 将二进制文件放置在所需的安装位置。
|
||||||
|
* 将 `gogs/custom/conf/app.ini` 复制到 `gitea/custom/conf/app.ini`。
|
||||||
|
* 将 `gogs/custom/` 中的自定义 `templates, public` 复制到 `gitea/custom/`。
|
||||||
|
* 对于其他自定义文件夹,例如 `gogs/custom/conf` 中的 `gitignore, label, license, locale, readme`,将它们复制到 `gitea/custom/options`。
|
||||||
|
* 将 `gogs/data/` 复制到 `gitea/data/`。其中包含问题附件和头像。
|
||||||
|
* 使用 `gitea web` 启动 Gitea 进行验证。
|
||||||
|
* 在 UI 上进入 Gitea 管理面板,运行 `Rewrite '.ssh/authorized_keys' file`。
|
||||||
|
* 启动每个主要版本的二进制文件(例如 `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → 等)以迁移数据库。
|
||||||
|
* 如果自定义或配置路径已更改,请运行 `Rewrite all update hook of repositories`。
|
||||||
|
|
||||||
|
## 更改特定于 Gogs 的信息
|
||||||
|
|
||||||
|
* 将 `gogs-repositories/` 重命名为 `gitea-repositories/`
|
||||||
|
* 将 `gogs-data/` 重命名为 `gitea-data/`
|
||||||
|
* 在 `gitea/custom/conf/app.ini` 中进行更改:
|
||||||
|
从:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gogs/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gogs-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gogs/log
|
||||||
|
```
|
||||||
|
|
||||||
|
到:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gitea/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gitea-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gitea/log
|
||||||
|
```
|
||||||
|
|
||||||
|
* 使用 `gitea web` 启动 Gitea 进行验证
|
||||||
|
|
||||||
|
## 升级到最新版本的 `gitea`
|
||||||
|
|
||||||
|
在成功从 `gogs` 迁移到 `gitea 1.0.x` 之后,可以通过两步过程将 `gitea` 升级到现代版本。
|
||||||
|
|
||||||
|
首先升级到 [`gitea 1.6.4`](https://dl.gitea.com/gitea/1.6.4/)。从 [下载页面](https://dl.gitea.com/gitea/1.6.4/) 下载适用于目标平台的文件,并替换二进制文件。至少运行一次 Gitea 并检查是否一切正常。
|
||||||
|
|
||||||
|
然后重复这个过程,但这次使用 [最新版本](https://dl.gitea.com/gitea/@version@/)。
|
||||||
|
|
||||||
|
## 从较新的 Gogs 版本升级
|
||||||
|
|
||||||
|
从较新的 Gogs 版本(最高到 `0.11.x`)可能也是可能的,但需要更多的工作。
|
||||||
|
请参见 [#4286](https://github.com/go-gitea/gitea/issues/4286),其中包括各种 Gogs `0.11.x` 版本。
|
||||||
|
|
||||||
|
从 Gogs `0.12.x` 及更高版本升级将变得越来越困难,因为项目在配置和架构上逐渐分歧。
|
||||||
|
|
||||||
|
## 故障排除
|
||||||
|
|
||||||
|
* 如果在 `gitea/custom/templates` 文件夹中遇到与自定义模板相关的错误,请尝试逐个移除引发错误的模板。
|
||||||
|
它们可能与 Gitea 或更新不兼容。
|
||||||
|
|
||||||
|
## 将 Gitea 添加到 Unix 的启动项
|
||||||
|
|
||||||
|
从 [gitea/contrib](https://github.com/go-gitea/gitea/tree/main/contrib) 更新适当的文件,确保正确的环境变量。
|
||||||
|
|
||||||
|
对于使用 systemd 的发行版:
|
||||||
|
|
||||||
|
* 将更新后的脚本复制到 `/etc/systemd/system/gitea.service`
|
||||||
|
* 使用以下命令将服务添加到启动项:`sudo systemctl enable gitea`
|
||||||
|
* 禁用旧的 gogs 启动脚本:`sudo systemctl disable gogs`
|
||||||
|
|
||||||
|
对于使用 SysVinit 的发行版:
|
||||||
|
|
||||||
|
* 将更新后的脚本复制到 `/etc/init.d/gitea`
|
||||||
|
* 使用以下命令将服务添加到启动项:`sudo rc-update add gitea`
|
||||||
|
* 禁用旧的 gogs 启动脚本:`sudo rc-update del gogs`
|
107
docs/content/installation/upgrade-from-gogs.zh-tw.md
Normal file
107
docs/content/installation/upgrade-from-gogs.zh-tw.md
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
---
|
||||||
|
date: "2016-12-01T16:00:00+02:00"
|
||||||
|
title: "從 Gogs 升級"
|
||||||
|
slug: "upgrade-from-gogs"
|
||||||
|
sidebar_position: 101
|
||||||
|
toc: false
|
||||||
|
draft: false
|
||||||
|
aliases:
|
||||||
|
- /zh-tw/upgrade-from-gogs
|
||||||
|
menu:
|
||||||
|
sidebar:
|
||||||
|
parent: "installation"
|
||||||
|
name: "從 Gogs 升級"
|
||||||
|
sidebar_position: 101
|
||||||
|
identifier: "upgrade-from-gogs"
|
||||||
|
---
|
||||||
|
|
||||||
|
# 從 Gogs 升級
|
||||||
|
|
||||||
|
**目錄**
|
||||||
|
|
||||||
|
若您正在執行 Gogs 0.9.146 以下版本,您可以很簡單地遷移到 Gitea。
|
||||||
|
|
||||||
|
請參考下列步驟。在 Linux 系統上請以 Gogs 的使用者身份執行:
|
||||||
|
|
||||||
|
- 使用 `gogs backup` 建立 Gogs 的備份。這會建立檔案 `gogs-backup-[timestamp].zip` 包含所有重要的 Gogs 資料。
|
||||||
|
如果稍後您要恢復到 `gogs` 時會用到它。
|
||||||
|
- 從[下載頁](https://dl.gitea.com/gitea/)下載對應您平臺的檔案。請下載 `1.0.x` 版,從 `gogs` 遷移到其它版本是不可行的。
|
||||||
|
- 將二進位檔放到適當的安裝位置。
|
||||||
|
- 複製 `gogs/custom/conf/app.ini` 到 `gitea/custom/conf/app.ini`。
|
||||||
|
- 從 `gogs/custom/` 複製自訂 `templates, public` 到 `gitea/custom/`。
|
||||||
|
- `gogs/custom/conf` 中的其它自訂資料夾如: `gitignore, label, license, locale, readme`,
|
||||||
|
請複製到 `gitea/custom/options`。
|
||||||
|
- 複製 `gogs/data/` 到 `gitea/data/`。它包含了問題附件和大頭貼。
|
||||||
|
- 以指令 `gitea web` 啟動 Gitea 驗證上列設定是否正確。
|
||||||
|
- 從網頁 UI 進入 Gitea 管理員面板, 執行 `Rewrite '.ssh/authorized_keys' file`。
|
||||||
|
- 執行每個主要版本的二進位檔 ( `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → 等等 ) 以遷移資料庫。
|
||||||
|
- 如果變更了自訂檔、設定檔路徑,請執行 `Rewrite all update hook of repositories`。
|
||||||
|
|
||||||
|
## 修改指定的 gogs 資訊
|
||||||
|
|
||||||
|
- 重新命名 `gogs-repositories/` 為 `gitea-repositories/`
|
||||||
|
- 重新命名 `gogs-data/` 為 `gitea-data/`
|
||||||
|
- 在 `gitea/custom/conf/app.ini` 中修改:
|
||||||
|
|
||||||
|
修改前:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gogs/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gogs-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gogs/log
|
||||||
|
```
|
||||||
|
|
||||||
|
修改後:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[database]
|
||||||
|
PATH = /home/:USER/gitea/data/:DATABASE.db
|
||||||
|
[attachment]
|
||||||
|
PATH = /home/:USER/gitea-data/attachments
|
||||||
|
[picture]
|
||||||
|
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
|
||||||
|
[log]
|
||||||
|
ROOT_PATH = /home/:USER/gitea/log
|
||||||
|
```
|
||||||
|
|
||||||
|
- 執行 `gitea web` 啟動 Gitea 檢查是否正確執行
|
||||||
|
|
||||||
|
## 升級到最新版的 `gitea`
|
||||||
|
|
||||||
|
成功從 `gogs` 升級到 `gitea 1.0.x` 後再用 2 個步驟即可升級到最新版的 `gitea`。
|
||||||
|
|
||||||
|
請先升級到 [`gitea 1.6.4`](https://dl.gitea.com/gitea/1.6.4/),先從[下載頁](https://dl.gitea.com/gitea/1.6.4/)下載
|
||||||
|
您平臺的二進位檔取代既有的。至少執行一次 Gitea 並確認一切符合預期。
|
||||||
|
|
||||||
|
接著重複上述步驟,但這次請使用[最新發行版本](https://dl.gitea.com/gitea/@version@/)。
|
||||||
|
|
||||||
|
## 從更新版本的 Gogs 升級
|
||||||
|
|
||||||
|
您也可以從更新版本的 Gogs 升級,但需要更多步驟。
|
||||||
|
請參考 [#4286](https://github.com/go-gitea/gitea/issues/4286)。
|
||||||
|
|
||||||
|
## 疑難排解
|
||||||
|
|
||||||
|
- 如果錯誤和 `gitea/custom/templates` 中 的自訂樣板有關,請試著逐一移除它們。
|
||||||
|
它們可能和 Gitea 或更新不相容。
|
||||||
|
|
||||||
|
## 在 Unix 啟動時執行 Gitea
|
||||||
|
|
||||||
|
從 [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib) 更新必要的檔案以取得正確的環境變數。
|
||||||
|
|
||||||
|
使用 systemd 的發行版:
|
||||||
|
|
||||||
|
- 複製新的腳本到 `/etc/systemd/system/gitea.service`
|
||||||
|
- 啟動系統時執行服務: `sudo systemctl enable gitea`
|
||||||
|
- 停用舊的 gogs 腳本: `sudo systemctl disable gogs`
|
||||||
|
|
||||||
|
使用 SysVinit 的發行版:
|
||||||
|
|
||||||
|
- 複製新的腳本到 `/etc/init.d/gitea`
|
||||||
|
- 啟動系統時執行服務: `sudo rc-update add gitea`
|
||||||
|
- 停用舊的 gogs 腳本: `sudo rc-update del gogs`
|
@ -113,7 +113,7 @@ menu:
|
|||||||
|
|
||||||
## 外部跟踪器
|
## 外部跟踪器
|
||||||
|
|
||||||
Gitea 支持使用外部工单跟踪器,并可以在合并请求中创建对外部托管的工单的引用。但是,如果外部跟踪器使用数字来标识工单,那么它们将与 Gitea 中托管的合并请求无法区分。为了解决这个问题,Gitea 允许使用 `!` 标记来标识合并请求。例如:
|
Gitea 支持使用外部工单跟踪器,并可以在合并请求中创建对外部托管的工单的引用。但是,如果外部跟踪器使用数字来标识工单,那么它们将与 Gitea 中托管的合并请求无法区分。为了解决这个工单,Gitea 允许使用 `!` 标记来标识合并请求。例如:
|
||||||
|
|
||||||
> 这是工单 [#1234](#),并链接到外部跟踪器。
|
> 这是工单 [#1234](#),并链接到外部跟踪器。
|
||||||
> 这是合并请求 [!1234](#),并链接到 Gitea 中的合并请求。
|
> 这是合并请求 [!1234](#),并链接到 Gitea 中的合并请求。
|
||||||
|
@ -649,23 +649,3 @@
|
|||||||
repo_id: 49
|
repo_id: 49
|
||||||
type: 2
|
type: 2
|
||||||
created_unix: 946684810
|
created_unix: 946684810
|
||||||
|
|
||||||
-
|
|
||||||
id: 98
|
|
||||||
repo_id: 1
|
|
||||||
type: 8
|
|
||||||
created_unix: 946684810
|
|
||||||
|
|
||||||
-
|
|
||||||
id: 99
|
|
||||||
repo_id: 1
|
|
||||||
type: 9
|
|
||||||
config: "{}"
|
|
||||||
created_unix: 946684810
|
|
||||||
|
|
||||||
-
|
|
||||||
id: 100
|
|
||||||
repo_id: 1
|
|
||||||
type: 10
|
|
||||||
config: "{}"
|
|
||||||
created_unix: 946684810
|
|
||||||
|
@ -42,7 +42,7 @@ const (
|
|||||||
// UserTypeOrganization defines an organization
|
// UserTypeOrganization defines an organization
|
||||||
UserTypeOrganization
|
UserTypeOrganization
|
||||||
|
|
||||||
// UserTypeUserReserved reserves a (non-existing) user, i.e. to prevent a spam user from re-registering after being deleted, or to reserve the name until the user is actually created later on
|
// UserTypeReserved reserves a (non-existing) user, i.e. to prevent a spam user from re-registering after being deleted, or to reserve the name until the user is actually created later on
|
||||||
UserTypeUserReserved
|
UserTypeUserReserved
|
||||||
|
|
||||||
// UserTypeOrganizationReserved reserves a (non-existing) organization, to be used in combination with UserTypeUserReserved
|
// UserTypeOrganizationReserved reserves a (non-existing) organization, to be used in combination with UserTypeUserReserved
|
||||||
|
@ -86,8 +86,7 @@ func (repo *Repository) IsEmpty() (bool, error) {
|
|||||||
Stdout: &output,
|
Stdout: &output,
|
||||||
Stderr: &errbuf,
|
Stderr: &errbuf,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
if (err.Error() == "exit status 1" && strings.TrimSpace(errbuf.String()) == "") || err.Error() == "exit status 129" {
|
if err.Error() == "exit status 1" && errbuf.String() == "" {
|
||||||
// git 2.11 exits with 129 if the repo is empty
|
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return true, fmt.Errorf("check empty: %w - %s", err, errbuf.String())
|
return true, fmt.Errorf("check empty: %w - %s", err, errbuf.String())
|
||||||
|
@ -6,7 +6,6 @@ package setting
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
)
|
)
|
||||||
@ -19,9 +18,6 @@ var (
|
|||||||
ArtifactRetentionDays int64 `ini:"ARTIFACT_RETENTION_DAYS"`
|
ArtifactRetentionDays int64 `ini:"ARTIFACT_RETENTION_DAYS"`
|
||||||
Enabled bool
|
Enabled bool
|
||||||
DefaultActionsURL defaultActionsURL `ini:"DEFAULT_ACTIONS_URL"`
|
DefaultActionsURL defaultActionsURL `ini:"DEFAULT_ACTIONS_URL"`
|
||||||
ZombieTaskTimeout time.Duration `ini:"ZOMBIE_TASK_TIMEOUT"`
|
|
||||||
EndlessTaskTimeout time.Duration `ini:"ENDLESS_TASK_TIMEOUT"`
|
|
||||||
AbandonedJobTimeout time.Duration `ini:"ABANDONED_JOB_TIMEOUT"`
|
|
||||||
}{
|
}{
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
DefaultActionsURL: defaultActionsURLGitHub,
|
DefaultActionsURL: defaultActionsURLGitHub,
|
||||||
@ -86,9 +82,5 @@ func loadActionsFrom(rootCfg ConfigProvider) error {
|
|||||||
Actions.ArtifactRetentionDays = 90
|
Actions.ArtifactRetentionDays = 90
|
||||||
}
|
}
|
||||||
|
|
||||||
Actions.ZombieTaskTimeout = sec.Key("ZOMBIE_TASK_TIMEOUT").MustDuration(10 * time.Minute)
|
|
||||||
Actions.EndlessTaskTimeout = sec.Key("ENDLESS_TASK_TIMEOUT").MustDuration(3 * time.Hour)
|
|
||||||
Actions.AbandonedJobTimeout = sec.Key("ABANDONED_JOB_TIMEOUT").MustDuration(24 * time.Hour)
|
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,6 @@ locked = Locked
|
|||||||
|
|
||||||
copy = Copy
|
copy = Copy
|
||||||
copy_url = Copy URL
|
copy_url = Copy URL
|
||||||
copy_hash = Copy hash
|
|
||||||
copy_content = Copy content
|
copy_content = Copy content
|
||||||
copy_branch = Copy branch name
|
copy_branch = Copy branch name
|
||||||
copy_success = Copied!
|
copy_success = Copied!
|
||||||
@ -1284,7 +1283,6 @@ commits.signed_by_untrusted_user = Signed by untrusted user
|
|||||||
commits.signed_by_untrusted_user_unmatched = Signed by untrusted user who does not match committer
|
commits.signed_by_untrusted_user_unmatched = Signed by untrusted user who does not match committer
|
||||||
commits.gpg_key_id = GPG Key ID
|
commits.gpg_key_id = GPG Key ID
|
||||||
commits.ssh_key_fingerprint = SSH Key Fingerprint
|
commits.ssh_key_fingerprint = SSH Key Fingerprint
|
||||||
commits.view_path=View at this point in history
|
|
||||||
|
|
||||||
commit.operations = Operations
|
commit.operations = Operations
|
||||||
commit.revert = Revert
|
commit.revert = Revert
|
||||||
@ -2009,8 +2007,7 @@ settings.mirror_settings.push_mirror.add = Add Push Mirror
|
|||||||
settings.mirror_settings.push_mirror.edit_sync_time = Edit mirror sync interval
|
settings.mirror_settings.push_mirror.edit_sync_time = Edit mirror sync interval
|
||||||
|
|
||||||
settings.sync_mirror = Synchronize Now
|
settings.sync_mirror = Synchronize Now
|
||||||
settings.pull_mirror_sync_in_progress = Pulling changes from the remote %s at the moment.
|
settings.mirror_sync_in_progress = Mirror synchronization is in progress. Check back in a minute.
|
||||||
settings.push_mirror_sync_in_progress = Pushing changes to the remote %s at the moment.
|
|
||||||
settings.site = Website
|
settings.site = Website
|
||||||
settings.update_settings = Update Settings
|
settings.update_settings = Update Settings
|
||||||
settings.update_mirror_settings = Update Mirror Settings
|
settings.update_mirror_settings = Update Mirror Settings
|
||||||
|
@ -285,7 +285,7 @@ func SettingsPost(ctx *context.Context) {
|
|||||||
|
|
||||||
mirror_service.AddPullMirrorToQueue(repo.ID)
|
mirror_service.AddPullMirrorToQueue(repo.ID)
|
||||||
|
|
||||||
ctx.Flash.Info(ctx.Tr("repo.settings.pull_mirror_sync_in_progress", repo.OriginalURL))
|
ctx.Flash.Info(ctx.Tr("repo.settings.mirror_sync_in_progress"))
|
||||||
ctx.Redirect(repo.Link() + "/settings")
|
ctx.Redirect(repo.Link() + "/settings")
|
||||||
|
|
||||||
case "push-mirror-sync":
|
case "push-mirror-sync":
|
||||||
@ -302,7 +302,7 @@ func SettingsPost(ctx *context.Context) {
|
|||||||
|
|
||||||
mirror_service.AddPushMirrorToQueue(m.ID)
|
mirror_service.AddPushMirrorToQueue(m.ID)
|
||||||
|
|
||||||
ctx.Flash.Info(ctx.Tr("repo.settings.push_mirror_sync_in_progress", m.RemoteAddress))
|
ctx.Flash.Info(ctx.Tr("repo.settings.mirror_sync_in_progress"))
|
||||||
ctx.Redirect(repo.Link() + "/settings")
|
ctx.Redirect(repo.Link() + "/settings")
|
||||||
|
|
||||||
case "push-mirror-update":
|
case "push-mirror-update":
|
||||||
|
@ -488,13 +488,8 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
|
|||||||
} else {
|
} else {
|
||||||
buf, _ := io.ReadAll(rd)
|
buf, _ := io.ReadAll(rd)
|
||||||
|
|
||||||
// The Open Group Base Specification: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html
|
// empty: 0 lines; "a": one line; "a\n": two lines; "a\nb": two lines;
|
||||||
// empty: 0 lines; "a": 1 line, 1 incomplete-line; "a\n": 1 line; "a\nb": 1 line, 1 incomplete-line;
|
// the NumLines is only used for the display on the UI: "xxx lines"
|
||||||
// Gitea uses the definition (like most modern editors):
|
|
||||||
// empty: 0 lines; "a": 1 line; "a\n": 2 lines; "a\nb": 2 lines;
|
|
||||||
// When rendering, the last empty line is not rendered in UI, while the line-number is still counted, to tell users that the file contains a trailing EOL.
|
|
||||||
// To make the UI more consistent, it could use an icon mark to indicate that there is no trailing EOL, and show line-number as the rendered lines.
|
|
||||||
// This NumLines is only used for the display on the UI: "xxx lines"
|
|
||||||
if len(buf) == 0 {
|
if len(buf) == 0 {
|
||||||
ctx.Data["NumLines"] = 0
|
ctx.Data["NumLines"] = 0
|
||||||
} else {
|
} else {
|
||||||
|
@ -12,15 +12,20 @@ import (
|
|||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
"code.gitea.io/gitea/modules/actions"
|
"code.gitea.io/gitea/modules/actions"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
|
||||||
"code.gitea.io/gitea/modules/timeutil"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
zombieTaskTimeout = 10 * time.Minute
|
||||||
|
endlessTaskTimeout = 3 * time.Hour
|
||||||
|
abandonedJobTimeout = 24 * time.Hour
|
||||||
|
)
|
||||||
|
|
||||||
// StopZombieTasks stops the task which have running status, but haven't been updated for a long time
|
// StopZombieTasks stops the task which have running status, but haven't been updated for a long time
|
||||||
func StopZombieTasks(ctx context.Context) error {
|
func StopZombieTasks(ctx context.Context) error {
|
||||||
return stopTasks(ctx, actions_model.FindTaskOptions{
|
return stopTasks(ctx, actions_model.FindTaskOptions{
|
||||||
Status: actions_model.StatusRunning,
|
Status: actions_model.StatusRunning,
|
||||||
UpdatedBefore: timeutil.TimeStamp(time.Now().Add(-setting.Actions.ZombieTaskTimeout).Unix()),
|
UpdatedBefore: timeutil.TimeStamp(time.Now().Add(-zombieTaskTimeout).Unix()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +33,7 @@ func StopZombieTasks(ctx context.Context) error {
|
|||||||
func StopEndlessTasks(ctx context.Context) error {
|
func StopEndlessTasks(ctx context.Context) error {
|
||||||
return stopTasks(ctx, actions_model.FindTaskOptions{
|
return stopTasks(ctx, actions_model.FindTaskOptions{
|
||||||
Status: actions_model.StatusRunning,
|
Status: actions_model.StatusRunning,
|
||||||
StartedBefore: timeutil.TimeStamp(time.Now().Add(-setting.Actions.EndlessTaskTimeout).Unix()),
|
StartedBefore: timeutil.TimeStamp(time.Now().Add(-endlessTaskTimeout).Unix()),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +81,7 @@ func stopTasks(ctx context.Context, opts actions_model.FindTaskOptions) error {
|
|||||||
func CancelAbandonedJobs(ctx context.Context) error {
|
func CancelAbandonedJobs(ctx context.Context) error {
|
||||||
jobs, _, err := actions_model.FindRunJobs(ctx, actions_model.FindRunJobOptions{
|
jobs, _, err := actions_model.FindRunJobs(ctx, actions_model.FindRunJobOptions{
|
||||||
Statuses: []actions_model.Status{actions_model.StatusWaiting, actions_model.StatusBlocked},
|
Statuses: []actions_model.Status{actions_model.StatusWaiting, actions_model.StatusBlocked},
|
||||||
UpdatedBefore: timeutil.TimeStamp(time.Now().Add(-setting.Actions.AbandonedJobTimeout).Unix()),
|
UpdatedBefore: timeutil.TimeStamp(time.Now().Add(-abandonedJobTimeout).Unix()),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("find abandoned tasks: %v", err)
|
log.Warn("find abandoned tasks: %v", err)
|
||||||
|
@ -592,7 +592,7 @@ func checkAndUpdateEmptyRepository(m *repo_model.Mirror, gitRepo *git.Repository
|
|||||||
if err := gitRepo.SetDefaultBranch(m.Repo.DefaultBranch); err != nil {
|
if err := gitRepo.SetDefaultBranch(m.Repo.DefaultBranch); err != nil {
|
||||||
if !git.IsErrUnsupportedVersion(err) {
|
if !git.IsErrUnsupportedVersion(err) {
|
||||||
log.Error("Failed to update default branch of underlying git repository %-v. Error: %v", m.Repo, err)
|
log.Error("Failed to update default branch of underlying git repository %-v. Error: %v", m.Repo, err)
|
||||||
desc := fmt.Sprintf("Failed to update default branch of underlying git repository '%s': %v", m.Repo.RepoPath(), err)
|
desc := fmt.Sprintf("Failed to uupdate default branch of underlying git repository '%s': %v", m.Repo.RepoPath(), err)
|
||||||
if err = system_model.CreateRepositoryNotice(desc); err != nil {
|
if err = system_model.CreateRepositoryNotice(desc); err != nil {
|
||||||
log.Error("CreateRepositoryNotice: %v", err)
|
log.Error("CreateRepositoryNotice: %v", err)
|
||||||
}
|
}
|
||||||
@ -603,7 +603,7 @@ func checkAndUpdateEmptyRepository(m *repo_model.Mirror, gitRepo *git.Repository
|
|||||||
// Update the is empty and default_branch columns
|
// Update the is empty and default_branch columns
|
||||||
if err := repo_model.UpdateRepositoryCols(db.DefaultContext, m.Repo, "default_branch", "is_empty"); err != nil {
|
if err := repo_model.UpdateRepositoryCols(db.DefaultContext, m.Repo, "default_branch", "is_empty"); err != nil {
|
||||||
log.Error("Failed to update default branch of repository %-v. Error: %v", m.Repo, err)
|
log.Error("Failed to update default branch of repository %-v. Error: %v", m.Repo, err)
|
||||||
desc := fmt.Sprintf("Failed to update default branch of repository '%s': %v", m.Repo.RepoPath(), err)
|
desc := fmt.Sprintf("Failed to uupdate default branch of repository '%s': %v", m.Repo.RepoPath(), err)
|
||||||
if err = system_model.CreateRepositoryNotice(desc); err != nil {
|
if err = system_model.CreateRepositoryNotice(desc); err != nil {
|
||||||
log.Error("CreateRepositoryNotice: %v", err)
|
log.Error("CreateRepositoryNotice: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th>
|
<th class="three wide">{{ctx.Locale.Tr "repo.commits.author"}}</th>
|
||||||
<th class="two wide sha">SHA1</th>
|
<th class="two wide sha">SHA1</th>
|
||||||
<th class="eight wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th>
|
<th class="nine wide message">{{ctx.Locale.Tr "repo.commits.message"}}</th>
|
||||||
<th class="two wide right aligned">{{ctx.Locale.Tr "repo.commits.date"}}</th>
|
<th class="two wide right aligned">{{ctx.Locale.Tr "repo.commits.date"}}</th>
|
||||||
<th class="one wide right aligned"></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="commit-list">
|
<tbody class="commit-list">
|
||||||
@ -26,6 +25,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</td>
|
</td>
|
||||||
<td class="sha gt-df">
|
<td class="sha gt-df">
|
||||||
|
<button class="ui button copy-commit-sha gt-df gt-ac" data-clipboard-text="{{.ID}}">{{svg "octicon-copy" 14}}</button>
|
||||||
{{$class := "ui sha label"}}
|
{{$class := "ui sha label"}}
|
||||||
{{if .Signature}}
|
{{if .Signature}}
|
||||||
{{$class = (print $class " isSigned")}}
|
{{$class = (print $class " isSigned")}}
|
||||||
@ -76,12 +76,6 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
<td class="text right aligned">{{TimeSince .Author.When ctx.Locale}}</td>
|
<td class="text right aligned">{{TimeSince .Author.When ctx.Locale}}</td>
|
||||||
{{end}}
|
{{end}}
|
||||||
<td class="gt-pt-0 gt-pb-0">
|
|
||||||
<div class="gt-df gt-je">
|
|
||||||
<button class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "copy_hash"}}" data-clipboard-text="{{.ID}}">{{svg "octicon-copy"}}</button>
|
|
||||||
{{if $.FileName}}<a class="btn interact-bg gt-p-3" data-tooltip-content="{{ctx.Locale.Tr "repo.commits.view_path"}}" href="{{printf "%s/src/commit/%s/%s" $commitRepoLink (PathEscape .ID.String) $.FileName}}">{{svg "octicon-file-code"}}</a>{{end}}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{{end}}
|
{{end}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -159,7 +159,6 @@ func testLinksAsUser(userName string, t *testing.T) {
|
|||||||
"/releases/new",
|
"/releases/new",
|
||||||
//"/wiki/_pages",
|
//"/wiki/_pages",
|
||||||
"/wiki/?action=_new",
|
"/wiki/?action=_new",
|
||||||
"/activity",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, repo := range apiRepos {
|
for _, repo := range apiRepos {
|
||||||
@ -175,35 +174,3 @@ func TestLinksLogin(t *testing.T) {
|
|||||||
|
|
||||||
testLinksAsUser("user2", t)
|
testLinksAsUser("user2", t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRepoLinks(t *testing.T) {
|
|
||||||
defer tests.PrepareTestEnv(t)()
|
|
||||||
|
|
||||||
// repo1 has enabled almost features, so we can test most links
|
|
||||||
repoLink := "/user2/repo1"
|
|
||||||
links := []string{
|
|
||||||
"/actions",
|
|
||||||
"/packages",
|
|
||||||
"/projects",
|
|
||||||
}
|
|
||||||
|
|
||||||
// anonymous user
|
|
||||||
for _, link := range links {
|
|
||||||
req := NewRequest(t, "GET", repoLink+link)
|
|
||||||
MakeRequest(t, req, http.StatusOK)
|
|
||||||
}
|
|
||||||
|
|
||||||
// admin/owner user
|
|
||||||
session := loginUser(t, "user1")
|
|
||||||
for _, link := range links {
|
|
||||||
req := NewRequest(t, "GET", repoLink+link)
|
|
||||||
session.MakeRequest(t, req, http.StatusOK)
|
|
||||||
}
|
|
||||||
|
|
||||||
// non-admin non-owner user
|
|
||||||
session = loginUser(t, "user2")
|
|
||||||
for _, link := range links {
|
|
||||||
req := NewRequest(t, "GET", repoLink+link)
|
|
||||||
session.MakeRequest(t, req, http.StatusOK)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1328,6 +1328,13 @@ img.ui.avatar,
|
|||||||
display: inline-block; /* not sure whether it is still needed */
|
display: inline-block; /* not sure whether it is still needed */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui .button.copy-commit-sha {
|
||||||
|
border: 1px solid var(--color-light-border);
|
||||||
|
margin-right: 3px;
|
||||||
|
padding: 6px 6px 4px;
|
||||||
|
background: var(--color-light);
|
||||||
|
}
|
||||||
|
|
||||||
.ui .button.truncate {
|
.ui .button.truncate {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
@ -3051,6 +3051,9 @@ tbody.commit-list {
|
|||||||
.commit-table th.sha {
|
.commit-table th.sha {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
.commit-table .commit-list .copy-commit-sha {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
.comment-header {
|
.comment-header {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user