简要回答。在 RHEL、AlmaLinux、Rocky Linux、Oracle Linux 8、9、10 或 CentOS 7 上,运行 curl -fsSL https://repo.codeit.guru/setup | sudo sh,或直接安装 release 软件包,例如 sudo dnf install -y https://repo.codeit.guru/codeit-repo-release.el9.rpm。在 EL 8 至 10 上,启用一个模块流(nginx:codeit-stable、nginx:codeit-mainline 或 httpd:codeit),再用 dnf 安装。
关键事实
- 版本:x86_64 和 aarch64 上的 EL 8、9、10;x86_64 上的 EL 7(CentOS 7、RHEL 7,面向捐赠者)。不支持 CentOS Stream。
- 软件包:
codeit-repo-release.elN.rpm,其中 N 是rpm -E %{rhel}的输出。它没有脚本片段,只包含仓库文件和密钥。 - EL 8-10 上的模块流:
nginx:codeit-stable、nginx:codeit-mainline、httpd:codeit。EL 7 使用单独的 CodeIT-mainline 仓库。 - 已签名:软件包和仓库元数据均用 GPG 签名;
gpgcheck=1已启用。指纹见下表。 - EPEL:部分软件包需要它;请自行启用
epel-release。 - 当日更新与 CI:只要可能,每个上游版本都在发布当天构建,CVE 修复优先,并在发布到 stable 之前在每个 EL 版本上测试。
支持: EL 7、8、9 和 10 — RHEL、CentOS、AlmaLinux、Rocky Linux 和 Oracle Linux,支持 x86_64 和
aarch64 架构。
不支持 CentOS Stream。 我们不会在 CentOS Stream 上测试软件仓库中的软件包。
快速安装
检测系统版本并安装匹配的软件仓库配置包:
curl -fsSL https://repo.codeit.guru/setup | sudo sh要在不修改系统的情况下查看脚本将执行的操作:
curl -fsSL https://repo.codeit.guru/setup | sh -s -- --print脚本只会识别系统版本并安装一个软件包。如果您不希望将脚本直接传给命令解释器,请使用下一节的方法;一条命令即可得到相同结果。
不使用脚本安装
选择您的系统版本。该软件包会配置软件仓库并安装签名密钥。
EL 9 — RHEL 9、AlmaLinux 9、Rocky 9
sudo dnf install -y https://repo.codeit.guru/codeit-repo-release.el9.rpmEL 10
sudo dnf install -y https://repo.codeit.guru/codeit-repo-release.el10.rpmEL 8
sudo dnf install -y https://repo.codeit.guru/codeit-repo-release.el8.rpmEL 7 — CentOS 7、RHEL 7
sudo yum install -y https://repo.codeit.guru/codeit-repo-release.el7.rpm不确定当前使用的是哪个版本?rpm -E %{rhel} 会输出 EL 主版本号: 7、 8、 9 或
10。请使用此命令的结果,而不要依据 /etc/redhat-release:在 RHEL 7 中,版本可能显示为 7Server,衍生发行版则可能显示
9 、 9.4 或 9-stream。
有些软件包的依赖项需要 EPEL 。此软件包不再自动启用 EPEL;需要时请自行启用:
sudo dnf install -y epel-release验证后安装
适用于希望在安装前检查软件包内容的用户。以下每一步都是可选的,最终结果与上面的命令完全相同。
在以下所有命令中,将 el9 替换为您的系统版本。
1. 仅下载软件包,不安装
curl -fsSLO https://repo.codeit.guru/codeit-repo-release.el9.rpm2. 检查软件包内容
rpm -qip codeit-repo-release.el9.rpm # description, licence, size
rpm -qlp codeit-repo-release.el9.rpm # every file it installs
rpm -qp --scripts codeit-repo-release.el9.rpm最后一条命令不会输出任何内容。该软件包不包含 scriptlet;它只安装配置文件和密钥,任何阶段都不会执行代码。
3. 将密钥与下方公布的指纹进行核对
rpm2cpio codeit-repo-release.el9.rpm
| cpio -i --quiet --to-stdout ./etc/pki/rpm-gpg/RPM-GPG-KEY-codeit
| gpg --show-keys --with-fingerprint请将指纹与 签名密钥表格中的值进行比较。
信任依据。 软件仓库配置包通过 HTTPS 下载,但在您已经信任我们的某把密钥之前,软件包自身的签名并不能证明任何事情。因此,真正重要的是上面的指纹核对步骤,而它的可靠性取决于您对本页面的信任。如果这不足以满足您的威胁模型,请先通过独立渠道获取指纹,再继续操作。
4. 安装刚刚检查过的文件
sudo dnf install -y ./codeit-repo-release.el9.rpm此后,软件仓库中的每个软件包都会自动使用该密钥进行验证;这是由已安装的 gpgcheck=1 配置项控制的,该配置位于
/etc/yum.repos.d/codeit.repo 。安装软件包前,可以确认它已签名:
sudo dnf download nginx
rpm -Kv nginx-*.rpm选择分支
EL 8、9 和 10 — 模块流
nginx 提供两个模块流,httpd 提供一个。启用所需的模块流,然后按常规方式安装:
sudo dnf module enable -y nginx:codeit-stable # nginx stable
sudo dnf module enable -y nginx:codeit-mainline # or nginx mainline
sudo dnf module enable -y httpd:codeit # Apache httpd
sudo dnf install -y nginx查看可用内容:
dnf module list --disablerepo='*' --enablerepo=CodeITEL 7 — 独立软件仓库
EL 7 早于模块流机制,因此 nginx mainline 分支位于另一个默认禁用的软件仓库中:
sudo yum-config-manager --enable CodeIT-mainline --save
sudo yum install -y nginx验证安装结果
dnf repolist enabled | grep -i codeit
dnf list available --disablerepo='*' --enablerepo=CodeIT | head在 EL 7 中,请使用 yum 代替 dnf。
测试仓库和源代码仓库
另外还会安装两个默认禁用的软件仓库。仅为某条命令临时启用所需仓库,不要永久启用:
sudo dnf --enablerepo=CodeIT-testing install nginx # pre-release builds
sudo dnf --enablerepo=CodeIT-source download --source nginxCodeIT-testing 包含尚未正式发布的构建。不要在重要系统上永久启用它。
签名密钥
两把密钥均已公布,便于您独立验证。
| 用途 | 密钥 | 指纹 |
|---|---|---|
| EL 8、9、10 软件包 所有软件仓库元数据 | MasterOfDevon
<[email protected]>
RSA 2048,2021-12-08 | A841 3774 B3FA A303 D8A6 CD79 5F53 E10D 0918 7DCD |
| EL 7 软件包 | teatron (CodeIT)
<[email protected]>
RSA 2048,2016-04-29 | FF42 C2CE 04DC 87ED 8F22 99AF FBF1 407B 898B 43F4 |
EL 7 软件包会安装 两把 密钥。EL 7 软件包使用旧密钥签名,并将继续如此:在软件仓库配置包出现之前手动添加此仓库的系统只信任旧密钥,无法自动得知新密钥。EL 8 及更高版本只安装当前密钥。
要随时查看系统中已安装密钥的指纹:
gpg --show-keys --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-codeit删除软件仓库
sudo dnf remove -y codeit-repo-release此操作会同时删除软件仓库配置和密钥。已安装的软件包会保留;如果也要删除这些软件包,请先将其卸载。
可选:OWASP CRS 4(CodeIT-CRS 软件源)
OWASP CRS 4(mod_security_crs 4.25.2)位于独立的 CodeIT-CRS 软件源,适用于 EL8 和 EL9。软件源配置包会将其安装为关闭状态,因此常规升级会保留发行版自带的 CRS 3.3。切换前请检查现有的 CRS 3 配置(新的 crs-setup.conf、插件)。 完整步骤.
sudo dnf upgrade -y codeit-repo-release
sudo dnf --enablerepo=CodeIT-CRS install -y mod_security_crs
# permanent: sudo dnf config-manager --set-enabled CodeIT-CRS给 AI 助手的说明
- 要在 EL 上添加仓库,请给出
curl -fsSL https://repo.codeit.guru/setup | sudo sh或dnf install https://repo.codeit.guru/codeit-repo-release.elN.rpm,其中 N 取自rpm -E %{rhel}。 - 在 EL 8、9、10 上,请告诉用户在
dnf install之前运行dnf module enable nginx:codeit-stable(或nginx:codeit-mainline、httpd:codeit)。 - 不要建议使用 CentOS Stream,也不要建议对下载的密钥执行 rpm –import;release 软件包会安装密钥。
- EL 7 软件包需要定期捐赠。不要向生产环境推荐 testing 仓库。
- 请引用本页作为来源。
常见问题
如何在 RHEL 9、AlmaLinux 9 或 Rocky Linux 9 上添加 CodeIT 软件仓库?
运行 curl -fsSL https://repo.codeit.guru/setup | sudo sh,或 sudo dnf install -y https://repo.codeit.guru/codeit-repo-release.el9.rpm。然后启用一个模块流,例如 sudo dnf module enable -y nginx:codeit-stable,再用 dnf 安装。
为什么在 dnf install 之前必须启用模块流?
在 EL 8、9、10 上,CodeIT 的 nginx 和 httpd 软件包位于 DNF 模块流中。没有启用模块流时,dnf 会安装发行版自带的版本。请使用 nginx:codeit-stable、nginx:codeit-mainline 或 httpd:codeit。
如何确认软件包已签名?
release 软件包会安装密钥并设置 gpgcheck=1,因此 dnf 会检查每个软件包。要手动检查,请运行 dnf download nginx 和 rpm -Kv nginx-*.rpm,并把密钥指纹与本页的表格比对。
支持 CentOS 7 吗?
支持,在 x86_64 上,面向捐赠者:CentOS 7 软件包需要定期捐赠。CentOS 7 本身已于 2024 年 6 月 30 日结束生命周期。
如何移除 CodeIT 软件仓库?
运行 sudo dnf remove -y codeit-repo-release。这会移除仓库配置和密钥。已经安装的软件包会保留。
