diff --git a/app/controllers/rpc_controller.rb b/app/controllers/rpc_controller.rb deleted file mode 100644 index e9e5ba78a..000000000 --- a/app/controllers/rpc_controller.rb +++ /dev/null @@ -1,41 +0,0 @@ -# -*- encoding : utf-8 -*- -class RpcController < ApplicationController - exposes_xmlrpc_methods - - before_filter :authenticate_user! - before_filter lambda { EventLog.current_controller = self }, :only => :xe_index # should be after auth callback - - ## Usage example: - # - # require 'xmlrpc/client' - # client = XMLRPC::Client.new("127.0.0.1", '/api/xmlrpc', 3000, nil, nil, 'user@email', 'password', false, 900) - # client.call("project_versions", 1) - - def platforms - ActiveSupport::Notifications.instrument "event_log.observer", :message => I18n.t('event_log.notices.platforms_list') - Platform.select('name').where("platform_type = ?", 'main').map(&:name) - end - - def user_projects - ActiveSupport::Notifications.instrument "event_log.observer", :message => I18n.t('event_log.notices.users_list') - current_user.projects.map{|p| { :id => p.id, :name => p.name } } - end - - def project_versions id - p = Project.find_by_id(id) - ActiveSupport::Notifications.instrument "event_log.observer", :object => p, :message => I18n.t('event_log.notices.versions_list') - p.tags.map(&:name) rescue 'not found' - end - - def build_status id - bl = BuildList.find_by_id(id) - ActiveSupport::Notifications.instrument "event_log.observer", :object => bl, :message => I18n.t('event_log.notices.status') - bl.try(:status) || 'not found' - end - - def build_packet project_id, repo_id - # p = Project.find_by_id(project_id); r = Repository.find_by_id(repo_id) - ActiveSupport::Notifications.instrument "event_log.observer", :message => I18n.t('event_log.notices.project_build') - 'unknown' # TODO: build packet - end -end diff --git a/app/models/event_log.rb b/app/models/event_log.rb index ba1e2343e..ca3607a82 100644 --- a/app/models/event_log.rb +++ b/app/models/event_log.rb @@ -21,7 +21,7 @@ class EventLog < ActiveRecord::Base el.ip = current_controller.request.remote_ip el.controller = current_controller.class.to_s el.action = current_controller.action_name - el.protocol = (el.controller == 'RpcController' ? 'api' : 'web') + el.protocol = 'web' end end diff --git a/bin/xml-client-demo.rb b/bin/xml-client-demo.rb deleted file mode 100755 index af73ea16c..000000000 --- a/bin/xml-client-demo.rb +++ /dev/null @@ -1,38 +0,0 @@ -# -*- encoding : utf-8 -*- -#!/usr/bin/env ruby - -require 'rubygems' -require 'xmlrpc/client' -require 'pp' - -# Please correctly fill following vars -@host = 'npp-build.rosalab.ru' -@port = 80 -@user = 'pchipiga@ya.ru' -@password = '123456' - -puts 'PLATFORMS' -client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900) -pp client.call("platforms") - -puts 'USER PROJECTS' -client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900) -pp client.call("user_projects") - -puts 'PROJECT VERSIONS' -client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900) -project_id = 1 # FIXME! -pp client.call("project_versions", project_id) - -puts 'BUILD STATUS' -client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900) -build_list_id = 1 # FIXME -pp client.call("build_status", build_list_id) - -puts 'BUILD PACKET' -client = XMLRPC::Client.new(@host, '/api/xmlrpc', @port, nil, nil, @user, @password, false, 900) -project_id = 1 # FIXME -repo_id = 1 # FIXME -pp client.call("build_packet", project_id, repo_id) - -puts 'DONE' diff --git a/config/routes.rb b/config/routes.rb index 1adfae20d..efb8bb716 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,5 @@ # -*- encoding : utf-8 -*- Rosa::Application.routes.draw do - # XML RPC - match 'api/xmlrpc' => 'rpc#xe_index' devise_scope :user do get '/users/auth/:provider' => 'users/omniauth_callbacks#passthru'