From 012773228349e565bf8b97efdd724ae7c89f2455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 26 Mar 2024 19:21:05 +0800 Subject: [PATCH] documentation: Add repo --- docs/installation/package-manager.md | 31 ++++++++++++++++++- docs/installation/package-manager.zh.md | 29 +++++++++++++++++ .../{scripts => tools}/arch-install.sh | 0 .../{scripts => tools}/deb-install.sh | 8 ++--- .../{scripts => tools}/rpm-install.sh | 8 ++--- docs/installation/tools/rpm.repo | 6 ++++ 6 files changed, 73 insertions(+), 9 deletions(-) rename docs/installation/{scripts => tools}/arch-install.sh (100%) rename docs/installation/{scripts => tools}/deb-install.sh (65%) rename docs/installation/{scripts => tools}/rpm-install.sh (65%) create mode 100644 docs/installation/tools/rpm.repo diff --git a/docs/installation/package-manager.md b/docs/installation/package-manager.md index 992fd44..c5e175a 100644 --- a/docs/installation/package-manager.md +++ b/docs/installation/package-manager.md @@ -4,12 +4,41 @@ icon: material/package # Package Manager +## :material-tram: Repository Installation + +=== ":material-debian: Debian / APT" + + ```bash + sudo curl -fsSL https://deb.sagernet.org/gpg.key -o /etc/apt/keyrings/sagernet.asc + sudo chmod a+r /etc/apt/keyrings/sagernet.asc + echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * *" | \ + sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null + sudo apt-get update + sudo apt-get install serenity + ``` + +=== ":material-redhat: Redhat / DNF" + + ```bash + sudo dnf -y install dnf-plugins-core + sudo dnf config-manager --add-repo https://sing-box.app/rpm.repo + sudo dnf install serenity + ``` + +=== ":material-redhat: CentOS / YUM" + + ```bash + sudo yum install -y yum-utils + sudo yum-config-manager --add-repo https://sing-box.app/rpm.repo + sudo yum install serenity + ``` + ## :material-download-box: Manual Installation === ":material-debian: Debian / DEB" ```bash - bash <(curl -fsSL https://sing-box.app/serenity/deb-install.sh) + bash <(curl -fsSL https://serenity.app/serenity/deb-install.sh) ``` === ":material-redhat: Redhat / RPM" diff --git a/docs/installation/package-manager.zh.md b/docs/installation/package-manager.zh.md index 736db6c..1ec79c4 100644 --- a/docs/installation/package-manager.zh.md +++ b/docs/installation/package-manager.zh.md @@ -4,6 +4,35 @@ icon: material/package # 包管理器 +## :material-tram: 仓库安装 + +=== ":material-debian: Debian / APT" + + ```bash + sudo curl -fsSL https://deb.sagernet.org/gpg.key -o /etc/apt/keyrings/sagernet.asc + sudo chmod a+r /etc/apt/keyrings/sagernet.asc + echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * *" | \ + sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null + sudo apt-get update + sudo apt-get install serenity + ``` + +=== ":material-redhat: Redhat / DNF" + + ```bash + sudo dnf -y install dnf-plugins-core + sudo dnf config-manager --add-repo https://sing-box.app/rpm.repo + sudo dnf install serenity + ``` + +=== ":material-redhat: CentOS / YUM" + + ```bash + sudo yum install -y yum-utils + sudo yum-config-manager --add-repo https://sing-box.app/rpm.repo + sudo yum install serenity + ``` + ## :material-download-box: 手动安装 === ":material-debian: Debian / DEB" diff --git a/docs/installation/scripts/arch-install.sh b/docs/installation/tools/arch-install.sh similarity index 100% rename from docs/installation/scripts/arch-install.sh rename to docs/installation/tools/arch-install.sh diff --git a/docs/installation/scripts/deb-install.sh b/docs/installation/tools/deb-install.sh similarity index 65% rename from docs/installation/scripts/deb-install.sh rename to docs/installation/tools/deb-install.sh index 60eadcc..f4933a5 100644 --- a/docs/installation/scripts/deb-install.sh +++ b/docs/installation/tools/deb-install.sh @@ -12,12 +12,12 @@ case "${ARCH_RAW}" in *) echo "Unsupported architecture: ${ARCH_RAW}"; exit 1;; esac -VERSION=$(curl -s https://api.github.com/repos/SagerNet/serenity/releases/latest \ +VERSION=$(curl -s https://api.github.com/repos/SagerNet/serentry/releases/latest \ | grep tag_name \ | cut -d ":" -f2 \ | sed 's/\"//g;s/\,//g;s/\ //g;s/v//') -curl -Lo serenity.deb "https://github.com/SagerNet/serenity/releases/download/v${VERSION}/serenity_${VERSION}_linux_${ARCH}.deb" -sudo dpkg -i serenity.deb -rm serenity.deb +curl -Lo serentry.deb "https://github.com/SagerNet/serentry/releases/download/v${VERSION}/serentry_${VERSION}_linux_${ARCH}.deb" +sudo dpkg -i serentry.deb +rm serentry.deb diff --git a/docs/installation/scripts/rpm-install.sh b/docs/installation/tools/rpm-install.sh similarity index 65% rename from docs/installation/scripts/rpm-install.sh rename to docs/installation/tools/rpm-install.sh index a08c0f0..4767c2c 100644 --- a/docs/installation/scripts/rpm-install.sh +++ b/docs/installation/tools/rpm-install.sh @@ -12,11 +12,11 @@ case "${ARCH_RAW}" in *) echo "Unsupported architecture: ${ARCH_RAW}"; exit 1;; esac -VERSION=$(curl -s https://api.github.com/repos/SagerNet/serenity/releases/latest \ +VERSION=$(curl -s https://api.github.com/repos/SagerNet/serentry/releases/latest \ | grep tag_name \ | cut -d ":" -f2 \ | sed 's/\"//g;s/\,//g;s/\ //g;s/v//') -curl -Lo serenity.rpm "https://github.com/SagerNet/serenity/releases/download/v${VERSION}/serenity_${VERSION}_linux_${ARCH}.rpm" -sudo rpm -i serenity.rpm -rm serenity.rpm +curl -Lo serentry.rpm "https://github.com/SagerNet/serentry/releases/download/v${VERSION}/serentry_${VERSION}_linux_${ARCH}.rpm" +sudo rpm -i serentry.rpm +rm serentry.rpm diff --git a/docs/installation/tools/rpm.repo b/docs/installation/tools/rpm.repo new file mode 100644 index 0000000..20cbb11 --- /dev/null +++ b/docs/installation/tools/rpm.repo @@ -0,0 +1,6 @@ +[serentry] +name=serentry +baseurl=https://rpm.sagernet.org/ +enabled=1 +gpgcheck=1 +gpgkey=https://deb.sagernet.org/gpg.key