Retrospring/README.md

140 lines
3.8 KiB
Markdown
Raw Normal View History

2015-05-10 13:50:43 -07:00
# Retrospring [![Build Status](https://travis-ci.org/Retrospring/retrospring.svg?branch=master)](https://travis-ci.org/Retrospring/retrospring)
2015-04-01 16:14:54 -07:00
2015-04-19 05:10:15 -07:00
This is the source code that powers Retrospring. Yep, all of it. Including
2015-04-01 16:14:54 -07:00
all the branches where we left off.
2014-08-01 02:23:47 -07:00
2015-04-01 16:35:55 -07:00
<!--
Except for the memes that happened 4 hours before the shutdown. I've edited
it right on the server, without a special branch or something. If you want
to, I can make a branch with all the modifications we made.
-->
2014-10-27 22:36:38 -07:00
## Requirements
2014-08-01 02:23:47 -07:00
2015-03-30 00:36:10 -07:00
- UNIX-like system (Linux, FreeBSD, ...)
2014-12-28 17:34:11 -08:00
- Ruby 2.0.0+
2014-10-27 22:36:38 -07:00
- Bundler
2014-12-28 17:34:11 -08:00
- PostgreSQL
2015-04-01 16:14:54 -07:00
- Redis (for Sidekiq)
- ImageMagick (for image processing)
2014-08-01 02:23:47 -07:00
2014-12-07 03:55:04 -08:00
## Installation (production)
2014-08-01 02:23:47 -07:00
2015-04-01 16:14:54 -07:00
We've installed justask 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
2014-10-27 22:36:38 -07:00
### Database
2014-08-01 02:23:47 -07:00
2015-04-01 16:14:54 -07:00
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
2014-10-27 22:36:38 -07:00
#### PostgreSQL
2014-11-28 13:31:29 -08:00
$ sudo -u postgres psql -d template1
template1=# CREATE USER justask CREATEDB;
template1=# CREATE DATABASE justask_production OWNER justask;
template1=# \q
2014-10-27 22:36:38 -07:00
Try connecting to the database:
2014-11-28 13:31:29 -08:00
$ psql -U justask -d justask_production
2014-10-27 22:36:38 -07:00
2015-04-01 16:14:54 -07:00
### nginx
See [docs/nginx.conf](https://github.com/nilsding/justask/blob/master/docs/nginx.conf)
2015-04-19 06:14:09 -07:00
for the configuration we use on Retrospring.
2015-04-01 16:14:54 -07:00
2014-10-27 22:36:38 -07:00
### justask
#### Clone the Source
2015-04-01 16:14:54 -07:00
$ git clone https://github.com/nilsding/justask.git justask
2014-10-27 22:36:38 -07:00
#### Configure It
2014-11-28 13:31:29 -08:00
# Change into the justask directory
$ cd justask
2014-10-27 22:36:38 -07:00
2014-11-28 13:31:29 -08:00
# Copy the example config
$ cp config/justask.yml.example config/justask.yml
2014-10-27 22:36:38 -07:00
2014-11-28 13:31:29 -08:00
# Edit the configuration file
$ vi config/justask.yml
2014-10-27 22:36:38 -07:00
#### Database Configuration
2014-11-28 13:31:29 -08:00
$ cp config/database.yml.postgres config/database.yml
$ vi config/database.yml
2014-10-27 22:36:38 -07:00
2014-11-28 13:31:29 -08:00
# Make database.yml readable only for you
chmod o-rwx config/database.yml
2014-10-27 22:36:38 -07:00
#### Install Gems
2014-12-28 17:34:11 -08:00
# Deployment:
2014-11-28 13:31:29 -08:00
$ bundle install --deployment --without development test mysql
2014-10-27 22:36:38 -07:00
2014-12-28 17:34:11 -08:00
# Development:
$ bundle install --without production mysql
2014-10-27 22:36:38 -07:00
#### Initialize Database
2014-11-28 13:31:29 -08:00
$ bundle exec rake db:migrate RAILS_ENV=production
2014-10-27 22:36:38 -07:00
#### Compile Assets
2014-11-28 13:31:29 -08:00
$ bundle exec rake assets:precompile RAILS_ENV=production
#### Run the server
# Production mode:
2014-12-28 17:34:11 -08:00
$ foreman start
2014-11-28 13:31:29 -08:00
# Development mode:
$ bundle exec rails server
2015-04-01 16:14:54 -07:00
Now, create an account on your justask installation.
2014-11-28 13:31:29 -08:00
To make yourself an admin, just execute:
$ bundle exec rake 'justask:admin[your_username]' RAILS_ENV=production
If you want to remove admin status from a certain user, you can do this:
$ bundle exec rake 'justask:deadmin[get_rekt]' RAILS_ENV=production
2015-04-19 06:14:52 -07:00
Add/remove moderators (this can also be done via the web interface by visiting an user as an admin):
2014-12-28 17:34:11 -08:00
$ bundle exec rake 'justask:mod[someone_else]' RAILS_ENV=production
$ bundle exec rake 'justask:demod[someone_else]' RAILS_ENV=production
2015-01-06 06:21:32 -08:00
2015-04-19 06:14:52 -07:00
Add/remove supporters (this can also be done via the web interface by visiting an user as an admin/mod):
2015-01-06 06:21:32 -08:00
$ bundle exec rake 'justask:sup[someone_else]' RAILS_ENV=production
2015-03-30 00:36:10 -07:00
$ bundle exec rake 'justask:desup[someone_else]' RAILS_ENV=production
Export user data:
$ bundle exec rake 'justask:export[jdoe@example.tld]' RAILS_ENV=production
2015-04-01 16:14:54 -07:00
Find the user(s) with the most self-asked anonymous questions:
$ bundle exec rake justask:loners
2015-04-19 06:14:52 -07:00
## The Official Retrospring Closedown Soundtrack™ (now redundant)
2015-04-01 16:14:54 -07:00
* [Scooter - Can't Stop The Hardcore](https://www.youtube.com/watch?v=nJ3bet-Y79w)
* [Darude - Sandstorm](https://www.youtube.com/watch?v=y6120QOlsfU)
* [Max Raabe - Oops I Did It Again](https://www.youtube.com/watch?v=qYr9kIyambE)
2015-04-01 16:39:55 -07:00
## License
AGPLv3.