This commit is contained in:
jysperm
2014-10-13 16:00:14 +08:00
parent 5bcec4313d
commit e7f9056ff4
4 changed files with 8 additions and 66 deletions

View File

@@ -27,7 +27,7 @@ exports.try = (key, options, setter, callback) ->
redis.get key, (err, value) ->
if value != undefined
if options.is_json
value = JSON.prase value
value = JSON.parse value
callback value
@@ -39,7 +39,7 @@ exports.try = (key, options, setter, callback) ->
options.command key, value, ->
callback value
exports.delete (key, param, callback) ->
exports.delete = (key, param, callback) ->
unless callback
callback = param
param = {}

View File

@@ -89,6 +89,10 @@ exports.selectHook = (account, hook_name) ->
return _.filter pointer, (hook) ->
if hook.plugin_info.type == 'extension'
return true
else if !hook.require_account
return true
else if !account
return false
else if account.meta == 'any'
return true
else if hook.plugin_info.name in account.billing.services

View File

@@ -1,6 +1,8 @@
child_process = require 'child_process'
os = require 'os'
fs = require 'fs'
async = require 'async'
_ = require 'underscore'
{config} = app
{mAccount} = app.models

View File

@@ -1,64 +0,0 @@
module.exports =
web:
name: 'GreenShadow'
url: 'http://greenshadow.net'
listen: '/home/rpadmin/rootpanel.sock'
google_analytics_id: 'UA-49193300-3'
account:
cookie_time: 30 * 24 * 3600 * 1000
i18n:
defaultLanguage: 'zh_CN'
availableLanguage: ['zh_CN', 'en']
plugin:
available_extensions: ['rpvhost']
available_services: ['shadowsocks']
billing:
taobao_item_id: '41040606505'
force_unsubscribe:
when_balance_below: 0
when_arrears_above: 0
cyclical_billing: 3600 * 1000
daily_billing_cycle: 24 * 3600 * 1000
plans:
shadowsocks:
t_name: 'ShadowSocks'
t_service: '按量付费'
t_resources: '0.6 CNY / G'
services: ['shadowsocks']
resources: {}
mongodb:
user: 'rpadmin'
password: 'password'
host: 'localhost'
name: 'RootPanel'
redis_password: 'password'
email:
send_from: 'robot@rpvhost.net'
account:
service: 'Postmark'
auth:
user: 'postmark-api-token'
pass: 'postmark-api-token'
bitcoin:
coinbase_api_key: 'coinbase-simple-api-key'
plugins:
rpvhost:
index_page: false
shadowsocks:
price_bucket: 0.06
monitor_cycle: 60 * 1000
billing_bucket: 100 * 1024 * 1024