Skip to content

Commit

Permalink
documentation: Add repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Mar 26, 2024
1 parent d301a93 commit 0127732
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 9 deletions.
31 changes: 30 additions & 1 deletion docs/installation/package-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
29 changes: 29 additions & 0 deletions docs/installation/package-manager.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions docs/installation/tools/rpm.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[serentry]
name=serentry
baseurl=https://rpm.sagernet.org/
enabled=1
gpgcheck=1
gpgkey=https://deb.sagernet.org/gpg.key

0 comments on commit 0127732

Please sign in to comment.