Skip to content

Commit

Permalink
Merge pull request #22 from devome/main
Browse files Browse the repository at this point in the history
Add Arch Linux installation.
  • Loading branch information
llaoj authored Oct 24, 2024
2 parents c0cda1f + aa4b295 commit 30f1037
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ Safari on iOS
## More

- [Deploy by Docker](/docs/deploy-by-docker.md)
- [Deploy from source code](./docs/deploy-from-source.md)
- [Deploy from source code](/docs/deploy-from-source.md)
- [Install from AUR on Arch Linux](/docs/deploy-from-aur.md)
52 changes: 52 additions & 0 deletions docs/deploy-from-aur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# Install from AUR on Arch Linux

The AUR package maintained by [@devome](https://github.com/devome) uses the stable version of GCopy for building.

## Installation

Since the GCopy frontend and backend can be installed separately, the AUR package splits them into two packages: the backend [gcopy](https://aur.archlinux.org/packages/gcopy) and the frontend [gcopy-web](https://aur.archlinux.org/packages/gcopy-web). You can install them on different hosts, or you can install them on the same host.

```shell
## Install the backend, you can also use yay to install
paru -Sy gcopy

## Install the frontend, you can also use yay to install
paru -Sy gcopy-web
```

## Configuration

### Backend

For the backend, the configuration file is located at `/etc/gcopy/gcopy.env`. Edit it according to the comments, for example:

```shell
APPEND_ARGS="-app-key='rqMrHprILwYintES4UeQc0wM/252SLy59y7LMYKXJE0=' -smtp-host='smtp.example.com' -smtp-password='your_password' -smtp-username='username@example.com'"
```

For the `app-key`, you can generate a random string using the following command:

```shell
openssl rand -base64 32
```

### Frontend

For the frontend, the configuration file is located at `/etc/gcopy/gcopy-web.env`. Edit it according to the comments. If the backend and frontend are on different hosts, be sure to modify the `SERVER_URL`.

## Starting

After configuration, you can start the services:

```shell
## Start the backend
sudo systemctl enable --now gcopy.service

## Start the frontend
sudo systemctl enable --now gcopy-web.service
```

## Reverse Proxy

In production mode, it is recommended to deploy behind a reverse proxy, such as Nginx or Apisix. This makes it easier to manage certificates and configure the proxy. You will need to prepare a domain name and the corresponding certificate. For Nginx, refer to `/usr/share/gcopy-web/nginx-example.conf`.
3 changes: 2 additions & 1 deletion docs/zh-CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,5 @@ Safari on iOS
## 更多

- [使用Docker部署](./deploy-by-docker.md)
- [使用源代码部署](./deploy-from-source.md)
- [使用源代码部署](./deploy-from-source.md)
- [ArchLinux从AUR安装](./deploy-from-aur.md)
51 changes: 51 additions & 0 deletions docs/zh-CN/deploy-from-aur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Arch Linux 从 AUR 安装

[@devome](https://github.com/devome) 维护的 AUR 包使用稳定版 GCopy 来进行构建。

## 安装

由于GCopy前端和后端可以分离安装,所以 AUR 包将其分为了两个包:后端 [gcopy](https://aur.archlinux.org/packages/gcopy),前端 [gcopy-web](https://aur.archlinux.org/packages/gcopy-web)。你可以在不同的主机上安装他们,也可以在同一个主机上安装它们。

```shell
## 安装后端,你也可以更换成yay来安装
paru -Sy gcopy

## 安装前端,你也可以更换成yay来安装
paru -Sy gcopy-web
```

## 配置

### 后端

对于后端,配置文件为 `/etc/gcopy/gcopy.env`,按照其注释编辑即可,比如:

```shell
APPEND_ARGS="-app-key='rqMrHprILwYintES4UeQc0wM/252SLy59y7LMYKXJE0=' -smtp-host='smtp.example.com' -smtp-password='your_password' -smtp-username='username@example.com'"
```

对于`app-key`,你可以使用以下命令来生成一个随机字符串:

```shell
openssl rand -base64 32
```

### 前端

对于前端,配置文件为 `/etc/gcopy/gcopy-web.env`,按照其注释编辑即可,如果后端和前端在不同主机上,请注意修改`SERVER_URL`

## 启动

配置好以后,启动即可:

```shell
## 启动后端
sudo systemctl enable --now gcopy.service

## 启动前端
sudo systemctl enable --now gcopy-web.service
```

## 反向代理

在生产模式, 推荐部署在反向代理的后面, 例如 Nginx、Apisix等. 这样您就可以方便的管理证书和配置代理, 你需要准备好域名和对应的证书。以nginx为例, 参考`/usr/share/gcopy-web/nginx-example.conf`

0 comments on commit 30f1037

Please sign in to comment.