Support custom textures storage directory (#127)

* Support custom textures storage directory

* fix test

* update changelog

Co-authored-by: Pig Fang <g-plane@hotmail.com>
This commit is contained in:
Steven Qiu 2020-01-22 11:06:02 +08:00 committed by Pig Fang
parent 640a714d8e
commit ad528520ca
6 changed files with 10 additions and 2 deletions

View File

@ -44,3 +44,5 @@ REDIS_PORT = 6379
PLUGINS_DIR = null
PLUGINS_URL = null
TEXTURES_DIR = null

View File

@ -32,4 +32,6 @@ REDIS_PORT=6379
PLUGINS_DIR=plugins
PLUGINS_URL=
TEXTURES_DIR=
JWT_SECRET=1tdM3gXarxYI4KlAHMBo238iC2tEb4I3EtBlZTQQXvInXIt7V2ix7hJ1KTvxCKZW

View File

@ -55,7 +55,7 @@ return [
'textures' => [
'driver' => env('FS_DRIVER', 'local'),
'root' => storage_path('textures'),
'root' => env('TEXTURES_DIR', storage_path('textures')),
],
'testing' => [

View File

@ -19,6 +19,7 @@
- Added support of character "§" for player name. (Under CJK mode.)
- New password hash algorithm: Argon2i.
- Support searching players when applying textures.
- Support customizing textures storage directory.
## Tweaked

View File

@ -19,6 +19,7 @@
- 角色名支持字符「§」需开启「CJK」模式
- 新的密码哈希算法Argon2i
- 将材质应用到角色时可进行搜索
- 支持自定义材质存储目录
## 调整

View File

@ -593,6 +593,8 @@ class SkinlibControllerTest extends TestCase
public function testDelete()
{
$disk = Storage::fake('textures');
$uploader = factory(User::class)->create();
$other = factory(User::class)->create();
$texture = factory(Texture::class)->create(['uploader' => $uploader->uid]);
@ -625,7 +627,7 @@ class SkinlibControllerTest extends TestCase
$texture = factory(Texture::class)->create();
factory(Texture::class)->create(['hash' => $texture->hash]);
Storage::disk('textures')->put($texture->hash, '');
$disk->put($texture->hash, '');
// When file is occupied, the file should not be deleted
$this->postJson('/skinlib/delete', ['tid' => $texture->tid])