diff --git a/.gitignore b/.gitignore index a51e2aa..8d89755 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ /node_modules + /.vagrant +/package.box + +/config.coffee diff --git a/INSTALL.md b/INSTALL.md index 4ea3295..aac8355 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,11 +1,3 @@ -顺序: - -* Core 中 reboot 之前的部分 -* Plugin 中用到的插件的 reboot 之前的部分 -* reboot -* 继续装 Core 中 reboot 后的部分,和 Plugin 中 reboot 后的部分(如果有的话) -* 安装 Runtime(如果需要的话) - ## Ubuntu 14.04 amd64 ### Core @@ -25,6 +17,8 @@ mongo + use admin + db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase', 'clusterAdmin']}) use RootPanel db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWrite']}) @@ -40,7 +34,7 @@ rm /etc/nginx/sites-enabled/default - cat > /etc/nginx/sites-available/rpadmin + vi /etc/nginx/sites-enabled/rpadmin server { listen 80 default_server; @@ -59,9 +53,7 @@ } } - ln -s /etc/nginx/sites-available/rpadmin /etc/nginx/sites-enabled - - adduser rpadmin + useradd -m rpadmin usermod -G rpadmin -a www-data vi /etc/sudoers @@ -72,26 +64,30 @@ iptables-restore < /etc/iptables.rules - reboot - su rpadmin cd ~ git clone https://github.com/jysperm/RootPanel.git cd RootPanel - vi config.coffee + cp sample/core.config.coffee config.coffee - sudo vi /etc/supervisor/conf.d/rpadmin.conf + npm install + + exit + + vi /etc/supervisor/conf.d/rpadmin.conf [program:RootPanel] command=node /home/rpadmin/RootPanel/start.js autorestart=true user=rpadmin - npm install - sudo service supervisor restart + service nginx restart + service mongodb restart + service redis-server restart + service supervisor restart ### Plugin @@ -112,13 +108,6 @@ apt-get install memcached - # MongoDB - - mongo - - use admin - db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase', 'clusterAdmin']}) - # MySQL apt-get install mariadb-server diff --git a/README.md b/README.md index 74f14f4..176290d 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ RootPanel 是一个高度插件化的,基于 Linux 的虚拟服务销售平台 git.config.coffee # Git 托管 xen.config.coffee # Xen VPS -配置文件位于 `config.coffee` +请选择一个配置文件复制到根目录,重命名为 `config.coffee`. ## Vagrant diff --git a/Vagrantfile b/Vagrantfile index c44b86a..e9dd597 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,5 +6,8 @@ Vagrant.configure(2) do |config| config.vm.hostname = "rp.rpvhost.net" config.vm.network "private_network", ip: "192.168.33.10" - config.vm.network "public_network" + config.vm.network "public_network", bridge: 'en0: Wi-Fi (AirPort)' + + config.vm.synced_folder ".", "/vagrant", + owner: "rpadmin", group: "rpadmin" end diff --git a/app.coffee b/app.coffee index 31dbc4c..ac8e0c7 100644 --- a/app.coffee +++ b/app.coffee @@ -3,7 +3,7 @@ nodemailer = require 'nodemailer' path = require 'path' harp = require 'harp' fs = require 'fs' -moment = require 'moment' +moment = require 'moment-timezone' redis = require 'redis' global.app = express() diff --git a/config.coffee b/config.coffee deleted file mode 100644 index 244ca34..0000000 --- a/config.coffee +++ /dev/null @@ -1,82 +0,0 @@ -module.exports = - web: - name: 'GreenShadow' - url: 'http://ss.rpvhost.net' - listen: '/home/rpadmin/rootpanel.sock' - google_analytics_id: 'UA-49193300-2' - - account: - cookie_time: 30 * 24 * 3600 * 1000 - - i18n: - available_language: ['zh_CN'] - default_language: 'zh_CN' - default_timezone: 'Asia/Shanghai' - - plugin: - available_extensions: ['rpvhost', 'wiki', 'bitcoin'] - available_services: ['shadowsocks'] - - billing: - currency: 'CNY' - - 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: - host: '127.0.0.1' - port: 6379 - password: 'password' - prefix: 'RP' - - 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: 5 * 60 * 1000 - billing_bucket: 100 * 1024 * 1024 - - linux: - monitor_cycle: 30 * 1000 - - mysql: - connection: - host: 'localhost' - user: 'rpadmin' - password: 'password'