-
-
Notifications
You must be signed in to change notification settings - Fork 35
Setup
Warning
This guide is outdated, please read the new documentation on self-hosting Retrospring here!
This page will cover general setup steps for your own local/production running Retrospring instance!
- UNIX-like system (Linux, FreeBSD, ...)
- Ruby 2.7.0+
- Node 12+
- Bundler
- PostgreSQL
- Redis (for Sidekiq)
- ImageMagick (for image processing)
- Install Docker for your platform of choice
- Follow the steps outlined in Setup/General
- Configure your database using the environment variables given in
docker-compose.yml
- Configure your database using the environment variables given in
- Build the Docker image for Retrospring and start up the required containers
docker-compose up -d --build
Retrospring should be running on localhost:3000
. You can access the container running the application using docker-compose exec web bash
, this is where you need to run bundle exec rails *
commands or interact with Rails from the command line in general
Note: If you are running Docker on WSL make sure you also clone Retrospring into a WSL mount to fully utilize the performance benefits of the subsystem
- Install Homebrew
- Run
brew bundle
in this project's directory to install all dependencies. - Install
yarn
usingnpm
:npm install yarn
- Follow the steps outlined in Setup
If you do not wish to install Node or wish to install it by means other than Homebrew, use HOMEBREW_BUNDLE_BREW_SKIP=node brew bundle
We've installed Retrospring on FreeBSD 10 using rvm. What we also did was creating a new, seperate user just for justask to run in. On FreeBSD, this is done with:
# pw user add justask
At Retrospring, we were using PostgreSQL as the database backend. The software might work on MySQL too, but that was not tested.
Installation from Ports (using portmaster
):
# portmaster databases/postgresql93-server
$ sudo -u postgres psql -d template1
template1=# CREATE USER justask CREATEDB;
template1=# CREATE DATABASE justask_production OWNER justask;
template1=# \q
Try connecting to the database:
$ psql -U justask -d justask_production
You'll need a web server that acts as a reverse proxy to Retrospring.
See docs/nginx.conf for the configuration we use on Retrospring.
- Clone the repository
git clone https://github.com/Retrospring/retrospring.git
- Configure Retrospring
- Copy
config/justask.yml.example
toconfig/justask.yml
and edit its contents - Copy
config/database.yml.example
toconfig/database.yml
and edit its contents
- Copy
// Ruby
$ bundle install --without production mysql
// Node
$ yarn install
$ bundle exec i18n export
$ bundle exec rake db:prepare RAILS_ENV=development
$ yarn run build
$ yarn run build:css
$ bundle exec rails server
// Ruby
$ bundle install --deployment --without development test mysql
// Node
$ yarn install --frozen-lockfile
$ bundle exec i18n export
$ bundle exec rake db:migrate RAILS_ENV=production
$ bundle exec rake assets:precompile RAILS_ENV=production
$ foreman start
Now visit your newly created instance at localhost:3000 or the configured hostname and register a new account.
To give yourself administrator permissions there's two supported ways:
Rake
$ bundle exec rake 'justask:admin[your_username]' RAILS_ENV=...
your_username
being your username and RAILS_ENV
being set to either development
or production
You can find more rake tasks to use here!
Rails Console
$ bundle exec rails c RAILS_ENV=...
> @user = User.first
> @user.add_role :administrator
> @user.save!