Skip to content

Commit a7391f5

Browse files
committed
doc(README): add examples
1 parent 8cd7b56 commit a7391f5

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ Start server on port 8080, root directory is /usr/share/doc:
3535
ghfs -l 8080 -r /usr/share/doc
3636
```
3737

38-
Start server on default port, root directory is /tmp, and allow upload files to file system directory /tmp/data:
38+
Start server on default port, root directory is /var/tmp, and allow upload files into ./data:
3939
```sh
40-
ghfs -r /tmp -u /data
40+
ghfs -r /var/tmp -u /data
41+
# or
42+
ghfs -r /var/tmp --upload-dir /var/tmp/data
4143
```
4244

4345
Share files from /etc, but also mount /usr/share/doc to url path /doc
@@ -69,6 +71,11 @@ Http Basic Auth:
6971
ghfs --auth /files --user user1:pass1 --user-sha1 user2:8be52126a6fde450a7162a3651d589bb51e9579d
7072
```
7173

74+
Share /data, grant upload permission on /data/upload to user "admin" and "root", others are read only:
75+
```sh
76+
ghfs -r /data --user admin:adminpass root:rootpass user1:user1pass user2:user2pass --upload-user :/upload:admin:root
77+
```
78+
7279
Start 2 virtual hosts:
7380
- server 1
7481
- listen on port 80 for http

README.zh-CN.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ ghfs -l 8080
3535
ghfs -l 8080 -r /usr/share/doc
3636
```
3737

38-
在默认端口启动服务器,根目录为/tmp,并允许上传文件到/tmp/data:
38+
在默认端口启动服务器,根目录为/var/tmp,并允许上传文件到./data:
3939
```sh
40-
ghfs -r /tmp -u /data
40+
ghfs -r /var/tmp -u /data
41+
#
42+
ghfs -r /var/tmp --upload-dir /var/tmp/data
4143
```
4244

4345
共享/etc下的文件,同时把/usr/share/doc挂载到URL路径/doc下:
@@ -68,6 +70,11 @@ http基本验证:
6870
ghfs --auth /files --user user1:pass1 --user-sha1 user2:8be52126a6fde450a7162a3651d589bb51e9579d
6971
```
7072

73+
共享/data,授予用户“admin”和“root”在/data/upload的上传权限,其他用户只读:
74+
```sh
75+
ghfs -r /data --user admin:adminpass root:rootpass user1:user1pass user2:user2pass --upload-user :/upload:admin:root
76+
```
77+
7178
启动2台虚拟主机:
7279
- 服务器1
7380
- 在80端口提供http服务

0 commit comments

Comments
 (0)