mcpa-stlouis / hack-the-arch

Welcome to HackTheArch! A free open source scoring server for cyber Capture the Flag competitions!
https://hackthearch.herokuapp.com
MIT License
67 stars 28 forks source link

Ruby version #16

Closed noraj closed 7 years ago

noraj commented 7 years ago

Is it possible to make hack-the-arch working on Ruby 2.3.1+ and not only ruby 2.3.3 (ex: ruby 2.4.0)?

noraj commented 7 years ago

Writing ruby '~> 2.3.3' displays Your Ruby version is 2.4.1, but your Gemfile specified ~> 2.3.3. I need to write ruby '>= 2.3.3'.

Can you fix it?

I see a lot of gem version are fixed in the gemfile

noraj commented 7 years ago

I did it but don't you want to include this change? Why using a fixed version of ruby?

paullj1 commented 7 years ago

The reason for using any fixed version is to make sure that the config works. Sometimes newer versions can break the entire build as pointed out by Michael Hartl.

paullj1 commented 7 years ago

Let me know if that did it.

noraj commented 7 years ago

Until you officially support ruby 2.4.0 the best is maybe to use old version with RVM:

$ rvm install 2.3.3
$ rvm use 2.3.3
$ git clone https://github.com/mcpa-stlouis/hack-the-arch.git
$ cd hack-the-arch/
$ cd certs/
$ openssl genrsa -des3 -out server.orig.key 2048
$ openssl rsa -in server.orig.key -out server.key
$ openssl req -new -key server.key -out server.csr
$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
$ printf %s '127.0.0.1 localhost.ssl' | sudo tee -a /etc/hosts
$ cd ..
$ gem install bundler
$ bundle install
$ bundle exec rails secret
$ vim .env      # changed HOST=localhost and SECRET_KEY_BASE
$ docker-compose up -d

Here is what I did, I'm still pulling containers. I'll tell you if I have any problem in the following of the installation.

paullj1 commented 7 years ago

So the good news about docker is that you don't need to install ruby or bundle locally. That all happens inside the container. The only thing you need on the host is the docker engine, and docker-compose.

paullj1 commented 7 years ago

But otherwise, I agree. RVM is the way to go if you want to build/deploy/test/develop locally without docker.

noraj commented 7 years ago

I successfully built all docker containers. But have a problem with Puma: https://github.com/mcpa-stlouis/hack-the-arch/issues/25