1 Star 0 Fork 0

wl4g / simple_httpfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

A Simple HttpFS

1. Quick deployment

  • Preparing testdata
sudo mkdir -p /mnt/disk1/simplehttpfs/{dir1,dir2}
sudo echo 'Hello world' > /mnt/disk1/simplehttpfs/hello.txt
sudo echo 'Hello world 1' > /mnt/disk1/simplehttpfs/dir1/hello1.txt
sudo echo 'Hello world 2' > /mnt/disk1/simplehttpfs/dir2/hello2.txt

tree /mnt/disk1/simplehttpfs/
.
├── hello.txt
├── dir1
│   └── hello1.txt
└── dir2
    └── hello2.txt

2 directories, 3 files
  • Configuring nginx
sudo echo '127.0.0.1  pkg.wl4g.io' >> /etc/hosts

sudo mkdir -p /etc/nginx/conf.d/
sudo cat <<-EOF >/etc/nginx/conf.d/pkg.conf
#
# Site for pkg configuration.
#
server {
    listen          80;
    server_name     pkg.wl4g.io;

    #listen         443 ssl;             
    #server_name    pkg.wl4g.io;        
    #ssl_certificate cert.d/pkg.wl4g.io.pem;
    #ssl_certificate_key cert.d/pkg.wl4g.io.key;
    #ssl_session_timeout 5m;           
    #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    #ssl_prefer_server_ciphers on;

    proxy_set_header  Host              $host;
    proxy_set_header  X-Real-IP         $remote_addr;
    proxy_set_header  X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header  X-Forwarded-Proto $scheme;

    location / {
      proxy_pass http://localhost:28001;
    }
}
EOF

sudo systemctl restart nginx
  • Installation
git clone https://gitee.com/wl4g/simple_httpfs.git
cd simple_httpfs/

# Build package
make

# Copy configuration
sudo mkdir -p /etc/simplehttpfs/
sudo cp config/* /etc/simplehttpfs/

# Installing systemd
sudo cp scripts/systemd/simplehttpfs.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl restart simplehttpfs
sudo systemctl status simplehttpfs
sudo journalctl -afu simplehttpfs

2. Configuration items

  • Default config load at: /etc/simple_httpfs/server.ini

  • Config items description:

Config Key Type Default Value Example Value Description
[http.server].listen_addr string 0.0.0.0 192.168.2.101 Listening http server sock address.
[http.server].listen_port int 28001 8888 Listening http server sock port.
[http.server].server_version string Google-SimpleHttpFS/2.0 Microsoft-SimpleHttpFS/2.0 http server information.
[http.server].cert_file string nil /etc/simple_httpfs/server.pem https tls certificate file path.
[http.acl].<username>=<acl_rule_json> string <required> admin={"password":"123","rules":[{"path":"^/(.*)","permit": "rw"}]} Access controller list configuration, the example indicates that the user user1 is allowed to request resources that satisfy the path ^/dir1/(.*) and the permissions are r and w, Tips: only when it has the 'w' permission The upload file button will appear. More example see: config/server.ini
[fs.rendering].mime_types string /etc/simple_httpfs/mime_types ./config/index.tpl HttpFS rendering template file.
[fs.rendering].tpl_file string /etc/simple_httpfs/index.tpl ./config/index.tpl HttpFS rendering template file.
[fs.data].data_dir string <work_dir> /mnt/disk1/httpfs The directory where the actual files of HttpFS.
  • If you need to use https, you can use openssl self-signed certificate: openssl req -new -x509 -keyout ./httpfs_server.pem -out ./httpfs_server.pem -days 365 -nodes -subj "/C=/ST=/O=/OU=/CN="

空文件

简介

A Simple HttpFS 展开 收起
Python 等 4 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/wl4g/simple_httpfs.git
git@gitee.com:wl4g/simple_httpfs.git
wl4g
simple_httpfs
simple_httpfs
master

搜索帮助