retrospring/README.md

140 lines
3.7 KiB
Markdown
Raw Normal View History

# Retrospring [![Build Status](https://travis-ci.org/Retrospring/retrospring.svg)](https://travis-ci.org/Retrospring/retrospring)
2015-04-02 01:14:54 +02:00
2015-04-19 14:10:15 +02:00
This is the source code that powers Retrospring. Yep, all of it. Including
2015-04-02 01:14:54 +02:00
all the branches where we left off.
2014-08-01 11:23:47 +02:00
2015-04-02 01:35:55 +02: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-28 06:36:38 +01:00
## Requirements
2014-08-01 11:23:47 +02:00
2015-03-30 09:36:10 +02:00
- UNIX-like system (Linux, FreeBSD, ...)
2014-12-29 02:34:11 +01:00
- Ruby 2.0.0+
2014-10-28 06:36:38 +01:00
- Bundler
2014-12-29 02:34:11 +01:00
- PostgreSQL
2015-04-02 01:14:54 +02:00
- Redis (for Sidekiq)
- ImageMagick (for image processing)
2014-08-01 11:23:47 +02:00
2014-12-07 12:55:04 +01:00
## Installation (production)
2014-08-01 11:23:47 +02:00
2015-04-02 01:14:54 +02: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-28 06:36:38 +01:00
### Database
2014-08-01 11:23:47 +02:00
2015-04-02 01:14:54 +02: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-28 06:36:38 +01:00
#### PostgreSQL
2014-11-28 22:31:29 +01:00
$ sudo -u postgres psql -d template1
template1=# CREATE USER justask CREATEDB;
template1=# CREATE DATABASE justask_production OWNER justask;
template1=# \q
2014-10-28 06:36:38 +01:00
Try connecting to the database:
2014-11-28 22:31:29 +01:00
$ psql -U justask -d justask_production
2014-10-28 06:36:38 +01:00
2015-04-02 01:14:54 +02:00
### nginx
See [docs/nginx.conf](https://github.com/nilsding/justask/blob/master/docs/nginx.conf)
2015-04-19 15:14:09 +02:00
for the configuration we use on Retrospring.
2015-04-02 01:14:54 +02:00
2014-10-28 06:36:38 +01:00
### justask
#### Clone the Source
2015-04-02 01:14:54 +02:00
$ git clone https://github.com/nilsding/justask.git justask
2014-10-28 06:36:38 +01:00
#### Configure It
2014-11-28 22:31:29 +01:00
# Change into the justask directory
$ cd justask
2014-10-28 06:36:38 +01:00
2014-11-28 22:31:29 +01:00
# Copy the example config
$ cp config/justask.yml.example config/justask.yml
2014-10-28 06:36:38 +01:00
2014-11-28 22:31:29 +01:00
# Edit the configuration file
$ vi config/justask.yml
2014-10-28 06:36:38 +01:00
#### Database Configuration
2014-11-28 22:31:29 +01:00
$ cp config/database.yml.postgres config/database.yml
$ vi config/database.yml
2014-10-28 06:36:38 +01:00
2014-11-28 22:31:29 +01:00
# Make database.yml readable only for you
chmod o-rwx config/database.yml
2014-10-28 06:36:38 +01:00
#### Install Gems
2014-12-29 02:34:11 +01:00
# Deployment:
2014-11-28 22:31:29 +01:00
$ bundle install --deployment --without development test mysql
2014-10-28 06:36:38 +01:00
2014-12-29 02:34:11 +01:00
# Development:
$ bundle install --without production mysql
2014-10-28 06:36:38 +01:00
#### Initialize Database
2014-11-28 22:31:29 +01:00
$ bundle exec rake db:migrate RAILS_ENV=production
2014-10-28 06:36:38 +01:00
#### Compile Assets
2014-11-28 22:31:29 +01:00
$ bundle exec rake assets:precompile RAILS_ENV=production
#### Run the server
# Production mode:
2014-12-29 02:34:11 +01:00
$ foreman start
2014-11-28 22:31:29 +01:00
# Development mode:
$ bundle exec rails server
2015-04-02 01:14:54 +02:00
Now, create an account on your justask installation.
2014-11-28 22:31:29 +01: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 15:14:52 +02:00
Add/remove moderators (this can also be done via the web interface by visiting an user as an admin):
2014-12-29 02:34:11 +01:00
$ bundle exec rake 'justask:mod[someone_else]' RAILS_ENV=production
$ bundle exec rake 'justask:demod[someone_else]' RAILS_ENV=production
2015-01-06 15:21:32 +01:00
2015-04-19 15:14:52 +02:00
Add/remove supporters (this can also be done via the web interface by visiting an user as an admin/mod):
2015-01-06 15:21:32 +01:00
$ bundle exec rake 'justask:sup[someone_else]' RAILS_ENV=production
2015-03-30 09:36:10 +02: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-02 01:14:54 +02:00
Find the user(s) with the most self-asked anonymous questions:
$ bundle exec rake justask:loners
2015-04-19 15:14:52 +02:00
## The Official Retrospring Closedown Soundtrack™ (now redundant)
2015-04-02 01:14:54 +02: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-02 01:39:55 +02:00
## License
AGPLv3.