Core of the Amahi Platform, a web app in RoR
Ruby HTML CSS CoffeeScript JavaScript Makefile Python
Latest commit 31d17a1 Apr 26, 2017 @vik-y vik-y committed with cpg Update admin password (#135)
Admin password created by rake db:seed is "secretpassword"
Permalink
Failed to load latest commit information.
app Added a few comments related to app installation (#134) Mar 28, 2017
bin Deprecation fixes rails4.2.6 (#129) Mar 20, 2017
config Deprecation fixes rails4.2.6 (#129) Mar 20, 2017
db Deprecation fixes rails4.2.6 (#129) Mar 20, 2017
doc Full screen plugins layout and the documentation for how to use them Jul 8, 2014
lib Deprecation Fixes on Rails 4.2.6 and Updating RSpec Syntax to RSpec 3 ( Mar 15, 2017
misc label the results coming out of search with an "active" class Mar 27, 2013
plugins Added a few comments related to app installation (#134) Mar 28, 2017
public Add troubleshoot link (#130) Mar 20, 2017
script reset user password script for (amahi 7 and going forward) Jul 22, 2015
spec Deprecation fixes rails4.2.6 (#129) Mar 20, 2017
test initial commit of the platform Nov 25, 2012
tmp add .gitkeep in tmp/ to make sure there is a tmp dir Feb 17, 2013
vendor initial commit of the platform Nov 25, 2012
.gemrc Docker support for developers (#136) Apr 8, 2017
.gitignore Docker support for developers (#136) Apr 8, 2017
.powrc support for pow+rvm on mac os Mar 18, 2013
.ruby-version update bundle, s/yum/dnf/, add ruby 2.3 testing, set ruby version to … Jun 23, 2016
.travis.yml Deprecation fixes rails4.2.6 (#129) Mar 20, 2017
COPYING initial commit of the platform Nov 25, 2012
Dockerfile Docker support for developers (#136) Apr 8, 2017
Gemfile Deprecation fixes rails4.2.6 (#129) Mar 20, 2017
Gemfile.lock Deprecation fixes rails4.2.6 (#129) Mar 20, 2017
Makefile update bundle, s/yum/dnf/, add ruby 2.3 testing, set ruby version to … Jun 23, 2016
README.md Update admin password (#135) Apr 25, 2017
Rakefile Change application name to be AmahiHDA rather than Html. Needed for p… Jan 10, 2013
TODO.txt Create TODO.txt Dec 11, 2012
config.ru latest working platform for amahi 8 release Sep 2, 2015
docker-compose.yml Docker support for developers (#136) Apr 8, 2017
icla.txt add ICLA, for taking contributions Nov 30, 2012

README.md

Amahi Platform

Build Status Code Climate Dependency Status Coverage Status

The Amahi Platform is a web-based app that allows management of users, shares, apps, networking and other settings in a Linux-based PC, VM or ARM-based system.

The Amahi Platform is part of Amahi and supports the services provided by Amahi.

Contributing

Contributions are always welcome! Here's what you need to do to get the Amahi platform working:

1. Clone the repo

git clone https://github.com/amahi/platform.git

2. Run the tests

You can test Amahi locally with limited functionality either on the command line or in the browser and both should work. Tests are written in CoffeeScript using QUnit.

To run on the command line, run the following command from the project root:

make run-tests

3. Write some test-driven code

The tests are in spec/. All test files are typically inside spec/requests and we use capybara and factory-girl for easy test writing.

4. Test by hand in the browser

To run the app in the browser, you need to bootstrap it first. The first db: command assumes you have MySQL up and running and will ask for the root user credentials in MySQL:

bundle install
rake db:create
rake db:migrate
rake db:seed

To start the app and use it with a browser, start a web server with rails:

rails s

Visit http://localhost:3000/, login with the username of admin & the password of secretpassword and excersise the app as much as you can.

We like to follow a particular git branching model. You can create and work in your own branch, making your work easier to track.

Install for Development Using docker

If you find it difficult to set up the development environment and all dependencies then you can use docker for an easy installation. Please note that docker and docker-compose must be installed on your system.

For docker installation refer to the following link: https://docs.docker.com/engine/installation/ For docker-compose installation refer to the following link : https://docs.docker.com/compose/install/

Once that is done clone the code and go to the config/database.yml and put the following settings for development:

development:
  adapter: mysql2
  encoding: utf8
  pool: 5
  database: amahi_dev
  host: amahi_mysqldb
  username: root
  password: test123

Now run the following commands (Make sure you are at root directory of the code, docker-compose.yml file should be present in the directory)

# Clone this code and go to the directory 
# Run bundle install to install all the required gems 
docker-compose run amahi_web bundle install
docker-compose run amahi_web rake db:create
docker-compose run amahi_web rake db:migrate
docker-compose run amahi_web rake db:seed
# As you can see, to run any rails command we have to just prepend the rails commands with "docker-compose run amahi_web" 

This should initialize everything required for the app. Now to run the server

docker-compose up 
# or you can also do : doker-compose run amahi_web rails s
# You can do Ctrl+C to stop the server.

Running and creating migrations:

# Running any rails command is fairly simple. You just have to prepend all the commands with: docker-compose run amahi_web
# Example: Generate a migration and run it.
docker-compose run amahi_web rails g migration addRandomStuff
docker-compose run amahi_web rake db:migrate

# Run a scaffold command
docker-compose run amahi_web rails g scaffold random
# Drop db 
docker-compose run amahi_web rake db:drop 

NOTE: The files generated by all the rails or rake commands might be owned by root and you might have to use chown to edit them.

5. Coding Style

Try to remove suprious white spaces and such. We have a Ruby beautifier tool that we recommend. It's a basic ruby script that will modify any number of files (in the command line) to make them more readable and keep the formatting conventions and styles that we like in Amahi.

6. Create a pull request

When you are ready for your changes and it's good code that fits with the goals of the project, submit a pull request and we will merge it!

7. Agree to CLA

For mutual protection, please check the icla.txt file for the individual contributor agreement we require for contributors. It's a virtual copy to Apache's CLA. Generally, you will be asked by email to read it and accept, otherwise it will be implied that you accept it. If you are working for a company or some large institution, we will ask that you submit a scan of the signed CLA for us to keep on file.

8. Develop Plugins

We are trying to make the platform more modular and also thinner. If you have some ideas for plugins that would improve the platform but are better done as plugins, See the plugins docs file.

License

This program is Copyright (C) 2007-2013, Amahi. Licensed under the AGPL. See the license in the COPYING file.