Commit 53ac7428 authored by gubala's avatar gubala

experimental prometheus support

parent 0c6554f8
......@@ -99,6 +99,7 @@ end
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'ruby-gridftp', git: 'https://gitlab.dev.cyfronet.pl/commons/ruby-gridftp.git', branch: 'master'
# gem 'ruby-gridftp', git: 'https://gitlab.dev.cyfronet.pl/commons/ruby-gridftp.git', branch: 'master'
gem 'ruby-gridftp', git: 'git@dev.cyfronet.pl:commons/ruby-gridftp.git', branch: 'master'
#gem 'ruby-gridftp', git: 'https://gitlab.dev.cyfronet.pl/commons/ruby-gridftp.git', branch: 'parallelizm_pthreads'
#gem 'ruby-gridftp', git: 'https://gitlab.dev.cyfronet.pl/commons/ruby-gridftp.git', branch: 'parallelizm_nothreads'
......@@ -7,8 +7,8 @@ GIT
sass (>= 3.2)
GIT
remote: https://gitlab.dev.cyfronet.pl/commons/ruby-gridftp.git
revision: 8b75646fea704ad413ca947fd09221529097c5dc
remote: git@dev.cyfronet.pl:commons/ruby-gridftp.git
revision: b11ea1e5424a16f51408edfdfa9ad0c75e434652
branch: master
specs:
ruby-gridftp (0.0.1)
......@@ -84,7 +84,7 @@ GEM
activesupport (>= 3.0.4)
execjs (2.0.2)
fastercsv (1.5.5)
ffi (1.9.8)
ffi (1.9.10)
foreigner (1.6.1)
activerecord (>= 3.0.0)
haml (4.0.5)
......
......@@ -56,6 +56,16 @@ class ApplicationController < ActionController::Base
@path = URI.escape @path
end
def set_gftp_server
logger.debug "PATH: " + @path
if @path.start_with?('/prometheus/') || @path.start_with?('prometheus/')
@path = "gsiftp://" +
Plgdata::Application.config.prometheus_gridftp_host +
"/#{@path.gsub!('prometheus/', '')}"
logger.debug "NEW PATH: " + @path
end
end
def sanitize_filename(filename)
URI.escape(filename.strip[0..256].tap do |name|
name.gsub! /\//, '_'
......
class FilesController < ApplicationController
skip_before_filter :authenticate_user!, only: [:download, :upload, :remove]
before_filter :sanitize_path
before_filter :set_gftp_server
before_filter :restrict_api_access, only: [:download, :upload, :remove]
before_filter :check_proxy_existence
......
......@@ -2,6 +2,7 @@ class FoldersController < ApplicationController
skip_before_filter :authenticate_user!, only: [:list, :mkdir]
before_filter :sanitize_path, except: [:no_access_error]
before_filter :set_gftp_server, except: [:no_access_error]
before_filter :restrict_api_access, only: [:list, :mkdir]
before_filter :check_proxy_existence, except: [:no_access_error]
......
......@@ -5,5 +5,7 @@ Plgdata::Application.config.secondary_gridftp_host = 'qcg.grid.cyf-kr.edu.pl'
Plgdata::Application.config.primary_gridftp_port = 2811
Plgdata::Application.config.secondary_gridftp_port = 2811
Plgdata::Application.config.prometheus_gridftp_host = 'login01.prometheus.cyf-kr.edu.pl'
GFTP::SERVER_HOST = Plgdata::Application.config.primary_gridftp_host
puts "Setting up primary GridFTP server to #{GFTP::SERVER_HOST}."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment