Skip to content

Commit

Permalink
doc: append run server in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
icyleaf committed Apr 28, 2018
1 parent b3ac190 commit 55bd724
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 4 deletions.
5 changes: 2 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# API 接口

hpr 运行后会提供 Web API 接口,端口号 `8848`
hpr 运行后会提供 Web API 接口,默认端口 `8848`

## 认证

接口请求目前仅支持 Basic Auth,通过配置文件 `config/hpr.json` 进行配置,详情参见[配置文件](configuration?id=basic_auth-接口认证)说明。
接口请求目前仅支持 Basic Auth,通过配置文件 `config/hpr.json` 进行配置是否开启(默认关闭),详情参见[配置文件](configuration?id=basic_auth-接口认证)说明。

```bash
$ curl -u user@password http://hpr-ip:8848/info
Expand Down Expand Up @@ -55,7 +55,6 @@ GET /repositores
}
```


### 单个镜像仓库信息

```
Expand Down
15 changes: 15 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

hpr 本身是一个命令行工具,因此也提供了一个临时可用的辅助命令来管理镜像仓库。

## 运行 Web API 服务器

```bash
$ hpr -s
# 或者更改端口号
$ hpr -s --port 8848
_
| |__ _ __ _ __
| '_ \| '_ \| '__|
| | | | |_) | |
|_| |_| .__/|_|
|_|
2018-04-28 10:06:42 +08:00 INFO API Server now listening at localhost:8848, press Ctrl-C to stop
```
## 显示已镜像的仓库列表
```bash
Expand Down
2 changes: 1 addition & 1 deletion docs/en/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hpr support a web api service (port `8848`) by default.

## Authentication

Only support Basic Auth for now. Configure from `config/hpr.json` file,View detail in [Configuration](/en/configuration?id=basic_auth-接口认证).
Only support Basic Auth for now. Configure to enable or not from `config/hpr.json` file,View detail in [Configuration](/en/configuration?id=basic_auth).

```bash
$ curl -u user@password http://hpr-ip:8848/info
Expand Down
15 changes: 15 additions & 0 deletions docs/en/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

hpr is a command line tool, it also support some commands to manage mirror repositories temporary.

## Run Web API server

```bash
$ hpr -s
# Or customize server port
$ hpr -s --port 8848
_
| |__ _ __ _ __
| '_ \| '_ \| '__|
| | | | |_) | |
|_| |_| .__/|_|
|_|
2018-04-28 10:06:42 +08:00 INFO API Server now listening at localhost:8848, press Ctrl-C to stop
```
## List repositories
```bash
Expand Down
2 changes: 2 additions & 0 deletions docs/en/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Here has 4 places to change your own.
- `group_name`: all mirrored project will be in this group, **MAKE SUER YOU ACCOUNT HAS CREATE GROUP ROLE** (ignore if has admin role)
- `ssh_port`: change it if you use custom ssh port

> About more params check [Configuration](configuration?id=basic_auth-接口认证) page.
Then set some optional `ENV` variables if you need in `docker-compose.yml`:

```yaml
Expand Down
2 changes: 2 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ $ mv hpr.json.example.yml config/hpr.json
- `group_name`: 项目镜像的项目都会归属到这个组内,**务必确保你的账户拥有创建组的权限** (如果是管理员请忽略加粗字样)
- `ssh_port`: 如果 SSH 不是 22 端口的话需要根据你的实际情况修改

> 更多参数详情参见[配置文件](configuration?id=basic_auth-接口认证)
配置文件修改保存后还需要在 `docker-compose.yml` 文件中配置下:

```yaml
Expand Down

0 comments on commit 55bd724

Please sign in to comment.