update docs

This commit is contained in:
Pig Fang 2020-06-10 15:38:13 +08:00
parent c5a7989fdc
commit 6bb9d04244
4 changed files with 271 additions and 112 deletions

View File

@ -68,6 +68,7 @@ editLinkText = 'Edit this page on GitHub'
lastUpdated = 'Last Updated'
sidebar = [
'/en/setup',
'/en/faq',
'/en/mod',
'/en/build',
'/en/v3-to-v4',

228
man/en/faq.md Normal file
View File

@ -0,0 +1,228 @@
# FAQ
Before reporting problems, please check if your problem is mentioned at this list.
::: tip
Use <kbd>Ctrl</kbd>+<kbd>F</kbd> to search your problems.
:::
[[toc]]
## Where is `.env` file?
It's at the root of the application, and this file can be a symbolic link (aka. symlink).
## I received an error with message "No application encryption key has been specified.".
You didn't generate app key. Go to the root of Blessing Skin, and run this command:
```shell
php artisan key:generate
```
## There isn't a directory called `setup`. How can I visit it?
We use URL rewrite. What you need to do is to configure URL rewrite correctly. You can read [here](./setup.md) to get more information about configuring this.
## I received an error and it told me `vendor` directory is missing.
Two solutions:
1. Download release from our releases page, then read installation guide.
2. Run Composer by yourself. (for advanced users only)
## I got "500 Internal Server Error".
Go to `storage/logs` directory and check the logs. If there aren't log files, you should grant write permission to that directory.
Then, edit your `.env` file. Set `APP_DEBUG` to `true`. You will get more information.
::: warning
Once your problem is addressed, don't forget to disable debug mode by settting `APP_DEBUG` to `false`. Otherwise, some information will be exposed.
:::
## I got "404 Not Found".
If you can access home page, you need to re-configure URL rewrite.
Otherwise, your web server isn't configured correctly. For example, web server root directory is incorrect.
## require: open_basedir restriction in effect. File is not within the allow path(s).
Open your `php.ini` file, and search for `open_basedir`. Add the absolute path to your Blessing Skin application after the `=` sign. Save this file.
Don't forget to restart php-fpm service if you're using Nginx.
## xxx() has been disabled for security reasons
Some PHP functions have been disabled. You need to enable them by editing `php.ini` file.
Open your `php.ini` file and search for `disable_functions`. Delete all characters after the `=` sign. Save this file.
Don't forget to restart php-fpm service if you're using Nginx.
## Deprecated $HTTP_RAW_POST_DATA
If you received an error likes this:
```
Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
```
![error screenshot](https://i.loli.net/2018/02/10/5a7eb109a7b43.png)
Open your `php.ini` file and search for `always_populate_raw_post_data`. Update its value to `-1`. If it's already `-1`, delete the semicolon at the head of line. Save this file.
Don't forget to restart php-fpm service if you're using Nginx.
## Maximum function nesting level of '100' reached
If you received an error like this:
```
PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /opt/app-root/src/vendor/composer/ClassLoader.php on line 344, referer: http://domain.com/setup/info
```
Please disable XDebug.
## getdate(): It is not safe to rely on the system's timezone settings
If you received an error like this:
```
Warning: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
```
Open your `php.ini` file and search for `date.timezone`. Update its value according to your preferred timezone. Also, if this line starts with a semicolon, delete the semicolon.
## Some pictures can't be loaded.
If you're using Nginx, check the Nginx configuration file. Search the file and check if it contains something like this:
```nginx
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
expires 30d;
access_log off;
}
```
Delete this part. Save the file and restart Nginx service.
## How to integrate with AuthMe?
Just download "AuthMe Integration" plugin from Plugins Market and configure it.
## Where are uploaded textures?
All the textures are stored at `storage/textures`. Their file names are hashes without file extension. You can use picture viewer to open them.
## I can't see my skin in game!
::: tip
We only discuss about using Skin Mod. Yggdrasil API is off-topic.
:::
### Verify whether skin server works or not.
Visit `http://{your.domain.name}/{PlayerName}.json`. If you can see something like this:
```json
{
"username": "621sama",
"skins": {
"default": "834cbd848f0a29008bf5b1d59d02ecb1cf25dfd21fc88be1c183c9261f5fdd69",
"slim": "3d82f454ceeb30f2546283e08ab060a45d450dc6042c9077f638f10ca51205d4"
},
"cape": "2911438e8282d40e6d64fbefd076eef0a901cb90d3deae4057fec60c66eb93d2"
}
```
Copy the very very long code, then visit `http://{your.domain.name}/textures/{long code}`, you should be able to see your skin or cape.
### Verify whether your skin mod is installed or not.
Skin mod should be located at `.minecraft/mods` directory.
### Verify configuration of skin mod.
Read [here](./mod.md).
### Debug with logs.
For example, log files of CustomSkinLoader are located at `.minecraft/CustomSkinLoader/CustomSkinLoader.log`. They are just text files. Read it and you may know the problems.
### How about Elytra?
Draw it on a cape. However, our online previewer doesn't support Elytra currently.
## I forgot my password.
Use "Forgot My Password" function in log-in page.
Another solution is only for administrators. Register a new user, then open the database and replace the hashed password of old user with the hashed password of new user. Now, log-in the old user with new password. Once finished, just delete the new user.
## How can I use third-party comment service?
Check out it at Plugins Market. That plugin will allow you to insert a code snippet to each texture detail page.
## How can I enable another super administrator?
Open the database, update permission value of the user you want to hoist to `2`.
## Target class [App\Services\Cipher\xxx] does not exist.
Password hashing algorithm is incorrect. Make sure you're using an algorithm which Blessing Skin supports. And validate the name (case-sensitive).
## MySQL error code: 2054
If MySQL raised an error like this: `SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client`, you may using MySQL 8 and `caching_sha2_password` in MySQL. You should create a MySQL user with `mysql_native_password` then grant it to the database, or change the existing user to `mysql_native_password`.
## No style (CSS) on page.
If the URL you visited contains `index.php`, delete `index.php`.
## 503 error occurred when upgrading.
There are two solutions:
1. Open terminal, and run this command:
```shell
php artisan update
```
2. When this error occurred, you will find a "Log-In" button at page. Click it and log in your administrator account as usual. Then, continue the upgrade wizard.
## I can't open Web CLI.
### Nginx
Edit `/etc/nginx/mime.types` file, and append a new line as below:
```
application/wasm wasm;
```
Then, restart Nginx.
### Apache
We've configure `.htaccess` file for you. If it doesn't work, try solutions below.
One solution is to edit `/etc/mime.types`, and append a new line as below:
```
application/wasm wasm
```
Another solution is modify your Apache configuration file, and append a new line as below:
```
AddType application/wasm .wasm
```

View File

@ -55,5 +55,3 @@ Another solution is modify your Apache configuration file, and append a new line
```
AddType application/wasm .wasm
```

View File

@ -1,9 +1,9 @@
# 常见问题解答
提问之前请先看看的问题是否在以下列表中:
提问之前请先看看的问题是否在以下列表中:
::: tip 提示:
请善用浏览器的 Ctrl + F 页内查找功能。
请善用浏览器的 <kbd>Ctrl</kbd> + <kbd>F</kbd> 页内查找功能。
:::
[[toc]]
@ -22,79 +22,64 @@ php artisan key:generate
## 目录下没有 `setup` 这个文件夹啊,怎么访问?
Blessing Skin 使用了 URL 重写来实现路由功能(即俗称的伪静态),具体请自行搜索
Blessing Skin 使用了 URL 重写来实现路由功能。
一般来说,只要按照 [安装指南](/setup.md#配置-url-重写规则(伪静态)) 正确配置了 URL 重写之后,就能正常安装和使用 Blessing Skin。
一般来说,只要按照 [安装指南](/setup.md#配置-url-重写规则(伪静态)) 正确配置了 URL 重写之后,就能正常安装和使用 Blessing Skin。
## 提示「根目录下没有 `vendor` 文件夹」?
嗯,有两种解决方法:
有两种解决方法:
1. 给我认认真真地再看一遍 [安装指南](/setup.md)
2. 自己使用 Composer 安装依赖库
## 出现 500 Internal Server Error
### 如果服务器报错 500且页面上没有任何 Blessing Skin 字样
如果服务器报错 500且页面上没有任何 Blessing Skin 字样,请查看 `storage/logs` 目录下是否有日志文件,如果没有,说明是您文件权限设置错误,请设置正确的文件权限。
请查看 `storage/logs` 目录下是否有日志文件,如果没有,说明是你文件权限设置错误,请设置正确的文件权限。
如果有,请编辑 .env 文件,将 `APP_DEBUG` 这一项的值改为 `true`,保存退出后再次打开皮肤站就能看到更详细的调试信息,读一读页面最顶上的报错应该就知道是什么问题了。
如果有,请编辑 `.env` 文件,将 `APP_DEBUG` 这一项的值改为 `true`,保存退出后再次打开皮肤站就能看到更详细的调试信息,读一读页面最顶上的报错应该就知道是什么问题了。
::: warning
解决报错后,请再次编辑 .env 文件,将 `APP_DEBUG` 这一项的值改为 `false`,否则可能泄露重要机密信息。
解决报错后,请再次编辑 `.env` 文件,将 `APP_DEBUG` 这一项的值改为 `false`,否则可能泄露重要机密信息。
:::
## 404 Not Found
如果你可以访问首页,其他页面都是 404请检查你的 URL 重写(伪静态)规则 **是否生效**
如果您可以访问首页,其他页面都是 404请检查您的 URL 重写(伪静态)规则 **是否生效**
如果所有页面(包括 `/index.php`)都是 404请检查自己的 Web 服务器配置。
如果所有页面(包括 `/index.php`)都是 404请检查自己的 Web 服务器配置。
## require: open_basedir restriction in effect. File is not within the allow path(s).
如果的站点出现了如下错误:
如果的站点出现了如下错误:
```
require: open_basedir restriction in effect. File is not within the allow path(s).
```
**这是你的 PHP 设置出了问题,需要修改 php.ini 文件。**
基本上你搜索一下就能找到解决方案。这里再复述一遍:
1. 打开你的 php.ini 文件(不知道 php.ini 文件在哪儿?随便去哪里下载个 PHP 探针(搜索引擎是你的好朋友),打开 `phpinfo()` 就可以看到你目前的 php.ini 配置文件所在目录了);
2. 搜索 `open_basedir` 字样;
3. 找到了吗?
1. 如果找到了,在 `=` 等于符号后面加上你的皮肤站根目录的**完整的绝对路径**,然后保存并退出编辑;
- 多个路径中间用 `:` 英文半角分号隔开。
2. 如果没找到,那么抱歉爱莫能助。
4. 如果你使用的是 Nginx请重启 PHP-FPMApache 用户一般不用再做什么了;
5. 如果一切运转正常,你应该可以正常使用 Blessing Skin 了。
1. 打开您的 php.ini 文件;
2. 搜索 `open_basedir` 字样并在 `=` 等于符号后面加上您的皮肤站根目录的**完整的绝对路径**,然后保存并退出编辑;
4. 如果您使用的是 Nginx请重启 php-fpm。
## XXX() has been disabled for security reasons
如果的遇到了类似如下的错误:
如果您的遇到了类似如下的错误:
```
XXX() has been disabled for security reasons
```
看到这条报错说明 Blessing Skin 所使用的一些函数在你的 PHP 中被禁用了,你需要在 php.ini 文件中解除这些函数的禁用。
看到这条报错说明 Blessing Skin 所使用的一些函数在您的 PHP 中被禁用了,您需要在 php.ini 文件中解除这些函数的禁用。
基本上你搜索一下就能找到很详细的解决方案(所以说在提问前先自己搜索一遍是多么有必要)。这里再复述一遍:
1. 打开你的 php.ini 文件(不知道你的 php.ini 文件在哪儿?看上一条);
1. 打开您的 php.ini 文件;
2. 搜索 `disable_functions` 字样;
3. 找到之后,把 `=` 等于符号右边一长串字母和逗号组成的字符串里的 `XXX,` 字样删除;
4. 记得在退出编辑前要保存!
5. Nginx 用户请重启 PHP-FPMApache 用户应该不需要再做什么了;
6. 好了,你可以正常使用 Blessing Skin 了。
3. 找到之后,把 `=` 等于符号右边一长串字母和逗号组成的字符串里的 `XXX,` 字样删除并保存;
5. Nginx 用户请重启 php-fpm。
## Deprecated $HTTP_RAW_POST_DATA
如果你的站点出现了如下错误(一般只会发生在你点了某个按钮之后):
如果您的站点出现了如下错误(一般只会发生在您点了某个按钮之后):
```
Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
@ -102,15 +87,10 @@ Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will
![error screenshot](https://i.loli.net/2018/02/10/5a7eb109a7b43.png)
**这是你 PHP 设置出了问题,需要修改 php.ini 文件。**
基本上你把这个报错拿去翻译一下,就可以很清晰地知道如何操作了。我这里再复述一遍:
1. 打开 php.ini 文件(不知道 php.ini 文件在哪儿?看上一条);
1. 打开 php.ini 文件;
2. 搜索 `always_populate_raw_post_data` 字样;
3. 找到之后,把 `=` 等于符号右边的数字设置为 `-1`(如果已经是 `-1` 了,请把行首的分号 `;` 删掉);
4. 如果你用的是 Nginx请重启 php-fpmApache 用户一般不用做什么;
5. 只要命运的齿轮没有出差错,你不会再看到类似的报错了。
4. 如果您用的是 Nginx请重启 php-fpm。
## Maximum function nesting level of '100' reached
@ -120,7 +100,7 @@ Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will
PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /opt/app-root/src/vendor/composer/ClassLoader.php on line 344, referer: http://domain.com/setup/info
```
请修改 PHP 配置,关闭 XDebug 或修改其设置(具体操作请自行搜索)
请修改 PHP 配置,关闭 XDebug 或修改其设置。
## getdate(): It is not safe to rely on the system's timezone settings
@ -130,7 +110,7 @@ PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /
Warning: getdate(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
```
请打开你的 php.ini 文件(不知道在哪的话请看上上条),找到 `date.timezone` 项的值并设置为 `Asia/Shanghai`
请打开您的 php.ini 文件,找到 `date.timezone` 项的值并设置为 `Asia/Shanghai`
如果 `date.timezone` 这一项的最前面有一个半角分号 `;` 的话,请务必去掉。
@ -142,70 +122,53 @@ Warning: getdate(): It is not safe to rely on the system's timezone settings. Yo
AuthMe / Discuz请在插件市场中下载数据对接插件。
CrazyLogin自 Blessing Skin Server v4 起CrazyLogin 数据对接不受 Blessing Skin Community 支持。如果想对接 CrazyLogin请自行编写插件或者使用 v3 及以下版本的 Blessing Skin Server。
CrazyLogin自 Blessing Skin Server v4 起CrazyLogin 数据对接不受 Blessing Skin Community 支持。如果想对接 CrazyLogin请自行编写插件或者使用 v3 及以下版本的 Blessing Skin Server。
## 上传的皮肤跑哪里去了?
皮肤文件都被重命名为文件的 SHA256 Hash 并保存至 `/storage/textures` 文件夹下。你可以直接使用图片查看软件打开它们。
## 我要怎么直接访问皮肤文件?
皮肤站提供了各种 API 让你能够获取指定的皮肤文件。当然如果你只是想要在游戏内显示皮肤的话,直接给 Mod 提供一个 JSON Profile 的地址即可,其他操作 Mod 会替你自动完成:[配置皮肤 Mod](/mod.md)
```
# 获取指定角色的皮肤/披风
example.com/{skin|cape}/{username}.png
# 获取指定角色的头像
example.com/avatar/player/{size}/{username}.png
# 通过材质 ID 获取皮肤
example.com/raw/{tid}.png
# 通过材质 Hash 获取皮肤
example.com/textures/{hash}
```
皮肤文件都被重命名为文件的 SHA256 Hash 并保存至 `/storage/textures` 文件夹下。您可以直接使用图片查看软件打开它们。
## 游戏中不显示皮肤?
::: warning 注意
这里只讨论使用 _皮肤 Mod_ 时的问题。使用自定义 Yggdrasil API 外置登录系统出现的皮肤不加载问题不在本文的讨论范围之内。
::: warning 注意
这里只讨论使用 _皮肤 Mod_ 时的问题。使用自定义 Yggdrasil API 外置登录系统出现的皮肤不加载问题不在讨论范围之内。
:::
### 检查皮肤站是否配置正确
怎么检查?访问 `http://你的皮肤站地址/你的游戏角色名.json`(此处以 CSL API 为例USM 也差不多),如果一切正常,会得到类似这样的内容:
怎么检查?访问 `http://您的皮肤站地址/您的游戏角色名.json`(此处以 CSL API 为例USM 也差不多),如果一切正常,您会得到类似这样的内容:
```json
{
"username": "621sama",
"skins": {
"default": "834cbd848f0a29008bf5b1d59d02ecb1cf25dfd21fc88be1c183c9261f5fdd69",
"slim": "3d82f454ceeb30f2546283e08ab060a45d450dc6042c9077f638f10ca51205d4"
},
"cape": "2911438e8282d40e6d64fbefd076eef0a901cb90d3deae4057fec60c66eb93d2"
"username": "621sama",
"skins": {
"default": "834cbd848f0a29008bf5b1d59d02ecb1cf25dfd21fc88be1c183c9261f5fdd69",
"slim": "3d82f454ceeb30f2546283e08ab060a45d450dc6042c9077f638f10ca51205d4"
},
"cape": "2911438e8282d40e6d64fbefd076eef0a901cb90d3deae4057fec60c66eb93d2"
}
```
然后把那几串长长的字符串复制出来,分别访问 `http://你的皮肤站地址/textures/那一串字符串`,如果一切正常,你会看到你的皮肤图片:
然后把那几串长长的字符串复制出来,分别访问 `http://您的皮肤站地址/textures/那一串字符串`,如果一切正常,您会看到您的皮肤图片:
![screenshot](https://i.loli.net/2018/02/09/5a7d81e639473.png)
确保这一步一切正常后,可以继续往下排查了。
确保这一步一切正常后,可以继续往下排查了。
### 检查皮肤 Mod 是否正确加载
去看看游戏主菜单中 Forge Mod List 里有没有正确加载皮肤 ModCustomSkinLoader、UniSkinMod 之类)。
去看看游戏主菜单中 Forge Mod List 里有没有正确加载皮肤 ModCustomSkinLoader、UniSkinMod 之类)。
### 检查皮肤 Mod 是否配置正确
请参阅 [配置皮肤 Mod](/mod.md),再检查一遍有没有配置出错的地方。
请参阅 [配置皮肤 Mod](/mod.md),再检查一遍有没有配置出错的地方。
### 查看皮肤 Mod 的日志
日志是开发者的好朋友,有了它可以快速定位问题原因。
- CSL 的日志位于 `.minecraft/CustomSkinLoader/CustomSkinLoader.log`
- USM 的日志直接输出至游戏日志中
在日志里看看有没有什么 `ERROR` 头的记录,把错误信息拿去翻译一下基本上就能知道原因了。
在日志里看看有没有什么 `ERROR` 头的记录,把错误信息拿去翻译一下基本上就能知道原因了。
## 如何上传 鞘翅/翅膀/Elytra 的材质?
@ -225,54 +188,23 @@ example.com/textures/{hash}
## 忘了密码怎么办
1. 使用皮肤站自带的「找回密码功能」
2. 使用一个「新密码」注册一个新用户,然后在数据库 `users` 表中用新注册用户的 `password` 字段内容替换掉你原来那个用户的 `password` 字段。替换完成后你就可以使用「新密码」登录你原来的账户了。
2. 使用一个「新密码」注册一个新用户,然后在数据库 `users` 表中用新注册用户的 `password` 字段内容替换掉您原来那个用户的 `password` 字段。替换完成后您就可以使用「新密码」登录您原来的账户了。
## 如何开启皮肤库评论区?
请安装「嵌入第三方评论」插件并在插件配置中填入您的评论代码即可。
评论代码是什么?请搜索「第三方评论系统」。
## 如何设置第二个超级管理员?
去皮肤站数据库 `users` 表那个用户记录的 `permission` 字段设置为 `2`
:::tip Permission 字段说明:
0 正常
-1封禁
1管理员
2超级管理员
:::
## 如何同时对接论坛和登录插件?
皮肤站对接至论坛,登录插件也对接至论坛即可。
## 启用数据对接后如何修改玩家角色名?
第一步:打开 `users` 数据表,找到你要修改的用户记录,修改这一条记录的 `username` 字段(注意,不是 `nickname`)为你想要修改的【新角色名】;
![users](https://img.blessing.studio/images/2017/06/29/snipaste_20170629_151335.png)
第二步:打开 `players` 数据表,找到【原来的角色名】对应的数据记录,将该记录的 `name` 字段修改为【新角色名】
![players](https://img.blessing.studio/images/2017/06/29/snipaste_20170629_151613.png)
完成。
::: tip 注意:
如果你对接的是 Discuz、PHPWind 等论坛程序,而且在「数据对接」插件配置页面中将「重复处理」选项配置为「用目标程序上的用户数据覆盖皮肤站」的话,那么【皮肤站】上用户的【昵称】与【绑定的角色名】会被自动同步为该用户在【目标程序(论坛)】上具有【相同邮箱】账户的【用户名】。不愿意这样的话,请同时更改数据对接【目标程序】上的用户名或修改数据对接插件的「重复处理」配置项。
:::
参考链接:[printempw/blessing-skin-server#61](https://github.com/printempw/blessing-skin-server/issues/61)
## Target class [App\Services\Cipher\xxx] does not exist.
站点的密码算法设置不正确,请确保使用 Blessing Skin 支持的算法并且算法名没有拼写错误(区分大小写)。
## MySQL 错误码2054
出错消息会像这样:无法连接至 MySQL/MariaDB 服务器,请检查的配置。服务器返回的信息SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
出错消息会像这样:无法连接至 MySQL/MariaDB 服务器请检查您的配置。服务器返回的信息SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
MySQL 8 默认使用了新的密码验证插件caching_sha2_password而之前的 PHP 版本中所带的 mysqlnd 无法支持这种验证。