Gitea v1.21.1 中文文档
X-Real-IP 将真实的客 户端 IP 地址传递给 Gitea。否则 Gitea 程序会将客户端地址错误解析为反向代理服务器的地址,例如回环地址 127.0.0.1 。 1. proxy_set_header X-Real-IP $remote_addr; 额外注意,在 Gitea 的配置文件 app.ini 中存在下列默认值: 1. REVERSE_PROXY_LIMIT = 1 2. proxy_set_header Host $host; 8. proxy_set_header X-Real-IP $remote_addr; 9. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 10. proxy_set_header X-Forwarded-Proto proxy_set_header Host $host; 10. proxy_set_header X-Real-IP $remote_addr; 11. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 12. proxy_set_header X-Forwarded-Proto0 码力 | 303 页 | 3.88 MB | 1 年前3Pro Git 2nd Edition 2.1.413
to repos// /issues/ /comments with the token we just generated as an Authorization header. $ curl -H "Content-Type: application/json" \ -H "Authorization: token TOKEN" \ --data 40-character checksum hash. This is the SHA-1 hash — a checksum of the content you’re storing plus a header, which you’ll learn about in a bit. Now you can see how Git has stored your data: $ find .git/objects initially — as a single file per piece of content, named with the SHA-1 checksum of the content and its header. The subdirectory is named with the first 2 characters of the SHA-1, and the filename is the remaining 0 码力 | 731 页 | 21.49 MB | 1 年前3Pro Git 2nd Edition 2.1.413
repos// /issues/ /comments with the token we just generated as an Authorization header. $ curl -H "Content-Type: application/json" \ -H "Authorization: token TOKEN" \ --data 40-character checksum hash. This is the SHA-1 hash — a checksum of the content you’re storing plus a header, which you’ll learn about in a bit. Now you can see how Git has stored your data: $ find .git/objects initially — as a single file per piece of content, named with the SHA-1 checksum of the content and its header. The subdirectory is named with the first 2 characters of the SHA-1, and the filename is the remaining 0 码力 | 501 页 | 17.96 MB | 1 年前3Pro Git 2nd Edition 2.1.413
repos// /issues/ /comments with the token we just generated as an Authorization header. $ curl -H "Content-Type: application/json" \ -H "Authorization: token TOKEN" \ --data 40-character checksum hash. This is the SHA-1 hash — a checksum of the content you’re storing plus a header, which you’ll learn about in a bit. Now you can see how Git has stored your data: $ find .git/objects initially — as a single file per piece of content, named with the SHA-1 checksum of the content and its header. The subdirectory is named with the first 2 characters of the SHA-1, and the filename is the remaining 0 码力 | 691 页 | 13.35 MB | 1 年前3Pro Git 中文版 第2版 2.1.66
选项则指示该命令 从标准输入读取内容;若不指定此选项,则须在命令尾部给出待存储文件的路径。 此命令输出一个长度为 40 个字符的校验和。 这是一个 SHA-1 哈希值——一个将待存储的数据外加一个头部信息 (header)一起做 SHA-1 校验运算而得的校验和。后文会简要讨论该头部信息。 现在我们可以查看 Git 是如何 存储数据的: $ find .git/objects -type f .git/obj 首先会以识别出的对象的类型作为开头来构造一个头部信息,本例中是一个“blob”字符串。 接着 Git 会在 头部的第一部分添加一个空格,随后是数据内容的字节数,最后是一个空字节(null byte): 424 >> header = "blob #{content.length}\0" => "blob 16\u0000" Git 会将上述头部信息和原始数据拼接起来,并计算出这条新内容的 SHA-1 校验和。 在 Ruby 中可以这样计算 SHA-1 值——先通过 require 命令导入 SHA-1 digest 库, 然后对目标字符串调用 Digest::SHA1.hexdigest(): >> store = header + content => "blob 16\u0000what is up, doc?" >> require 'digest/sha1' => true >> sha1 = Digest::SHA10 码力 | 501 页 | 19.30 MB | 1 年前3Pro Git 中文版 第2版 2.1.66
选项则指示该命令从标准输入读 取内容;若不指定此选项,则须在命令尾部给出待存储文件的路径。 此命令输出一个长度为 40 个字符的校验和。 这是一个 SHA-1 哈希值——一 个将待存储的数据外加一个头部信息(header)一起做 SHA-1 校验运算而得 的校验和。后文会简要讨论该头部信息。 现在我们可以查看 Git 是如何存储数 据的: $ find .git/objects -type f .git/ 首先会以识别出的对象的类型作为开头来构造一个头部信息,本例中是一 个“blob”字符串。 接着 Git 会在头部的第一部分添加一个空格,随后是数据内 容的字节数,最后是一个空字节(null byte): >> header = "blob #{content.length}\0" => "blob 16\u0000" Git 会将上述头部信息和原始数据拼接起来,并计算出这条新内容的 SHA-1 校 验和。 在 中可以这样计算 SHA-1 值——先通过 require 命令导入 SHA-1 digest 库, 然后对目标字符串调用 Digest::SHA1.hexdigest(): >> store = header + content => "blob 16\u0000what is up, doc?" >> require 'digest/sha1' => true >> sha1 = Digest::SHA10 码力 | 670 页 | 13.59 MB | 1 年前3
共 6 条
- 1