Q/A based social network
Find a file
2014-12-21 13:41:57 +01:00
app added "delete all questions" button thing 2014-12-21 13:41:57 +01:00
bin added rspec-core binstub 2014-11-14 13:39:26 +01:00
config added "delete all questions" button thing 2014-12-21 13:41:57 +01:00
db created notification model 2014-12-13 19:30:10 +01:00
lib first commit 2014-08-01 11:23:47 +02:00
log first commit 2014-08-01 11:23:47 +02:00
public Nicolas Cage approves this branch 2014-12-13 19:11:27 +01:00
spec added a few more specs 2014-12-07 12:42:03 +01:00
tmp added a few directories in ./tmp 2014-12-13 16:42:00 +01:00
vendor/assets first commit 2014-08-01 11:23:47 +02:00
.gitignore update gitignore 2014-12-09 22:14:05 +01:00
.rspec removed a (rrer)rspec option 2014-12-05 06:39:33 +01:00
config.ru first commit 2014-08-01 11:23:47 +02:00
Gemfile added foreman 2014-12-12 22:59:35 +01:00
Gemfile.lock added foreman 2014-12-12 22:59:35 +01:00
Procfile updated procfile 2014-12-13 16:44:33 +01:00
Rakefile removed \n 2014-12-19 23:21:15 +01:00
README.md update readme 2014-12-07 12:55:04 +01:00
TODO updated TODO 2014-12-16 15:23:29 +01:00

justask build status

Requirements

  • UNIX-like system (Linux, *BSD, ...)
  • ruby 1.9.3+
  • Bundler
  • PostgreSQL or MySQL

Installation (production)

Database

PostgreSQL

$ 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

MySQL

Note: We do not test for MySQL. Caveat emptor.

$ mysql -u root -p
# change 'hack me' in the command below to a real password
mysql> CREATE USER 'justask'@'localhost' IDENTIFIED BY 'hack me';
mysql> SET storage_engine=INNODB;
mysql> CREATE DATABASE IF NOT EXISTS `justask_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `justask_production`.* TO 'justask'@'localhost';
mysql> \q

Try connecting to the database:

$ mysql -u justask -p -D justask_production

justask

Clone the Source

$ git clone https://git.rrerr.net/nilsding/justask.git justask

Configure It

# Change into the justask directory
$ cd justask

# Copy the example config
$ cp config/justask.yml.example config/justask.yml

# Edit the configuration file
$ vi config/justask.yml

Database Configuration

# PostgreSQL only:
$ cp config/database.yml.postgres config/database.yml

# MySQL only:
$ cp config/database.yml.mysql config/database.yml

# MySQL and remote PostgreSQL only:
$ vi config/database.yml

# Both:
# Make database.yml readable only for you
chmod o-rwx config/database.yml

Install Gems

# For PostgreSQL (note: the option says "without ... mysql")
$ bundle install --deployment --without development test mysql

# Or, if you use MySQL
$ bundle install --deployment --without development test postgres

Initialize Database

$ bundle exec rake db:migrate RAILS_ENV=production

Compile Assets

$ bundle exec rake assets:precompile RAILS_ENV=production

Run the server

# Production mode:
$ mkdir -p ./tmp/sockets/
$ bundle exec unicorn -E production -l unix:./tmp/sockets/justask.sock

# 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