diff --git a/rails/.bowerrc b/rails/.bowerrc deleted file mode 100644 index 975d6d07eb9ce29a8ae8c7b8bc37058f0b75d47b..0000000000000000000000000000000000000000 --- a/rails/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "/opt/bower_components" -} diff --git a/rails/.dockerignore b/rails/.dockerignore deleted file mode 100644 index b3d2ec756253328220c1a627bcfc0e00c6df0b77..0000000000000000000000000000000000000000 --- a/rails/.dockerignore +++ /dev/null @@ -1,4 +0,0 @@ -Dockerfile* -.git -.*.swo -.*.swp diff --git a/rails/.gitignore b/rails/.gitignore deleted file mode 100644 index 9304c993e955af3879569e6e39c57e9afb95a551..0000000000000000000000000000000000000000 --- a/rails/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -.DS_Store -.vagrant -*.rbc -*.sassc -.sass-cache -capybara-*.html -.rspec -.rvmrc -.bundle -vendor/bundle -log -log/* -tmp/ -tmp/* -db/*.sqlite3 -public/system/* -coverage/ -spec/tmp/* -**.orig -rerun.txt -pickle-email-*.html -.project -dump.rdb -app/assets/dockers -app/assets/dockers/* -app/assets/stylesheets/theme/ -public/app/* -db/backup/* -public/datastore -.settings/ -.vagrant/ -deploy/.vagrant/ -deploy/atom -deploy/debian-jessie -.keep -*.keep -doing.txt -active_admin.rb.old -vendor/assets/components/* -deploy/nginxconf -public/assets -.*.sw[po] diff --git a/rails/.ruby-version b/rails/.ruby-version deleted file mode 100644 index 276cbf9e2858c779297bb9f73b34170302949ec4..0000000000000000000000000000000000000000 --- a/rails/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.3.0 diff --git a/rails/Dockerfile b/rails/Dockerfile deleted file mode 100644 index 891a57af42ec42c8cfe9b2d9c247dde8ac45b7da..0000000000000000000000000000000000000000 --- a/rails/Dockerfile +++ /dev/null @@ -1,49 +0,0 @@ -FROM allgo/base-debian - -# configure the node reporisory -# http://linuxbsdos.com/2017/06/26/how-to-install-node-js-lts-on-debian-9-stretch/ -RUN apt-getq install curl gnupg ca-certificates &&\ - curl -sL https://deb.nodesource.com/setup_8.x | bash - - -# install system packages + bower -RUN apt-getq install mariadb-client libmariadb-client-lgpl-dev-compat \ - redis-server curl imagemagick git ca-certificates \ - gcc g++ make libc6-dev file libffi-dev libgdbm-dev libgmp-dev \ - libncurses5-dev libncursesw5-dev libreadline6-dev libssl-dev \ - libyaml-dev openssl procps systemtap-sdt-dev zlib1g-dev \ - nodejs npm supervisor nginx-light zip \ - && ln -s /usr/bin/nodejs /usr/local/bin/node \ - && npm install -g bower - -# build & install ruby -ENV PATH="/opt/ruby/bin:$PATH" -COPY deploy/docker/ruby /tmp/ruby -RUN apply-patches /tmp/ruby/*.diff &&\ - useradd -m -s /bin/bash allgo &&\ - chown allgo: /opt &&\ - su allgo -c 'sh /tmp/ruby/install.sh' - -# install ruby gems -COPY Gemfile* /tmp/ -RUN cd /tmp && chown allgo: /tmp/Gemfile* && su allgo -c "bundle install" - -# install bower modules under /opt/bower_components -# (so that they are located in the docker image, even when /opt/allgo is mounted from an external volume) -COPY bower.json .bowerrc /tmp/ -RUN mkdir /opt/bower_components &&\ - chown allgo: /opt/bower_components &&\ - cd /tmp && su allgo -c "bower install" - -# install allgo sources + run setup script -COPY . /opt/allgo -RUN sh /opt/allgo/deploy/docker/setup/setup.sh - -USER allgo -WORKDIR /opt/allgo -CMD ["run-allgo"] -LABEL dk.migrate_always=1 - - - - - diff --git a/rails/Gemfile b/rails/Gemfile deleted file mode 100755 index 65e17f61d0f4a4cc5794ba0ca6a74907ae719ca1..0000000000000000000000000000000000000000 --- a/rails/Gemfile +++ /dev/null @@ -1,1025 +0,0 @@ -ruby '2.5.1' -source 'https://rubygems.org' - -# use https: instead of git: for github repositories -git_source(:github) do |repo_name| - repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") - "https://github.com/#{repo_name}.git" -end - -# rake: a makefile look alike but entirely coded in ruby ( tasks and dependencies ) -# which gives the user the ability to specify tasks without having to care about the ususal makefile syntax quirks. -# rake has two main tasks : -# 1) A task named “test”, which – upon invocation – will run a unit test file in Ruby. -# 2) A task named “default". This task does nothing by itself, -# but it has exactly one dependency, namely the “test” task. -# Invoking the “default” task will cause Rake to invoke the “test” task as well. -# -# Now there are project-specific tasks implemented in lib/tasks/*.rake (TODO -# clean them because most are very likely obsolete) -# -# -> in lib/tasks/allgo.rake: -# task clean_jobs: -# task clean_docker_container: -# task update_versions: -# task migrate_demos: -# task create_dataset_and_jobs_folder: -# task update_all_ipadress: -# task back_docker_images: -# -# -> in lib/tasks/docker.rake: -# task commit_sid: -# task upgrade_all: -# -# This gem requires a “Rakefile” that instanciates the build rules. -# -# used in; rails/bin/rake -# ; rails/lib/tasks/* -gem 'rake' - -# rails: is a full-stack web-application optimized framework appying the Model-View-Controller (MVC) pattern. -# - The Model layer represents your domain model (such as Account, Product, Person, Post, etc.) -# and encapsulates the business logic that is specific to your application. -# - The Controller layer is responsible for handling incoming HTTP requests and providing a suitable response. -# - The View layer is composed of "templates" that are responsible for providing -# appropriate representations of your application's resources. -# Here in the rails gem declaration '>=5', '<6' refers to the versions we want to implement the website with -# between 5.0 and 6.0 for instance. -# -# used in; almost everywhere in the rails directory. -gem 'rails', '>=5.0', '<5.1' - -# turbolinks : a gem compatible with most web browsers -# makes following links in your web application faster -# by rendering a preview of the page from cache immediately after the visit starts. -# This improves the perceived speed of frequent navigation between the same pages. -# -# Turbolinks automatically initializes itself when loaded via a standalone -# <script> tag or a traditional concatenated JavaScript bundle. -# (use with Rails Asset Pipeline). But since turbolink don't actually -# automatically cancel the some javascripts fonctionnalities implemented -# in <scripts> tags when a new visit to the site is triggered, you have to be either -# very carefull of the memory leaks generated by your javascript code , -# or use the hooks provided by the turbolinks API like Turbolinks.clearCache(); to cancel callbacks installed -# by javascript functionnalities like .setTimeout() or .setIntervall(). -# -# If changes are initiated by such non-idempotent javascript methods, -# you'll need to ensure you're not applying them again when a cached page is loaded. -# To cope with these particular cases, turbolinks provides -# - data-turbolinks-* attributes to tune the processing of HTML content -# - turbolinks:* javascript events -# -# used in; rails/app/views/* -# ; rails/app/assets/javascripts/application.js -gem 'turbolinks' - -# jbuilder : Generates JSON objects with a Builder-style DSL -# -# Read more: https://github.com/rails/jbuilder -# -# We use it mostly in the REST API. -# -# used in; *.json.jbuilder -gem 'jbuilder' - -# devise : Flexible authentication solution for Rails with Warden -# Devise will create some helpers to use inside your controllers and views. -# -# Authentication in a can be enforced in a controller by registering a -# 'before_action' hook that calls 'authenticate_user!' -# -# Devise provides a series of helper methods to query the authentication status -# of the current user. Eg: user_signed_in?, current_user, user_session... -# -# Note: Devise is designed to be usable on multiple models concurrently. The -# name of the helper methods is derived from then name of the model they refer -# to, the above examples refer to the model 'User'. For a model named 'Member' -# the helpers would be named: member_signed_in?, current_member, -# member_session, ... -# -# In allgo, devise is used in the User model, implemented in: -# ; rails/app/models/user.rb -# ; rails/app/controllers/users_controller.rb -# ; rails/app/controllers/custom_registrations_controller.rb -# ; rails/app/views/devise/* -# ; rails/app/views/layouts/_navbar.html.erb -# the helpers are used mostly everywhere else. -gem 'devise', github: 'plataformatec/devise', branch: 'master' - -# bcrypt: secure hash algorithm for storing passwords -# -# bcrypt is a sophisticated and secure hash algorithm designed by -# The OpenBSD project for hashing passwords. -# The bcrypt algorithm only handles passwords up to 72 characters. -# The bcrypt Ruby gem provides a simple wrapper for safely handling passwords. -# -# A typical bcrypt gem call would be bcrypt.checkpw(password, hashed), -# to check if a password is hashed or not. -# Or bcrypt.hashpw(password, bcrypt.gensalt()) to crypt a password. -# -# used in ; rails/config/initializers/devise.rb -gem 'bcrypt' - - -# rack-utf8_sanitizer : is a Rack middleware which -# cleans up invalid UTF8 characters in request URI and headers. -# It divides all keys in the Rack environment in two distinct groups: -# - keys which contain raw data -# - with percent-encoded data. -# The fields which are treated as percent-encoded are: -# SCRIPT_NAME, REQUEST_PATH, REQUEST_URI, PATH_INFO, QUERY_STRING, HTTP_REFERER. -# -# used in; is not used for the moment. -gem 'rack-utf8_sanitizer' - -# mysql2 : is a phpmyadmin lookalike for ruby code to access mysql databases -# binding to libmysql -# -# In Allgo mysql is used as backend for ActiveRecord models -# -# used in; rails/config/database.yml -gem 'mysql2' - - -# Sidekiq : is a server interface that uses threads to handle many jobs at the same time in the same process. -# Mainly it manages the waiting queue of requests , to delay jobs, -# and you can also acces a user interface that gives you statistics about -# the past, present and future processes. -# It does not require Rails but will integrate tightly with Rails to make background -# processing dead simple. -# -# FIXME: very likeliy unused non that docker containers are managed by the 'controller' container -# -# used in; rails/config/routes.rb -# ; rails/app/views/admin/logs/sidekiq_log.html.erb -# ; rails/config/environments/production.rb -# ; rails/config/initializers/active_job.rb -# ; rails/app/views/layouts/admin.html.erb -# ; rails/deploy/docker/setup/supervisord.conf -# ; rails/app/views/admin/logs/sidekiq_log.html.erb -# ; rails/app/controllers/admin/logs_controller.rb -gem 'sidekiq' - -# client_side_validations: implements form data validation on client side -# -# It is enabled when a form is generated with « validate: true ». Eg: -# -# <%= form_for @job, validate: true do |f| %> -# -# Validation errors are displayed directly in the form and prevent its -# submission (until the errors are fixed). -# -# The plugin generates the javascript code to verify the ActiveRecord -# validation rules defined in the models ('validates' keyword). Native -# rules (http://guides.rubyonrails.org/active_record_validations.html) -# are supported out-of-the-box. -# -# If a model implements a custom validation rule (ruby code on server-side), -# then the client-side javascript code has to be written manually. -# -# For example, the 'new_webapp_version_number' rule: -# - is used by model rails/app/models/webapp_version.rb -# - is implemented (server-side) in rails/app/validators/webapp_version.rb -# - is implemented (client-side) in rails/app/views/webapps/_sandbox_panel.html.erb - gem 'client_side_validations' - - -# paperclip; is intended as an easy file attachment library for ActiveRecord. -# -# The intent behind it was to keep setup as easy as possible and to treat files -# as much like other attributes as possible. This means they aren't saved to their -# final locations on disk, nor are they deleted if set to nil, until ActiveRecord::Base#save is called. -# It manages validations based on size and presence, if required. It can transform its assigned image into thumbnails -# if needed, and the prerequisites are as simple as installing ImageMagick (which, for most modern Unix-based systems, -# is as easy as installing the right packages). Attached files are saved to the filesystem and referenced in the browser -# by an easily understandable specification, which has sensible and useful defaults. -# ImageMagick must be installed and Paperclip must have access to it. -# -# In development mode, you might add this line to config/environments/development.rb file : -# Paperclip.options[:command_path] = "/usr/local/bin/" -# -# A typical implementation that call this gem , is this type of call in a ruby model .Ex: -# -# class User < ActiveRecord::Base -# has_attached_file :avatar, styles: { medium: "300x300>", thumb: "100x100>" }, -# default_url: "/images/:style/missing.png" -# validates_attachment_content_type :avatar, content_type: /\Aimage\/.*\z/ -# end -# -# In the controller you now have to declare the new attachement defined ( here :avatar ) -# as beeing part of the model's parameters: -# -# def user_params -# params.require(:user).permit(:avatar) -# end -# -# Now that the model calls the gem's functionnalities and that the controller has a method to defrine -# the attachement as beeing part of the user's model .. -# Client side , an avatar file can be called from the database and displayed into a html form or html page -# with a command like : -# -# <%= form_for @user, url: users_path, html: { multipart: true } do |form| %> -# <%= form.file_field :avatar %> -# <% end %> -# -# Or uloaded client side : -# -# <%= simple_form_for @user, url: users_path do |form| %> -# <%= form.input :avatar, as: :file %> -# <% end %> -# -# used in; rails/app/models/job_upload.rb -# ; rails/app/models/webapp.rb -gem 'paperclip' - - -# acts-as-taggable-on: is a gem that permits the developper to tag a single model on several contexts. -# such as skills, interests, and awards. It also provides other advanced functionalities. -# -# For instance, in a social network, a user might have tags that are called skills, interests, sports, and more. -# Enter Acts as Taggable On. Rather than tying functionality to a specific keyword (namely tags), acts as taggable on -# allows you to specify an arbitrary number of tag "contexts" that can be used locally or in combination in the same -# way steroids was used. -# -# A typical call of this gem is as follows in a model: -# class User < ActiveRecord::Base -# acts_as_taggable # Alias for acts_as_taggable_on :tags -# acts_as_taggable_on :skills, :interests -# end -# -# In a model controller: -# class UsersController < ApplicationController -# def user_params -# params.require(:user).permit(:name, :tag_list) ## Rails 4 strong params usage -# end -# end -# -# Typical calls to add one or many tags ; @user.tag_list.add("awesome") , @user.tag_list.add("awesome", "slick") -# to remove one or many tags ; @user.tag_list.remove("awesome") , @user.tag_list.remove("awesome", "slick") -# -# used in; rails/app/models/webapp.rb -gem 'acts-as-taggable-on', github:'mbleigh/acts-as-taggable-on' - - -# Sinatra: is a DomainSpecificLanguage for quickly creating web applications in Ruby with minimal effort. -# Also makes the routes.rb file able to run blocks of ruby code to efficiently route the pages requests . -# In Sinatra, a route is an HTTP method paired with a URL-matching pattern. -# Routes are matched in the order they are defined. The first route that matches the request is invoked. -# Routes with trailing slashes are different from the ones without: -# Each route is associated with a block: -# -# get '/' do -# .. show something .. -# end -# -# Route patterns may include named parameters, accessible via the params hash: -# -# get '/hello/:name' do -# # matches "GET /hello/foo" and "GET /hello/bar" -# # params['name'] is 'foo' or 'bar' -# "Hello #{params['name']}!" -# end -# You can also access named parameters via block parameters: -# -# get '/hello/:name' do |n| -# # matches "GET /hello/foo" and "GET /hello/bar" -# # params['name'] is 'foo' or 'bar' -# # n stores params['name'] -# "Hello #{n}!" -# end -# -# used in; not used for the moment in the allgo project, the only type of routes that are defined -# in uch an unusual way in routes.rb at the moment are the devise routes. -gem 'sinatra', github: 'sinatra/sinatra' -# gem "rack-protection", github: "sinatra/rack-protection" - - -# redis: is a queue system referred as a data structures server -# so different processes can query and modify the same data structures in a shared way. -# It features thread-safety, client-side sharding, pipelining. -# Data structures implemented into Redis have a few special properties: -# - Redis cares to store them on disk, even if they are always served and modified into the server memory. -# - data structures inside Redis will likely use less memory compared to the same. -# - data structure modeled using an high level programming language. -# - offers a number of unusual database features like replication, -# tunable levels of durability, cluster, high availability. -# -# To run Redis with the default configuration just type: -# -# % cd src -# % ./redis-server -# -# FIXME: very likely no longer used (because it was included for sidekiq) -# -# used in; rails/config/initializers/sidekiq.rb -# ; rails/deploy/docker/setup/* -# ; rails/deploy/provisioning/2_prepare-webapp.sh -# ; rails/deploy/provisioning/2_prepare-webapp.sh -# ; rails/lib/tasks/launch_allgo.sh -gem 'redis' - -# rack-cors: allows web applications to make cross domain AJAX calls without using workarounds such as JSONP. -# Also a middleware that will make Rack-based apps CORS compatible. -# -# A method of usage to access the power of this gem is to put in your config/application.rb file the following lines: -# -# -> in rails 3/4: -# -# config.middleware.insert_before 0, "Rack::Cors" do -# allow do -# origins '*' -# resource '*', :headers => :any, :methods => [:get, :post, :options] -# end -# end -# -# -> in rails 5: -# -# config.middleware.insert_before 0, Rack::Cors do -# allow do -# origins '*' -# resource '*', :headers => :any, :methods => [:get, :post, :options] -# end -# end -# -# For example, this will allow GET, POST or OPTIONS requests from any origin on any resource. -# In Rails there's no further configuration to make , no need to update config.ru at all. -# -# -# used in ; no used for the moment in the allgo project. -gem 'rack-cors', require: 'rack/cors' - -# sdoc: is an HTML template built on top of the RDoc documentation generator for Ruby code. -# bundle exec rake doc:rails generates the API under doc/api. -# RDoc generator to build searchable HTML documentation for Ruby code with javascript search index... -# Provided are two command-line tools you get when you installing the gem: -# > sdoc: command line tool to run rdoc with generator=shtml (searchable HTML). -# > sdoc-merge: command line tool to merge multiple sdoc folders into a single documentation site. -# -# If you want, you can setup a task in your Rakefile for generating your project's -# documentation via the rake rdoc command. -# -# # Rakefile -# require 'sdoc' # and use your RDoc task the same way you used it before -# require 'rdoc/task' # ensure this file is also required in order to use `RDoc::Task` -# -# RDoc::Task.new do |rdoc| -# rdoc.rdoc_dir = 'doc/rdoc' # name of output directory -# rdoc.generator = 'sdoc' # explictly set the sdoc generator -# rdoc.template = 'rails' # template used on api.rubyonrails.org -# end -# used in; nowhere for the moment. -group :doc do - gem 'sdoc', require: false -end - -# Capistrano: is a utility and framework for executing deployment script commands in parallel -# on single or multiple remote machines, via SSH. -# Capistrano depends on connecting to your server(s) with SSH using key-based (i.e. password-less) authentication. -# You'll need this working before you can use Capistrano. -# Once installed, Capistrano gives you a cap tool to perform your deployments -# whether in java , ruby or , php from the comfort of your command line. -# -# $ cd my-capistrano-enabled-project -# $ cap production deploy -# -# You can define those commands by writing Rake tasks like as follows: -# task :restart_sidekiq do -# on roles(:worker) do -# execute :service, "sidekiq restart" -# end -# end -# after "deploy:published", "restart_sidekiq" -# -# Make sure your project doesn't already have a "Capfile" or "capfile" present. Then run: -# -# $ bundle exec cap install -# -# This creates all the necessary configuration files and directory structure for a Capistrano-enabled -# project with two stages, staging and production. -# -# Usual command lines: -# # list all available tasks -# $ bundle exec cap -T -# deploy to the staging environment -# $ bundle exec cap staging deploy -# deploy to the production environment -# $ bundle exec cap production deploy -# simulate deploying to the production environment -# does not actually do anything -# $ bundle exec cap production deploy --dry-run -# list task dependencies -# $ bundle exec cap production deploy --prereqs -# trace through task invocations -# $ bundle exec cap production deploy --trace -# lists all config variable before deployment tasks -# $ bundle exec cap production deploy --print-config-variables -# -# FIXME: no longer used since we switched to docker images for the deployments -# -# used in ; rails/app/controllers/deploy_controller.rb -# ; rails/bin/rake -gem 'capistrano', '2.15.5' - -group :development do - #web server - #gem 'puma' - - # thin: A thin and fast web server. - # - # used when running « rails server » - # - # (in production we use unicorn which is more powerful, but slower to start) - # - # Note: in the development container we actually use unicorn by default - # (since the docker image recreates the same environment as in production) - # and this is ok for everyday development since rails reloads most classes - # on-the-fly when they are modified. However when testing initialisation code - # it may be more convenient to use thin instead: - # -> ./shell dev-rails - # $ supervisorctl stop rails - # $ rails server - # - gem 'thin' - - # Web Console: is a web-based application that allows to execute shell commands - # on a server directly from a browser (web-based SSH). - # Is also a debugging tool for your Ruby on Rails applications. - # - gem 'web-console' - - # rspec-rails: is a behavioral testing framework for Rails 3.x and 4.x and 5.0. - # - # Use model specs to describe behavior of models (usually ActiveRecord-based) in the application: - # - # RSpec.describe User, :type => :model do - # - # Use model specs to describe behavior of a controller in spec/controllers/ directory: - # to test the behavior of a controller it would mean typing something like: - # - # RSpec.describe PostsController, :type => :controller do - # - # used in; rails/spec/rails_helper.rb - # ; rails/spec/controllers/datasets_controller_spec.rb - gem 'rspec-rails' - - # factory_girl_rails: is a fixtures replacement with a straightforward definition syntax. - # It generate data factory patterns into test-driven development. - # A data Factory is a blueprint that allows us to create an object, - # or a collection of objects, with predefined sets of values. - # This gem supports multiple build strategies (saved instances, unsaved instances, - # attribute hashes, and stubbed objects), and support for multiple factories for - # the same class (user, admin_user, and so on), including factory inheritance. - # factory_girl_rails provides integration between factory_girl and rails 3. - # Generators for factories will automatically substitute fixture. - # The purpose of a test fixture is to ensure that there is a well known and - # fixed environment in which tests are run so that results are repeatable. - # Some people call this the test context. - # - # Examples of fixtures: - # - Loading a database with a specific, known set of data. - # - Erasing a hard disk and installing a known clean operating system installation. - # - Copying a specific known set of files. - # - Preparation of input data and set-up/creation of fake or mock objects. - # - # A typical call of the gem would be implemented in the Default factories directories: - # - # config.generators do |g| - # g.factory_girl dir: 'custom/dir/for/factories' - # end - # - # ( here it is a call to change the test directory ) - # - # You are also able to disable features on demand by adding the following lines to your application.rb file : - # - # config.generators do |g| - # g.factory_girl false - # end - # - # used in; rails/spec/rails_helper.rb - gem 'factory_girl_rails' - - # faker: is a PHP library aimed at generating fake data such as names, - # addresses, and phone numbers for data factories. Faker requires PHP >= 5.3.3. - # It can generate data by accessing properties named after the type of data you want - # or anonymize data taken from a production service. - # - # A typical call of the gem's functionnalities would look like : - # - # Use Faker\Factory::create() to create and initialize a faker generator - # Then : f.clientname { Faker::Bank.client_name } to attribut a fake name to a dummy bank client. - #( to generate fake identities in a bank database ) - # - # echo $faker->name; - # echo $faker->address; - # echo $faker->text; - # - # Are the typical faker commands aimed at providing dummy data to immediately - # have good looking XML pages or stress-testing your persistance. - # - # used in ; rails/spec/factories/users.rb - gem 'faker' - - # cucumber: supports Behaviour Driven Development . - # Behaviour-Driven Development (BDD) is a software development process that aims to - # enhance software quality and reduce maintenance costs. - # Cucumber executes executable specifications written in plain - # language and produces reports indicating whether the software - # behaves according to the specification or not. - # It supports Capybara and DatabaseCleaner. - # - # used in; not used for the moment in the allgo project. - gem 'cucumber' - - - # Capybara helps you test web applications by simulating programmatically how a real user - # would interact with your app. - # It is agnostic about the driver running your tests .By default, Capybara uses the :rack_test driver - # and Selenium support built in. WebKit is supported through an external gem. - # capibara integrates seamlessly with other gems like: - # - Cucumber : require 'capybara/cucumber' - # - RSpec : require 'capybara/rspec' - # - Test::Unit : require 'capybara/dsl' - # - Minitest : require 'capybara/minitest' - # - # If you are using capybara with Rails ( which is the case in the allgo project ) - # you've got to update your test_helper.rb file with the following lines : - # require 'capybara/rails' - # - # Here's an example of how it is used in a test class ( here in conjunction with minitest ): - # class CapybaraTestCase < Minitest::Test - # include Capybara::DSL - # include Capybara::Minitest::Assertions - # - # def teardown - # Capybara.reset_sessions! - # Capybara.use_default_driver - # end - # end - # - # used in ; rails/.gitignore - gem 'capybara' - - # better_errors: Provides a better error log page for Rails and other Rack apps directly into the localhost URL. - # Includes source code inspection, a live REPL and local/instance variable inspection for all stack frames. - # - # ATTENTION: It is crucial to only put this gem in the developpment version of your website not the production version, - # you don't want to give hints to a potential hacker of your site about how the source code is implemented! - # HOWEVER: To poke selective holes in this security mechanism, you can add a line like this to your startup - # (for example, on Rails it would be config/environments/development.rb) - # - # BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP'] - # - # You will notice that the only machine that gets the Better Errors page is localhost, which means you get the default - # error page if you are developing on a remote host . - # - # REMARK : You might want to use better error only with ONE web server in developpement mode to avoid any request beeing - # sent to a second worker who doesn't have the necessary memory context and might send a "Session Expired" message . - # - # Here's an example of better _errors using Sinatra: - # - # require "sinatra" - # require "better_errors" - # - # configure :development do - # use BetterErrors::Middleware - # BetterErrors.application_root = __dir__ - # end - # - # get "/" do - # raise "oops" - # end - # - # used in; when there are errors generated during local developpement, - # better-errors comes into action to precise the lines incriminated for the errors. - # We use it extensively in developpment mode , this is basically the error page our local server - # puts into your browser with all the detailed bug info . - gem 'better_errors' - - - # binding_of_caller: we can grab bindings from higher up the call stack and evaluate code in that context. - # Allows access to bindings arbitrarily far up the call stack, not limited to just the immediate caller. - # Modifying a local inside the caller of a caller is possible with this gem. - # - # Here's a typical use for this gem: - # - # def a - # var = 10 - # b - # puts var - # end - # - # def b - # c - # end - # - # def c - # binding.of_caller(2).eval('var = :hello') - # end - # - # a() - # - # OUTPUT - # => hello - # - # used in; i haven't seen it used anywhere in the allgo project. - gem 'binding_of_caller' - - # traceroute : this Rake task investigates the application's routes definition, - # find dead routes and unused or unreachable actions in your Rails 3+ app. - # - # Usage: - # Just run the following command in your Rails app directory : - # % rake traceroute - # If you want the rake task to fail when errors are found. - # % FAIL_ON_ERROR=1 rake traceroute - # - # Running the Rake task will print something like this for you after analysis of - # a route.rb file and the routes to models ( a model that here contains a index2 method that is empty ) - # and controllers it contains : - # - # Unused routes (3): - # users#create - # users#new - # catalog#purchase - # Unreachable action methods (1): - # users#index2 - # - # used in; currently no rake tasks are implemented to take advantage of this gem ( may have been used in the past ) - gem 'traceroute' - - # gem 'rack-mini-profiler' #find bottleneck - - # bullet: increases your application's performance by reducing the number of queries it makes. - # Finds non-optimized queries , kills N+1 queries and unused eager loading. - # ATTENTION : Best practice is to use Bullet in development mode or custom mode (staging, profile, etc.). - # The last thing you want is your clients getting alerts about your queries beeing unefficiently coded . - # - # Typical usage in config/environments/development.rb , you have to configure your bullet actions: - # config.after_initialize do - # Bullet.enable = true - # Bullet.bullet_logger = true - # Bullet.console = true - # Bullet.add_whitelist :type => :n_plus_one_query, :class_name => "Post", :association => :comments - # ( for problems you don't care to fix ) - # etc .... - # end - # - # Bullet also allows you to disable any of its detectors: - # # Each of these settings defaults to true - # - # Detect N+1 queries - # Bullet.n_plus_one_query_enable = false - # - # If you want to skip bullet in some specific controller actions, you can do like: - # class ApplicationController < ActionController::Base - # around_action :skip_bullet - # - # Sometimes Bullet may notify you of query problems you don't care to fix, or which come from outside - # your code. You can whitelist these to ignore them: - # - # Bullet.add_whitelist :type => :n_plus_one_query, :class_name => "Post", :association => :comments - # - # - # used in; automated tool that comes into actions only when unefficient queries are made. - gem 'bullet' - - # brakeman: is an open source static analysis tool which checks Ruby on Rails applications - # for security vulnerabilities. - # From a Rails application's root directory: - # brakeman - # Outside of Rails root: - # brakeman /path/to/rails/application - - # You can specify the format of the report output files. - # The output format is determined by the file extension or by using the -f - # option. Current options are: text, html, tabs, json, markdown, csv, and codeclimate. - # - # brakeman -o output.html - # brakeman -o output.json - # etc.. - # - # To suppress informational warnings and just output the report: - # brakeman -q - # To see all kinds of debugging information: - # brakeman -d - # Specific checks can be skipped, if desired. - # The name needs to be the correct case. For example, to skip looking for default routes (DefaultRoutes): - # brakeman -x DefaultRoutes - # Multiple checks should be separated by a comma: - # brakeman -x DefaultRoutes,Redirect - # To do the opposite and only run a certain set of tests: - # brakeman -t SQL,ValidationRegex - # By default, Brakeman will return 0 as an exit code unless something went very wrong. To return an error code when warnings were found: - # brakeman -z - # To skip certain files or directories that Brakeman may have trouble parsing, use: - # brakeman --skip-files file1,/path1/,path2/ - # To compare results of a scan with a previous scan, use the JSON output option and then: - # brakeman --compare old_report.json - # Brakeman will ignore warnings if configured to do so. By default, - # it looks for a configuration file in config/brakeman.ignore. To create and manage this file, use: - # brakeman -I - # - # used in; automated tools that signals security issues to the developper . - gem 'brakeman' - - # rails_best_practices: code metric tool analysis for rails codes, written in Ruby. - # First run: - # rails_best_practices -g - # to generate rails_best_practices.yml file. - # - # At the root directory of a Rails app, run: - # rails_best_practices. - # Or for HTML output: - # rails_best_practices -f html. - # - # used in; used only for analysis pruproses in developpement mode, - # wen you execute the command in your terminal. - gem 'rails_best_practices' - - - # rubyCritic: is a gem that wraps around static analysis gems such as Reek1, Flay2 and Flog3 - # to provide a quality report of your Ruby code. - # If you'd rather install RubyCritic using Bundler, add this line to your application's Gemfile: - # gem "rubycritic", :require => false - # And then execute: - # $ bundle - # - # Running rubycritic with no arguments will analyse all the Ruby files in the current directory: - # $ rubycritic - # Alternatively you can pass rubycritic a list of files and directories to check: - # $ rubycritic app lib/foo.rb - # - # You can use RubyCritic as Rake command in its most simple form like this: - # require "rubycritic/rake_task" - # RubyCritic::RakeTask.new - # - # A more sophisticated Rake task that would make use of all available configuration options could look like this: - # RubyCritic::RakeTask.new do |task| - # task.name = 'something_special' - # task.paths = FileList['vendor/**/*.rb'] - # task.options = '--mode-ci --format json' - # task.verbose = true - # end - # - # RubyCritic will try to open the generated report with a browser by default. - # If you don't want this you can prevent this behaviour by setting the options correspondingly: - # RubyCritic::RakeTask.new do |task| - # task.options = '--no-browser' - # end - # - # used in; developper tool that gives information about the ruby code from your terminal's directories . - gem 'rubycritic' - - # logstasher: is a logging system for Ruby on Rails improves - # its default logging displaying interface. - # This gem is heavily inspired from lograge , but focused specifically - # on displaying logs in a comprehensive manner. - # - # exemple of use : - # Configure your <environment>.rb or development.rb: - # # Enable the logstasher logs for the current environment - # config.logstasher.enabled = true - # # Each of the following lines are optional. If you want to selectively disable log subscribers. - # config.logstasher.controller_enabled = false - # config.logstasher.mailer_enabled = false - # config.logstasher.record_enabled = false - # config.logstasher.view_enabled = false - # config.logstasher.job_enabled = false - # config.logstasher.logger_path = 'log/logstasher.log' - # etc.. - # - # Here's how to add some custom fields to the logs: - # - # # Create a file - config/initializers/logstasher.rb - # - # if LogStasher.enabled? - # LogStasher.add_custom_fields do |fields| - # # This block is run in application_controller context, - # # so you have access to all controller methods - # fields[:user] = current_user && current_user.mail - # fields[:site] = request.path =~ /^\/api/ ? 'api' : 'user' - # - # # If you are using custom instrumentation, just add it to logstasher custom fields - # LogStasher.custom_fields << :myapi_runtime - # end - # - # LogStasher.add_custom_fields_to_request_context do |fields| - # # This block is run in application_controller context, - # # so you have access to all controller methods - # # You can log custom request fields using this block - # fields[:user] = current_user && current_user.mail - # fields[:site] = request.path =~ /^\/api/ ? 'api' : 'user' - # end - # end - # - # used in; rails/config/environments/production.rb - # ; rails/config/environments/development.rb - # ; rails/config/environments/qualification.rb - gem 'logstasher' - - # The Listen gem, listens to file modifications and notifies you about the changes. - # Ruby < 2.2.x is no longer supported - upgrade to Ruby 2.2 or 2.3. - # - # Typical usage: - # Call Listen.to with either a single directory or multiple directories, then define the "changes" callback in a block. - # - # listener = Listen.to('dir/to/listen', 'dir/to/listen2') do |modified, added, removed| - # puts "modified absolute path: #{modified}" - # puts "added absolute path: #{added}" - # puts "removed absolute path: #{removed}" - # end - # listener.start # not blocking - # sleep - # - # Listeners can also be easily paused/unpaused: - # - # listener = Listen.to('dir/path/to/listen') { |modified, added, removed| puts 'handle changes here...' } - # listener.start - # listener.paused? => false - # listener.processing? => true - # listener.pause # stops processing changes (but keeps on collecting them) - # listener.paused? # => true - # listener.processing? # => false - # listener.unpause # resumes processing changes ("start" would do the same) - # listener.stop - # etc .. - # sleep - # - # Listen ignores some directories and extensions by default , but can also be set to ignore them selectively. - # listener = Listen.to('dir/path/to/listen', ignore: /\.txt/) { |modified, added, removed| # ... } - # listener.start - # listener.ignore! /\.pkg/ # overwrite all patterns and only ignore pkg extension. - # listener.ignore /\.rb/ # ignore rb extension in addition of pkg. - # etc... - # sleep - # - # Listen catches all files (less the ignored ones) by default. If you want to only listen to a specific type of file (i.e., just .rb extension), you should use the only option/method. - # - # listener = Listen.to('dir/path/to/listen', only: /\.rb$/) { |modified, added, removed| # ... } - # listener.start - # listener.only /_spec\.rb$/ # overwrite all existing only patterns. - # sleep - # - # OPTIONS; - # ignore: [%r{/foo/bar}, /\.pid$/, /\.coffee$/] # Ignore a list of paths - # # default: See DEFAULT_IGNORED_DIRECTORIES and DEFAULT_IGNORED_EXTENSIONS in Listen::Silencer - # ignore!: %r{/foo/bar} # Same as ignore options, but overwrite default ignored paths. - # - # only: %r{.rb$} # Only listen to specific files - # # default: none - # latency: 0.5 # Set the delay (**in seconds**) between checking for changes - # # default: 0.25 sec (1.0 sec for polling) - # - # wait_for_delay: 4 # Set the delay (**in seconds**) between calls to the callback when changes exist - # # default: 0.10 sec - # - # force_polling: true # Force the use of the polling adapter - # # default: none - # - # relative: false # Whether changes should be relative to current dir or not - # # default: false - # - # polling_fallback_message: 'custom message' # Set a custom polling fallback message (or disable it with false) - # # default: "Listen will be polling for changes. - # - # - # used in; rails/config/unicorn.rb - # ; rails/config/environments/development.rb: - # ; rails/config/environments/qualification.rb - gem 'listen', '~> 3.0.5' - - # Spring speeds up development by keeping your application running in the background. - # Read more: https://github.com/rails/spring - # gem 'spring' - # gem 'spring-watcher-listen', '~> 2.0.0' -end - -group :production do - # unicorn: Use unicorn as the app server, back nginx - # unicorn is an HTTP server for Rack applications - # designed to only serve fast clients on low-latency, - # high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. - # Slow clients should only be served by placing a reverse proxy capable of - # fully buffering both the the request and response in between unicorn and slow clients. - # - # used in; rails/config/unicorn.rb - # ; rails/lib/tasks/launch_allgo.sh - gem 'unicorn' - #gem 'puma' -end - -##------- -## frontend gem -##------- -# bower-rails: Bower support for Rails projects. -# -# Used for installing and tracking dependencies of javascript assets not provided by ruby gems. -# -# used in; allgo/rails/bower.json -gem 'bower-rails' - -# redcarpet: is a Ruby library for Markdown processing. -# The core of the Redcarpet library is the Redcarpet::Markdown class -# Redcarpet comes with two built-in renderers, Redcarpet::Render::HTML and Redcarpet::Render::XHTML, -# which output HTML and XHTML, respectively. -# These renderers are actually implemented in C and hence faster than other Ruby Markdown solutions. -# -# typical usage: -# # Initializes a Markdown parser -# markdown = Redcarpet::Markdown.new(renderer, OPTIONS) -# with OPTIONS beeing like: -# a typical call of the functionalities would look like ; -# :no_intra_emphasis :tables :autolink :disable_indented_code_blocks :strikethrough -# :lax_spacing :space_after_headers :superscript :underline :highlight :quote :footnotes -# -# Initializing a Markdown parser: -# markdown.render() -# -# used in; rails/app/helpers/application_helper.rb -gem 'redcarpet' - -# sass-rails: this gem provides official integration for Ruby on Rails projects -# with the Sass stylesheet language , sass is a descriptive stylesheet language compiled in css. -# sass stlesheet syntax is really close of the syntax of haml files , there are basiocally two syntaxes availabel :. -# - SCSS (Sassy CSS): Uses the .scss file extension and is fully compliant with CSS syntax. -# - Indented (simply called 'Sass'): Uses .sass file extension and uses indentation rather than brackets; -# it is not fully compliant with CSS syntax, but it's quicker to write . -# sass version 6.0 is a bad , real real bad , the use of 5.0 version is mandatory here. -# -# Example: -# MyProject::Application.configure do -# config.sass.preferred_syntax = :sass -# config.sass.line_comments = false -# config.sass.cache = false -# end -# -# used in; essential for the gem bootstrap-sass to work properly , and be able to import boostrap styles. -# rails/tmp/cache/assets/* -gem 'sass-rails', '~> 5.0' - -# bootstrap-sass: is a Sass-powered version of Bootstrap 3 ( Bootstrap, converted to Sass) -# It serves as Twitter's Bootstrap but only ready to drop into Rails or Compass. -# Usage: -# Import Bootstrap styles in app/assets/stylesheets/application.scss -# // "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables" -# @import "bootstrap-sprockets"; -# @import "bootstrap"; -# -# When using bootstrap-sass Bower package instead of the gem in Rails, -# configure assets in config/application.rb: -# # Bower asset paths -# root.join('vendor', 'assets', 'bower_components').to_s.tap do |bower_path| -# config.sass.load_paths << bower_path -# config.assets.paths << bower_path -# end -# # Precompile Bootstrap fonts -# config.assets.precompile << %r(bootstrap-sass/assets/fonts/bootstrap/[\w-]+\.(?:eot|svg|ttf|woff2?)$) -# Minimum Sass number precision required by bootstrap-sass -# ::Sass::Script::Value::Number.precision = [8, ::Sass::Script::Value::Number.precision].max -# -# used in ; rails/tmp/cache/assets/* -gem 'bootstrap-sass', '~> 3.3' - -# uglifier: Ruby wrapper for 'UglifyJS' JavaScript compressor , -# uses Uglifier as compressor for JavaScript assets -# Uglifier minifies JavaScript files by wrapping UglifyJS to be accessible in Ruby . -# -# A typical call of the functionnalities would look like : -# require 'uglifier' -# Uglifier.new.compile(File.read("source.js")) -# => js file minified -# Or alternatively -# Uglifier.compile(File.read("source.js")) -# -# used in; rails/config/environments/production.rb -# ; rails/config/environments/development.rb -# ; rails/config/environments/qualification.rb -gem 'uglifier' - -# CoffeeScript adapter for the Rails asset pipeline. Also adds support for .coffee views. -# -# FIXME: does not seem to be used -# -gem 'coffee-rails' - -# Font-awesome: useful icons. -# The font-awesome font bundled as an asset for the rails asset pipeline. -# -# The icons are implemeted in css (classes fa and fa-*) -# <i class="fa fa-cog fa-spin"></i> -# -gem "font-awesome-rails" - -#jquery-fileupload-rails: is a file upload plugin that features multiple -# file selection, drag & drop support, progress bars and preview images for jQuery. -# Supports cross-domain, chunked and resumable file uploads and client-side image resizing. -# -# -# used in; rails/app/assets/stylesheets/application.scss -# rails/app/views/jobs/_edit_upload.html.erb -# rails/app/assets/javascripts/application.js -gem 'jquery-fileupload-rails' - -#TODO: use for stats to geolocate IP + store ip in jobs when jobs by token -#gem 'geokit-rails' -#or gem 'geocoder' diff --git a/rails/Gemfile.lock b/rails/Gemfile.lock deleted file mode 100755 index 1b4cd85f95fecbc8b97fcaaa8908b1377fe80925..0000000000000000000000000000000000000000 --- a/rails/Gemfile.lock +++ /dev/null @@ -1,443 +0,0 @@ -GIT - remote: https://github.com/mbleigh/acts-as-taggable-on.git - revision: 8e64c3d4a81cfbb8af621228eae36a65c1f94501 - specs: - acts-as-taggable-on (4.0.0) - activerecord (>= 4.0) - -GIT - remote: https://github.com/plataformatec/devise.git - revision: 2cf18f99e040853db587a3acdaf6c91737a1fa1c - branch: master - specs: - devise (4.4.3) - bcrypt (~> 3.0) - orm_adapter (~> 0.1) - railties (>= 4.1.0, < 6.0) - responders - warden (~> 1.2.3) - -GIT - remote: https://github.com/sinatra/sinatra.git - revision: af6dad2a6c31e31617712b15f455b2a3d3eb1c06 - specs: - rack-protection (2.0.0.beta2) - rack - sinatra (2.0.0.beta2) - mustermann (= 1.0.0.beta2) - rack (~> 2.0) - rack-protection (= 2.0.0.beta2) - tilt (~> 2.0) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.0.7) - actionpack (= 5.0.7) - nio4r (>= 1.2, < 3.0) - websocket-driver (~> 0.6.1) - actionmailer (5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.0.7) - actionview (= 5.0.7) - activesupport (= 5.0.7) - rack (~> 2.0) - rack-test (~> 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.0.7) - activesupport (= 5.0.7) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.0.7) - activesupport (= 5.0.7) - globalid (>= 0.3.6) - activemodel (5.0.7) - activesupport (= 5.0.7) - activerecord (5.0.7) - activemodel (= 5.0.7) - activesupport (= 5.0.7) - arel (~> 7.0) - activesupport (5.0.7) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.4.0) - arel (7.1.4) - ast (2.3.0) - autoprefixer-rails (6.5.0.2) - execjs - axiom-types (0.1.1) - descendants_tracker (~> 0.0.4) - ice_nine (~> 0.11.0) - thread_safe (~> 0.3, >= 0.3.1) - bcrypt (3.1.11) - better_errors (2.1.1) - coderay (>= 1.0.0) - erubis (>= 2.6.6) - rack (>= 0.9.0) - binding_of_caller (0.7.2) - debug_inspector (>= 0.0.1) - bootstrap-sass (3.3.7) - autoprefixer-rails (>= 5.2.1) - sass (>= 3.3.4) - bower-rails (0.11.0) - brakeman (3.4.0) - builder (3.2.3) - bullet (5.4.2) - activesupport (>= 3.0.0) - uniform_notifier (~> 1.10.0) - capistrano (2.15.5) - highline - net-scp (>= 1.0.0) - net-sftp (>= 2.0.0) - net-ssh (>= 2.0.14) - net-ssh-gateway (>= 1.1.0) - capybara (2.10.0) - addressable - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - client_side_validations (9.0.1) - jquery-rails (~> 4.2) - js_regex (~> 1.2) - rails (~> 5.0.0, >= 5.0.0.1) - climate_control (0.0.3) - activesupport (>= 3.0) - cocaine (0.5.8) - climate_control (>= 0.0.3, < 1.0) - code_analyzer (0.4.7) - sexp_processor - codeclimate-engine-rb (0.3.1) - virtus (~> 1.0) - coderay (1.1.1) - coercible (1.0.0) - descendants_tracker (~> 0.0.1) - coffee-rails (4.2.1) - coffee-script (>= 2.2.0) - railties (>= 4.0.0, < 5.2.x) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - colorize (0.8.1) - concurrent-ruby (1.0.5) - connection_pool (2.2.0) - crass (1.0.4) - cucumber (2.4.0) - builder (>= 2.1.2) - cucumber-core (~> 1.5.0) - cucumber-wire (~> 0.0.1) - diff-lcs (>= 1.1.3) - gherkin (~> 4.0) - multi_json (>= 1.7.5, < 2.0) - multi_test (>= 0.1.2) - cucumber-core (1.5.0) - gherkin (~> 4.0) - cucumber-wire (0.0.1) - daemons (1.2.4) - debug_inspector (0.0.2) - descendants_tracker (0.0.4) - thread_safe (~> 0.3, >= 0.3.1) - diff-lcs (1.2.5) - equalizer (0.0.11) - erubis (2.7.0) - eventmachine (1.2.0.1) - execjs (2.7.0) - factory_girl (4.7.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.7.0) - factory_girl (~> 4.7.0) - railties (>= 3.0.0) - faker (1.6.6) - i18n (~> 0.5) - ffi (1.9.14) - flay (2.8.1) - erubis (~> 2.7.0) - path_expander (~> 1.0) - ruby_parser (~> 3.0) - sexp_processor (~> 4.0) - flog (4.4.0) - path_expander (~> 1.0) - ruby_parser (~> 3.1, > 3.1.0) - sexp_processor (~> 4.4) - font-awesome-rails (4.7.0.1) - railties (>= 3.2, < 5.1) - gherkin (4.0.0) - globalid (0.4.1) - activesupport (>= 4.2.0) - highline (1.7.8) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - ice_nine (0.11.2) - jbuilder (2.6.0) - activesupport (>= 3.0.0, < 5.1) - multi_json (~> 1.2) - jquery-fileupload-rails (0.4.7) - actionpack (>= 3.1) - railties (>= 3.1) - sass (>= 3.2) - jquery-rails (4.2.2) - rails-dom-testing (>= 1, < 3) - railties (>= 4.2.0) - thor (>= 0.14, < 2.0) - js_regex (1.2.1) - regexp_parser (>= 0.3.6, <= 0.4.2) - json (1.8.6) - kgio (2.10.0) - launchy (2.4.3) - addressable (~> 2.3) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - logstash-event (1.2.02) - logstasher (1.0.1) - activerecord (>= 4.0) - activesupport (>= 4.0) - logstash-event (~> 1.2.0) - request_store - loofah (2.2.2) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.0) - mini_mime (>= 0.1.1) - method_source (0.9.0) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mimemagic (0.3.2) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - minitest (5.11.3) - multi_json (1.12.1) - multi_test (0.1.2) - mustermann (1.0.0.beta2) - mysql2 (0.4.4) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-sftp (2.1.2) - net-ssh (>= 2.6.5) - net-ssh (3.2.0) - net-ssh-gateway (1.2.0) - net-ssh (>= 2.6.5) - nio4r (2.3.0) - nokogiri (1.8.2) - mini_portile2 (~> 2.3.0) - orm_adapter (0.5.0) - paperclip (5.1.0) - activemodel (>= 4.2.0) - activesupport (>= 4.2.0) - cocaine (~> 0.5.5) - mime-types - mimemagic (~> 0.3.0) - parser (2.3.1.2) - ast (~> 2.2) - path_expander (1.0.0) - rack (2.0.4) - rack-cors (0.4.0) - rack-test (0.6.3) - rack (>= 1.0) - rack-utf8_sanitizer (1.3.2) - rack (>= 1.0, < 3.0) - rails (5.0.7) - actioncable (= 5.0.7) - actionmailer (= 5.0.7) - actionpack (= 5.0.7) - actionview (= 5.0.7) - activejob (= 5.0.7) - activemodel (= 5.0.7) - activerecord (= 5.0.7) - activesupport (= 5.0.7) - bundler (>= 1.3.0) - railties (= 5.0.7) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.0.4) - loofah (~> 2.2, >= 2.2.2) - rails_best_practices (1.17.0) - activesupport - code_analyzer (>= 0.4.3) - erubis - i18n - json - require_all - ruby-progressbar - railties (5.0.7) - actionpack (= 5.0.7) - activesupport (= 5.0.7) - method_source - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rainbow (2.1.0) - raindrops (0.17.0) - rake (12.3.1) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rdoc (4.2.2) - json (~> 1.4) - redcarpet (3.3.4) - redis (3.3.1) - reek (4.4.2) - codeclimate-engine-rb (~> 0.3.1) - parser (~> 2.3.1, >= 2.3.1.2) - rainbow (~> 2.0) - regexp_parser (0.4.2) - request_store (1.3.1) - require_all (1.3.3) - responders (2.4.0) - actionpack (>= 4.2.0, < 5.3) - railties (>= 4.2.0, < 5.3) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-rails (3.5.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - ruby-progressbar (1.8.1) - ruby_parser (3.8.2) - sexp_processor (~> 4.1) - rubycritic (2.9.4) - colorize - flay (~> 2.8) - flog (~> 4.4) - launchy (= 2.4.3) - parser (= 2.3.1.2) - reek (~> 4.4) - ruby_parser (~> 3.8) - virtus (~> 1.0) - sass (3.4.22) - sass-rails (5.0.6) - railties (>= 4.0.0, < 6) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - sdoc (0.4.2) - json (~> 1.7, >= 1.7.7) - rdoc (~> 4.0) - sexp_processor (4.7.0) - sidekiq (4.1.4) - concurrent-ruby (~> 1.0) - connection_pool (~> 2.2, >= 2.2.0) - redis (~> 3.2, >= 3.2.1) - sinatra (>= 1.4.7) - sprockets (3.7.1) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.1) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - thin (1.7.0) - daemons (~> 1.0, >= 1.0.9) - eventmachine (~> 1.0, >= 1.0.4) - rack (>= 1, < 3) - thor (0.20.0) - thread_safe (0.3.6) - tilt (2.0.5) - traceroute (0.5.0) - rails (>= 3.0.0) - turbolinks (5.0.1) - turbolinks-source (~> 5) - turbolinks-source (5.0.0) - tzinfo (1.2.5) - thread_safe (~> 0.1) - uglifier (3.0.2) - execjs (>= 0.3.0, < 3) - unicorn (5.1.0) - kgio (~> 2.6) - raindrops (~> 0.7) - uniform_notifier (1.10.0) - virtus (1.0.5) - axiom-types (~> 0.1) - coercible (~> 1.0) - descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) - warden (1.2.7) - rack (>= 1.0) - web-console (3.4.0) - actionview (>= 5.0) - activemodel (>= 5.0) - debug_inspector - railties (>= 5.0) - websocket-driver (0.6.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.3) - xpath (2.0.0) - nokogiri (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - acts-as-taggable-on! - bcrypt - better_errors - binding_of_caller - bootstrap-sass (~> 3.3) - bower-rails - brakeman - bullet - capistrano (= 2.15.5) - capybara - client_side_validations - coffee-rails - cucumber - devise! - factory_girl_rails - faker - font-awesome-rails - jbuilder - jquery-fileupload-rails - listen (~> 3.0.5) - logstasher - mysql2 - paperclip - rack-cors - rack-utf8_sanitizer - rails (>= 5.0, < 5.1) - rails_best_practices - rake - redcarpet - redis - rspec-rails - rubycritic - sass-rails (~> 5.0) - sdoc - sidekiq - sinatra! - thin - traceroute - turbolinks - uglifier - unicorn - web-console - -RUBY VERSION - ruby 2.5.1p57 - -BUNDLED WITH - 1.16.1 diff --git a/rails/LICENSE b/rails/LICENSE deleted file mode 100644 index 58777e31affae4a4448722cff12c8bd440236c7b..0000000000000000000000000000000000000000 --- a/rails/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ -GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -<http://www.gnu.org/licenses/>. diff --git a/rails/README b/rails/README deleted file mode 100644 index d81629b891d075f518499f4c7365ace0f8a8893e..0000000000000000000000000000000000000000 --- a/rails/README +++ /dev/null @@ -1,31 +0,0 @@ - _ - _ | | _____ ____ - /\ | | | | / ____|/ __ \ - / \ | | | | | | __| | | | - / /\ \ | | | | | | |_ | | | | - / ____ \| |____ | | | |__| | |__| | - /_/ \_\______| | | \_____|\____/ - |_| - - -#What is Allgo? (A||Go) - -A || Go is a web infrastructure to put online quickly and easily possible software or scientific prototypes. The objective is to reduce the cost of transferring -the computer researcher to end users (team member, community -Scientific Startup SMEs, the general public). -Application deployment, and especially their uses are found in simplified. One can execute via the web interface or an HTTP API. -Technically, A||Go is based on the Ruby on Rails framework to provide the web interface and HTTP services REST. Use of Docker for managing application images. -Docker provides Linux containers to manage / store / apps we use host. -A job is the action to run an application, with one file or more, which will return a result. - ---- - -If you want to contribute: - -You can fork the project, create a branch and make a pull-request. -You can refeer to the gitlab issues. -Our main need is someone who know ruby on rails testing. - -To deploy the test environment, you will need Vagrant. -Go in /deploy folder and run vagrant up, you don't need any particular software on your computer. -For more information on the infrastructure, you can refeer to the /doc folder. diff --git a/rails/Rakefile b/rails/Rakefile deleted file mode 100644 index fb6cdbf30456644fe2559bf38a83a15f72877d7f..0000000000000000000000000000000000000000 --- a/rails/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -# Add your own tasks in files placed in lib/tasks ending in .rake, -# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. - -require File.expand_path('../config/application', __FILE__) - -Allgo::Application.load_tasks diff --git a/rails/app/assets/config/manifest.js b/rails/app/assets/config/manifest.js deleted file mode 100644 index 1f012a678233e7700dc89f351e760cac9fb8dd7c..0000000000000000000000000000000000000000 --- a/rails/app/assets/config/manifest.js +++ /dev/null @@ -1,12 +0,0 @@ -// JS and CSS bundles, creates for sass 6 and polymerjs -// -//= link_directory ../javascripts .js -//= link_directory ../stylesheets .css -// link_directory ../../../vendor/assets/stylesheets .css -// link_directory ../../../vendor/assets/javascripts .js - - -// Images and fonts so that views can link to them -// -//= link_tree ../fonts -//= link_tree ../images diff --git a/rails/app/assets/images/.keep b/rails/app/assets/images/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/app/assets/images/containers.png b/rails/app/assets/images/containers.png deleted file mode 100644 index 00962b0b99fd3f2d059f0fb914b40611343758ad..0000000000000000000000000000000000000000 Binary files a/rails/app/assets/images/containers.png and /dev/null differ diff --git a/rails/app/assets/images/credit.png b/rails/app/assets/images/credit.png deleted file mode 100644 index d13cabac019d893b41129c4392b18ee0e3ae578a..0000000000000000000000000000000000000000 Binary files a/rails/app/assets/images/credit.png and /dev/null differ diff --git a/rails/app/assets/images/inria.png b/rails/app/assets/images/inria.png deleted file mode 100644 index f0ea7255130569ff44d928aea99772a08ebac033..0000000000000000000000000000000000000000 Binary files a/rails/app/assets/images/inria.png and /dev/null differ diff --git a/rails/app/assets/images/irisa.png b/rails/app/assets/images/irisa.png deleted file mode 100644 index 14706a35e2b85a09fe6cc7cab3775a68a361272b..0000000000000000000000000000000000000000 Binary files a/rails/app/assets/images/irisa.png and /dev/null differ diff --git a/rails/app/assets/images/sed.png b/rails/app/assets/images/sed.png deleted file mode 100644 index 5f0a9548c74930f9d40c8432844088785ec420cd..0000000000000000000000000000000000000000 Binary files a/rails/app/assets/images/sed.png and /dev/null differ diff --git a/rails/app/assets/javascripts/application.js b/rails/app/assets/javascripts/application.js deleted file mode 100644 index ded925af0a14e77c64f98dfd47846438def4da01..0000000000000000000000000000000000000000 --- a/rails/app/assets/javascripts/application.js +++ /dev/null @@ -1,33 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// - - -//= require jquery -//= require jquery-ujs -//= require bootstrap -// require jquery-ui/widget -//= require jquery-fileupload/basic -//= require jquery-color/jquery.color -//= require d3 -//= require nvd3 -//= require turbolinks -//= require_tree - -// NOTE rails.validations must be included *after* turbolinks -//= require rails.validations - - -// initialise the tooltips -$(function () { - $('[data-toggle="tooltip"]').tooltip() -}) diff --git a/rails/app/assets/javascripts/cable.coffee b/rails/app/assets/javascripts/cable.coffee deleted file mode 100644 index 07934d026f77c08f23d223a8cb9f3533d595881f..0000000000000000000000000000000000000000 --- a/rails/app/assets/javascripts/cable.coffee +++ /dev/null @@ -1,11 +0,0 @@ -# Action Cable provides the framework to deal with WebSockets in Rails. -# You can generate new channels where WebSocket features live using the rails generate channel command. -# -# Turn on the cable connection by removing the comments after the require statements (and ensure it's also on in config/routes.rb). -# -#= require action_cable -#= require_self -#= require_tree ./channels -# -# @App ||= {} -# App.cable = ActionCable.createConsumer() diff --git a/rails/app/assets/javascripts/channels/.keep b/rails/app/assets/javascripts/channels/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/app/assets/javascripts/datasets.js b/rails/app/assets/javascripts/datasets.js deleted file mode 100644 index dee720facdcda703fe5067aef3fcec32c121f50b..0000000000000000000000000000000000000000 --- a/rails/app/assets/javascripts/datasets.js +++ /dev/null @@ -1,2 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. diff --git a/rails/app/assets/javascripts/job_upload.coffee b/rails/app/assets/javascripts/job_upload.coffee deleted file mode 100644 index 24f83d18bbd38c24c4f7c3c2fc360cd68e857a2a..0000000000000000000000000000000000000000 --- a/rails/app/assets/javascripts/job_upload.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/rails/app/assets/javascripts/jobs/job_creation.js b/rails/app/assets/javascripts/jobs/job_creation.js deleted file mode 100644 index 2f45472886565d02fb83001ef6a267462b929283..0000000000000000000000000000000000000000 --- a/rails/app/assets/javascripts/jobs/job_creation.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -var job; // Store the job's id once created. - -/* -Fired when user clicks on "Remove". -It calls the jobs' controller aynschronously to remove the file and update the table. -*/ -function destroyFile(filename) { - $.get( '../job/' + job + '/destroy_file', {'filename': filename} ).done(function( data ) { - $.getJSON( '../job/' + job + '/attached_files', function(response) { - displayAttachedFiles(response.files); - }); - }); -} - -/* -After the user's added a file, update the table showing uploaded files. -*/ -function displayAttachedFiles(files) { - if (files.length > 0) { - var text = '<table class=\"table\"><thead><tr><th>Files uploaded</th><th></th></tr></thead>'; - for (var i in files) { - text += '<tr><td>' + files[i] + '</td><td><a class="remove-file" id="' + files[i] + '" style="cursor: pointer;">Remove</a></td></tr>'; - } - text += '</table>'; - $('#filesUploaded').html(text); - $('.remove-file').on('click', function() { - destroyFile(this.id); - }); - } else { - $('#filesUploaded').html(''); - } - $('#progress .progress-bar').remove(); // We cannot set the width to 0 because of the animations thus we remove and create a new bar. - $('#progress').append('<div class=\"progress-bar progress-bar-success\"></div>'); -} - -/* -We're using FileUpload to upload files to the server. We're using AJAX to create job before sending a file. -*/ -function enableOneUpload(webapp_id) { - $('#fileupload').fileupload({ - //maxChunkSize: 20000000, //20MB - //maxFileSize: 30000000 * 1000, //3Go - url: '/upload', - dataType: 'json', - add: function (e, data) { - //console.log("this file is :"+data.files[0].size); - if (data.files[0].size > 1000000) //show it will take time - { - //$('#progress .progress-bar').next.text("it will take time"); - } - if (job == undefined) { // We don't have a job yet, we create one. - $.getJSON( '../job/inside_creation', {'webapp_id': webapp_id}, function(response) { - job = response.job_id; - $('#job_id').val(job); - data.formData = {'id': job}; - data.submit(); - }); - } else { - data.formData = {'id': job}; - data.submit(); - } - // We have the same thing in the if and the else because the AJAX request is aynchronous. - // thus we cannot have lines after the if or they would be used before the request is done. - //TODO: use promise - }, - submit: function(e, data) { - // disable submit button - $("#job-submit-button").prop("disabled", true); - }, - stop: function (e) { - // re-enable the submit button - $("#job-submit-button").prop("disabled", false); - - $.getJSON( '../job/' + job + '/attached_files', function(response) { - displayAttachedFiles(response.files); // Display the files uploaded. - enableOneUpload(webapp_id); // Re-enable upload. - }); - }, - fail: function (e, data) { - alert(data.errorThrown +" "+data.jqXHR.responseText); - }, - progressall: function (e, data) { - //console.log(data.bitrate); - //console.log(data.total); - var progress = parseInt(data.loaded / data.total * 100, 10); - $('#progress .progress-bar').css('width', progress + '%'); // Showings the progress. - } - }).prop('disabled', !$.support.fileInput) - .parent().addClass($.support.fileInput ? undefined : 'disabled') -} - -function upload_file_with_url(webapp_id,file_url) -{ - if(job == undefined) - { - $.getJSON( '../job/inside_creation', {'webapp_id': webapp_id}, function(response) { - job = response.job_id; - $('#job_id').val(job); - }).done(function(){ - $.post('../job/get_file_url',{file_url : file_url, job_id : job}).done(function( data ){ - $.getJSON( '../job/' + job + '/attached_files', function(response) { - displayAttachedFiles(response.files); // Display the files uploaded. - }); - }).fail(function(XMLHttpRequest, textStatus, errorThrown) { - alert("we're sorry, something went wrong"+textStatus); - }); - }); - } - else - { - $.post('../job/get_file_url',{file_url : file_url, job_id : job}).done(function( data ){ - $.getJSON( '../job/' + job + '/attached_files', function(response) { - displayAttachedFiles(response.files); // Display the files uploaded. - }); - }); - } -} diff --git a/rails/app/assets/javascripts/webapps/webapps.js b/rails/app/assets/javascripts/webapps/webapps.js deleted file mode 100644 index 00330ee3243b6c29fcf7e5bcc5a0ff09c2a81315..0000000000000000000000000000000000000000 --- a/rails/app/assets/javascripts/webapps/webapps.js +++ /dev/null @@ -1,12 +0,0 @@ - -/* view/webapps/index */ -function webapps_index() -{ - // $(".thumbnail").hover(function() { - // $(this).css("cursor","pointer"); - // $(this).animate({"border-color": "#ff6000"}, 50); - // }, function() { - // $(this).animate({"border-color": "#cccccc"}, 50); - // }); - -} diff --git a/rails/app/assets/stylesheets/allgo.scss b/rails/app/assets/stylesheets/allgo.scss deleted file mode 100644 index 833bb5b1bbabc82f07735db426785a083edfdb71..0000000000000000000000000000000000000000 --- a/rails/app/assets/stylesheets/allgo.scss +++ /dev/null @@ -1,245 +0,0 @@ -$fonts_body : Roboto, sans-serif; -$fonts_big_title: Offside, cursive; - -$navbar_bg_color: #3399CC; //also h1 color -$navbar_font_color: white; //also h1 color -$navbar_hover_color: #ff6000; - -//$second_color: #3399CC; -$second_color: #ff6000; - -$fonts_title_color: #ff6000; - -$webapp_border_color: #ff6000; -$webapp_hover_border_color: #3399CC; - - /* Body */ - html, body, h3, h4, h5, p { - font-family: $fonts_body; - } - - @media (min-width: 1300px) { - .container{ - width: 1300px; - } -} - - h1, h2 { - font-family: $fonts_big_title; - font-weight:normal; - color: $fonts_title_color; - } - - h1 { - font-size: 72px; - } - - .allgo-title, .brand { - font-family: $fonts_big_title; - } - - .brand { - font-size: 26px; - } - -h3, h4, h5 { - color: $second_color; -} - -#main-text { - color: $navbar_bg_color; -} - -.btn-success { - background-color: $second_color; - border-color: $second_color; -} -.btn-success:hover { - background-color: #ff6100; - border-color: #ff6100; -} - /* Navbar */ - @media screen and (max-width: 1000px) { - .navbar { - height: 50px; - } - } - - .navbar { - background-color: $navbar_bg_color; - font-size: 20px; - .link-avatar { - padding: 0; - } - .avatar { - margin-top: 9px; - } - } - - .navbar-inverse .navbar-nav > li > a { - color: $navbar_font_color; - } - .navbar-inverse .navbar-nav > li > a:hover { - color: $navbar_hover_color; - } - - /* mod navbar for no collapse on small screen */ - .navbar-collapse.collapse { - display: block!important; - } - - .navbar-nav>li, .navbar-nav { - float: left !important; - } - - .navbar-nav.navbar-right:last-child { - margin-right: -15px !important; - } - - .navbar-right { - float: right!important; - } - /* end of mod navbar, thanks Armand ! */ - - /* bloc to be used for inserting an anchor and ensure that we are not below the navbar - * http://stackoverflow.com/questions/4086107/html-positionfixed-page-header-and-in-page-anchors - */ - .jumptarget { - margin-top: -50px; - height:50px; - visibility: hidden; - } - - body { - padding-top: 70px; - } - - .webapp { - border: 4px solid $webapp_hover_border_color; - } - .webapp:hover{ - border: 4px solid $webapp_border_color; - cursor: pointer; - } - - /* Content */ - - .progress { - margin-top: 7px; - } - - .logo { - text-align: center; - margin-top: 12px; - } - - .pop { - color: #337ab7; - } - - .app-info { - background-color: #f5f5f5; - border-radius: 4px; - padding: 7px; - } - - .app-img { - float: right; - } - - .presentation { - background-image: image-url("containers.png"); - padding: 30px 0 20px 0; - margin-top: -20px; - margin-bottom: 20px; - } - - .margin-20 { - margin-top: 20px; - } - - .margin-30 { - margin-top: 30px; - } - - .text-muted { - font-size: 14px; - } - - @media screen and (min-width: 1000px) { - .webapp { - width: 15em; - height: 20em; - } - } - .centered { - text-align: center; - } - - .cloud { - .s { font-size: 10px; } - .m { font-size: 16px; } - .l { font-size: 22px; } - .xl { font-size: 28px; } - } - - .cloud-all { - display: block; - margin-top: 15px; - margin-bottom: 20px; - } - - // Footer - .footer-space { - min-height: 43px; - } - - .footer { - position:fixed; - bottom: 0; - height: 43px; - width: 100%; - background-color: #f5f5f5; - border-top: 1px solid #e7e7e7; - - img { - height: 43px; - } - - .credits { - padding-left: 0; - } - - .container .credit { - margin-top: 12px; - } - } - - /* Wrapper for page content to push down footer */ - #wrap { - /* Negative indent footer by its height */ - margin: 0 auto -60px; - /* Pad bottom by footer height */ - padding: 0 0 60px; - } - - code { - font-size: 80%; - } - - .caption > p { - color : black; - font-size:medium; - } - - /* form errors */ - - .field_with_errors > label { - color: red -// padding: 2px; -// background-color: red; - } - .field_with_errors > input { - border: solid 2px red; - } - diff --git a/rails/app/assets/stylesheets/application.scss b/rails/app/assets/stylesheets/application.scss deleted file mode 100644 index bfb1ca6f1d2be9de4c0712ee00b8a2f7852cb396..0000000000000000000000000000000000000000 --- a/rails/app/assets/stylesheets/application.scss +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require_self - *= require_tree - *= require jquery.fileupload - *= require jquery.fileupload-ui - *= require nvd3 - *= require font-awesome - */ - @import "bootstrap-sprockets"; - @import "bootstrap"; - @import url(https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900italic,900|Offside); diff --git a/rails/app/assets/stylesheets/scaffolds.scss b/rails/app/assets/stylesheets/scaffolds.scss deleted file mode 100644 index ceb4a229f9c513f9b23be0381d681c2c5290dea8..0000000000000000000000000000000000000000 --- a/rails/app/assets/stylesheets/scaffolds.scss +++ /dev/null @@ -1,34 +0,0 @@ -// div { -// &.field, &.actions { -// margin-bottom: 10px; -// } -// } - -#notice { - color: green; -} - -#error_explanation { - width: 450px; - border: 2px solid red; - padding: 7px; - padding-bottom: 0; - margin-bottom: 20px; - background-color: #f0f0f0; - - h2 { - text-align: left; - font-weight: bold; - padding: 5px 5px 5px 15px; - font-size: 12px; - margin: -7px; - margin-bottom: 0px; - background-color: #c00; - color: #fff; - } - - ul li { - font-size: 12px; - list-style: square; - } -} diff --git a/rails/app/assets/stylesheets/webapps.css.scss b/rails/app/assets/stylesheets/webapps.css.scss deleted file mode 100644 index 4274e18963f6a9670ba84e4a9d70ce301c385622..0000000000000000000000000000000000000000 --- a/rails/app/assets/stylesheets/webapps.css.scss +++ /dev/null @@ -1,4 +0,0 @@ -// .webapp_thumbnail -// { -// background-color:#F5F7FA; height:17em; width:11em; -// } diff --git a/rails/app/channels/application_cable/channel.rb b/rails/app/channels/application_cable/channel.rb deleted file mode 100644 index 438c84154d21871060bf9e79061d5ab0b0de7f47..0000000000000000000000000000000000000000 --- a/rails/app/channels/application_cable/channel.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. Action Cable runs in an EventMachine loop that does not support auto reloading. -module ApplicationCable - class Channel < ActionCable::Channel::Base - end -end diff --git a/rails/app/channels/application_cable/connection.rb b/rails/app/channels/application_cable/connection.rb deleted file mode 100644 index 7b8ec558b8b47e798f5643a64986d325e4484ee9..0000000000000000000000000000000000000000 --- a/rails/app/channels/application_cable/connection.rb +++ /dev/null @@ -1,20 +0,0 @@ -# Be sure to restart your server when you modify this file. Action Cable runs in an EventMachine loop that does not support auto reloading. -module ApplicationCable - class Connection < ActionCable::Connection::Base - identified_by :current_user - - def connect - self.current_user = find_verified_user - logger.add_tags 'ActionCable', current_user.name - end - - protected - def find_verified_user - if verified_user = User.find_by(id: cookies.signed['user.id']) - verified_user - else - reject_unauthorized_connection - end - end - end -end diff --git a/rails/app/controllers/admin/application_controller.rb b/rails/app/controllers/admin/application_controller.rb deleted file mode 100644 index 84b59d0534e5706f0c2989fff3ae8c584bc08307..0000000000000000000000000000000000000000 --- a/rails/app/controllers/admin/application_controller.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Admin::ApplicationController < ApplicationController - before_action :verify_admin_permission - layout 'admin' - - def verify_admin_permission - # only admin users can see the admin pages, others get 404 - if current_user.nil? or not current_user.admin? - not_found - end - end -end diff --git a/rails/app/controllers/admin/dashboard_controller.rb b/rails/app/controllers/admin/dashboard_controller.rb deleted file mode 100644 index f59cf4d9575f9289e0ebaa15dddf70449177eb87..0000000000000000000000000000000000000000 --- a/rails/app/controllers/admin/dashboard_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class Admin::DashboardController < Admin::ApplicationController - - def index - @active_jobs = Job.active.order(state: :desc).order(updated_at: :desc) - @previous_jobs = Job.done.order(updated_at: :desc).limit(10) - @pending_versions = WebappVersion.pending.order(updated_at: :desc) - @active_sandboxes = Webapp.where.not(sandbox_state: "IDLE").order(updated_at: :desc) - end - -end diff --git a/rails/app/controllers/admin/logs_controller.rb b/rails/app/controllers/admin/logs_controller.rb deleted file mode 100644 index 21f7463163ea49622f64fc4b71f074355a8c6880..0000000000000000000000000000000000000000 --- a/rails/app/controllers/admin/logs_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Admin::LogsController < Admin::ApplicationController - - - - def show - render 'error_log' - end - - def show_sidekiq - render 'sidekiq_log' - end - -end diff --git a/rails/app/controllers/admin/registry_controller.rb b/rails/app/controllers/admin/registry_controller.rb deleted file mode 100644 index 762070a199138e83e132f69375363ee73c4ecff7..0000000000000000000000000000000000000000 --- a/rails/app/controllers/admin/registry_controller.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Admin::RegistryController < Admin::ApplicationController - - def index - #get all the images from the registry - @images = JSON.load(open("http://#{Rails.configuration.docker_registry}/v2/_catalog")) - #TODO: https issues - end - - def create - - end - - def show - - end - - def update - - end - -end diff --git a/rails/app/controllers/admin/statistics_controller.rb b/rails/app/controllers/admin/statistics_controller.rb deleted file mode 100644 index 6626c040020b8ad8949d9557e3150f431955ec5e..0000000000000000000000000000000000000000 --- a/rails/app/controllers/admin/statistics_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Admin::StatisticsController < Admin::ApplicationController - - def index - @webapps = Webapp.published - @w_in_progress = Webapp.none - @w_just_created = Webapp.creating - end - - def index_webapps - @webapps = Webapp.all - #display some global statistics and a dropdown list to choose a webapp - end - - def show_webapps - - end - -end diff --git a/rails/app/controllers/admin/webapps_controller.rb b/rails/app/controllers/admin/webapps_controller.rb deleted file mode 100644 index 8530460afdaee5a6093159ab3e6667388f32feca..0000000000000000000000000000000000000000 --- a/rails/app/controllers/admin/webapps_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Admin::WebappsController < Admin::ApplicationController - - def index - @webapps = Webapp.select('id','name','user_id','created_at').creating - @webapps_upgrading = Webapp.published.where.not(sandbox_state: "IDLE") - end - -end diff --git a/rails/app/controllers/api/v0/api_controller.rb b/rails/app/controllers/api/v0/api_controller.rb deleted file mode 100644 index 6ed714af35851c31d2feff9b60b125782f24b9d7..0000000000000000000000000000000000000000 --- a/rails/app/controllers/api/v0/api_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Api::V0 - class ApiController < ApplicationController - # Generic API stuff here - - - end -end diff --git a/rails/app/controllers/api/v0/jobs_controller.rb b/rails/app/controllers/api/v0/jobs_controller.rb deleted file mode 100644 index 99cf6077892a28f4d19bda280b7bfd48a5bd4ef1..0000000000000000000000000000000000000000 --- a/rails/app/controllers/api/v0/jobs_controller.rb +++ /dev/null @@ -1,92 +0,0 @@ -class Api::V0::JobsController < ApplicationController - skip_before_action :verify_authenticity_token - before_action :authenticate - -#How it works : -#curl -H 'Authorization: Token token=your_token' -X POST -F job[webapp_id]=46 -F job[param]="" -F job[file]=@test.txt allgo-dev.local/api/v0/jobs -#curl -H 'Authorization: Token token=your_token' -X GET allgo-dev.local:3000/api/v0/jobs/215.json - - #POST /jobs.json - def create - jp = job_params - files = files_param - require 'fileutils' - @quota = Quota.find_by_user_id_and_webapp_id(@user.id,job_params[:webapp_id]) - if(@quota.blank?) - @dq = Webapp.find(job_params[:webapp_id]) - @quota = Quota.create({user_id: @user.id , webapp_id: job_params[:webapp_id], quantity: @dq.default_quota}) - end - if jp[:file] - @job = Job.new(user: @user, webapp_id: jp[:webapp_id], param: jp[:param], version: Webapp.find(jp[:webapp_id]).webapp_versions.usable.order("number DESC").first.number) - @job.save - f = jp[:file] - f.original_filename.delete(' ') - FileUtils.mkpath(@job.path) - df = File.join(@job.path, f.original_filename) - @job.datafile = df - FileUtils.mv(f.tempfile, df, :force => true) - File.chmod(0644, df) - @job.datasize = File.size(df) #ajout pour récupérer la taille du fichier - @job.save - @quota = Quota.find_by_user_id_and_webapp_id(@user.id,@job.webapp.id) - new_q = @quota.quantity.to_i - @job.datasize.to_i #is the quota gonna be positive? - @quota.quantity = new_q - if (new_q > 0) - JobWorker.perform_later(@job) #we run the job - @quota.decrease(new_q) - render json: {id: @job.id, url: request.protocol + request.host + ":3000" + "/datastore/" + @job.path} - #render json: @job - else - render text: "not enough quota" - end - else - render text: "Please upload a file" - end - end - - def index - render text: "#{@user.id}" - end - - def show - require 'json' - @job = Job.find(params[:id]) - if @job.status == 'finish' - output = files_list - render json: output - else - render text: "job is not over yet" - end - end - - private - def authenticate - authenticate_or_request_with_http_token do |token, options| - @user = User.find_by(auth_token: token) - end - end - - def request_http_token_authentication(realm = "Application") - self.headers["WWW-Authenticate"] = %(Token realm="#{realm.gsub(/"/, "")}") - self.__send__ :render, :json => { :error => "HTTP Token: Access denied. You did not provide an valid API key." }.to_json, :status => :unauthorized - end - - def job_params - params.require(:job).permit(:webapp_id, :datafile, :file, :param, :status, :datasize, - webapp_attributes: [:name, :id]) - end - - def files_list - require 'json' - i = 0 - output = "{ \"#{@job.id}\" : {" - Dir.foreach(@job.path) do |f| next if f == '.' or f == '..' - output += "\"#{File.basename(f)}\" : " + - "\"" + request.protocol + request.host + ":3000" + "/datastore/" + @job.path + "/" + File.basename(f) + "\"," - end - output = output.chomp(",") - output += " }}" - return output - end - -end diff --git a/rails/app/controllers/api/v0/old_api.txt b/rails/app/controllers/api/v0/old_api.txt deleted file mode 100644 index 17e0f7799dc160ff915debc074b5b01ef1192799..0000000000000000000000000000000000000000 --- a/rails/app/controllers/api/v0/old_api.txt +++ /dev/null @@ -1,58 +0,0 @@ - -<!-- Here is an example of our low level API, HTTP REST :<br> - <p> - <b>1. Create the job</b> <br> - HTTP Request : <br> - <pre>Method : POST -Params : job[webapp_id]=<%= #@webapp.id %> -Url : https://<%= #request.host %>/jobs</pre> - </p> - - <p> - HTTP Response :<br> - <pre>Status code : 302 Moved Temporarily -Location: http://<%= #request.host %>/jobs/63/edit</pre> - - Here, the job id (jid) in <b>63</b>. - </p> - - <p> - <b>2. Upload your data </b><br> - HTTP Request : <br> - <pre>Method : POST -Content-Type multipart/form-data -Params : Job=63 ; file=octet_stream -Url : https://<%= #request.host %>/upload</pre> - </p> - - <p> - <b>3. Schedule the job </b><br> - HTTP Request : <br> - <pre>Method : PUT -Params : job[webapp_id]=1;job[status]:scheduled -Url : https://<%= #request.host %>/jobs/63</pre> - </p> - - <p> - <b>4. Pull your job status and responses :</b><br> - HTTP Request : <br> - <pre>Method : GET -Url : https://<%= #request.host %>/jobs/63.json</pre> - - If the status parameter is not 'finish', retry. <br> - - Example of json payload : - <pre> -{"id":63, -"files": ["https://<%= request.host %>/datastore/abfedec52e8c3e8b2878da31ad8e0b64/test.mp3", - "https://<%= request.host %>/datastore/abfedec52e8c3e8b2878da31ad8e0b64/test_speech.log", - "https://<%= request.host %>/datastore/abfedec52e8c3e8b2878da31ad8e0b64/test_music.log"] -"webapp_id":1, -"user_id":17, -"status":"finish", -"created_at":"2014-01-30T08:27:10.000Z", -"updated_at":"2014-01-30T08:28:07.000Z", -"param":""} - </pre> - </p> ---> diff --git a/rails/app/controllers/api/v1/api_controller.rb b/rails/app/controllers/api/v1/api_controller.rb deleted file mode 100644 index 1524c0dbb6871d84697f2679710710f3585dd74d..0000000000000000000000000000000000000000 --- a/rails/app/controllers/api/v1/api_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Api::V1 - class ApiController < ApplicationController - # Generic API stuff here - - private - def authenticate - authenticate_or_request_with_http_token do |token, options| - @user = User.find_by(auth_token: token) - end - end - - def request_http_token_authentication(realm = "Application", message=nil) - self.headers["WWW-Authenticate"] = %(Token realm="#{realm.gsub(/"/, "")}") - self.__send__ :render, :json => { :error => "HTTP Token: Access denied. You did not provide an valid API key." }.to_json, :status => :unauthorized - end - - end -end diff --git a/rails/app/controllers/api/v1/jobs_controller.rb b/rails/app/controllers/api/v1/jobs_controller.rb deleted file mode 100644 index c8a9b93959f892178dc1ab5772a7ef7e37fbd482..0000000000000000000000000000000000000000 --- a/rails/app/controllers/api/v1/jobs_controller.rb +++ /dev/null @@ -1,103 +0,0 @@ -#Job controller for API V1 -#class Api::V1::JobsController < ApplicationController -class Api::V1::JobsController < Api::V1::ApiController - skip_before_action :verify_authenticity_token - before_action :authenticate - respond_to :json - -#How it works : -#curl -H 'Authorization: Token token=your_token' -X POST -F job[webapp_id]=46 -F job[param]="" -F files[0]=@test.txt allgo-dev:3000/api/v1/jobs -#curl -H 'Authorization: Token token=your_token' -X GET allgo-dev.local:3000/api/v1/jobs/215.json - - #POST /jobs.json - def create - jp = job_params - - # lookup webapp - webapp = Webapp.find jp[:webapp_id] - - # lookup job queue (by name) - queue = jp.extract!(:queue)[:queue] - jp[:queue_id] = queue ? JobQueue.find_by!(name: queue).id : webapp.default_job_queue_id - - #TODO: multi file_url by api - if params[:files].nil? and jp[:dataset].nil? and jp[:file_url].nil? and jp[:param].nil? #no files, nothing - #render text: "you forgot to use a input file" - render json: {error: "no input file"}.to_json - #if webapp_id not found - #elsif - else - @job = Job.create_w_user(jp,@user.id) - if jp[:dataset] - unless @job.use_dataset(Dataset.where(name: jp[:dataset], user_id: @user.id).select("id").first) - error = "can't find dataset, check the name please" - end - end - if jp[:file_url] - unless @job.download_file(jp[:file_url]) - error = "url not valid, check your link extension" - end - end - if params[:files] - puts params[:files] - params[:files].each do |key,value| - # unless @job.move_file(value) - # error = "can't move the file, sorry" - # end - puts "key : #{key}, value: #{value}" - jb = @job.job_uploads.create(job_file: value) - @job.datasize += jb.job_file_file_size - @job.save - end - end - if error - @job.destroy! - render json: {error: error}.to_json - elsif @job.save_and_run - render json: {avg_time: @job.webapp.exec_time, id: @job.id, url: "#{Rails.configuration.root_url}" + "/api/v1/jobs/" + "#{@job.id}"} - else - render json: {error: "no file found or not enough quota, mail us"}.to_json - end - end - end - - def index - # FIXME: why return user id? (should return a job list instead) - render text: "#{@user.id}" - end - - def show - require 'json' - @job = Job.find(params[:id]) - if @user.id == @job.user_id or @user.admin? - case @job.state - when "DONE" then - result = files_list - result[:status] = @job.status - - render json: result - when "ARCHIVED" then render json: {status: "archived"} - else render json: {status: "in progress"} - end - else - #render text: "user not authorized" - render json: {error: "user not authorized"}.to_json - end - end - -private - - def job_params - params.require(:job).permit(:webapp_id, :dataset, :datafile, :file, :param, :status, :datasize, :file_url, :queue, webapp_attributes: [:name, :id], :files_attributes => []) - end - - def files_list - files = {} - Dir.foreach(@job.path) do |f| - next if f == '.' or f == '..' - files[File.basename(f)] = "#{Rails.configuration.root_url}/datastore/#{@job.folder}/#{File.basename(f)}" - end - return { @job.id.to_s => files} - end - -end diff --git a/rails/app/controllers/api/v1/webapps_controller.rb b/rails/app/controllers/api/v1/webapps_controller.rb deleted file mode 100644 index 86e437f3ddcc7fcba2eec9beb853d82b6b98c4ab..0000000000000000000000000000000000000000 --- a/rails/app/controllers/api/v1/webapps_controller.rb +++ /dev/null @@ -1,65 +0,0 @@ -class Api::V1::WebappsController < Api::V1::ApiController - skip_before_action :verify_authenticity_token - before_action :authenticate - respond_to :json - - - def edit - #user do : curl -H 'Authorization: Token token=your_token' -X GET http://allgo.inria.fr/api/v1/webapps/1/edit - if params[:id] - @webapp = Webapp.find(params[:id]) - if @user.id == @webapp.user_id - if @webapp.edit_container # FIXME: broken - #TODO: return only after the sandbox is ready - value = {connection: "#{@webapp.ssh_connect_string}"} - else - value = {error: "sandbox already running"} - end - else - value = {error: "nice try"} - end - else - value = {error:"I find your lack of id disturbing"} - end - render json: value.to_json - end - - def update_container - #user do : curl -H 'Authorization: Token token=your_token' -X PATCH http://allgo.inria.fr/api/v1/webapps/1/edit - p params - p "toto" - vp = version_params - @webapp = Webapp.find(params[:webapp_id]) - if @user.id == @webapp.user_id and !@webapp.ipadress.nil? - number = "" - if version_params[:number] - number = version_params[:number] - end - changelog = "" - if version_params[:changelog] - changelog = version_params[:changelog] - end - - @webapp.transaction do - ver = wp["webapp_versions_attributes"]["0"] - - # TODO catch exception to ensure that there is no pending commits (and report error to the user) - @webapp.create_version( - number: number, - changelog: changelog, - state: "SANDBOX", - published: true, - ).save! - @webapp.update!(sandbox_state: "STOPPING") - end - - return "work in progress..." - end - end - - private - def version_params - params.require(:version).permit(:number, :changelog) - end - -end diff --git a/rails/app/controllers/application_controller.rb b/rails/app/controllers/application_controller.rb deleted file mode 100644 index 2b4b14cba6d5025b123c7222ddb671ce50283394..0000000000000000000000000000000000000000 --- a/rails/app/controllers/application_controller.rb +++ /dev/null @@ -1,34 +0,0 @@ -# -*- encoding : utf-8 -*- -class ApplicationController < ActionController::Base - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception - - - # not found page: Error 404 - def not_found - respond_to do |format| - format.html { render "/errors/404", status: 404} - format.json { render json: {"error": "404 Not Found"}, status: 404} - end - end - - # - # Code for redirecting to the previous location after sign_in - # - # taken from https://github.com/plataformatec/devise/wiki/How-To:-Redirect-back-to-current-page-after-sign-in,-sign-out,-sign-up,-update - - # saves the location before loading each page so we can return to the - # right page. If we're on a devise page, we don't want to store that as the - # place to return to (for example, we don't want to return to the sign in page - # after signing in), which is what the :unless prevents - before_action :store_current_location, :unless => :devise_controller? - - private - # override the devise helper to store the current location so we can - # redirect to it after loggin in or out. This override makes signing in - # and signing up work automatically. - def store_current_location - store_location_for(:user, request.url) - end -end diff --git a/rails/app/controllers/custom_registrations_controller.rb b/rails/app/controllers/custom_registrations_controller.rb deleted file mode 100644 index c7f83856da35e5398fb43ef774094761f9636acb..0000000000000000000000000000000000000000 --- a/rails/app/controllers/custom_registrations_controller.rb +++ /dev/null @@ -1,42 +0,0 @@ -# -*- encoding : utf-8 -*- -class CustomRegistrationsController < Devise::RegistrationsController - - protected - - # def configure_permitted_parameters - # devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:sshkey) } - # end - - def profile - @user = current_user - end - - def update_resource(resource, params) - resource.update_without_password(params) - end - - def account_update_params - params.require(:user).permit(:email, :password, :password_confirmation, :sshkey, :current_password, :auth_token ) - end - - # def update - # self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key) - # prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email) - # resource_updated = update_resource(resource, account_update_params) - # yield resource if block_given? - # if resource_updated - # if is_flashing_format? - # flash_key = update_needs_confirmation?(resource, prev_unconfirmed_email) ? - # :update_needs_confirmation : :updated - # set_flash_message :notice, flash_key - # end - # sign_in resource_name, resource, bypass: true - # respond_with resource, location: after_update_path_for(resource) - # else - # clean_up_passwords resource - # respond_with resource - # end - # @user.reload.update_attributes(:sshkey => params[:sshkey]) - # end - -end diff --git a/rails/app/controllers/datasets_controller.rb b/rails/app/controllers/datasets_controller.rb deleted file mode 100644 index 10a026c7b47e584292c4b65283cb2d94ef3322c6..0000000000000000000000000000000000000000 --- a/rails/app/controllers/datasets_controller.rb +++ /dev/null @@ -1,91 +0,0 @@ -class DatasetsController < ApplicationController - before_action :set_dataset, only: [:show, :edit, :update, :destroy] - - # GET /datasets - # GET /datasets.json - def index - @datasets = Dataset.all - end - - # GET /datasets/1 - # GET /datasets/1.json - def show - @dataset = Dataset.where(user_id: current_user.id) - if !@dataset - render new - end - end - - # GET /datasets/new - def new - @dataset = Dataset.new - @datasets = Dataset.where(user_id: current_user.id) - end - - # GET /datasets/1/edit - def edit - end - - # POST /datasets - # POST /datasets.json - def create - @dataset = Dataset.new - @dataset.user_id = current_user.id - @dataset.name = dataset_params[:name] - file = dataset_params[:file] - @dataset.file_name = file.original_filename.delete(' ') - respond_to do |format| - if @dataset.move_file(dataset_params) - if @dataset.save - flash[:success] = "Dataset was successfully created." - format.html { redirect_to :back } - format.json { render :show, status: :created, location: @dataset } - end - else - flash[:warning] = "Dataset was not created. Do you exceed the 200 MB limit ?" - format.html { redirect_to :back } - format.json { render json: @dataset.errors, status: :unprocessable_entity } - end - end - end - - # PATCH/PUT /datasets/1 - # PATCH/PUT /datasets/1.json - def update - respond_to do |format| - if @dataset.update(dataset_params) - format.html { redirect_to @dataset, notice: 'Dataset was successfully updated.' } - format.json { render :show, status: :ok, location: @dataset } - else - format.html { render :edit } - format.json { render json: @dataset.errors, status: :unprocessable_entity } - end - end - end - - # DELETE /datasets/1 - # DELETE /datasets/1.json - def destroy - @dataset.destroy - FileUtils.rm(@dataset.get_file) - respond_to do |format| - #format.html { redirect_to datasets_url, notice: 'Dataset was successfully destroyed.' } - format.html { - flash[:success] = 'Dataset was successfully destroyed.' - redirect_to datasets_url - } - format.json { head :no_content } - end - end - - private - # Use callbacks to share common setup or constraints between actions. - def set_dataset - @dataset = Dataset.find(params[:id]) - end - - # Never trust parameters from the scary internet, only allow the white list through. - def dataset_params - params.require(:dataset).permit(:name, :size, :user_id, :extension, :file) - end -end diff --git a/rails/app/controllers/documentation_controller.rb b/rails/app/controllers/documentation_controller.rb deleted file mode 100644 index 8e0540e3bbd15d6fad89c4c5c7b9af5c507a07b9..0000000000000000000000000000000000000000 --- a/rails/app/controllers/documentation_controller.rb +++ /dev/null @@ -1,11 +0,0 @@ -# -*- encoding : utf-8 -*- -class DocumentationController < ApplicationController - def about - end - - def tutorial - end - - def infrastructure - end -end diff --git a/rails/app/controllers/home_controller.rb b/rails/app/controllers/home_controller.rb deleted file mode 100644 index 3f2e4051825466a32472edf9d8b79af86190c7be..0000000000000000000000000000000000000000 --- a/rails/app/controllers/home_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -class HomeController < ApplicationController - # def index - # @user = current_user - # end - - def index - - end -end diff --git a/rails/app/controllers/jobs_controller.rb b/rails/app/controllers/jobs_controller.rb deleted file mode 100644 index 1826185889bdd63c3b5062ee2163dd6539d8e2dd..0000000000000000000000000000000000000000 --- a/rails/app/controllers/jobs_controller.rb +++ /dev/null @@ -1,238 +0,0 @@ -class JobsController < ApplicationController - before_action :set_job, only: [:show, :edit, :upload, :destroy, :update, :destroy_file, :attached_files, :abort] - # FIXME: should allow creating a job using the webapp access_token - before_action :authenticate_user! - #skip_before_action :verify_authenticity_token - - #How it works - #When the user upload a file for the first time on the app page, we create a job in ajax with inside_creation (see assets/job_creation.js) - #Then we upload the file using upload - - - # GET /job/inside_creation - # Creation of the job in ajax when uploading files, used in show.html.erb - # Model.new don't save in database, we need to do Model.save. Model.create does - def inside_creation - job = Job.create_in_ajax(params['webapp_id'],current_user.id) - render json: { job_id: job.id } - end - - # POST /jobs/upload - def upload - jb = @job.job_uploads.create(job_file: params[:file]) - @job.datasize += jb.job_file_file_size - #Job.create(params) - #@job.move_file(params[:file]) - @job.save! - render json: { status: "upload done" } - end - - ##TODO: chuncked upload - # def upload - # @temp_upload = Job.new(params[:upload]) - # - # @upload = Job.where(:datafile => @temp_upload.upload_file_name).first - # - # if @upload.nil? - # @upload = Upload.create(params[:upload]) - # else - # if @upload.filesize.nil? - # @upload.filesize = @temp_upload.upload_file_size - # else - # @upload.filesize += @temp_upload.upload_file_size - # end - # end - # - # p = params[:upload] - # name = p[:upload].original_filename - # directory = "uploads" - # - # path = File.join(directory, name.gsub(" ","_")) - # File.open(path, "ab") { |f| f.write(p[:upload].read) } - # - # respond_to do |format| - # if @upload.save - # format.html { - # render :json => [@upload.to_jq_upload].to_json, - # :content_type => 'text/html', - # :layout => false - # } - # format.json { render json: {files: [@upload.to_jq_upload]}, status: :created, location: @upload } - # else - # format.html { render action: "new" } - # format.json { render json: @upload.errors, status: :unprocessable_entity } - # end - # end - # end - - # POST /jobs - # POST /jobs.json - def create - @job = Job.find_by(id: params[:job][:id]) - #job was not created in inside_creation - #we create a job with user and directory - if @job.blank? #job without files or maybe using a dataset, who knows ? - @job = Job.create_w_user(job_params, current_user.id) - else - @job.param = params[:job][:param] - @job.version = params[:job][:version] - end - @job.save - unless params[:dataset].blank? - @job.use_dataset(params[:dataset]) - end - respond_to do |format| - if @job.save_and_run - format.html { - flash[:success] = "Your job has been created, it'll be ready soon" - redirect_to @job - } - format.json { render action: 'show', status: :created, location: @job } - else - format.html { - redirect_to @job.webapp - flash[:danger] = "files or param are missing, or #{@job.errors}" - } - format.json { render json: @job.errors, status: :unprocessable_entity } - end - end - end - - # GET /jobs - # GET /jobs.json - def index - if current_user.admin? - @jobs = Job.not_archived.order("id desc").all - else - if params[:app] - @jobs = Job.not_archived.where(user_id: current_user.id,webapp_id: params[:app] ).order("id desc").all - else - @jobs = Job.not_archived.where(user_id: current_user.id).order("id desc") - end - end - end - - # GET /jobs/1 - # GET /jobs/1.json - def show - respond_to do |format| - format.html # show.html.erb - format.json { render json: @job } - end - end - - # GET /jobs/new - def new - @job = Job.new - @job.build_webapp - @job.build_user - end - - # GET /jobs/1/attached_files - def attached_files - files = [] - Dir.foreach(@job.path) do |f| next if f == '.' or f == '..' or f.start_with?('.') - if File.size(File.join(@job.path, f)) > 0 # TODO: and file don't start with . (hidden file) - files.push(File.basename(f)) - end - end - respond_to do |format| - format.html - format.js {} - format.json { - render json: {files: files} - } - end - end - - # POST /jobs/1/abort - def abort - @job.abort - respond_to do |format| - format.html { redirect_to @job } - format.json { head :no_content } - end - end - - # DELETE /jobs/1 - # DELETE /jobs/1.json - def destroy - @job.purge - respond_to do |format| - format.html { - if request.referrer && request.referrer =~ /\d$/ - # if we call "destroy" from the job page, then redirect to the job index - redirect_to jobs_path - else - # otherwise redirect to the previous page - redirect_back fallback_location: jobs_path - end - } - format.json { head :no_content } - end - end - - def destroy_file - begin - require 'fileutils' - JobUpload.where(job_id: @job.id, job_file_file_name: params['filename']).destroy - #FileUtils.rm_f(@job.path + '/' + params['filename']) if Dir["@job.path"] - rescue Exception => e - puts e - end - respond_to do |format| - format.json { head :no_content } - end - end - - def generate_zip - @job = Job.find(params[:id]) - tmpdir = Dir.mktmpdir "allgo-zip-job-#{@job.id}-" - - zipfile = "#{tmpdir}/job-#{@job.id}.zip" - if not system ["/usr/bin/zip", "zip"], "-r", zipfile, ".", chdir: @job.path - raise "zip failed: #{$?}" - end - send_file(zipfile, x_sendfile: true, - type: 'application/zip', - filename: "allgo_job_#{@job.id}.zip") - - #TODO cleanup the tmp file after a delay - end - - def show_content - @job = Job.find(params[:id]) - #if @job.user_id == current_user.id or current_user.admin - render partial: "jobs/ajax/show_content", layout: false, locals: {:@job => @job, :toto => @job.state} - #end - end - - def get_file_url - if params[:file_url] - @job = Job.where(id: params[:job_id]).first - @job.download_file(params[:file_url]) - end - end - - private - # Use callbacks to share common setup or constraints between actions. - def set_job - @job = Job.find_by(id: params[:id]) - case @job and @job.state - when nil - when "ARCHIVED" - when "DELETED" - else - return - end - not_found - end - - # Never trust parameters from the scary internet, only allow the white list through. - #for params name job[:bar] where params.require(:foo).permit(:bar) - def job_params - params.require(:job).permit(:id, :webapp_id, :datafile, :param, :state, :filename, :file, :version, :datasize, :file_url, :queue_id, - :dataset, webapp_attributes: [:name, :id]) - end - -end diff --git a/rails/app/controllers/quotas_controller.rb b/rails/app/controllers/quotas_controller.rb deleted file mode 100644 index 1cf9dfa2848d49d3f71e1e2d771b1162536f9b4b..0000000000000000000000000000000000000000 --- a/rails/app/controllers/quotas_controller.rb +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding : utf-8 -*- -class QuotasController < ApplicationController - # pour récupérer le quota d'un utilisateur - def get_quota(user_v, webapp_v) - q = Quota.select('quantity').where(user_id: user_v, webapp_id: webapp_v).limit(1) - return q.fetch() - end - - # def create(user_v, webapp_v) - # #if get_quota(user_v,webapp_v) == nil - # @q = Quota.new({user_id: user_v, webapp_id: webapp_v, quantity: 1000}) - # #end - # @q.save - # return @q - # end - - def update(user_v, webapp_v) - #q. - end - - def show(user) - @quotas = Quota.where(user_id: @current_user.id) - end - - def index() - user_id = current_user.id - @quotas = Quota.where(user_id: user_id) - end - - def calcul_new(new_q) - - end - - private - def quota_params - params.require(:quota).permit(:user, :webapp) - end -end diff --git a/rails/app/controllers/users_controller.rb b/rails/app/controllers/users_controller.rb deleted file mode 100644 index 4e1fab8a54b5c2ba5029372caafa9aeb8b0488c2..0000000000000000000000000000000000000000 --- a/rails/app/controllers/users_controller.rb +++ /dev/null @@ -1,17 +0,0 @@ -class UsersController < ApplicationController - - #to display apps of the user - #for the moment : only the one waiting - #view : user/show_apps.html.erb - def show_apps - @webapps_waiting = Webapp.waiting.where(user_id: current_user.id).order(:name) - end - - # generate a new authentication token and return it - def new_token - current_user.set_auth_token - current_user.save! - - render plain: current_user.auth_token - end -end diff --git a/rails/app/controllers/webapp_demos_controller.rb b/rails/app/controllers/webapp_demos_controller.rb deleted file mode 100644 index aa142d83eacbc8f53e67e78ca3107fd88bfb475f..0000000000000000000000000000000000000000 --- a/rails/app/controllers/webapp_demos_controller.rb +++ /dev/null @@ -1,15 +0,0 @@ -class WebappDemosController < ApplicationController - def destroy - @wp = WebappDemo.find(params[:id]) - @webapp = Webapp.find(@wp.webapp_id) - if File.delete("public/app/#{@webapp.docker_name}/demo/#{@wp.file_type}/#{@wp.name}") - @wp.destroy! - flash[:success] = "Demo file deleted" - else - flash[:error] = "Couldn't delete demo file" - end - respond_to do |format| - format.html { redirect_to :back } - end - end -end diff --git a/rails/app/controllers/webapps_controller.rb b/rails/app/controllers/webapps_controller.rb deleted file mode 100644 index 3bef29c671fff5014466c10105b9d6d26ee5c562..0000000000000000000000000000000000000000 --- a/rails/app/controllers/webapps_controller.rb +++ /dev/null @@ -1,400 +0,0 @@ -require "docker_adapter" - -class WebappsController < ApplicationController - # store the current webapp as @webapp - before_action :set_webapp, except: [:index, :new, :create] - - ######################################################################] - # permissions - - # default behaviour: require admin permissions for the webapp - before_action :verify_webapp_admin_permission, except: [:index, :new, :create, :show] - - # exception 1: new app creation - before_action :verify_webapp_create_permission, only: [:new, :create] - - # exception 2: show app - before_action :verify_webapp_use_permission, only: :show - - ######################################################################] - - # GET /webapps - # GET /webapps.json - def index - if params[:tag] - @webapps = Webapp.published.public_apps.tagged_with(params[:tag]).all - elsif current_user - #FIXME should limit to 'published' apps - @webapps = Webapp.by_nb_jobs(current_user.id) - else - @webapps = Webapp.published.public_apps.all - end - end - - # GET /webapps/1 - # GET /app/samusa - def show - if current_user - @webapp_jobs = @webapp.jobs.all - @job = Job.new(webapp_id: @webapp.id, queue_id: @webapp.default_job_queue_id) - @datasets = Dataset.where(user_id: current_user.id) - @q = Quota.init(current_user.id,@webapp.id) - @q_quantity = @q.quantity - end - - respond_to do |format| - format.html - format.json { - render json: @webapp.slice(:id, :name, :sandbox_state) - } - end - end - - # GET /webapps/new - # call when an inria user wants to create an app - def new - @webapp = Webapp.new - @webapp.contact = current_user.email - set_memory_limit_mb Rails.configuration.webapp_default_memory_limit - @dockeros_name = DockerOs.select(:name).group(:name) - @dockeros = DockerOs.all - @default_os = default_os - end - - # POST /webapps - ### How it works - #we generate a dockerfile relative to the os the user choose - #we save the app - #we generate the docker image (workers/create_docker.rb) - # then, we open a new container in daemon mode for the user - # he push his app - # we commit the container in a new image to push to the registry - ### - def create - wp = webapp_params #must have a copy to modify the array - wp = Webapp.validator(wp) - wp[:user_id] = current_user.id - if not current_user.admin? - wp[:memory_limit] = Rails.configuration.webapp_default_memory_limit - end - # unless wp[:source_file].nil? - # manage_source_upload(wp) - # end - #wp.delete(:source_file) - if wp[:docker_os_id].blank? - wp[:docker_os_id] = default_os.id - end - @webapp = Webapp.new(wp) - #2.times { @webapp.webapp_parameters.build } #pre-set parameters - @webapp.webapp_parameters.build #pre-set parameters - @webapp.exec_time = 30 #we set the default time for a job at 30 - - # start the sandbox - @webapp.sandbox_state = "STARTING" - - respond_to do |format| - if @webapp.save - #Create the docker container for this app - Quota.new(user_id: current_user.id,webapp_id: @webapp.id,quantity: wp[:default_quota]*10).save - format.html { redirect_to @webapp } - format.json { render action: 'index', status: :created, location: @webapp } - else - flash[:error] = "We're sorry, an error appear, did you fill all the form?" - format.html { redirect_to new_webapp_path } - format.json { render json: @webapp.errors, status: :unprocessable_entity } - end - end - end - - - # GET /webapps/1/edit - def edit - #TODO - #@webapp = Webapp.find(params[:id]) - @user = User.find(@webapp.user_id) - set_memory_limit_mb @webapp.memory_limit - end - - # PATCH/PUT /webapps/1 - # PATCH/PUT /webapps/1.json - def update - if webapp_params[:from_showapps] && webapp_params[:from_showapps] == "1" #this is an ugly way - update_info(webapp_params) - else - respond_to do |format| - if @webapp.update(webapp_params) - format.html { redirect_to @webapp, notice: 'Webapp was successfully updated.' } - format.json { head :no_content } - else - format.html { render action: 'edit' } - format.json { render json: @webapp.errors, status: :unprocessable_entity } - end - end - end - end - - # POST /webapp/1/commit - def sandbox_commit - # version parameters - ver = webapp_params["webapp_versions_attributes"]["0"] - - # extra parameters - xp = params.permit :version_action, :number_replace - if xp[:version_action] == "replace" - ver[:number] = xp[:number_replace] - end - - begin - @webapp.transaction do - @webapp.create_version( - number: ver["number"], - changelog: ver["changelog"], - state: "SANDBOX", - published: true, - ).save! - @webapp.update!(sandbox_state: "STOPPING") - end - rescue RuntimeError => e - flash[:error] = "Unable to commit a new version (#{e.to_s})" - end - respond_to { |format| - format.html { redirect_to webapp_path } - } - end - - # POST /webapp/1/sandbox_rollback - def sandbox_rollback - @webapp.update!(sandbox_state: "STOPPING") - - respond_to { |format| - format.html { redirect_to webapp_path } - } - end - - # DELETE /webapps/1 - # DELETE /webapps/1.json - def destroy - #system "for i in `docker ps|grep #{@webapp.docker_name}|awk '{print $3}'`;do docker stop $i; done" - #system "for i in `docker images|grep #{@webapp.docker_name}|awk '{print $3}'`;do docker rmi -f $i; done" - #command to delete all images linked to the webapp - sql = "DELETE FROM quotas where webapp_id=#{@webapp.id}" - ActiveRecord::Base.connection.execute(sql) - #Quota.destroy_all(webapp_id: @webapp.id, user_id: *) - @webapp.destroy - respond_to do |format| - format.html { redirect_to show_apps_user } - format.json { head :no_content } - end - - end - - #to add files and parameters to an app - # after app creation, function call from update() - #TODO split each component in his own controller - # PATCH/PUT - def update_info(wparams) - require 'fileutils' - #@webapp = Webapp.find(params[:id]) - wp = wparams - wp.delete(:from_showapps) - #parameters - if wp[:update_parameters] - (0..1).each do |i| #or wp[:webapp_parameters_attributes].each ? - n = i.to_s - #@wpa = WebappParameter - @wpa = WebappParameter.find(wp[:webapp_parameters_attributes][n.to_sym][:id]) - @wpa.update(wp[:webapp_parameters_attributes][n.to_sym]) - end - end - #demos - if wp[:update_demos] #TODO : create folder at webapp creation - system "mkdir -p public/app/#{@webapp.docker_name}/demo/input" - system "mkdir -p public/app/#{@webapp.docker_name}/demo/output" - if wp[:input_demo] - d = WebappDemo.create(file_type: "input", name: wp[:input_demo].original_filename, extension: File.extname(wp[:input_demo].original_filename), webapp_id: @webapp.id) - d.move_file(wp[:input_demo]) - flash[:success] = "demo file added" - end - if wp[:output_demo] - d = WebappDemo.create(file_type: "output", name: wp[:output_demo].original_filename, extension: File.extname(wp[:output_demo].original_filename), webapp_id: @webapp.id) - d.move_file(wp[:output_demo]) - flash[:success] = "demo file added" - end - end - #readme - if wp[:readme] - system "mkdir -p public/app/#{@webapp.docker_name}" - df_readme = File.join("public/app/#{@webapp.docker_name}/", "Readme") - FileUtils.mv(wp[:readme].tempfile, df_readme, force: true) - @webapp.update(readme: true) - end - #render action: 'show' - redirect_to edit_webapp_path(@webapp) - end - -## FUNCTION ABOUT DOCKER & CONTAINER FROM HERE (new controller require?) - - def sandbox_start - if ["IDLE", "START_ERROR"].include? @webapp.sandbox_state - xp = params.permit :sandbox_version_id - if xp[:sandbox_version_id] == nil - @webapp.update! sandbox_state: "STARTING", sandbox_version: nil - else - version = @webapp.webapp_versions.usable.find_by id: xp[:sandbox_version_id].to_i - if version - @webapp.update! sandbox_state: "STARTING", sandbox_version: version - else - flash[:error] = "unable to start (unknown webapp version id #{xp[:sandbox_version_id]})" - end - end - else - flash[:error] = "unable to start (sandbox is in state #{@webapp.sandbox_state.inspect})" - end - redirect_to webapp_path - end - - def sandbox_abort - if ["STARTING", "START_ERROR"].include? @webapp.sandbox_state - @webapp.update! sandbox_state: "STOPPING" - else - flash[:error] = "unable to abort (sandbox is in state #{@webapp.sandbox_state.inspect})" - end - redirect_to webapp_path - end - - def sandbox_retry - case @webapp.sandbox_state - when "START_ERROR" - @webapp.update! sandbox_state: "STARTING" - when "STOP_ERROR" - @webapp.update! sandbox_state: "STOPPING" - else - flash[:error] = "unable to retry (sandbox is in state #{@webapp.sandbox_state.inspect})" - end - redirect_to webapp_path - end - - - def statistics - @webapp = Webapp.find(params[:id]) - data = Webapp.find(params[:id]).jobs.group('year(created_at)').group('month(created_at)').count(:id) - @webapp_jobs = @webapp.jobs.all - i = 0 - @b = [] - require 'date' - data.each do |k,v| - @b[i] = Hash.new - #@b[i] = {"label" => "#{k[0]} #{Date::MONTHNAMES[k[1].to_i]}", "value" => v.to_i} - @b[i] = {"label" => "#{k[1]}/#{k[0]}", "value" => v.to_i} - i = i+1 - end - - #render :plain => @b.to_json - - #@values = @webapp.jobs.all.to_json - ##@referral_source = Client.count(:all, :group => :referral_source) - ##remap = @referral_source.map {|k, v| { Name: k, Count: v} } - ##=> {{:Name=>"Internet search (e.g., Google)?", :Count=>26}, ... ] - ##@values = {1 => 2,2 => 4,3 => 6,4 => 8} - #create value array - end - - private - - - # return the DefaultOs - def default_os - # return latest DebianOs - - # NOTE: we prepend with "0." for the sort because Gem::Version does not - # accept version numbers starting with a letter - DockerOs.where(docker_name: "debian").sort_by{|x| - Gem::Version.new "0.#{x.version}"}.last - end - - # parse the webapp id from the request url store it in @webapp - # - # return 404 if the app is not found - def set_webapp - @webapp = if params[:docker_name] - Webapp.find_by(docker_name: params[:docker_name]) - elsif params[:id] - Webapp.find_by(id: params[:id]) - else - nil - end - - if not @webapp - not_found - end - end - - def set_memory_limit_mb(lim) - @memory_limit_mb = lim && (lim/1.megabyte) - end - - # 'admin' access is granted to the app owner and to the admin users - # - def verify_webapp_admin_permission - authenticate_user! - - if not @webapp.administrable_by? current_user - render "/errors/403", status: 403 - end - end - - # 'create' access is granted to our local users only - # - def verify_webapp_create_permission - authenticate_user! - - # TODO store the allowed domains in Rails.configuration - if not User.valid_email current_user.email - render "/errors/403", status: 403 - end - end - - # 'use' access is granted provided if any condition is met: - # - the app is public - # - the provided access_token is valid - # - the user is allowed to adminstrate the app - def verify_webapp_use_permission - if @webapp.private - token = params[:access_token] - if token and token == @webapp.access_token - return - end - - verify_webapp_admin_permission - end - end - - - def manage_source_upload(wp) - require 'fileutils' - file = wp[:source_file] - ext = File.extname(file.original_filename) - destination = "/tmp/#{wp[:docker_name]}/upload/" - FileUtils.mkpath(destination) - FileUtils.mv(file.tempfile, destination+"upload_#{wp[:docker_name]}"+ext.to_s, force: true) - end - - # Never trust parameters from the scary internet, only allow the white list through. - # split in different method for each action (create, update, delete) - def webapp_params - # FIXME: do not permit to update user_id - wp = params.require(:webapp).permit(:id, :name, :description, :contact, :entrypoint, :logo, :tag_list, :user_id, :default_quota, :source_file, :private, - :sandbox_state, :docker_os_id, :from_showapps, :readme, :input_demo, :output_demo, :update_demos, :update_parameters, :version, :default_job_queue_id, - webapp_parameters_attributes: [:id, :name, :value, :detail], - #webapp_demos_attributes: [:id, :name, :extension, :file_type], - webapp_versions_attributes: [:id, :number, :changelog] ) - - # setting memory_limit permitted to admins only - if params.has_key? :memory_limit_mb and current_user and current_user.admin? - lim = params[:memory_limit_mb] - wp[:memory_limit] = lim.empty? ? nil : lim.to_i.megabytes - end - return wp - end - -end diff --git a/rails/app/helpers/application_helper.rb b/rails/app/helpers/application_helper.rb deleted file mode 100644 index bf2e878197a4403951764b9043896817ed39bf2e..0000000000000000000000000000000000000000 --- a/rails/app/helpers/application_helper.rb +++ /dev/null @@ -1,49 +0,0 @@ -module ApplicationHelper - - def avatar_url(email) - "/images/guest.png" - end - - def allgo_display(root_path,file,folder) - #path = "app/#{app_name}/demo/#{self.file_type}/#{self.name}" - path = root_path+'/'+file - extension = File.extname(file) - img = ['.png','.jpg','.gif','.bmp'] - txt = ['.txt','.log','.out','.res','.json','.xml'] - audio = ['.mp3', '.flac', '.wav'] - video = ['.ogg', '.mp4', '.webm'] - # ext = [img,txt,audio,video] - # r = '' - # ext.each do |e| - # if e.include?(self.extension) - # r = - # end - # end - r = '' - if img.include?(extension) - r += ActionController::Base.helpers.image_tag("#{path}", height: "200") - render :plain => r.html_safe - elsif txt.include?(extension) - #r+= render :file => "#{folder}/#{file}".force_encoding("UTF-8").scrub.html_safe - r += File.read("#{folder}/#{file}") - #r+= render :file => "#{folder}/#{file}".scrub.html_safe - #r+= content.force_encoding("UTF-8") - #render :plain => "<pre class='pre-scrollable'>#{r.scrub!}</pre>".html_safe - render :plain => r.scrub! - elsif audio.include?(extension) - r += ActionController::Base.helpers.audio_tag("#{path}", controls: true) - render :plain => r.html_safe - elsif video.include?(extension) - r += ActionController::Base.helpers.video_tag("#{path}", controls: true) - render :plain => r.html_safe - end - #render :plain => r.html_safe - end - - def markdown(text) - require 'redcarpet' - markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML) - return markdown.render(text).html_safe - end - -end diff --git a/rails/app/helpers/datasets_helper.rb b/rails/app/helpers/datasets_helper.rb deleted file mode 100644 index 7e35bc32a3b83fe274eda0205a95697001acbcd6..0000000000000000000000000000000000000000 --- a/rails/app/helpers/datasets_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module DatasetsHelper -end diff --git a/rails/app/helpers/documentation_helper.rb b/rails/app/helpers/documentation_helper.rb deleted file mode 100644 index 1ef08cf7176a78c527c8b5f25c8c9709b28dfba0..0000000000000000000000000000000000000000 --- a/rails/app/helpers/documentation_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# -*- encoding : utf-8 -*- -module DocumentationHelper -end diff --git a/rails/app/helpers/file_helper.rb b/rails/app/helpers/file_helper.rb deleted file mode 100644 index 7dcfa7ea5bb87e3815282e294832c9d55999ffc1..0000000000000000000000000000000000000000 --- a/rails/app/helpers/file_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -module FileHelper - -end diff --git a/rails/app/helpers/form_helper.rb b/rails/app/helpers/form_helper.rb deleted file mode 100644 index a0fa2c262fa2f09175ff52c5418efacfec8dc0eb..0000000000000000000000000000000000000000 --- a/rails/app/helpers/form_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -#trying to normalize our form -module FormHelper -end diff --git a/rails/app/helpers/job_upload_helper.rb b/rails/app/helpers/job_upload_helper.rb deleted file mode 100644 index 2ecfc75a3d34eb06e6de103b1e90b9f9e1db8fa6..0000000000000000000000000000000000000000 --- a/rails/app/helpers/job_upload_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module JobUploadHelper -end diff --git a/rails/app/helpers/jobs_helper.rb b/rails/app/helpers/jobs_helper.rb deleted file mode 100644 index bfb62331cccdce1f9c905bb62965e0e069c1bd85..0000000000000000000000000000000000000000 --- a/rails/app/helpers/jobs_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# -*- encoding : utf-8 -*- -module JobsHelper -end diff --git a/rails/app/helpers/quota_helper.rb b/rails/app/helpers/quota_helper.rb deleted file mode 100644 index 95d4d35351e119677f07ab1f43bc6a127c51b56e..0000000000000000000000000000000000000000 --- a/rails/app/helpers/quota_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# -*- encoding : utf-8 -*- -module QuotaHelper -end diff --git a/rails/app/helpers/webapps_helper.rb b/rails/app/helpers/webapps_helper.rb deleted file mode 100644 index b6e81fae8b20dd28f5af3732c93e31a3fdb7815d..0000000000000000000000000000000000000000 --- a/rails/app/helpers/webapps_helper.rb +++ /dev/null @@ -1,4 +0,0 @@ -# -*- encoding : utf-8 -*- -module WebappsHelper - -end diff --git a/rails/app/mailers/.keep b/rails/app/mailers/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/app/mailers/application_mailer.rb b/rails/app/mailers/application_mailer.rb deleted file mode 100644 index 4e9b3c41dc07bd85e7aaafb6fbdce634a603c22a..0000000000000000000000000000000000000000 --- a/rails/app/mailers/application_mailer.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ApplicationMailer < ActionMailer::Base - #FIXME: use configurable address - default from: 'noreply@allgo.inria.fr' - layout 'mailer' -end diff --git a/rails/app/models/.keep b/rails/app/models/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/app/models/application_record.rb b/rails/app/models/application_record.rb deleted file mode 100644 index 10a4cba84df37181f4cf310fd85d8f0aaa5d90ba..0000000000000000000000000000000000000000 --- a/rails/app/models/application_record.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ApplicationRecord < ActiveRecord::Base - self.abstract_class = true -end diff --git a/rails/app/models/dataset.rb b/rails/app/models/dataset.rb deleted file mode 100644 index 6791ff299f73dbc62dea078d8eb7e001ddf69522..0000000000000000000000000000000000000000 --- a/rails/app/models/dataset.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Dataset < ActiveRecord::Base - - belongs_to :user - accepts_nested_attributes_for :user - - @@max_limit = 200 - - def get_path - return "#{Rails.configuration.datastore}/#{self.user_id}/datasets/" - end - - def get_file - return self.get_path+"#{self.file_name}" - end - - def move_file(params) - file = params[:file] - if File.size(file.tempfile) < 200*1024*1024 #200Mo - FileUtils.mkpath(self.get_path) - if FileUtils.mv(file.tempfile, self.get_file, force: true) - File.chmod(0644, self.get_file) - self.size = File.size(self.get_file) - else - errors.add(:file, "can't move the file") - return true - end - else - errors.add(:file, "damn too big") - return false - end - end - - def ln_to(path) - - end - -end diff --git a/rails/app/models/docker_os.rb b/rails/app/models/docker_os.rb deleted file mode 100644 index 11bb6ac2d69106f4d18ba2ce2f4359fc736373fe..0000000000000000000000000000000000000000 --- a/rails/app/models/docker_os.rb +++ /dev/null @@ -1,15 +0,0 @@ -# -*- encoding : utf-8 -*- -class DockerOs < ActiveRecord::Base - belongs_to :webapp - accepts_nested_attributes_for :webapp - - validates :name, presence: true - validates :version, presence: true - - # return the name of the docker image - def image - "#{docker_name}:#{version}" - end - - -end diff --git a/rails/app/models/job.rb b/rails/app/models/job.rb deleted file mode 100644 index a36a33d58cb42e9c4a67a677208119cc7e87580c..0000000000000000000000000000000000000000 --- a/rails/app/models/job.rb +++ /dev/null @@ -1,270 +0,0 @@ -require "docker_adapter" - -class Job < ActiveRecord::Base - belongs_to :user - accepts_nested_attributes_for :user - - belongs_to :webapp - accepts_nested_attributes_for :webapp - - has_many :job_uploads - accepts_nested_attributes_for :job_uploads - #inverse_of - - belongs_to :queue, class_name: JobQueue - - require 'fileutils' - before_create :generate_access_token - after_create :make_directory - - attr_accessor :file_url - - enum state: { - # the job is being created (not yet submitted) - NEW: 0, - - # the job is submitted - WAITING: 1, - - # the job is running - RUNNING: 2, - - # the job is being aborted - ABORTING: 6, - - # the job is terminated - DONE: 3, - - # the job has expired (after 1 month), its data is no longer available - ARCHIVED: 4, - - # the job was destroyed before being run or completed - # (this is a temporary state until the files are purged) - DELETED: 5, - } - - enum result: { - # no result yet - NONE: 0, - - # job finished successfully (exit 0) - SUCCESS: 1, - - # job finished with an error (non zero exit) - ERROR: 2, - - # job was aborted by the user - ABORTED: 3, - - # job timed out - TIMEOUT: 4, - } - - scope :not_archived, -> { where.not(state: "ARCHIVED") } - - after_commit :notify_controller - - scope :active, -> { where.not(state: ["DONE", "ARCHIVED"]) } - scope :running, -> { where(state: "RUNNING") } - scope :done, -> { where(state: "DONE") } - - - # job parameters must not contain any special character interpreted by bash - # (because the webapp providers are very bad at preventing shell injections) - # NOTE: / is forbidden too to prevent accessing files outside the current directory - # FIXME: should disallow .. too - validates :param, format: { - without: /[<>()\[\];`$!|~&\/]/, - message: 'contains a forbidden symbol: <>()[];`$!|~&/' - }, allow_blank: true - - # job parameters may be quoted with '', "" or \ (shell quotes) - # -> ensure all quotes are terminated or the job will fail - validates :param, format: { - with: /\A([^'"\\]|\\.|'([^'\\]|\\.)*'|"([^"\\]|\\.)*")*\Z/, - message: 'unterminated quote' - }, allow_blank: true - - def notify_controller - if self.state == "WAITING" or self.state == "ABORTING" - DockerAdapter.notify - end - end - - #absolute path to the job folder - def path - return "#{Rails.configuration.datastore}/#{self.folder}" - end - - #relative path - def folder - #return "#{self.user_id}/#{self.webapp_id}/#{self.id}" - return "#{self.user_id}/#{self.webapp_id}/#{self.access_token}" - end - - # status of the job - # return either .state or .result (which one is more useful) - def status - (((DONE? or ARCHIVED?) and not SUCCESS?) ? result : state).downcase - end - - def make_directory - FileUtils.mkpath(self.path) - end - - def self.create_in_ajax(webapp_id,user_id) - job = self.new(webapp_id: webapp_id, user_id: user_id, - queue_id: Webapp.find(webapp_id).default_job_queue_id) - job.make_directory - job.datasize = 0 - job.state = "NEW" - job.save - return job - end - - def self.create_w_user(params,user_id) - job = self.new(params) - job.user_id = user_id - job.make_directory - job.datasize = 0 - job.state = "NEW" - job.version = params[:version].nil? ? Webapp.find(params[:webapp_id]).webapp_versions.usable.order("number DESC").first.number : params[:version] - job.save - return job - end - - def move_file(file) - #self.make_directory - df = File.join(self.path, file.original_filename.delete(' ')) - self.datafile = df #if we upload 3 files, it changes 3 times, bad - #j.job_uploads.job_file = - FileUtils.mv(file.tempfile, df, force: true) - File.chmod(0644, df) - self.datasize = File.size(df).to_i - self.save! - end - - def use_dataset(dataset_id) - #self.make_directory - dataset = Dataset.where(dataset_id).first - if !dataset.nil? - FileUtils.ln_s(dataset.get_file, self.path+"/"+dataset.file_name) - self.datafile = "dataset : #{dataset.file_name}" - else - return false - end - end - - def save_and_run - #si modération/installation : pas de quota et lancer job pour commit avant - quota = Quota.init(self.user_id,self.webapp_id) - if (self.job_uploads.length >= 0 or self.param != "") and quota.make_decrease(self.datasize) - self.update! state: "WAITING" - return true - else - return false - end - end - - # abort a running job - def abort - case state - when "RUNNING" - # *atomically* set the job state to ABORTING - Job.where(id:910, state:"RUNNING").update_all(state: "ABORTING") - self.update! state: "ABORTING" - return - when "NEW" - when "WAITING" - else - # nop - return - end - - raise "job is not yet started" - end - - # remove a job - # - # For the moment, statistics are derived from the DB. So we never destroy a - # job directly but call this method instead - # - # Purging a job means: - # - delete all the job files - # - if the job was DONE: - # - mark it as ARCHIVED - # -> the job is no longer visible to the user, but is included in the stats - # else - # - destroy the db entry - # -> thee job no longer exists - def purge - case state - when "ARCHIVED" - #nop - return - when "DONE" - when "DELETED" - when "NEW" - else - # TODO: implement cancellation - raise "NOT SUPPORTED" - end - - begin - # ensure the path is really inside the datastore (avoid destroying something else) - realpath = File.realpath (self.path) - if realpath !~ /\A#{Regexp.quote Rails.configuration.datastore}\/[0-9a-f\/]*\z/ - raise "invalid path" - end - - # delete the path - FileUtils.rm_rf(realpath) - rescue Errno::ENOENT - end - - if self.state == "DONE" - self.state = "ARCHIVED" - self.save! validate: false - else - self.destroy! - end - end - - def set_generated_data - #how do we know which files are input files ? - end - - def download_file(file_url) - require 'uri' - require 'net/http' - uri = URI.parse(file_url) - if (uri.kind_of?(URI::HTTP) or uri.kind_of?(URI::HTTPS)) and ['.gz','.zip','.tar.gz','.fa.gz','.txt','.log','.json','.jpeg','.jpg','.png','.mp3','.wav','.ogg','.xml','.webm','.mp4','.gif'].include?File.extname(uri.path) - res = Net::HTTP.get_response(uri) - if !res['content-length'].nil? and res['content-length'].to_i < 1024*1024*1024 #1GB - # if uri.host == 'allgo.inria.fr' or uri.host =="192.168.50.2" - # #if uri.path match datastore/current_user.id - # #system("ln -s /mnt#{uri.path} #{self.path}") - # #docker doesn't like getting a symbolic link - # system("cp /mnt#{uri.path} #{self.path}") - # else - # system("wget -P #{self.path} #{file_url}") - # end - # end - # self.datafile = file_url - # self.datasize += res['content-length'].to_i - # self.save! - self.job_uploads.new.job_file = URI.parse(file_url) - self.datasize += self.job_uploads.last.job_file_file_size - self.save! - end - return true - else - return false - end - end - - # SHA1 from random salt and time - def generate_access_token - self.access_token = SecureRandom.hex(20) - end -end diff --git a/rails/app/models/job_queue.rb b/rails/app/models/job_queue.rb deleted file mode 100644 index 0e3b46561c9c2a2aa7485ecf8a9dfc86e019d05e..0000000000000000000000000000000000000000 --- a/rails/app/models/job_queue.rb +++ /dev/null @@ -1,26 +0,0 @@ -class JobQueue < ApplicationRecord - validates :name, uniqueness: true, format: {with: /\A[A-Za-z0-9_]+\z/} - validates_uniqueness_of :is_default, conditions: -> { where is_default: true } - validates_numericality_of :timeout, greater_than: 0, allow_nil: true - - default_scope { order(:timeout) } - - def self.default - where(is_default: true).first - end - - def human_timeout - if timeout - d = (timeout / 1.day).days - h = (timeout % 1.day / 1.hour).hours - m = (timeout % 1.hour / 1.minute).minutes - s = (timeout % 1.minute).seconds - - [d,h,m,s].select {|x| x!=0}.map{|x| x.inspect}.join(", ") - end - end - - def name_with_timeout - "#{name} (#{timeout ? "<#{human_timeout}" : "no limit"})" - end -end diff --git a/rails/app/models/job_upload.rb b/rails/app/models/job_upload.rb deleted file mode 100644 index 23e127297aac95f80f7ee454161d2c81adc8fb26..0000000000000000000000000000000000000000 --- a/rails/app/models/job_upload.rb +++ /dev/null @@ -1,25 +0,0 @@ -class JobUpload < ActiveRecord::Base - belongs_to :job - accepts_nested_attributes_for :job - - has_attached_file :job_file, - url: '/datastore/:user_id/:webapp_id/:access_token/:filename', - #path: ':rails_root/public/:url' - path: "#{Rails.configuration.datastore}/:user_id/:webapp_id/:access_token/:filename" - #do_not_validate_attachment_file_type :job_file - validates_attachment_content_type :job_file, content_type: /.*/ - - private - - # interpolate in paperclip - Paperclip.interpolates :access_token do |attachment, style| - attachment.instance.job.access_token - end - Paperclip.interpolates :webapp_id do |attachment, style| - attachment.instance.job.webapp_id - end - Paperclip.interpolates :user_id do |attachment, style| - attachment.instance.job.user_id - end - -end diff --git a/rails/app/models/quota.rb b/rails/app/models/quota.rb deleted file mode 100644 index 2a5210a068cac947a99e09fdd1ed5f20da87e07b..0000000000000000000000000000000000000000 --- a/rails/app/models/quota.rb +++ /dev/null @@ -1,36 +0,0 @@ -class Quota < ActiveRecord::Base - belongs_to :user - accepts_nested_attributes_for :user - belongs_to :webapp - accepts_nested_attributes_for :webapp - - self.table_name = :quotas - #self.primary_key = [:user_id, :webapp_id] - - def make_decrease(quantity_to_decrease) - if self.user_id != self.webapp.user_id or !self.user.admin or self.webapp.webapp_versions.empty? - new_q = (self.quantity - quantity_to_decrease) #is the quota gonna be positive? - if new_q > 0 - self.update!(quantity: new_q) - return true - else - return false - end - else - return true - end - end - - def self.init(user_id,webapp_id) - quota = Quota.find_by(user_id: user_id,webapp_id: webapp_id) - #quota = Quota.where(user_id: user_id,webapp_id: webapp_id).first_or_create # => will create with the the parameters if don't exist - if quota.blank? #we create the quota for the user & the webapp - #default_quantity = Webapp.where(id: webapp_id).select("default_quota").first - default_quantity = 20*1024*1024*1024 - quota = Quota.create({user_id: user_id, webapp_id: webapp_id, quantity: default_quantity}) - quota.save - end - return quota - end - -end diff --git a/rails/app/models/user.rb b/rails/app/models/user.rb deleted file mode 100644 index 187396cf733e266d3751c5437f12db5118049994..0000000000000000000000000000000000000000 --- a/rails/app/models/user.rb +++ /dev/null @@ -1,57 +0,0 @@ -# -*- encoding : utf-8 -*- -class User < ActiveRecord::Base - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, :registerable, :confirmable, - :recoverable, :rememberable, :trackable, :validatable - - - # FIXME: destroy may fail if there are jobs running - has_many :jobs, dependent: :destroy - - # FIXME: this is a bad idea to have the 'webapps' based on the jobs - # launched by the user (thought it could be useful, but with another - # name, eg: used_apps) the 'webapps' should resolve to the applications - # *owned* by the user. - has_many :webapps, :through => :jobs - - has_many :quotas - has_many :webapps, :through => :quotas - - has_many :datasets - - before_create :set_auth_token - - # multiline regex for validating sshkeys in the authorized_keys format - # - # Allows: - # - blank line - # - comment line (starting with '#') - # - ssh key line (options not allowed) - validates :sshkey, format: { - with: /\A(\s*(|#.*|ssh-[a-z0-9]+\s+[\w\/+=]+(\s.*)?)(\r?\n|\z))*\z/, - } - - ## Look in the config and test the authorized domain - ## we use it to check that an user is @inria or @irisa to create an app - # FIXME: the method name should be much more explicit - def self.valid_email(u_email) - domain = u_email.split("@").last - Rails.application.config.restrict_email.include? domain - end - - def set_auth_token - #return if auth_token.present? - self.auth_token = generate_auth_token - end - - def generate_auth_token - SecureRandom.hex(16) - end - - #make scope - def user_apps - return Webapp.where(user_id: self.id) - end - -end diff --git a/rails/app/models/webapp.rb b/rails/app/models/webapp.rb deleted file mode 100644 index b756196174be9542f697e58e19423a991b6e3d40..0000000000000000000000000000000000000000 --- a/rails/app/models/webapp.rb +++ /dev/null @@ -1,168 +0,0 @@ -require 'docker_adapter' - -class Webapp < ActiveRecord::Base - - belongs_to :user - #accepts_nested_attributes_for :user - - enum sandbox_state: { - IDLE: 0, - RUNNING: 1, - STARTING: 2, - START_ERROR: 3, - STOPPING: 4, - STOP_ERROR: 5, - } - - # FIXME setting :delete_all here is not right because we do - # not want the jobs to be deleted, especially if they - # belong to another user (plus :delete_all will not - # purge the job files from the datastore nor kill and - # remove the container if running) - has_many :jobs, dependent: :delete_all - has_many :users, :through => :jobs - - #ajout pour gestion de la relation N-N - has_many :quotas, dependent: :delete_all - has_many :users, :through => :quotas - - has_one :docker_os - accepts_nested_attributes_for :docker_os - - has_many :webapp_parameters, dependent: :delete_all - accepts_nested_attributes_for :webapp_parameters - - has_many :webapp_demos, dependent: :delete_all - accepts_nested_attributes_for :webapp_demos - - has_many :webapp_versions, dependent: :delete_all, inverse_of: :webapp - accepts_nested_attributes_for :webapp_versions - - # id of the webapp version to be run in the sandbox - # (nil for using the original docker_os) - belongs_to :sandbox_version, class_name: "WebappVersion" - - # default queue for the jobs created for this webapp - belongs_to :default_job_queue, class_name: JobQueue - - #paperclip module, for logo - - has_attached_file :logo, - styles: { medium: "300x300>", thumb: "100x100>" }, - url: "/system/logos/:id/:style/:filename", - default_url: "/images/:style/default.png", - path: ":rails_root/public:url" - validates_attachment_content_type :logo, content_type: /\Aimage\/.*\Z/ - - - validates :name, presence: true, uniqueness: {message: "name already exist"} - validates :docker_os_id, presence: true - - validates :entrypoint, format: { with: /\A\/[\/\w+._-]*[\w+._-]\z/ } - - acts_as_taggable #for gem providing the tag - - # FIXME: the terminology is misleading, here 'published' means that there is - # at least one available version in "ready" state. - # Does not mean: made public - scope :published, -> { joins(:webapp_versions).where("webapp_versions.state" => "READY").group("webapps.id") } - scope :creating, -> { where.not(id: Webapp.published.select("id").to_a).select("id") } - scope :public_apps, -> { where(private: [0,nil]) } - - # waiting means either: - # - webapps with an active sandbox - # - webapps with no committed version - scope :waiting, -> { left_joins(:webapp_versions).group(:id).where( - "sandbox_state != ? OR webapp_versions.id IS NULL", sandbox_states[:IDLE]) } - - #TODO scope :complete if webapp has demo & readme - - - #we will rank webapps on index pages by most use, so personnalize, much custom - #this awesome sql request was conceive with the help of Aurélien Martinez - scope :by_nb_jobs, -> (user_id) { - find_by_sql ["select w.* from webapps as w left join (select webapp_id, user_id, count(id) as count_jobs from jobs - group by webapp_id,user_id) as j on w.id = j.webapp_id and j.user_id = ? where - (w.private is false or w.private is null) - order by j.count_jobs DESC,created_at DESC;", user_id] - } - #or (w.private is true and w.user_id=#{user_id})) - - #enum status: [ :waiting, :deploy ] Introduit dans Rails dans la v4.1 ! - # donc pour le moment, 0 => waiting, 1 => moderate, 2 => deploy - - after_commit :notify_controller - - def administrable_by?(user) - if user - user.admin? or user.id == user_id - else - false - end - end - - def notify_controller - if destroyed? || (["STARTING", "STOPPING"].include? self.sandbox_state) - DockerAdapter.notify - end - end - - # return the name of the docker image used for the current sandbox - def sandbox_image - if sandbox_state != "IDLE" - if sandbox_version.nil? - return DockerOs.find(docker_os_id).image - else - return sandbox_version.number - end - end - end - - - #TODO rewrite it - def self.validator(records) #TODO voir doc Active Model Validator - records[:docker_name] = records[:name].gsub(/\W|/, '').downcase - if(records[:default_quota].to_i > 1000) - records[:default_quota] = 1000 - end - #records[:default_quota] = (records[:default_quota].to_i*1048576).to_i #1024*1024 - records[:default_quota] = (100*2*1048576).to_i #1024*1024 - records[:sandbox_state] = "IDLE" - #if no OS choosen, debian 7 - # if records[:docker_os_id].nil? - # zid = DockerOs.select(:id).find_by(name: 'debian', version: [7,7.0]).id - # records[:docker_os_id] = zid #works only that wayy?! - # end - #no custom entrypoint => /home/allgo/docker_name - records[:entrypoint] = records[:entrypoint].blank? ? "/home/allgo/#{records[:docker_name]}.sh" : records[:entrypoint] - records[:entrypoint] = records[:entrypoint].delete(';`') - if records[:private] - records[:access_token] = SecureRandom.urlsafe_base64 - end - return records - end - - # return the ssh command to connect to the sandbox - def ssh_connect_string - host, port = Rails.configuration.sandbox - return (port == 22) ? "ssh #{self.docker_name}@#{host}" - : "ssh -p #{port} #{self.docker_name}@#{host}" - end - - def generate_access_token - self.access_token = SecureRandom.urlsafe_base64 - self.save - end - - def create_version(**args) - # FIXME: atomicity is not guaranteed - pending = WebappVersion.where(webapp_id: self.id, state: ["SANDBOX", "COMMITTED"]).first - if pending - # TODO: report the error to the user - raise "There is already a version being created: #{pending.number.inspect}" - end - - return self.webapp_versions.build(**args) - end - -end diff --git a/rails/app/models/webapp_demo.rb b/rails/app/models/webapp_demo.rb deleted file mode 100644 index c194b22a9b3ea222205e5bd72ddfd54812fa7c0c..0000000000000000000000000000000000000000 --- a/rails/app/models/webapp_demo.rb +++ /dev/null @@ -1,14 +0,0 @@ -class WebappDemo < ActiveRecord::Base - - belongs_to :webapp - accepts_nested_attributes_for :webapp - - - def move_file(params) - #self.save - df = "public/app/#{self.webapp.docker_name}/demo/#{self.file_type}/#{self.name}" - FileUtils.mv(params.tempfile, df, force: true) - File.chmod(0644, df) - end - -end diff --git a/rails/app/models/webapp_parameter.rb b/rails/app/models/webapp_parameter.rb deleted file mode 100644 index 675878c01a0a51b55a05608e2485a95eceeb8883..0000000000000000000000000000000000000000 --- a/rails/app/models/webapp_parameter.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding : utf-8 -*- -class WebappParameter < ActiveRecord::Base - - belongs_to :webapp - accepts_nested_attributes_for :webapp - -end diff --git a/rails/app/models/webapp_version.rb b/rails/app/models/webapp_version.rb deleted file mode 100644 index af0245a0db58c4d26f83da101de70d689ce022b7..0000000000000000000000000000000000000000 --- a/rails/app/models/webapp_version.rb +++ /dev/null @@ -1,104 +0,0 @@ -require 'docker_adapter' - -#FIXME nomally this should be an absolute path, however the production crashes -# if fed with an absolute link -> should find why -require_dependency './app/validators/webapp_version.rb' - -# sort by version number (descending) -def sort_webapp_versions(collection) - # NOTE: we prepend with "0." for the sort because Gem::Version does not - # accept version numbers starting with a letter - return collection.sort_by{|v| Gem::Version.new "0.#{v.number}"}.reverse -end - -class WebappVersion < ActiveRecord::Base - - belongs_to :webapp, inverse_of: :webapp_versions - accepts_nested_attributes_for :webapp - - enum state: { - # docker image is not yet committed - # - the version is the current content of the webapp sandbox - # - a Webapp may have at most one WebappVersion in state SANDBOX - SANDBOX: 0, - - # docker image is committed but not yet pushed to the registry - COMMITTED: 1, - - # docker image is on the registry - READY: 2, - - # an error occured - # - there were multiple WebappVersions with state==SANDBOX - ERROR: 3, - - # version is successfully replaced - # - this is a transient state before this version entry is destroyed - # (to avoid race condition with the processing of jobs that were using - # it) - # - the rails app must ignore all versions with state==REPLACED - REPLACED: 4, - - # UI consideration: the WebappVersion is listed (in the job creation form) - # only if either: - # - the user is the owner of the job - # - the WebappVersion state is :ready and published is true - # - # When updating an existing WebappVersion, a second entry is created in the - # table. It replaces the old one once it reaches the READY state - # - - # process to commit over an existing version - # - # 0. (possible race condition on docker push) ensure that there is no - # existing version in state SANDBOX or COMMITTED for the same number - # (TODO: should add revision numbers) - # 1. a tmp WebappVersion entry is created with state==SANDBOX - # 2. the image is committed and pushed to the registry and the swarm - # 3. the existing entry is updated with the data from the tmp entry - # 4. jobs referring to the tmp entry are updated to use the existing entry - # 5. the tmp entry is put in state REPLACED - # - # - # Allowed state changes: - # - by the rails server - # (none) -> SANDBOX - # - by the docker controller - # SANDBOX -> COMMITTED,ERROR - # COMMITTED -> READY - # - # - # TODO: implement version deletion - # - # FIXME: should update the job submission API should be modified to avoid - # race condition (when the owner wants to create a job using the tmp - # version) - # - } - - # number must be a valid docker tag - # -> TagRegexp in https://github.com/docker/distribution/blob/master/reference/regexp.go - validates :number, format: { - with: /\A[\w][\w.-]{0,127}\z/ - }, exclusion: { - in: %w(sandbox latest) # reserved names - }, new_webapp_version_number: true - - #default order will be by the most recent - default_scope {order("updated_at DESC")} - - # usable == versions that can be used when creating a job - scope :usable, -> {where state: ["READY", "COMMITTED"]} - - scope :ready, -> {where state: "READY"} - - scope :pending,-> {where state: ["SANDBOX", "COMMITTED"]} - - after_commit :notify_controller - - def notify_controller - if self.state == "SANDBOX" - DockerAdapter.notify - end - end -end diff --git a/rails/app/validators/webapp_version.rb b/rails/app/validators/webapp_version.rb deleted file mode 100644 index 2bc2c118c20d4a4f7c47ef63f53c3cef270efa51..0000000000000000000000000000000000000000 --- a/rails/app/validators/webapp_version.rb +++ /dev/null @@ -1,7 +0,0 @@ - -# empty validator to ensure the user does not accidentally overwrite a version -# when creating a new one (actual check made on client side) -class NewWebappVersionNumberValidator < ActiveModel::EachValidator - def validate_each(record, attr_name, value) - end -end diff --git a/rails/app/views/admin/dashboard/index.html.erb b/rails/app/views/admin/dashboard/index.html.erb deleted file mode 100644 index 9376b13dff690bfa84d8498c85df84b73054b5ab..0000000000000000000000000000000000000000 --- a/rails/app/views/admin/dashboard/index.html.erb +++ /dev/null @@ -1,120 +0,0 @@ -<div class="container"> -<%# TODO: refresh the dashboard periodically (or use a channel !) %> -<h2>Active sandboxes</h2> -<table class="table table-hover table-condensed"> - <thead> - <tr> - <th>Name</th> - <th>Image</th> - <th>State</th> - <th>Last update</th> - </tr> - </thead> - <tbody> - <% @active_sandboxes.each do |webapp| %> - <tr> - <td><%= link_to webapp.name, webapp %></td> - <td><%= webapp.sandbox_image %> - <td><%= webapp.sandbox_state %> - <td><%= webapp.updated_at %> - </tr> - <% end %> - </tbody> -</table> - -<h2>Pending versions</h2> -<table class="table table-hover table-condensed"> - <thead> - <tr> - <th>Name</th> - <th>Version</th> - <th>State</th> - <th>Last update</th> - </tr> - </thead> - <tbody> - <% @pending_versions.each do |ver| %> - <tr> - <td><%= link_to ver.webapp.name, ver.webapp %></td> - <td><%= ver.number %> - <td><%= ver.state %> - <td><%= ver.updated_at %> - </tr> - <% end %> - </tbody> -</table> - -<h2>Active jobs</h2> -<table class="table table-hover table-condensed"> - <thead> - <tr> - <th>User</th> - <th>Id</th> - <th>App</th> - <th>Files</th> - <th>Status</th> - <th>Date</th> - <th>Parameters</th> - <th>Actions</th> - </tr> - </thead> - - <tbody> - <% @active_jobs.each do |job| %> - <tr> - <td><%= job.user.email %></td> - <td><%= link_to job.id, job, data: {main: 1} %></td> - <td><%= link_to job.webapp.name, job.webapp %></td> - <td><%= File.basename(job.job_uploads.first.job_file_file_name).truncate(30) if !job.job_uploads.first.nil? %></td> - <td><%= job.status %></td> - <td><%= job.updated_at.strftime("%e/%m/%Y, %H:%M") %></td> <!-- TODO changer en fonction de la localisation --> - <td> - <% if job.param %> - <%= job.param.truncate(30) %> - <% end %> - </td> - <td><%= button_to 'Destroy', job, remote: true, method: :delete, data: { - confirm: "This will permanently destroy job #{job.id}\n\nAre you sure?" - }, disabled: (job.state == "RUNNING" or job.state == "WAITING"), class: 'btn btn-danger' %></td> - </tr> - <% end %> - </tbody> -</table> - -<h2>Previous jobs</h2> -<table class="table table-hover table-condensed"> - <thead> - <tr> - <th>User</th> - <th>Id</th> - <th>App</th> - <th>Files</th> - <th>Status</th> - <th>Date</th> - <th>Parameters</th> - <th>Actions</th> - </tr> - </thead> - - <tbody> - <% @previous_jobs.each do |job| %> - <tr> - <td><%= job.user.email %></td> - <td><%= link_to job.id, job, data: {main: 1} %></td> - <td><%= link_to job.webapp.name, job.webapp %></td> - <td><%= File.basename(job.job_uploads.first.job_file_file_name).truncate(30) if !job.job_uploads.first.nil? %></td> - <td><%= job.status %></td> - <td><%= job.updated_at.strftime("%e/%m/%Y, %H:%M") %></td> <!-- TODO changer en fonction de la localisation --> - <td> - <% if job.param %> - <%= job.param.truncate(30) %> - <% end %> - </td> - <td><%= button_to 'Destroy', job, remote: true, method: :delete, data: { - confirm: "This will permanently destroy job #{job.id}\n\nAre you sure?" - }, disabled: (job.state == "RUNNING" or job.state == "WAITING"), class: 'btn btn-danger' %></td> - </tr> - <% end %> - </tbody> -</table> - diff --git a/rails/app/views/admin/logs/error_log.html.erb b/rails/app/views/admin/logs/error_log.html.erb deleted file mode 100644 index b3e8026ff13b3024fc0857a3cd4046e902907318..0000000000000000000000000000000000000000 --- a/rails/app/views/admin/logs/error_log.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<pre> - <%= File.read(Rails.root.join("log/development.log")) %> -</pre> diff --git a/rails/app/views/admin/logs/sidekiq_log.html.erb b/rails/app/views/admin/logs/sidekiq_log.html.erb deleted file mode 100644 index e84c4d69f8bd0b5128602dd9ef7203935c680ed5..0000000000000000000000000000000000000000 --- a/rails/app/views/admin/logs/sidekiq_log.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<pre> - <%= File.read(Rails.root.join("log/sidekiq.log")) %> -</pre> diff --git a/rails/app/views/admin/registry/index.html.erb b/rails/app/views/admin/registry/index.html.erb deleted file mode 100644 index a0906dd27b361913d0a7b655d7be7ee8f9d3831c..0000000000000000000000000000000000000000 --- a/rails/app/views/admin/registry/index.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<h3> Registry </h3> -<p> All the images on the registry: </p> -<%= @images.to_json %> diff --git a/rails/app/views/admin/statistics/index.html.erb b/rails/app/views/admin/statistics/index.html.erb deleted file mode 100644 index 6e2eed95ff7587cb8776950c491bbe461c6709c5..0000000000000000000000000000000000000000 --- a/rails/app/views/admin/statistics/index.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -<svg id="chart"></svg> - -<script type="text/javascript"> - nv.addGraph(function() { - var chart = nv.models.discreteBarChart() - .x(function(d) { return d.label }) //Specify the data accessors. - .y(function(d) { return d.value }) - .staggerLabels(false) //Too many bars and not enough room? Try staggering labels. - //.tooltips(false) //Don't show tooltips - .showValues(true) //...instead, show the bar value right on top of each bar. - .duration(350) - .color(['#aec7e8']) - ; - chart.yAxis.tickFormat(d3.format(',0f')); - chart.valueFormat(d3.format(',0f')); - - d3.select('#chart') - .datum(getData()) - .call(chart); - - nv.utils.windowResize(chart.update); - - return chart; - }); - //Each bar represents a single discrete quantity. - function getData() - { - return [{values: <%= @b.to_json.html_safe %>}] - } -</script> diff --git a/rails/app/views/admin/webapps/index.html.erb b/rails/app/views/admin/webapps/index.html.erb deleted file mode 100644 index 6aa080a716e85221025b4a7e189a6bf2abe89cfb..0000000000000000000000000000000000000000 --- a/rails/app/views/admin/webapps/index.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<h3> Not published app </h3> -<ul> - <% @webapps.each do |w| %> - - <li> App : <%= link_to w.name, webapp_path(w) %>, created by : <%= w.user.email %> the <%= w.created_at %> </li> - <% end %> -</ul> -<h3> Upgrading apps </h3> -<ul> - <% @webapps_upgrading.each do |w| %> - - <li> App : <%= link_to w.name, webapp_path(w) %>, created by : <%= w.user.email %> the <%= w.created_at %> </li> - <!-- TODO: fermer conteneur et supprimer adresse ip --> - <% end %> -</ul> diff --git a/rails/app/views/datasets/_form.html.erb b/rails/app/views/datasets/_form.html.erb deleted file mode 100644 index c5cc2d0a260ef131a1b06e6ec3eebadc3fb342c5..0000000000000000000000000000000000000000 --- a/rails/app/views/datasets/_form.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<%= form_for(@dataset) do |f| %> - <% if @dataset.errors.any? %> - <div id="error_explanation"> - <h2><%= pluralize(@dataset.errors.count, "error") %> prohibited this dataset from being saved:</h2> - - <ul> - <% @dataset.errors.full_messages.each do |message| %> - <li><%= message %></li> - <% end %> - </ul> - </div> - <% end %> - - <div class="field"> - <%= f.label :name %><br> - <%= f.text_field :name %> - </div> - <br /> - <div class="field"> - <%= f.label :file %><br> - <%= f.file_field :file %> - </div> - <br /> - <div class="actions"> - <%= f.submit %> - </div> -<% end %> diff --git a/rails/app/views/datasets/edit.html.erb b/rails/app/views/datasets/edit.html.erb deleted file mode 100644 index 9d26ae588bc9103d9c2b12923bcc8e4adc826aec..0000000000000000000000000000000000000000 --- a/rails/app/views/datasets/edit.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% @page_title = "Edit dataset"%> -<h1>Editing Dataset</h1> - -<%= render 'form' %> - -<%= link_to 'Show', @dataset %> | -<%= link_to 'Back', datasets_path %> diff --git a/rails/app/views/datasets/index.html.erb b/rails/app/views/datasets/index.html.erb deleted file mode 100644 index 5a6a96187d0d0c96e761b83734f50c06b90db91e..0000000000000000000000000000000000000000 --- a/rails/app/views/datasets/index.html.erb +++ /dev/null @@ -1,34 +0,0 @@ -<% @page_title = "Your Datasets"%> -<p id="notice"><%= notice %></p> - -<h1>Listing Datasets</h1> - -<table> - <thead> - <tr> - <th>Name</th> - <th>Size</th> - <th>User</th> - <th>Extension</th> - <th colspan="3"></th> - </tr> - </thead> - - <tbody> - <% @datasets.each do |dataset| %> - <tr> - <td><%= dataset.name %></td> - <td><%= dataset.size %></td> - <td><%= dataset.user_id %></td> - <td><%= dataset.extension %></td> - <td><%= link_to 'Show', dataset %></td> - <td><%= link_to 'Edit', edit_dataset_path(dataset) %></td> - <td><%= link_to 'Destroy', dataset, method: :delete, data: { confirm: 'Are you sure?' } %></td> - </tr> - <% end %> - </tbody> -</table> - -<br> - -<%= link_to 'New Dataset', new_dataset_path %> diff --git a/rails/app/views/datasets/index.json.jbuilder b/rails/app/views/datasets/index.json.jbuilder deleted file mode 100644 index 9f25620b8b24029fb0e6900b88ad26106b056f4f..0000000000000000000000000000000000000000 --- a/rails/app/views/datasets/index.json.jbuilder +++ /dev/null @@ -1,4 +0,0 @@ -json.array!(@datasets) do |dataset| - json.extract! dataset, :id, :name, :size, :user_id, :extension - json.url dataset_url(dataset, format: :json) -end diff --git a/rails/app/views/datasets/new.html.erb b/rails/app/views/datasets/new.html.erb deleted file mode 100644 index ba5e889ebf40e9b925d4d4da51af0a36efd8ab0c..0000000000000000000000000000000000000000 --- a/rails/app/views/datasets/new.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<div class="container"> - <div class="row"> - <div class="col-md-8"> - <% @page_title = "My datasets"%> - <% @datasets.each do |d| %> - <%= link_to "destroy #{d.name} ?", d, data: { confirm: "Are you sure?" }, method: :delete %></p> - <% end %> - </div> - </div> - - <div class="row"> - <div class="col-md-8"> - <h3>Create a new Dataset</h3> - <p class="lead"> - Datasets allow you to upload a file that you can let on our server to run job (so you don't need to upload them any time) - A dataset can be either a single document or a file containing a collection of documents such as a zipped folder, according to the specifications of the web service considered. - </p> - <%= render 'form' %> - </div> - </div> -</div> diff --git a/rails/app/views/datasets/show.html.erb b/rails/app/views/datasets/show.html.erb deleted file mode 100644 index 026d085786c8df91aaca0855a8eebe075409c375..0000000000000000000000000000000000000000 --- a/rails/app/views/datasets/show.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<% @page_title = "Your Dataset"%> -<p id="notice"><%= notice %></p> - -<p> - <strong>Name:</strong> - <%= @dataset.name %> -</p> - -<p> - <strong>Size:</strong> - <%= @dataset.size %> -</p> - -<p> - <strong>User:</strong> - <%= @dataset.user_id %> -</p> - -<p> - <strong>Extension:</strong> - <%= @dataset.extension %> -</p> - -<%= link_to 'Edit', edit_dataset_path(@dataset) %> | -<%= link_to 'Back', datasets_path %> diff --git a/rails/app/views/datasets/show.json.jbuilder b/rails/app/views/datasets/show.json.jbuilder deleted file mode 100644 index 37be1794d896235b212cb5a995875bc6ac0a74aa..0000000000000000000000000000000000000000 --- a/rails/app/views/datasets/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.extract! @dataset, :id, :name, :size, :user_id, :extension, :created_at, :updated_at diff --git a/rails/app/views/devise/confirmations/new.html.erb b/rails/app/views/devise/confirmations/new.html.erb deleted file mode 100644 index 7c0ff6685aa2a13d840856f733bfabc2d25bf498..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/confirmations/new.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% @page_title = "Confirmation"%> -<div class="container"> - <h2>Resend confirmation instructions</h2> - - <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post, class: 'form-horizontal' }) do |f| %> - <%= devise_error_messages! %> - <div class="form-group"> - <%= f.label :email, class: "control-label col-md-3" %> - <div class="col-md-4"><%= f.email_field :email, class: "form-control", autofocus: true %></div> - </div> - - <div class="form-group"> - <div class="col-md-4 col-md-offset-3"> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %> - Resend instructions - <% end %> - </div> - </div> - <% end %> - - <%= render "devise/shared/links" %> -</div> \ No newline at end of file diff --git a/rails/app/views/devise/mailer/confirmation_instructions.html.erb b/rails/app/views/devise/mailer/confirmation_instructions.html.erb deleted file mode 100644 index dc55f64f69e2541d12e6ffd6e3f4a413e8b828b2..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<p>Welcome <%= @email %>!</p> - -<p>You can confirm your account email through the link below:</p> - -<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p> diff --git a/rails/app/views/devise/mailer/reset_password_instructions.html.erb b/rails/app/views/devise/mailer/reset_password_instructions.html.erb deleted file mode 100644 index f667dc12fe34929983021920c39f4ca061c4fd4f..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<p>Hello <%= @resource.email %>!</p> - -<p>Someone has requested a link to change your password. You can do this through the link below.</p> - -<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> - -<p>If you didn't request this, please ignore this email.</p> -<p>Your password won't change until you access the link above and create a new one.</p> diff --git a/rails/app/views/devise/mailer/unlock_instructions.html.erb b/rails/app/views/devise/mailer/unlock_instructions.html.erb deleted file mode 100644 index 41e148bf2ac2d8b3f108e15c45f8a2e75fb0b07e..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<p>Hello <%= @resource.email %>!</p> - -<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p> - -<p>Click the link below to unlock your account:</p> - -<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p> diff --git a/rails/app/views/devise/passwords/edit.html.erb b/rails/app/views/devise/passwords/edit.html.erb deleted file mode 100644 index 8c993ff5212c584dc13665cf81a1d4d3450794da..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/passwords/edit.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<% @page_title = "Edit your password"%> -<h2>Change your password</h2> - -<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> - <%= f.hidden_field :reset_password_token %> - - <div><%= f.label :password, "New password" %><br /> - <%= f.password_field :password, autofocus: true %></div> - - <div><%= f.label :password_confirmation, "Confirm new password" %><br /> - <%= f.password_field :password_confirmation %></div> - - <div><%= f.submit "Change my password" %></div> -<% end %> - -<%= render "devise/shared/links" %> diff --git a/rails/app/views/devise/passwords/new.html.erb b/rails/app/views/devise/passwords/new.html.erb deleted file mode 100644 index c9a933cc14d15db97ae3c938d01b60a4774ff721..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/passwords/new.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<% @page_title = "Create password"%> -<div class="container"> - <h2>Forgot your password?</h2> - - <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'form-horizontal' }) do |f| %> - <%= devise_error_messages! %> - - <div class="form-group"> - <%= f.label :email, class: "control-label col-md-3" %> - <div class="col-md-4"><%= f.email_field :email, class: "form-control", autofocus: true %></div> - </div> - <div> - - <div class="form-group"> - <div class="col-md-4 col-md-offset-3"> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %> - Send me reset password instructions - <% end %> - </div> - </div> - <% end %> - - <%= render "devise/shared/links" %> -</div> \ No newline at end of file diff --git a/rails/app/views/devise/registrations/edit.html.erb b/rails/app/views/devise/registrations/edit.html.erb deleted file mode 100644 index 458df30514f666f429aa0a690cfc42b4c449e92c..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/registrations/edit.html.erb +++ /dev/null @@ -1,57 +0,0 @@ -<%= render 'users/menu' %> - <% @page_title = "Update your account " %> -<div class="container"> - <h3>Update my account</h3> - <br /> - <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'form-horizontal'}) do |f| %> - <%= devise_error_messages! %> - - <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> - <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div> - <% end %> - - <div class="form-group"> - <%= f.label :email, class: "control-label col-sm-3" %> - <div class="col-sm-5"><%= f.email_field :email, autofocus: true, class: "form-control" %></div> - </div> - - <div class="form-group"> - <%= f.label :password , class: "control-label col-sm-3" %> - <div class="col-sm-5"><%= f.password_field :password, class: "form-control" %></div> - <span class="help-block">Leave blank if you don't want to change it</span> - </div> - - <div class="form-group"> - <%= f.label :password_confirmation , class: "control-label col-sm-3" %> - <div class="col-sm-5"><%= f.password_field :password_confirmation, class: "form-control" %></div> - </div> - - <div class="form-group"> - <label class="control-label col-sm-3">SSH keys</label> - <div class="col-sm-5"><%= f.text_area :sshkey, rows: 9 , class: "form-control" %></div> - <span class="help-block">Key lines must begin with <tt>ssh-<i>XXX</i></tt><br/>Needed if you intend to create/update apps</span> - </div> - - <!--<div class="form-group"> - <%= f.label :current_password , class: "control-label col-sm-3" %> - <div class="col-sm-5"><%= f.password_field :current_password, class: "form-control" %></div> - <span class="help-block">Mandatory to confirm your changes</span> - </div>--> - - <div class="form-group"> - <%= f.label "Private token (for API)" , class: "control-label col-sm-3" %> - <div class="col-sm-5" ><%= f.text_field :auth_token , :class => "form-control" , :readonly => true %></div> - <div class="btn btn-default col-sm-2"><%= link_to 'Regenerate token', new_user_token_path, :remote => true, method: :post, id: 'regen_token_button' %></div> - <script type="text/javascript"> - $("#regen_token_button").on("ajax:success", function(e, data) { $("#user_auth_token").val(data);}); - </script> - </div> - - <div class="form-group"> - <div class="col-sm-5"> - <%= f.submit 'Update', class: 'btn btn-primary' %> - </div> - </div> - - <% end %> -</div> diff --git a/rails/app/views/devise/registrations/new.html.erb b/rails/app/views/devise/registrations/new.html.erb deleted file mode 100644 index 9ab9b70a00ae9d7f2c468a6080406b1c50d85885..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/registrations/new.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<% @page_title = "create your account"%> -<div class="container"> - <h2>Create your account</h2> - <div class="row"> - <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {class: 'form-horizontal'}) do |f| %> - <%= devise_error_messages! %> - - <div class="form-group"> - <%= f.label :email, class: "control-label col-md-3" %> - <div class="col-md-4"><%= f.email_field :email, class: "form-control", autofocus: true %></div> - </div> - <div class="form-group"> - <%= f.label :password, class: "control-label col-md-3" %> - <div class="col-md-4"><%= f.password_field :password, class: "form-control" %></div> - </div> - <div class="form-group"> - <%= f.label :password_confirmation, class: "control-label col-md-3" %> - <div class="col-md-4"><%= f.password_field :password_confirmation, class: "form-control" %></div> - </div> - - <div class="form-group"> - <div class="col-md-4 col-md-offset-3"> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %> - Submit - <% end %> - </div> - </div> - <% end %> - </div> - <%= render "devise/shared/links" %> -</div> \ No newline at end of file diff --git a/rails/app/views/devise/sessions/new.html.erb b/rails/app/views/devise/sessions/new.html.erb deleted file mode 100644 index 072383659af40087788f47b8be85974e073825ec..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/sessions/new.html.erb +++ /dev/null @@ -1,39 +0,0 @@ -<% @page_title = "Log in"%> -<div class="container"> - <h2>Log in</h2> - <div class="row"> - <%= form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: 'form-horizontal'}) do |f| %> - <%= devise_error_messages! %> - - <div class="form-group"> - <%= f.label :email, class: "control-label col-md-3" %> - <div class="col-md-4"> - <%= f.email_field :email, class: "form-control", autofocus: true %> - </div> - </div> - <div class="form-group"> - <%= f.label :password, class: "control-label col-md-3" %> - <div class="col-md-4"> - <%= f.password_field :password, class: "form-control" %> - </div> - </div> - <% if devise_mapping.rememberable? -%> - <div class="form-group"> - <%= f.label :remember_me, class: "control-label col-md-3" %> - <div class="col-md-4"> - <%= f.check_box :remember_me, html_options = {style: "margin-top: 12px;"} %> - </div> - </div> - <% end %> - - <div class="form-group"> - <div class="col-md-4 col-md-offset-3"> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %> - Submit - <% end %> - </div> - </div> - <% end %> - </div> - <%= render "devise/shared/links" %> -</div> \ No newline at end of file diff --git a/rails/app/views/devise/shared/_links.erb b/rails/app/views/devise/shared/_links.erb deleted file mode 100644 index 23606c5eff4642af58c9308b62803ed2fe93ebc7..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/shared/_links.erb +++ /dev/null @@ -1,32 +0,0 @@ -<div id="links"> - <%- if controller_name != 'sessions' %> - <%= link_to "Sign in", new_session_path(resource_name) %> | - <% end -%> - - <%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to "Sign up", new_registration_path(resource_name) %> | - <% end -%> - - <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> - <%= link_to "Forgot your password?", new_password_path(resource_name) %> | - <% end -%> - - <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %> | - <% end -%> - - <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %> | - <% end -%> - - <%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %> | - <% end -%> - <% end -%> -</div> - -<script> -var linksWithoutBar = $("#links").html().slice(0, -($("#links").html().length - $("#links").html().lastIndexOf('|'))); -$("#links").html(linksWithoutBar); -</script> \ No newline at end of file diff --git a/rails/app/views/devise/unlocks/new.html.erb b/rails/app/views/devise/unlocks/new.html.erb deleted file mode 100644 index c7344bd4202ae8193713ce4c89d94ec8555623fc..0000000000000000000000000000000000000000 --- a/rails/app/views/devise/unlocks/new.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% @page_title = "Send unlock instructions"%> -<div class="container"> - <h2>Resend unlock instructions</h2> - - <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> - <%= devise_error_messages! %> - - <div><%= f.label :email %><br /> - <%= f.email_field :email, autofocus: true %></div> - - <div><%= f.submit "Resend unlock instructions" %></div> - <% end %> - - <%= render "devise/shared/links" %> -</div> diff --git a/rails/app/views/documentation/_doc_footer.html.erb b/rails/app/views/documentation/_doc_footer.html.erb deleted file mode 100644 index 7f5eaa32ef17c352844cdb2f56d00f079c791cd0..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/_doc_footer.html.erb +++ /dev/null @@ -1 +0,0 @@ -</div> \ No newline at end of file diff --git a/rails/app/views/documentation/_entrypoint_example.html.erb b/rails/app/views/documentation/_entrypoint_example.html.erb deleted file mode 100644 index f2fe021e2b2507fbde483e1a5f9ac6cb8599ca10..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/_entrypoint_example.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<h4> How to make an entrypoint for an allgo algorithm </h4> -<p> -The entrypoint is the file that is launched by allgo to process a job. -</p> - -<p> -The user creating the job may provide command line arguments and input files. -The arguments are passed to the entrypoint command, and the input files are -located in the current working directory. -</p> - -<p>For example, an app that works on text files could have the following entrypoint: -<pre> -#!/bin/sh -for file in *.txt; -do - echo "Processing $file" - /usr/local/bin/myapp --input "$file" --output "$file.output" "$@" -done -</pre> -<p>In this example, <code>myapp</code> is run on each input text file and store the result as <code><i>FILENAME</i>.output.</code> The extra argument <code>"$@"</code> is there to <a href="https:///stackoverflow.com/questions/9994295/what-does-mean-in-a-shell-script">forward the command line arguments</a> provided to the entrypoint. -</p> - diff --git a/rails/app/views/documentation/_menu.html.erb b/rails/app/views/documentation/_menu.html.erb deleted file mode 100644 index b79651f590d3ac67f66fd48b488d6978a4c0f0bb..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/_menu.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<div class="container"> - <ul class="nav nav-tabs" id="mytab" role="tablist"> - <li role="presentation" class="nav-item" id ="about"><a href="about">About - What is A||go</a></li> - <li role="presentation" class="nav-item" id ="tutorial"><a href="tutorial">Tutorial - Deploy easily your app </a></li> - <li role="presentation" class="nav-item" id ="entrypoint"><a href="entrypoint">Tutorial - Make your entrypoint </a></li> - <li role="presentation" class="nav-item" id ="privacy"><a href="privacy">Privacy</a></li> - <li role="presentation" class="nav-item" id ="api"><a href="api">API</a></li> - <li role="presentation" class="nav-item" id ="demo_examples"><a href="demo_examples">UI Example with API</a></li> - <li role="presentation" class="nav-item" id ="infrastructure"><a href="infrastructure">Infrastructure</a></li> - <li role="presentation" class="nav-item" id ="roadmap"><a href="roadmap">Roadmap</a></li> - </ul> - <br /> - -<script type="text/javascript"> -$(".nav-item").map(function() { - if (window.location.pathname.indexOf(this.id) >= 0) { - $(this).attr('class', 'active'); - } -}); -</script> diff --git a/rails/app/views/documentation/about.html.erb b/rails/app/views/documentation/about.html.erb deleted file mode 100644 index 78d530a9e7cb4fd51deb84b12b48de5910536c88..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/about.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<%= render 'documentation/menu' %> -<% @page_title = "documentation"%> -<p class="lead"> Allgo is a web platform developed by SED - Inria Rennes <br /> -It enables you to easily use algorithms made by French research directly online, or as a web-service. <br /> -We invite you to test the app on our store. <br /> -<br /> -If you're a scientist, and you have an app, an algorithm, who run in console/shell, you can quickly put it online. <br /> -This will help people to discover and use your work.<br /> -To add your app, we provide you a full root access on a independent machine. <br /> -To discover in details the process, go to the tutorial section. <br /> -<br /> -See you on A||go! -</p> -<br /> -<h3> Contact : <a href="mailto:allgo@inria.fr">allgo@inria.fr</a> </h3> -<%= render 'documentation/doc_footer' %> diff --git a/rails/app/views/documentation/api.html.erb b/rails/app/views/documentation/api.html.erb deleted file mode 100644 index 5c507a4976954903b572aa2f78d83ddbe91bf47d..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/api.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -<%= render 'documentation/menu' %> - <% @page_title = "Api " %> -<h3>A||GO's web services can be used through command lines using cURL</h3> -<p class="lead"> - First, check your private token on your <%= link_to "account page", edit_user_registration_path %> , - Second, the generic syntax to execute the web service is the one below. - <pre><%="curl -H 'Authorization: Token token=<your_private_token>' -X POST -F job[webapp_id]=<service_id> - -F job[param]='' -F files[0]=@<path_to_file0> -F files[1]=@<path_to_file1> - -F job[file_url]=<your_file_url> - -F job[dataset]=<dataset_name> - #{api_v1_jobs_url}"%></pre> - <ul> - <li> <your_private_token> : this code is given in your accouont information page</li> - <li> one or several input files can be specified using arguments "-F files[i]" </li> - <li> <dataset_name> : If you're an Inria member, you can drop a file that you'll be able to use as input file without uploading it. - Use the name you choose for your dataset on the cURL request to use it</li> - </ul> - - <p> - This request will return you, either the errors, or if it's ok, your job_id and the average execution time for this app. - </p> - - Third, check the resulting job to get the url files with : - - <pre><%= "curl -H 'Authorization: Token token=<your_private_token>' -X GET #{api_v1_job_url(id: "ID").gsub("ID", "<job_id>")}" %></pre> - with <job_id> the job number returned by the former cURL command. - - <p> This command will give you the list of your files, so you can download them </p> -</p> diff --git a/rails/app/views/documentation/demo_examples.html.erb b/rails/app/views/documentation/demo_examples.html.erb deleted file mode 100644 index ea1565db174388c9a811dc47af286e878ec55c64..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/demo_examples.html.erb +++ /dev/null @@ -1,88 +0,0 @@ -<%= render 'documentation/menu' %> - <% @page_title = "Ui example " %> -<h3> UI example using allgo API </h3> -<p class="lead">We provide some web interface example for app which run under allgo. -Most of them are using the javascript framework jQuery, but the choice of the techno is yours. - -You can access the code of this demo. - -If you make a specific interface for your app, but you don't have any server to host it : -Send us a Dockerfile (like in the examples) - -We suggest to host your interface, because you'll have less restrictions. -</p> - <div class="row"> - <h4>Ginflow</h4> - <div> - <a href="http://woody.irisa.fr:27000/" target="_blank">Alchemia UI</a><br /> - <a href="https://allgo.inria.fr/app/ginflow" target="_blank">Ginflow on allgo</a> - <a href="https://gitlab.irisa.fr/mileem/template-alchemia" target="_blank">Code on GitLab</a> - <span class="help-block">Team Myriads</span><br /> - </div> - <hr /> - <h4>ND-Safir</h4> - <div> - <a href="http://woody.irisa.fr:25000/" target="_blank">ND-Safir UI</a><br /> - <a href="https://allgo.inria.fr/app/ndsafir" target="_blank">ND-Safir on allgo</a> - <a href="https://gitlab.irisa.fr/mileem/template-ndsafir-allgo" target="_blank">Code on GitLab</a> - <span class="help-block">Team Serpico</span><br /> - </div> - <hr /> - <h4>Squall</h4> - <div> - <a href="http://woody.irisa.fr:26000/" target="_blank">Squall UI</a><br /> - <a href="https://allgo.inria.fr/app/squall" target="_blank">ND-Safir on allgo</a> - <a href="https://gitlab.irisa.fr/mileem/template-squall" target="_blank">Code on GitLab</a> - <span class="help-block">Team Lis</span><br /> - </div> - <hr /> - <h4>Minimal example with ginflow</h4> - <div> - <a href="http://alchemia.gforge.inria.fr" target="_blank">a really light interface for ginflow</a><br /> - <span class="help-block">Team Myriads</span><br /> - </div> - <hr /> - <p class="lead"> A small jQuery function to launch a job on allgo : </p> - <pre> - $("#form").on("submit", function(event) { - //the formData embed an uploaded file and the webapp id - formData = new FormData($(this)[0]); - $.ajax({ - type: 'POST', - url: 'https://allgo.inria.fr/api/v1/jobs', - data: formData, - cache: false, - contentType: false, - processData: false, - headers: { 'Authorization': 'Token token=your token, - 'Accept':'application/json' - }, - success: function(d, s, ex) { - console.log("success"); - console.log(d); - } - }) - return false; - }); - </pre> - <hr /> - <p class="lead"> A small php snippet, sending a file by url : </p> - <pre> - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL,"https://allgo.inria.fr/api/v1/jobs"); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-type: multipart/form-data','Authorization: Token token=c00eefecd3834fd4acdd0df45c4bb88e')); - $fields = array('webapp_id'=>"122",'file_url'=>"https://upload.wikimedia.org/wikipedia/en/5/5f/Original_Doge_meme.jpg"); - - //url-ify the data for the POST - $fields_string = http_build_query(array('job' => $fields)); - curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - print "running the request..."; - $server_output = curl_exec ($ch); - curl_close ($ch); - print $server_output -</pre> -<hr /> - </div> - </div> diff --git a/rails/app/views/documentation/entrypoint.html.erb b/rails/app/views/documentation/entrypoint.html.erb deleted file mode 100644 index 42f9d048a9d828ce476afd0a389db97f6f74ecaa..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/entrypoint.html.erb +++ /dev/null @@ -1,4 +0,0 @@ - - <% @page_title = "Make your entrypoint " %> -<%= render 'documentation/menu' %> -<%= render 'documentation/entrypoint_example' %> diff --git a/rails/app/views/documentation/infrastructure.html.erb b/rails/app/views/documentation/infrastructure.html.erb deleted file mode 100644 index 413d504c8b5b3f31ea9610df59dd85219aedd66d..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/infrastructure.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= render 'documentation/menu' %> - <% @page_title = "Infrastructure" %> -<div class="text-center"> - <img class="img-rounded" src="/images/infrastructure.png"/> -</div> -<%= render 'documentation/doc_footer' %> \ No newline at end of file diff --git a/rails/app/views/documentation/privacy.html.erb b/rails/app/views/documentation/privacy.html.erb deleted file mode 100644 index 78fbb16cc4bde5b099389405688b519610a5eb80..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/privacy.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= render 'documentation/menu' %> - <% @page_title = "Privacy" %> -<p class="lead"> -We keep your input and generated data by the jobs you run for 30 days. <br /> -After that, they are deleted, so think to download them if you want to keep them. <br /> -</p> diff --git a/rails/app/views/documentation/roadmap.html.erb b/rails/app/views/documentation/roadmap.html.erb deleted file mode 100644 index 3f4d6da07a0eaded6217831d8207c198839ae3a7..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/roadmap.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<%= render 'documentation/menu' %> - <% @page_title = "Roadmap " %> -<p class="leader">In progress...</p> -<%= render 'documentation/doc_footer' %> \ No newline at end of file diff --git a/rails/app/views/documentation/template.html.erb b/rails/app/views/documentation/template.html.erb deleted file mode 100644 index 437eb35f94bd2f9455aebd01e3dfcf0ed3ce4394..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/template.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -You want to build your custom interface ? -AWESOME diff --git a/rails/app/views/documentation/tutorial.html.erb b/rails/app/views/documentation/tutorial.html.erb deleted file mode 100644 index 0ad4999fb700eb7df8b4802910b053f733f30f20..0000000000000000000000000000000000000000 --- a/rails/app/views/documentation/tutorial.html.erb +++ /dev/null @@ -1,60 +0,0 @@ -<%= render 'documentation/menu' %> - <% @page_title = "Deploy easily " %> - <div> - <p class="lead"> - <h3>Add my app on A||go</h3> - This is a brief and simple tutorial about how you can deploy your app/algorithm on A||go. - We try to make it really simple, so, if something looks complicated, send us an email. - - <h3>Before started</h3> - Note that the required knowledge you need to have, is <strong>only</strong> how to install your app. - We remind you that A||go only works for application without UI, running on linux, without workflow. - You need to add your public SSH key in your profile, so you'll be able to access to your machine later. - - <h3>Step 1: Beam me up, A||Go!</h3> - - Go to <%=link_to 'this page'.html_safe, new_webapp_path %> - you will find a basic form with the information we need to build your app. - Enter the name, a short description, and, in the tags field, you can add the name of your research-team. - The entrypoint is the file (usually a binary) that will be call to execute your application. - The quota field refer to the amount of data that can be used, per user, for your app: - If you allow a 50MB quota, an user will have the possibility to use 50 times your app with a 1MB file (25 times with a 2MB) - This restriction is here to avoid abuse and spam. But for you, it's unlimited.<br /> - The default OS for your app is a Debian, you are free to choose another one. - If the OS you require is not on the list, send us an email. <br /> - - Your machines comes with a set of usual tools (nano, vim, less, - ssh,...), but you'll be free to add anything you need (compiler, - JRE, ...). - - <h3>Step 2: Congratulations! You have created a new element.</h3> - The system is building your app, so it could take few minutes. - During this time, you can add a Readme file, and demo files. Demo files are here to show to users - what it needs in input, and what the result will be in output. - A readme file is useful if you have many parameters in your application, explain how it works, - how it can be used (Markdown language can be read). - If nothing happens, in a really long time, try to refresh the page. - Then, it'll display an adress to connect to your ssh access. - - <h3>Step 3: Do, or do not. There is no “try”.</h3> - Connect with ssh at the provided adress. - You're at home, so make it comfortable. You're the only one in this machine, - you don't come in conflict with other scientists installations. So feel free to install whatever is needed. - The file you choose has the entrypoint is already created, you can modify it or replace it. - At the execution of your app in A||Go, the file(s) in input will be place at the same place as your - Remember to redirect the output & the errors to files in the same folder. - When it's done, go to step 4. - - <h3>Step 4: Run, A||Go, run!</h3> - After installing your app, come back on the A||Go page.<br /> - Click the button "commit your work", and your app will be testable. - It's time to test your app, go to your page application and create a job by uploading a file. - If it works, it's great.<br /> - It it doesn't, it's not. But you can go back on your SSH connection to modify your app and test it again. - Now that everything looks all right, click "publish my app". - - <h3>Step 5: Enjoy the little things.</h3> - This is it! You just make your work accessible to anyone, congrats! - </p> -</div> -<%= render 'documentation/doc_footer' %> diff --git a/rails/app/views/errors/403.html b/rails/app/views/errors/403.html deleted file mode 100644 index f49e587b81e12cc1159e6fcf74d8e90978cabb1f..0000000000000000000000000000000000000000 --- a/rails/app/views/errors/403.html +++ /dev/null @@ -1,4 +0,0 @@ -<div class="container"> - <h2>403 Forbidden</h2> - <p>You are not allowed to access this page</p> -</div> diff --git a/rails/app/views/errors/404.html b/rails/app/views/errors/404.html deleted file mode 100644 index bebde71f8d50e2c9e6a294bc6cf38b7c683eb858..0000000000000000000000000000000000000000 --- a/rails/app/views/errors/404.html +++ /dev/null @@ -1,4 +0,0 @@ -<div class="container"> - <h2>404 Not Found</h2> - <p>You are trying to access a page which does not exist</p> -</div> diff --git a/rails/app/views/home/index.html.erb b/rails/app/views/home/index.html.erb deleted file mode 100644 index 164c2e1e74d2820db6f6224cef0ae511d2782022..0000000000000000000000000000000000000000 --- a/rails/app/views/home/index.html.erb +++ /dev/null @@ -1,48 +0,0 @@ -<style media="screen" type="text/css"> - .alert { - position: absolute; - min-width: 300px; - } - div { - color:#2c3e50; - } -</style> -<% @page_title = "Home "%> -<div class="presentation"> - <div class="container"> - <div class="text-center"> - <!-- <div class="text-center" style="color: yellow;transform-origin: 50% 100%;transform: perspective(300px) rotateX(25deg);"> --> - <h1> - A||GO - </h1> - <br /> - <h3 id="main-text"> - Allgo is a platform for building deploying apps that analyze massive data in Linux containers, it has been specifically designed for use in scientific applications. - </h3> - <br /> - <%= link_to "Get started".html_safe, webapps_path, class: "btn btn-lg btn-success" %> - <br /> - <br /> - <p class="text-muted"> - Currently in Beta - </p> - </div> - </div> -</div> - -<div class="container"> - <div class="row"> - <div class="col-lg-4"> - <h3><i class="glyphicon glyphicon-share-alt"></i> Easy Sharing</h3> - <p>You don't need to spend hours packaging your algorithms anymore thanks to Allgo. End users can immediately use your application.</p> - </div> - <div class="col-lg-4"> - <h3><i class="glyphicon glyphicon-floppy-saved"></i> Backup your app</h3> - <p>We are using Linux container technology to run your applications. They can be launched several years after the initial deployement without any upgrade of your source code.</p> - </div> - <div class="col-lg-4"> - <h3><i class="glyphicon glyphicon-console"></i> Command Line Interface</h3> - <p>Thanks to our easy to use HTTP REST API, you can do your own scripts using our platform.</p> - </div> - </div> -</div> diff --git a/rails/app/views/jobs/_edit_upload.html.erb b/rails/app/views/jobs/_edit_upload.html.erb deleted file mode 100644 index 2ef9ee6ae895965bba9b2c257445ad27f90fb7be..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/_edit_upload.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -<%= javascript_include_tag "jquery.ui.widget.js" %> -<%= javascript_include_tag "jquery.iframe-transport.js" %> -<%= javascript_include_tag "jquery.fileupload.js" %> -<%= stylesheet_link_tag "jquery.fileupload.css" %> -<!-- The fileinput-button span is used to style the file input field as button --> - -<span class="btn btn-success fileinput-button"> - <i class="glyphicon glyphicon-plus"></i> - <span>Upload file</span> - <input id="fileupload" type="file" name="file"> -</span> - <br /> <br /> - -<div id="progress" class="progress"> - <div class="progress-bar progress-bar-success"></div> -</div> - -<!-- The container for the uploaded files --> -<div id="files" class="files"></div> - -<script> -//todo : while doesn't work when move in application.js -$(function () { - 'use strict'; - // Change this to the location of your server-side upload handler: - var url = '/upload'; - $('#fileupload').fileupload({ - url: url, - dataType: 'json', - stop: function (e) { - location.reload(); - }, - fail: function (e, data) { - alert(data.errorThrown +" "+data.jqXHR.responseText); - }, - progressall: function (e, data) { - var progress = parseInt(data.loaded / data.total * 100, 10); - $('#progress .progress-bar').css('width', progress + '%'); - }, - headers: { - 'Job': '<%= @job.id %>' - } - }).prop('disabled', !$.support.fileInput) - .parent().addClass($.support.fileInput ? undefined : 'disabled') -}); - //$('#job_submit').click(function(){ $(this).attr('disabled',false); -</script> \ No newline at end of file diff --git a/rails/app/views/jobs/_files.html.erb b/rails/app/views/jobs/_files.html.erb deleted file mode 100644 index d2494fc5369e0322cf25936a827d3b7054ebe20a..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/_files.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% Dir.foreach(@job.path) do |f| next if f == '.' or f == '..' %> - - <% if File.size(File.join(@job.path, f)) > 0 %> - <p> - <%= link_to File.basename(f), request.protocol + request.host + '/datastore/' + @job.path + '/' + File.basename(f) %> <span class="badge"> - <%= number_to_human_size(File.size(File.join(@job.path, f))) %></span> - </p> - <%= allgo_display("#{Rails.configuration.root_url}/datastore/#{@job.path}",f,"datastore/#{@job.path}") %> - <!-- TODO chemin en dur dans la bdd, n'utilise pas le Rails.config --> - <% end %> -<% end %> diff --git a/rails/app/views/jobs/_form.html.erb b/rails/app/views/jobs/_form.html.erb deleted file mode 100644 index 81800e16d53cc28726d0af30e7ed2df2c1b5db24..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/_form.html.erb +++ /dev/null @@ -1,71 +0,0 @@ -<%= form_for @job, validate: true, html: {class: "form-horizontal"} do |f| %> - <% if @job.errors.any? %> - <div id="error_explanation"> - <h2><%= pluralize(@job.errors.count, "error") %> prohibited this job from being saved:</h2> - <ul> - <% @job.errors.full_messages.each do |msg| %> - <li><%= msg %></li> - <% end %> - </ul> - </div> - <% end %> - - <div class="row"> - <%= f.label :dummy_files, "Files: ", class: "control-label col-md-2 col-md-offset-1 lead" %> - <%= render 'jobs/upload' %> - <div class="col-md-3"></div> <!-- to display uploaded file --> - </div> - <div class="row"> - <!-- f.label :file_url, "Paste an url: ", class: "control-label col-md-offset-1 col-md-2 lead" %> --> - <%= render partial: 'jobs/paste_url',locals: {:f => f} %> - </div> - <!-- render dataset --> - <% if !@datasets.blank? %> - <div class="row"> - <%= f.label :dataset, "Dataset: ", class: "control-label col-md-2 col-md-offset-1 lead" %> - <div class="col-md-2"> - <%= f.collection_select :webapp, @datasets,:id,:name, {include_blank: true}, {class: "form-control",name: "dataset"} %> - </div> - </div> - <% end %> - <%= f.hidden_field :id, value: '' %> - <%= f.hidden_field :webapp_id, value: @webapp.id %> - <div class="row"> - <%= f.label :version, "Version: ", class: "control-label col-md-2 col-md-offset-1 lead" %> - <div class="col-md-2"> - <%= - f.select( :version, nil, {}, {class: "form-control"}) { - - opt = options_from_collection_for_select sort_webapp_versions(@webapp.webapp_versions.usable), :number, :number - if @webapp.sandbox_state == "RUNNING" and @webapp.administrable_by? current_user - "<option value=\"sandbox\">sandbox</option>".html_safe.concat opt - else - opt - end - } - %> - </div> - <div class="col-md-4"> - <span class="help-block">It's the last one by default</span> - </div> - </div> - <div class="row"> - <%= f.label :queue_id, "Queue: ", class: "control-label col-md-2 col-md-offset-1 lead" %> - <div class="col-md-3"> - <%= f.collection_select :queue_id, JobQueue.all, :id, :name_with_timeout, {}, {class: "form-control"} %> - </div> - </div> - <div class="row"> - <%= f.label :param, "Parameters: ", class: "control-label col-md-2 col-md-offset-1 lead" %> - <div class="col-md-9"> - <%= f.text_field :param, class: "form-control", id: "text_param" %> - <%= render @webapp.webapp_parameters %> <!-- match /view/webapp_parameters/webapp_parameter.html.erb --> - </div> - </div> - <div class="row"> - <div class="control-label col-md-2 col-md-offset-1 lead"> - <%= f.submit "Run this job", class: 'btn btn-success', id: 'job-submit-button' %> - </div> - </div> - -<% end %> diff --git a/rails/app/views/jobs/_paste_url.html.erb b/rails/app/views/jobs/_paste_url.html.erb deleted file mode 100644 index 83adae969be6197c3a2f9f86e97d06aa2f031ff5..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/_paste_url.html.erb +++ /dev/null @@ -1,20 +0,0 @@ -<!-- The fileinput-button span is used to style the file input field as button --> - -<%= f.label :file_url, "From url: ", class: "control-label col-md-offset-1 col-md-2 lead" %> -<div class="col-md-6"> - <%# FIXME: url file upload looks broken %> - <%= text_field_tag :dummy_file_url, "", class: "form-control", size: 100, id: "paste_url" %></span> -</div> -<%= f.button "Download this file", id: "dl_file", class: 'btn btn-info' %> -<br /> -<!-- <span class="help-block">Authorize extensions : ['.zip','.tar.gz','.fa.gz','.txt','.log','.json','.jpeg','.jpg','.png','.mp3','.wav','.ogg','.xml','.webm','.mp4','.gif'] </span> --> - -<script type="text/javascript"> -document.getElementById('dl_file').onclick = function(e) { - e.preventDefault(); - if (document.getElementById("paste_url").value != "") { - upload_file_with_url(<%= @webapp.id %>,document.getElementById("paste_url").value); - document.getElementById("paste_url").value = ""; - } -} -</script> diff --git a/rails/app/views/jobs/_upload.html.erb b/rails/app/views/jobs/_upload.html.erb deleted file mode 100644 index cba92ff71878b74c831d2e7961d42cdaa2723a30..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/_upload.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<!-- The fileinput-button span is used to style the file input field as button --> - -<div class="col-md-2"> - <span class="btn btn-info fileinput-button" id="search-files"> - <i class="glyphicon glyphicon-plus"></i> - <span>Upload file</span> - <input id="fileupload" type="file" name="file"> - </span> -</div> -<div class="col-md-5"> - <div id="progress" class="progress"> - <div class="progress-bar progress-bar-success"></div> - </div> - <div id="filesUploaded"></div> -</div> - -<script type="text/javascript"> - enableOneUpload(<%= @webapp.id %>); // Call the function in job_creation with a good webapp_id -</script> diff --git a/rails/app/views/jobs/ajax/_show_content.html.erb b/rails/app/views/jobs/ajax/_show_content.html.erb deleted file mode 100644 index a0049c041b3d159657b6dc4858090386a048945b..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/ajax/_show_content.html.erb +++ /dev/null @@ -1,15 +0,0 @@ - <h3>Files: </h3> - <% if File.directory?(@job.path) %> - <% Dir.foreach(@job.path) do |f| next if f == '.' or f == '..' -%> - <% if File.size(File.join(@job.path, f)) > 0 %> - <p> - <%= link_to f, "#{Rails.configuration.root_url}" + '/datastore/' + @job.folder + '/' + File.basename(f) %> - <span class="badge"> - <%= number_to_human_size(File.size(File.join(@job.path, f))) %> - </span> - <pre class="pre-scrollable"><%= allgo_display("#{Rails.configuration.root_url}/datastore/#{@job.folder}",f,"public/datastore/#{@job.folder}") %></pre> - </p> - <!-- TODO chemin en dur dans la bdd, n'utilise pas le Rails.config --> - <% end %> - <% end %> - <% end %> diff --git a/rails/app/views/jobs/index.html.erb b/rails/app/views/jobs/index.html.erb deleted file mode 100644 index 1591095f87f90186e7501594327e2c59a6e4cbdc..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/index.html.erb +++ /dev/null @@ -1,82 +0,0 @@ -<% @page_title = "My jobs "%> -<div class="container"> - <div class="row"> - <div class="col-md-12"> - <h2>Jobs</h2> - </div> - </div> - <div class="row"> - <div class="col-md-12"> - <br /> - <table class="table table-hover table-condensed" style="th text-align:center;"> - <thead> - <tr> - <% if current_user.admin? %> - <th>User</th> - <% end %> - <th>Id</th> - <th>App</th> - <th>Files</th> - <th>Status</th> - <th>Queue</th> - <th>Date</th> - <th>Parameters</th> - <th style="text-align: center">Actions</th> - </tr> - </thead> - - <tbody> - <% @jobs.each do |job| %> - <tr> - <% if current_user.admin? %> - <td><%= job.user.email %></td> - <% end %> - <td><%= link_to job.id, job, data: {main: 1} %></td> - <td><%= link_to job.webapp.name, job.webapp %></td> - <td><%= File.basename(job.job_uploads.first.job_file_file_name).truncate(30) if !job.job_uploads.first.nil? %></td> - <td><%= job.status %></td> - <td><%= job.queue.name %></td> - <td><%= job.updated_at.strftime("%e/%m/%Y, %H:%M") %></td> <!-- TODO changer en fonction de la localisation --> - <td> - <% if job.param %> - <%= job.param.truncate(30) %> - <% end %> - </td> - <td style="display: flex; justify-content: center"> - <%= button_to 'Abort', job_abort_path(job), remote: true, method: :post, data: { - confirm: "This will abort job #{job.id}\n\nAre you sure?" - }, class: 'btn btn-danger', style: "#{job.state=="RUNNING" ? '' : 'visibility: hidden'}" %> - - <%= button_to 'Destroy', job, remote: true, method: :delete, data: { - confirm: "This will permanently destroy job #{job.id}\n\nAre you sure?" - }, disabled: (job.state == "RUNNING" or job.state == "WAITING"), class: 'btn btn-danger' %></td> - </tr> - <% end %> - </tbody> - </table> - </div> - </div> -</div> -<script type="text/javascript"> -var rows=$(".table-hover tbody tr"); - -// make the whole <tr> clickable to reach the job -rows.click(function (e) { - - if(this.getAttribute("data-clicked")) { - // a link/button inside the row was clicked - // -> reset state and ignore - this.removeAttribute("data-clicked"); - } else { - // show the job - Turbolinks.visit($(this).find("a[data-main=1]").attr("href")); - } -}).hover(function () { - $(this).css('cursor','pointer'); -}); - -rows.find("a,form").click(function (e) { - // mark the row as clicked (so that the <tr> hook does not override it) - $(this).parentsUntil("tr").first().parent().attr("data-clicked", 1); -}); -</script> diff --git a/rails/app/views/jobs/index.json.jbuilder b/rails/app/views/jobs/index.json.jbuilder deleted file mode 100644 index 9930213ed2a64965300a85a0142277f6b6c0f7b7..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/index.json.jbuilder +++ /dev/null @@ -1,4 +0,0 @@ -json.array!(@jobs) do |job| - json.extract! job, :app, :datafile - json.url job_url(job, format: :json) -end diff --git a/rails/app/views/jobs/show.html.erb b/rails/app/views/jobs/show.html.erb deleted file mode 100644 index 499a221e396adf06b036fd0bafc686d0a2465bdc..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/show.html.erb +++ /dev/null @@ -1,152 +0,0 @@ - <% @page_title = "Job #{@job.id} " %> - <div class="container"> - <div class="row"> - <div class="col-md-12"> - <div class="panel panel-default"> - <div class="panel-heading">Job : <%= @job.id %></div> - <div class="panel-body"> - <% if @job.webapp.webapp_versions.empty? %> - <div class="alert alert-info">If the job don't produce the expected result, or stay "in progress" forever, - change your app with the ssh access and test again. <br /> - Do you render the files in the current directory ? - </div> - <% end %> - <div class="pull-left col-md-5"> - <h3>App: </h3><p class="lead"><%= link_to @job.webapp.name, @job.webapp %></p> - <h3>Version: </h3><%= @job.version %> <br /><br /> - <h3>Parameters: </h3><%= @job.param %> <br /><br /> - <h3>Status: </h3><span id="job_state"><%= @job.status %></span> <br /><br /> - <h3>Queue: </h3><%= @job.queue.name_with_timeout %> <br /><br /> - <span id="zip"> - <% if @job.state == "DONE" %> - <h3>Download zip: </h3> - <%= link_to "allgo_job_#{@job.id}.zip", - { controller: :jobs, action: :generate_zip } - %> - <% end %> - </span><br /><br /> - <% if (current_user && current_user.admin?) %> - <h3> Runned by: </h3> <%= @job.user.email %> - <h3> Exec time: </h3> <%= @job.exec_time.to_s+"s" if @job.exec_time %> - <% end %> - </div> - <div class="pull-right col-md-7"> - <div class="row"> - <div class="col-md-6"> - <% msg = case @job.state - when "NEW" - destroyable = true - "Job not yet submitted" - when "WAITING" - destroyable = true - "Job queued" - when "RUNNING" - destroyable = false - "Work in progress, estimated time #{@job.webapp.exec_time}s" - # FIXME: estimated should take in to account: - # - the elapsed time (since the job was started) - # - the waiting queue - when "ABORTING" - destroyable = false - "Abort in progress" - else - destroyable = true - nil - end %> - <% if msg %> - <p id="job_spinning"><i class="fa fa-cog fa-spin fa-5"></i> <%= msg %></p> - <%# TODO refresh automatically -> use a websocket ? %> - - <%= link_to job_path, class: "btn btn-primary" do %> - <span class="glyphicon glyphicon-refresh"></span> Refresh - <% end %> - <% end %> - </div> - <div class="col-md-6" style="display: flex; justify-content: flex-end;"> - <% if @job.state == "RUNNING" %> - <%= button_to 'Abort', job_abort_path(@job), remote: true, method: :post, data: { - confirm: "This will abort job #{@job.id}\n\nAre you sure?" - }, class: 'btn btn-danger' %> - - <% end %> - <%= button_to 'Destroy', @job, remote: true, method: :delete, data: { - confirm: "This will permanently destroy job #{@job.id}\n\nAre you sure?" - }, disabled: (not destroyable), class: 'btn btn-danger' %> - - <%= mail_to @job.webapp.contact , "Report a problem" , class: 'btn btn-info' , subject: "problem with app #{@job.webapp.name} , the job numer #{@job.id} failed" , body: "Hi ! \n \nI contact you regarding the following job : \n#{ job_url} \nThat has been subjected to errors . - - \n<<< your message here >>> - "%> - </div> - </div> - - <div id="job_content"> - <%= render partial: 'jobs/ajax/show_content' %> - </div> - </div> - </div> - </div> - </div> - </div> -</div> - -<% if @job.state != "DONE" %> - <script type="text/javascript"> -(function() { - if (document.documentElement.hasAttribute("data-turbolinks-preview")) { - return; - } - var state = { "interval": null, "ajax": null, "delay": 800 }; - - function start_timeout() - { - if (state.delay && state.interval == null) { - state.delay *= 1.2; // exponentional backoff - state.interval = setTimeout(on_timeout, state.delay); - } - } - - function on_timeout() { - state.interval = null; - if (state.ajax == null) - { - state.ajax = $.ajax({ - url: <%= job_path(@job).to_json.html_safe %>, - dataType: "json", - success: function(data) { - state.ajax = null; - if (state.delay) { - if (data.state == <%= @job.state.to_json.html_safe %>) { - start_timeout(); - } else { - Turbolinks.clearCache(); // to avoid flashing the previous page before refreshing - Turbolinks.visit(<%= job_path(@job).to_json.html_safe %>); - } - } - }, - error: start_timeout, - }); - } - } - // stop polling when leaving the page (this is necessary because turbolinks - // does not clear timers and XHRs when visiting another page) - function on_before_visit(ev) { - $(document).off("turbolinks:before-visit", on_before_visit); - state.delay = 0; - if(state.interval) { - clearInterval(state.interval); - state.interval = null; - } - if(state.ajax != null) { - state.ajax.abort(); - state.ajax = null; - } - } - $(document).on("turbolinks:before-visit", on_before_visit); - - // trigger first timeout - start_timeout(); - -})(); - </script> -<% end %> diff --git a/rails/app/views/jobs/show.json.jbuilder b/rails/app/views/jobs/show.json.jbuilder deleted file mode 100644 index a1a76fd2b3769146cf4f603804a004da31121c94..0000000000000000000000000000000000000000 --- a/rails/app/views/jobs/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.extract! @job, :app, :datafile, :created_at, :updated_at diff --git a/rails/app/views/layouts/_footer.html.erb b/rails/app/views/layouts/_footer.html.erb deleted file mode 100644 index c95c448324515b6c462cb3f687ce80b6f2af86da..0000000000000000000000000000000000000000 --- a/rails/app/views/layouts/_footer.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<div class="container footer-space"> - -</div> -<footer class="footer"> - <div class="container"> - <div class="col-md-4 credits"> - <%#FIXME should have links too%> - <img class="img-responsive" src="<%= asset_path('credit.png') %>" alt="inria"> - </div> - <div class="col-md-8"> - <p class="credit pull-right"> - <a href="https://wiki.inria.fr/sed_ren/">SED</a> - <a href="http://www.irisa.fr/">IRISA</a> / - <a href="http://www.inria.fr/centre/rennes">INRIA</a>, - <%= Time.now.year %><br /> - </p> - </div> - </div> -</footer> diff --git a/rails/app/views/layouts/_navbar.html.erb b/rails/app/views/layouts/_navbar.html.erb deleted file mode 100644 index eb38a2170d0892075774ce14368a39b5550802a3..0000000000000000000000000000000000000000 --- a/rails/app/views/layouts/_navbar.html.erb +++ /dev/null @@ -1,103 +0,0 @@ -<nav class="navbar navbar-inverse navbar-fixed-top"> - <div class="container"> - <div> - <% - # function generating a button in the navigation bar, with: - # - a glyphicon and a tooltip (in devices given by 'hide') - # - a glyphicon and a text (in other configuration) - def nav_button (glyph, text, hide=[]) - if hide.empty? - raw "<span class='glyphicon #{glyph}'></span> #{h text}</span>" - else - raw(" - <span class='#{hide.map{|x| "visible-#{x}-inline"}.join " "} glyphicon #{glyph}' - data-toggle='tooltip' data-placement='bottom' #{raw "title='#{text}'"}></span> - <span class='#{hide.map{|x| "hidden-#{x}"}.join " "}'><span class='glyphicon #{glyph}'></span> #{h text}</span> - ") - end - end - %> - <ul class="nav navbar-nav"> - <li class="hidden-md hidden-sm hidden-xs"> - <a class="navbar-brand brand" href="/">A||GO</a> - </li> - <li> - <%= link_to nav_button("glyphicon-cloud", "Apps", ["xs"]), apps_path %> - </li> - <% if user_signed_in? %> - <li> - <%= link_to nav_button("glyphicon-tasks", "My Jobs", ["xs"]), jobs_path %> - </li> - <% end %> - <% if user_signed_in? && User.valid_email(current_user.email) %> <!-- ajout d'app que pour inria/irisa --> - <li> - <%= link_to nav_button("glyphicon-cloud-upload", "Add an app", ["xs", "sm"]), new_webapp_path %> - </li> - <li> - <%= link_to nav_button("glyphicon-stats", "My apps", ["xs"]), show_apps_user_path %> - </li> - <li> - <%= link_to nav_button("glyphicon-save", "My datasets", ["xs", "sm", "md"]), new_dataset_path %> - </li> - <% if current_user.admin? %> - <li> - <%= link_to nav_button("glyphicon-eye-open", "Admin", ["xs", "sm", "md"]), admin_dashboard_path %> - </li> - <% end %> - <% end %> - <li> - <a href="/documentation/about"><%= nav_button "glyphicon-info-sign", "Doc", ["xs", "sm"] %></a> - </li> - - <% if user_signed_in? %> - <li class="dropdown"> - <%# the hepldesk is accessible only by inria users %> - <% if User.valid_email(current_user.email) %> - <a data-toggle="dropdown" role="button" aria-expanded="false"> - <%= nav_button "glyphicon-question-sign", "Help", ["xs", "sm"] %> - </a> - <ul class="dropdown-menu"> - <% Rails.configuration.helpdesk_links.each do|text, url| %> - <li> <a href="<%= url %>"><%= text %></a></li> - <%end%> - </ul> - <% end %> - </li> - <li> - - <%= link_to image_tag(avatar_url(current_user.email), alt: '', title: '', size: "30x30", class: "avatar"), edit_user_registration_path, class: "link-avatar" %> - </li> - <li class="dropdown"> - <a data-toggle="dropdown" role="button" aria-expanded="false"><i class="glyphicon glyphicon-menu-down"></i></a> - <ul class="dropdown-menu dropdown-menu-right" role="menu" id="user-options"> - <li> - <%= link_to 'My account', edit_user_registration_path %> - </li> - <li> - <%= link_to 'Quotas of my apps', quotas_path %> - </li> - <li> - <%= link_to 'Logout', destroy_user_session_path, method: "delete" %> - </li> - </ul> - </li> - <% else %> - <li class="dropdown"> - <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="glyphicon glyphicon-user"></i> Log In</a> - <ul class="dropdown-menu" role="menu" style="padding: 15px;"> - <%= form_for("user", url: user_session_path) do |f| %> - <%= f.email_field :email, class: "form-control", placeholder: "Email address" %> - <%= f.password_field :password, class: "form-control", placeholder: "Password" %> - <%= f.submit "Login", class: "btn btn-success btn-block" %> - <% end %> - <span style="padding-left: 27px;"><%= link_to 'Forgot your password?', '/users/password/new' %></span> - </ul> - </li> - <li> - <%= link_to "<i class=\"glyphicon glyphicon-glyphicon glyphicon-pencil\"></i> Sign Up".html_safe, new_user_registration_path %> - </li> - <% end %> - </ul> - </div> - </div> -</nav> diff --git a/rails/app/views/layouts/_watermark.html.erb b/rails/app/views/layouts/_watermark.html.erb deleted file mode 100644 index a40e73c4743d5d1f94fa3a724a89748af0ba362f..0000000000000000000000000000000000000000 --- a/rails/app/views/layouts/_watermark.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%# display a watermark in qualif/dev environments %> -<% if Rails.configuration.short_env != "prod" %> - <div style=" - position: fixed; - opacity: .25; - color: red; - font-size: 3em; - z-index: -10000; - word-spacing: 2em; - line-height: 3em; - font-weight: bold; - left: -50%; - width: 150%; - transform: rotate(330deg); - transform-origin: 0% 0%; - "> - <%= (Rails.configuration.short_env + " ") * 300 %> - </div> -<% end %> diff --git a/rails/app/views/layouts/admin.html.erb b/rails/app/views/layouts/admin.html.erb deleted file mode 100644 index 95589c58e02ba09a6586bff01f99d65f46829181..0000000000000000000000000000000000000000 --- a/rails/app/views/layouts/admin.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title>A||GO | admin</title> - <%= csrf_meta_tags %> - <!-- #action_cable_meta_tag %> --> - - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - </head> - <body> - <%= render partial: 'layouts/watermark' %> - <%= render partial: 'layouts/navbar' %> - <div class="container" id="flash-alert"> - <% flash.each do |key, value| %> - <div class="alert alert-<%= key %>" role="alert"><%= value %></div> - <% end %> - </div> - - <div class="container"> - <ul class="nav nav-tabs"> - <li role="presentation" class="tab"> <%= link_to 'Dashboard', admin_dashboard_path %> </li> - <li role="presentation" class="tab"> <%= link_to 'Registry state', admin_registry_index_path %></li> - <li role="presentation" class="tab"> <%= link_to 'Statistics', admin_statistics_path %></li> - <li role="presentation" class="tab"> <%= link_to 'Sidekiq logs', admin_logs_sidekiq_path %></li> - <li role="presentation" class="tab"> <%= link_to 'Error logs', admin_logs_error_path %></li> - <li role="presentation" class="tab"> <%= link_to 'Webapps', admin_webapps_path %></li> - <li role="presentation" class="tab"><a href="#">Kibana</a></li> - </ul> - - <%= yield %> - </div> - <%= render partial: 'layouts/footer' %> - - </body> -</html> diff --git a/rails/app/views/layouts/application.html.erb b/rails/app/views/layouts/application.html.erb deleted file mode 100644 index 622a3919b638be5f6b17ba445715181f1eb4a580..0000000000000000000000000000000000000000 --- a/rails/app/views/layouts/application.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title>A||GO | <%= @page_title || nil %> </title> - <%= csrf_meta_tags %> - <!-- #action_cable_meta_tag %> --> - - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> - <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> - <meta name="keywords" content="allgo, a||go, scientific applications as a service, science, inria, irisa, research, deploy app, platform, api" /> - <meta name="description" content="allgo allow you to use console applications made by research team, online." /> - <meta name="viewport" content="width=device-width, initial-scale=1"> - - </head> - <body> - <%= render partial: 'layouts/watermark' %> - <%= render partial: 'layouts/navbar' %> - <div class="container" id="flash-alert"> - <% flash.each do |key, value| %> - <div class="alert alert-<%= key %>" role="alert"><%= value %></div> - <% end %> - </div> - <%= yield %> - <%= render partial: 'layouts/footer' %> - </body> -</html> diff --git a/rails/app/views/quotas/index.html.erb b/rails/app/views/quotas/index.html.erb deleted file mode 100644 index 9f31e8ad30265cd4f21811c1ef88345eb7981ab6..0000000000000000000000000000000000000000 --- a/rails/app/views/quotas/index.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -<!-- vue listant tous les quotas de l'utilisateur--> -<%= render 'users/menu' %> - <% @page_title = "My quotas" %> -<div class="container"> - <h2>My quotas</h2> - <br /> - - <% @quotas.each do |q| %> - <div class="container"> - <div class="row"> - <div class="col-md-2"> - <% cal = (100*q.quantity/q.webapp.default_quota) %> <!-- TODO changer la méthode de calcul --> - <strong class="lead"><%= link_to q.webapp.name.capitalize, q.webapp %></strong> - </div> - <div class="col-md-3"> - <div class="progress"> - <div class="progress-bar" role="progressbar" aria-valuenow="<%= cal %>" aria-valuemin="0" aria-valuemax="100" style="width: <%= cal %>%" > - <%= q.quantity.to_s(:human_size) %> left - </div> - </div> - </div> - </div> - </div> - <% end %> -</div> diff --git a/rails/app/views/quotas/show.html.erb b/rails/app/views/quotas/show.html.erb deleted file mode 100644 index cd8ace5cc9a2f9eb2206b8f030e2c77c2b5a6774..0000000000000000000000000000000000000000 --- a/rails/app/views/quotas/show.html.erb +++ /dev/null @@ -1 +0,0 @@ -<% @page_title = "Quotas"%> \ No newline at end of file diff --git a/rails/app/views/users/_app_connection.html.erb b/rails/app/views/users/_app_connection.html.erb deleted file mode 100644 index 0f981b41c4537c24ac51ca8eb34d9ac94347c695..0000000000000000000000000000000000000000 --- a/rails/app/views/users/_app_connection.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<!-- render in users/show_apps or ajax call in users/show_apps --> -<!-- call to display information connection when a user create an app --> -<p class="lead"> - To install your app, connect with your terminal in ssh at :<br /> - <strong><%= @webapp.ssh_connect_string %></strong> - <br /><br /> - When you have done, <br /> - Commit your work and you'll be able to test your app in A||go : - <%= link_to "go to the commit form", webapp_path(@webapp, anchor: "commit_form"), class: 'btn btn-primary'%> <br /><br /> -</p> diff --git a/rails/app/views/users/_menu.html.erb b/rails/app/views/users/_menu.html.erb deleted file mode 100644 index 15dcc8c40c93fc37c22e502157f5dc5fcbadc276..0000000000000000000000000000000000000000 --- a/rails/app/views/users/_menu.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<div class="container"> - <ul class="nav nav-tabs"> - <li role="presentation" class="tab" id ="quotas"><%= link_to "Quotas of my apps", quotas_path %></li> - <li role="presentation" class="tab" id ="edit"><%= link_to "My account", edit_user_registration_path %></li> - <li role="presentation" class="tab" id ="myapps"> - <%= link_to "Waiting apps", show_apps_user_path if User.valid_email(current_user.email) %> - </li> - <% unless current_user.user_apps.nil? %> - <% current_user.user_apps.each do |wu| %> - <li role="presentation" class="tab" id ="stat_<%=wu.docker_name%>"><%= link_to "#{wu.name}", webapp_statistics_path(wu.id) %></li> - <% end %> - <% end %> - </ul> -</div> - <br /> - -<script type="text/javascript"> -$(".tab").map(function() { - if (window.location.pathname.indexOf(this.id) >= 0) { - $(this).attr('class', 'active'); - } -}); -</script> diff --git a/rails/app/views/users/destroy.html.erb b/rails/app/views/users/destroy.html.erb deleted file mode 100644 index 31f8ccce9ba6757f2d509591a8da85f860f87381..0000000000000000000000000000000000000000 --- a/rails/app/views/users/destroy.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% @page_title = "Cancel your account"%> -<%= render 'menu' %> -<h3>Cancel my account</h3> - -<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p> \ No newline at end of file diff --git a/rails/app/views/users/show_apps.html.erb b/rails/app/views/users/show_apps.html.erb deleted file mode 100644 index 4442465fde8f23b0973fcdd8ec4129312cc71d93..0000000000000000000000000000000000000000 --- a/rails/app/views/users/show_apps.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<%= render 'users/menu' %> -<div class="container"> -<% @page_title = "My apps"%> -<% if @webapps_waiting.empty? %> - <p class="lead"> No app waiting, to add one : <%= link_to 'Add my app'.html_safe, new_webapp_path %> </p> -<% else %> - <% w = @webapps_waiting.first %> - <div class="panel panel-info "> - <div class="panel-heading"> - <h2 class="panel-title brand-ns">Apps waiting to be completed</h2> - </div> - <div class="panel-body"> - <ul class="lead"> - <% @webapps_waiting.each do |webapp| %> - <li><%= link_to webapp.name, webapp %></li> - <% end %> - </ul> - </div> - </div> -<% end %> -</div> diff --git a/rails/app/views/webapp_demos/show.html.erb b/rails/app/views/webapp_demos/show.html.erb deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/app/views/webapp_parameters/_form.html.erb b/rails/app/views/webapp_parameters/_form.html.erb deleted file mode 100644 index ddd313fd533a44420e5772d4d8aa0121874ffcd0..0000000000000000000000000000000000000000 --- a/rails/app/views/webapp_parameters/_form.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - <%= f.fields_for :webapp_parameters, html: {class: 'form-horizontal'} do |wp| %> - <h4> Enter new pre-set : </h4> - <%= wp.label :name, class: "control-label" %> - <%= wp.text_field :name, class: "form-control" %> - <br /> - <%= wp.label :value, "Value: (an example of input parameters like : -p 2000 -L french)", class: "control-label" %> - <%= wp.text_field :value, class: "form-control" %> - <br /> - <%= wp.label :detail, "Detail: (what this parameters line will do):", class: "control-label" %> - <%= wp.text_field :detail, class: "form-control" %> - <br /> - <% end %> diff --git a/rails/app/views/webapp_parameters/_webapp_parameter.html.erb b/rails/app/views/webapp_parameters/_webapp_parameter.html.erb deleted file mode 100644 index aa5521a57eb96e43b4ca9d335f0836c11fa5ca5d..0000000000000000000000000000000000000000 --- a/rails/app/views/webapp_parameters/_webapp_parameter.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<% if not webapp_parameter.detail.blank? %> -<p> - <i class="fa fa-code fa-4"></i> - <a class="param lead" href="javascript:void(0)" data-value="<%= webapp_parameter.value %>"><%= webapp_parameter.detail %></a> : - <span class="param_value lead"><%= webapp_parameter.value %></span> - <script type="text/javascript"> -<%# attach callback to each webapp_parameter to copy it into the job form %> -$("a.param").click(function(ev) { - $("#text_param").val($(ev.target).attr("data-value")) -}); - </script> -</p> -<% end %> diff --git a/rails/app/views/webapps/_api/_display_curl.html.erb b/rails/app/views/webapps/_api/_display_curl.html.erb deleted file mode 100644 index f50e52f77c97e01d7a418145c7fdaa1f31c84a84..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_api/_display_curl.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - <div class="display curl" style="display:none"> - <p> - Download the following script <a href="/script/<%= @webapp.docker_name %>.sh" class="btn btn-success btn-sm" > <%= @webapp.docker_name %>.sh</a> - </p> - <p> - Then call it like this : - </p> - <p> - <pre><%= @webapp.docker_name %>.sh username passwd input_dir outpud_dir</pre> - </p> - </div> diff --git a/rails/app/views/webapps/_api/_display_http.html.erb b/rails/app/views/webapps/_api/_display_http.html.erb deleted file mode 100644 index d8ccb0652d3c15525a54764d4b6376e20dc2b468..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_api/_display_http.html.erb +++ /dev/null @@ -1,24 +0,0 @@ -<div class="display http"> -<h4>How to use our REST API : </h4> -<span class="help-block">Think to check your private token in your account first.</span class="help-block"> - <span class="help-block">You can find more detail in our documentation tab.</span class="help-block"> -<p class="lead"> This app id is : <%= @webapp.id %> </p> -<p class="lead">This curl command will create a job, and return your job url, and also the average execution time</p> -<span class="help-block">files and/or dataset are optionnal, think to remove them if not wanted</span class="help-block"> -<pre><%=" -curl -H 'Authorization: Token token=<your_private_token>' -X POST --F job[webapp_id]=#{@webapp.id} --F job[param]=\"\" --F job[queue]=standard --F files[0]=@test.txt --F files[1]=@test2.csv --F job[file_url]=<my_file_url> --F job[dataset]=<my_dataset_name> #{api_v1_jobs_url} -"%></pre> - -<br /> -<p class="lead">Then, check your job to get the url files with :</p> -<pre> -<%="curl -H 'Authorization: Token token=<your_private_token>' -X GET #{api_v1_job_url(id: "ID").gsub("ID", "<job_id>")}"%> -</pre> -</div> diff --git a/rails/app/views/webapps/_api/_display_python.erb b/rails/app/views/webapps/_api/_display_python.erb deleted file mode 100644 index de315ea68066e3d7fb116e9b7e751a8c2992ab5b..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_api/_display_python.erb +++ /dev/null @@ -1,5 +0,0 @@ - <div class="display python" style="display:none"> - <p> - <div class="alert alert-warning">Work in progress</div> - </p> - </div> \ No newline at end of file diff --git a/rails/app/views/webapps/_api/_display_ruby.html.erb b/rails/app/views/webapps/_api/_display_ruby.html.erb deleted file mode 100644 index 1ff15e30b0f91bae113f340bf9e40c74a653b38d..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_api/_display_ruby.html.erb +++ /dev/null @@ -1,5 +0,0 @@ - <div class="display ruby" style="display:none"> - <p> - <div class="alert alert-warning">Work in progress</div> - </p> - </div> \ No newline at end of file diff --git a/rails/app/views/webapps/_bottom_panel/_privacy.html.erb b/rails/app/views/webapps/_bottom_panel/_privacy.html.erb deleted file mode 100644 index d117c21d1c9a46a0161caea97a78a022500c0e16..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_bottom_panel/_privacy.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<p class="lead"> Share your private app with this link : <br /> -<%= # FIXME: should use app_url but it's broken - link_to webapp_url(@webapp, access_token: @webapp.access_token) %> -<br /> -For the moment, it still requires an allgo account to be used.</p> diff --git a/rails/app/views/webapps/_bottom_panel/_short_statistics.html.erb b/rails/app/views/webapps/_bottom_panel/_short_statistics.html.erb deleted file mode 100644 index e690f88abab6cdd65187935aa6ef179af9776092..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_bottom_panel/_short_statistics.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<p class="lead"> Statistics about your app:</p> -<ul> - <li> - Total jobs : <%= @webapp_jobs.count %> - </li> - <li> - Number of users : <%= @webapp_jobs.all.distinct.count(:user_id) %> - </li> - <li> - Average file weight : <%= (@webapp_jobs.sum(:datasize).to_i / @webapp_jobs.count(:datasize).to_i).to_s(:human_size) if @webapp_jobs.count(:datasize).to_i > 0 %> - </li> - <li> - Last use : <%= - lu = @webapp_jobs.last - if lu - lu.created_at.strftime("%d/%m/%Y") - end - %> - </li> - <li> - Average execution time : <%= @webapp.exec_time %>s - </li> - <!-- - <li> - - error reported : feature is coming - </li>--> -</ul> diff --git a/rails/app/views/webapps/_bottom_panel/_show_demo_files.html.erb b/rails/app/views/webapps/_bottom_panel/_show_demo_files.html.erb deleted file mode 100644 index 905b6f3e90412191778917f5abbef4cc5df745de..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_bottom_panel/_show_demo_files.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<p class="lead"><u> In input : </u></p> -<div> - <% @webapp.webapp_demos.where(file_type: "input").each do |wd| %> - <%= link_to File.basename(wd.name), - "#{Rails.configuration.root_url}/app/#{@webapp.docker_name}/demo/input/#{wd.name}" %> - <br /> - <pre><%= allgo_display("#{Rails.configuration.root_url}/app/#{@webapp.docker_name}/demo/input", - "#{wd.name}","public/app/#{@webapp.docker_name}/demo/input") %></pre> - <br /><br /> - <% end %> -</div> -<br /> -<p class="lead"><u> In output : </u></p> -<div> - <% @webapp.webapp_demos.where(file_type: "output").each do |wd| %> - <%= link_to File.basename(wd.name), - "#{Rails.configuration.root_url}/app/#{@webapp.docker_name}/demo/output/#{wd.name}" %> - <br /> - <pre><%= allgo_display("#{Rails.configuration.root_url}/app/#{@webapp.docker_name}/demo/output", - "#{wd.name}","public/app/#{@webapp.docker_name}/demo/output") %></pre> - <% end %> -</div> diff --git a/rails/app/views/webapps/_bottom_panel/_version_listing.html.erb b/rails/app/views/webapps/_bottom_panel/_version_listing.html.erb deleted file mode 100644 index 13671f366cb0793c3ed74b451b42f362909b46ee..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_bottom_panel/_version_listing.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<% if @webapp.webapp_versions.ready %> - <p class="lead"> - <% @webapp.webapp_versions.ready.each do|v| %> - <%= v.updated_at.strftime("%d/%m/%Y") %> : Version <b><%= v.number %></b>, <%= v.changelog %> - <br /> - <% end %> - </p> -<% end %> diff --git a/rails/app/views/webapps/_form.html.erb b/rails/app/views/webapps/_form.html.erb deleted file mode 100644 index 58db1d860af198723ac9b03505861dde2ccfb024..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_form.html.erb +++ /dev/null @@ -1,143 +0,0 @@ -<% if @webapp.errors.any? %> - <div id="error_explanation"> - <h2><%= pluralize(@webapp.errors.count, "error") %> prohibited this webapp from being saved:</h2> - <ul> - <% @webapp.errors.full_messages.each do |msg| %> - <li><%= msg %></li> - <% end %> - </ul> - </div> -<% end %> -<%= - # FIXME: with "remote: true" the form is posted twice (there is some dirty javascript fooling around) - form_for(@webapp, authenticity_token: true, html: {class: 'form-horizontal', multipart: true}) do |f| %> - <div class="form-group"> - <%= f.label :name, "Name * ", class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.text_field :name, required: true, class: "form-control" %></div> - <!-- TODO: @book.errors[:title].first --> - </div> - <div class="form-group"> - <%= f.label :description, class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.text_area :description, rows: "5", class: "form-control" %></div> - </div> - - <div class="form-group"> - <%= f.label :logo, class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.file_field :logo, class: "form-control" %></div> - </div> - - <div class="form-group"> - <%= f.label :contact, class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.email_field :contact, class: "form-control", required: true %></div> - </div> - - <div class="form-group"> - <%= f.label :entrypoint, class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.text_field :entrypoint, :size=>"50", placeholder: "/home/allgo/<your_app_name>" , class: "form-control" %></div> - <span class="help-block">Which file will we have to launch? <br />If empty it will be /home/allgo/< your_app_name >.sh </span> - </div> - - <div class="form-group"> - <%= f.label :default_queue, class: "col-sm-2 control-label" %> - <div class="col-sm-4"><%= f.collection_select :default_job_queue_id, JobQueue.all, :id, :name_with_timeout, {}, {class: "form-control"} %></div> - <span class="help-block"></span> - </div> - - <div class="form-group"> - <%= f.label :tag_list, "Tags, separated by commas", class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.text_field :tag_list, class: "form-control", - # NOTE bug in acts-as-taggable-on: https://github.com/mbleigh/acts-as-taggable-on/issues/750 - # -> must provide the value explicitely or the tags will be separated by spaces instead of commas - value: @webapp.tag_list.to_s - %></div> - </div> - - <div class="form-group"> - <%= f.label :access_token, "Private mode", class: "col-sm-2 control-label" %> - <div class="btn-group col-sm-5" data-toggle="buttons"> - <label class="btn btn-default active"> - <input type="radio" name="webapp[private]" id="no" value=0 checked> No - </label> - <label class="btn btn-default"> - <input type="radio" name="webapp[private]" id="yes" value=1> Yes - </label> - </div> - <span class="help-block"> A private app won't be display on the main page, and won't be accessible without the link. </span> - </div> - - <div class="form-group"> - <%= f.label :access_token, "Memory limit", class: "col-sm-2 control-label" %> - <div class="col-sm-1"><%= text_field_tag :memory_limit_mb, @memory_limit_mb, {placeholder: "no limit", class: "form-control", style: "text-align: right", disabled: !current_user.admin?} %></div> - - <span class="help-block"> megabytes</span> - </div> - - <!-- <div class="form-group"> - <%= f.label :default_quota, "Quota per user (in MB) ", class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.text_field :default_quota, value: "50", class: "form-control" %></div> - <span class="help-block">Data for input by user for your app? (50MB => A user can run 50 times your app with a 1MB file) </span> - </div> --> - - <!-- nom de l'os, on affiche un bouton pour chaque docker_os_name --> - <div class="form-group choose_name"> - <% if not @webapp.docker_os_id? %> <!-- if not edit mode, app has no docker_os yet --> - <%= f.label :docker_os_display_name, "Choose your OS ", class: "col-sm-2 control-label" %> - <div class="col-sm-5"> - <% @dockeros_name.each do |don| %> - <%= button_tag(type: 'button', class: "btn btn-info dockeros_n", value: don.name) do %> - <%= don.name.capitalize %> - <% end %> - <% end %> - <span class="help-block">Default OS is <%= @default_os.name %> <%= @default_os.version %></span> - </div> - <% end %> - </div> - - <!-- version de l'os --> - <% if !@webapp.persisted? %> - <div class="form-group choose_version" style="visibility:hidden;"> - <%= f.label :docker_os_display_version, "Choose your version ", class: "col-sm-2 control-label" %> - <div class="col-sm-5"> - <% @dockeros.each do |dos| %> - <%= button_tag(type: 'button', class: "btn btn-info #{dos.name} dockeros_v", value: dos.id, style:"display:none;") do %> - <%= dos.version.to_s %> - <% end %> - <% end %> - </div> - </div> - <%= f.hidden_field :docker_os_id %> - - <!-- test: add a zip or file that we will add in the container --> - <!-- <div class="form-group"> - <%= f.label :source_file, "Upload your code or a script ", class: "col-sm-2 control-label" %> - <div class="col-sm-5"><%= f.file_field :source_file, class: "form-control" %></div> - </div> --> - <% end %> - - <div class="actions"> - <div class="col-sm-offset-2 col-sm-10" style="padding-left: 0"> - <%= f.submit (@webapp.id ? 'Update your app' : 'Create your app'), class: 'btn btn-success' %> - </div> - </div> -<% end %> - -<script type="text/javascript"> - $('.dockeros_n').click(function(){ - $('.dockeros_n').attr('class', 'btn btn-info dockeros_n'); - $(this).attr('class', 'btn btn-success dockeros_n'); - $('.choose_version').css('visibility','visible'); - $('.dockeros_v').css('display','none'); - $('.'+this.value).css('display','inline'); - // $('#webapp_docker_os_id_name').attr('value',this.value); - }); - $('.dockeros_v').click(function(){ - $('.dockeros_v').addClass('btn-info').removeClass('btn-success'); - $(this).addClass('btn-success').removeClass('btn-info'); - //$('webapp_docker_os_id_version').attr('value',this.value) - $('#webapp_docker_os_id').attr('value',this.value); - $('#submit_button').attr('disabled',false); - }); - - - -</script> diff --git a/rails/app/views/webapps/_form_edit.html.erb b/rails/app/views/webapps/_form_edit.html.erb deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/app/views/webapps/_form_second.html.erb b/rails/app/views/webapps/_form_second.html.erb deleted file mode 100644 index 495ca2c29ab63b30349d7532e484b30513c84c44..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_form_second.html.erb +++ /dev/null @@ -1,77 +0,0 @@ -<!-- TODO : split in different view --> -<% if not @webapp_waiting.blank? %> - <% @webapp = @webapp_waiting %> -<% end %> -<div class="row"> - <%= form_for @webapp do |f| %> - <div class="form-group"> - <label>Add a Readme file (Supporting <a target="_blank" href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet">Mardown</a> syntax) :</label> - <%= f.file_field :readme, class: "form-control" %> - <% if @webapp.readme %> - <span class="help-block">You already uploaded a Readme file. </span> - <% end %> - </div> - <%= f.hidden_field :from_showapps, class: "form-control", value: "1" %> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %>Submit<% end %> - <% end %> -</div> - -<br /> - -<div class="row"> - <%= form_for @webapp do |f| %> - <div class="form-group"> - <label>Input demo file(s), what your app takes as input</label> - <%= f.file_field :input_demo, class: "form-control" %> - <div> - Your input demo files : <br /> - <% @webapp.webapp_demos.where(file_type: "input").each do |w| %> - <%= w.name %> <%= link_to 'Destroy ?', w, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> <br /> - <% end %> - </div> - </div> - <div class="form-group"> - <label>Output demo files, what your app generates :</label> - <%= f.file_field :output_demo, class: "form-control" %> - <div> - Your output demo files : <br /> - <% @webapp.webapp_demos.where(file_type: "output").each do |w| %> - <%= w.name %> <%= link_to 'Destroy ?', w, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %> <br /> - <% end %> - </div> - </div> - <%= f.hidden_field :update_demos, class: "form-control", value: true %> - <%= f.hidden_field :from_showapps, class: "form-control", value: "1" %> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %>Submit<% end %> - <% end %> -</div> - - <br /> - - <!-- <div class="row"> - <%= form_for @webapp do |f| %> - <label>Pre-set parameters are example lines of parameters for your app users</label> - <%= f.fields_for :webapp_parameters do |wp| %> - - <%= render partial: 'webapp_parameters/form', locals: {f: f} %> - <label> Value, an example of input parameters like : "-p 2000 -L french"</label> - <%= wp.text_field :value, class: "form-control" %> - <label>Detail ( What this line will do) :" - <%= wp.text_field :detail, class: "form-control" %> - <%= f.hidden_field :update_parameters, class: "form-control", value: "1" %> - <%= f.hidden_field :from_showapps, class: "form-control", value: "1" %> - <br /> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %>Submit<% end %> - <br /> - <% end %> - <% end %> - </div> --> - -<!-- <script type="text/javascript"> -// $("a").click(function(){ -// if($(this).next('div').css('display') == 'none') -// $(this).next('div').show(300); -// else -// $(this).next('div').hide(); -// }); - </script> --> diff --git a/rails/app/views/webapps/_partial/_app_share.html.erb b/rails/app/views/webapps/_partial/_app_share.html.erb deleted file mode 100644 index 15f2be7bbf5a07e44a5c1e1c4c81385455ca47f8..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_partial/_app_share.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<h3> - <% if @webapp.private %> - <p class="lead"> Your app is private, people can only access it with this link.</p> - - <% end %> - -</h3> diff --git a/rails/app/views/webapps/_sandbox_panel.html.erb b/rails/app/views/webapps/_sandbox_panel.html.erb deleted file mode 100644 index 902d786af922a88b667848d590039f3ad20212da..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_sandbox_panel.html.erb +++ /dev/null @@ -1,334 +0,0 @@ - -<% if @webapp - if defined? webapp - raise "must provide either webapp or @webapp but not both" - end - webapp = @webapp -end %> - -<% if webapp.administrable_by? current_user %> - - <%# js snippet to poll the webapp state until its sandbox_state changes %> - <% def poll_sandbox_state(webapp) %> - <script type="text/javascript"> - (function() { - var state = { "interval": 800 }; - - function start_timeout() - { - if (state.interval) { - state.interval *= 1.2; // exponentional backoff - setTimeout(on_timeout, state.interval); - } - } - - function on_timeout() { - $.ajax({ - url: <%= webapp_path(webapp).to_json.html_safe %>, - dataType: "json", - success: function(data) { - if (state.interval) { - if (data.sandbox_state == <%= webapp.sandbox_state.to_json.html_safe %>) { - start_timeout(); - } else { - Turbolinks.clearCache(); // to avoid flashing the previous page before refreshing - Turbolinks.visit(<%= webapp_path(webapp).to_json.html_safe %>); - } - } - }, - error: start_timeout, - }); - } - - // stop polling when leaving the page (this is necessary because turbolinks - // does not clear timers and XHRs when visiting another page) - function on_before_visit(ev) { - $(document).off("turbolinks:before-visit", on_before_visit); - state.interval = 0; - } - $(document).on("turbolinks:before-visit", on_before_visit); - - // trigger first timeout - start_timeout(); - - })(); - </script> - <% end %> - - <% def app_info(title) %> - <div class="app-info" style="padding:10px;"> - <h4><%= title %></h4> - <% yield %> - </div> - <% end %> - - <%case webapp.sandbox_state %> - <% when "STARTING" %> - <%##################### sandbox starting ###############################%> - <%# TODO show documentation (if no versions)%> - <% app_info "Your sandbox is starting" do %> - <p class="lead"> - <i class="fa fa-cog fa-spin"></i><br/> - It will soon be accessible soon with the following command <span class="small">(use the <a href="https://vpn.inria.fr/" target="_blank">VPN</a> if you are located outside INRIA)</span><br/> - <strong style="margin: 1em;"><i><%= webapp.ssh_connect_string %></i></strong> <br /> - <%= link_to sandbox_abort_path(webapp), method: :post, remote: true, class: "btn btn-danger" do %> - <span class="glyphicon glyphicon-remove"></span> Abort - <% end %> - </p> - <% poll_sandbox_state webapp %> - <% end %> - - <% when "START_ERROR"%> - <%##################### start error ####################################%> - <% app_info "Your sandbox failed to start" do %> - - <%= link_to sandbox_retry_path(webapp), method: :post, remote: true, class: "btn btn-primary" do %> - <span class="glyphicon glyphicon-repeat"></span> Retry - <% end %> - <%= link_to sandbox_abort_path(webapp), method: :post, remote: true, class: "btn btn-danger" do %> - <span class="glyphicon glyphicon-remove"></span> Abort - <% end %> - <% end %> - - <% when "RUNNING" %> - <%##################### sandbox running ################################%> - <%# the sandbox is running - # TODO alt: show essential infos (entrypoint) in ssh - # TODO add "Save draft" %> - <% app_info "Your sandbox is running#{ - webapp.sandbox_version ? " (version #{webapp.sandbox_version.number})" : "" - }" do %> - <p class="lead"> - The sandbox is accessible with the following command <span class="small">(use the <a href="https://vpn.inria.fr/" target="_blank">VPN</a> if you are located outside INRIA)</span><br/> - <strong style="margin: 1em;"><%= webapp.ssh_connect_string %></strong> <br /> - </p> - <!-- to be displayed in the shell - <p> - The entrypoint of your app is <strong><%= webapp.entrypoint %></strong>, - this is the command executed when running a job. - </p> - --> - - <%# display a detailed documentation if it the first time the sandbox is running %> - <% if webapp.webapp_versions.empty? %> - <h4>Next steps</h4> - <ol class="lead"> - <li>install the application inside the sandbox</li> - <li>provide the entrypoint: <tt><%= webapp.entrypoint %></tt></li> - <li>test your application using the <a href="#job_form">job creation form just below</a></li> - <li>when finished, <a href="#commit_form">commit an image</a> of the sandbox and the app will be online</li> - </ol> - <% else %> - <p class="lead">Your can test your app with the job creation form just - below. When ready, commit an image to make the application available on - allgo.</p> - <% end %> - </div> - <% if webapp.webapp_versions.empty? %> - <div style="padding:10px;"> - <%= render partial: "documentation/entrypoint_example" %> - </div> - <% end %> - - <div class="jumptarget" id="commit_form"></div> - <div class="app-info" style="padding:10px;"> - <% if webapp.webapp_versions.empty? %> - <h4>Commit</h4> - <p>When the app is ready, make a commit and the app will be online</p> - <% end %> - - <%= form_for(webapp, validate: true, method: "post", remote: true, url: sandbox_commit_path(webapp), html: {class: 'form-horizontal'}) do |f| %> - <%= f.fields_for :webapp_versions, webapp.webapp_versions.build, html: {class: 'form-horizontal'} do |wv| %> - - <!-- Version --> - <div class="form-group"> - <%= wv.label nil, "Version: *", class: "control-label col-md-2 col-sm-2" %> - <div class="col-sm-5 col-md-4 col-lg-3" id="radio_version"> - <label class="radio-inline"><input type="radio" name="version_action" value="replace">replace version</label> - <label class="radio-inline"><input type="radio" name="version_action" value="create">create new version</label> - </div> - <div class="col-sm-4 col-md-3 col-lg-2"> - <%# input control for creating a new version %> - <div id="create_version"> - <%= wv.text_field :number, required:true, class: "form-control" %> - </div> - <div id="replace_version"> - <%= - - opt = options_from_collection_for_select( - sort_webapp_versions(webapp.webapp_versions.usable.group(:number)), :number, :number, - selected: (webapp.sandbox_version && webapp.sandbox_version.number) - ) - select_tag :number_replace, opt, {class: "form-control"} - %> - </div> - </div> - </div> - <!-- Changelog --> - <div class="form-group"> - <%= wv.label :changelog, "Changelog: ", class: "control-label col-md-2 col-sm-2" %> - <div class="col-md-10 col-sm-10"><%= wv.text_field :changelog, class: "form-control", id: "input_changelog" %></div> - </div> - - - <% end %> - <div class="form-group"> - <div class="col-sm-2 col-md-2"></div> - <div class="col-sm-5 col-md-4 col-lg-3"> - <%= button_tag(type: 'submit', class: "btn btn-primary") do %> - <span class="glyphicon glyphicon-save" aria-hidden="true"></span> Commit image - <% end %> - </div> - <!-- TODO Save draft - <div class="col-sm-4 col-md-3 col-lg-2"> - <%= button_tag(type: 'button', class: "btn btn-warning") do %> - <span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save draft - <% end %> - </div> - --> - </div> - <script type="text/javascript"> - //FIXME we may need to write « document.addEventListener("turbolinks:load", function() { » instead - (function(){ - // called when selecting a version to be replaced - // -> load the existing changelog in the form - function update_changelog() - { - var version = $("#replace_version select").val(); - console.log(version, changelogs[version]); - $("#input_changelog").val(changelogs[version] || "") - } - - // switch between the "create" and "replace" view - function switch_radio_version(value) - { - var cv = $("#create_version"); - var rv = $("#replace_version"); - var cv_input = cv.find("input"); - - cv_input.val(""); - if (value == "replace") { - cv_input.disableClientSideValidations(); - cv.addClass("hidden"); - rv.removeClass("hidden"); - update_changelog(); - - } else { - cv.removeClass("hidden"); - rv.addClass("hidden"); - $("#input_changelog").val(default_version ? "" : "initial version"); - cv_input.enableClientSideValidations(); - } - }; - - // store the default version and all the previous changelogs in local variables - var default_version = <%= - default_version = webapp.webapp_versions.first - (default_version ? default_version.number.to_json : "null").html_safe - %>; - - var changelogs = <%= - webapp.webapp_versions.usable.reorder(:state).group(:number).map{ |v| - [v.number, v.changelog]}.to_h.to_json.html_safe %> - - // disable the radio buttons if the sandbox was started from scratch - // otherwise select the current version - var display = null; - if (default_version == null) { - display = "create"; - $("#radio_version").addClass("hidden"); - } else { - display = "replace"; - } - $("#radio_version input[value='"+display+"']").prop("checked", true); - switch_radio_version(display); - - // register callbacks - $("[name='version_action']").change(function(ev) { - switch_radio_version(ev.target.value); - }); - $("#replace_version select").change(update_changelog); - - - // prevent version collisions - window.ClientSideValidations.validators.local['new_webapp_version_number'] = function(element, options) { - // Your validator code goes in here - if (element.val() in changelogs) { - return "version exists"; - } - } - })(); - </script> - <% end %> - <p> If you whish to drop your changes, your can perform a rollback. - <strong>CAUTION: this will discard all the work made since the sandbox was - started</strong></p> - <div class="row"> - <div class="col-md-2 col-sm-2"></div> - <div class="col-md-10 col-sm-10"> - <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#rollback_modal"> - <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> Rollback - </button> - </div> - </div> - <div class="modal" id="rollback_modal" tabindex="-1" role="dialog"> - <%= form_for(webapp, method: :post, remote: true, url: sandbox_rollback_path(webapp), html: {class: 'form-horizontal'}) do |f| %> - <div class="modal-dialog" role="document"> - <div class="modal-content"> - <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> - <h4 class="modal-title"><span class="glyphicon glyphicon-warning-sign"></span> rollback confirmation</h4> - </div> - <div class="modal-body"> - <p>This action will <strong>permanently discard all changes</strong> made since the sandbox - of application <strong>“<%=webapp.name%>”</strong> was started.</p> - <p>Are you sure you want to proceed?</p> - </div> - <div class="modal-footer"> - <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> - - <%= button_tag(type: 'submit', remote: true, class: "btn btn-danger") do %> - <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> Confirm rollback - <% end %> - </div> - </div> - </div> - <% end %> - </div><!-- modal --> - <% end %> - - <% when "STOPPING" %> - <%##################### sandbox stopping ###############################%> - <% app_info "Your sandbox is stopping" do %> - <%# TODO show deployment status (if any commit) %> - <p class="lead"> - <i class="fa fa-cog fa-spin"></i><br/> - </p> - <% poll_sandbox_state webapp %> - <% end %> - - <% when "STOP_ERROR" %> - <%##################### stop error #####################################%> - <%# TODO show deployment status (if any commit) %> - <% app_info "Your sandbox failed to stop" do %> - <%= link_to sandbox_retry_path(webapp), method: :post, remote: true, class: "btn btn-primary" do %> - <span class="glyphicon glyphicon-repeat"></span> Retry - <% end %> - <% end %> - - <% when "IDLE" %> - <%##################### sandbox idle ###################################%> - <%#TODO display congratulation! when first version is committed - + tell the user to add documentation + examples... %> - <%#TODO show deployment status (show versions with errors somewhere) %> - - <% if webapp.webapp_versions.usable.empty? %> - <% app_info "Your sandbox is idle" do %> - <%= link_to sandbox_start_path(webapp), method: :post, remote: true, class: "btn btn-primary" do %> - <span class="glyphicon glyphicon-play"></span> Start sandbox - <% end %> - <% end %> - <% end %> - <% end %> - -<% end # user admin access %> diff --git a/rails/app/views/webapps/_show_bottom_panel.html.erb b/rails/app/views/webapps/_show_bottom_panel.html.erb deleted file mode 100644 index 3892b9ec13071df92e7440c6b481a54057ff1a11..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/_show_bottom_panel.html.erb +++ /dev/null @@ -1,69 +0,0 @@ -<!-- from here, bottom panel with doc, demo, and api --> -<div class="container"> - <ul class="nav nav-tabs" id="mytab" role="tablist"> - <% if @webapp.administrable_by? current_user %> - <li role="presentation" class="nav-item"> - <a class="nav-link active" data-toggle="tab" role="tab" href="#statistics" ><span class="glyphicon glyphicon-stats"></span> Statistics </a> - </li> - <% if @webapp.private %> - <li role="presentation" class="nav-item"> - <a class="nav-link" data-toggle="tab" role="tab" href="#privacy"><span class="glyphicon glyphicon-flag"></span> Privacy </a> - </li> - <% end %> - <% end %> - <li role="presentation" class="nav-item active"> - <a class="nav-link" data-toggle="tab" role="tab" href="#readme"><span class="glyphicon glyphicon-book"></span> Documentation</a> - </li> - <li role="presentation" class="nav-item"> - <a class="nav-link" data-toggle="tab" role="tab" href="#demo"><span class="glyphicon glyphicon-eye-open"></span> Demo</a> - </li> - <li role="presentation" class="nav-item"> - <a class="nav-link" data-toggle="tab" role="tab" href="#version"><span class="glyphicon glyphicon-hourglass"></span> History</a> - </li> - <li role="presentation" class="nav-item"> - <a class="nav-link" data-toggle="tab" role="tab" href="#apihttp"><span class="glyphicon glyphicon-console"></span> REST API </a> - </li> - - <!--<li role="presentation" id="api-shell" class="w_menu"> - <a href="#api_shell"><span class="glyphicon glyphicon-console"></span> API - Shell</a> - </li> - <li role="presentation" id="api-python" class="w_menu"> - <a href="#api_tabs"><span class="glyphicon glyphicon-console"></span> API - Python</a> - </li> - <li role="presentation" id="api-ruby" class="w_menu"> - <a href="#api_tabs"><span class="glyphicon glyphicon-console"></span> API - Ruby</a> - </li> --> - </ul> - <br /> - <div class="tab-content"> - <% if @webapp.administrable_by? current_user %> - <div class="tab-pane fade" id="statistics" role="tabpanel"> - <%= render partial: 'webapps/_bottom_panel/short_statistics' %> - </div> - <% if @webapp.private %> - <div class="tab-pane fade" id="privacy" role="tabpanel"> - <%= render partial: 'webapps/_bottom_panel/privacy' %> - </div> - <% end %> - <% end %> - <div class="tab-pane fade in active" id="readme" role="tabpanel"> - <% if @webapp.readme %> - <p class="lead"> <%= markdown(File.read("public/app/#{@webapp.docker_name}/Readme")) %> </p> - <% end %> - </div> - - <div class="tab-pane fade" id="demo" role="tabpanel"> - <%= render partial: 'webapps/_bottom_panel/show_demo_files' %> - </div> - <div class="tab-pane fade" id="version" role="tabpanel"> - <%= render partial: 'webapps/_bottom_panel/version_listing' %> - </div> - <div class="tab-pane fade" id="apihttp" role="tabpanel"> - <%= render partial: 'webapps/_api/display_http' %> - </div> - </div> - -</div> -<script type="text/javascript"> -$('#mytab a').click(function (e) {e.preventDefault();$(this).tab('show');}) -</script> diff --git a/rails/app/views/webapps/_show_status_moderation.html.erb b/rails/app/views/webapps/_show_status_moderation.html.erb deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/app/views/webapps/edit.html.erb b/rails/app/views/webapps/edit.html.erb deleted file mode 100644 index f7cd91da0db3aac6e7287885dcbf84dfb63e4eec..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/edit.html.erb +++ /dev/null @@ -1,94 +0,0 @@ -<% @page_title = "Edit your webapp"%> -<div class="container"> - <h2>Editing webapp : <%= link_to @webapp.name, @webapp %></h2> - <div class="panel-heading"> - <ul class="nav nav-tabs" id="edit_webapp_menu"> - <li role="presentation" class="tab active"><a data-toggle="tab" href="edit_basic">Basic information </a></li> - <li role="presentation" class="tab" ><a data-toggle="tab" href="edit_advance">Advance information </a></li> - <% if !@webapp.webapp_versions.usable.empty? %> - <li role="presentation" class="tab" ><a data-toggle="tab" href="edit_container">Start the sandbox</a></li> - <% end %> - </ul> - </div> - - <div class="row" style="margin-top:3em;"> - <div class="edit_webapp row" id="edit_basic"> - <%= render 'form' %> - </div> - - <div class="edit_webapp row col-md-10" id="edit_advance" style="display:none; margin-left:10%;"> - <%= render 'form_second' %> - </div> - - <div class="edit_webapp row" id="edit_container" style="display:none; margin-left:10%;"> - <div class="row" id="sandbox_panel"> - <% if @webapp.sandbox_state != "IDLE" %> - <%= render 'sandbox_panel' %> - <% end %> - </div> - <% if @webapp.sandbox_state == "IDLE" %> - <%# FIXME this should be integrated in the sandbox_panel (but shown only on this page) %> - - <%= form_for @webapp, method: :post, remote: true, url: :sandbox_start, html: {class: "form-horizontal"} do |f| %> - <div class="form-group"> - <%= f.label :sandbox_version_id, "Use version", class: "col-sm-2 control-label" %> - <div class="col-sm-2"> - <%= - opt = options_from_collection_for_select sort_webapp_versions(@webapp.webapp_versions.usable), :id, :number - select_tag :sandbox_version_id, opt, {class: "form-control"} %> - </div> - </div> - <div class="form-group"> - <div class="col-sm-2"></div> - <div class="col-sm-2"> - <%= button_tag type: 'submit', class: 'btn btn-success' do %> - <span class="glyphicon glyphicon-play"></span> Start sandbox - <% end %> - </div> - </div> - <% end %> - <!-- - <p> - You can now edit your application without coming here. - The API to update your app is available ! - Open a new connexion to your app : (app id : <%= @webapp.id %>) - </p> - <pre> - curl -H 'Authorization: Token token=<your_private_token>' -X GET https://allgo.inria.fr/api/v1/webapps/<app_id>/edit - </pre> - <p> - It'll return you the ssh command to access to your application. - When you have done : - </p> - <pre> - curl -H 'Authorization: Token token=<your_private_token>' -X POST - -F webapp[version]=1.1 - -F webapp[changelog]='it's more awesome than ever' - https://allgo.inria.fr/api/v1/webapps/<app_id>/update_container - </pre> - --> - <br /> - <h4>History :</h4> - <% @webapp.webapp_versions.ready.each do|v| %> - <%= v.updated_at.strftime("%Y-%d-%m")+":" %> Version <b><%= v.number %></b>, <%= v.changelog %> - <br /> - <% end %> - <% end %> - </div> - </div> -</div> - -<script type="text/javascript"> - $('a[data-remote]').bind('ajax:complete', function(evt, xhr, status){ - $('#edit_container').html(xhr.responseText); - }); - // .bind('ajax:beforeSend', function(evt, xhr, status){ - // $('#edit_container').html("Work in progress... "); - // }); - $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { - e.preventDefault(); - var target = $(e.target).attr("href") // activated tab - $('div.edit_webapp:not(#'+target+')').fadeOut(); - $('#'+target).fadeIn(); - }); -</script> diff --git a/rails/app/views/webapps/index.html.erb b/rails/app/views/webapps/index.html.erb deleted file mode 100644 index b8240677808e5451df5ba4294e990255e2938410..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/index.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -<div class="container"> - <div class="row centered"> - <div class="col-md-8 col-md-offset-2 cloud"> - <% @page_title = "Apps "%> - <% tag_cloud Webapp.tag_counts, %w(s m l xl) do |tag, css_class| %> - <%= link_to tag.name, tag_path(tag.name), class: "#{css_class}" %> - <% end %> - </div> - </div> - <div class="row centered"> - <div class="col-md-2 col-md-offset-5"> - <%= link_to "See all", webapps_path, class: 'btn btn-default cloud-all' %> - </div> - </div> - <% @webapps.each_with_index do |webapp, index| %> <!-- boucle pour lister les apps ici --> - <% if index % 4 == 0 %> - <div class="row"> - <% end %> - <div class="col-md-3"> - <div class="thumbnail webapp"> - <div style="height:2.5em;"> - <%= link_to image_tag(webapp.logo.url(:thumb), class: "img-responsive center-block"), app_path(webapp.docker_name) %> - </div> - <div class="caption" > - <h3 class="text-center" style="margin-top:1.5em;"> - <%= link_to webapp.name.capitalize, app_path(webapp.docker_name) %> - </h3> - <p class="group inner list-group-item-text"> - <%= truncate(webapp.description, length: 110) %> - </p> - </div> - </div> - </div> - <% if (index % 4 == 3) || (index == @webapps.size - 1) %> - </div> - <% end %> - <% end %> -</div> - -<script type="text/javascript"> -$('.thumbnail').click(function(e){ - e.preventDefault(); - window.location.href = $(this).find("a:first").attr("href"); -}); -</script> diff --git a/rails/app/views/webapps/index.json.jbuilder b/rails/app/views/webapps/index.json.jbuilder deleted file mode 100644 index 2d6b899cb102b5971affd06e53445010895a8a0f..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/index.json.jbuilder +++ /dev/null @@ -1,4 +0,0 @@ -json.array!(@webapps) do |webapp| - json.extract! webapp, :name, :description, :contact - json.url webapp_url(webapp, format: :json) -end diff --git a/rails/app/views/webapps/new.html.erb b/rails/app/views/webapps/new.html.erb deleted file mode 100644 index 0bd4ff41a7a3ed7df8345e22459843f96ec3739a..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/new.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<!-- first step of the app creation --> -<div class="container"> - <p id="notice"><%= notice %></p> - <% @page_title = "New app"%> - <h2>Create your App</h2> - <div id="create-app-form"> - <p class="lead help-block">We will provide you an access to your own machine to install your app, through SSH protocol. <br /> - You'll just have to confirm that you've done the installation, and you'll be able to test your app, before publishing it. <br /> - </p> - <br /> - <%= render 'form' %> - </div> -</div> -<script> -$(document).ready(function() { - $('form[data-remote]').bind('ajax:complete', function(evt, xhr, status){ - $('#create-app-form').html(xhr.responseText).fadeIn(); - $("html, body").animate({ scrollTop: 0 }, "slow"); - }); -}); -</script> diff --git a/rails/app/views/webapps/show.html.erb b/rails/app/views/webapps/show.html.erb deleted file mode 100644 index 87ccc8d6d719526e46504ddd6c0c39d09ceb9e54..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/show.html.erb +++ /dev/null @@ -1,60 +0,0 @@ -<!-- view for displaying webapp info, but also create a job --> -<% @page_title = "#{@webapp.name}"%> -<div class="container"> - <div class="row"> - <h2 class="pull-left"><%= @webapp.name.capitalize %></h2> - <%= image_tag @webapp.logo.url(:thumb), class: "img-responsive app-img pull-right" %> - </div> - - <%= render partial: 'sandbox_panel' %> - - <div class="row"> - <div class="col-md-3 app-info"> - <p> - Tags:<br /> - <%= raw @webapp.tag_list.map { |t| link_to t, tag_path(t) }.join(', ') %> - </p> - <p> - Owner:<br /> - <%= mail_to @webapp.contact do %> - <%= image_tag avatar_url( @webapp.contact), size: '30x30', class: "img-circle" %> - <span> <%= @webapp.contact %></span> - <% end %> - </p> - <% if @webapp.administrable_by? current_user %> - <%= link_to "<i class=\"glyphicon glyphicon-tags\"></i> Jobs".html_safe, jobs_path(app: @webapp.id), class: 'btn btn-primary' %><br /><br /> - <%= link_to "<i class=\"glyphicon glyphicon-edit\"></i> Edit".html_safe, edit_webapp_path(@webapp), class: 'btn btn-warning' %><br /><br /> - <%= link_to "<i class=\"glyphicon glyphicon-trash\"></i> Destroy".html_safe, @webapp, - method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' %><br /><br /> - <% end %> - </div> - <div class="jumptarget" id="job_form"></div> - <div class="col-md-9"> - <p class="lead"> - <%= @webapp.description %> - <hr /> - </p> - <!-- form to create a job directly, but TODO : not DRY, bc job _form too specific --> - <% if current_user.blank? %> - <p class="lead"> - Please <%= link_to "log in", new_user_session_path %> to perform a job with this app. - </p> - <% else %> - <p class="lead pop">Create a job (remaining quota: <%= @q_quantity.to_s(:human_size) %>):</p> - <div class="form-group row"> - <%= render partial: 'jobs/form' %> <!-- render jobs/upload in jobs/form, where we create the directory for file --> - </div> - <% end %> - </div> - </div> -</div> -<%= render partial: 'show_bottom_panel' %> - -<%# here we insert some padding so that the user is not confused when following - # the links to 'job_form' and 'commit_form' -> the page should be exactly aligned - # with the wanted form -%> -<% if @webapp.webapp_versions.empty? or true %> - <div style="height:25em;"> - </div> -<% end %> diff --git a/rails/app/views/webapps/show.json.jbuilder b/rails/app/views/webapps/show.json.jbuilder deleted file mode 100644 index 64adf8df519aeb6fcc4e8b92e77132b01b88e735..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/show.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.extract! @webapp, :name, :description, :contact, :created_at, :updated_at diff --git a/rails/app/views/webapps/statistics.html.erb b/rails/app/views/webapps/statistics.html.erb deleted file mode 100644 index c2ce9aa05d83d50790e480c959316ad2698188c5..0000000000000000000000000000000000000000 --- a/rails/app/views/webapps/statistics.html.erb +++ /dev/null @@ -1,41 +0,0 @@ -<% @page_title = "Statistics"%> -<%= render 'users/menu' %> -<div class="container"> - <h3> <%= link_to @webapp.name.capitalize, @webapp %></h3> - <p class="lead"> Number of jobs per month:</p> - <!-- <%= javascript_include_tag 'nv.d3.min' %> --> - <!-- <%= stylesheet_link_tag 'nv.d3.min', media: "all", "data-turbolinks-track" => true %> --> - <svg id="chart"></svg> - - <div class="row"> - <%= render partial: 'webapps/_bottom_panel/short_statistics' %> - </div> -</div> -<script type="text/javascript"> - nv.addGraph(function() { - var chart = nv.models.discreteBarChart() - .x(function(d) { return d.label }) //Specify the data accessors. - .y(function(d) { return d.value }) - .staggerLabels(false) //Too many bars and not enough room? Try staggering labels. - //.tooltips(false) //Don't show tooltips - .showValues(true) //...instead, show the bar value right on top of each bar. - .duration(350) - .color(['#aec7e8']) - ; - chart.yAxis.tickFormat(d3.format(',0f')); - chart.valueFormat(d3.format(',0f')); - - d3.select('#chart') - .datum(getData()) - .call(chart); - - nv.utils.windowResize(chart.update); - - return chart; - }); - //Each bar represents a single discrete quantity. - function getData() - { - return [{values: <%= @b.to_json.html_safe %>}] - } -</script> diff --git a/rails/bin/bundle b/rails/bin/bundle deleted file mode 100644 index 66e9889e8b4aeea1af13e2396fb70594232a2ae3..0000000000000000000000000000000000000000 --- a/rails/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') diff --git a/rails/bin/rails b/rails/bin/rails deleted file mode 100644 index 0138d79b751b9668a1036329a9ef29a213836162..0000000000000000000000000000000000000000 --- a/rails/bin/rails +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby -begin - load File.expand_path('../spring', __FILE__) -rescue LoadError => e - raise unless e.message.include?('spring') -end -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' diff --git a/rails/bin/rake b/rails/bin/rake deleted file mode 100644 index d87d5f578104597c1d1b951b55942e37f8af1277..0000000000000000000000000000000000000000 --- a/rails/bin/rake +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env ruby -begin - load File.expand_path('../spring', __FILE__) -rescue LoadError => e - raise unless e.message.include?('spring') -end -require_relative '../config/boot' -require 'rake' -Rake.application.run diff --git a/rails/bin/setup b/rails/bin/setup deleted file mode 100644 index 589bee82b79bdb7284f4b8538f464d4e83bf268c..0000000000000000000000000000000000000000 --- a/rails/bin/setup +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env ruby -require 'pathname' -require 'fileutils' -include FileUtils - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a starting point to setup your application. - # Add necessary setup steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') or system!('bundle install') - - # puts "\n== Copying sample files ==" - # unless File.exist?('config/database.yml') - # cp 'config/database.yml.sample', 'config/database.yml' - # end - - puts "\n== Preparing database ==" - system! 'bin/rails db:setup' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/rails/bin/spring b/rails/bin/spring deleted file mode 100644 index 62ec28f8c21004302e7bffd12c549cf7d599c789..0000000000000000000000000000000000000000 --- a/rails/bin/spring +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env ruby - -# This file loads spring without using Bundler, in order to be fast. -# It gets overwritten when you run the `spring binstub` command. - -unless defined?(Spring) - require 'rubygems' - require 'bundler' - - if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) - Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq } - gem 'spring', match[1] - require 'spring/binstub' - end -end diff --git a/rails/bin/update b/rails/bin/update deleted file mode 100644 index 985192370d1011ecab1105d64886470b4e1c3114..0000000000000000000000000000000000000000 --- a/rails/bin/update +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env ruby -require 'pathname' -require 'fileutils' -include FileUtils - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a way to update your development environment automatically. - # Add necessary update steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system 'bundle check' or system! 'bundle install' - - puts "\n== Updating database ==" - system! 'bin/rails db:migrate' - - puts "\n== Removing old logs and tempfiles ==" - system! 'bin/rails log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'bin/rails restart' -end diff --git a/rails/bower.json b/rails/bower.json deleted file mode 100644 index 0b91f34d85e6164f37475af0c394f54230645b90..0000000000000000000000000000000000000000 --- a/rails/bower.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "allgo", - "authors": [ - "Allgo SED Rennes <allgo@inria.fr>" - ], - "description": "awesome application", - "main": "application.html.erb", - "keywords": [ - "inria" - ], - "license": "AGPL2", - "homepage": "allgo.inria.fr", - "private": true, - "ignore": [ - "**/.*", - "test", - "tests" - ], - "dependencies": { - "jquery-ujs": "*", - "jquery": "~2.2.4", - "jquery-color": "latest", - "coffee-script": "latest", - "nvd3": "latest" - }, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "old_" : { - "bootstrap": "~3.3.7", - "bootstrap-sass-official": "3.3.7" - } -} diff --git a/rails/config.ru b/rails/config.ru deleted file mode 100644 index 5bc2a619e83ea182b17e2507c5e0f2f07f7cf18c..0000000000000000000000000000000000000000 --- a/rails/config.ru +++ /dev/null @@ -1,4 +0,0 @@ -# This file is used by Rack-based servers to start the application. - -require ::File.expand_path('../config/environment', __FILE__) -run Rails.application diff --git a/rails/config/application.rb b/rails/config/application.rb deleted file mode 100644 index 4d9b8d92f0d0ae249714a70d9dc92edb374e3508..0000000000000000000000000000000000000000 --- a/rails/config/application.rb +++ /dev/null @@ -1,101 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -# Require the gems listed in Gemfile, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(*Rails.groups) - -module Allgo - class Application < Rails::Application - # so it must run after (= be inserted before) Rack::UTF8Sanitizer. - #Paperclip.options[:command_path] = "/usr/local/bin/identify" - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Set Time.zone default from the value of the TZ environment variable - tz = ENV["TZ"] - if tz and tz != "" - config.time_zone = tz - end - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de - - - # Do not put ANSI colors in the logs - config.colorize_logging = false - - # Externalised web links inside the help dropdown bar - config.helpdesk_links = { - "report a problem" => "https://helpdesk.inria.fr/categories/227/submit", - "ask a question" => "https://helpdesk.inria.fr/categories/228/submit", - } - - # Memory limit (in bytes) set when new webapps are created - config.webapp_default_memory_limit = nil - - # Conventions inside the docker container - config.datastore = "/vol/rw/datastore" - config.paths["log"] = "/vol/log/rails/rails.log" - - config.webapp_demo_path = 'public/app/' - - # configuration for paperclip (file attachement management) - # :command_path is the location of imagemagick commands - # FIXME it would be nice to sandbox imagemagick - Paperclip.options[:command_path] = "/usr/bin" - Paperclip.options[:log] = true - Paperclip.options[:log_command] = true - - config.after_initialize do - # Load extra config from /vol/ro/config.rb - # (to allow customisation on a per-container basis) - extra_config = "/vol/ro/config.rb" - if File.exists? extra_config - require extra_config - end - - # TCP (host, port) to contact the docker controller - if !config.respond_to? :docker_adapter - config.docker_adapter = "#{config.short_env}-controller", 4567 - end - - # Mailer configuration - # -> forward to the smtpsink container - if !config.action_mailer.smtp_settings - config.action_mailer.smtp_settings = { :address => "#{config.short_env}-smtpsink", :port => 25 } - end - end - - config.generators do |g| - g.test_framework :rspec, - :fixtures => true, - :view_specs => false, - :helper_specs => false, - :routing_specs => false, - :controller_specs => true, - :request_specs => true - g.fixture_replacement :factory_girl, :dir => "spec/factories" - end - -# disabled (for the moment) because duplicated in the nginx config (see #119) -# -# config.middleware.insert_before 0, "Rack::Cors", :debug => true, :logger => (-> { Rails.logger }) do -# allow do -# origins '*' -# -# resource '/api/v1/*', -# :headers => :any, -# :methods => [:post,:get,:options], -# :credentials => true, -# :max_age => 0 -# -# end -# end - - - end -end diff --git a/rails/config/boot.rb b/rails/config/boot.rb deleted file mode 100644 index 6b750f00b1dff4d94937b97ae0dbf76784b02164..0000000000000000000000000000000000000000 --- a/rails/config/boot.rb +++ /dev/null @@ -1,3 +0,0 @@ -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) - -require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/rails/config/brakeman.ignore b/rails/config/brakeman.ignore deleted file mode 100644 index 094e4afe87cb2703e86a89562347ced3a314fe1e..0000000000000000000000000000000000000000 --- a/rails/config/brakeman.ignore +++ /dev/null @@ -1,247 +0,0 @@ -{ - "ignored_warnings": [ - { - "warning_type": "File Access", - "warning_code": 16, - "fingerprint": "06fec185fde51ebe3ac781614271aecc1a8b873e2c48f439c325abf71b7d05b7", - "message": "Model attribute used in file name", - "file": "app/controllers/jobs_controller.rb", - "line": 134, - "link": "http://brakemanscanner.org/docs/warning_types/file_access/", - "code": "Dir.foreach(Job.find_by(:id => params[:id]).path)", - "render_path": null, - "location": { - "type": "method", - "class": "JobsController", - "method": "attached_files" - }, - "user_input": "Job.find_by(:id => params[:id]).path", - "confidence": "Medium", - "note": "" - }, - { - "warning_type": "Cross Site Scripting", - "warning_code": 4, - "fingerprint": "0dfd562315c1db17760de29aa95ec786aeac3c2ffebf1c9ee2d5fb6359dcc12e", - "message": "Unsafe model attribute in link_to href", - "file": "app/views/webapps/_bottom_panel/_show_demo_files.html.erb", - "line": 17, - "link": "http://brakemanscanner.org/docs/warning_types/link_to_href", - "code": "link_to(File.basename(wd.name), \"#{Rails.configuration.root_url}/app/#{(Webapp.find_by(:docker_name => params[:docker_name]) or params[:id] ? (Webapp.find_by(:id => params[:id])) : (nil)).docker_name}/demo/output/#{wd.name}\")", - "render_path": [{"type":"controller","class":"WebappsController","method":"show","line":46,"file":"app/controllers/webapps_controller.rb"},{"type":"template","name":"webapps/show","line":51,"file":"app/views/webapps/show.html.erb"},{"type":"template","name":"webapps/_show_bottom_panel","line":56,"file":"app/views/webapps/_show_bottom_panel.html.erb"}], - "location": { - "type": "template", - "template": "webapps/_bottom_panel/_show_demo_files" - }, - "user_input": "Webapp.find_by(:docker_name => params[:docker_name])", - "confidence": "Medium", - "note": "" - }, - { - "warning_type": "Command Injection", - "warning_code": 14, - "fingerprint": "14e709999a329cee50d897cc34ce14b8bb83ba720f2245abb8489152bca75756", - "message": "Possible command injection", - "file": "app/controllers/webapps_controller.rb", - "line": 207, - "link": "http://brakemanscanner.org/docs/warning_types/command_injection/", - "code": "system(\"mkdir -p public/app/#{(Webapp.find_by(:docker_name => params[:docker_name]) or params[:id] ? (Webapp.find_by(:id => params[:id])) : (nil)).docker_name}/demo/output\")", - "render_path": null, - "location": { - "type": "method", - "class": "WebappsController", - "method": "update_info" - }, - "user_input": "Webapp.find_by(:id => params[:id])", - "confidence": "High", - "note": "" - }, - { - "warning_type": "Cross Site Scripting", - "warning_code": 4, - "fingerprint": "17e5b1a1cf49d25b0318130687fc7139f3cb00dc388859f42c4a64b121a76aeb", - "message": "Unsafe model attribute in link_to href", - "file": "app/views/jobs/show.html.erb", - "line": 15, - "link": "http://brakemanscanner.org/docs/warning_types/link_to_href", - "code": "link_to((Job.find_by(:id => params[:job][:id]) or Job.create_w_user(job_params, current_user.id)).webapp.name, (Job.find_by(:id => params[:job][:id]) or Job.create_w_user(job_params, current_user.id)).webapp)", - "render_path": [{"type":"controller","class":"JobsController","method":"create","line":90,"file":"app/controllers/jobs_controller.rb"}], - "location": { - "type": "template", - "template": "jobs/show" - }, - "user_input": "Job.find_by(:id => params[:job][:id])", - "confidence": "Medium", - "note": "" - }, - { - "warning_type": "File Access", - "warning_code": 16, - "fingerprint": "51ecc56f7c0e5359e31249fe74bc3669ae001c496ae3cee805f488f700a99273", - "message": "Model attribute used in file name", - "file": "app/views/jobs/ajax/_show_content.html.erb", - "line": 3, - "link": "http://brakemanscanner.org/docs/warning_types/file_access/", - "code": "Dir.foreach((Job.find_by(:id => params[:job][:id]) or Job.create_w_user(job_params, current_user.id)).path)", - "render_path": [{"type":"controller","class":"JobsController","method":"create","line":90,"file":"app/controllers/jobs_controller.rb"},{"type":"template","name":"jobs/show","line":77,"file":"app/views/jobs/show.html.erb"}], - "location": { - "type": "template", - "template": "jobs/ajax/_show_content" - }, - "user_input": "Job.create_w_user(job_params, current_user.id)", - "confidence": "Weak", - "note": "" - }, - { - "warning_type": "File Access", - "warning_code": 16, - "fingerprint": "7395e97ccb273c7e8e48748f07d3dd5b4463f0b2622b573f8754da448cf375e6", - "message": "Model attribute used in file name", - "file": "app/controllers/api/v0/jobs_controller.rb", - "line": 24, - "link": "http://brakemanscanner.org/docs/warning_types/file_access/", - "code": "FileUtils.mkpath(Job.new(:user => (@user), :webapp_id => job_params[:webapp_id], :param => job_params[:param], :version => Webapp.find(job_params[:webapp_id]).webapp_versions.usable.order(\"number DESC\").first.number).path)", - "render_path": null, - "location": { - "type": "method", - "class": "Api::V0::JobsController", - "method": "create" - }, - "user_input": "Job.new(:user => (@user), :webapp_id => job_params[:webapp_id], :param => job_params[:param], :version => Webapp.find(job_params[:webapp_id]).webapp_versions.usable.order(\"number DESC\").first.number).path", - "confidence": "Medium", - "note": "" - }, - { - "warning_type": "Cross Site Scripting", - "warning_code": 2, - "fingerprint": "86e26b5741cf0ffbfe31627ac84eeea0180284ef0f1b3dc556a15fdde952a269", - "message": "Unescaped model attribute", - "file": "app/views/webapps/show.html.erb", - "line": 15, - "link": "http://brakemanscanner.org/docs/warning_types/cross_site_scripting", - "code": "(Webapp.find_by(:docker_name => params[:docker_name]) or params[:id] ? (Webapp.find_by(:id => params[:id])) : (nil)).tag_list.map do\n link_to(t, tag_path(t))\n end.join(\", \")", - "render_path": [{"type":"controller","class":"WebappsController","method":"show","line":46,"file":"app/controllers/webapps_controller.rb"}], - "location": { - "type": "template", - "template": "webapps/show" - }, - "user_input": "Webapp.find_by(:docker_name => params[:docker_name])", - "confidence": "Weak", - "note": "" - }, - { - "warning_type": "File Access", - "warning_code": 16, - "fingerprint": "a6cf6a4926985b7cc4ea645505bd37ac306c34b2ddba8962d7e14ee12e788b13", - "message": "Model attribute used in file name", - "file": "app/controllers/jobs_controller.rb", - "line": 187, - "link": "http://brakemanscanner.org/docs/warning_types/file_access/", - "code": "send_file(\"#{Dir.mktmpdir(\"allgo-zip-job-#{Job.find(params[:id]).id}-\")}/job-#{Job.find(params[:id]).id}.zip\", :x_sendfile => true, :type => \"application/zip\", :filename => (\"allgo_job_#{Job.find(params[:id]).id}.zip\"))", - "render_path": null, - "location": { - "type": "method", - "class": "JobsController", - "method": "generate_zip" - }, - "user_input": "Job.find(params[:id])", - "confidence": "Weak", - "note": "" - }, - { - "warning_type": "Command Injection", - "warning_code": 14, - "fingerprint": "b1a23619b8e1be66622462fa3d06aeb3d664b4fc441a4a444d2d4a7c76f51cff", - "message": "Possible command injection", - "file": "app/controllers/webapps_controller.rb", - "line": 221, - "link": "http://brakemanscanner.org/docs/warning_types/command_injection/", - "code": "system(\"mkdir -p public/app/#{(Webapp.find_by(:docker_name => params[:docker_name]) or params[:id] ? (Webapp.find_by(:id => params[:id])) : (nil)).docker_name}\")", - "render_path": null, - "location": { - "type": "method", - "class": "WebappsController", - "method": "update_info" - }, - "user_input": "Webapp.find_by(:id => params[:id])", - "confidence": "High", - "note": "" - }, - { - "warning_type": "Cross Site Scripting", - "warning_code": 4, - "fingerprint": "ca9f9b658eebc3f034321c3fbb13ce48d163ec768dd59bc08ad35c7b5d7c8b00", - "message": "Unsafe model attribute in link_to href", - "file": "app/views/jobs/ajax/_show_content.html.erb", - "line": 6, - "link": "http://brakemanscanner.org/docs/warning_types/link_to_href", - "code": "link_to(f, ((((\"#{Rails.configuration.root_url}\" + \"/datastore/\") + (Job.find_by(:id => params[:job][:id]) or Job.create_w_user(job_params, current_user.id)).folder) + \"/\") + File.basename(f)))", - "render_path": [{"type":"controller","class":"JobsController","method":"create","line":90,"file":"app/controllers/jobs_controller.rb"},{"type":"template","name":"jobs/show","line":77,"file":"app/views/jobs/show.html.erb"}], - "location": { - "type": "template", - "template": "jobs/ajax/_show_content" - }, - "user_input": "Job.find_by(:id => params[:job][:id])", - "confidence": "Medium", - "note": "" - }, - { - "warning_type": "File Access", - "warning_code": 16, - "fingerprint": "cb039904096dbd3be0d8d106b9acdf14199ff2f5a5841a92ada7bd437dac0eae", - "message": "Model attribute used in file name", - "file": "app/controllers/webapp_demos_controller.rb", - "line": 5, - "link": "http://brakemanscanner.org/docs/warning_types/file_access/", - "code": "File.delete(\"public/app/#{Webapp.find(WebappDemo.find(params[:id]).webapp_id).docker_name}/demo/#{WebappDemo.find(params[:id]).file_type}/#{WebappDemo.find(params[:id]).name}\")", - "render_path": null, - "location": { - "type": "method", - "class": "WebappDemosController", - "method": "destroy" - }, - "user_input": "Webapp.find(WebappDemo.find(params[:id]).webapp_id).docker_name", - "confidence": "Medium", - "note": "" - }, - { - "warning_type": "Command Injection", - "warning_code": 14, - "fingerprint": "ef6a7b96374dd74a37b431785d131042d40ce4e461a32530990ed90438161255", - "message": "Possible command injection", - "file": "app/controllers/webapps_controller.rb", - "line": 206, - "link": "http://brakemanscanner.org/docs/warning_types/command_injection/", - "code": "system(\"mkdir -p public/app/#{(Webapp.find_by(:docker_name => params[:docker_name]) or params[:id] ? (Webapp.find_by(:id => params[:id])) : (nil)).docker_name}/demo/input\")", - "render_path": null, - "location": { - "type": "method", - "class": "WebappsController", - "method": "update_info" - }, - "user_input": "Webapp.find_by(:id => params[:id])", - "confidence": "High", - "note": "" - }, - { - "warning_type": "Cross Site Scripting", - "warning_code": 4, - "fingerprint": "fc77eeafd34cbe0903d8633b206121df1b5c15cf4b7470584e7ba60511217ea5", - "message": "Unsafe model attribute in link_to href", - "file": "app/views/webapps/_bottom_panel/_show_demo_files.html.erb", - "line": 5, - "link": "http://brakemanscanner.org/docs/warning_types/link_to_href", - "code": "link_to(File.basename(wd.name), \"#{Rails.configuration.root_url}/app/#{(Webapp.find_by(:docker_name => params[:docker_name]) or params[:id] ? (Webapp.find_by(:id => params[:id])) : (nil)).docker_name}/demo/input/#{wd.name}\")", - "render_path": [{"type":"controller","class":"WebappsController","method":"show","line":46,"file":"app/controllers/webapps_controller.rb"},{"type":"template","name":"webapps/show","line":51,"file":"app/views/webapps/show.html.erb"},{"type":"template","name":"webapps/_show_bottom_panel","line":56,"file":"app/views/webapps/_show_bottom_panel.html.erb"}], - "location": { - "type": "template", - "template": "webapps/_bottom_panel/_show_demo_files" - }, - "user_input": "Webapp.find_by(:docker_name => params[:docker_name])", - "confidence": "Medium", - "note": "" - } - ], - "updated": "2017-09-27 15:45:24 +0000", - "brakeman_version": "3.4.0" -} diff --git a/rails/config/cable.yml b/rails/config/cable.yml deleted file mode 100644 index 7143f3105c740f77deee77802e461ba329d4f25a..0000000000000000000000000000000000000000 --- a/rails/config/cable.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Action Cable uses Redis to administer connections, channels, and sending/receiving messages over the WebSocket. -production: - url: redis://localhost:6379/1 - -development: - url: redis://localhost:6379/4 - -test: - url: redis://localhost:6379/3 diff --git a/rails/config/database.yml b/rails/config/database.yml deleted file mode 100644 index 283e2b1a0a8d3f268b2c0e9713b2f27e244213d4..0000000000000000000000000000000000000000 --- a/rails/config/database.yml +++ /dev/null @@ -1,40 +0,0 @@ -# SQLite version 3.x -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem 'sqlite3' -development: - adapter: mysql2 - database: allgo - username: allgo - password: allgo - host: dev-mysql - port: 3306 - -qualification: - adapter: mysql2 - database: allgo - username: allgo - password: allgo - host: qualif-mysql - port: 3306 - -production: - adapter: mysql2 - database: allgo - username: allgo - password: allgo - host: prod-mysql - port: 3306 - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: mysql2 - database: allgo_test - username: allgo - password: allgo - host: dev-mysql - port: 3306 - diff --git a/rails/config/environment.rb b/rails/config/environment.rb deleted file mode 100644 index ee8d90dc651948269f1b869953ff04774e737307..0000000000000000000000000000000000000000 --- a/rails/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the Rails application. -require File.expand_path('../application', __FILE__) - -# Initialize the Rails application. -Rails.application.initialize! diff --git a/rails/config/environments/development.rb b/rails/config/environments/development.rb deleted file mode 100644 index 688dcebd6832c9a7a726a05596aeeb445bd73445..0000000000000000000000000000000000000000 --- a/rails/config/environments/development.rb +++ /dev/null @@ -1,94 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = false - - # Show full error reports. - config.consider_all_requests_local = true - - # Enable/disable caching. By default caching is disabled. - # if Rails.root.join('tmp/caching-dev.txt').exist? - # config.action_controller.perform_caching = true - # config.cache_store = :memory_store - # config.public_file_server.headers = { - # 'Cache-Control' => 'public, max-age=172800' - # } - # else - # config.action_controller.perform_caching = false - # config.cache_store = :null_store - #end - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = true - - # Asset digests allow you to set far-future HTTP expiration dates on all assets, - # yet still be able to expire them through the digest params. - config.assets.digest = true - - # Adds additional error checking when serving assets at runtime. - # Checks for improperly declared sprockets dependencies. - # Raises helpful error messages. - config.assets.raise_runtime_errors = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true - - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - # config.file_watcher = ActiveSupport::EventedFileUpdateChecker - - # short name for the environment - config.short_env = "dev" - - # Root URL - config.root_url = "http://localhost:3000" - config.action_mailer.default_url_options = { :host => 'localhost', :port => 3000} - - config.restrict_email = ['irisa.fr','inria.fr','cnrs.fr','loria.fr'] - - # [host, port] where the sandboxes are reachable (for the ssh access) - config.sandbox = "127.0.0.1", 2222 - - # FIXME: this line is meant to suppress a deprecation warning - # https://gist.github.com/chancancode/7781341 - # maybe it is not needed - config.i18n.enforce_available_locales = false - - #TODO: remove this in development ? - config.assets.js_compressor = :uglifier - config.assets.css_compressor = :sass - - #TODO check - # action_cable == support for websockets (pub/sub) - config.action_cable.allowed_request_origins = ['http://allgo.dev:3000','192.168.50.2:3000','http://localhost:3000'] - - #config.logstasher.enabled = true - #config.logstasher.logger_path = 'log/logstasher.log' - -# + # Asset digests allow you to set far-future HTTP expiration dates on all assets, -# + # yet still be able to expire them through the digest params. -# + config.assets.digest = true -# + -# + # Adds additional error checking when serving assets at runtime. -# + # Checks for improperly declared sprockets dependencies. -# + # Raises helpful error messages. -# + config.assets.raise_runtime_errors = true -# + -# + # Raises error for missing translations -# + # config.action_view.raise_on_missing_translations = true - -end diff --git a/rails/config/environments/production.rb b/rails/config/environments/production.rb deleted file mode 100644 index 88ee927a2f5d7382b0aef4d78b5dcde0ebdd89d9..0000000000000000000000000000000000000000 --- a/rails/config/environments/production.rb +++ /dev/null @@ -1,112 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # Code is not reloaded between requests. - config.cache_classes = true - - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. - config.eager_load = true - - # Full error reports are disabled and caching is turned on. - config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Disable serving static files from the `/public` folder by default since - # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? - - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier - config.assets.css_compressor = :sass - - # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = false - - # Asset digests allow you to set far-future HTTP expiration dates on all assets, - # yet still be able to expire them through the digest params. - config.assets.digest = true - - # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - #config.force_ssl = false - - # Use the lowest log level to ensure availability of diagnostic information - # when problems arise. - config.log_level = :info - - # Adds additional error checking when serving assets at runtime. - # Checks for improperly declared sprockets dependencies. - # Raises helpful error messages. -# config.assets.raise_runtime_errors = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true - - # short name for the environment - config.short_env = "prod" - - # Root URL - config.root_url = "https://allgo.inria.fr" - config.action_mailer.default_url_options = { host: 'allgo.inria.fr', protocol: 'https' } - - # host where the sandboxes are located (for the ssh access) - config.sandbox = "ssh-allgo.inria.fr", 22 - - # smtp server - config.action_mailer.smtp_settings = { address: "smtp.inria.fr", port: 25 } - - # Use a different logger for distributed setups. - # require 'syslog/logger' - # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') - - # Use a different cache store in production. - # config.cache_store = :mem_cache_store - - # Use a real queuing backend for Active Job (and separate queues per environment) - config.active_job.queue_adapter = :sidekiq - #config.active_job.queue_name_prefix = "allgo_#{Rails.env}" - - # Ignore bad email addresses and do not raise email delivery errors. - # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false - - # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation cannot be found). - config.i18n.fallbacks = true - - # Use default logging formatter so that PID and timestamp are not suppressed. - #config.log_formatter = ::Logger::Formatter.new - - ##specific allgo - config.restrict_email = ['irisa.fr','inria.fr','cnrs.fr','loria.fr'] - - #TODO check - # action_cable == support for websockets (pub/sub) - config.action_cable.allowed_request_origins = ['http://allgo.dev:3000','192.168.50.2:3000','http://localhost:3000'] - - #config.logstasher.enabled = true - #config.logstasher.logger_path = 'log/logstasher.log' - -# + # Asset digests allow you to set far-future HTTP expiration dates on all assets, -# + # yet still be able to expire them through the digest params. -# + config.assets.digest = true -# + -# + # Adds additional error checking when serving assets at runtime. -# + # Checks for improperly declared sprockets dependencies. -# + # Raises helpful error messages. -# + config.assets.raise_runtime_errors = true -# + -# + # Raises error for missing translations -# + # config.action_view.raise_on_missing_translations = true - -end diff --git a/rails/config/environments/qualification.rb b/rails/config/environments/qualification.rb deleted file mode 100644 index 2ae160e20c62cdc4a412c13894e9847887b0db52..0000000000000000000000000000000000000000 --- a/rails/config/environments/qualification.rb +++ /dev/null @@ -1,95 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. - config.cache_classes = false - - # Do not eager load code on boot. - config.eager_load = true - - # Show full error reports. -# config.consider_all_requests_local = true - - # Enable/disable caching. By default caching is disabled. - # if Rails.root.join('tmp/caching-dev.txt').exist? - # config.action_controller.perform_caching = true - # config.cache_store = :memory_store - # config.public_file_server.headers = { - # 'Cache-Control' => 'public, max-age=172800' - # } - # else - # config.action_controller.perform_caching = false - # config.cache_store = :null_store - #end - - # Print deprecation notices to the Rails logger. - config.active_support.deprecation = :log - - # Raise an error on page load if there are pending migrations. - config.active_record.migration_error = :page_load - - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large - # number of complex assets. - config.assets.debug = false - - # Asset digests allow you to set far-future HTTP expiration dates on all assets, - # yet still be able to expire them through the digest params. - config.assets.digest = true - - # Adds additional error checking when serving assets at runtime. - # Checks for improperly declared sprockets dependencies. - # Raises helpful error messages. - config.assets.raise_runtime_errors = true - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true - - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. - # config.file_watcher = ActiveSupport::EventedFileUpdateChecker - - # short name for the environment - config.short_env = "qualif" - - # Root URL - config.root_url = "https://allgo-qualif.inria.fr" - config.action_mailer.default_url_options = { host: 'worker0.irisa.fr', protocol: 'https' } - - config.restrict_email = ['irisa.fr','inria.fr','cnrs.fr','loria.fr'] - - # host where the sandboxes are located (for the ssh access) - config.sandbox = "ssh-allgo-qualif.inria.fr", 22 - - # FIXME: this line is meant to suppress a deprecation warning - # https://gist.github.com/chancancode/7781341 - # maybe it is not needed - config.i18n.enforce_available_locales = false - - #TODO: remove this in development ? - config.assets.js_compressor = :uglifier - config.assets.css_compressor = :sass - - #TODO check - # action_cable == support for websockets (pub/sub) - config.action_cable.allowed_request_origins = ['http://allgo.dev:3000','192.168.50.2:3000','http://localhost:3000'] - - #config.logstasher.enabled = true - #config.logstasher.logger_path = 'log/logstasher.log' - -# + # Asset digests allow you to set far-future HTTP expiration dates on all assets, -# + # yet still be able to expire them through the digest params. -# + config.assets.digest = true -# + -# + # Adds additional error checking when serving assets at runtime. -# + # Checks for improperly declared sprockets dependencies. -# + # Raises helpful error messages. -# + config.assets.raise_runtime_errors = true -# + -# + # Raises error for missing translations -# + # config.action_view.raise_on_missing_translations = true - -end - diff --git a/rails/config/environments/test.rb b/rails/config/environments/test.rb deleted file mode 100644 index 0bd8514a84834d69fa9b5d5389ec8b6462698f3e..0000000000000000000000000000000000000000 --- a/rails/config/environments/test.rb +++ /dev/null @@ -1,47 +0,0 @@ -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Configure static file server for tests with Cache-Control for performance. - config.public_file_server.enabled = true - config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Randomize the order test cases are executed. - config.active_support.test_order = :random - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true - - - # short name for the environment -# config.short_env = "test" - -end diff --git a/rails/config/initializers/active_job.rb b/rails/config/initializers/active_job.rb deleted file mode 100644 index 5b6ece3c7a91a6220fd2d1d2ad6c533d024c6ee7..0000000000000000000000000000000000000000 --- a/rails/config/initializers/active_job.rb +++ /dev/null @@ -1 +0,0 @@ -ActiveJob::Base.queue_adapter = :sidekiq diff --git a/rails/config/initializers/active_record_belongs_to_required_by_default.rb b/rails/config/initializers/active_record_belongs_to_required_by_default.rb deleted file mode 100644 index c91309763e76212a7547ad2a8781eb995eca88f5..0000000000000000000000000000000000000000 --- a/rails/config/initializers/active_record_belongs_to_required_by_default.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Require `belongs_to` associations by default. This is a new Rails 5.0 default, -# so introduced as a config to ensure apps made with earlier versions of Rails aren't affected when upgrading. -Rails.application.config.active_record.belongs_to_required_by_default = false diff --git a/rails/config/initializers/application_controller_renderer.rb b/rails/config/initializers/application_controller_renderer.rb deleted file mode 100644 index 51639b67a00ddba973a92d59ec277f5d97b63ef6..0000000000000000000000000000000000000000 --- a/rails/config/initializers/application_controller_renderer.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# ApplicationController.renderer.defaults.merge!( -# http_host: 'example.org', -# https: false -# ) diff --git a/rails/config/initializers/assets.rb b/rails/config/initializers/assets.rb deleted file mode 100644 index 623f85dbd02dbcdf4b3f5cdf98f8c667a8b07685..0000000000000000000000000000000000000000 --- a/rails/config/initializers/assets.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.2' - -Rails.application.config.assets.paths << '/opt/bower_components' -#Rails.application.config.assets.paths << Rails.root.join("vendor","assets","components","bootstrap","assets","fonts") -# Add additional assets to the asset load path -# Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. -#Rails.application.config.assets.precompile += %w( manifest.js ) diff --git a/rails/config/initializers/backtrace_silencers.rb b/rails/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cdf379bd06a8d2326dcd4de6d5cd5d3f5b0..0000000000000000000000000000000000000000 --- a/rails/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/rails/config/initializers/bower_rails.rb b/rails/config/initializers/bower_rails.rb deleted file mode 100644 index c3673867e6d96405b18201127d3e83ad93f280ed..0000000000000000000000000000000000000000 --- a/rails/config/initializers/bower_rails.rb +++ /dev/null @@ -1,6 +0,0 @@ -BowerRails.configure do |bower_rails| - - # get the bower modules from the docker image - bower_rails.bower_components_directory = '/opt/bower_components' - -end diff --git a/rails/config/initializers/callback_terminator.rb b/rails/config/initializers/callback_terminator.rb deleted file mode 100644 index 43510c244bfa6b588bf612238ae7a76dff531d25..0000000000000000000000000000000000000000 --- a/rails/config/initializers/callback_terminator.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Do not halt callback chains when a callback returns false. This is a new Rails 5.0 default, -# so introduced as a config to ensure apps made with earlier versions of Rails aren't affected when upgrading. -ActiveSupport.halt_callback_chains_on_return_false = false diff --git a/rails/config/initializers/client_side_validations.rb b/rails/config/initializers/client_side_validations.rb deleted file mode 100644 index 8ce25b036ec63d7ab01981c66ec76d7dbb79c829..0000000000000000000000000000000000000000 --- a/rails/config/initializers/client_side_validations.rb +++ /dev/null @@ -1,20 +0,0 @@ -# ClientSideValidations Initializer - -# Disabled validators -# ClientSideValidations::Config.disabled_validators = [] - -# Uncomment to validate number format with current I18n locale -# ClientSideValidations::Config.number_format_with_locale = true - -# Uncomment the following block if you want each input field to have the validation messages attached. -# -# Note: client_side_validation requires the error to be encapsulated within -# <label for="#{instance.send(:tag_id)}" class="message"></label> -# -ActionView::Base.field_error_proc = proc do |html_tag, instance| - if html_tag =~ /^<label/ - %(<div class="field_with_errors">#{html_tag}</div>).html_safe - else - %(<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>).html_safe - end -end diff --git a/rails/config/initializers/cookies_serializer.rb b/rails/config/initializers/cookies_serializer.rb deleted file mode 100644 index ba971956b49b1bdf665069a4aef5ddc37ac9da11..0000000000000000000000000000000000000000 --- a/rails/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -#Rails.application.config.action_dispatch.cookies_serializer = :hybrid -#devise can't deal with json for the moment -Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/rails/config/initializers/devise.rb b/rails/config/initializers/devise.rb deleted file mode 100644 index 63219d3ab5db48ae95b926348bfa1e0125f7971f..0000000000000000000000000000000000000000 --- a/rails/config/initializers/devise.rb +++ /dev/null @@ -1,255 +0,0 @@ -# -*- encoding : utf-8 -*- -# Use this hook to configure devise mailer, warden hooks and so forth. -# Many of these configuration options can be set straight in your model. -Devise.setup do |config| - # The secret key used by Devise. Devise uses this key to generate - # random tokens. Changing this key will render invalid all existing - # confirmation, reset password and unlock tokens in the database. - config.secret_key = '5e48ad609f94cc973b26d37386bc67dc41e0da350c98ac248246156d35858d136cb37ef1f1e9b0337e5efae8cdd778925e498689261d8e45bcc3809a15aea4ae' - - # ==> Mailer Configuration - # Configure the e-mail address which will be shown in Devise::Mailer, - # note that it will be overwritten if you use your own mailer class - # with default "from" parameter. - config.mailer_sender = 'noreply@allgo.inria.fr' - - # Configure the class responsible to send e-mails. - # config.mailer = 'Devise::Mailer' - - # ==> ORM configuration - # Load and configure the ORM. Supports :active_record (default) and - # :mongoid (bson_ext recommended) by default. Other ORMs may be - # available as additional gems. - require 'devise/orm/active_record' - - # ==> Configuration for any authentication mechanism - # Configure which keys are used when authenticating a user. The default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating a user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # You can also supply a hash where the value is a boolean determining whether - # or not authentication should be aborted when the value is not present. - # config.authentication_keys = [ :email ] - - # Configure parameters from the request object used for authentication. Each entry - # given should be a request method and it will automatically be passed to the - # find_for_authentication method and considered in your model lookup. For instance, - # if you set :request_keys to [:subdomain], :subdomain will be used on authentication. - # The same considerations mentioned for authentication_keys also apply to request_keys. - # config.request_keys = [] - - # Configure which authentication keys should be case-insensitive. - # These keys will be downcased upon creating or modifying a user and when used - # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [ :email ] - - # Configure which authentication keys should have whitespace stripped. - # These keys will have whitespace before and after removed upon creating or - # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [ :email ] - - # Tell if authentication through request.params is enabled. True by default. - # It can be set to an array that will enable params authentication only for the - # given strategies, for example, `config.params_authenticatable = [:database]` will - # enable it only for database (email + password) authentication. - # config.params_authenticatable = true - - # Tell if authentication through HTTP Auth is enabled. False by default. - # It can be set to an array that will enable http authentication only for the - # given strategies, for example, `config.http_authenticatable = [:database]` will - # enable it only for database authentication. The supported strategies are: - # :database = Support basic authentication with authentication key + password - config.http_authenticatable = true - - # If http headers should be returned for AJAX requests. True by default. - # config.http_authenticatable_on_xhr = true - - # The realm used in Http Basic Authentication. 'Application' by default. - # config.http_authentication_realm = 'Application' - - # It will change confirmation, password recovery and other workflows - # to behave the same regardless if the e-mail provided was right or wrong. - # Does not affect registerable. - # config.paranoid = true - - # By default Devise will store the user in session. You can skip storage for - # particular strategies by setting this option. - # Notice that if you are skipping storage for all authentication paths, you - # may want to disable generating routes to Devise's sessions controller by - # passing :skip => :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] - - # By default, Devise cleans up the CSRF token on authentication to - # avoid CSRF token fixation attacks. This means that, when using AJAX - # requests for sign in and sign up, you need to get a new CSRF token - # from the server. You can disable this option at your own risk. - # config.clean_up_csrf_token_on_authentication = true - - # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 10. If - # using other encryptors, it sets how many times you want the password re-encrypted. - # - # Limiting the stretches to just one in testing will increase the performance of - # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use - # a value less than 10 in other environments. - config.stretches = Rails.env.test? ? 1 : 10 - - # Setup a pepper to generate the encrypted password. - # config.pepper = 'a6791a9443d0f0ae4a3ad7b0a74bb5d1545af7e85fefb911c4b84dc6ea68a305456f02909ed8584be4bf3122a9b5d8f32978935fc69021019b0cd28757cd6e7e' - - # ==> Configuration for :confirmable - # A period that the user is allowed to access the website even without - # confirming his account. For instance, if set to 2.days, the user will be - # able to access the website for two days without confirming his account, - # access will be blocked just in the third day. Default is 0.days, meaning - # the user cannot access the website without confirming his account. - # config.allow_unconfirmed_access_for = 2.days - - # A period that the user is allowed to confirm their account before their - # token becomes invalid. For example, if set to 3.days, the user can confirm - # their account within 3 days after the mail was sent, but on the fourth day - # their account can't be confirmed with the token any more. - # Default is nil, meaning there is no restriction on how long a user can take - # before confirming their account. - # config.confirm_within = 3.days - - # If true, requires any email changes to be confirmed (exactly the same way as - # initial account confirmation) to be applied. Requires additional unconfirmed_email - # db field (see migrations). Until confirmed new email is stored in - # unconfirmed email column, and copied to email column on successful confirmation. - config.reconfirmable = false - - # Defines which key will be used when confirming an account - # config.confirmation_keys = [ :email ] - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false - - # Options to be passed to the created cookie. For instance, you can set - # :secure => true in order to force SSL only cookies. - # config.rememberable_options = {} - - # ==> Configuration for :validatable - # Range for password length. Default is 8..128. - config.password_length = 8..128 - - # Email regex used to validate email formats. It simply asserts that - # one (and only one) @ exists in the given string. This is mainly - # to give user feedback and not to assert the e-mail validity. - # config.email_regexp = /\A[^@]+@[^@]+\z/ - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. Default is 30 minutes. - # config.timeout_in = 30.minutes - - # If true, expires auth token on session timeout. - # config.expire_auth_token_on_timeout = false - - # ==> Configuration for :lockable - # Defines which strategy will be used to lock an account. - # :failed_attempts = Locks an account after a number of failed attempts to sign in. - # :none = No lock strategy. You should handle locking by yourself. - # config.lock_strategy = :failed_attempts - - # Defines which key will be used when locking and unlocking an account - # config.unlock_keys = [ :email ] - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Re-enables login after a certain amount of time (see :unlock_in below) - # :both = Enables both strategies - # :none = No unlock strategy. You should handle unlocking by yourself. - # config.unlock_strategy = :both - - # Number of authentication tries before locking an account if lock_strategy - # is failed attempts. - # config.maximum_attempts = 20 - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # Warn on the last attempt before the account is locked. - # config.last_attempt_warning = false - - # ==> Configuration for :recoverable - # - # Defines which key will be used when recovering the password for an account - # config.reset_password_keys = [ :email ] - - # Time interval you can reset your password with a reset password key. - # Don't put a too small interval or your users won't have the time to - # change their passwords. - config.reset_password_within = 6.hours - - # ==> Configuration for :encryptable - # Allow you to use another encryption algorithm besides bcrypt (default). You can use - # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1, - # :authlogic_sha512 (then you should set stretches above to 20 for default behavior) - # and :restful_authentication_sha1 (then you should set stretches to 10, and copy - # REST_AUTH_SITE_KEY to pepper). - # - # Require the `devise-encryptable` gem when using anything other than bcrypt - # config.encryptor = :sha512 - - # ==> Scopes configuration - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "users/sessions/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = false - - # Configure the default scope given to Warden. By default it's the first - # devise role declared in your routes (usually :user). - # config.default_scope = :user - - # Set this configuration to false if you want /users/sign_out to sign out - # only the current scope. By default, Devise signs out all scopes. - # config.sign_out_all_scopes = true - - # ==> Navigation configuration - # Lists the formats that should be treated as navigational. Formats like - # :html, should redirect to the sign in page when the user does not have - # access, but formats like :xml or :json, should return 401. - # - # If you have any extra navigational formats, like :iphone or :mobile, you - # should add them to the navigational formats lists. - # - # The "*/*" below is required to match Internet Explorer requests. - # config.navigational_formats = ['*/*', :html] - - # The default HTTP method used to sign out a resource. Default is :delete. - config.sign_out_via = :delete - - # ==> OmniAuth - # Add a new OmniAuth provider. Check the wiki for more information on setting - # up on your models and hooks. - # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' - - # ==> Warden configuration - # If you want to use other strategies, that are not supported by Devise, or - # change the failure app, you can configure them inside the config.warden block. - # - # config.warden do |manager| - # manager.intercept_401 = false - # manager.default_strategies(:scope => :user).unshift :some_external_strategy - # end - - # ==> Mountable engine configurations - # When using Devise inside an engine, let's call it `MyEngine`, and this engine - # is mountable, there are some extra configurations to be taken into account. - # The following options are available, assuming the engine is mounted as: - # - # mount MyEngine, at: '/my_engine' - # - # The router that invoked `devise_for`, in the example above, would be: - # config.router_name = :my_engine - # - # When using omniauth, Devise cannot automatically set Omniauth path, - # so you need to do it manually. For the users scope, it would be: - # config.omniauth_path_prefix = '/my_engine/users/auth' -end diff --git a/rails/config/initializers/filter_parameter_logging.rb b/rails/config/initializers/filter_parameter_logging.rb deleted file mode 100644 index 4a994e1e7bb7ce28dcec98bad48b9a891d7dec51..0000000000000000000000000000000000000000 --- a/rails/config/initializers/filter_parameter_logging.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Configure sensitive parameters which will be filtered from the log file. -Rails.application.config.filter_parameters += [:password] diff --git a/rails/config/initializers/inflections.rb b/rails/config/initializers/inflections.rb deleted file mode 100644 index ac033bf9dc846101320c96a5ce8aceb8c96ec098..0000000000000000000000000000000000000000 --- a/rails/config/initializers/inflections.rb +++ /dev/null @@ -1,16 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format. Inflections -# are locale specific, and you may define rules for as many different -# locales as you wish. All of these examples are active by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end - -# These inflection rules are supported but not enabled by default: -# ActiveSupport::Inflector.inflections(:en) do |inflect| -# inflect.acronym 'RESTful' -# end diff --git a/rails/config/initializers/mime_types.rb b/rails/config/initializers/mime_types.rb deleted file mode 100644 index 6bcad867f86bb726cfc216f6172338cdc86f7d92..0000000000000000000000000000000000000000 --- a/rails/config/initializers/mime_types.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf - Mime::Type.register "text/script", :sh - Mime::Type.register "text/python", :py diff --git a/rails/config/initializers/paperclip.rb b/rails/config/initializers/paperclip.rb deleted file mode 100644 index 929bfa840036f9cee8e777942dc5512db87123ee..0000000000000000000000000000000000000000 --- a/rails/config/initializers/paperclip.rb +++ /dev/null @@ -1 +0,0 @@ -Paperclip::Attachment.default_options[:validate_media_type] = false diff --git a/rails/config/initializers/rack.rb b/rails/config/initializers/rack.rb deleted file mode 100644 index f9c481b1e49023c2383a5e93a1c7ae1b47bc4358..0000000000000000000000000000000000000000 --- a/rails/config/initializers/rack.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Rack - module Multipart - class Parser - remove_const :BUFSIZE - BUFSIZE = 20_000_000 - end - end -end diff --git a/rails/config/initializers/request_forgery_protection.rb b/rails/config/initializers/request_forgery_protection.rb deleted file mode 100644 index 3eab78a8850a3cf4acb923443d14b9997ebd640b..0000000000000000000000000000000000000000 --- a/rails/config/initializers/request_forgery_protection.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Enable origin-checking CSRF mitigation. -Rails.application.config.action_controller.forgery_protection_origin_check = true diff --git a/rails/config/initializers/secret_token.rb b/rails/config/initializers/secret_token.rb deleted file mode 100644 index 13602c7b1ab18e5d517da7308b97668c485e14f4..0000000000000000000000000000000000000000 --- a/rails/config/initializers/secret_token.rb +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding : utf-8 -*- -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. - -KEY_FILE = '/vol/cache/secret_key_base' - -Rails.configuration.secret_key_base = File.read(KEY_FILE).strip - -if Rails.configuration.secret_key_base.size < 128 - raise "session key too short in #{KEY_FILE}" -end diff --git a/rails/config/initializers/session_store.rb b/rails/config/initializers/session_store.rb deleted file mode 100644 index ab8299bcce989dba7059bb86a70a173c379f66bd..0000000000000000000000000000000000000000 --- a/rails/config/initializers/session_store.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Be sure to restart your server when you modify this file. - -Rails.application.config.session_store :cookie_store, key: '_allgo_session' diff --git a/rails/config/initializers/sidekiq.rb b/rails/config/initializers/sidekiq.rb deleted file mode 100644 index 9808efdb9f10484fbdf0dd24c58bbdc343822508..0000000000000000000000000000000000000000 --- a/rails/config/initializers/sidekiq.rb +++ /dev/null @@ -1,3 +0,0 @@ -Sidekiq.configure_server do |config| - config.redis = { url: 'redis://127.0.0.1:6379' } -end diff --git a/rails/config/initializers/warden_hooks.rb b/rails/config/initializers/warden_hooks.rb deleted file mode 100644 index 8a26fc8e4e2ab580ee43537e382a2ff8140d2394..0000000000000000000000000000000000000000 --- a/rails/config/initializers/warden_hooks.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Warden::Manager.after_set_user do |user,auth,opts| -# scope = opts[:scope] -# auth.cookies.signed["#{scope}.id"] = user.id -# auth.cookies.signed["#{scope}.expires_at"] = 30.minutes.from_now -# end diff --git a/rails/config/initializers/wrap_parameters.rb b/rails/config/initializers/wrap_parameters.rb deleted file mode 100644 index bbfc3961bffef15dabb35fe0de4c409d6efb58c5..0000000000000000000000000000000000000000 --- a/rails/config/initializers/wrap_parameters.rb +++ /dev/null @@ -1,14 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# This file contains settings for ActionController::ParamsWrapper which -# is enabled by default. - -# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. -ActiveSupport.on_load(:action_controller) do - wrap_parameters format: [:json] -end - -# To enable root element in JSON for ActiveRecord objects. -# ActiveSupport.on_load(:active_record) do -# self.include_root_in_json = true -# end diff --git a/rails/config/locales/devise.en.yml b/rails/config/locales/devise.en.yml deleted file mode 100644 index fc67293fab2ab0eff0bd5f2e72459c219f81d829..0000000000000000000000000000000000000000 --- a/rails/config/locales/devise.en.yml +++ /dev/null @@ -1,62 +0,0 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n -en: - devise: - confirmations: - confirmed: "Your account was successfully confirmed." - send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." - failure: - already_authenticated: "You are already signed in." - inactive: "Your account is not activated yet." - invalid: "Invalid email or password." - locked: "Your account is locked." - last_attempt: "You have one more attempt before your account will be locked." - not_found_in_database: "Invalid email or password." - timeout: "Your session expired. Please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your account before continuing." - mailer: - confirmation_instructions: - subject: "Confirmation instructions" - reset_password_instructions: - subject: "Reset password instructions" - unlock_instructions: - subject: "Unlock Instructions" - omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." - passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password was changed successfully. You are now signed in." - updated_not_active: "Your password was changed successfully." - registrations: - destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." - updated: "You updated your account successfully." - sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - unlocks: - send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." - custom_registrations: - user: - updated: "You updated your account successfully." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." - errors: - messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" - not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" diff --git a/rails/config/locales/en.yml b/rails/config/locales/en.yml deleted file mode 100644 index 7f09b28e7f1f24712908f2ab514ccb57fcf4d1b9..0000000000000000000000000000000000000000 --- a/rails/config/locales/en.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Files in the config/locales directory are used for internationalization -# and are automatically loaded by Rails. If you want to use locales other -# than English, add the necessary files in this directory. -# -# To use the locales, use `I18n.t`: -# -# I18n.t 'hello' -# -# In views, this is aliased to just `t`: -# -# <%= t('hello') %> -# -# To use a different locale, set it with `I18n.locale`: -# -# I18n.locale = :es -# -# This would use the information in config/locales/es.yml. -# -# To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. - -en: - hello: "Hello world" - public_ssh_key : "Your public SSH key (must begin by 'ssh-rsa'), if you want to be an app provider " - your_quotas : "Your different quotas" \ No newline at end of file diff --git a/rails/config/puma.rb b/rails/config/puma.rb deleted file mode 100644 index 0bcebdb5254300684b4bd2f5d9daddd5d5225e4a..0000000000000000000000000000000000000000 --- a/rails/config/puma.rb +++ /dev/null @@ -1,41 +0,0 @@ -# Change to match your CPU core count -workers 4 #prod = 12 - -# Min and Max threads per worker -threads 1, 6 - -# app_dir = File.expand_path("../..", __FILE__) -# shared_dir = "#{app_dir}/shared" -# -# # Default to production -# rails_env = ENV['RAILS_ENV'] || "production" -# environment rails_env -# -# # Set up socket location -# bind "unix://#{shared_dir}/sockets/puma.sock" -# -# # Logging -# stdout_redirect "#{shared_dir}/log/puma.stdout.log", "#{shared_dir}/log/puma.stderr.log", true -# -# # Set master PID and state locations -# pidfile "#{shared_dir}/pids/puma.pid" -# state_path "#{shared_dir}/pids/puma.state" -activate_control_app - -before_fork do - ActiveRecord::Base.connection_pool.disconnect! -end - -on_worker_boot do - #require "active_record" - #ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished - #ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[rails_env]) - ActiveSupport.on_load(:active_record) do - ActiveRecord::Base.establish_connection - end -end - -lowlevel_error_handler do |e| - Rollbar.critical(e) - [500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact allgo@inria.fr\n"]] -end diff --git a/rails/config/rails_best_practices.yml b/rails/config/rails_best_practices.yml deleted file mode 100644 index 0fa6202903e120c848a7947bb5ac1f2c9d505ebd..0000000000000000000000000000000000000000 --- a/rails/config/rails_best_practices.yml +++ /dev/null @@ -1,42 +0,0 @@ -AddModelVirtualAttributeCheck: { } -AlwaysAddDbIndexCheck: { } -#CheckSaveReturnValueCheck: { } -#CheckDestroyReturnValueCheck: { } -DefaultScopeIsEvilCheck: { } -DryBundlerInCapistranoCheck: { } -#HashSyntaxCheck: { } -IsolateSeedDataCheck: { } -KeepFindersOnTheirOwnModelCheck: { } -LawOfDemeterCheck: { } -#LongLineCheck: { max_line_length: 80 } -MoveCodeIntoControllerCheck: { } -MoveCodeIntoHelperCheck: { array_count: 3 } -MoveCodeIntoModelCheck: { use_count: 2 } -MoveFinderToNamedScopeCheck: { } -MoveModelLogicIntoModelCheck: { use_count: 4 } -NeedlessDeepNestingCheck: { nested_count: 2 } -NotRescueExceptionCheck: { } -NotUseDefaultRouteCheck: { } -NotUseTimeAgoInWordsCheck: { } -OveruseRouteCustomizationsCheck: { customize_count: 3 } -ProtectMassAssignmentCheck: { } -RemoveEmptyHelpersCheck: { } -#RemoveTabCheck: { } -RemoveTrailingWhitespaceCheck: { } -RemoveUnusedMethodsInControllersCheck: { except_methods: [] } -RemoveUnusedMethodsInHelpersCheck: { except_methods: [] } -RemoveUnusedMethodsInModelsCheck: { except_methods: [] } -ReplaceComplexCreationWithFactoryMethodCheck: { attribute_assignment_count: 2 } -ReplaceInstanceVariableWithLocalVariableCheck: { } -RestrictAutoGeneratedRoutesCheck: { } -SimplifyRenderInControllersCheck: { } -SimplifyRenderInViewsCheck: { } -#UseBeforeFilterCheck: { customize_count: 2 } -UseModelAssociationCheck: { } -UseMultipartAlternativeAsContentTypeOfEmailCheck: { } -#UseParenthesesInMethodDefCheck: { } -UseObserverCheck: { } -UseQueryAttributeCheck: { } -UseSayWithTimeInMigrationsCheck: { } -UseScopeAccessCheck: { } -UseTurboSprocketsRails3Check: { } diff --git a/rails/config/routes.rb b/rails/config/routes.rb deleted file mode 100644 index 5b961b454b0c3b95208bf9c4813d1fbf1ae6aa6e..0000000000000000000000000000000000000000 --- a/rails/config/routes.rb +++ /dev/null @@ -1,149 +0,0 @@ -# -*- encoding : utf-8 -*- -Allgo::Application.routes.draw do - root to: "home#index" - get "home/index" - - resources :datasets - - get 'documentation/about' - get 'documentation/tutorial' - get 'documentation/infrastructure' - get 'documentation/roadmap' - get 'documentation/privacy' - get 'documentation/api' - get 'documentation/demo_examples' - get 'documentation/entrypoint' - - get 'users/myapps', to: 'users#show_apps', as: :show_apps_user - - - namespace :api do - namespace :v0 do - resources :jobs - end - namespace :v1 do - resources :jobs - resources :webapps do - match 'update_container', to: 'webapps#update_container', via: :all - end - end - end - - namespace :admin do - get '', to: 'dashboard#index', as: :dashboard - - resources :statistics - resources :registry - get 'logs/sidekiq', to: 'logs#show_sidekiq', as: :logs_sidekiq - get 'logs/error', to: 'logs#show', as: :logs_error - resources :webapps - end - - resources :webapps - match "/app/:docker_name", to: "webapps#show", via: :all, as: :app - match "/apps", to: "webapps#index", via: :all, as: :apps - get 'tags/:tag', to: 'webapps#index', as: :tag - #when status of webapp go to 1 - get 'webapp/:id/statistics', to: 'webapps#statistics', as: :webapp_statistics - - post 'webapp/:id/sandbox_start', to: 'webapps#sandbox_start', as: 'sandbox_start' - post 'webapp/:id/sandbox_retry', to: 'webapps#sandbox_retry', as: 'sandbox_retry' - post 'webapp/:id/sandbox_abort', to: 'webapps#sandbox_abort', as: 'sandbox_abort' - post 'webapp/:id/sandbox_commit', to: 'webapps#sandbox_commit', as: 'sandbox_commit' - post 'webapp/:id/sandbox_rollback',to:'webapps#sandbox_rollback',as:'sandbox_rollback' - - resources :webapp_parameters - resources :webapp_demos - - - resources :jobs - patch 'upload', to: 'jobs#upload' - post 'upload', to: 'jobs#upload' - post 'jobs/:id/abort', to: 'jobs#abort', as: 'job_abort' - get 'job/inside_creation', to: 'jobs#inside_creation' - get 'job/:id/destroy_file', to: 'jobs#destroy_file' - get 'job/:id/attached_files', to: 'jobs#attached_files' - get 'job/:id/generate_zip', to: 'jobs#generate_zip' - get 'jobs/ajax/show_content/:id', to: 'jobs#show_content' - - post 'job/get_file_url', to:'jobs#get_file_url' - - resources :quotas - - resources :datasets - - resources :audios - resources :videos - - devise_for :users, :controllers => { registrations: 'custom_registrations' } #to rewrite Devise functions - post 'users/new_token', to: 'users#new_token', as: :new_user_token - - #put 'users/myapps', to: 'webapps#second_update', as: :second_update_webapps - - - require 'sidekiq/web' - authenticate :user, lambda { |u| u.admin? } do - mount Sidekiq::Web => '/sidekiq' - end - - #mount ActionCable.server => '/cable' - - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - - # default route (404 Not Found) - match "*path", via: :all, to: "application#not_found" -end diff --git a/rails/config/sidekiq.yml b/rails/config/sidekiq.yml deleted file mode 100644 index 674ebed952bde930c88980505eae5ddad79725f4..0000000000000000000000000000000000000000 --- a/rails/config/sidekiq.yml +++ /dev/null @@ -1,11 +0,0 @@ -:verbose: true -:concurrency: 5 -#:pidfile: tmp/pids/sidekiq.pid -development: - :concurrency: 10 -production: - :concurrency: 20 -:queues: - - [jobs_queue, 5] - - [apps_queue, 1] -#:logfile: ./log/sidekiq.log diff --git a/rails/config/unicorn.rb b/rails/config/unicorn.rb deleted file mode 100644 index 20ed0980d32f90814bbd68b8cb82f8afdda801b0..0000000000000000000000000000000000000000 --- a/rails/config/unicorn.rb +++ /dev/null @@ -1,64 +0,0 @@ -worker_processes 4 - -log_path = "/vol/log/rails" -preload_app true - -# not using unix sock so that we can use the thin server interchangeably -# (did not find how to use thin with a unix socket) -#listen "unix:#{shared_path}/sockets/unicorn.sock" -#listen "[::1]:3000" -listen "127.0.0.1:3000" - -timeout 90 - -pid "/run/unicorn.pid" -stdout_path "/vol/log/unicorn/stdout.log" -stderr_path "/vol/log/unicorn/stderr.log" - - -GC.respond_to?(:copy_on_write_friendly=) and - GC.copy_on_write_friendly = true - -before_fork do |server, worker| - # the following is highly recomended for Rails + "preload_app true" - # as there's no need for the master process to hold a connection - defined?(ActiveRecord::Base) and - ActiveRecord::Base.connection.disconnect! - - # The following is only recommended for memory/DB-constrained - # installations. It is not needed if your system can house - # twice as many worker_processes as you have configured. - # - # # This allows a new master process to incrementally - # # phase out the old master process with SIGTTOU to avoid a - # # thundering herd (especially in the "preload_app false" case) - # # when doing a transparent upgrade. The last worker spawned - # # will then kill off the old master process with a SIGQUIT. - # old_pid = "#{server.config[:pid]}.oldbin" - # if old_pid != server.pid - # begin - # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU - # Process.kill(sig, File.read(old_pid).to_i) - # rescue Errno::ENOENT, Errno::ESRCH - # end - # end - # - # # *optionally* throttle the master from forking too quickly by sleeping - # sleep 1 -end - -after_fork do |server, worker| - # per-process listener ports for debugging/admin/migrations - # addr = "127.0.0.1:#{9293 + worker.nr}" - # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true) - - # the following is *required* for Rails + "preload_app true", - defined?(ActiveRecord::Base) and - ActiveRecord::Base.establish_connection - - # if preload_app is true, then you may also want to check and - # restart any other shared sockets/descriptors such as Memcached, - # and Redis. TokyoCabinet file handles are safe to reuse - # between any number of forked children (assuming your kernel - # correctly implements pread()/pwrite() system calls) -end diff --git a/rails/db/migrate/20131121150637_devise_create_users.rb b/rails/db/migrate/20131121150637_devise_create_users.rb deleted file mode 100644 index 5e7d70b097c4ad8868867f2e609fd4549c9c82b4..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131121150637_devise_create_users.rb +++ /dev/null @@ -1,43 +0,0 @@ -# -*- encoding : utf-8 -*- -class DeviseCreateUsers < ActiveRecord::Migration - def change - create_table(:users) do |t| - ## Database authenticatable - t.string :email, :null => false, :default => "" - t.string :encrypted_password, :null => false, :default => "" - - ## Recoverable - t.string :reset_password_token - t.datetime :reset_password_sent_at - - ## Rememberable - t.datetime :remember_created_at - - ## Trackable - t.integer :sign_in_count, :default => 0, :null => false - t.datetime :current_sign_in_at - t.datetime :last_sign_in_at - t.string :current_sign_in_ip - t.string :last_sign_in_ip - - ## Confirmable - # t.string :confirmation_token - # t.datetime :confirmed_at - # t.datetime :confirmation_sent_at - # t.string :unconfirmed_email # Only if using reconfirmable - - ## Lockable - # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts - # t.string :unlock_token # Only if unlock strategy is :email or :both - # t.datetime :locked_at - - - t.timestamps - end - - add_index :users, :email, :unique => true - add_index :users, :reset_password_token, :unique => true - # add_index :users, :confirmation_token, :unique => true - # add_index :users, :unlock_token, :unique => true - end -end diff --git a/rails/db/migrate/20131121152958_create_webapps.rb b/rails/db/migrate/20131121152958_create_webapps.rb deleted file mode 100644 index 370f2954c8fa6634afb3415b217f9a46c4f8c994..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131121152958_create_webapps.rb +++ /dev/null @@ -1,12 +0,0 @@ -# -*- encoding : utf-8 -*- -class CreateWebapps < ActiveRecord::Migration - def change - create_table :webapps do |t| - t.string :name - t.string :description - t.string :contact - - t.timestamps - end - end -end diff --git a/rails/db/migrate/20131121153102_add_admin_to_users.rb b/rails/db/migrate/20131121153102_add_admin_to_users.rb deleted file mode 100644 index 962a9c0f23e391a331f2b27bb9a71902c9e3fe82..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131121153102_add_admin_to_users.rb +++ /dev/null @@ -1,10 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddAdminToUsers < ActiveRecord::Migration - def self.up - add_column :users, :admin, :boolean, :default => false - end - - def self.down - remove_column :users, :admin - end -end diff --git a/rails/db/migrate/20131122093548_create_jobs.rb b/rails/db/migrate/20131122093548_create_jobs.rb deleted file mode 100644 index e626a4e9d8b281943ac159ec7165cd9952f74db5..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131122093548_create_jobs.rb +++ /dev/null @@ -1,13 +0,0 @@ -# -*- encoding : utf-8 -*- -class CreateJobs < ActiveRecord::Migration - def change - create_table :jobs do |t| - t.string :datafile - t.belongs_to :webapp - t.belongs_to :user - t.string :status - - t.timestamps - end - end -end diff --git a/rails/db/migrate/20131122100843_addconfirmable.rb b/rails/db/migrate/20131122100843_addconfirmable.rb deleted file mode 100644 index 0ba3083cbe2ee4df1b911eca26236af08f0a1ea3..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131122100843_addconfirmable.rb +++ /dev/null @@ -1,22 +0,0 @@ -# -*- encoding : utf-8 -*- -class Addconfirmable < ActiveRecord::Migration - # Note: You can't use change, as User.update_all with fail in the down migration - def self.up - add_column :users, :confirmation_token, :string - add_column :users, :confirmed_at, :datetime - add_column :users, :confirmation_sent_at, :datetime - # add_column :users, :unconfirmed_email, :string # Only if using reconfirmable - add_index :users, :confirmation_token, :unique => true - # User.reset_column_information # Need for some types of updates, but not for update_all. - # To avoid a short time window between running the migration and updating all existing - # users as confirmed, do the following - User.update_all(:confirmed_at => Time.now) - # All existing user accounts should be able to log in after this. - end - - def self.down - remove_columns :users, :confirmation_token, :confirmed_at, :confirmation_sent_at - # remove_columns :users, :unconfirmed_email # Only if using reconfirmable - end -end - diff --git a/rails/db/migrate/20131122103349_add_param_to_jobs.rb b/rails/db/migrate/20131122103349_add_param_to_jobs.rb deleted file mode 100644 index bcc0c1cd8796c7d025a40d0697bfa43babc74f45..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131122103349_add_param_to_jobs.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddParamToJobs < ActiveRecord::Migration - def change - add_column :jobs, :param, :string - end -end diff --git a/rails/db/migrate/20131122110002_add_default_value_to_status.rb b/rails/db/migrate/20131122110002_add_default_value_to_status.rb deleted file mode 100644 index 8ac778655c1325c14da66d17ad0d229762d3f0db..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131122110002_add_default_value_to_status.rb +++ /dev/null @@ -1,10 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddDefaultValueToStatus < ActiveRecord::Migration -def up - change_column :jobs, :status, :string, :default => 'new' -end - -def down - change_column :jobs, :status, :string, :default => nil -end -end diff --git a/rails/db/migrate/20131126145113_add_index_to_webapps.rb b/rails/db/migrate/20131126145113_add_index_to_webapps.rb deleted file mode 100644 index 5ace516d82413aa8e00110ef3223e12da6b37a82..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20131126145113_add_index_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddIndexToWebapps < ActiveRecord::Migration - def change - add_index :webapps, :name, unique: true - end -end diff --git a/rails/db/migrate/20140205134947_add_logo_column_to_webapps.rb b/rails/db/migrate/20140205134947_add_logo_column_to_webapps.rb deleted file mode 100644 index 861669c88f6a919fc7976efecdf00bcc63090121..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20140205134947_add_logo_column_to_webapps.rb +++ /dev/null @@ -1,10 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddLogoColumnToWebapps < ActiveRecord::Migration - def self.up - add_attachment :webapps, :logo - end - - def self.down - remove_attachment :webapps, :logo - end -end diff --git a/rails/db/migrate/20140205144848_devise_create_admin_users.rb b/rails/db/migrate/20140205144848_devise_create_admin_users.rb deleted file mode 100644 index 488e0c2483c08d75910237a6aa18d28d042766e9..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20140205144848_devise_create_admin_users.rb +++ /dev/null @@ -1,49 +0,0 @@ -# -*- encoding : utf-8 -*- -class DeviseCreateAdminUsers < ActiveRecord::Migration - def migrate(direction) - super - # Create a default user - AdminUser.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password') if direction == :up - end - - def change - create_table(:admin_users) do |t| - ## Database authenticatable - t.string :email, :null => false, :default => "" - t.string :encrypted_password, :null => false, :default => "" - - ## Recoverable - t.string :reset_password_token - t.datetime :reset_password_sent_at - - ## Rememberable - t.datetime :remember_created_at - - ## Trackable - t.integer :sign_in_count, :default => 0, :null => false - t.datetime :current_sign_in_at - t.datetime :last_sign_in_at - t.string :current_sign_in_ip - t.string :last_sign_in_ip - - ## Confirmable - # t.string :confirmation_token - # t.datetime :confirmed_at - # t.datetime :confirmation_sent_at - # t.string :unconfirmed_email # Only if using reconfirmable - - ## Lockable - # t.integer :failed_attempts, :default => 0, :null => false # Only if lock strategy is :failed_attempts - # t.string :unlock_token # Only if unlock strategy is :email or :both - # t.datetime :locked_at - - - t.timestamps - end - - add_index :admin_users, :email, :unique => true - add_index :admin_users, :reset_password_token, :unique => true - # add_index :admin_users, :confirmation_token, :unique => true - # add_index :admin_users, :unlock_token, :unique => true - end -end diff --git a/rails/db/migrate/20140207083212_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/rails/db/migrate/20140207083212_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb deleted file mode 100644 index dc44e6281f529d00a4c673be83231de0d6d5bfa4..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20140207083212_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +++ /dev/null @@ -1,32 +0,0 @@ -# -*- encoding : utf-8 -*- -# This migration comes from acts_as_taggable_on_engine (originally 1) -class ActsAsTaggableOnMigration < ActiveRecord::Migration - def self.up - create_table :tags do |t| - t.string :name - end - - create_table :taggings do |t| - t.references :tag - - # You should make sure that the column created is - # long enough to store the required class names. - t.references :taggable, :polymorphic => true - t.references :tagger, :polymorphic => true - - # Limit is created to prevent MySQL error on index - # length for MyISAM table type: http://bit.ly/vgW2Ql - t.string :context, :limit => 128 - - t.datetime :created_at - end - - add_index :taggings, :tag_id - add_index :taggings, [:taggable_id, :taggable_type, :context] - end - - def self.down - drop_table :taggings - drop_table :tags - end -end diff --git a/rails/db/migrate/20140207083213_add_missing_unique_indices.acts_as_taggable_on_engine.rb b/rails/db/migrate/20140207083213_add_missing_unique_indices.acts_as_taggable_on_engine.rb deleted file mode 100644 index d07eb1d9a0c8b76651fbdc99d25a2b7294816dbc..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20140207083213_add_missing_unique_indices.acts_as_taggable_on_engine.rb +++ /dev/null @@ -1,23 +0,0 @@ -# -*- encoding : utf-8 -*- -# This migration comes from acts_as_taggable_on_engine (originally 2) -class AddMissingUniqueIndices < ActiveRecord::Migration - - def self.up - add_index :tags, :name, unique: true - - remove_index :taggings, :tag_id - remove_index :taggings, [:taggable_id, :taggable_type, :context] - add_index :taggings, - [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], - unique: true, name: 'taggings_idx' - end - - def self.down - remove_index :tags, :name - - remove_index :taggings, name: 'tagging_idx' - add_index :taggings, :tag_id - add_index :taggings, [:taggable_id, :taggable_type, :context] - end - -end diff --git a/rails/db/migrate/20141008130916_add_sshkey_to_users.rb b/rails/db/migrate/20141008130916_add_sshkey_to_users.rb deleted file mode 100644 index c815d41066406b3e4e01ec8e4321abf6a70fc8b8..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141008130916_add_sshkey_to_users.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddSshkeyToUsers < ActiveRecord::Migration - def change - #memo : rails generate migration add_fieldname_to_tablename fieldname:text, génère ce fichier - add_column :users, :sshkey, :text - end -end diff --git a/rails/db/migrate/20141010090731_add_is_provider_to_users.rb b/rails/db/migrate/20141010090731_add_is_provider_to_users.rb deleted file mode 100644 index 63dd0ad8cbe10c3c99a0c83ad493358b77ffea0e..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141010090731_add_is_provider_to_users.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddIsProviderToUsers < ActiveRecord::Migration - def change - add_column :users, :is_provider, :boolean - end -end diff --git a/rails/db/migrate/20141010091148_add_user_id_to_webapps.rb b/rails/db/migrate/20141010091148_add_user_id_to_webapps.rb deleted file mode 100644 index d054096b7aab62fdb05140b50455c3b6fc9ce641..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141010091148_add_user_id_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddUserIdToWebapps < ActiveRecord::Migration - def change - add_reference :webapps, :user, index: true - end -end diff --git a/rails/db/migrate/20141010092430_create_quotas.rb b/rails/db/migrate/20141010092430_create_quotas.rb deleted file mode 100644 index 5f1c9c8513e9d2a8ab75d7b601f4fce21d71fc96..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141010092430_create_quotas.rb +++ /dev/null @@ -1,12 +0,0 @@ -# -*- encoding : utf-8 -*- -class CreateQuotas < ActiveRecord::Migration - def change - create_table :quotas, :id => false do |t| - t.references :user, index: true, :null => false - t.references :webapp, index: true, :null => false - t.integer :quantity - t.timestamps - end - add_index(:quotas, [:user_id, :webapp_id], :unique => true) - end -end diff --git a/rails/db/migrate/20141017084559_add_default_quota_to_webapps.rb b/rails/db/migrate/20141017084559_add_default_quota_to_webapps.rb deleted file mode 100644 index d1bc9ceb86fc4cbab2c3ee8c7f6d12183ef30875..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141017084559_add_default_quota_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddDefaultQuotaToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :default_quota, :integer - end -end diff --git a/rails/db/migrate/20141017125252_add_datasize_to_jobs.rb b/rails/db/migrate/20141017125252_add_datasize_to_jobs.rb deleted file mode 100644 index 785f18e8552242166b94f8a6a527f66a1e8f9e23..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141017125252_add_datasize_to_jobs.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddDatasizeToJobs < ActiveRecord::Migration - def change - add_column :jobs, :datasize, :long - end -end diff --git a/rails/db/migrate/20141021122513_change_description_format_in_webapps.rb b/rails/db/migrate/20141021122513_change_description_format_in_webapps.rb deleted file mode 100644 index d098095a5bcca63c798e84e099b37d06be624ce0..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141021122513_change_description_format_in_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class ChangeDescriptionFormatInWebapps < ActiveRecord::Migration - def change - change_column :webapps, :description, :text - end -end diff --git a/rails/db/migrate/20141021132048_add_not_null_constraint.rb b/rails/db/migrate/20141021132048_add_not_null_constraint.rb deleted file mode 100644 index c1a6397b1c1906c6b014c60f3f2759cf2f919ac3..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141021132048_add_not_null_constraint.rb +++ /dev/null @@ -1,9 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddNotNullConstraint < ActiveRecord::Migration - def change - change_column_null(:quotas, :user_id, true) - change_column_null(:quotas, :webapp_id, true) - change_column_null(:jobs, :webapp_id, true) - change_column_null(:jobs, :user_id, true) - end -end diff --git a/rails/db/migrate/20141022075533_add_status_to_webapps.rb b/rails/db/migrate/20141022075533_add_status_to_webapps.rb deleted file mode 100644 index af2ea21d60b95d138595ab7803bff52b983da3d3..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141022075533_add_status_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddStatusToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :status, :integer - end -end diff --git a/rails/db/migrate/20141022082415_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/rails/db/migrate/20141022082415_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb deleted file mode 100644 index 3e75195988bf99ac7a30d1949cfa4e1ff8ab6117..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141022082415_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +++ /dev/null @@ -1,16 +0,0 @@ -# -*- encoding : utf-8 -*- -# This migration comes from acts_as_taggable_on_engine (originally 3) -class AddTaggingsCounterCacheToTags < ActiveRecord::Migration - def self.up - add_column :tags, :taggings_count, :integer, default: 0 - - ActsAsTaggableOn::Tag.reset_column_information - ActsAsTaggableOn::Tag.find_each do |tag| - ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings) - end - end - - def self.down - remove_column :tags, :taggings_count - end -end diff --git a/rails/db/migrate/20141022082416_add_missing_taggable_index.acts_as_taggable_on_engine.rb b/rails/db/migrate/20141022082416_add_missing_taggable_index.acts_as_taggable_on_engine.rb deleted file mode 100644 index a97bd12b4ae96c1438765a2411b9e4723c59f728..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141022082416_add_missing_taggable_index.acts_as_taggable_on_engine.rb +++ /dev/null @@ -1,11 +0,0 @@ -# -*- encoding : utf-8 -*- -# This migration comes from acts_as_taggable_on_engine (originally 4) -class AddMissingTaggableIndex < ActiveRecord::Migration - def self.up - add_index :taggings, [:taggable_id, :taggable_type, :context] - end - - def self.down - remove_index :taggings, [:taggable_id, :taggable_type, :context] - end -end diff --git a/rails/db/migrate/20141029162743_add_port_to_webapps.rb b/rails/db/migrate/20141029162743_add_port_to_webapps.rb deleted file mode 100644 index c339d7cd368b79d39104dec2b8714ea478045cdc..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141029162743_add_port_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddPortToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :port, :integer - end -end diff --git a/rails/db/migrate/20141030133858_alter_table_webapps.rb b/rails/db/migrate/20141030133858_alter_table_webapps.rb deleted file mode 100644 index a030bb4089d4c1e8e83f7ac9886f0a6b76609a16..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141030133858_alter_table_webapps.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding : utf-8 -*- -class AlterTableWebapps < ActiveRecord::Migration - def change - remove_column :webapps, :port - add_column :webapps, :ipadress, :string - end -end diff --git a/rails/db/migrate/20141104141320_create_docker_os.rb b/rails/db/migrate/20141104141320_create_docker_os.rb deleted file mode 100644 index 48be70ca136cc16d8842a6f9b5e259de7b629c1b..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141104141320_create_docker_os.rb +++ /dev/null @@ -1,9 +0,0 @@ -# -*- encoding : utf-8 -*- -class CreateDockerOs < ActiveRecord::Migration - def change - create_table :docker_os do |t| - t.string :name - t.float :version - end - end -end diff --git a/rails/db/migrate/20141104142342_add_os_docker_and_version_to_webapps.rb b/rails/db/migrate/20141104142342_add_os_docker_and_version_to_webapps.rb deleted file mode 100644 index a1010c918663c9180665d424d007806168ef27df..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141104142342_add_os_docker_and_version_to_webapps.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddOsDockerAndVersionToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :version, :float - add_reference :webapps, :docker_os, index: true - end -end diff --git a/rails/db/migrate/20141106093737_add_docker_name_to_docker_os.rb b/rails/db/migrate/20141106093737_add_docker_name_to_docker_os.rb deleted file mode 100644 index 986b44afd85d26c8a2c0f7099d775ae2e127fd26..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141106093737_add_docker_name_to_docker_os.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddDockerNameToDockerOs < ActiveRecord::Migration - def change - add_column :docker_os, :docker_name, :string - change_column :docker_os, :version, :string - end -end diff --git a/rails/db/migrate/20141106152358_create_ssh_keys.rb b/rails/db/migrate/20141106152358_create_ssh_keys.rb deleted file mode 100644 index c8cd3ebc4bd3c64976010ebcdc82ca2694068b19..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141106152358_create_ssh_keys.rb +++ /dev/null @@ -1,12 +0,0 @@ -# -*- encoding : utf-8 -*- -class CreateSshKeys < ActiveRecord::Migration - def change - create_table :ssh_keys do |t| - t.text :value - t.string :name - t.references :user, index: true - - t.timestamps - end - end -end diff --git a/rails/db/migrate/20141119101332_add_docker_name_to_webapps.rb b/rails/db/migrate/20141119101332_add_docker_name_to_webapps.rb deleted file mode 100644 index 33ae0addbfeb7f551f703cca60531e1d8d4dcd32..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141119101332_add_docker_name_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddDockerNameToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :docker_name, :string - end -end diff --git a/rails/db/migrate/20141127103850_create_webapp_parameters.rb b/rails/db/migrate/20141127103850_create_webapp_parameters.rb deleted file mode 100644 index 9ffec494072a0569eeaa08a6b8e42f60e12aab68..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141127103850_create_webapp_parameters.rb +++ /dev/null @@ -1,11 +0,0 @@ -# -*- encoding : utf-8 -*- -class CreateWebappParameters < ActiveRecord::Migration - def change - create_table :webapp_parameters do |t| - t.string :value - t.string :name - t.string :detail - t.references :webapp, index: true - end - end -end diff --git a/rails/db/migrate/20141205160149_create_webapp_demos.rb b/rails/db/migrate/20141205160149_create_webapp_demos.rb deleted file mode 100644 index f027d634f5c1dedcf8e677445a95f7912eafe654..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141205160149_create_webapp_demos.rb +++ /dev/null @@ -1,12 +0,0 @@ -# -*- encoding : utf-8 -*- -class CreateWebappDemos < ActiveRecord::Migration - def change - create_table :webapp_demos do |t| - t.string :name - t.string :extension - t.string :type #input - output - t.references :webapp, index: true - end - end -end - diff --git a/rails/db/migrate/20141205163005_alter_table_webapp_demos.rb b/rails/db/migrate/20141205163005_alter_table_webapp_demos.rb deleted file mode 100644 index 33d3624863548f2473b484b1442351c651d6d2ce..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141205163005_alter_table_webapp_demos.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding : utf-8 -*- -class AlterTableWebappDemos < ActiveRecord::Migration - def change - remove_column :webapp_demos, :type - add_column :webapp_demos, :file_type, :string - end -end diff --git a/rails/db/migrate/20141211141519_add_readme_to_webapps.rb b/rails/db/migrate/20141211141519_add_readme_to_webapps.rb deleted file mode 100644 index a0230eec65ceef7d19c09f69c9093049e212bbe2..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20141211141519_add_readme_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddReadmeToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :readme, :boolean, default: false - end -end diff --git a/rails/db/migrate/20150107140639_add_entrypoint_to_webapp.rb b/rails/db/migrate/20150107140639_add_entrypoint_to_webapp.rb deleted file mode 100644 index b84ee9e26f36b2419f0825e9f188ed545ba79ac5..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150107140639_add_entrypoint_to_webapp.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding : utf-8 -*- -class AddEntrypointToWebapp < ActiveRecord::Migration - def change - add_column :webapps, :entrypoint, :string - remove_column :users, :is_provider - end -end diff --git a/rails/db/migrate/20150414144903_change_collation_for_tag_names.acts_as_taggable_on_engine.rb b/rails/db/migrate/20150414144903_change_collation_for_tag_names.acts_as_taggable_on_engine.rb deleted file mode 100644 index bfb06bc7cda48c12580961fc53373a6153ac7f68..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150414144903_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from acts_as_taggable_on_engine (originally 5) -# This migration is added to circumvent issue #623 and have special characters -# work properly -class ChangeCollationForTagNames < ActiveRecord::Migration - def up - if ActsAsTaggableOn::Utils.using_mysql? - execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;") - end - end -end diff --git a/rails/db/migrate/20150604131745_create_nodes.rb b/rails/db/migrate/20150604131745_create_nodes.rb deleted file mode 100644 index a3daf7a9423db333c834306e7bad11797732498b..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150604131745_create_nodes.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateNodes < ActiveRecord::Migration - def change - create_table :nodes do |t| - t.string :name - t.string :ip_address - t.references :user, index: true - end - end -end - - # def up - # remove_reference :nodes, :user - # add_reference :nodes, :user, index: true, foreign_key: true - # change_column_null :nodes, :name, false - # change_column_null :nodes, :ip_address, false - # end diff --git a/rails/db/migrate/20150709081509_create_active_admin_comments.rb b/rails/db/migrate/20150709081509_create_active_admin_comments.rb deleted file mode 100644 index 1e9e221c32e06304a00d314f67f287732f4d8572..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150709081509_create_active_admin_comments.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateActiveAdminComments < ActiveRecord::Migration - def change - create_table :active_admin_comments do |t| - t.string :namespace - t.text :body - t.string :resource_id, null: false - t.string :resource_type, null: false - t.references :author, polymorphic: true - t.timestamps - end - add_index :active_admin_comments, [:namespace] - add_index :active_admin_comments, [:author_type, :author_id] - add_index :active_admin_comments, [:resource_type, :resource_id] - end -end diff --git a/rails/db/migrate/20150720144543_create_webapp_version.rb b/rails/db/migrate/20150720144543_create_webapp_version.rb deleted file mode 100644 index d96cc7daff2ee16364457adc00856959be674731..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150720144543_create_webapp_version.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateWebappVersion < ActiveRecord::Migration - def change - create_table :webapp_versions do |t| - t.float :number - t.string :changelog - t.timestamps - t.references :webapp, index: true - end - end -end - diff --git a/rails/db/migrate/20150728131254_remove_version_from_webapps.rb b/rails/db/migrate/20150728131254_remove_version_from_webapps.rb deleted file mode 100644 index 7d4164f6faaa8638c020a9f97a97e1fdc5e6659f..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150728131254_remove_version_from_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveVersionFromWebapps < ActiveRecord::Migration - def change - remove_column :webapps, :version - add_timestamps :nodes - end -end diff --git a/rails/db/migrate/20150729122125_add_version_to_jobs.rb b/rails/db/migrate/20150729122125_add_version_to_jobs.rb deleted file mode 100644 index 30dd9332d364d92e76e75f0935c06d655b0a3fff..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150729122125_add_version_to_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddVersionToJobs < ActiveRecord::Migration - def change - add_column :jobs, :version, :float - end -end diff --git a/rails/db/migrate/20150911131427_add_demo_to_webapps.rb b/rails/db/migrate/20150911131427_add_demo_to_webapps.rb deleted file mode 100644 index a8b55c3e328ee0719c9c8464413fdf3739cebd6f..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150911131427_add_demo_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddDemoToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :input_demo, :string - add_column :webapps, :output_demo, :string - end -end diff --git a/rails/db/migrate/20150921155205_alter_table_webapp_versions.rb b/rails/db/migrate/20150921155205_alter_table_webapp_versions.rb deleted file mode 100644 index 987ff37b6d63efb4b76795ec3c0afe8bd615d3e8..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20150921155205_alter_table_webapp_versions.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AlterTableWebappVersions < ActiveRecord::Migration - def change - change_column :webapp_versions, :number, :string - end -end diff --git a/rails/db/migrate/20151116101606_add_avg_job_time_column_to_webapps.rb b/rails/db/migrate/20151116101606_add_avg_job_time_column_to_webapps.rb deleted file mode 100644 index 47204668a858d5a06ebfffeb1980db722d70dde5..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20151116101606_add_avg_job_time_column_to_webapps.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddAvgJobTimeColumnToWebapps < ActiveRecord::Migration - def change - add_column :webapps, :exec_time, :float - end -end diff --git a/rails/db/migrate/20151116101627_add_exec_time_column_to_jobs.rb b/rails/db/migrate/20151116101627_add_exec_time_column_to_jobs.rb deleted file mode 100644 index b25bb4fa1a2f5f5b44fcaccc29a868bfe257df5f..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20151116101627_add_exec_time_column_to_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddExecTimeColumnToJobs < ActiveRecord::Migration - def change - add_column :jobs, :exec_time, :float - end -end diff --git a/rails/db/migrate/20151130155240_create_datasets.rb b/rails/db/migrate/20151130155240_create_datasets.rb deleted file mode 100644 index 9554f8541dfcbec38c4f1df363acbcbf8efd54c1..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20151130155240_create_datasets.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateDatasets < ActiveRecord::Migration - def change - create_table :datasets do |t| - t.string :name, null: false - t.integer :size - t.string :extension - t.references :user - t.timestamps null: false - end - end -end diff --git a/rails/db/migrate/20151229152428_add_file_name_to_datasets.rb b/rails/db/migrate/20151229152428_add_file_name_to_datasets.rb deleted file mode 100644 index 46c607fc60d92cd39aaf378b29d6b9a01a60f67b..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20151229152428_add_file_name_to_datasets.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddFileNameToDatasets < ActiveRecord::Migration - def change - add_column :datasets, :file_name, :string - end -end diff --git a/rails/db/migrate/20151229152519_remove_exec_time.rb b/rails/db/migrate/20151229152519_remove_exec_time.rb deleted file mode 100644 index f51c38652d9e025b2bfa5124cc0214d670e36445..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20151229152519_remove_exec_time.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveExecTime < ActiveRecord::Migration - def change - remove_column :webapps, :exec_time - remove_column :jobs, :exec_time - - add_column :jobs, :exec_time, :integer - add_column :webapps, :exec_time, :integer - end -end diff --git a/rails/db/migrate/20160106094607_change_datasize_format_in_jobs.rb b/rails/db/migrate/20160106094607_change_datasize_format_in_jobs.rb deleted file mode 100644 index a0ac16e5f58b5d7c3161fb1db166b5f746eb2f0b..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160106094607_change_datasize_format_in_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ChangeDatasizeFormatInJobs < ActiveRecord::Migration - def change - change_column :jobs, :datasize, :integer - end -end diff --git a/rails/db/migrate/20160115143931_alter_table_jobs.rb b/rails/db/migrate/20160115143931_alter_table_jobs.rb deleted file mode 100644 index acd1d63efd890316c11d5e56ebb991aa8f72edb4..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160115143931_alter_table_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AlterTableJobs < ActiveRecord::Migration - def change - change_column :jobs, :version, :string - end -end diff --git a/rails/db/migrate/20160118104655_recreate_quotas.rb b/rails/db/migrate/20160118104655_recreate_quotas.rb deleted file mode 100644 index fe7b4a7f9bea9269fc2c60dbefb1dcbf060c411e..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160118104655_recreate_quotas.rb +++ /dev/null @@ -1,11 +0,0 @@ -class RecreateQuotas < ActiveRecord::Migration - def change - drop_table :quotas - create_table :quotas do |t| - t.references :user, index: true, null: false - t.references :webapp, null: false - t.integer :quantity - t.timestamps - end - end -end diff --git a/rails/db/migrate/20160118110439_alter_table_quotas.rb b/rails/db/migrate/20160118110439_alter_table_quotas.rb deleted file mode 100644 index c92aa9b6ba4f21efd7a1554654016522c2c5cb5d..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160118110439_alter_table_quotas.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AlterTableQuotas < ActiveRecord::Migration - def change - change_column :quotas, :quantity, :integer, :limit => 8 - end -end diff --git a/rails/db/migrate/20160118140700_remove_column_from_webapps.rb b/rails/db/migrate/20160118140700_remove_column_from_webapps.rb deleted file mode 100644 index 5569938242174116aadd017918db2146cb386214..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160118140700_remove_column_from_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -class RemoveColumnFromWebapps < ActiveRecord::Migration - def change - remove_column :webapps, :input_demo - remove_column :webapps, :output_demo - end -end diff --git a/rails/db/migrate/20160127163056_add_size_generated_data_to_jobs.rb b/rails/db/migrate/20160127163056_add_size_generated_data_to_jobs.rb deleted file mode 100644 index 0dde1e6536e7a58f23ebbbc9af6768ffe34d2e9e..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160127163056_add_size_generated_data_to_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSizeGeneratedDataToJobs < ActiveRecord::Migration - def change - add_column :jobs, :size_generated_data, :integer - end -end diff --git a/rails/db/migrate/20160208091638_add_missing_indexes.acts_as_taggable_on_engine.rb b/rails/db/migrate/20160208091638_add_missing_indexes.acts_as_taggable_on_engine.rb deleted file mode 100644 index 12f3747a6876fdb47596aa4d580365a67bf3f611..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160208091638_add_missing_indexes.acts_as_taggable_on_engine.rb +++ /dev/null @@ -1,13 +0,0 @@ -# This migration comes from acts_as_taggable_on_engine (originally 6) -class AddMissingIndexes < ActiveRecord::Migration - def change - add_index :taggings, :tag_id - add_index :taggings, :taggable_id - add_index :taggings, :taggable_type - add_index :taggings, :tagger_id - add_index :taggings, :context - - add_index :taggings, [:tagger_id, :tagger_type] - add_index :taggings, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy' - end -end diff --git a/rails/db/migrate/20160629091308_add_private_to_webapps.rb b/rails/db/migrate/20160629091308_add_private_to_webapps.rb deleted file mode 100644 index 6be654e5dc51efe069aa2b2c3b4b746c4b4756c6..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160629091308_add_private_to_webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddPrivateToWebapps < ActiveRecord::Migration[5.0] - def change - add_column :webapps, :private, :boolean - add_column :webapps, :access_token, :string - end -end diff --git a/rails/db/migrate/20160729142937_add_docker_image_size_to_webapp_demos.rb b/rails/db/migrate/20160729142937_add_docker_image_size_to_webapp_demos.rb deleted file mode 100644 index 27838b78b132591c89b3b8d7d8dd99155d5bc0dc..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160729142937_add_docker_image_size_to_webapp_demos.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDockerImageSizeToWebappDemos < ActiveRecord::Migration[5.0] - def change - add_column :webapp_demos, :docker_image_size, :float - end -end diff --git a/rails/db/migrate/20160803100931_add_ipaddress_to_jobs.rb b/rails/db/migrate/20160803100931_add_ipaddress_to_jobs.rb deleted file mode 100644 index 8aac7f977fd2cca5bde08f6c1a1391924a2cb6be..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160803100931_add_ipaddress_to_jobs.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddIpaddressToJobs < ActiveRecord::Migration[5.0] - def change - add_column :jobs, :ipaddress, :string - end -end diff --git a/rails/db/migrate/20160831151733_create_job_uploads.rb b/rails/db/migrate/20160831151733_create_job_uploads.rb deleted file mode 100644 index 1c93f2f2fa12466e82babbdbde6ef6abaae632fa..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160831151733_create_job_uploads.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateJobUploads < ActiveRecord::Migration[5.0] - def change - create_table :job_uploads do |t| - t.attachment :job_file - t.string :type - t.references :job - end - end -end diff --git a/rails/db/migrate/20160902142127_add_access_token_to_job_upload.rb b/rails/db/migrate/20160902142127_add_access_token_to_job_upload.rb deleted file mode 100644 index c466a01d41081638c6eda11b904200fc4f02f8a8..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160902142127_add_access_token_to_job_upload.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddAccessTokenToJobUpload < ActiveRecord::Migration[5.0] - def change - add_column :job_uploads, :access_token, :string - end -end diff --git a/rails/db/migrate/20160902145057_add_access_token_to_job.rb b/rails/db/migrate/20160902145057_add_access_token_to_job.rb deleted file mode 100644 index 0fa49863ac129f9e46ab02b7671bc6d3e70a5aae..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160902145057_add_access_token_to_job.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddAccessTokenToJob < ActiveRecord::Migration[5.0] - def change - add_column :jobs, :access_token, :string - remove_column :job_uploads, :access_token - end -end diff --git a/rails/db/migrate/20160927081738_remove_unused_column.rb b/rails/db/migrate/20160927081738_remove_unused_column.rb deleted file mode 100644 index 88b5361cb027c31fde9c8a10f3fed93a6fe66beb..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20160927081738_remove_unused_column.rb +++ /dev/null @@ -1,7 +0,0 @@ -class RemoveUnusedColumn < ActiveRecord::Migration[5.0] - def change - remove_column :jobs, :datafile - remove_column :webapp_demos, :docker_image_size - add_column :webapp_versions, :docker_image_size, :float - end -end diff --git a/rails/db/migrate/20161123181405_add_webapp_state.rb b/rails/db/migrate/20161123181405_add_webapp_state.rb deleted file mode 100644 index ecb2c51e903fe775ee2866fa572de9f64b848c32..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20161123181405_add_webapp_state.rb +++ /dev/null @@ -1,46 +0,0 @@ -class AddWebappState < ActiveRecord::Migration[5.0] - def up - # replace webapps.ipadress with webapps.sandbox_state - add_column :webapps, :sandbox_state, :integer, null: false, default: 0 - remove_column :webapps, :ipadress - - # replace webapps.status with webapp_versions.{state, published} - add_column :webapp_versions, :state, :integer, null: false, default: 0 - execute("UPDATE webapp_versions, webapps SET state=2") - add_column :webapp_versions, :published, :boolean, null: false, default: 0 - execute("UPDATE webapp_versions, webapps SET published=1 WHERE webapps.id=webapp_versions.webapp_id AND status=2") - remove_column :webapps, :status - - # replace job.status with job.state - add_column :jobs, :state, :integer, null: false, default: 0 - execute('UPDATE jobs SET state=255') - execute('UPDATE jobs SET state=1 WHERE status="new"') - execute('UPDATE jobs SET state=2 WHERE status="in progress"') - execute('UPDATE jobs SET state=3 WHERE status="finish"') - execute('UPDATE jobs SET state=4 WHERE status="archived"') - remove_column :jobs, :status - - end - - def down - # job.status - add_column :jobs, :status, :string, default: "new" - execute('UPDATE jobs SET status=NULL') - execute('UPDATE jobs SET status="new" WHERE state=1') - execute('UPDATE jobs SET status="in progress" WHERE state=2') - execute('UPDATE jobs SET status="finish" WHERE state=3') - execute('UPDATE jobs SET status="archived" WHERE state=4') - remove_column :jobs, :state - - # webapps.status - add_column :webapps, :status, :integer - execute("UPDATE webapps SET status=0") - execute("UPDATE webapp_versions, webapps SET status=2 WHERE webapps.id=webapp_versions.webapp_id AND published=1") - remove_column :webapp_versions, :published - remove_column :webapp_versions, :state - - # webapps.ipadress - add_column :webapps, :ipadress, :string - remove_column :webapps, :sandbox_state - end -end diff --git a/rails/db/migrate/20170111164440_add_docker_os_names.rb b/rails/db/migrate/20170111164440_add_docker_os_names.rb deleted file mode 100644 index 65f1833d98bf11deee79a35c7db2d952761cfa1d..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20170111164440_add_docker_os_names.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddDockerOsNames < ActiveRecord::Migration[5.0] - def up - execute('UPDATE docker_os SET docker_name=name WHERE docker_name IS NULL OR docker_name=""') - end -end diff --git a/rails/db/migrate/20170221141247_add_sandbox_version.rb b/rails/db/migrate/20170221141247_add_sandbox_version.rb deleted file mode 100644 index e2fd2647ed7cab9d80a242e953d093b56fdcccbd..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20170221141247_add_sandbox_version.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddSandboxVersion < ActiveRecord::Migration[5.0] - def change - add_column :webapps, :sandbox_version_id, :integer - end -end diff --git a/rails/db/migrate/20170706111647_drop_sshkeys.rb b/rails/db/migrate/20170706111647_drop_sshkeys.rb deleted file mode 100644 index 255161bf7442f0042d59362fbb49d4e8c49d657d..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20170706111647_drop_sshkeys.rb +++ /dev/null @@ -1,5 +0,0 @@ -class DropSshkeys < ActiveRecord::Migration[5.0] - def change - drop_table :ssh_keys - end -end diff --git a/rails/db/migrate/20170706152531_drop_admin_users.rb b/rails/db/migrate/20170706152531_drop_admin_users.rb deleted file mode 100644 index d25af310684dc1b076351a83126bcc333df54266..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20170706152531_drop_admin_users.rb +++ /dev/null @@ -1,6 +0,0 @@ -class DropAdminUsers < ActiveRecord::Migration[5.0] - def change - drop_table :admin_users - drop_table :active_admin_comments - end -end diff --git a/rails/db/migrate/20170706162853_drop_nodes.rb b/rails/db/migrate/20170706162853_drop_nodes.rb deleted file mode 100644 index b79adefc611deb33e2d806a3d9872506c6029bbe..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20170706162853_drop_nodes.rb +++ /dev/null @@ -1,5 +0,0 @@ -class DropNodes < ActiveRecord::Migration[5.0] - def change - drop_table :nodes - end -end diff --git a/rails/db/migrate/20171031145600_add_container_id_to_job.rb b/rails/db/migrate/20171031145600_add_container_id_to_job.rb deleted file mode 100644 index 2eed11ca19166a8b637a6647607fd91e1d4fbff0..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20171031145600_add_container_id_to_job.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddContainerIdToJob < ActiveRecord::Migration[5.0] - def change - add_column :jobs, :container_id, :string, limit: 64 - end -end diff --git a/rails/db/migrate/20171115133031_create_job_queues.rb b/rails/db/migrate/20171115133031_create_job_queues.rb deleted file mode 100644 index c92bfd115b2f5384b25f043bf24422c7e5eec3d2..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20171115133031_create_job_queues.rb +++ /dev/null @@ -1,26 +0,0 @@ -class CreateJobQueues < ActiveRecord::Migration[5.0] - def up - create_table :job_queues do |t| - t.string :name, null: false - t.integer :timeout - t.boolean :is_default, null: false, default: false - - t.timestamps - end - add_column :jobs, :queue_id, :integer, null: false - add_column :webapps, :default_job_queue_id, :integer, null: false - - execute('INSERT INTO job_queues (id, name, is_default, created_at, updated_at) - VALUES (1, "default", 1, now(), now());') - - execute('UPDATE jobs SET queue_id=1') - execute('UPDATE webapps SET default_job_queue_id=1') - - end - - def down - remove_column :webapps, :default_job_queue_id - remove_column :jobs, :queue_id - drop_table :job_queues - end -end diff --git a/rails/db/migrate/20171116132928_add_memory_limit.rb b/rails/db/migrate/20171116132928_add_memory_limit.rb deleted file mode 100644 index 751aab9b42ef9f98549c8220074bcef482a18247..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20171116132928_add_memory_limit.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddMemoryLimit < ActiveRecord::Migration[5.0] - def change - add_column :webapps, :memory_limit, :integer, limit: 8 - end -end diff --git a/rails/db/migrate/20171116161215_add_job_result.rb b/rails/db/migrate/20171116161215_add_job_result.rb deleted file mode 100644 index c9a951f217ccb102bacb793d78be6373af0897a4..0000000000000000000000000000000000000000 --- a/rails/db/migrate/20171116161215_add_job_result.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AddJobResult < ActiveRecord::Migration[5.0] - def up - add_column :jobs, :result, :integer, default: 0, null: false - # set result=SUCCESS for all terminated jobs - execute 'UPDATE jobs SET result=1 WHERE state IN (3, 4);' - end - def down - remove_column :jobs, :result - end -end diff --git a/rails/db/schema.rb b/rails/db/schema.rb deleted file mode 100644 index e308b704e22101d9b860d9642331a9cf27b0a7ac..0000000000000000000000000000000000000000 --- a/rails/db/schema.rb +++ /dev/null @@ -1,181 +0,0 @@ -# This file is auto-generated from the current state of the database. Instead -# of editing this file, please use the migrations feature of Active Record to -# incrementally modify your database, and then regenerate this schema definition. -# -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). -# -# It's strongly recommended that you check this file into your version control system. - -ActiveRecord::Schema.define(version: 20171116161215) do - - create_table "datasets", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "name", null: false - t.integer "size" - t.string "extension" - t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "file_name" - end - - create_table "docker_os", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "name" - t.string "version" - t.string "docker_name" - end - - create_table "job_queues", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "name", null: false - t.integer "timeout" - t.boolean "is_default", default: false, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - create_table "job_uploads", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci" do |t| - t.string "job_file_file_name" - t.string "job_file_content_type" - t.integer "job_file_file_size" - t.datetime "job_file_updated_at" - t.string "type" - t.integer "job_id" - t.index ["job_id"], name: "index_job_uploads_on_job_id", using: :btree - end - - create_table "jobs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.integer "webapp_id" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "param" - t.integer "datasize" - t.string "version" - t.integer "exec_time" - t.integer "size_generated_data" - t.string "ipaddress" - t.string "access_token" - t.integer "state", default: 0, null: false - t.string "container_id", limit: 64 - t.integer "queue_id", null: false - t.integer "result", default: 0, null: false - end - - create_table "quotas", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.integer "user_id", null: false - t.integer "webapp_id", null: false - t.bigint "quantity" - t.datetime "created_at" - t.datetime "updated_at" - t.index ["user_id"], name: "index_quotas_on_user_id", using: :btree - end - - create_table "taggings", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context", limit: 128 - t.datetime "created_at" - t.index ["context"], name: "index_taggings_on_context", using: :btree - t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree - t.index ["tag_id"], name: "index_taggings_on_tag_id", using: :btree - t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree - t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy", using: :btree - t.index ["taggable_id"], name: "index_taggings_on_taggable_id", using: :btree - t.index ["taggable_type"], name: "index_taggings_on_taggable_type", using: :btree - t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type", using: :btree - t.index ["tagger_id"], name: "index_taggings_on_tagger_id", using: :btree - end - - create_table "tags", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "name", collation: "utf8_bin" - t.integer "taggings_count", default: 0 - t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree - end - - create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.string "reset_password_token" - t.datetime "reset_password_sent_at" - t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0, null: false - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "admin", default: false - t.string "confirmation_token" - t.datetime "confirmed_at" - t.datetime "confirmation_sent_at" - t.text "sshkey", limit: 65535 - t.string "auth_token" - t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree - t.index ["email"], name: "index_users_on_email", unique: true, using: :btree - t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree - end - - create_table "webapp_demos", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "name" - t.string "extension" - t.integer "webapp_id" - t.string "file_type" - t.index ["webapp_id"], name: "index_webapp_demos_on_webapp_id", using: :btree - end - - create_table "webapp_parameters", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "value" - t.string "name" - t.string "detail" - t.integer "webapp_id" - t.index ["webapp_id"], name: "index_webapp_parameters_on_webapp_id", using: :btree - end - - create_table "webapp_versions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "number" - t.string "changelog" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "webapp_id" - t.float "docker_image_size", limit: 24 - t.integer "state", default: 0, null: false - t.boolean "published", default: false, null: false - t.index ["webapp_id"], name: "index_webapp_versions_on_webapp_id", using: :btree - end - - create_table "webapps", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.string "name" - t.text "description", limit: 65535 - t.string "contact" - t.datetime "created_at" - t.datetime "updated_at" - t.string "logo_file_name" - t.string "logo_content_type" - t.integer "logo_file_size" - t.datetime "logo_updated_at" - t.integer "user_id" - t.integer "default_quota" - t.integer "docker_os_id" - t.string "docker_name" - t.boolean "readme", default: false - t.string "entrypoint" - t.integer "exec_time" - t.boolean "private" - t.string "access_token" - t.integer "sandbox_state", default: 0, null: false - t.integer "sandbox_version_id" - t.integer "default_job_queue_id", null: false - t.bigint "memory_limit" - t.index ["docker_os_id"], name: "index_webapps_on_docker_os_id", using: :btree - t.index ["name"], name: "index_webapps_on_name", unique: true, using: :btree - t.index ["user_id"], name: "index_webapps_on_user_id", using: :btree - end - -end diff --git a/rails/db/seeds.rb b/rails/db/seeds.rb deleted file mode 100644 index a108d956a3a3f3b65c1ea4f836c9512cbd1b61c6..0000000000000000000000000000000000000000 --- a/rails/db/seeds.rb +++ /dev/null @@ -1,48 +0,0 @@ -# -*- encoding : utf-8 -*- -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) -# Mayor.create(name: 'Emanuel', city: cities.first) - - -DockerOs.create([ - # NOTE debian:7 has to be present because it is hardcoded as the default image - { name: "debian", docker_name: "debian", version: "8"}, - { name: "debian", docker_name: "debian", version: "9"}, - { name: "centos", docker_name: "centos", version: "6"}, - { name: "fedora", docker_name: "fedora", version: "20"}, - { name: "ubuntu", docker_name: "ubuntu", version: "14.04"}, -]) - -JobQueue.create!(name: "default", is_default: true) - -if Rails.env.development? - - now = Time.zone.now - User.create( - email: "anthony.baire@irisa.fr", - password: "qzfyplzfy;rsty;l", - encrypted_password: "$2a$10$36P5wHY0fuRIny1y6sN/y.kh/0ow5ZEQyhSxolrRxxlablEkW6lw2", - admin: 1, - sshkey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwUS3knoJ3/Mqrc9B9CWih+VglNfcuz7Tr0beiIuCSwvu+9+hLIA2mjcdhjGzuAvJ1jepktxpWPe0PrpJ8vaG8nw/L8jG3Rt6SIwwXZVumeWqH/I/kGEk4ieE0bkqypCXIxAh748KEqW75gsZqmBaONl9sX5NqabhWmZImM1A/5l3kbyQWKYt+6wSLmtldd9saVkqhUtV1IJGgN0bNYTs7npyUYWSNNWFMM+3lhpiGN+QgUsralnXF67nVRlC/o8mZN3zyeT4dnThLZJkttycDgQTovgFRkhd2tNo08iVhzaX4KlwNDEeZzhPl5dXI6pquxlMKoOZku1yzwrtkvMCn\n", - created_at: now, - confirmed_at: now, -# auth_token: 37010bc3b9834f28ae6dd5023c5efb4a - ) - - User.create( - email: "benoit.guillou@inria.fr", - password: "qzfyplzfy;rsty;l", - encrypted_password: "$2a$10$j1t6f..YD784kcfyB4wksuZjt6y6Q.lCuIcv.2E6noZSFxfAf2ni6", - admin: 1, - sshkey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOT2kQqfsp9jqExS39v8/fV0+gh9RW27hN+Ef8yCwoMeEhWlcBX8MtEnpMjpkbNq84b16sR2mmA5ZpD6s6H1FK2R8ArZGrRiuHtbhbbrovBz86Z1pkO5Y8HF4ouNf/dwlOY/Vrp+1ybIdAIkBhwbObJOubUgWBnp4cuaJ3WClHJZB8HON7P0DNNtDJMbhzc8g8MRUMniq4wI+MmREtBuDnMolczPgElA6gIZ6XMEPzp9HGhfg3DPur/lzk691yIQzx5dqEKfEsrlekGWG7pk4dES80daPHNbL86BVl7mRm3O5d9ZDICbQMa6IyEqGEn3rQiUViymDui3vxFCkT7yKF", - created_at: now, - confirmed_at: now, -# auth_token: 37010bc3b9834f28ae6dd5023c5efb4a - ) - - -end diff --git a/rails/db/structure.sql b/rails/db/structure.sql deleted file mode 100644 index 40fb5c8e7051594ee1e2dc152c36342788e72f7d..0000000000000000000000000000000000000000 --- a/rails/db/structure.sql +++ /dev/null @@ -1,45 +0,0 @@ -CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL); -CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version"); -CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime, "updated_at" datetime, "admin" boolean DEFAULT 'f', "confirmation_token" varchar(255), "confirmed_at" datetime, "confirmation_sent_at" datetime); -CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email"); -CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token"); -CREATE TABLE "webapps" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "contact" varchar(255), "created_at" datetime, "updated_at" datetime, "logo_file_name" varchar(255), "logo_content_type" varchar(255), "logo_file_size" integer, "logo_updated_at" datetime); -CREATE UNIQUE INDEX "index_users_on_confirmation_token" ON "users" ("confirmation_token"); -CREATE TABLE "jobs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "datafile" varchar(255), "webapp_id" integer, "user_id" integer, "status" varchar(255) DEFAULT 'new', "created_at" datetime, "updated_at" datetime, "param" varchar(255)); -CREATE UNIQUE INDEX "index_webapps_on_name" ON "webapps" ("name"); -CREATE TABLE "admin_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime, "updated_at" datetime); -CREATE UNIQUE INDEX "index_admin_users_on_email" ON "admin_users" ("email"); -CREATE UNIQUE INDEX "index_admin_users_on_reset_password_token" ON "admin_users" ("reset_password_token"); -CREATE TABLE "active_admin_comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "namespace" varchar(255), "body" text, "resource_id" varchar(255) NOT NULL, "resource_type" varchar(255) NOT NULL, "author_id" integer, "author_type" varchar(255), "created_at" datetime, "updated_at" datetime); -CREATE INDEX "index_active_admin_comments_on_namespace" ON "active_admin_comments" ("namespace"); -CREATE INDEX "index_active_admin_comments_on_author_type_and_author_id" ON "active_admin_comments" ("author_type", "author_id"); -CREATE INDEX "index_active_admin_comments_on_resource_type_and_resource_id" ON "active_admin_comments" ("resource_type", "resource_id"); -CREATE TABLE "tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255)); -CREATE TABLE "taggings" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "tag_id" integer, "taggable_id" integer, "taggable_type" varchar(255), "tagger_id" integer, "tagger_type" varchar(255), "context" varchar(128), "created_at" datetime); -CREATE UNIQUE INDEX "index_tags_on_name" ON "tags" ("name"); -CREATE UNIQUE INDEX "taggings_idx" ON "taggings" ("tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"); -INSERT INTO schema_migrations (version) VALUES ('20131121150637'); - -INSERT INTO schema_migrations (version) VALUES ('20131121152958'); - -INSERT INTO schema_migrations (version) VALUES ('20131121153102'); - -INSERT INTO schema_migrations (version) VALUES ('20131122093548'); - -INSERT INTO schema_migrations (version) VALUES ('20131122100843'); - -INSERT INTO schema_migrations (version) VALUES ('20131122103349'); - -INSERT INTO schema_migrations (version) VALUES ('20131122110002'); - -INSERT INTO schema_migrations (version) VALUES ('20131126145113'); - -INSERT INTO schema_migrations (version) VALUES ('20140205134947'); - -INSERT INTO schema_migrations (version) VALUES ('20140205144848'); - -INSERT INTO schema_migrations (version) VALUES ('20140205144853'); - -INSERT INTO schema_migrations (version) VALUES ('20140207083212'); - -INSERT INTO schema_migrations (version) VALUES ('20140207083213'); diff --git a/rails/deploy/docker/npm/etc/apt/sources.list.d/nodesource.list b/rails/deploy/docker/npm/etc/apt/sources.list.d/nodesource.list deleted file mode 100644 index e4c88a6d2ce5f41ea9c5535383f16b5bc2115f6d..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/npm/etc/apt/sources.list.d/nodesource.list +++ /dev/null @@ -1 +0,0 @@ -deb https://deb.nodesource.com/node_6.x stretch main diff --git a/rails/deploy/docker/ruby/install.sh b/rails/deploy/docker/ruby/install.sh deleted file mode 100644 index 9cb085ccf2505ccbf34307a8f918962b97bb4039..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/ruby/install.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -set -e -x - -cd /tmp/ - -curl -O https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz -sha256sum -c <<EOF -dac81822325b79c3ba9532b048c2123357d3310b2b40024202f360251d9829b1 ruby-2.5.1.tar.gz -EOF - -tar zxf ruby-2.5.1.tar.gz - -cd ruby-2.5.1 -./configure --prefix=/opt/ruby -make -j4 -make install -rm -rf /tmp/ruby-*; - -cd / - - -echo "gem: --no-rdoc --no-ri" > ~/.gemrc - -#FIXME: why not install them with bundler -gem install bundler rails sidekiq -gem install mysql2 -v 0.3.18 -- --with-mysql-include=/usr/include/mariadb - diff --git a/rails/deploy/docker/ruby/update-pathenv.diff b/rails/deploy/docker/ruby/update-pathenv.diff deleted file mode 100644 index f1255be65708901337f5bb0fdf339cd4d1d7f386..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/ruby/update-pathenv.diff +++ /dev/null @@ -1,5 +0,0 @@ ---- etc/login.defs -+++ etc/login.defs -@@ -103 +103 @@ --ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games -+ENV_PATH PATH=/opt/ruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games diff --git a/rails/deploy/docker/setup/dk/container_cron_daily b/rails/deploy/docker/setup/dk/container_cron_daily deleted file mode 100644 index d85e58f0a05a278c6336e7f7f4ad65b10d604d46..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/dk/container_cron_daily +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -e - -prepare-allgo - -# purge old jobs -exec rake allgo:clean_jobs diff --git a/rails/deploy/docker/setup/dk/container_cron_monthly b/rails/deploy/docker/setup/dk/container_cron_monthly deleted file mode 100755 index c7bce797838755ae2a55882f08db575b8fef3733..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/dk/container_cron_monthly +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -e - -prepare-allgo - -# regenerate session key every month -generate-secret diff --git a/rails/deploy/docker/setup/dk/container_init b/rails/deploy/docker/setup/dk/container_init deleted file mode 100644 index 2ec805a2e5c0adb2acbeeda3705bd8ec221b2406..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/dk/container_init +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -if [ -z "$RAILS_ENV" ] -then - echo "error: the RAILS_ENV environment variable is not set (should have something like 'production' or 'development')" >&2 - exit 1 -fi - -if rake db:version 2>/dev/null -then - echo "error: the db is already initialised" >&2 - exit 1 -fi - -set -e -x - -generate-secret - -rake db:setup diff --git a/rails/deploy/docker/setup/dk/container_migrate b/rails/deploy/docker/setup/dk/container_migrate deleted file mode 100644 index c73d75b7342f6d2cf2e61a1c229956f95dad7946..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/dk/container_migrate +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -if [ -z "$RAILS_ENV" ] -then - echo "error: the RAILS_ENV environment variable is not set (should have something like 'production' or 'development')" >&2 - exit 1 -fi - -set -e -x - -prepare-allgo - -rake db:migrate diff --git a/rails/deploy/docker/setup/etc-nginx-conf.diff b/rails/deploy/docker/setup/etc-nginx-conf.diff deleted file mode 100644 index 47ced5a2bf3434c368d736013147091985232530..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/etc-nginx-conf.diff +++ /dev/null @@ -1,34 +0,0 @@ ---- etc/nginx/nginx.conf 2017-07-12 05:44:59.000000000 +0000 -+++ etc/nginx/nginx.conf 2018-04-11 11:41:15.551198709 +0000 -@@ -1,8 +1,9 @@ --user www-data; - worker_processes auto; - pid /run/nginx.pid; - include /etc/nginx/modules-enabled/*.conf; - -+error_log /vol/log/nginx/error.log; -+ - events { - worker_connections 768; - # multi_accept on; -@@ -38,8 +40,18 @@ - # Logging Settings - ## - -- access_log /var/log/nginx/access.log; -- error_log /var/log/nginx/error.log; -+ access_log /vol/log/nginx/access.log; -+ -+ # -+ # Spool paths -+ # -+ # (override defaults in debian/rules) -+ -+ client_body_temp_path /vol/cache/nginx/body; -+ fastcgi_temp_path /vol/cache/nginx/body; -+ proxy_temp_path /vol/cache/nginx/proxy; -+ scgi_temp_path /vol/cache/nginx/scgi; -+ uwsgi_temp_path /vol/cache/nginx/uwsgi; - - ## - # Gzip Settings diff --git a/rails/deploy/docker/setup/etc-redis-conf.diff b/rails/deploy/docker/setup/etc-redis-conf.diff deleted file mode 100644 index 43a4cf2141789f7a9e007836b04338eca8bc7c42..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/etc-redis-conf.diff +++ /dev/null @@ -1,30 +0,0 @@ ---- etc/redis/redis.conf -+++ etc/redis/redis.conf -@@ -34,7 +34,7 @@ - - # By default Redis does not run as a daemon. Use 'yes' if you need it. - # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. --daemonize yes -+daemonize no - - # When running daemonized, Redis writes a pid file in /var/run/redis.pid by - # default. You can specify a custom pid file location here. -@@ -100,7 +100,7 @@ - # Specify the log file name. Also the empty string can be used to force - # Redis to log on the standard output. Note that if you use standard - # output for logging but daemonize, logs will be sent to /dev/null --logfile /var/log/redis/redis-server.log -+logfile /vol/log/redis/redis-server.log - - # To enable logging to the system logger, just set 'syslog-enabled' to yes, - # and optionally update the other syslog parameters to suit your needs. -@@ -184,7 +184,7 @@ - # The Append Only File will also be created inside this directory. - # - # Note that you must specify a directory here, not a file name. --dir /var/lib/redis -+dir /vol/cache/redis - - ################################# REPLICATION ################################# - - diff --git a/rails/deploy/docker/setup/generate-secret b/rails/deploy/docker/setup/generate-secret deleted file mode 100755 index 1b99e64929a7d862dde1d81a734df24e92f5a75e..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/generate-secret +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -mkdir -p /vol/cache - -cd /opt/allgo && rake secret | install -m 0400 /dev/fd/0 /vol/cache/secret_key_base diff --git a/rails/deploy/docker/setup/prepare-allgo b/rails/deploy/docker/setup/prepare-allgo deleted file mode 100755 index 7a89b8e76c3d902f817158630ec2ce093f218127..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/prepare-allgo +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -set -e - -mkdir -p \ - /vol/rw/datastore \ - /vol/rw/app \ - /vol/rw/system \ - /vol/log/nginx \ - /vol/log/rails \ - /vol/log/redis \ - /vol/log/sidekiq \ - /vol/log/supervisor \ - /vol/log/unicorn \ - /vol/cache/redis \ - /vol/cache/nginx \ - -[ -f /vol/cache/secret_key_base ] || generate-secret - diff --git a/rails/deploy/docker/setup/run-allgo b/rails/deploy/docker/setup/run-allgo deleted file mode 100755 index 907356cf875c31c1a1163d460bff42a848e0dab4..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/run-allgo +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -prepare-allgo - -# wait until the mysql server is ready -# (otherwise rails is unable to start) -while ! rails db:version >/dev/null -do - sleep 10 -done - -exec supervisord -n - diff --git a/rails/deploy/docker/setup/setup.sh b/rails/deploy/docker/setup/setup.sh deleted file mode 100644 index f8420aef66ac214d6a2814dfb19e6f6277c4da3d..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/setup.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -set -e -x - -SETUP=/opt/allgo/deploy/docker/setup - -# FIXME: is this really necessary ? -chown -R allgo: /opt/allgo - -apply-patches "$SETUP"/*.diff - -# make /run world writable (so that the container can be run under any uid) -chown -R nobody: /run -chmod -R og+rwX /run - - -# scripts -ln -s "$SETUP/run-allgo" "$SETUP/prepare-allgo" "$SETUP/generate-secret" /usr/local/bin/ - -# precompile assets -cd /opt/allgo -mkdir /vol && chown allgo: /vol -su allgo -c "generate-secret" -su allgo -c "env RAILS_ENV=qualification rake assets:precompile" -su allgo -c "env RAILS_ENV=production rake assets:precompile" -rm -rf /vol - -# supervisord config -rm /etc/supervisor/supervisord.conf -ln -s "$SETUP/supervisord.conf" /etc/supervisor/ - -# nginx config -rm /etc/nginx/sites-enabled/default -ln -s "/opt/allgo/deploy/nginxconf" /etc/nginx/sites-enabled/allgo - -install -m 0755 "$SETUP"/dk/* /dk/ diff --git a/rails/deploy/docker/setup/supervisord.conf b/rails/deploy/docker/setup/supervisord.conf deleted file mode 100644 index f445467c70d6bc2d1d9325e42424b0b6a9aba009..0000000000000000000000000000000000000000 --- a/rails/deploy/docker/setup/supervisord.conf +++ /dev/null @@ -1,28 +0,0 @@ -; supervisor config file - -[unix_http_server] -; FIXME: should be in /run (but this fails on overlayfs https://github.com/Supervisor/supervisor/issues/654 and tmpfs is not available in docker-compose <2) -file=/vol/cache/supervisor.sock ; (the path to the socket file) -chmod=0700 ; sockef file mode (default 0700) - -[supervisord] -logfile=/vol/log/supervisor/supervisord.log -pidfile=/var/run/supervisord.pid -childlogdir=/vol/log/supervisor ; ('AUTO' child log dir, default $TEMP) - -; the below section must remain in the config file for RPC -; (supervisorctl/web interface) to work, additional interfaces may be -; added by defining them in separate rpcinterface: sections -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl=unix:///vol/cache/supervisor.sock ; use a unix:// URL for a unix socket - - -[program:rails] -command=bundle exec unicorn -E %(ENV_RAILS_ENV)s -c config/unicorn.rb -startsecs=10 - -[program:nginx] -command=nginx -g "daemon off;" diff --git a/rails/deploy/nginxconf b/rails/deploy/nginxconf deleted file mode 100644 index 0fdc41f6c84e27ed67a43bab7faa3a087f4b585a..0000000000000000000000000000000000000000 --- a/rails/deploy/nginxconf +++ /dev/null @@ -1,127 +0,0 @@ -upstream allgo -{ - server 127.0.0.1:3000 fail_timeout=0; -# server unix:/run/rails.sock fail_timeout=0; -} - -server -{ - listen 8080; - - client_max_body_size 1G; - client_body_in_file_only clean; - client_body_buffer_size 32K; - - sendfile on; - send_timeout 300s; - - keepalive_timeout 5; - root /opt/allgo/public/; - try_files $uri/index.html $uri.html $uri @allgo; - - location @allgo - { - # the 'Host' header must be forwarded as-is because turbolinks needs it to - # work properly - proxy_set_header Host $http_host; - # however we do not forward 'X-Forwarded-Proto' because this would - # overwrite the value set by dev-nginx - # proxy_set_header X-Forwarded-Proto $scheme; - - proxy_redirect off; - proxy_pass http://allgo; -#if ($http_origin ~* 'https?://(localhost|www\.yourdomain\.com|www\.yourotherdomain\.com)') { -# set $cors 'true'; -#} - - - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - # - # Om nom nom cookies - # - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - # - # Tell client that this pre-flight info is valid for 20 days - # - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - if ($request_method = 'POST') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - } - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - } - -} - - if (-f $document_root/system/maintenance.html) { - return 503; - } - - error_page 500 502 504 /500.html; - location = /500.html { - root /home/allgo/production/current/public; - } - - error_page 503 @maintenance; - location @maintenance { - rewrite ^(.*)$ /system/maintenance.html break; - } - - location /datastore - { - alias /vol/rw/datastore/; - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - # - # Om nom nom cookies - # - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - # - # Custom headers and headers various browsers *should* be OK with but aren't - # - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - # - # Tell client that this pre-flight info is valid for 20 days - # - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - add_header 'Content-Length' 0; - return 204; - } - if ($request_method = 'POST') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - } - if ($request_method = 'GET') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; - } - #if ($http_origin = 'http://alchemia.gforge.inria.fr') - #add_header 'Access-Control-Allow-Origin' $http_origin; - #add_header 'Access-Control-Allow-Credentials' 'true'; - #add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - #add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With'; - - } -} diff --git a/rails/doc/allgo.jpg b/rails/doc/allgo.jpg deleted file mode 100644 index d446b017e5367c8908423a008d17555249de0072..0000000000000000000000000000000000000000 Binary files a/rails/doc/allgo.jpg and /dev/null differ diff --git a/rails/doc/procedure_maj b/rails/doc/procedure_maj deleted file mode 100644 index ddedf3b37339c446b5979f4402efa883f955213f..0000000000000000000000000000000000000000 --- a/rails/doc/procedure_maj +++ /dev/null @@ -1,22 +0,0 @@ -#MAJ d'allgo -##upgrade de docker -Souvent pénible, donc -depuis woody -rake allgo:back_docker_images -va télécharger toutes les images du registry sur SID - -sur cargo : -modifier le script launch_registry.sh pour correspondre à la version du registry souhaitée (current: 2.5) - -tâche pour commit tous les conteneurs, backup du .docker, et màj - -fonction pour fermer et commit les conteneurs - -fonction pour nettoyer les workers - -fonction pour backuper la conf workers - -fonction pour backup la conf docker de woody + maj de swarm et déploiement - -rm /var/lib/docker/network/files/local-kv.db - diff --git a/rails/doc/technical_informations.md b/rails/doc/technical_informations.md deleted file mode 100644 index b3ff16a09fbb9a30dbf602626e2115166d23bd9d..0000000000000000000000000000000000000000 --- a/rails/doc/technical_informations.md +++ /dev/null @@ -1,180 +0,0 @@ - -#Architecture - - -## Woody (web server) - Debian 8 -### What -Allgo frontend via the web application in RoR. We also have the datastore on Woody, to store files from jobs, and the SQL database. -### Need -Ruby 2.2.2-dev, Nginx, mariadb, ruby + rails via rvm, rails app (via capistrano), redis, git, zip, curl, sudo -### How -su -c "adduser allgo" -su -c "usermod -aG sudo allgo" -su allgo - -Use RVM to install the correct version of Ruby -```zsh -\curl -sSL https://get.rvm.io | bash -rvm install ruby-2.2.2-dev -rvm --default use ruby-2.2.2-dev -``` -Install the gem bundler to download the dependancies -```zsh -gem install bundler -``` - -```zsh -sudo apt-get install mariadb-devel redis -y -sudo service redis enable (to launch at boot) -sudo service redis start -sudo service mariadb enable -sudo service mariadb start -``` - -To run the project you need to migrate the project's database, there are backup in db/backup -```zsh -rake db:create ( RAILS_ENV=production ) -rake db:migrate ( RAILS_ENV=production ) -``` - -Then launch the project and check if there is no error message in the correct port: -```zsh -rails s -``` - -We also need to run sidekiq separately : -```zsh -bundle exec sidekiq (-e production) -``` - -##WorkerX - -### What - -The worker are server that will execute job created by users in Allgo. -we sent the command through ssh from Woody and send a docker pull request to cargo (see below) -the datastore from woody is mount through ssh so Worker can write in. - -### Need - -Docker 1.6, openssh-server - -### How - -```zsh -su -c "apt-get update && apt-get install sudo openssh-server -y" -su -c "adduser allgo" -su -c "usermod -aG sudo allgo" -su allgo -``` -Install the last docker version docker : -```zsh -curl + curl -sSL https://test.docker.com/ | sh -sudo usermod -aG docker allgo -/etc/init.d/docker start -``` - -Try a Docker command to see if it works: -```zsh -docker ps -``` - -If it is not the case: -```zsh -sudo chown allgo /home/allgo/.docker/ -sudo chown allgo /home/allgo/.docker/key.json -``` - -*Allowing insecure registry* -#####Debian >= v8 - -```zsh -sudo nano /lib/systemd/system/docker.service -``` - -Change one line to have ```ExecStart=/usr/bin/docker --insecure-registry <registry_ip>:5000 -d -H fd://``` - -```zsh -sudo systemctl daemon-reload -sudo /etc/init.d/docker restart -``` - -###Sid - Sandbox - -It's the same as worker, but we use it when an user install an application/algorithm. -We create the docker image and push it to the registry - -###Cargo - -Cargo run the docker image registry, which allow us to store our own docker images. -We use a NAS to replicate the created images, it's safer. -Install docker (same as above) -*To run the registry, with external storage* -```zsh -docker pull registry -docker run -d -p 5000:5000 -e SETTING_FLAVOR=dev -e STORAGE_PATH=/the_folder_of/your_choice_on_container/ -v /the_folder_of/your_choice/on_host:/the_folder_of/your_choice_on_container/ registry:latest -``` -To deploy TLS certificate, you can read docker documentation. - -###To mount datastore : -nfs-kernel on main server -on each node: -- modify the file: /etc/fstab -- add line: main.server:/mnt/datastore /mnt/datastore nfs user 0 0 -- do: mount /mnt/datastore -- modify the file: /etc/exports -/mnt/datastore/ worker1(rw,all_squash,anonuid=1000,anongid=1000,sync) -/mnt/datastore/ worker2(rw,all_squash,anonuid=1000,anongid=1000,sync) -/mnt/datastore/ sid(rw,all_squash,anonuid=1000,anongid=1000,sync) - - -#The development environment : -Note that we don't use nginx or TLS in development, because it required auto-signed certificate that I don't know how to do (yet). - -You can use the Vagrantfile for Virtualbox (easy way) - -Or follow those instructions (hard way, and you will need to read the production environment): -Create 4 or 5 VM (depends of if you want to use your host as web server) -Add in VirtualBox second host-only adapter in the Network tab, with DHCP. - -Relaunch your VM and modify the network interfaces: - -```zsh -sudo nano /etc/network/interfaces -``` - -Add in the opened file: -```zsh -auto eth0 -iface eth0 inet dhcp - -auto eth1 -iface eth1 inet dhcp -``` - -Once you've done the modifications, use the command ``sudo /etc/init.d/networking restart`` to restart the network card of your VM. - -When duplicating the first worker don't forget to check the option to change the MAC address. Run a ```sudo ifconfig``` on each machine to get the IP address and copy-paste them into ``config/environments/development.rb`` in the corresponding line of rails-allgo. - -###Installing ssh -You'll use ssh a lot on the workers thus we need to install it on the workers and aloow Woody to do a ssh without having to enter a password. First, install openssh-server: -```zsh -sudo apt-get install openssh-server -``` - -Then on Woody, assuming that you already have a ssh key, do this for the workers and Sid: -```zsh -ssh allgo@192.168.56.<machine number> mkdir -p .ssh -cat ~/.ssh/id_rsa.pub | ssh allgo@192.168.56.<machine number> 'cat >> .ssh/authorized_keys' -``` - -##Cargo -You need to install docker-registry on it: -```zsh -docker pull registry:2.1 -``` -When running the registry, you need to mount a folder which will contain the datastore: -```zsh -docker run -d -p 5000:5000 -e SETTING_FLAVOR=dev -e STORAGE_PATH=/your_choice_on_container/ -v /home/allgo/docker/:/your_choice_on_container/ registry:2.1 -``` -In this case, the images will be accessible in cargo machine, in /home/allgo/docker folder diff --git a/rails/lib/assets/.keep b/rails/lib/assets/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/lib/docker_adapter.rb b/rails/lib/docker_adapter.rb deleted file mode 100644 index cae420684d53e40e25d350e55c3786928911760e..0000000000000000000000000000000000000000 --- a/rails/lib/docker_adapter.rb +++ /dev/null @@ -1,19 +0,0 @@ -require "socket" -require 'timeout' - -module DockerAdapter - - def self.notify - Timeout.timeout(0.5) do - begin - host, port = Rails.configuration.docker_adapter - sock = TCPSocket.new(host, port) - sock.close - - rescue Exception => e - Rails.logger.error "failed to notify the docker controller: #{e}" - end - - end - end -end diff --git a/rails/lib/docker_management/certgen_docker.rb b/rails/lib/docker_management/certgen_docker.rb deleted file mode 100644 index 5412a4919893c33eadac275d5785b8bd1c458965..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/certgen_docker.rb +++ /dev/null @@ -1,120 +0,0 @@ -# Generates necessary certificates to ~/.docker -# -# Usage: -# bundle install -# ruby certgen.rb <domain> - -require 'certificate_authority' -require 'fileutils' - -if ARGV.empty? - puts "Usage: ruby certgen.rb <domain>" - exit 1 -end - -$domain = ARGV[0] - -$certs_path = File.join(ENV['HOME'], '.docker') - -def certificate_authority - cert_path = File.join($certs_path, 'ca', 'cert.pem') - ca_path = File.join($certs_path, 'ca', 'key.pem') - - key_material = if File.exist?(ca_path) - key = OpenSSL::PKey::RSA.new(File.read(ca_path)) - mem_key = CertificateAuthority::MemoryKeyMaterial.new - mem_key.public_key = key.public_key - mem_key.private_key = key - mem_key - else - mem_key = CertificateAuthority::MemoryKeyMaterial.new - mem_key.generate_key - mem_key - end - - if File.exist?(cert_path) - raw_cert = File.read(cert_path) - openssl = OpenSSL::X509::Certificate.new(raw_cert) - cert = CertificateAuthority::Certificate.from_openssl(openssl) - cert.key_material = key_material - cert - else - root = CertificateAuthority::Certificate.new - root.subject.common_name = $domain - root.serial_number.number = 1 - root.signing_entity = true - root.key_material = key_material - - ca_profile = { - "extensions" => { - "keyUsage" => { - "usage" => [ "critical", "keyCertSign" ] - } - } - } - - root.sign!(ca_profile) - - root - end -end - -def server_certificate(root) - server = CertificateAuthority::Certificate.new - server.subject.common_name = $domain - server.serial_number.number = rand(3..100000) - server.parent = root - server.key_material.generate_key - server.sign! - server -end - -def client_certificate(root) - client = CertificateAuthority::Certificate.new - client.subject.common_name = $domain - client.serial_number.number = 2 - client.parent = root - - client.key_material.generate_key - - signing_profile = { - "extensions" => { - "extendedKeyUsage" => { - "usage" => [ "clientAuth" ] - } - } - } - - client.sign!(signing_profile) - - client -end - -root = certificate_authority -server = server_certificate(root) -client = client_certificate(root) - -[ - # You can reuse this file to generate more certs - ['ca/key.pem', root.key_material.private_key], - ['ca/cert.pem', root.to_pem], - - # Those are default filenames expected by Docker - ['ca.pem', root.to_pem], - ['key.pem', client.key_material.private_key], - ['cert.pem', client.to_pem], - - # Those files are supposed to be uploaded to server - ["#{$domain}/ca.pem", root.to_pem], - ["#{$domain}/key.pem", server.key_material.private_key], - ["#{$domain}/cert.pem", server.to_pem] -].each do |name, contents| - path = File.join($certs_path, name) - FileUtils.mkdir_p(File.dirname(path)) - File.write(path, contents) - File.chmod(0600, path) -end - -puts "CA certificates are in #{$certs_path}/ca" -puts "Client certificates are in #{$certs_path}" -puts "Server certificates are in #{$certs_path}/#{$domain}" diff --git a/rails/lib/docker_management/certgen_swarm_docker.rb b/rails/lib/docker_management/certgen_swarm_docker.rb deleted file mode 100644 index 58dde289b5aa80ae173eca279ea84369a02336aa..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/certgen_swarm_docker.rb +++ /dev/null @@ -1,63 +0,0 @@ -### -# Securize your docker cluster with TLS -# Generate a CA.pem and use it to sign the cert of all the server (swarm master and node) -# Change your systemd docker.service -# /!\ This is not full automate now, you need to enter informations for the certificate, -# like the password, and at "common name" line, your server name (example.com) - -##Execute the script on your swarm master - -require 'net/ssh' - -#swarm_master='woody.irisa.fr' -user = 'vagrant' -swarm_master={hn: 'allgo.dev', ip: '192.168.50.02'} -swarm_node1={hn: 'worker0.dev', ip: '192.168.50.10'} -swarm_node2={hn: 'worker1.dev', ip: '192.168.50.11'} -swarm_nodes=[swarm_node1,swarm_node2] -path = "/home/vagrant/.docker" - -system "mkdir -p #{path}/swarm-server/" -#generate the C -system "openssl genrsa -aes256 -out #{path}/ca-key.pem 4096" -system "openssl req -new -x509 -days 3650 -key #{path}/ca-key.pem -sha256 -out #{path}/ca.pem" - -#securize the master -#system "sudo echo '127.0.1.1 swarm-master' >> /etc/hosts" -system "echo 'extendedKeyUsage = clientAuth,serverAuth' > #{path}/swarm-server/extfile.cnf " -system "echo \"subjectAltName = IP:#{swarm_master[:ip]},IP:127.0.0.1\" >> #{path}/swarm-server/extfile.cnf " - -#gen key pair -system "openssl genrsa -out #{path}/swarm-server/swarm-key.pem 2048" -system "openssl req -subj '/CN=#{swarm_master[:hn]}' -new -key #{path}/swarm-server/swarm-key.pem -out #{path}/swarm-server/swarm.csr" -#sign it -system "openssl x509 -req -days 3650 -in #{path}/swarm-server/swarm.csr -CA #{path}/ca.pem -CAkey #{path}/ca-key.pem -CAcreateserial -out #{path}/swarm-server/swarm-cert.pem -extfile #{path}/swarm-server/extfile.cnf" - -#generate client keys -system "echo 'extendedKeyUsage = clientAuth,serverAuth' > #{path}/extfile.cnf" -system "openssl genrsa -out #{path}/key.pem 4096" -system "openssl req -subj '/CN=client' -new -key #{path}/key.pem -out #{path}/client.csr" -system "openssl x509 -req -days 3650 -sha256 -in #{path}/client.csr -CA #{path}/ca.pem -CAkey #{path}/ca-key.pem -CAcreateserial -out #{path}/cert.pem -extfile #{path}/extfile.cnf" - -#swarm -system "docker run --rm swarm create > /mnt/datastore/token_id" - -##so now, we gonna send the CA to sign & securize the nodes -swarm_nodes.each do |node| - system "ssh #{node[:ip]} \"mkdir #{path}\"" - system "scp #{path}/ca.pem #{node[:ip]}:#{path} " - system "scp #{path}/ca-key.pem #{node[:ip]}:#{path} " - #system "scp #{path}/extfile.cnf #{node[:ip]}:#{path} " - system "ssh #{node[:ip]} \"echo 'extendedKeyUsage = clientAuth,serverAuth' > #{path}/extfile.cnf\"" - system "ssh #{node[:ip]} \"echo \"subjectAltName = IP:#{node[:ip]},IP:127.0.0.1\" >> #{path}/extfile.cnf\"" - system "ssh #{node[:ip]} \"openssl genrsa -out #{path}/server-key.pem 2048\"" - system "ssh #{node[:ip]} \"openssl req -subj '/CN=#{node[:hn]}' -new -key #{path}/server-key.pem -out #{path}/server.csr\"" - system "ssh #{node[:ip]} \"openssl x509 -req -days 3650 -in #{path}/server.csr -CA #{path}/ca.pem -CAkey #{path}/ca-key.pem -CAcreateserial -out #{path}/server-cert.pem -extfile #{path}/extfile.cnf\"" - #system "ssh #{node[:ip]} \"sudo sed -i '/ExecStart=\/usr\/bin\/docker/c\ExecStart=\/usr\/bin\/docker daemon --tlsverify --tlscacert=/home/#{user}/.docker/ca.pem --tlscert=/home/#{user}/.docker/server-cert.pem - #--tlskey=/home/#{user}/.docker/server-key.pem -H tcp://0.0.0.0:2376 -H fd:\/\/' /lib/systemd/system/docker.service\"" - #system "ssh #{node[:ip]} \"sudo systemctl daemon-reload && sudo systemctl restart docker.service\"" - #system "ssh -t #{node[:ip]} \"docker run --name swarm_node -d swarm:1.0.0 join --addr=#{node[:ip]}:2376 token://#{token}\"" -end - -#system "docker run -d -p 2376:2375 -v ~/.docker/:/certs/ swarm:1.0.0 manage --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/swarm-cert.pem --tlskey=/certs/swarm-key.pem token://#{token}" -#curl -H "Content-Type: application/json" -X POST -d '{"image":"ubuntu"}' https://allgo.dev:2376/containers/create --cert ~/.docker/cert.pem --key ~/.docker/key.pem --cacert ~/.docker/ca.pem diff --git a/rails/lib/docker_management/deploy_registry2.sh b/rails/lib/docker_management/deploy_registry2.sh deleted file mode 100755 index 4a007adb76173215acb839238e3b4510dfd5655e..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/deploy_registry2.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -version=2.5 -docker rm -f allgo-registryv2 -docker run --entrypoint htpasswd registry:$version -Bbn allgo testpassword > auth/htpasswd -docker run -d -p 5000:5000 --restart=always --name allgo-registryv2 \ - -v /home/allgo/allgo-registry/:/var/lib/registry/ \ - -v /home/allgo/certs/:/certs/ \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/cargo.irisa.fr.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/cargo.irisa.fr.key \ - -v `pwd`/auth:/auth \ - -e REGISTRY_AUTH=htpasswd \ - -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ - -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \ - registry:$version diff --git a/rails/lib/docker_management/dev_deploy_registry.sh b/rails/lib/docker_management/dev_deploy_registry.sh deleted file mode 100644 index 9131efc7e087681cf24ee1fd549e077aea6bec21..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/dev_deploy_registry.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -version=2.5 -#docker rm -f allgo-registryv2 -docker run --entrypoint htpasswd registry:$version -Bbn allgo testpassword > auth/htpasswd -docker run -d -p 5000:5000 --name allgo-registryv2 \ - -v /home/allgo/allgo-registry/:/var/lib/registry/ \ - -v /home/allgo/certs/:/certs/ \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/cargo.irisa.fr.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/cargo.irisa.fr.key \ - -v `pwd`/auth:/auth \ - -e REGISTRY_AUTH=htpasswd \ - -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ - -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd \ - registry:$version diff --git a/rails/lib/docker_management/gen_ssl_for_docker.sh b/rails/lib/docker_management/gen_ssl_for_docker.sh deleted file mode 100755 index ad0259d73b15b22b845bce0c02784b10376c4f2f..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/gen_ssl_for_docker.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# generate auto-signed certificates for docker -# CF official docker docs for https -# certificates in /server/ folder are for the machine where docker daemon running, and needs to be indicate in ExecStart in systemd file -# those in /client/ need to be on the ~/.docker/ of the machine you want to acceed to the server. If multiple server for one client, indicate the server in the docker command. - -# important! for swarm, use the same CA to sign certificates - -# $1 refer to the hostname (example.com) -# $2 refer to IP adress of the server -# $3 refer to where you are, client or daemon - -mkdir -p ~/.docker/$1 -mkdir -p ~/.docker/$1/server/ -mkdir -p ~/.docker/$1/client/ -#cd ~/.docker/$1/ -path=~/.docker/$1 -echo $1 -echo $2 - -#generate the CA -openssl genrsa -aes256 -out $path/ca-key.pem 4096 -openssl req -new -x509 -days 365 -key $path/ca-key.pem -sha256 -out $path/ca.pem - -#we know have a ca-key.pem and a ca.pem (CA stand for Certificate Authority) - -#generate the server -echo 'generating server certificate : ' -openssl genrsa -out $path/server/server-key.pem 4096 -#we generate a .csr file, certificate server request -openssl req -subj "/CN=$1" -sha256 -new -key $path/server/server-key.pem -out $path/server/server.csr -echo "subjectAltName = IP:$2,IP:127.0.0.1" > $path/extfile.cnf -openssl x509 -req -days 365 -sha256 -in $path/server/server.csr -CA $path/ca.pem -CAkey $path/ca-key.pem -CAcreateserial -out $path/server/server-cert.pem -extfile $path/extfile.cnf - -#generate the client -echo 'generating client certificate : ' -echo extendedKeyUsage = clientAuth,serverAuth > $path/extfile.cnf -openssl genrsa -out $path/client/key.pem 4096 -openssl req -subj '/CN=client' -new -key $path/client/key.pem -out $path/client/client.csr -openssl x509 -req -days 365 -sha256 -in $path/client/client.csr -CA $path/ca.pem -CAkey $path/ca-key.pem -CAcreateserial -out $path/client/cert.pem -extfile $path/extfile.cnf - -rm ~/.docker/$1/client/client.csr -rm ~/.docker/$1/server/server.csr - -#si on est sur le client, send server certificate to server -if $3 == 'server' - #sudo sed -i '/ExecStart=\/usr\/bin\/docker/c\ExecStart=\/usr\/bin\/docker --insecure-registry 192.168.50.05:5000 -d -H fd:\/\/' /lib/systemd/system/docker.service - sudo sed -i '/ExecStart=\/usr\/bin\/docker/c\ExecStart=\/usr\/bin\/docker daemon --tlsverify --tlscacert=~/.docker/ca.pem --tlscert=~/.docker/server/server-cert.pem \ - --tlskey=~/.docker/server/server-key.pem \ - -H tcp://0.0.0.0:2376 -H fd:\/\/' /lib/systemd/system/docker.service -fi - -# FOR SWARM - -#swarm node(s) - -#in /lib/systemd/system/docker.service : -#ExecStart=/usr/bin/docker daemon --tlsverify --tlscacert=/home/vagrant/.docker/worker0.dev/ca.pem \ - #--tlscert=/home/vagrant/.docker/worker0.dev/server/server-cert.pem \ - #--tlskey=/home/vagrant/.docker/worker0.dev/server/server-key.pem \ - #-H 0.0.0.0:2375 -H 0.0.0.0:2376 -H fd:// - -docker run -d swarm:1.0.0 join --addr=192.168.50.10:2376 token://$token - -#swarm master -vim /etc/hosts > 127.0.1.1 swarm -echo extendedKeyUsage = clientAuth,serverAuth > extfile.cnf -#gen key pair for swarm -openssl genrsa -out swarmKEY.pem 2048 -openssl req -subj "/CN=swarm" -new -key swarmKEY.pem -out swarm.csr -#use the same CA as for -openssl x509 -req -days 3650 -in swarm.csr -CA ca.pem -CAkey CAkey.pem -CAcreateserial -out swarmCRT.pem -extensions v3_req -extfile openssl.cnf - -docker run -d -p 2376:2375 -v ~/.docker/:/certs/ swarm:1.0.0 manage \ - --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/swarmCRT.pem --tlskey=/certs/swarmKEY.pem token://$token - -docker --tlsverify -H tcp://swarm:2375 info - -#think to enable tls by default - -#to specify a client keys folder -#export DOCKER_CERT_path=~/.docker/zone1/ diff --git a/rails/lib/docker_management/new_swarm.sh b/rails/lib/docker_management/new_swarm.sh deleted file mode 100755 index b9ec0f4f1e792cda9d19c5198a1be0da61f998fb..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/new_swarm.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -version=1.1.0 -docker pull swarm:$version -docker rm -f swarm_manager -#docker run --rm swarm create > /mnt/datastore/token_id -#token=$(cat /mnt/datastore/token_id) -token=`docker run --rm swarm create` -#ssh -t worker0 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node -d swarm join --addr=worker0.irisa.fr:2376 token://$token" -ssh -t worker0 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node --restart=always -d swarm:$version join --addr=worker0.irisa.fr:2375 token://$token" -#ssh -t worker1 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node -d swarm join --addr=worker1.irisa.fr:2376 token://$token" -ssh -t worker1 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node --restart=always -d swarm:$version join --addr=worker1.irisa.fr:2375 token://$token" -docker run -d -p 2375:2375 --name swarm_manager --restart=always swarm:$version manage token://$token -#docker run -d -p 2376:2375 -v ~/.docker/:/certs/ swarm:1.0.0 manage --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/swarmCRT.pem --tlskey=/certs/swarmKEY.pem token://$token diff --git a/rails/lib/docker_management/new_swarm_dev.sh b/rails/lib/docker_management/new_swarm_dev.sh deleted file mode 100755 index 7e9640f4d5c3acee5e8b60244c950a70092182b3..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/new_swarm_dev.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -version=1.2.5 -docker pull swarm:$version -docker rm -f swarm_manager -#docker run --rm swarm create > /mnt/cmaupeti/datastore/token_id -#token=$(cat /mnt/cmaupeti/datastore/token_id) -token=`docker run --rm swarm:$version create` -echo token = $token -#ssh -t worker0 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node -d swarm join --addr=worker0.irisa.fr:2376 token://$token" -ssh -t 192.168.50.10 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node --restart=always -d swarm:$version join --addr=192.168.50.10:2375 token://$token" -#ssh -t worker1 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node -d swarm join --addr=worker1.irisa.fr:2376 token://$token" -ssh -t 192.168.50.11 "docker pull swarm:$version && docker rm -f swarm_node && docker run --name swarm_node --restart=always -d swarm:$version join --addr=192.168.50.11:2375 token://$token" -docker run -d -p 2375:2375 --name swarm_manager --restart=always swarm:$version manage token://$token -#docker run -d -p 2376:2375 -v ~/.docker/:/certs/ swarm:1.0.0 manage --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/swarmCRT.pem --tlskey=/certs/swarmKEY.pem token://$token diff --git a/rails/lib/docker_management/update_prod.sh b/rails/lib/docker_management/update_prod.sh deleted file mode 100755 index 11d9190c13a4bd6a8516fba2f6df0d6e999d0ce4..0000000000000000000000000000000000000000 --- a/rails/lib/docker_management/update_prod.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -server_list=( "woody.irisa.fr" "worker0.irisa.fr" "worker1.irisa.fr" "sid.irisa.fr") -cmd='sudo cp /lib/systemd/system/docker.service /home/allgo/docker.service.backup && sudo apt-get update && sudo apt-get upgrade -y docker-engine -&& sudo systemctl daemon-reload && sudo systemctl restart docker.service' -for i in ${server_list[@]} -do - #scp update_docker.sh allgo@$i:/tmp/ - #ssh -t allgo@$i 'sudo cp /lib/systemd/system/docker.service /home/allgo/docker.service.backup' - #ssh -t allgo@$i 'sudo apt-get update && sudo apt-get upgrade docker-engine' - # ssh #{node[:ip]} \"sudo sed -i '/ExecStart=\/usr\/bin\/docker/c\ExecStart=\/usr\/bin\/docker daemon --tlsverify --tlscacert=/home/#{user}/.docker/ca.pem --tlscert=/home/#{user}/.docker/server-cert.pem - # #--tlskey=/home/#{user}/.docker/server-key.pem -H tcp://127.0.0.1 :2376 -H fd:\/\/' /lib/systemd/system/docker.service\"" - #ssh -t allgo@$i "sudo systemctl daemon-reload && sudo systemctl restart docker.service" - ssh -t allgo@$i $cmd -done -ssh root@cargo $cmd diff --git a/rails/lib/tasks/allgo.rake b/rails/lib/tasks/allgo.rake deleted file mode 100644 index b1e294cf0c6e2105ce60b38649473272d89d478b..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/allgo.rake +++ /dev/null @@ -1,116 +0,0 @@ -require 'docker_adapter' - -namespace :allgo do - - desc "print the emails of all the users" - task dump_all_emails: :environment do - puts "#{User.all.map{|u| u.email}.sort.join "\n"}" - end - - desc "print the emails of developers only (users allowed to create an app)" - task dump_dev_emails: :environment do - puts "#{User.all.select{|u| User.valid_email u.email}.map{|u| u.email}.sort.join "\n"}" - end - - desc "print the emails of external users only (not allowed to create an app)" - task dump_ext_emails: :environment do - puts "#{User.all.select{|u| !User.valid_email u.email}.map{|u| u.email}.sort.join "\n"}" - end - - # clean jobs - # - NEW jobs that were never started - # - DONE jobs older than one month - desc "clean old jobs" - task clean_jobs: :environment do - # mark old NEW jobs as deleted (need to be atomic) - Job.where(state: "NEW").where('updated_at <= :t', t: Time.now - 1.day - ).update_all(state: "DELETED") - - for job in (Job.where(state: "DELETED") - ).or(Job.where(state:"DONE").where('updated_at <= :t', t: Time.now - 1.month)) - begin - job.purge - rescue Exception => e - Rails.logger.error "failed to purge job #{job.id}: #{e}" - end - end - end - -#TODO old tasks: port them or remove them -# -# dbuser = "root" -# dbhost = "127.0.0.1" -# database = "allgo" -# password = "mariadb6sed" -# date = Time.now.strftime("%Y-%m-%d_%H-%M") -# filename = "db/backup/backup_mysql_"+date.to_s+".sql" -# desc "save mysql database state" -# task backup_mysql: :environment do -# system "mysqldump -u #{dbuser} -p#{password} #{database} > #{filename}" -# puts "it's ok" -# end -# -# -# task clean_docker_container: :environment do -# #system " docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm" -# system "docker ps -a | awk '{print $1}' | xargs --no-run-if-empty docker rm -f" #remove stopped docker container -# system "docker rmi -f $(docker images -q --filter 'dangling=true')" #remove <none> docker images -# end -# -# task update_versions: :environment do -# Webapp.all.each do |w| -# v = w.webapp_versions.build -# v.number = 1.0 -# v.changelog = "initial version" -# v.created_at = w.created_at -# v.save -# end -# end -# -# task migrate_demos: :environment do -# WebappDemo.all.each do |w| -# webapp = Webapp.find(w.webapp_id) -# if w.file_type == "input" -# webapp.update(input_demo: w.name) -# elsif w.file_type == "output" -# webapp.update(output_demo: w.name) -# end -# webapp.save! -# end -# end -# -# task create_dataset_and_jobs_folder: :environment do -# require 'fileutils' -# User.all.each do |u| -# FileUtils.mkpath("#{Rails.configuration.datastore}/#{u.id}/datasets/") -# Webapp.all.each do |w| -# FileUtils.mkpath("#{Rails.configuration.datastore}/#{u.id}/#{w.id}/") -# end -# end -# end -# -# #useful if SID reboot -# task update_all_ipadress: :environment do -# # FIXME: should make the list of containers from the database (to avoid -# # starting stale containers) -> Webapp.where.not(ipadress: nil) -# start_list = DockerAdapter.call( -# command: "ps", -# all: true, -# filters: {name: "^/#{Rails.configuration.docker_prefix}sandbox_|^/#{Rails.configuration.docker_prefix}upgrade_"}, -# )["result"].map {|x| x["Names"][0].slice(1,9999)} -# -# start_list.each { |x| -# DockerAdapter.call(command: "start", container: x) -# } -# end -# -# task back_docker_images: :environment do -# Webapp.all.each do |webapp| -# webapp.webapp_versions.each do |wv| -# system "ssh allgo@sid 'docker pull cargo.irisa.fr:5000/allgo/#{webapp.docker_name}:#{wv.number}'" -# #update size docker iamges -# end -# end -# end - -end diff --git a/rails/lib/tasks/assets.rake b/rails/lib/tasks/assets.rake deleted file mode 100644 index c85409a68537316f75d2bffd4d3fb89beaae9044..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/assets.rake +++ /dev/null @@ -1,33 +0,0 @@ -namespace :assets do - desc "Create .gz versions of assets" - task :gzip => :environment do - zip_types = /\.(?:css|html|js|otf|svg|txt|xml)$/ - - public_assets = File.join( - Rails.root, - "public", - Rails.application.config.assets.prefix) - - Dir["#{public_assets}/**/*"].each do |f| - next unless f =~ zip_types - - mtime = File.mtime(f) - gz_file = "#{f}.gz" - next if File.exist?(gz_file) && File.mtime(gz_file) >= mtime - - File.open(gz_file, "wb") do |dest| - gz = Zlib::GzipWriter.new(dest, Zlib::BEST_COMPRESSION) - gz.mtime = mtime.to_i - IO.copy_stream(open(f), gz) - gz.close - end - - File.utime(mtime, mtime, gz_file) - end - end - - #Hook into existing assets:precompile task - Rake::Task["assets:precompile"].enhance do - Rake::Task["assets:gzip"].invoke - end -end diff --git a/rails/lib/tasks/clean.sh b/rails/lib/tasks/clean.sh deleted file mode 100644 index f0ff01d5c1a2944713703b349e0c7000709a9df2..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/clean.sh +++ /dev/null @@ -1,5 +0,0 @@ -bundle exec rake tmp:clear RAILS_ENV=production -bundle exec rake assets:clean RAILS_ENV=production -bundle exec rake assets:precompile RAILS_ENV=production - -#bundle install --no-deployment diff --git a/rails/lib/tasks/docker.rake b/rails/lib/tasks/docker.rake deleted file mode 100644 index d4b7685a131f57510761160286c5d1a4aeb0d4e5..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/docker.rake +++ /dev/null @@ -1,19 +0,0 @@ -namespace :docker do - task commit_sid: :environment do - Webapp.where.not(ipadress: "NULL").where.not(ipadress: "").all.each do |webapp| - if webapp.status == 2 - v = "upgrade" - else - v = "sandbox" - end - puts webapp.docker_name - system "#{Rails.configuration.connect_sandbox} 'docker stop #{v}_#{webapp.docker_name}'" - system "#{Rails.configuration.connect_sandbox} 'docker commit #{v}_#{webapp.docker_name} #{Rails.configuration.docker_registry}/allgo/#{webapp.docker_name}:#{webapp.webapp_versions.last.number}'" - end - end - - task upgrade_all: :environment do - end - - -end diff --git a/rails/lib/tasks/launch_allgo.sh b/rails/lib/tasks/launch_allgo.sh deleted file mode 100644 index 89856fddf98e581ebfeef5b03dd54be84bacaeb5..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/launch_allgo.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -##all what allgo needs to run, launch it from woody -## boot all the machines, whatever the order, and run the script - -#start the docker registry on cargo, normally it starts with the server -ssh -t root@cargo.irisa.fr "systemctl start docker.service" -ssh -t root@cargo.irisa.fr "docker start allgo-registryv2" - -#normally, those services start with the server, it just to be sure -sudo systemctl start docker.service -sudo systemctl start redis -sudo systemctl start mariadb -sudo systemctl start nginx - -# launch the nfs sharing -## an autofs support could be great -sudo exportfs -a -sudo mount /mnt/datastore/ -ssh -t allgo@worker0 "sudo mount /mnt/datastore/" -ssh -t allgo@worker1 "sudo mount /mnt/datastore/" -ssh -t allgo@sid "sudo mount /mnt/datastore/" - -#launch a new docker swarm cluster, but normally it starts with the server -#if docker -H tcp://0.0.0.0:2375 info -#./script/new_swarm.sh - -cd /home/allgo/production/current/ && bundle exec unicorn -E production -c config/unicorn.rb -cd /home/allgo/production/current/ && bundle exec sidekiq -d -e production -C config/sidekiq.yml -L log/sidekiq.log - -# launch socat to provide a proxy to the docker socket of sid -SID_DIR="/home/allgo/sid" -SID_SOCK="$SID_DIR/docker.sock" -SID_PID="$SID_DIR/socat.pid" -/sbin/start-stop-daemon --pidfile "$SID_PID" --stop --exec /usr/bin/socat -mkdir -p "$SID_DIR" -chmod 0700 "$SID_DIR" -rm -f "$SID_SOCK" -/sbin/start-stop-daemon --pidfile "$SID_PID" --make-pid --background --start --exec /usr/bin/socat -- UNIX-LISTEN:"$SID_SOCK",mode=0700,fork EXEC:'ssh allgo@sid nc -U /run/docker.sock' - -alias docker_sid="docker -H 'unix://$SID_SOCK'" -docker_sid start -- `docker_sid ps -aq` - -cd /home/allgo/production/current/ && RAILS_ENV=production bundle exec rake allgo:update_all_ipadress diff --git a/rails/lib/tasks/reload_assets.sh b/rails/lib/tasks/reload_assets.sh deleted file mode 100755 index dec21a8d11879965643191962e15efd2592adc17..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/reload_assets.sh +++ /dev/null @@ -1,4 +0,0 @@ -bundle exec rails tmp:clear -bundle exec rails assets:clean RAILS_ENV=production -bundle exec rails assets:precompile RAILS_ENV=production -bundle exec rails assets:gzip RAILS_ENV=production diff --git a/rails/lib/tasks/start_sidekiq.sh b/rails/lib/tasks/start_sidekiq.sh deleted file mode 100755 index 00714cdb5ecfc044b416200dc2711fad2ee0b5ef..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/start_sidekiq.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -/home/allgo/production/shared/bundle/ruby/2.2.0/bin/sidekiq -d -e production -C config/sidekiq.yml -L log/sidekiq.log - diff --git a/rails/lib/tasks/stop_sidekiq.sh b/rails/lib/tasks/stop_sidekiq.sh deleted file mode 100755 index 05d27605185d7e5e8a7fc642355d91d0fa56085e..0000000000000000000000000000000000000000 --- a/rails/lib/tasks/stop_sidekiq.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -pid=$(cat tmp/pids/sidekiq.pid) -kill -9 $pid diff --git a/rails/public/404.html b/rails/public/404.html deleted file mode 100644 index a0daa0c1567b55d8de2b4d7a3bc010f58c047eab..0000000000000000000000000000000000000000 --- a/rails/public/404.html +++ /dev/null @@ -1,58 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>The page you were looking for doesn't exist (404)</title> - <style> - body { - background-color: #EFEFEF; - color: #2E2F30; - text-align: center; - font-family: arial, sans-serif; - } - - div.dialog { - width: 25em; - margin: 4em auto 0 auto; - border: 1px solid #CCC; - border-right-color: #999; - border-left-color: #999; - border-bottom-color: #BBB; - border-top: #B00100 solid 4px; - border-top-left-radius: 9px; - border-top-right-radius: 9px; - background-color: white; - padding: 7px 4em 0 4em; - } - - h1 { - font-size: 100%; - color: #730E15; - line-height: 1.5em; - } - - body > p { - width: 33em; - margin: 0 auto 1em; - padding: 1em 0; - background-color: #F7F7F7; - border: 1px solid #CCC; - border-right-color: #999; - border-bottom-color: #999; - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-top-color: #DADADA; - color: #666; - box-shadow:0 3px 8px rgba(50, 50, 50, 0.17); - } - </style> -</head> - -<body> - <!-- This file lives in public/404.html --> - <div class="dialog"> - <h1>The page you were looking for doesn't exist.</h1> - <p>You may have mistyped the address or the page may have moved.</p> - </div> - <p>If you are the application owner check the logs for more information.</p> -</body> -</html> diff --git a/rails/public/422.html b/rails/public/422.html deleted file mode 100644 index fbb4b84d725dde9be7d2b352aded0bdf85c4c081..0000000000000000000000000000000000000000 --- a/rails/public/422.html +++ /dev/null @@ -1,58 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>The change you wanted was rejected (422)</title> - <style> - body { - background-color: #EFEFEF; - color: #2E2F30; - text-align: center; - font-family: arial, sans-serif; - } - - div.dialog { - width: 25em; - margin: 4em auto 0 auto; - border: 1px solid #CCC; - border-right-color: #999; - border-left-color: #999; - border-bottom-color: #BBB; - border-top: #B00100 solid 4px; - border-top-left-radius: 9px; - border-top-right-radius: 9px; - background-color: white; - padding: 7px 4em 0 4em; - } - - h1 { - font-size: 100%; - color: #730E15; - line-height: 1.5em; - } - - body > p { - width: 33em; - margin: 0 auto 1em; - padding: 1em 0; - background-color: #F7F7F7; - border: 1px solid #CCC; - border-right-color: #999; - border-bottom-color: #999; - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-top-color: #DADADA; - color: #666; - box-shadow:0 3px 8px rgba(50, 50, 50, 0.17); - } - </style> -</head> - -<body> - <!-- This file lives in public/422.html --> - <div class="dialog"> - <h1>The change you wanted was rejected.</h1> - <p>Maybe you tried to change something you didn't have access to.</p> - </div> - <p>If you are the application owner check the logs for more information.</p> -</body> -</html> diff --git a/rails/public/500.html b/rails/public/500.html deleted file mode 100644 index e9052d35bfb6d30065b206fc43f4200a04d5281b..0000000000000000000000000000000000000000 --- a/rails/public/500.html +++ /dev/null @@ -1,57 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>We're sorry, but something went wrong (500)</title> - <style> - body { - background-color: #EFEFEF; - color: #2E2F30; - text-align: center; - font-family: arial, sans-serif; - } - - div.dialog { - width: 25em; - margin: 4em auto 0 auto; - border: 1px solid #CCC; - border-right-color: #999; - border-left-color: #999; - border-bottom-color: #BBB; - border-top: #B00100 solid 4px; - border-top-left-radius: 9px; - border-top-right-radius: 9px; - background-color: white; - padding: 7px 4em 0 4em; - } - - h1 { - font-size: 100%; - color: #730E15; - line-height: 1.5em; - } - - body > p { - width: 33em; - margin: 0 auto 1em; - padding: 1em 0; - background-color: #F7F7F7; - border: 1px solid #CCC; - border-right-color: #999; - border-bottom-color: #999; - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-top-color: #DADADA; - color: #666; - box-shadow:0 3px 8px rgba(50, 50, 50, 0.17); - } - </style> -</head> - -<body> - <!-- This file lives in public/500.html --> - <div class="dialog"> - <h1>We're sorry, but something went wrong.</h1> - </div> - <p>If you are the application owner check the logs for more information.</p> -</body> -</html> diff --git a/rails/public/app b/rails/public/app deleted file mode 120000 index 025ffd06288e76d65b55116a51683024ece4069e..0000000000000000000000000000000000000000 --- a/rails/public/app +++ /dev/null @@ -1 +0,0 @@ -/vol/rw/app \ No newline at end of file diff --git a/rails/public/datastore b/rails/public/datastore deleted file mode 120000 index 5993f701f837fa0b3ef924e365faa5afa9d52cfa..0000000000000000000000000000000000000000 --- a/rails/public/datastore +++ /dev/null @@ -1 +0,0 @@ -/vol/rw/datastore \ No newline at end of file diff --git a/rails/public/favicon.ico b/rails/public/favicon.ico deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/public/images/app/nero.png b/rails/public/images/app/nero.png deleted file mode 100644 index f40fc260dd7e8c8c829a784ae830e5ed8d39982e..0000000000000000000000000000000000000000 Binary files a/rails/public/images/app/nero.png and /dev/null differ diff --git a/rails/public/images/app/otis.png b/rails/public/images/app/otis.png deleted file mode 100644 index 27a28e0f83a8b526e9716444f5db645d2397e5ae..0000000000000000000000000000000000000000 Binary files a/rails/public/images/app/otis.png and /dev/null differ diff --git a/rails/public/images/app/samusa.png b/rails/public/images/app/samusa.png deleted file mode 100644 index f08b2d916c207e8619c0eeefa16346726be150f1..0000000000000000000000000000000000000000 Binary files a/rails/public/images/app/samusa.png and /dev/null differ diff --git a/rails/public/images/app/termex.png b/rails/public/images/app/termex.png deleted file mode 100644 index f7edef358a532b7ca594a99d8f2a90849b3e314e..0000000000000000000000000000000000000000 Binary files a/rails/public/images/app/termex.png and /dev/null differ diff --git a/rails/public/images/guest.png b/rails/public/images/guest.png deleted file mode 100644 index 5993b1ed9dcfc81f463fcc245ea811297f03717e..0000000000000000000000000000000000000000 Binary files a/rails/public/images/guest.png and /dev/null differ diff --git a/rails/public/images/infrastructure.png b/rails/public/images/infrastructure.png deleted file mode 100644 index 24aefe71785d2f8baeab91d9ebbc87bad5ba5056..0000000000000000000000000000000000000000 Binary files a/rails/public/images/infrastructure.png and /dev/null differ diff --git a/rails/public/images/thumb/default.png b/rails/public/images/thumb/default.png deleted file mode 100644 index 198ad0963a60d93c9e9a1dc698b4fb308d02f574..0000000000000000000000000000000000000000 Binary files a/rails/public/images/thumb/default.png and /dev/null differ diff --git a/rails/public/robots.txt b/rails/public/robots.txt deleted file mode 100644 index 1aadf7d1ebb1e5e9b45a312367b5d2092698c140..0000000000000000000000000000000000000000 --- a/rails/public/robots.txt +++ /dev/null @@ -1,6 +0,0 @@ -# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file -# -# To ban all spiders from the entire site uncomment the next two lines: -User-agent: * -Disallow: /jobs -Disallow: /datastore diff --git a/rails/public/system b/rails/public/system deleted file mode 120000 index e056d64c264dfd0347b6123455e47fc967f3375d..0000000000000000000000000000000000000000 --- a/rails/public/system +++ /dev/null @@ -1 +0,0 @@ -/vol/rw/system \ No newline at end of file diff --git a/rails/spec/controllers/admin_controller_spec.rb b/rails/spec/controllers/admin_controller_spec.rb deleted file mode 100644 index 64bdb0e7dffd8e96cdaf4dd94b6ee155e5c9a56e..0000000000000000000000000000000000000000 --- a/rails/spec/controllers/admin_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe AdminController, type: :controller do - -end diff --git a/rails/spec/controllers/datasets_controller_spec.rb b/rails/spec/controllers/datasets_controller_spec.rb deleted file mode 100644 index 535aa44d502d45936f4ed60fbe95ef8e7c2f2748..0000000000000000000000000000000000000000 --- a/rails/spec/controllers/datasets_controller_spec.rb +++ /dev/null @@ -1,159 +0,0 @@ -require 'rails_helper' - -# This spec was generated by rspec-rails when you ran the scaffold generator. -# It demonstrates how one might use RSpec to specify the controller code that -# was generated by Rails when you ran the scaffold generator. -# -# It assumes that the implementation code is generated by the rails scaffold -# generator. If you are using any extension libraries to generate different -# controller code, this generated spec may or may not pass. -# -# It only uses APIs available in rails and/or rspec-rails. There are a number -# of tools you can use to make these specs even more expressive, but we're -# sticking to rails and rspec-rails APIs to keep things simple and stable. -# -# Compared to earlier versions of this generator, there is very limited use of -# stubs and message expectations in this spec. Stubs are only used when there -# is no simpler way to get a handle on the object needed for the example. -# Message expectations are only used when there is no simpler way to specify -# that an instance is receiving a specific message. - -RSpec.describe DatasetsController, type: :controller do - - # This should return the minimal set of attributes required to create a valid - # Dataset. As you add validations to Dataset, be sure to - # adjust the attributes here as well. - let(:valid_attributes) { - skip("Add a hash of attributes valid for your model") - } - - let(:invalid_attributes) { - skip("Add a hash of attributes invalid for your model") - } - - # This should return the minimal set of values that should be in the session - # in order to pass any filters (e.g. authentication) defined in - # DatasetsController. Be sure to keep this updated too. - let(:valid_session) { {} } - - describe "GET #index" do - it "assigns all datasets as @datasets" do - dataset = Dataset.create! valid_attributes - get :index, {}, valid_session - expect(assigns(:datasets)).to eq([dataset]) - end - end - - describe "GET #show" do - it "assigns the requested dataset as @dataset" do - dataset = Dataset.create! valid_attributes - get :show, {:id => dataset.to_param}, valid_session - expect(assigns(:dataset)).to eq(dataset) - end - end - - describe "GET #new" do - it "assigns a new dataset as @dataset" do - get :new, {}, valid_session - expect(assigns(:dataset)).to be_a_new(Dataset) - end - end - - describe "GET #edit" do - it "assigns the requested dataset as @dataset" do - dataset = Dataset.create! valid_attributes - get :edit, {:id => dataset.to_param}, valid_session - expect(assigns(:dataset)).to eq(dataset) - end - end - - describe "POST #create" do - context "with valid params" do - it "creates a new Dataset" do - expect { - post :create, {:dataset => valid_attributes}, valid_session - }.to change(Dataset, :count).by(1) - end - - it "assigns a newly created dataset as @dataset" do - post :create, {:dataset => valid_attributes}, valid_session - expect(assigns(:dataset)).to be_a(Dataset) - expect(assigns(:dataset)).to be_persisted - end - - it "redirects to the created dataset" do - post :create, {:dataset => valid_attributes}, valid_session - expect(response).to redirect_to(Dataset.last) - end - end - - context "with invalid params" do - it "assigns a newly created but unsaved dataset as @dataset" do - post :create, {:dataset => invalid_attributes}, valid_session - expect(assigns(:dataset)).to be_a_new(Dataset) - end - - it "re-renders the 'new' template" do - post :create, {:dataset => invalid_attributes}, valid_session - expect(response).to render_template("new") - end - end - end - - describe "PUT #update" do - context "with valid params" do - let(:new_attributes) { - skip("Add a hash of attributes valid for your model") - } - - it "updates the requested dataset" do - dataset = Dataset.create! valid_attributes - put :update, {:id => dataset.to_param, :dataset => new_attributes}, valid_session - dataset.reload - skip("Add assertions for updated state") - end - - it "assigns the requested dataset as @dataset" do - dataset = Dataset.create! valid_attributes - put :update, {:id => dataset.to_param, :dataset => valid_attributes}, valid_session - expect(assigns(:dataset)).to eq(dataset) - end - - it "redirects to the dataset" do - dataset = Dataset.create! valid_attributes - put :update, {:id => dataset.to_param, :dataset => valid_attributes}, valid_session - expect(response).to redirect_to(dataset) - end - end - - context "with invalid params" do - it "assigns the dataset as @dataset" do - dataset = Dataset.create! valid_attributes - put :update, {:id => dataset.to_param, :dataset => invalid_attributes}, valid_session - expect(assigns(:dataset)).to eq(dataset) - end - - it "re-renders the 'edit' template" do - dataset = Dataset.create! valid_attributes - put :update, {:id => dataset.to_param, :dataset => invalid_attributes}, valid_session - expect(response).to render_template("edit") - end - end - end - - describe "DELETE #destroy" do - it "destroys the requested dataset" do - dataset = Dataset.create! valid_attributes - expect { - delete :destroy, {:id => dataset.to_param}, valid_session - }.to change(Dataset, :count).by(-1) - end - - it "redirects to the datasets list" do - dataset = Dataset.create! valid_attributes - delete :destroy, {:id => dataset.to_param}, valid_session - expect(response).to redirect_to(datasets_url) - end - end - -end diff --git a/rails/spec/controllers/job_upload_controller_spec.rb b/rails/spec/controllers/job_upload_controller_spec.rb deleted file mode 100644 index d7d05214b8a43e35a05ca377bc85b58afcf3caae..0000000000000000000000000000000000000000 --- a/rails/spec/controllers/job_upload_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe JobUploadController, type: :controller do - -end diff --git a/rails/spec/controllers/jobs_controller_spec.rb b/rails/spec/controllers/jobs_controller_spec.rb deleted file mode 100644 index cf6ce841174ab11371bb2fc827022e790c600f93..0000000000000000000000000000000000000000 --- a/rails/spec/controllers/jobs_controller_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe JobsController, type: :controller do - -end diff --git a/rails/spec/controllers/webapps_controller_spec.rb b/rails/spec/controllers/webapps_controller_spec.rb deleted file mode 100644 index cd1ffe5c13fadc0a05b20e8d24c0e00bb95388c0..0000000000000000000000000000000000000000 --- a/rails/spec/controllers/webapps_controller_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'spec_helper' - -describe WebappsController do - describe "GET #index" do - it "should renders the :index view" - end - - describe "POST #create" do - context "with valid attributes" do - it "saves the new contact in the database" - it "redirects to the home page" - end - end -end diff --git a/rails/spec/factories/datasets.rb b/rails/spec/factories/datasets.rb deleted file mode 100644 index e5d4bda5c97a43fd9d8ba3d334c49b293e8f4b30..0000000000000000000000000000000000000000 --- a/rails/spec/factories/datasets.rb +++ /dev/null @@ -1,9 +0,0 @@ -FactoryGirl.define do - factory :dataset do - name "MyString" -size 1 -user_id "" -extension "MyString" - end - -end diff --git a/rails/spec/factories/job_queues.rb b/rails/spec/factories/job_queues.rb deleted file mode 100644 index d49c8fed65b72f0a8c5b1765edf6d24dd90aaeae..0000000000000000000000000000000000000000 --- a/rails/spec/factories/job_queues.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :job_queue do - name "MyString" - timeout 1 - end -end diff --git a/rails/spec/factories/jobs.rb b/rails/spec/factories/jobs.rb deleted file mode 100644 index 4a033ce800faf592b1d89b86dd6b4de2f482164c..0000000000000000000000000000000000000000 --- a/rails/spec/factories/jobs.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :job do - - end - -end diff --git a/rails/spec/factories/users.rb b/rails/spec/factories/users.rb deleted file mode 100644 index f10717572bd5bdc7f7bce4e01d6f0afdec2ac840..0000000000000000000000000000000000000000 --- a/rails/spec/factories/users.rb +++ /dev/null @@ -1,7 +0,0 @@ -FactoryGirl.define do - factory :user do - #f.firstname { Faker::Name.email } - #f.lastname { Faker::Name.last_name } - end - -end diff --git a/rails/spec/factories/webapp_versions.rb b/rails/spec/factories/webapp_versions.rb deleted file mode 100644 index d0b7037897331bcd498c9a2f1b63de7d72ac4f57..0000000000000000000000000000000000000000 --- a/rails/spec/factories/webapp_versions.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :webapp_version do - - end - -end diff --git a/rails/spec/factories/webapps.rb b/rails/spec/factories/webapps.rb deleted file mode 100644 index 232972289897952e4a93096ff8bc1b725bc04d60..0000000000000000000000000000000000000000 --- a/rails/spec/factories/webapps.rb +++ /dev/null @@ -1,6 +0,0 @@ -FactoryGirl.define do - factory :webapp do - - end - -end diff --git a/rails/spec/models/dataset_spec.rb b/rails/spec/models/dataset_spec.rb deleted file mode 100644 index 1e0d64c5a41f1405308d96ea3867e1ada5c304b9..0000000000000000000000000000000000000000 --- a/rails/spec/models/dataset_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Dataset, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/rails/spec/models/job_queue_spec.rb b/rails/spec/models/job_queue_spec.rb deleted file mode 100644 index d4c70eaa85718593b7b776baa9c89a0db2339e98..0000000000000000000000000000000000000000 --- a/rails/spec/models/job_queue_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe JobQueue, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/rails/spec/models/job_spec.rb b/rails/spec/models/job_spec.rb deleted file mode 100644 index b5a5d926bbb31035d3b1cb7a1a0f5bdf02088bf6..0000000000000000000000000000000000000000 --- a/rails/spec/models/job_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Job, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/rails/spec/models/user_spec.rb b/rails/spec/models/user_spec.rb deleted file mode 100644 index 47a31bb435500313e6f5e5bd5e353727a21152a6..0000000000000000000000000000000000000000 --- a/rails/spec/models/user_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe User, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/rails/spec/models/webapp_spec.rb b/rails/spec/models/webapp_spec.rb deleted file mode 100644 index 1c26a16da420a1eaffc11dc900e13c1deeaf3273..0000000000000000000000000000000000000000 --- a/rails/spec/models/webapp_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Webapp, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/rails/spec/models/webapp_version_spec.rb b/rails/spec/models/webapp_version_spec.rb deleted file mode 100644 index 3c19665292de9a99489a1e253b02f8b149e38c6d..0000000000000000000000000000000000000000 --- a/rails/spec/models/webapp_version_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe WebappVersion, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/rails/spec/rails_helper.rb b/rails/spec/rails_helper.rb deleted file mode 100644 index d056a196b78066b5405b0b2634a6c309d65075fd..0000000000000000000000000000000000000000 --- a/rails/spec/rails_helper.rb +++ /dev/null @@ -1,57 +0,0 @@ -# This file is copied to spec/ when you run 'rails generate rspec:install' -ENV['RAILS_ENV'] ||= 'test' -require File.expand_path('../../config/environment', __FILE__) -# Prevent database truncation if the environment is production -abort("The Rails environment is running in production mode!") if Rails.env.production? -require 'spec_helper' -require 'rspec/rails' -require 'factory_girl_rails' -# Add additional requires below this line. Rails is not loaded until this point! - -# Requires supporting ruby files with custom matchers and macros, etc, in -# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are -# run as spec files by default. This means that files in spec/support that end -# in _spec.rb will both be required and run as specs, causing the specs to be -# run twice. It is recommended that you do not name files matching this glob to -# end with _spec.rb. You can configure this pattern with the --pattern -# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. -# -# The following line is provided for convenience purposes. It has the downside -# of increasing the boot-up time by auto-requiring all files in the support -# directory. Alternatively, in the individual `*_spec.rb` files, manually -# require only the support files necessary. -# -# Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } - -# Checks for pending migrations before tests are run. -# If you are not using ActiveRecord, you can remove this line. -ActiveRecord::Migration.maintain_test_schema! - -RSpec.configure do |config| - - #including factory girls - config.include FactoryGirl::Syntax::Methods - - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - config.use_transactional_fixtures = true - - # RSpec Rails can automatically mix in different behaviours to your tests - # based on their file location, for example enabling you to call `get` and - # `post` in specs under `spec/controllers`. - # - # You can disable this behaviour by removing the line below, and instead - # explicitly tag your specs with their type, e.g.: - # - # RSpec.describe UsersController, :type => :controller do - # # ... - # end - # - # The different available types are documented in the features, such as in - # https://relishapp.com/rspec/rspec-rails/docs - config.infer_spec_type_from_file_location! -end diff --git a/rails/spec/requests/datasets_spec.rb b/rails/spec/requests/datasets_spec.rb deleted file mode 100644 index 6458d728a18078c7006819058aed4d752d01e5ce..0000000000000000000000000000000000000000 --- a/rails/spec/requests/datasets_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require 'rails_helper' - -RSpec.describe "Datasets", type: :request do - describe "GET /datasets" do - it "works! (now write some real specs)" do - get datasets_path - expect(response).to have_http_status(200) - end - end -end diff --git a/rails/spec/spec_helper.rb b/rails/spec/spec_helper.rb deleted file mode 100644 index 913e28a6188b636997852cc0f80c143a5525c322..0000000000000000000000000000000000000000 --- a/rails/spec/spec_helper.rb +++ /dev/null @@ -1,92 +0,0 @@ -# This file was generated by the `rails generate rspec:install` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # These two settings work together to allow you to limit a spec run - # to individual examples or groups you care about by tagging them with - # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # get run. - config.filter_run :focus - config.run_all_when_everything_filtered = true - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching - config.disable_monkey_patching! - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = 'doc' - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end diff --git a/rails/test/controllers/.keep b/rails/test/controllers/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/test/controllers/documentation_controller_test.rb b/rails/test/controllers/documentation_controller_test.rb deleted file mode 100644 index cffcde32919f0801948015b425d15d776bc0704d..0000000000000000000000000000000000000000 --- a/rails/test/controllers/documentation_controller_test.rb +++ /dev/null @@ -1,20 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class DocumentationControllerTest < ActionController::TestCase - test "should get about" do - get :about - assert_response :success - end - - test "should get tutorial" do - get :tutorial - assert_response :success - end - - test "should get infrastructure" do - get :infrastructure - assert_response :success - end - -end diff --git a/rails/test/controllers/jobs_controller_test.rb b/rails/test/controllers/jobs_controller_test.rb deleted file mode 100644 index 9c55c54f5bfc174ed19b20f9a195638831ba17a0..0000000000000000000000000000000000000000 --- a/rails/test/controllers/jobs_controller_test.rb +++ /dev/null @@ -1,50 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class JobsControllerTest < ActionController::TestCase - setup do - @job = jobs(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:jobs) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create job" do - assert_difference('Job.count') do - #post :create, job: { webapp_id: @job.app, datafile: @job.datafile, webapp_version: @job.webapp_version, webapp_id } - end - - assert_redirected_to job_path(assigns(:job)) - end - - test "should show job" do - get :show, id: @job - assert_response :success - end - - test "should get edit" do - get :edit, id: @job - assert_response :success - end - - test "should update job" do - patch :update, id: @job, job: { app: @job.app, datafile: @job.datafile } - assert_redirected_to job_path(assigns(:job)) - end - - test "should destroy job" do - assert_difference('Job.count', -1) do - delete :destroy, id: @job - end - - assert_redirected_to jobs_path - end -end diff --git a/rails/test/controllers/quotas_controller_test.rb b/rails/test/controllers/quotas_controller_test.rb deleted file mode 100644 index 398204ef4678f4036892d48b7b38f8c0aea4ff24..0000000000000000000000000000000000000000 --- a/rails/test/controllers/quotas_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class QuotasControllerTest < ActionController::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/rails/test/controllers/webapps_controller_test.rb b/rails/test/controllers/webapps_controller_test.rb deleted file mode 100644 index f2e2cc802eec19e724432c3067d045db10e1b6e7..0000000000000000000000000000000000000000 --- a/rails/test/controllers/webapps_controller_test.rb +++ /dev/null @@ -1,50 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class WebappsControllerTest < ActionController::TestCase - setup do - @webapp = webapps(:one) - end - - test "should get index" do - get :index - assert_response :success - assert_not_nil assigns(:webapps) - end - - test "should get new" do - get :new - assert_response :success - end - - test "should create webapp" do - assert_difference('Webapp.count') do - post :create, webapp: { contact: @webapp.contact, description: @webapp.description, name: @webapp.name } - end - - assert_redirected_to webapp_path(assigns(:webapp)) - end - - test "should show webapp" do - get :show, id: @webapp - assert_response :success - end - - test "should get edit" do - get :edit, id: @webapp - assert_response :success - end - - test "should update webapp" do - patch :update, id: @webapp, webapp: { contact: @webapp.contact, description: @webapp.description, name: @webapp.name } - assert_redirected_to webapp_path(assigns(:webapp)) - end - - test "should destroy webapp" do - assert_difference('Webapp.count', -1) do - delete :destroy, id: @webapp - end - - assert_redirected_to webapps_path - end -end diff --git a/rails/test/fixtures/.keep b/rails/test/fixtures/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/test/fixtures/files/bois.mp3 b/rails/test/fixtures/files/bois.mp3 deleted file mode 100644 index dffe7c10ea49bfb0863df9cae8cbb4d54275b577..0000000000000000000000000000000000000000 Binary files a/rails/test/fixtures/files/bois.mp3 and /dev/null differ diff --git a/rails/test/fixtures/jobs.yml b/rails/test/fixtures/jobs.yml deleted file mode 100644 index 6b4a82332bd449193b2d1ffb5c5d784ce83697fd..0000000000000000000000000000000000000000 --- a/rails/test/fixtures/jobs.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - datafile: fixture_file_upload('files/bois.mp3','application/json') - webapp_id: 1 - user_id: 24 - webapp_version: 1.0 - status: 'NEW' - -two: - datafile: MyString - webapp_id: 1 - user_id: 1 - status: MyString diff --git a/rails/test/fixtures/quota.yml b/rails/test/fixtures/quota.yml deleted file mode 100644 index e86d7523fc987c800ea09f39f3407cea666b2b6f..0000000000000000000000000000000000000000 --- a/rails/test/fixtures/quota.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - user_id: 1 - webapps_id: 1 - quantity: 10000 - -two: - user_id: 2 - webapps_id: 1 - quantity: 124006 diff --git a/rails/test/fixtures/users.yml b/rails/test/fixtures/users.yml deleted file mode 100644 index 4a82a284714e14e6963c2a14605f6323513f2e13..0000000000000000000000000000000000000000 --- a/rails/test/fixtures/users.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -<% 1000.times do |n| %> -user_<%= n %>: - username: <%= "user#{n}" %> - email: <%= "user#{n}@example.com" %> -<% end %> diff --git a/rails/test/fixtures/webapps.yml b/rails/test/fixtures/webapps.yml deleted file mode 100644 index 7706a1ba5e391fce696fe5ef9e88e105d93f4962..0000000000000000000000000000000000000000 --- a/rails/test/fixtures/webapps.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html - -one: - name: 'toto' - description: 'hello world' - contact: @user_1.email - -two: - name: MyString - description: MyString - contact: MyString diff --git a/rails/test/helpers/.keep b/rails/test/helpers/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/test/helpers/documentation_helper_test.rb b/rails/test/helpers/documentation_helper_test.rb deleted file mode 100644 index 8c07066b478e342c1523030a508216d3ab7afe37..0000000000000000000000000000000000000000 --- a/rails/test/helpers/documentation_helper_test.rb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class DocumentationHelperTest < ActionView::TestCase -end diff --git a/rails/test/helpers/jobs_helper_test.rb b/rails/test/helpers/jobs_helper_test.rb deleted file mode 100644 index 64ff877ac203947f86f67c6c4f47426747124106..0000000000000000000000000000000000000000 --- a/rails/test/helpers/jobs_helper_test.rb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class JobsHelperTest < ActionView::TestCase -end diff --git a/rails/test/helpers/quotas_helper_test.rb b/rails/test/helpers/quotas_helper_test.rb deleted file mode 100644 index dbf06ab765e8fcac82193f4313e39627db4ff149..0000000000000000000000000000000000000000 --- a/rails/test/helpers/quotas_helper_test.rb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class QuotasHelperTest < ActionView::TestCase -end diff --git a/rails/test/helpers/webapps_helper_test.rb b/rails/test/helpers/webapps_helper_test.rb deleted file mode 100644 index 13fa8e45fd495d8341cd2582249a88e8cc2ee44e..0000000000000000000000000000000000000000 --- a/rails/test/helpers/webapps_helper_test.rb +++ /dev/null @@ -1,5 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class WebappsHelperTest < ActionView::TestCase -end diff --git a/rails/test/integration/.keep b/rails/test/integration/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/test/mailers/.keep b/rails/test/mailers/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/test/models/.keep b/rails/test/models/.keep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/rails/test/models/job_test.rb b/rails/test/models/job_test.rb deleted file mode 100644 index d575feb24d562af1afbad9ad7e481d85297d3b6d..0000000000000000000000000000000000000000 --- a/rails/test/models/job_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class JobTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/rails/test/models/quota_test.rb b/rails/test/models/quota_test.rb deleted file mode 100644 index 17fff22481a080376f11f3ea7355eb9fd1d1df1c..0000000000000000000000000000000000000000 --- a/rails/test/models/quota_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class QuotaTest < ActiveSupport::TestCase - - # test "the truth" do - # assert true - # end -end diff --git a/rails/test/models/user_test.rb b/rails/test/models/user_test.rb deleted file mode 100644 index 5676662292bf23950ea2a5f88e61793fa04d47ee..0000000000000000000000000000000000000000 --- a/rails/test/models/user_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class UserTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/rails/test/models/webapp_test.rb b/rails/test/models/webapp_test.rb deleted file mode 100644 index b4076e6b38e7fa6c815499f846085cdce2f4531c..0000000000000000000000000000000000000000 --- a/rails/test/models/webapp_test.rb +++ /dev/null @@ -1,12 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class WebappTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -test "should not save webapp without name" do - w = Webapp.new - assert_not w.save, "Saved the article without a name" -end -end diff --git a/rails/test/models/webapp_types_test.rb b/rails/test/models/webapp_types_test.rb deleted file mode 100644 index dfc1f19eec3ad57a1ef23cccfb44e3c6d3fcdebf..0000000000000000000000000000000000000000 --- a/rails/test/models/webapp_types_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -# -*- encoding : utf-8 -*- -require 'test_helper' - -class WebappTypesTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end -end diff --git a/rails/test/test_helper.rb b/rails/test/test_helper.rb deleted file mode 100644 index 0ae7ebdf48a162547612a6425cccb24df31bd6f6..0000000000000000000000000000000000000000 --- a/rails/test/test_helper.rb +++ /dev/null @@ -1,16 +0,0 @@ -# -*- encoding : utf-8 -*- -ENV["RAILS_ENV"] ||= "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - ActiveRecord::Migration.check_pending! - - # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - fixtures :all - - # Add more helper methods to be used by all tests here... -end