pwerken / va-void
漩涡冒险 - 漩涡在线角色数据库
dev-main
2024-08-31 08:26 UTC
Requires
- php: >=8.2
- cakephp/authentication: ^2.0
- cakephp/authorization: ^2.0
- cakephp/cakephp: ^4.5
- cakephp/migrations: ^3.2
- cakephp/plugin-installer: ^1.3
- firebase/php-jwt: ^6.5
- setasign/fpdf: ^1.8
- socialconnect/auth: ^3.3
Requires (Dev)
- cakephp/bake: ^2.6
- cakephp/cakephp-codesniffer: ^5.1
- phpunit/phpunit: ^9.6
- psy/psysh: @stable
Suggests
- cakephp/repl: Console tools for a REPL interface for CakePHP applications.
- dereuromark/cakephp-ide-helper: After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility.
- markstory/asset_compress: An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.
- phpstan/phpstan: PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code.
This package is not auto-updated.
Last update: 2024-09-14 19:25:31 UTC
README
VA - VOID
漩涡冒险 - Vortex Online Incharacter Database
安装
下载 Composer 或更新 composer self-update.
- 克隆仓库
- 运行
composer install
如果这没有创建config/app.php(或设置文件夹权限),则再次运行此命令。 - 运行
./bin/cake admin checks- 修复它报告为“不正常”的所有内容(红色线条)。
- 这主要涉及读取和编辑
config/app.php。 - 在那里您需要设置
'Datasources'和任何与您的网站相关的其他配置。 - 可以使用迁移
./bin/cake migrations migrate创建数据库表。
- 配置apache以提供
webroot文件夹。
示例 apache vhost.conf<VirtualHost *:80> ServerName api.your.domain DocumentRoot /var/www/void/webroot <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> CustomLog ${APACHE_LOG_DIR}/access.void.log combined </VirtualHost> - 浏览到 /admin/checks
- 再次,修复它报告为“不正常”的所有内容。
- 可选:使用
./bin/cake migrations seed加载一些初始数据库内容
更新
./bin/cake backup export- 备份您的数据。
git pull- 检索最新代码
composer update- 安装/更新包依赖项。
- 如果修改了
composer.json,则此操作是必需的,否则仍然建议执行。
./bin/cake migrations migrate- 更新数据库表结构。
./bin/cake backup export- 可选:在恢复常规使用/操作之前创建备份。
数据库备份
可以使用CLI列出、导出和导入数据库备份。
./bin/cake backup列出所有现有的数据库备份。./bin/cake backup export [description]将创建一个新的备份文件。./bin/cake backup import <file>导入备份(或任何其他)sql文件。
此工具内部使用命令行mysql和mysqldump命令。
创建的备份文件存储在 backups/ 文件夹中。
警告:旧备份可能与新表结构不兼容。可以使用 cake migrations 还原到较早的数据库结构。在进行此操作之前,请务必保存您的数据/创建备份!
社交提供商登录
调用 /auth/social API端点以获取所有支持的社会登录提供商列表。对于每个提供商,结果包含一个 url 和 authUri 链接。在它们可以使用之前,都需要由前端进行自定义。
-
首先在
authUri中替换STATE和CALLBACK字符串STATE应该是一个用于防止跨站请求伪造的随机字符串CALLBACK是用户登录后将被重定向到的前端url
-
现在将用户重定向到这个修改后的
authUri以开始登录过程。 -
登录成功后,用户将被重定向到
CALLBACK位置。 -
检查返回的
state查询参数是否与之前提供的STATE值匹配。 -
在社会提供商的
url中替换CODE和CALLBACKCODE应该是登录后在查询参数中获得的code字符串CALLBACK必须与authUri中使用的相同
-
对修改后的
url执行 GET 操作。这应该会产生与普通用户+姓名密码相同的结果。结果中包含一个 JWT,可用于与 void api 的所有后续交互。类似地,登录失败将导致 401 错误响应。