Skip to content

Commit

Permalink
subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
gyteng committed Jul 3, 2019
1 parent 72ecf33 commit f424cbd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shadowsocks-manager",
"version": "0.32.29",
"version": "0.32.30",
"description": "A shadowsocks manager tool for multi user and traffic control.",
"main": "server.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion plugins/webgui/server/adminAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ exports.getSubscribeAccountForUser = async (req, res) => {
}
const result = subscribeAccount.server.map(s => {
if(type === 'shadowrocket') {
return 'ss://' + Buffer.from(s.method + ':' + subscribeAccount.account.password + '@' + s.host + ':' + (subscribeAccount.account.port + + s.shift)).toString('base64') + '#' + Buffer.from(s.subscribeName || s.name).toString('base64');
return 'ss://' + Buffer.from(s.method + ':' + subscribeAccount.account.password + '@' + s.host + ':' + (subscribeAccount.account.port + + s.shift)).toString('base64') + '#' + (s.subscribeName || s.name);
} else if(type === 'potatso') {
return 'ss://' + Buffer.from(s.method + ':' + subscribeAccount.account.password + '@' + s.host + ':' + (subscribeAccount.account.port + + s.shift)).toString('base64') + '#' + (s.subscribeName || s.name);
} else if(type === 'ssr') {
Expand Down
8 changes: 6 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ if(process.argv.indexOf('--multiCore') > 1) {
require('./init/log');
const log4js = require('log4js');
const logger = log4js.getLogger('system');
logger.info(`System start[${ process.pid }].`);
if(cluster.isMaster) {
logger.info(`System start[${ process.pid }].`);
} else {
logger.info(`Worker start[${ process.pid }].`);
}

process.on('unhandledRejection', (reason, p) => {
logger.error('Unhandled Rejection at: Promise', p, 'reason:', reason);
Expand All @@ -19,7 +23,6 @@ process.on('uncaughtException', (err) => {
});

const startWorker = async () => {
logger.info(`Worker [${ process.pid }] started`);
require('./init/utils');

require('./init/moveConfigFile');
Expand All @@ -44,6 +47,7 @@ if(cluster.isMaster) {
}
});
cluster.on('exit', (worker, code, signal) => {
if(code === 0) { return; }
logger.error(`worker [${ worker.process.pid }][${ worker.id }] died`);
for(const w in cluster.workers) {
process.env.mainWorker = w;
Expand Down

0 comments on commit f424cbd

Please sign in to comment.