This is a submission for the Shoprenter's backend developer job.
Live version: https://secretserver.unr.hu/
Included a default .env file with a preconfigured Sqlite database and unless you have a production ready stuff, you should use this default.
If you want to use anything else, please consult the Symfony Documentation about the correct configuration.
Checkout the repository and change dir (same for local and deployed):
git clone https://shr:yRmglFOqNMbwpnuhP5iy@git.unr.hu/r/shoprenter-secretserver.git secretserver.website.tld
cd secretserver.website.tld
composer install --no-dev
This is will create an Sqlite DB (or anything else if you changed the config) with the correct schema (you can check the .env file about the details) in the project dir (var/data.db
):
php bin/console doctrine:database:create
php bin/console doctrine:migrations:migrate
In theory if you have good sysadmins, you have SELinux.
Tell them to add httpd_sys_rw_content_t
type to the project var/* directory and you are good to go.
setenforce 0
is highNever turn off SELinux if you have it, its easy: let the almighty SERuler know we have some stuff that should be R/W by the webserver (you have to be in the project directory):
semanage fcontext -a -t httpd_sys_rw_content_t "`pwd`/var(/.*)?"
At this point you have a proper type context enabled on the var files (if your OS has correctly configured context), but SELinux cannot see it yet, you have to "activate" it: restorecon -R -v "`pwd`/var/"
You should see the context you modified on the files, the app is able to function now. This is a permanent change, it sticks (reloads) even after a restart.
The .env by default is in debug mode, so if something goes sideways, you should be able to see it.
Fire up this baby: symfony server:start
Only God knows what you are using (Apache, Nginx, Windows Server), you can configure as a normal symfony project: https://symfony.com/doc/current/setup/web_server_configuration.html
If you followed point-by-point your version of the project does not contains dev libraries, you have to install it: composer install
And get the tests running: php bin/phpunit
Probably you will get some errors, most likely the recent removal of monolog from default Symfony install.
My only option would be to mask up, but I prefer not to: https://github.com/liip/LiipTestFixturesBundle/issues/135
Are welcome @ (vfiber@gmail.com)[mailto:vfiber@gmail.com] / (adam.fibinger@gmail.com)[mailto:adam.fibinger@gmail.com]