gpt4 book ai didi

apache - 推送大文件时 Gitea Git-LFS HTTP 413 错误

转载 作者:行者123 更新时间:2023-12-02 16:04:11 24 4
gpt4 key购买 nike

预先免责声明:我对 Linux/Ubuntu 整体和系统管理还很陌生,也只是在空闲时间涉足它,所以请耐心和全面地回答你的问题。

我使用 git-lfs 在我的 Ubuntu 20.04 服务器上安装了 Gitea。我让 Apache 运行反向代理以将我的子域与 gitea 一起使用。我还使用 certbot 为 SSH 配置了它。

每次我尝试推送大文件 (~>1Gb) 时,我都会收到 LFS:来自 HTTP 413 的客户端错误。

到目前为止我尝试了什么:

  • 禁用 UFW
  • 增加gitea配置中的所有相关文件和文件大小选项

这是我的 app.ini:

APP_NAME = Tali Git
RUN_USER = git
RUN_MODE = prod

[security]
INTERNAL_TOKEN = XXXXX
INSTALL_LOCK = true
SECRET_KEY = XXXXXXX
PASSWORD_HASH_ALGO = pbkdf2

[database]
DB_TYPE = sqlite3
HOST = 127.0.0.1:3306
NAME = gitea
USER = gitea
PASSWD =
SCHEMA =
SSL_MODE = disable
CHARSET = utf8
PATH = /var/lib/gitea/data/gitea.db
LOG_SQL = false

[repository]
ROOT = /var/lib/gitea/data/gitea-repositories

[repository.upload]
FILE_MAX_SIZE = 999999999999
MAX_FILES = 999999999999

[server]
SSH_DOMAIN = git.example.com
DOMAIN = git.example.com
HTTP_PORT = 3000
ROOT_URL = https://git.example.com/
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /var/lib/gitea/data/lfs
LFS_JWT_SECRET = XXXXXXXXXXXX
LFS_MAX_FILE_SIZE = 999999999999999999999999
OFFLINE_MODE = false
LFS_HTTP_AUTH_EXPIRY = 999999m

[mailer]
ENABLED = false

[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
DISABLE_REGISTRATION = true
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost

[picture]
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = true

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[session]
PROVIDER = file

[log]
MODE = console
LEVEL = info
ROOT_PATH = /var/lib/gitea/log
ROUTER = console

[ui]
DEFAULT_THEME = arc-green
THEMES = gitea,arc-green

apache HTTP 代理:

<VirtualHost *:80>
ServerName git.example.com
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
LimitRequestBody 0
RewriteEngine on
RewriteCond %{SERVER_NAME} =git.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

apache SSH 代理:

<IfModule mod_ssl.c>
<VirtualHost *:443>
<Directory />
SSLRenegBufferSize 2147483647
</Directory>
ServerName git.example.com
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/

SSLCertificateFile /etc/letsencrypt/live/git.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/git.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

在 Apache 访问或错误日志中没有任何突出的内容。

可以在这里找到具有日志级别跟踪的相关 Gitea 日志:https://pastebin.com/XgbQaZn0

我们将不胜感激任何提示、想法或分享的经验。我在这里完全不知所措。

最佳答案

你试过添加

git config http.version HTTP/1.1

在你的 git 配置中?

关于apache - 推送大文件时 Gitea Git-LFS HTTP 413 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69900513/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com