To log in to postgres user:
sudo su postgresType your sudo password.
To create a database user for the project:
createuser -P -s airsoftType CHANGE-ME.
Change back to your normal user:
exitTo setup the database:
rails db:setupOther useful commands are rails db:create, db:migrate, db:seed and db:reset.
To compile the contents of app/javascript:
bin/webpackTo run compile server:
bin/webpack-dev-serverThese are necessary when you change some JS or CSS that are bundled to the app.
Create the persistent database volume:
docker volume create --name=airsoft_database`Run only database container:
docker-compose up --buildUse the -d switch to run it detached in the background.
The database is accessible on port 5433, so you must update the port in config/database.yml.
After creating the database container you have to set up the database from the console.
Create an Outh Client at https://auth.sch.bme.hu with the follwing callback url:
http://localhost:3000/users/auth/authsch/callbackRun rails credentials editor
rails credentials:edit --environment developmentor if it complains about default editor not being set
EDITOR=nano rails credentials:edit --environment developmentcopy the following yaml, and replace with OAuth credentials
authsch:
api_key: <authsch client id>
secret: <authsch secret>and then save the file. It will generate a key and encrypted crededentials file. These should be ommited from git commits.
The project uses rubocop to enforce good quality code. On the local machine you can run rubocop to detect mistakes with
rubocopAnd you can automatically fix minor mistakes with
rubocop -a- Front page background image by Michael Mráz on Unsplash.
- Default post thumbnail image by Daniel Stuben on Unsplash.