关于网盘:h5ai搭建网盘

82次阅读

共计 1270 个字符,预计需要花费 4 分钟才能阅读完成。

装置

编译 | 下载

能够本人下载编译,也能够间接去下载作者编译好的 release

git clone https://github.com/lrsjng/h5ai.git
cd h5ai
npm install
npm run build

编译好后失去的目录构造如下:

环境启动

须要 php 环境来启动,能够用 apache, lighttpd, nginx or cherokee 等,我比拟习惯用 apache2

service apache2 status
# 确保 php 存在
php --version

如果发现 apache2 无奈解析 php,须要装置如下依赖

sudo apt-get install libapache2-mod-php
service apache2 restart

查看配置

拜访http://localhost/_h5ai/public/index.php,默认明码为空

解决掉这些是 no 的选项

没有读写权限,能够用如下命令给权限

chmod 777 -R _h5ai/

其余什么是 no 就去装置什么,解决问题

# ffmpeg
apt install -y ffmpeg
# convert
sudo apt-get install imagemagick
# PHP GD extension with JPEG support available
sudo apt-get install php-gd libjpeg-dev

直到全都是 yes 就胜利了。

批改配置

批改语言

"l10n": {
"enabled": true,
"lang": "zh-cn",
"useBrowserLang": true
},

开启文件搜寻性能

"search": {
"enabled": true,
"advanced": true,
"debounceTime": 300,
"ignorecase": true
},

二维码

"info": {
"enabled": true,
"show": true,
"qrcode": true,
"qrFill": "#999",
"qrBack": "#fff"
},

字体减速

把 fonts.googleapis.com 改成 fonts.loli.net

"resources": {"scripts": [],
"styles": ["//fonts.loli.net/css?family=Ubuntu:300,400,700%7CUbuntu+Mono:400,700"]
},

设置主页

vim /etc/apache2/mods-available/dir.conf

设置内容如下,将其批改为主页拜访

<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm /_h5ai/public/index.php
</IfModule>

展现

平安问题

  1. 默认没有明码管理机制,所有人都能够拜访,能够本人去设置 apache2 的 basic 认证。
  2. /_h5ai/private/conf/options.json能够看到密钥,不过如同没什么用。

官网文档

https://larsjung.de/h5ai/

正文完
 0