system preference

This commit is contained in:
Matt K. Fu committed 2013-04-24 19:21:11 +08:00
1 parent 62fa589e8a
commit b198b1a17b
19 files changed
+251 -83

No files matched your search

+2 -1
View File
@@ -5,4 +5,5 @@ YAML::ENGINE.yamler = 'syck'
# Initialize the rails application
Orbit::Application.initialize!
Me = Site.first
Me = Site.first
OrbitJobLogger = OrbitJobLog.new
@@ -0,0 +1,13 @@
module OrbitSystemPreference
ArchiveDbListPath = "#{Rails.root}/log/archive_db.list.log"
GitCommitListPath = "#{Rails.root}/log/git_commit.list.log"
ResqueLogFile ="#{Rails.root}/log/orbit_job.log"
GitLogCommend = 'git log --pretty=format:"%x09%ad%x09%s" --date=short'
DiskFree= 'df -h /'
DefaultDiskSpaceLimit = 3 #in GB
module SystemPackage
MongodbVersion = "mongod --version"
NginxVersion = "nginx -V"
SystemVersion = "uname -a"
end
end
+12
View File
@@ -389,6 +389,18 @@ en:
search_help: Please Enter the search argument for Google search.
settings: Site setting
sub_menu: Site sub-menu
system_preference: System Preference
system_preference_:
tab_backups: Backups
tab_commits: Commits
tab_summary: Summary
tab_logs: Logs
summary:
code_update_at: Code Update histroy
disk_space: Disk Free
no_data: No Data
version: Version
weekness_report: Weekness Report
title: Site Title
title_help: Site Title Guide
site_: Site
+12
View File
@@ -389,6 +389,18 @@ zh_tw:
search_help: 請輸入送交Google搜尋的參數
settings: 基本設定
sub_menu: 次選單
system_preference: 系統狀態
system_preference_:
tab_backups: 備份記錄
tab_commits: 程式版本
tab_summary: 總覽
tab_logs: 登錄檔
summary:
code_update_at: 程式更新紀錄
disk_space: 硬碟空間
no_data: 沒有資訊
version: 版本
weekness_report: 弱點掃瞄資訊
title: 網站標題
title_help: 網站標題說明
site_: 網站
+19 -14
View File
@@ -1,14 +1,9 @@
#developer pls change here
rails_root = "/home/nccu/stage/NCCU" #keep this blank when development
rails_env = ENV['RAILS_ENV'] || "production"
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/..'
user_home = ENV['HOME'] || File.dirname(__FILE__) + '/../..'
development_uid = ''
development_gid = ''
development_uid = 'kaito' #when dev
development_gid = 'staff' #when dev
#rails_env = "developement"
rails_env = "production"
development_rails_root = File.expand_path("..",File.dirname(__FILE__))
#rails_root = (rails_env == 'production' )? production_rails_root : development_rails_root
num_workers = rails_env == 'production' ? 5 : 2
num_workers.times do |num|
@@ -16,16 +11,26 @@ num_workers.times do |num|
w.dir = rails_root
w.name = "resque-#{num}"
w.group = 'resque-stage'
w.group = 'nccu_production'
w.interval = 30.seconds
w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env}
w.start = "rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}"
queue = case num
when 0
'critical'
when 1..2
'high,low'
when 3..num_workers
'low'
end
w.env = {"QUEUE"=>queue, "RAILS_ENV"=>rails_env}
w.start = "HOME=#{user_home} rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}"
w.uid = (rails_env == 'production' )? "root" : development_uid
w.gid = (rails_env == 'production' )? "root" : development_gid
w.log = (rails_env == 'production' )? "/var/log/#{w.name}-stage.log":"#{rails_root}/log/#{w.name}.log"
w.log = (rails_env == 'production' )? "/var/log/#{w.group}-#{w.name}":"#{rails_root}/log/dev_resque-#{w.name}.log"
# restart if memory gets too high
w.transition(:up, :restart) do |on|
+8 -14
View File
@@ -1,27 +1,21 @@
#developer pls change here
rails_root = "/home/nccu/NCCU/" #keep this blank when development
development_uid = 'kaito' #when dev
development_gid = 'staff' #when dev
#rails_env = "developement"
rails_env = "production"
development_rails_root = File.expand_path("..",File.dirname(__FILE__))
#rails_root = (rails_env == 'production' )? production_rails_root : development_rails_root
rails_env = ENV['RAILS_ENV'] || "production"
rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/..'
user_home = ENV['HOME'] || File.dirname(__FILE__) + '/../..'
development_uid = ''
development_gid = ''
God.watch do |w|
w.dir = rails_root
w.name = "resque-scheduler"
w.group = 'resque'
w.group = 'nccu_production'
w.interval = 30.seconds
w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env}
w.start = "rake -f #{rails_root}/Rakefile resque:scheduler RAILS_ENV=#{rails_env}"
w.start = "HOME= #{user_home} rake -f #{rails_root}/Rakefile resque:scheduler RAILS_ENV=#{rails_env}"
w.uid = (rails_env == 'production' )? "root" : development_uid
w.gid = (rails_env == 'production' )? "root" : development_gid
w.log = (rails_env == 'production' )? "/var/log/#{w.name}.log":"#{rails_root}/log/#{w.name}.log"
w.log = (rails_env == 'production' )? "/var/log/#{w.group}-#{w.name}.log":"#{rails_root}/log/dev_resque-#{w.name}.log"
# restart if memory gets too high
w.transition(:up, :restart) do |on|
+6 -6
View File
@@ -1,11 +1,11 @@
# do_mail_matt:
# every: 10s
# class: FetchTime
# args:
# description: Runs the perform method in FetchTime
update_tag_cloud:
cron: 0 0 [0,12] * * *
class: UpdateTagCloud
args:
description: UpdateTagCloud
generate_system_summary:
cron: 0 0 12 * * *
class: GenerateSystemSummary
args:
description: Generate the system status such as disk free space,package version list for showing at site tab
+1
View File
@@ -17,6 +17,7 @@ Orbit::Application.routes.draw do
# routes for admin
namespace :admin do
match 'system_preference' => "sites#show_system_preference",:as=>"system_preference"
mount Resque::Server.new, :at => "/resque"
resources :assets do
collection do