There are also 2 other sites used as CDNS:
- cdn.013.team - used for hosting static web asssets (images, videos, icons etc)
- usercontent.013.team - used for hosting usercontent such as avatars etc.
The api requires for each node to be able to include a php file containing secrets and config info using the following format:
<?php
// infrastrucure
const MYSQL_DATABASE = "team013";
const MYSQL_USERNAME = "team013";
const MYSQL_PASSWORD = "database password";
const MYSQL_SERVER = "localhost";
const SESSION_VALIDATION_BASE = "http://localhost:4231/";
// encryption
const SESSION_SIGNING_ALGO = "sha3-256";
const SESSION_ENCRYPTION_ALGO = "aes-256-cbc";
const PASSWORD_RESET_ENCRYPTION_ALGO = "aes-256-cbc";
const PASSWORD_RESET_HMAC_ALGO = "sha3-256";
// gcp
// both 256 bit keys
const SESSION_ENCRYPTION_KEY_HEX = "session encryption key";
const SESSION_SIGNING_KEY_HEX = "session signing key";
const PASSWORD_RESET_ENCRYPTION_KEY_HEX = "forgot password key";
const PASSWORD_RESET_HMAC_KEY_HEX = "forgot password signing key";
// gcp
const GCP_CREDENTIALS_OBJECT = Array(); // creds.json array form
const GOOGLE_ASSET_BUCKET_NAME = "usercontent.013.team"; // storage bucket name
?>
-
Install PHP VS16 x64 Non Thread Safe
-
Extract to
C:\php
-
(Optional) Install the PHP Server extension for VS Code
-
(If using the extension) Change the php server location to serve from
web/
OR open theweb/
folder directly in vscode -
In the extension settings give the directory of your php folder and php.ini to PHP Server
-
Start the php server in the
web
folderMake sure there is a trailing slash in URLs because php server wont load styles or scripts if there isnt.
URLs should look like this:
localhost:3000/dashboard/
localhost:3000/
-
-
(If not) The repo comes with some run and debug configurations, select
php launch web server
navigate to localhost:8000
The site should now function like normal on your local machine.
- change the php include path to include the api folder include_path = ".;C:..\githubrepo\api"
- enable the openssl, curl, mysqli, mbstring, fileinfo extensions
- download the GTSRootR1 and Digicert GlobalRoot G2 certificate from the iternet
- add the
curl.cainfo="path/to/certificate"
entry to the config under the[curl]
heading - install composer
- install the composer packages: google/cloud-storage in the api folder
- install mariadb and setup an account to access
- create the secrets.php
- generate 2 encryption keys in a hex representation
- insert the database credentials you just created
- import the database format (dump.sql on the discord or get the latest backup from gcp) using 'mariadb < dump.sql' with the credentials
- instead of running the web server like above select
RUN DEVELOPMENT API
- the api will need a copy of the invalidation service running so make sure you can run (and possibly build) it
- in global-api.js uncomment the const API_BASE and change it to the address of the php server you just started