hustodemon / software-o-o

The site behind software.opensuse.org. It is the default web interface to download openSUSE distribution and to search for OBS packages.Packages at https://build.opensuse.org/project/show/openSUSE:infrastructure:software.opensuse.org

Home Page:http://software.opensuse.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

software.opensuse.org

Build Status

Ruby on Rails application powering https://software.opensuse.org

We hope you'll get involved! Read our Contributors' Guide for details.

Installing dependencies in a (open)SUSE system

zypper ref
zypper in ruby ruby-devel rubygem-bundler gcc make libxml2-devel libxslt-devel

Running the application locally

Just for running it in development mode. If you are playing to deploy it in a server, please apply good Ruby on Rails practices (like generating your own keys for secrets.yml).

git clone https://github.com/openSUSE/software-o-o.git
cd software-o-o
git submodule init
git submodule update

bundle package
bundle exec rails s

Enjoy your software.opensuse.org clone at http://127.0.0.1:3000/

Running the application in production

The application will take the following environment variables:

  • SECRET_KEY_BASE: See Encrypted Session Storage in Rails documentation.
  • API_USERNAME and API_PASSWORD: Credentials to the Open Build Service API end-point
    • These can be replaced with OPENSUSE_COOKIE if you have admin access to the Open Build Service instance.
  • RAILS_ENV

Puma will honor other variables too:

  • WEB_CONCURRENCY
  • RAILS_MAX_THREADS
  • PORT
  • RACK_ENV

Memcache

memcache should be running. It seems to be hardcoded in environments/production.rb to localhost:11211. This probably needs to be fixed, as the dalli gem, automatically uses MEMCACHE_SERVERS env variable or 127.0.0.1:11211 as default.

PaaS

If you plan to run the application on PaaS, make sure you set all the above variables correctly.

Official instance

The official instance is deployed using an rpm package. The rpm package bundles all the required gems.

There is a software_opensuse_org.service you can control via systemd.

The systemd service will read the variables described above from /etc/software_opensuse_org.conf in the form of an EnvironmentFile:

VAR1=value1
VAR2=value2
...

Development environment using Vagrant

There is also a Vagrant setup to create our development environment. All the tools needed for this are available for Linux, MacOS and Windows.

  1. Install Vagrant and docker. Both tools support Linux, MacOS and Windows.

  2. Clone this code repository:

    git clone --recurse-submodules git@github.com:openSUSE/software-o-o.git
    
  3. Build your Vagrant box:

    vagrant up
    
  4. Attach to your new development box

    docker attach software_web
    
  5. Setup the database

    rake db:setup db:seed
    
  6. Start the app

    rails server
    
  7. Enjoy your software.opensuse.org clone at http://127.0.0.1:3000/

If you exit the shell inside the vagrant box your development environment is stopped. Want to continue? Run vagrant up and docker attach software_web again. Happy hacking!

About

The site behind software.opensuse.org. It is the default web interface to download openSUSE distribution and to search for OBS packages.Packages at https://build.opensuse.org/project/show/openSUSE:infrastructure:software.opensuse.org

http://software.opensuse.org/


Languages

Language:Ruby 44.1%Language:HTML 40.6%Language:CSS 12.7%Language:JavaScript 2.6%