🌐 AI搜索 & 代理 主页
Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Next Next commit
打入补丁:B4A9891AC46BFD81.patch
  • Loading branch information
SongZihuan committed Mar 20, 2025
commit 040a86d8c07c9fa8938f200c336a29b20d2e2444
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ output*
/release
.task
.envrc
go-remote.sh
testhome
*.patch
21 changes: 5 additions & 16 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
Copyright (c) The Gogs Authors
The MIT License (MIT)
Copyright © 2025 宋子桓(Song Zihuan)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
114 changes: 20 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,108 +1,34 @@
![gogs-brand](https://user-images.githubusercontent.com/2946214/146899259-6a8b58ad-8d6e-40d2-ab02-79dc6aadabbf.png)
# Huan-Gogs

[![GitHub Workflow Status](https://img.shields.io/github/checks-status/gogs/gogs/main?logo=github&style=for-the-badge)](https://github.com/gogs/gogs/actions?query=branch%3Amain) [![Discord](https://img.shields.io/discord/382595433060499458.svg?style=for-the-badge&logo=discord)](https://discord.gg/9aqdHU7) [![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/gogs/gogs)
[Gogs](https://gogs.io)(`/gɑgz/`)是一款极易搭建的自助 Git 服务。

[简体中文](README_ZH.md)
[Huan-Gogs](https://github.com/SongZihuan/HuanGogs) 是根据 Gogs 按需改进而来。

## 🔮 Vision
例如增加了功能:

The Gogs (`/gɑgz/`) project aims to build a simple, stable and extensible self-hosted Git service that can be set up in the most painless way. With Go, this can be done with an independent binary distribution across all platforms that Go supports, including Linux, macOS, Windows and ARM-based systems.
- 公共邮件和主邮件分开。
- 优化邮件服务TLS握手过程。
- 更新用户权限、登录逻辑判断。
- 更新用户仓库创建逻辑(例如可以开启允许管理员无限制创建,而一般注册用户只能查看)。
- 允许限制用户探索其他用户的逻辑(Explore 发现页面 可以对一般用户不展示其他用户)。
- 修复了一些Bug。

## 📡 Overview
## 关于 Gogs

- Please visit [our home page](https://gogs.io) for user documentation.
- Please refer to [CHANGELOG.md](CHANGELOG.md) for list of changes in each releases.
- Want to try it before doing anything else? Do it [online](https://try.gogs.io/gogs/gogs)!
- Having trouble? Help yourself with [troubleshooting](https://gogs.io/docs/intro/troubleshooting.html) or ask questions in [Discussions](https://github.com/gogs/gogs/discussions).
- Want to help with localization? Check out the [localization documentation](https://gogs.io/docs/features/i18n.html).
- Ready to get hands dirty? Read our [contributing guide](.github/CONTRIBUTING.md).
- Hmm... What about APIs? We have experimental support with [documentation](https://github.com/gogs/docs-api).
可以访问 Gogs 的官网获得更多介绍:[gogs.io](https://gogs.io/)。

## 💌 Features
也可以访问其 Github 仓库获取更多介绍:[github.com/gogs/gogs](https://github.com/gogs/gogs)。

- User dashboard, user profile and activity timeline.
- Access repositories via SSH, HTTP and HTTPS protocols.
- User, organization and repository management.
- Repository and organization webhooks, including Slack, Discord and Dingtalk.
- Repository Git hooks, deploy keys and Git LFS.
- Repository issues, pull requests, wiki, protected branches and collaboration.
- Migrate and mirror repositories with wiki from other code hosts.
- Web editor for quick editing repository files and wiki.
- Jupyter Notebook and PDF rendering.
- Authentication via SMTP, LDAP, reverse proxy, GitHub.com and GitHub Enterprise with 2FA.
- Customize HTML templates, static files and many others.
- Rich database backend support, including PostgreSQL, MySQL, SQLite3 or any database backend that speaks one of those protocols.
- Have localization over [31 languages](https://crowdin.com/project/gogs).
## 使用文档

## 💾 Hardware requirements
文档请查看此处:[点击前往](./docs/README.md)。

- A Raspberry Pi or $5 Digital Ocean Droplet is more than enough to get you started. Some even use 64MB RAM Docker [CaaS](https://www.docker.com/blog/containers-as-a-service-caas/).
- 2 CPU cores and 512MB RAM would be the baseline for teamwork.
- Increase CPU cores when your team size gets significantly larger, memory footprint remains low.
## 授权许可

## 💻 Browser support
Gogs 项目采用 MIT 开源授权许可证,完整的授权说明已放置在 [LICENSE.gogs](/LICENSE.gogs) 文件中。

- Please see [Semantic UI](https://github.com/Semantic-Org/Semantic-UI#browser-support) for specific versions of supported browsers.
- The smallest resolution officially supported is **1024*768**, however the UI may still look right in smaller resolutions, but no promises or fixes.
## 协议

## 📜 Installation
本项目基于 [MIT LICENSE](/LICENSE) 发布。
了解更多关于 MIT LICENSE , 请 [点击此处](https://mit-license.song-zh.com) 。

Make sure you install the [prerequisites](https://gogs.io/docs/installation) first.

There are 6 ways to install Gogs:

- [Install from binary](https://gogs.io/docs/installation/install_from_binary.html)
- [Install from source](https://gogs.io/docs/installation/install_from_source.html)
- [Install from packages](https://gogs.io/docs/installation/install_from_packages.html)
- [Ship with Docker](https://github.com/gogs/gogs/tree/main/docker)
- [Try with Vagrant](https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs)

### Deploy to cloud

- [Cloudron](https://www.cloudron.io/store/io.gogs.cloudronapp.html)
- [YunoHost](https://github.com/YunoHost-Apps/gogs_ynh)
- [alwaysdata](https://www.alwaysdata.com/en/marketplace/gogs/)

### Tutorials

- [Private Git Web Portal in Raspberry PI With Gogs](https://peppe8o.com/private-git-web-portal-in-raspberry-pi-with-gogs/)
- [How To Set Up Gogs on Ubuntu 14.04](https://www.digitalocean.com/community/tutorials/how-to-set-up-gogs-on-ubuntu-14-04)
- [Run your own GitHub-like service with the help of Docker](https://blog.hypriot.com/post/run-your-own-github-like-service-with-docker/)
- [Dockerized Gogs git server and alpine postgres in 20 minutes or less](https://garthwaite.org/docker-gogs.html)
- [Host Your Own Private GitHub with Gogs](https://eladnava.com/host-your-own-private-github-with-gogs-io/)
- [使用 Gogs 搭建自己的 Git 服务器](https://blog.mynook.info/post/host-your-own-git-server-using-gogs/) (Chinese)
- [阿里云上 Ubuntu 14.04 64 位安装 Gogs](https://my.oschina.net/luyao/blog/375654) (Chinese)
- [Installing Gogs on FreeBSD](https://www.codejam.info/2015/03/installing-gogs-on-freebsd.html)
- [How to install Gogs on a Linux Server (DigitalOcean)](https://www.youtube.com/watch?v=deSfX0gqefE)

## 📦 Software, service and product support

- [Jenkins](https://plugins.jenkins.io/gogs-webhook/) (CI)
- [Puppet](https://forge.puppet.com/modules/Siteminds/gogs) (IT)
- [Synology](https://www.synology.com) (Docker)
- [Syncloud](https://syncloud.org/) (App Store)

## 🙇‍♂️ Acknowledgments

<p>This project is proudly supported by:</p>
<p>
<a href="https://www.digitalocean.com/">
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
</a>
</p>

Other acknowledgments:

- Thanks [Egon Elbre](https://twitter.com/egonelbre) for designing the original version of the logo.
- Thanks [Crowdin](https://crowdin.com/project/gogs) for sponsoring open source translation plan.
- Thanks [MonoVM](https://monovm.com/linux-vps/) for sponsoring VPS services.
- Thanks [Buildkite](https://buildkite.com) for sponsoring open source CI/CD plan.

## 👋 Contributors

- See [contributors page](https://github.com/gogs/gogs/graphs/contributors) for top 100 contributors.
- See [TRANSLATORS](conf/locale/TRANSLATORS) for public list of translators.

## ⚖️ License

This project is under the MIT License. See the [LICENSE](https://github.com/gogs/gogs/blob/main/LICENSE) file for the full license text.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tasks:
cmds:
- rm -rf {{.RELEASE_GOGS}}
- mkdir -p {{.RELEASE_GOGS}}
- cp -r gogs{{.BINARY_EXT}} LICENSE README.md README_ZH.md scripts {{.RELEASE_GOGS}}
- cp -r gogs{{.BINARY_EXT}} LICENSE LICENSE.gogs README.md scripts {{.RELEASE_GOGS}}
- cd {{.RELEASE_ROOT}} && zip -r gogs.zip "gogs"
vars:
RELEASE_ROOT: release
Expand Down
8 changes: 8 additions & 0 deletions conf/app.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ RUN_MODE = dev
EXTERNAL_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
; The public-facing domain name for the application.
DOMAIN = localhost
; Use TCP Proxy Proto
PROXY_PROTO = false
; The protocol that is used to serve direct traffic to the application.
; Currently supports "http", "https", "fcgi" and "unix".
PROTOCOL = http
Expand Down Expand Up @@ -102,6 +104,10 @@ SCRIPT_TYPE = bash
ANSI_CHARSET =
; Whether to force every new repository to be private.
FORCE_PRIVATE = false
; Administrators are not restricted from creating repositories
ADMIN_NOT_CREATION_LIMIT = false
; Organizations can create an unlimited number of repositories (only works if admin.DISABLE_REGULAR_ORG_CREATION is true)
ORGANIZATION_NOT_CREATION_LIMIT = false
; The global limit of number of repositories a user can create, -1 means no limit.
MAX_CREATION_LIMIT = -1
; Preferred Licenses to place at the top of the list.
Expand Down Expand Up @@ -344,6 +350,8 @@ ANGLED_QUOTES = true
[admin]
; Whether to disable regular (non-admin) users to create organizations.
DISABLE_REGULAR_ORG_CREATION = false
; Whether to disable regular (non-admin) users to explore other user.
DISABLE_REGULAR_EXPLORE_USER = false

[webhook]
; The list of enabled types for users to use, can be "gogs", "slack", "discord", "dingtalk".
Expand Down
2 changes: 1 addition & 1 deletion conf/embed.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2022 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// license that can be found in the LICENSE.gogs file.

package conf

Expand Down
2 changes: 1 addition & 1 deletion conf/embed_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2022 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// license that can be found in the LICENSE.gogs file.

package conf

Expand Down
18 changes: 15 additions & 3 deletions conf/locale/locale_zh-CN.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ signed_in_as=已登录用户

username=用户名
email=邮箱
pubemail=公开邮箱
password=密码
re_type=确认密码
captcha=验证码
Expand Down Expand Up @@ -310,9 +311,13 @@ password_change_disabled=非本地类型的用户被禁止修改密码。

emails=邮箱地址
manage_emails=管理邮箱地址
email_desc=您的主要邮箱地址将被用于通知提醒和其它操作。
email_desc=您的主要邮箱地址将被用于通知提醒和其它操作,公开邮件地址用于公开展示用途
primary=主要
public=公开
anonymous=匿名
primary_email=设为主要
public_email=设为公开
anonymous_email=使用匿名
delete_email=删除
email_deletion=邮箱删除操作
email_deletion_desc=删除该邮箱地址将会移除所有相关的信息。是否继续?
Expand Down Expand Up @@ -637,7 +642,7 @@ pulls.nothing_merge_base=由于两个分支各自拥有完全不同的提交历
pulls.has_pull_request=`已经存在目标分支的合并请求:<a href="%[1]s/pulls/%[3]d">%[2]s#%[3]d</a>`
pulls.create=创建合并请求
pulls.title_desc=请求将 %[1]d 次代码提交从 <code>%[2]s</code> 合并至 <code>%[3]s</code>
pulls.merged_title_desc=于 %[4]s 将 %[1]d 次代码提交从 <code>%[2]s</code>合并至 <code>%[3]s</code>
pulls.merged_title_desc=于 %[4]s 将 %[1]d 次代码提交从 <code>%[2]s</code>合并至 <code>%[3]s</code>
pulls.tab_conversation=对话内容
pulls.tab_commits=代码提交
pulls.tab_files=文件变动
Expand Down Expand Up @@ -819,7 +824,7 @@ settings.githook_edit_desc=如果钩子未启动,则会显示样例文件中
settings.githook_name=钩子名称
settings.githook_content=钩子文本
settings.update_githook=更新钩子设置
settings.add_webhook_desc=我们会通过 <code>POST</code> 请求将订阅事件信息发送至向指定 URL 地址。您可以设置不同的数据接收方式(JSON 或 <code>x-www-form-urlencoded</code>)。 请查阅 <a target="_blank" href="%s">Webhooks 文档</a> 获取更多信息。
settings.add_webhook_desc=我们会通过 <code>POST</code> 请求将订阅事件信息发送至向指定 URL 地址。您可以设置不同的数据接收方式(JSON 或 <code>x-www-form-urlencoded</code>)。 请查阅 <a target="_blank" href="%s">Webhooks 文档</a> 获取更多信息。
settings.payload_url=推送地址
settings.content_type=数据格式
settings.secret=密钥文本
Expand Down Expand Up @@ -1180,6 +1185,7 @@ config.brand_name=品牌名称
config.run_user=运行用户
config.run_mode=运行模式
config.server.external_url=外部网址
config.server.proxy_proto=支持TCP转发服务
config.server.domain=域名
config.server.protocol=协议
config.server.http_addr=HTTP 地址
Expand Down Expand Up @@ -1213,11 +1219,17 @@ config.ssh.server_ciphers=服务端加密套件
config.ssh.server_macs=服务器 MAC 地址
config.ssh.server_algorithms=服务器算法

config.admin_config=用户管理配置
config.admin.disable_regular_org_creation="禁止非管理员创建组织"
config.admin.disable_regularExploreUser="禁止非管理员探索��他用户"

config.repo_config=仓库配置
config.repo.root_path=根目录
config.repo.script_type=脚本类型
config.repo.ansi_chatset=ANSI 字符集
config.repo.force_private=强制设为私有
config.repo.admin_not_creation_limit=管理员创建仓库无限制
config.repo.organization_not_creation_limit=组织创建仓库无限制
config.repo.max_creation_limit=最大创建限制
config.repo.preferred_licenses=推荐的许可证
config.repo.disable_http_git=禁用 HTTP Git
Expand Down
14 changes: 13 additions & 1 deletion conf/locale/locale_zh-HK.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ signed_in_as=已登錄用戶

username=用戶名稱
email=電子郵件
pubemail=公开電子郵件地址
password=密碼
re_type=確認密碼
captcha=驗證碼
Expand Down Expand Up @@ -310,9 +311,13 @@ password_change_disabled=不允許非本地類型使用者,更改其密碼。

emails=電子郵件地址
manage_emails=管理電子郵件地址
email_desc=您的主要邮箱地址将被用于通知提醒和其它操作
email_desc=您的主要電子郵件地址将被用于通知提醒和其它操作,公开電子郵件地址用于公开展示用途
primary=主要
public=公开
anonymous=匿名
primary_email=设为主要
public_email=设为公开
anonymous_email=使用匿名
delete_email=刪除
email_deletion=刪除郵箱
email_deletion_desc=刪除該郵箱地址將會移除所有相��的信息。是否繼續?
Expand Down Expand Up @@ -1179,6 +1184,7 @@ config.brand_name=Brand name
config.run_user=執行用戶
config.run_mode=執行模式
config.server.external_url=External URL
config.server.proxy_proto=Proxy Protocol
config.server.domain=Domain
config.server.protocol=Protocol
config.server.http_addr=HTTP address
Expand Down Expand Up @@ -1212,11 +1218,17 @@ config.ssh.server_ciphers=Server ciphers
config.ssh.server_macs=Server MACs
config.ssh.server_algorithms=Server algorithms

config.admin_config=Admin configuration
config.admin.disable_regular_org_creation=Only admin can create organization
config.admin.disable_regularExploreUser=Only admin can explore user

config.repo_config=Repository configuration
config.repo.root_path=Root path
config.repo.script_type=Script type
config.repo.ansi_chatset=ANSI charset
config.repo.force_private=Force private
config.repo.admin_not_creation_limit=Admin creation unlimited
config.repo.organization_not_creation_limit=Organization creation unlimited
config.repo.max_creation_limit=Max creation limit
config.repo.preferred_licenses=Preferred licenses
config.repo.disable_http_git=Disable HTTP Git
Expand Down
14 changes: 13 additions & 1 deletion conf/locale/locale_zh-TW.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ signed_in_as=已登入用戶

username=用戶名稱
email=電子郵件
pubemail=公开電子郵件地址
password=密碼
re_type=確認密碼
captcha=驗證碼
Expand Down Expand Up @@ -310,9 +311,13 @@ password_change_disabled=不允許非本地類型使用者,更改其密碼。

emails=電子郵件地址
manage_emails=管理電子郵件地址
email_desc=您的主要邮箱地址将被用于通知提醒和其它操作
email_desc=您的主要電子郵件地址将被用于通知提醒和其它操作,公开電子郵件地址用于公开展示用途
primary=主要
public=公开
anonymous=匿名
primary_email=设为主要
public_email=设为公开
anonymous_email=使用匿名
delete_email=刪除
email_deletion=刪除郵箱
email_deletion_desc=刪除該郵箱地址將會移除所有相關的信息。是否繼續?
Expand Down Expand Up @@ -1179,6 +1184,7 @@ config.brand_name=Brand name
config.run_user=執行用戶
config.run_mode=執行模式
config.server.external_url=External URL
config.server.proxy_proto=Proxy Protocol
config.server.domain=網域
config.server.protocol=協定
config.server.http_addr=HTTP address
Expand Down Expand Up @@ -1212,11 +1218,17 @@ config.ssh.server_ciphers=Server ciphers
config.ssh.server_macs=Server MACs
config.ssh.server_algorithms=Server algorithms

config.admin_config=使用者管理配置
config.admin.disable_regular_org_creation=禁止非管理員創建組織
config.admin.disable_regularExploreUser=禁止非管理員探索其他用戶

config.repo_config=Repository 設定
config.repo.root_path=根路徑
config.repo.script_type=Script type
config.repo.ansi_chatset=ANSI charset
config.repo.force_private=Force private
config.repo.admin_not_creation_limit=Admin creation unlimited
config.repo.organization_not_creation_limit=Organization creation unlimited
config.repo.max_creation_limit=Max creation limit
config.repo.preferred_licenses=Preferred licenses
config.repo.disable_http_git=Disable HTTP Git
Expand Down
2 changes: 1 addition & 1 deletion gen.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2022 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// license that can be found in the LICENSE.gogs file.

package main

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/pires/go-proxyproto v0.8.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.62.0 // indirect
Expand Down
Loading