Locker is an application for managing user data from Torn City. It is developed my a small team of folks in the WarBirds family of factions.
If you want to quickly deploy Locker, you may want to look into DockerLocker. If you want a more traditional deployment, you will need:
- An http server. Apache or nginx is fine.
- PHP 7.2-mbstring with the following extensions:
- pdo
- pdo_mysql
- mysqli
- A MySQL (or MariaDB) server.
- PHP Composer.
Grab a copy of the Locker repository. Set the root directory for your web server to Locker/public. DO NOT set your web server's root directory to the Locker repository, otherwise you will be serving your configuration files out to the world.
Copy Locker/config/locker.json.default to locker.json. Update locker.json file to your liking. Currently you should only need to update the database information.
In the Locker directory, run composer install
to install dependencies.
Import the default, empty schema, located in Locker/database/001-schema.sql, into your database. If there are additional files, apply them in order (001, 002, 003, etc.)
Create /var/log/locker and ensure it is writable by your web service. As an alternative, you can alter the logging configuration to write somewhere else (/tmp is fine if you're just looking around), or disable it altogether (although this is not recommended).
User registration has not been completed. For now, you will need to create users manually:
INSERT INTO locker.users (tornid, username, password, tornuserkey, userrole, useremail) VALUES (...)
TornID: Your user ID on Torn.
Username: Can be empty.
Password: A sha1 hash of your password.
TornUserKey: Your Torn API Key.
UserRole: admin
for an admin, empty otherwise.
UserEmail: Email address to use for logging in.
At that point you should be able to access Locker and log in.
We now have unit tests using the PHPUnit Framework. You can run them via:
vendor/bin/phpunit --bootstrap vendor/autoload.php tests/