skyOS is a web-based virtual airline management system written in Rails and used by Lonestar Cargo.
It is an open-source project that may be used by anyone running a Virtual Airline. We encourage forks and pull-requests for new features and fixes!
Developed with Ruby: 2.7 / Rails: 6
To get the Rails server running locally:
- Clone this repo
bundle install
to install required dependenciesyarn install --check-files
install front-end dependencies- configure
.env
file for development/test databases (see.env.template
) rake db:prepare
to create and seed databaserake skyos:install
(optional) create an administrative user and load helpful defaultsrake skyos:create_admin
(optional) instead ofinstall
to create an administrative user only.rails s
to start the local server
This repository builds and releases a Docker image to our GitHub Docker repository. See docker-compose.yml.example for an example on how to pull the latest release and customize for your production environment.
This repository comes equipped to be run within Docker. The easiest way to build your own image is using docker-compose.
Build the Docker image using:
% docker-compose build
On first boot, the image will connect to the database specified in your
docker-compose.yml
or to the PostgreSQL server specified via environment
variables (see docker-compose.yml.example)
Load defaults and create an initial administrative user:
% docker-compose run --rm app rake skyos:install
Optionally populate the airports table (courtesy OurAirports)
% docker-compose run --rm app rake skyos:load_airports
After setting up, you can run the application and dependencies:
% docker-compose up -d
Syntax | Description | |
---|---|---|
DATABASE_URL | required | Database URL see docker-compose.yml.example |
RAILS_HOSTNAME | required | External hostname for application |
REDIS_URL | required | Redis URL see docker-compose.yml.example |
SECRET_KEY_BASE | required | Key used to sign messages and encrypt cookies |
SMTP_SERVER | required | Mail server, example: smtp.example.com |
SMTP_PORT | optional | Mail server port, default: 25 |
SMTP_DOMAIN | optional | Defaults to RAILS_HOSTNAME |
SMTP_USERNAME | required | Mail service username |
SMTP_PASSWORD | required | Mail service password |
SMTP_AUTH | optional | Defaults to plain |
The Setting
model contains settings that can be changed while the application
is running. Administration of these settings can be performed live by visiting
the Admin -> Settings
page while logged in with an appropriate user account.
See app\models\setting.rb
for defaults.
When users are registered, they automatically join the default Pilot user group. To create an initial administrative user run the following rake task:
rake skyos:create_admin
This will prompt you for the user attributes and assign the user administrative privileges.
docker-entrypoint.sh runs at container start and will automatically attempt to migrate and seed the database with changes as necessary.
If the app is using a different environment then it may be necessary to run the following steps after upgrade:
rake db:migrate
rake db:seed
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Ensure all test pass with appropriate coverage (
COVERAGE=true rake spec
) - Lint your changes appropriately (
rubocop
) - Check for any new security issues (
brakeman
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request