Retrospring/README.md

93 lines
2.1 KiB
Markdown
Raw Normal View History

2014-10-27 22:36:38 -07:00
# justask [![build status](https://ci.rrerr.net/projects/9/status.png?ref=master)](https://ci.rrerr.net/projects/9?ref=master)
2014-08-01 02:23:47 -07:00
2014-10-27 22:36:38 -07:00
## Requirements
2014-08-01 02:23:47 -07:00
2014-10-27 22:36:38 -07:00
- UNIX-like system (Linux, *BSD, ...)
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
- Redis
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
2014-10-27 22:36:38 -07:00
### Database
2014-08-01 02:23:47 -07:00
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
### justask
#### Clone the Source
2014-11-28 13:31:29 -08:00
$ git clone https://git.rrerr.net/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
Create an account on your justask installation.
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
2014-12-28 17:34:11 -08:00
Add/remove moderators:
$ 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
Add/remove supporters:
$ bundle exec rake 'justask:sup[someone_else]' RAILS_ENV=production
$ bundle exec rake 'justask:desup[someone_else]' RAILS_ENV=production