pwerken / va-void
Vortex Adventures - Vortex Online Incharacter Database
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Type:project
pkg:composer/pwerken/va-void
Requires
- php: >=8.2
- bacon/bacon-qr-code: ^3.0
- cakephp/authentication: ^3.0.0
- cakephp/authorization: ^3.0.0
- cakephp/cakephp: 5.2.*
- cakephp/migrations: @stable
- cakephp/plugin-installer: ^2.0
- firebase/php-jwt: ^6.5
- jeremyharris/cakephp-lazyload: ^5.0
- mpdf/mpdf: ^8.2
- socialconnect/auth: ^3.3
Requires (Dev)
- cakedc/cakephp-phpstan: ^4.0
- cakephp/cakephp-codesniffer: ^5.0
- composer/composer: ^2.8
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5.5 || ^11.1.3 || ^12.1
This package is not auto-updated.
Last update: 2025-11-09 01:56:41 UTC
README
VA - VOID
Vortex Adventues - Vortex Online Incharacter Database
Install
Download Composer or update composer self-update.
- Clone the repository
- Run
composer install
If this didn't create theconfig/app.php(or set folder permissions), then run this command again. - Run
./bin/cake admin checks- Fix everything it reports as NOT ok (the red lines).
- This mostly consists of reading and editing
config/app.php. - There you need to setup the
'Datasources'and any other configuration relevant for your site. - The database tables can be created with Migrations
./bin/cake migrations migrate
- Configure apache to serve the
webrootfolder.
Example 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> - Browse to /admin/checks
- Again, fix everything it reports as NOT ok.
- Optionally: load some initial database content with
./bin/cake migrations seed
Update
./bin/cake backup export- Make a backup of your data.
git pull- Retrieves the latest code
composer update- Installs/updates package dependencies.
- This is required if
composer.jsonwas modified, otherwise it is still recommended.
./bin/cake migrations migrate- Updates the database table structure(s).
./bin/cake backup export- Optionaly: create a backup before resuming regular usage/operations.
Database backups
Database backups can be listed, exported and imported using the CLI.
./bin/cake backuplists all the database backups present../bin/cake backup export [description]will created a new backup file../bin/cake backup import <file>Import a backup (or any other) sql file.
This tool uses the commandline mysql and mysqldump commands internally.
The created backup files are stored in the backups/ folder.
Warning: old backups might not be compatible with newer tables structures. It is possible to use cake migrations to revert to an earlier database structure. Don't forget to save your data / make a backup before doing this!
Social provider login
Call the /auth/social api endpoint to get the list of all supported social login providers. For each provider the result contains a url and authUri link. Both need to be customized by the front-end before they can be used.
-
First in the
authUrireplace theSTATEandCALLBACKstrings:STATEshould be a random string used to prevent cross-site request forgeryCALLBACKis the front-end url where the user gets redirect to after login
-
Now redirect the user to this modified
authUrito start the login proces. -
On succesful login the user gets redirected to the
CALLBACKlocation. -
Check that the returned
statequery parameter matches with the earlier providedSTATEvalue. -
In the
urlof the social provider replaceCODEandCALLBACK:CODEwith thecodestring we got in the query parameter after the loginCALLBACKmust be the same as used in theauthUri
-
Perform a GET on the modified
url. This should yield the same result as a regular user+name password. The result contains a JWT that can be used for all following interactions with the void api. Similar, a failed login will result in a 401 error response.
sequenceDiagram
participant B as Browser
participant C as Client App
participant A as VOID Api
participant P as Provider
B-)+C: get login page
activate B
C-)+A: (0) HTTP GET /auth/social
A--)-C: list of providers, each with "authUri" and "url"
C->>C: (1) replace STATE and CALLBACK in "authUri"
C--)-B: login page
B->>B: user selects login provider
B-)+P: (2) redirect to modified "authUri"
P--)B: login page
B-)P: user authenticates
P--)-B: (3) redirect to CALLBACK with CODE and STATE
B-)+C:
C->>C: (4) check STATE is unmodified
C->>C: (5) replace CODE and CALLBACK in "url"
C-)+A: (6) GET "url"
A-)+P: verify CODE
P-)-A: user information
A->>A: find player plin
A--)-C: provide JWT
Note over C,A: use JWT to access VOID Api as user
C-)+A: GET /players/<plin>
A--)-C:
C--)-B: ...
deactivate B
Loading