Skip to content

Commit

Permalink
docs: refine deployment documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed Sep 18, 2024
1 parent 6b0e46c commit bd121f8
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 142 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Artalk is an intuitive yet feature-rich comment system, ready for immediate depl

## Installation

Deploy with Docker in one step:
Deploy Artalk Server with Docker in one step:

```bash
docker run -d \
Expand All @@ -79,7 +79,7 @@ docker run -d \
artalk/artalk-go
```

Integrate Artalk into your webpage:
Integrate Artalk Client into your webpage:

<!-- prettier-ignore-start -->

Expand All @@ -94,6 +94,8 @@ Artalk.init({

<!-- prettier-ignore-end -->

We offer various installation methods, including binary files, go install, and package managers for Linux distributions.

[**Learn More →**](https://artalk.js.org/en/guide/deploy.html)

## For Developers
Expand Down
26 changes: 14 additions & 12 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Artalk 是一款简单易用但功能丰富的评论系统,你可以开箱即

## 安装

通过 Docker 一键部署:
通过 Docker 一键部署 Artalk 服务器

```bash
docker run -d \
Expand All @@ -79,7 +79,7 @@ docker run -d \
artalk/artalk-go
```

在网页中引入 Artalk:
在你的网页中引入 Artalk 客户端:

<!-- prettier-ignore-start -->

Expand All @@ -94,37 +94,39 @@ Artalk.init({

<!-- prettier-ignore-end -->

我们提供多种安装方法,包括二进制文件、`go install` 和通过 Linux 发行版的包管理器安装。

[**了解更多 →**](https://artalk.js.org/zh/guide/deploy.html)

## For Developers
## 参与开发

Pull requests are welcome!
我们欢迎你的 Pull Request!

See [Development](https://artalk.js.org/zh/develop/) and [Contributing](./CONTRIBUTING.md) for information on working with the codebase, getting a local development setup, and contributing changes.
有关如何使用代码库、设置本地开发环境和贡献更改的信息,请参阅 [开发文档](https://artalk.js.org/zh/develop/) [贡献指南](./CONTRIBUTING.md)

## Contributors
## 贡献者们

Your contributions enrich the open-source community, fostering learning, inspiration, and innovation. We deeply value your involvement. Thank you for being a vital part of our community! 🥰
你的贡献丰富了开源社区,促进了学习、灵感和创新。我们非常重视你的参与。感谢你成为我们社区的重要一员!🥰

[![](https://contrib.rocks/image?repo=ArtalkJS/Artalk)](https://github.com/ArtalkJS/Artalk/graphs/contributors)

## Supporters
## 支持者们

[![Stargazers repo roster for @ArtalkJS/Artalk](https://reporoster.com/stars/ArtalkJS/Artalk)](https://github.com/ArtalkJS/Artalk/stargazers)

## Repobeats Analytics
## Repobeats 分析

![Alt](https://repobeats.axiom.co/api/embed/a9fc9191ac561bc5a8ee2cddc81e635ecaebafb6.svg 'Repobeats analytics image')

## Stargazers over time
## Star 趋势

<a href="https://trendshift.io/repositories/6290" target="_blank"><img src="https://trendshift.io/api/badge/repositories/6290" alt="ArtalkJS%2FArtalk | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>

[![Stargazers over time](https://starchart.cc/ArtalkJS/Artalk.svg)](https://starchart.cc/ArtalkJS/Artalk)

## License
## 开源许可协议

[MIT](./LICENSE)
[MIT](./LICENSE) (麻省理工学院许可证)

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FArtalkJS%2FArtalk.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FArtalkJS%2FArtalk?ref=badge_shield)

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/.vitepress/config/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const en = defineConfig({
text: 'Quick Start',
collapsed: false,
items: [
{ text: 'Project Introduction', link: '/en/guide/intro.md' },
{ text: 'Program Deployment', link: '/en/guide/deploy.md' },
{ text: 'Introduction', link: '/en/guide/intro.md' },
{ text: 'Getting Started', link: '/en/guide/deploy.md' },
{ text: 'Data Migration', link: '/en/guide/transfer.md' },
],
},
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/en/guide/backend/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ docker exec -it artalk bash

## Multi-Platform Compatibility

The Docker image currently only provides builds for x86 and arm64 architectures. For more platform architectures, please download the binary build and deploy it using the [Ordinary Deployment](../deploy.md#普通方式部署) method.
The Docker image currently only provides builds for x86 and arm64 architectures. For more platform architectures, please download the binary build and deploy it using the [Binary Deployment](../deploy.md#binary) method.
164 changes: 94 additions & 70 deletions docs/docs/en/guide/deploy.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# 📦 Program Deployment
# 📦 Getting Started

## Docker Deployment
This guide will help you deploy Artalk on your server. Once deployed, you can integrate the Artalk client into your website or blog to enable comment functionality.

It is recommended to deploy using Docker. Pre-install the [Docker Engine](https://docs.docker.com/engine/install/) and execute the command to create the container:
## Docker

Here is a simple guide for deploying the Artalk **Server** and **Client**.

### Launch Server

It is recommended to use Docker for deployment. Pre-install the [Docker Engine](https://docs.docker.com/engine/install/) and create a working directory, then run the command to launch a container in the background:

```bash
docker run -d \
Expand All @@ -16,17 +22,19 @@ docker run -d \
artalk/artalk-go
```

Execute the command to create an admin account:
(Tip: We also provide a [Docker Compose](#docker-compose) configuration file).

Run the command to create an admin account:

```bash
docker exec -it artalk artalk admin
```

Enter `http://artalk.example.com:8080` in your browser to access the Artalk admin login interface.
Enter `http://artalk.example.com:8080` in your browser to access the Artalk Dashboard.

Incorporate the embedded front-end JS and CSS resources of the Artalk program into the webpage and initialize Artalk:
### Integrate Client

<!-- prettier-ignore-start -->
Import the embedded client JS and CSS resources from the Artalk server to your webpage and initialize the Artalk client:

```html
<!-- CSS -->
Expand All @@ -42,25 +50,24 @@ Artalk.init({
el: '#Comments', // Selector of the bound element
pageKey: '/post/1', // Permalink
pageTitle: 'About Introducing Artalk', // Page title (leave blank to auto-fetch)
server: 'http://artalk.example.com:8080', // Backend address
site: 'Artalk Blog', // Your site name
server: 'http://artalk.example.com:8080', // Artalk server address
site: 'Artalk Blog', // Your site name
})
</script>
```
<!-- prettier-ignore-end -->

Enter the admin username and email in the comment box, and the "Console" button will appear at the bottom right of the comment box.
Enter the admin username and email in the comment box, and the "Dashboard" button will appear at the bottom right of the comment box.

In the console, you can [configure the comment system](./backend/config.md) according to your preferences or [migrate comments to Artalk](./transfer.md).
In the Dashboard, you can [configure the comment system](./backend/config.md) to your liking or [migrate comments to Artalk](./transfer.md).

🥳 You have successfully completed the Artalk deployment!
🥳 You have successfully deployed Artalk!

## Standard Deployment
## Binary

1. Download the program package from [GitHub Release](https://github.com/ArtalkJS/Artalk/releases)
2. Extract it with `tar -zxvf artalk_version_system_architecture.tar.gz`
3. Run `./artalk server`
4. Configure
4. Configure and initialize the client on your webpage:

```js
Artalk.init({ server: 'http://artalk.example.com:23366' })
Expand All @@ -72,9 +79,47 @@ Advanced operations:
- [Reverse Proxy (Caddy, Nginx, Apache)](./backend/reverse-proxy.md)
- [Self-compile (Build from the latest code)](https://github.com/ArtalkJS/Artalk/blob/master/CONTRIBUTING.md)

## Compose Deployment
## Go Module

If you have the Golang toolchain installed, you can run the following commands to compile and install the latest version of Artalk:

```bash
go install github.com/artalkjs/artalk/v2@latest
```

Then run the server:

```bash
artalk server
```

The client integration steps are [here](#integrate-client).

## Linux Distributions

**Arch Linux (AUR)**:

```bash
paru -S artalk
```

**NixOS**:

```bash
nix-env -iA nixpkgs.artalk
```

**Termux**:

```bash
pkg install artalk
```

[![Packaging status](https://repology.org/badge/vertical-allrepos/artalk.svg)](https://repology.org/project/artalk/versions)

**compose.yaml**
## Docker Compose

Create a working directory and edit the `docker-compose.yml` file:

```yaml
version: '3.8'
Expand All @@ -94,12 +139,14 @@ services:
- ATK_SITE_URL=https://your_domain
```

Create the container:
Start the container to launch Artalk server:

```bash
docker-compose up -d
```

The client integration steps are [here](#integrate-client).

::: details Common Compose Commands

```bash
Expand All @@ -112,40 +159,48 @@ docker-compose exec artalk bash # Enter the container

:::

Refer to the documentation: [Docker](./backend/docker.md) / [Environment Variables](./env.md)
More information: [Docker](./backend/docker.md) / [Environment Variables](./env.md)

## Linux Distributions
## Client Projects (Node.js)

**Arch Linux (AUR)**:
Install Artalk via npm:

```bash
paru -S artalk
npm install artalk
```

**NixOS**:

```bash
nix-env -iA nixpkgs.artalk
```
Import Artalk in your web project:

**Termux**:
```js
import 'artalk/dist/Artalk.css'
import Artalk from 'artalk'
```bash
pkg install artalk
const artalk = Artalk.init({
el: '#Comments', // Selector of the bound element
pageKey: '/post/1', // Permalink
pageTitle: 'About Introducing Artalk', // Page title (leave blank to auto-fetch)
server: 'http://artalk.example.com:8080', // Artalk server address
site: 'Artalk Blog', // Your site name
})
```

[![Packaging status](https://repology.org/badge/vertical-allrepos/artalk.svg)](https://repology.org/project/artalk/versions)
For more references:

## CDN Resources
- [Import to Blog Documentation](../develop/import-blog.md)
- [Import to Frameworks Documentation](../develop/import-framework.md)
- [Client API Reference](../develop/fe-api.md)
- [Client Configuration](./frontend/config.md)

## Client CDN Resources

::: tip Latest Version of Artalk

The current latest version number of the Artalk front-end is: **:ArtalkVersion:**
The current latest version number of the Artalk client is: **:ArtalkVersion:**

To upgrade the front-end, simply replace the numeric part of the version number in the URL.
To upgrade the client, replace the numeric part of the version number in the URL.
:::

The back-end program of Artalk integrates front-end JS and CSS files. Please pay attention to version compatibility when using public CDN resources.
The Artalk server had embedded the client resources. Ensure version compatibility when using public CDN resources.

**CDNJS**

Expand All @@ -154,11 +209,6 @@ The back-end program of Artalk integrates front-end JS and CSS files. Please pay
> <https://cdnjs.cloudflare.com/ajax/libs/artalk/:ArtalkVersion:/Artalk.css>

::: details View More
**SUSTech Mirrors (Domestic)**

> <https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/artalk/:ArtalkVersion:/Artalk.js>
>
> <https://mirrors.sustech.edu.cn/cdnjs/ajax/libs/artalk/:ArtalkVersion:/Artalk.css>

**UNPKG**

Expand All @@ -174,40 +224,14 @@ The back-end program of Artalk integrates front-end JS and CSS files. Please pay

:::

## Node Projects

Install Artalk:

```bash
npm install artalk
```

Import Artalk:

```js
import 'artalk/dist/Artalk.css'
import Artalk from 'artalk'
Artalk.init({
// ...
})
```

For more references:

- [Embedding in Blog Documentation](../develop/import-blog.md)
- [Embedding in Framework Documentation](../develop/import-framework.md)
- [Front-end Configuration](./frontend/config.md)
- [Front-end API](../develop/fe-api.md)

## Data Import
## Data Migration

Import data from other comment systems: [Data Migration](./transfer.md)
Import data from other comment systems: [Data Migration](./transfer.md).

## ArtalkLite

Consider the lightweight version [ArtalkLite](./frontend/artalk-lite.md): smaller and more streamlined.
ArtalkLite is a lightweight version of the Artalk client. See: [ArtalkLite](./frontend/artalk-lite.md).

## Development Environment

Refer to: [Developer Guide](https://github.com/ArtalkJS/Artalk/blob/master/CONTRIBUTING.md)
Please refer to: [Developer Guide](https://github.com/ArtalkJS/Artalk/blob/master/CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion docs/docs/zh/guide/backend/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ docker exec -it artalk bash

## 多平台兼容性

Docker 镜像暂仅提供 x86、arm64 的镜像构建,如需更多平台架构版本,请下载 [二进制构建部署](../deploy.md#普通方式部署)
Docker 镜像暂仅提供 x86、arm64 的镜像构建,如需更多平台架构版本,请下载 [二进制构建部署](../deploy.md#二进制文件)
Loading

0 comments on commit bd121f8

Please sign in to comment.