miarra/fileserver

Miarra:基于Nette框架的文件服务器

安装: 10

依赖项: 0

建议者: 0

安全: 0

类型:项目

v3.0.1 2022-02-16 23:21 UTC

This package is auto-updated.

Last update: 2024-09-17 04:47:53 UTC


README

此应用程序为其他应用程序存储图像。

设置

您必须在本地配置文件中设置选项,如下所示

parametres:
	username: 'username'
	password: 'password'
	cacheTime: '2 minutes'

建议像这样设置虚拟主机(针对Apache2)

<VirtualHost *:80>
        # informations about webmaster showed in case that web crasched
        ServerAdmin name@mail.foo
        # domain to aply rules
        ServerName domain.bar
        # set document root
        DocumentRoot /path/to/document/root
        # default setting for document root
        <Directory "/path/to/document/root/">
				AllowOverride All
				Order Allow,Deny
				Allow from all
				Require all granted
					
				#is recommended to use XSendFile
				<IfModule mod_xsendfile.c>
						<Files *.php>
								XSendFile On
								XSendFilePath /path/to/images/folder/
						</Files>
				</IfModule>
				
				#MOD_X_SENDFILE_ENABLED will be 1 if XSendFile is enabled, 0 otherwise
				SetEnv MOD_X_SENDFILE_ENABLED 0
				
	</Directory>
</VirtualHost>

文件夹 logtempimages 必须有写权限。

保存和加载文件/图像

对于保存、加载和删除图像,请使用 miarra/filemanipulator,您可以在 Packagist(https://packagist.org.cn/packages/miarra/filemanipulator)或 Bitbucket(https://bitbucket.org/miarra/filemanipulator.git)上找到它。

安全

所有文件只能通过指定的URL访问。不允许直接访问。

如果您不使用PROXY,您需要将返回的URL与您的文件服务器URL和服务器图像文件夹连接起来

(示例:'https://< yourFileServerURL.xy >/images/< yourReturnedURL >').

仅使用 Https 协议。

结论

此应用程序使用 PHP 8.0 和 Nette 3.1 运行,并属于 Miarra © 2021