LinuxFr.org is a french web site speaking of Linux and Free Software.
This git repository is the rails application that run on LinuxFr.org.
The following instructions will help you to install the Rails part of LinuxFr.org on a Debian box.
-
First install some Debian packages:
-
Configure the database:
> CREATE DATABASE linuxfr_rails; > GRANT ALL PRIVILEGES ON linuxfr_rails.* TO "linuxfr_rails"@"localhost"; > QUIT; (return to user)Statistics need time zone at SQL level. You'll need to population time_zone* tables.
-
Install RVM (more details on https://rvm.io/rvm/install ):
$ curl -L https://get.rvm.io | bash
And follow the instructions.
-
Install Ruby with RVM:
$ rvm install 2.0.0 $ rvm use --default 2.0.0
-
Clone the repository, configure and install gems:
$ git clone git://github.com/nono/linuxfr.org.git $ cd linuxfr.org $ cp config/database.yml{.sample,} $ cp config/secret.yml{.sample,} $ gem install bundler rake $ bundle install
-
Finish to configure:
$ desi install $ desi start $ rake db:setup (if you're updating, you'll need an other step: redis-cli flushdb) $ ./script/rails r '[Diary, News, Page, Poll, Post, Tracker, WikiPage].each {|m| m.tire.index.refresh }'
-
Let's run it:
$ ./script/rails server thin $ x-www-browser http://127.0.0.1:3000/
-
Create an admin account:
- Create an account
- Get confirmation link in the console and confirm the account
- Get password in the console
- Give admin role to this account with
mysql linuxfr_rails
mysql> UPDATE accounts SET role='admin' WHERE login='xxxxxx';
- Reload the page on the site, you should be admin.
If you want the full stack for running LinuxFr.org, you should also look at:
- The admin files
- The migration script
- The board daemon
- The share daemon
- The epub daemon
- The img daemon
-
Be sure that redis and ElasticSearch are running
-
Create the test database:
$ bundle exec rake db:test:prepare
-
And now, just run rspec (and repeat this step until done):
$ bundle exec rspec spec
CSS are written in sass and compiled with the Rails assets pipeline.
If you just want to compile a CSS without installing Rails and all its
dependency, you can install the sass
gem and launch:
./script/compile_sass app/assets/stylesheets/application.css.scss > app.css
The code is licensed as GNU AGPLv3. See the LICENSE file for the full license.
The default avatar is a modified Tux.
Iconic icons are licenced CC by-sa 3.0.
♡2011 by Bruno Michel. Copying is an act of love. Please copy and share.