In short, Gandalf is a project that does everything that makes organising and managing an event a lot easier for FK-clubs of the University of Ghent. The application is written specifically for the UGent FakulteitenKonvent. It allows students to register for events and it also interacts with the FK-Enrolment database and allows members of student unions to subscribe to member-only events from their clubs.
- Install the prerequisites: ruby 3.3.1, preferably using asdf, and some system libraries depending on your OS (e.g. imagemagick)
- Install the ruby dependencies:
bin/bundle
- Start up the database, sidekiq and rails server by running
bin/dev
- Set up some database data using
rails db:setup
- Browse to http://localhost:3000
In case you want to start the webserver in your IDE, just run docker-compose up -d
and start Sidekiq manually (bundle exec sidekiq
)
If you have NixOS or Nix installed, you can use the flake.nix
to avoid the hassle of installing the right dependencies.
- Make sure you have Nix installed.
- Run
nix develop
- Done! You have everything installed. You can now:
- Install Ruby dependencies with
gems:refresh
- Start EVERYTHING with
server:start
- Install Ruby dependencies with
ssh gandalf@pratchett.ugent.be -p2222
podman exec -it gandalf_web_1 /bin/bash
bundle exec rails c
# Making someone admin
User.find_by(cas_mail: 'Voornaam.Familienaam@UGent.be').update!(admin: true)
# Adding a user to a club
Club.find_by(internal_name: 'zeus').users << User.find_by(cas_mail: 'Voornaam.Familienaam@UGent.be')
You need a https setup to use cas. The process is quite simple. You need to generate a self signed certificate which is just a few commands and then
openssl genrsa -des3 -passout pass:xxxx -out server.pass.key 2048
openssl rsa -passin pass:xxxx -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
rails s -b 'ssl://localhost:8080?key=server.key&cert=server.crt'