Skip to content

Commit

Permalink
Merge branch 'release/0.4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
yosukehara committed Jan 6, 2014
2 parents 455e074 + 8429cbf commit 6f47417
Show file tree
Hide file tree
Showing 277 changed files with 93,138 additions and 2,405 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.gem
*.rbc
*.swp
*.log
.bundle
.config
coverage
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ gem "sinatra", "~> 1.4.3"
gem "sinatra-contrib"
gem "haml"
gem "thin"
gem "leo_manager_client", "~> 0.4.8"
gem "leo_manager_client", "~> 0.4.9"
34 changes: 14 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
LeoCenter
==========
# LeoCenter

**Copyright (c) 2013 Rakuten, Inc.**
**Copyright (c) 2013-2014 Rakuten, Inc.**

**LeoCenter** is more powerful and user-friendly LeoFS's Web GUI Tool. You can easily operate LeoFS.
**LeoCenter** is more powerful and user-friendly LeoFS's Web GUI Tool, the documentation of which is [here](http://www.leofs.org/docs/leo_center.html).


Install
========
## Getting Started

### Requirements
* LeoFS v0.16.8 or higher
* Ruby 1.9.3 or higher

### Install

```
$ git clone
$ bundle install
```

Config
=======
### Configure

config.yml

Expand All @@ -28,22 +31,13 @@ config.yml
:secret_access_key: "YOUR_SECRET_ACCESS_KEY"
```
Run on Thin Web Server
======================
```
$ ruby config_webrick.ru ${PORT}
```

Run on Unicorn
==============
### Run on Thin Web Server
```
$ unicorn -c unicorn.conf config_unicorn.ru
$ thin start -a ${HOST} -p ${PORT}
```

Icons
=====
## Using Icons

* [Database](http://barrymieny.deviantart.com/art/Database-104013446): Barry Mieny (CC BY-NC-SA 3.0)
* [Tango Icon Library](http://tango.freedesktop.org/Tango_Icon_Library): Tango project (Public Domain)
Expand Down
19 changes: 11 additions & 8 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Leo Center
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand All @@ -20,7 +20,7 @@
#
# ======================================================================
gem "sinatra", "~> 1.4.3"
gem "leo_manager_client", "~> 0.4.8"
gem "leo_manager_client", "~> 0.4.9"

require "json"
require "haml"
Expand All @@ -36,25 +36,23 @@ class LoggerEx < Logger
end

class LeoCenter < Sinatra::Base
Version = "0.4.4"
Version = "0.4.5"
set :environment, :production
Config = CenterHelpers.load_config
SessionKey = "leofs_console_session"

class Error < StandardError; end

use Rack::CommonLogger, LoggerEx.new('leo_center.log')

session_config = Config[:session]
if session_config.has_key?(:local)
local_config = session_config[:local]
unless local_config.has_key?(:secret)
warn "session secret is not configured. please set it in config.yml. now LeoCenter uses random secret."
end
use Rack::Session::Cookie,
key: SessionKey,
secret: local_config[:secret] || Random.new.bytes(40),
expire_after: local_config[:expire_after] || 300 # 5 minutes in seconds
key: SessionKey,
secret: local_config[:secret] || Random.new.bytes(40),
expire_after: local_config[:expire_after] || 300 # 5 minutes in seconds
else
raise Error, "invalid session config: #{session_config}"
end
Expand Down Expand Up @@ -93,6 +91,11 @@ module Role
configure :production, :development do
@@manager = LeoManager::Client.new(*Config[:managers])

enable :logging
access_log = File.new("#{settings.root}/log/#{settings.environment}_access.log", 'a+')
access_log.sync = true
use Rack::CommonLogger, access_log

before do
debug "params: #{params}"
unless session[:user_id]
Expand Down
23 changes: 23 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ======================================================================
#
# Leo Center
#
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# ======================================================================
require "./app"
run LeoCenter
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
- Processes memory usage (1-min Averages)
- System memory usage (1-min Averages)
:plugins:
# - "disable_sign_up.rb"
# - "disable_sign_up.rb"
5 changes: 3 additions & 2 deletions config_thin.ru
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Leo Center
#
# Copyright (c) 2012 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand All @@ -21,4 +21,5 @@
# ======================================================================
require "./app"
#LeoCenter.run!(:host => ARGV[0], :port => (ARGV[1] || 8888))
LeoCenter.run!(:port => (ARGV[0] || 8888))
#LeoCenter.run!(:port => (ARGV[0] || 8888))
run LeoCenter
2 changes: 1 addition & 1 deletion lib/bucket_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/buckets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/growthforecast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
4 changes: 2 additions & 2 deletions lib/nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down Expand Up @@ -145,7 +145,7 @@ module GatewayLargeObjConfig
max_chunked_objs: "Max # of chunked objects",
max_len_for_obj: "Max size of an object",
chunked_obj_len: "Size of a chunked object",
threshold_obj_len: "Threshold of size of an object"
threshold_of_chunk_len: "Threshold of size of an object"
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/disable_sign_up.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/snmp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/system_conf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/user_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion lib/whereis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# LeoFS
#
# Copyright (c) 2012-2013 Rakuten, Inc.
# Copyright (c) 2012-2014 Rakuten, Inc.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
Expand Down
Empty file added log/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion public/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// LeoFS
//
// Copyright (c) 2012-2013 Rakuten, Inc.
// Copyright (c) 2012-2014 Rakuten, Inc.
//
// This file is provided to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file
Expand Down
9 changes: 1 addition & 8 deletions public/js/index.js → public/js/base_pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// LeoFS
//
// Copyright (c) 2012-2013 Rakuten, Inc.
// Copyright (c) 2012-2014 Rakuten, Inc.
//
// This file is provided to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file
Expand All @@ -20,13 +20,6 @@
//
//======================================================================
(function() {
/* config for logs
Highcharts.setOptions({
credits: { enabled: false },
global: { useUTC: false }
});
*/

Ext.onReady(function() {
var bucket_status = Ext.create("LeoCenter.BucketStatus");
var user_group = Ext.create("LeoCenter.UserGroup");
Expand Down
2 changes: 1 addition & 1 deletion public/js/bucket_status.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// LeoFS
//
// Copyright (c) 2012-2013 Rakuten, Inc.
// Copyright (c) 2012-2014 Rakuten, Inc.
//
// This file is provided to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion public/js/buckets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// LeoFS
//
// Copyright (c) 2012-2013 Rakuten, Inc.
// Copyright (c) 2012-2014 Rakuten, Inc.
//
// This file is provided to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file
Expand Down
2 changes: 1 addition & 1 deletion public/js/endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// LeoFS
//
// Copyright (c) 2012-2013 Rakuten, Inc.
// Copyright (c) 2012-2014 Rakuten, Inc.
//
// This file is provided to you under the Apache License,
// Version 2.0 (the "License"); you may not use this file
Expand Down
13 changes: 0 additions & 13 deletions public/js/highcharts/adapters/mootools-adapter.js

This file was deleted.

Loading

0 comments on commit 6f47417

Please sign in to comment.