网盘系统建立啦!

为了自己、班委以及相关需要的人实现分享文件的便利,我建立了一个网盘系统,用的是seafile

  当然是fs.wxk.es啦。。(当然是选择继续阅读啦)

seafile最大的好处在于,它是python运行时,c为主体构建的。部署便捷,文档齐全(有点老)但不足还是有很多的。比如不支持文件搜索。

现在实现的简单的功能特性:

  1. 简单的文件存储:网盘会分配少量的定额,满足分享公示、文件的需求;(一般少于800MB)
  2. 外链分享:通过外链的分享,实现文件的共享。可以添加外链过期时间,添加密码,还可实现更多;
  3. PDF、word、excel、markdown等预览:网盘自带预览系统,可以实现免下载预览;(微信内部浏览器不支持(偶尔闪退))【额,好像还是不支持xlsx格式的预览,随意啦(滑稽)】
  4. 全面的安全机制:小站拥有完备的安全规则,拥有A+级的安全评估;
  5. 主机商提供完备的服务,不会断电,极力保护数据不会丢失。

尚存的不足:

  1. 由于服务器仅为少量用户使用而配置,网盘仅提供少量的注册名额即存储空间;
  2. 服务器处于测试阶段,仅保证90%的SLA;(233)
其实主要的用途,还是分享文件的方便快捷,以及安全的考虑。其实pan.scnu已经做了全部事情了……

现在已经共享出来的链接:

(关于里面的内容,有些是比较私人化但又是免费的。请不要利用)

曾经也用过owncloud构建,但相对比较繁琐,而且会出现下载断链的情况(未探清楚是什么原因),于是乎一脚踹开了。同时,为了网站的安全,弄到了不少nginx部署上的技巧。例如防止xss攻击,实现CST,以及相应的监控等。监控用了report.io,一个非常管用的CST报告网站。

一些常用的Nginx规则:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
server_tokens off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # 仅允许安全的SSL版本
add_header X-Robots-Tag none;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
add_header Strict-Transport-Security "max-age=129600; includeSubDomains";

add_header 'Referrer-Policy' 'origin';
add_header Content-Security-Policy "default-src 'self' https://pagead2.googlesyndication.com; script-src 'self' data: 'unsafe-inline' 'unsafe-eval' https://pagead2.googlesyndication.com https://secure.gravatar.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://fonts.gstatic.com https://pagead2.googlesyndication.com https://secure.gravatar.com https://translate.googleapis.com; img-src 'self' data: https://dmmj3mmt94rvw.cloudfront.net https://fonts.gstatic.com https://csi.gstatic.com https://googleads.g.doubleclick.net https://gstatic.com https://secure.gravatar.com https://stats.g.doubleclick.net https://www.gstatic.com; font-src 'self' data: https://dmmj3mmt94rvw.cloudfront.net https://fonts.googleapis.com https://fonts.gstatic.com https://themes.googleusercontent.com https://www.gstatic.com; connect-src 'self' https://fonts.gstatic.com https://pagead2.googlesyndication.com; media-src 'self' data: https://ssl.gstatic.com; object-src 'self' https://fonts.gstatic.com https://pagead2.googlesyndication.com https://www.gstatic.com; child-src 'self'; frame-src 'self' https://googleads.g.doubleclick.net gsa://onpageload https://onpageload https://secure.gravatar.com https://tpc.googlesyndication.com ; worker-src 'self'; frame-ancestors 'self'; form-action 'self'; upgrade-insecure-requests; report-uri https://pingfs.report-uri.io/r/default/csp/enforce";

# 留意那个report-uri,是我个人的报告uri。请使用时务必更改为自己的

ssl_session_cache shared:SSL:10m;
ssl_session_timeout 20m;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-RC4-SHA:!ECDHE-RSA-RC4-SHA:ECDH-ECDSA-RC4-SHA:ECDH-RSA-RC4-SHA:ECDHE-RSA-AES256-SHA:!RC4-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!CBC:!EDH:!kEDH:!PSK:!SRP:!kECDH;
ssl_dhparam /etc/ssl/certs/dhparam.pem; # 这是自己生成的DH key,留意下文参考链接

location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
root /usr/share/nginx/certbot;
}

location = /.well-known/acme-challenge/ {
return 404;
}

location = /.well-known/carddav { # 这是给PHP用的
return 301 $scheme://$host/owncloud/remote.php/dav;
}
location = /.well-known/caldav {
return 301 $scheme://$host/owncloud/remote.php/dav;
}

现在fs在ssl Lab的评分是A+~

另外,IE6,Java6u等老版本浏览器,已经不被支持了。(blog的配置和fs的几乎无异)

附上我的参考资料:

评论

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×