FileGator文件管理器安装与使用教程-免费开源在线文件管理和下载程序

目录列表程序整理汇总一文中分享了当前支持将OneDrive,阿里云盘,GoogleDrive等各大网盘变身个人存储的目录列表程序,其中FileGator是一个支持多用户的文件管理器,支持Dropbox、Amazon S3、DigitalOcean Spaces、微软Azure Blob Storage等网盘存储。

当然,FileGator也完全可以当成一个本地存储,支持所有基本文件操作:复制,移动,重命名,创建,删除,压缩,解压缩,下载,上传。FileGator支持匿名操作,也就是说用户不需要登录FileGator,就可以查看、上传或者下载文件了,FileGator可以打造成一个公共存储网盘。

FileGator文件管理器安装与使用教程-免费开源的多用户在线文件管理和下载程序

有朋友留言说可以介绍一下在宝塔面板中FileGator文件管理器安装与使用,这里就基于宝塔面板来做一个安装演示,其它的面板也可以参考。更多的网盘存储还有:

  1. NextCloud从入门到精通-自建网盘搭建个人云存储系统
  2. 支持WebDAV的国内外网盘整理汇总-各大网盘WebDAV服务器地址及连接方式
  3. 十个国外优秀的网盘云存储使用对比-免费存储,单个文件,自动同步备份和在线文档

PS:更新记录.

1、安装简单,网络要求低 ,提供完善的版本控制,更适合用于私有分享的自建网盘:Syncthing开源免费跨平台的文件同步工具-利用Syncthing搭建免费同步网盘。2022.9.21

一、FileGator安装教程

网站:

  1. github:https://github.com/filegator/filegator
  2. 文档:https://docs.filegator.io/
  3. demo:https://demo.filegator.io

1.1 安装前准备

FileGator对于Web环境没有太高的要求,你只需要保证你的 PHP 7.2.5+ (with php-zip extension)即可。你可以找一个虚拟主机或者是VPS主机安装好LNMP环境,参考:VPS主机排行榜单

如果用VPS主机安装FileGator文件管理器,可以使用宝塔面板安装一键安装LNMP,同时把域名解析好和SSL证书配置好,其它的面板可以参考:服务器控制面板榜单

1.2 上传安装文件

到FileGator官网下载最新的安装包,上传到网站的根目录下,然后解压。如果是宝塔面板,直接在宝塔面板的文件管理器中就可以下载了。(宝塔面板教程:新版宝塔面板安装与使用教程。)

FileGator上传程序

将这两个文件夹  repository 和 private 设置为777可以读写权限。

FileGator设置读写权限

1.3 调整Root目录

修改你的FileGator的Root目录为dist 目录。如果用的是宝塔面板的话,去掉防跨站“open_basedir”。然后在运行目录设置为/dist。

FileGator调整目录

如果你用的是LNMP一键安装包或者Oneinstack,可以直接到Nginx的配置文件中修改root路径即可。然后打开你的域名,现在你可以使用默认的账号和密码 admin/admin123登录了。如果发现错误可以查看日志文件: filegator/private/logs/app.log

FileGator进入到页面

二、FileGator使用操作

2.1 上传查看文件

FileGator的界面管理如下:

FileGator操作界面

FileGator可以复制、移动、压缩、重命名等操作。

FileGator移动复制

FileGator支持在线浏览图片,其它的文件只能是下载了。

FileGator浏览图片

2.2 设置公开权限

FileGator默认是需要登录才能查看和下载文件的。

FileGator公开权限

不过,我们可以在FileGator的用户管理中,对平guest用户权限进行开放,例如你可以允许匿名用户上传、下载或者查看文件。

FileGator允许查看

2.3 调整为中文

FileGator支持中文,不过需要我们编辑configuration.php 文件,将'language' => 'english',改成 'language' => 'chinese',,如下:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return [
'public_path' => APP_PUBLIC_PATH,
'public_dir' => APP_PUBLIC_DIR,
'overwrite_on_upload' => false,
'timezone' => 'UTC', // https://www.php.net/manual/en/timezones.php
'download_inline' => ['pdf'], // download inline in the browser, array of extensions, use * for all
'frontend_config' => [
'app_name' => 'FileGator',
'app_version' => APP_VERSION,
//'language' => 'english',
'language' => 'chinese',
'logo' => 'https://filegator.io/filegator_logo.svg',
'upload_max_size' => 100 * 1024 * 1024, // 100MB
'upload_chunk_size' => 1 * 1024 * 1024, // 1MB
'upload_simultaneous' => 3,
'default_archive_name' => 'archive.zip',
'editable' => ['.txt', '.css', '.js', '.ts', '.html', '.php', '.json', '.md'],
'date_format' => 'YY/MM/DD hh:mm:ss', // see: https://momentjs.com/docs/#/displaying/format/
'guest_redirection' => '', // useful for external auth adapters
'search_simultaneous' => 5,
'filter_entries' => [],
],
return [ 'public_path' => APP_PUBLIC_PATH, 'public_dir' => APP_PUBLIC_DIR, 'overwrite_on_upload' => false, 'timezone' => 'UTC', // https://www.php.net/manual/en/timezones.php 'download_inline' => ['pdf'], // download inline in the browser, array of extensions, use * for all 'frontend_config' => [ 'app_name' => 'FileGator', 'app_version' => APP_VERSION, //'language' => 'english', 'language' => 'chinese', 'logo' => 'https://filegator.io/filegator_logo.svg', 'upload_max_size' => 100 * 1024 * 1024, // 100MB 'upload_chunk_size' => 1 * 1024 * 1024, // 1MB 'upload_simultaneous' => 3, 'default_archive_name' => 'archive.zip', 'editable' => ['.txt', '.css', '.js', '.ts', '.html', '.php', '.json', '.md'], 'date_format' => 'YY/MM/DD hh:mm:ss', // see: https://momentjs.com/docs/#/displaying/format/ 'guest_redirection' => '', // useful for external auth adapters 'search_simultaneous' => 5, 'filter_entries' => [], ],
return [
    'public_path' => APP_PUBLIC_PATH,
    'public_dir' => APP_PUBLIC_DIR,
    'overwrite_on_upload' => false,
    'timezone' => 'UTC', // https://www.php.net/manual/en/timezones.php
    'download_inline' => ['pdf'], // download inline in the browser, array of extensions, use * for all

    'frontend_config' => [
        'app_name' => 'FileGator',
        'app_version' => APP_VERSION,
        //'language' => 'english',
        'language' => 'chinese',
        'logo' => 'https://filegator.io/filegator_logo.svg',
        'upload_max_size' => 100 * 1024 * 1024, // 100MB
        'upload_chunk_size' => 1 * 1024 * 1024, // 1MB
        'upload_simultaneous' => 3,
        'default_archive_name' => 'archive.zip',
        'editable' => ['.txt', '.css', '.js', '.ts', '.html', '.php', '.json', '.md'],
        'date_format' => 'YY/MM/DD hh:mm:ss', // see: https://momentjs.com/docs/#/displaying/format/
        'guest_redirection' => '', // useful for external auth adapters
        'search_simultaneous' => 5,
        'filter_entries' => [],
    ],

FileGator中文效果如下:

FileGator中文语言

2.4 最大上传大小

直接修改配置文件中的最大上传文件大小即可:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
'upload_max_size' => 100 * 1024 * 1024, // 100MB
'upload_chunk_size' => 1 * 1024 * 1024, // 1MB
'upload_max_size' => 100 * 1024 * 1024, // 100MB 'upload_chunk_size' => 1 * 1024 * 1024, // 1MB
'upload_max_size' => 100 * 1024 * 1024, // 100MB
'upload_chunk_size' => 1 * 1024 * 1024, // 1MB

三、FileGator第三方存储

FileGator支持第三方存储,包括本地存储(默认)、FTP, SFTP, Amazon S3, DigitalOcean Spaces, Microsoft Azure Blob, Dropbox 等等。

3.1 默认本地存储

默认的是FileGator本地存储的文件是放在 repository 文件夹里。

FileGator文件存储

如果你要修改路径,你只需要修改 repository 文件夹的路径,编辑configuration.php 文件找到 repository 文件夹。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
'Filegator\Services\Storage\Filesystem' => [
'handler' => '\Filegator\Services\Storage\Filesystem',
'config' => [
'separator' => '/',
'config' => [],
'adapter' => function () {
return new \League\Flysystem\Adapter\Local(
__DIR__.'/repository'
);
},
],
],
'Filegator\Services\Storage\Filesystem' => [ 'handler' => '\Filegator\Services\Storage\Filesystem', 'config' => [ 'separator' => '/', 'config' => [], 'adapter' => function () { return new \League\Flysystem\Adapter\Local( __DIR__.'/repository' ); }, ], ],
        'Filegator\Services\Storage\Filesystem' => [
            'handler' => '\Filegator\Services\Storage\Filesystem',
            'config' => [
                'separator' => '/',
                'config' => [],
                'adapter' => function () {
                  return new \League\Flysystem\Adapter\Local(
                      __DIR__.'/repository'
                      );
                },
            ],
        ],

3.2 SFTP存储

如果你想要添加SFTP为你的FileGator存储,先安装环境(注意:宝塔面板安装了PHP后会自动安装好composer ,只需要执行一下命令):

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
composer require league/flysystem-sftp:^1.0 -W
composer require league/flysystem-sftp:^1.0 -W
composer require league/flysystem-sftp:^1.0 -W

然后调整配置文件,添加SFTP相关的信息。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
'Filegator\Services\Storage\Filesystem' => [
'handler' => '\Filegator\Services\Storage\Filesystem',
'config' => [
'separator' => '/',
'config' => [],
'adapter' => function () {
return new \League\Flysystem\Sftp\SftpAdapter([
'host' => 'example.com',
'port' => 22,
'username' => 'demo',
'password' => 'password',
'timeout' => 10,
]);
},
],
],
'Filegator\Services\Storage\Filesystem' => [ 'handler' => '\Filegator\Services\Storage\Filesystem', 'config' => [ 'separator' => '/', 'config' => [], 'adapter' => function () { return new \League\Flysystem\Sftp\SftpAdapter([ 'host' => 'example.com', 'port' => 22, 'username' => 'demo', 'password' => 'password', 'timeout' => 10, ]); }, ], ],
    'Filegator\Services\Storage\Filesystem' => [
            'handler' => '\Filegator\Services\Storage\Filesystem',
            'config' => [
                'separator' => '/',
                'config' => [],
                'adapter' => function () {
                  return new \League\Flysystem\Sftp\SftpAdapter([
                      'host' => 'example.com',
                      'port' => 22,
                      'username' => 'demo',
                      'password' => 'password',
                      'timeout' => 10,
                  ]);
                },
            ],
        ],

3.3 Dropbox存储

要想让Dropbox成为FileGator的第三方存储,首是安装环境:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
composer require spatie/flysystem-dropbox
composer require spatie/flysystem-dropbox
composer require spatie/flysystem-dropbox

然后调整配置文件,添加Dropbox的Token信息。如下:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
'Filegator\Services\Storage\Filesystem' => [
'handler' => '\Filegator\Services\Storage\Filesystem',
'config' => [
'separator' => '/',
'config' => [
'case_sensitive' => false,
],
'adapter' => function () {
$authorizationToken = '1234';
$client = new \Spatie\Dropbox\Client($authorizationToken);
return new \Spatie\FlysystemDropbox\DropboxAdapter($client);
},
],
],
'Filegator\Services\Storage\Filesystem' => [ 'handler' => '\Filegator\Services\Storage\Filesystem', 'config' => [ 'separator' => '/', 'config' => [ 'case_sensitive' => false, ], 'adapter' => function () { $authorizationToken = '1234'; $client = new \Spatie\Dropbox\Client($authorizationToken); return new \Spatie\FlysystemDropbox\DropboxAdapter($client); }, ], ],
    'Filegator\Services\Storage\Filesystem' => [
            'handler' => '\Filegator\Services\Storage\Filesystem',
            'config' => [
                'separator' => '/',
                'config' => [
                    'case_sensitive' => false,
                ],
                'adapter' => function () {
                  $authorizationToken = '1234';
                  $client = new \Spatie\Dropbox\Client($authorizationToken);

                  return new \Spatie\FlysystemDropbox\DropboxAdapter($client);
                },
            ],
        ],

3.4 Amazon S3存储

要想让Amazon S3成为FileGator的第三方存储,需要安装环境:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
composer require league/flysystem-aws-s3-v3:^1.0 -W
composer require league/flysystem-aws-s3-v3:^1.0 -W
composer require league/flysystem-aws-s3-v3:^1.0 -W

然后就是修改配置了。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
'Filegator\Services\Storage\Filesystem' => [
'handler' => '\Filegator\Services\Storage\Filesystem',
'config' => [
'separator' => '/',
'config' => [],
'adapter' => function () {
$client = new \Aws\S3\S3Client([
'credentials' => [
'key' => '123456',
'secret' => 'secret123456',
],
'region' => 'us-east-1',
'version' => 'latest',
]);
return new \League\Flysystem\AwsS3v3\AwsS3Adapter($client, 'my-bucket-name');
},
],
],
'Filegator\Services\Storage\Filesystem' => [ 'handler' => '\Filegator\Services\Storage\Filesystem', 'config' => [ 'separator' => '/', 'config' => [], 'adapter' => function () { $client = new \Aws\S3\S3Client([ 'credentials' => [ 'key' => '123456', 'secret' => 'secret123456', ], 'region' => 'us-east-1', 'version' => 'latest', ]); return new \League\Flysystem\AwsS3v3\AwsS3Adapter($client, 'my-bucket-name'); }, ], ],
    'Filegator\Services\Storage\Filesystem' => [
            'handler' => '\Filegator\Services\Storage\Filesystem',
            'config' => [
                'separator' => '/',
                'config' => [],
                'adapter' => function () {
                    $client = new \Aws\S3\S3Client([
                        'credentials' => [
                            'key' => '123456',
                            'secret' => 'secret123456',
                        ],
                        'region' => 'us-east-1',
                        'version' => 'latest',
                    ]);

                    return new \League\Flysystem\AwsS3v3\AwsS3Adapter($client, 'my-bucket-name');
                },
            ],
        ],

关于Amazon服务可以参考:AWS免费VPS主机申请使用

3.5 DigitalOcean Spaces

要想让DigitalOcean Spaces成为FileGator的第三方存储,需要安装环境:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
composer require league/flysystem-aws-s3-v3:^1.0 -W
composer require league/flysystem-aws-s3-v3:^1.0 -W
composer require league/flysystem-aws-s3-v3:^1.0 -W

然后就是修改配置了。

获取DigitalOcean Spaces的Key和Secret信息请参考:DigitalOcean Spaces云存储空间管理使用

四、总结

如果你在执行composer命令时出现以下错误:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
PHP Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 93
Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 93
PHP Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/bin/composer on line 59
Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/bin/composer on line 59
Info from https://repo.packagist.org: #StandWithUkraine
./composer.json has been created
Running composer update league/flysystem-sftp --with-all-dependencies
Installation failed, deleting ./composer.json.
[ErrorException]
putenv() has been disabled for security reasons
PHP Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 93 Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 93 PHP Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/bin/composer on line 59 Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/bin/composer on line 59 Info from https://repo.packagist.org: #StandWithUkraine ./composer.json has been created Running composer update league/flysystem-sftp --with-all-dependencies Installation failed, deleting ./composer.json. [ErrorException] putenv() has been disabled for security reasons
PHP Warning:  putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 93

Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/vendor/composer/xdebug-handler/src/Process.php on line 93
PHP Warning:  putenv() has been disabled for security reasons in phar:///usr/bin/composer/bin/composer on line 59

Warning: putenv() has been disabled for security reasons in phar:///usr/bin/composer/bin/composer on line 59
Info from https://repo.packagist.org: #StandWithUkraine
./composer.json has been created
Running composer update league/flysystem-sftp --with-all-dependencies

Installation failed, deleting ./composer.json.

                                                   
  [ErrorException]                                 
  putenv() has been disabled for security reasons  

原因是一些PHP函数如 putenv()被禁用了,你需要在宝塔面板中删除这些被禁用的函数。

FileGator禁用函数

文章出自:挖站否 https://wzfou.com/filegator/, 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。


分享到:
Avatar for Qi
关于站长(Qi),2008年开始混迹于免费资源圈中,有幸结识了不少的草根站长。之后自己摸爬滚打潜心学习Web服务器、VPS、域名等,兴趣广泛,杂而不精,但愿将自己经验与心得分享出来与大家共勉。
已有 6 条评论
  1. https://demo.filegator.io/#/ 链接后面的 /#/ 请问下如何去掉

    2023年4月8日 05:16 回复
    • Avatar for Qi Qi

      这个恐怕要Nginx重写规则了。

      2023年4月10日 21:25 回复
  2. Avatar for 红枫叶 红枫叶

    支持第三方的存储 非常好

    2022年8月24日 22:53 回复
  3. Avatar for ew ew

    很简洁

    2022年8月24日 09:09 回复
  4. 这方面我觉得 kodi 更牛

    2022年8月23日 23:40 回复
    • Avatar for Qi Qi

      kodi 更强大。

      2022年8月26日 22:05 回复

Login

Welcome! Login in to your account

Remember me Lost your password?

Don't have account. Register

Lost Password

Register