Coder Social home page Coder Social logo

shadowsocks / shadowsocks-hub Goto Github PK

View Code? Open in Web Editor NEW
130.0 7.0 45.0 1.12 MB

A web app managing shadowsocks users, servers, nodes, products, accounts, and traffic. Suitable for internal use by companies, organizations, and friends.

JavaScript 82.42% HTML 17.44% CSS 0.14%
management webapp users servers products traffic

shadowsocks-hub's People

Contributors

eggham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

shadowsocks-hub's Issues

Traffic control not work

hi,excuse me:
I follow the user guide to create a product with 100MB/monthly,then when a port tgraffic exceed 100MB,the Connection cannot be disconnected automatically
image
image

Ungraceful shutdown of web container leads to loss of accounts

When we remove docker containers with "docker-compose down" because of ungraceful shutdown, the accounts info will be lost with next "docker-compose up -d".
I dont know why accounts details is not stored in mysql, to persist accounts in mysql volume.

How to delete existing accounts

Everything expect requests have delete options, however clicking these prompt reference error.
So I turn to requests, hoping to find a delete option, but I can't.
How can I delete existing accounts?

如何获取当前服务器在线用户及IP地址

如何获取当前服务器在线用户及IP地址 LIKE THIS

Get All Online User

Request method: POST
Request URL: https://host_name:port/online/all
Request Header: Content-Type: application/json
Response HTTP Status Code: 201 Created
Response Body: {"token","your_authentication_token"}
Response Error Status Code: 401 Unauthorized
500 Internal Server Error

Request example (curl):

curl -ik -H "Content-Type: application/json" -X POST https://localhost:4001/online/all   

Response example:

[{"user": user1,"ip":"122.44.55.66"},{"user": user2,"ip":"122.44.55.66"}]

web container wont come up after "docker compose down"

It seems after 1-"docker compose down" and 2-"docker compose up -d" the web container wont come up again and keeps restarting because when removing docker containers with compose, the default network is removed also and I think there is something wrong with web container ip or uid that is stored in the code and make web container restarting.
Solution: I have added external network to the docker-compose.yml and after "docker compose down" the network persists and web container can come up again after "docker compose up -d".

ER_NO_SUCH_TABLE: Table 'sshub.traffic' doesn't exist

I have no idea why this prompt up.
What's checked:

  • newest version
  • knex migrate:latest --env production
  • mysql account has access to traffic

What's may mess the things up is that I have imported old backup data into new database, but I have no idea how to check it out.

root@server:~/shadowsocks-hub# pm2 logs sshub --lines 50
[TAILING] Tailing last 50 lines for [sshub] process (change the value with --lines option)
/root/.pm2/logs/sshub-out.log last 50 lines:
0|sshub    | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:

/root/.pm2/logs/sshub-error.log last 50 lines:
0|sshub    |     --------------------
0|sshub    |     at Protocol._enqueue (/root/shadowsocks-hub/node_modules/mysql/lib/protocol/Protocol.js:144:48)
0|sshub    |     at Connection.query (/root/shadowsocks-hub/node_modules/mysql/lib/Connection.js:200:25)
0|sshub    |     at /root/shadowsocks-hub/node_modules/knex/lib/dialects/mysql/index.js:161:18
0|sshub    |     at Promise._execute (/root/shadowsocks-hub/node_modules/bluebird/js/release/debuggability.js:313:9)
0|sshub    |     at Promise._resolveFromExecutor (/root/shadowsocks-hub/node_modules/bluebird/js/release/promise.js:483:18)
0|sshub    |     at new Promise (/root/shadowsocks-hub/node_modules/bluebird/js/release/promise.js:79:10)
0|sshub    |     at Client_MySQL._query (/root/shadowsocks-hub/node_modules/knex/lib/dialects/mysql/index.js:155:12)
0|sshub    |     at Client_MySQL.query (/root/shadowsocks-hub/node_modules/knex/lib/client.js:206:17)
0|sshub    |     at Runner.<anonymous> (/root/shadowsocks-hub/node_modules/knex/lib/runner.js:155:36)
0|sshub    |     at Runner.tryCatcher (/root/shadowsocks-hub/node_modules/bluebird/js/release/util.js:16:23)
0|sshub    |     at Runner.query (/root/shadowsocks-hub/node_modules/bluebird/js/release/method.js:15:34)
0|sshub    |     at /root/shadowsocks-hub/node_modules/knex/lib/runner.js:61:21
0|sshub    |     at tryCatcher (/root/shadowsocks-hub/node_modules/bluebird/js/release/util.js:16:23)
0|sshub    |     at /root/shadowsocks-hub/node_modules/bluebird/js/release/using.js:185:26
0|sshub    |     at tryCatcher (/root/shadowsocks-hub/node_modules/bluebird/js/release/util.js:16:23)
0|sshub    |     at Promise._settlePromiseFromHandler (/root/shadowsocks-hub/node_modules/bluebird/js/release/promise.js:512:31)
0|sshub    | (node:14719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)
0|sshub    | (node:14719) UnhandledPromiseRejectionWarning: Error: ER_NO_SUCH_TABLE: Table 'sshub.traffic' doesn't exist
0|sshub    |     at Query.Sequence._packetToError (/root/shadowsocks-hub/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
0|sshub    |     at Query.ErrorPacket (/root/shadowsocks-hub/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
0|sshub    |     at Protocol._parsePacket (/root/shadowsocks-hub/node_modules/mysql/lib/protocol/Protocol.js:278:23)
0|sshub    |     at Parser.write (/root/shadowsocks-hub/node_modules/mysql/lib/protocol/Parser.js:76:12)
0|sshub    |     at Protocol.write (/root/shadowsocks-hub/node_modules/mysql/lib/protocol/Protocol.js:38:16)
0|sshub    |     at Socket.<anonymous> (/root/shadowsocks-hub/node_modules/mysql/lib/Connection.js:91:28)
0|sshub    |     at Socket.<anonymous> (/root/shadowsocks-hub/node_modules/mysql/lib/Connection.js:502:10)
0|sshub    |     at emitOne (events.js:116:13)
0|sshub    |     at Socket.emit (events.js:211:7)
0|sshub    |     at addChunk (_stream_readable.js:263:12)
0|sshub    |     at readableAddChunk (_stream_readable.js:250:11)
0|sshub    |     at Socket.Readable.push (_stream_readable.js:208:10)
0|sshub    |     at TCP.onread (net.js:607:20)
0|sshub    |     --------------------
0|sshub    |     at Protocol._enqueue (/root/shadowsocks-hub/node_modules/mysql/lib/protocol/Protocol.js:144:48)
0|sshub    |     at Connection.query (/root/shadowsocks-hub/node_modules/mysql/lib/Connection.js:200:25)
0|sshub    |     at /root/shadowsocks-hub/node_modules/knex/lib/dialects/mysql/index.js:161:18
0|sshub    |     at Promise._execute (/root/shadowsocks-hub/node_modules/bluebird/js/release/debuggability.js:313:9)
0|sshub    |     at Promise._resolveFromExecutor (/root/shadowsocks-hub/node_modules/bluebird/js/release/promise.js:483:18)
0|sshub    |     at new Promise (/root/shadowsocks-hub/node_modules/bluebird/js/release/promise.js:79:10)
0|sshub    |     at Client_MySQL._query (/root/shadowsocks-hub/node_modules/knex/lib/dialects/mysql/index.js:155:12)
0|sshub    |     at Client_MySQL.query (/root/shadowsocks-hub/node_modules/knex/lib/client.js:206:17)
0|sshub    |     at Runner.<anonymous> (/root/shadowsocks-hub/node_modules/knex/lib/runner.js:155:36)
0|sshub    |     at Runner.tryCatcher (/root/shadowsocks-hub/node_modules/bluebird/js/release/util.js:16:23)
0|sshub    |     at Runner.query (/root/shadowsocks-hub/node_modules/bluebird/js/release/method.js:15:34)
0|sshub    |     at /root/shadowsocks-hub/node_modules/knex/lib/runner.js:61:21
0|sshub    |     at tryCatcher (/root/shadowsocks-hub/node_modules/bluebird/js/release/util.js:16:23)
0|sshub    |     at /root/shadowsocks-hub/node_modules/bluebird/js/release/using.js:185:26
0|sshub    |     at tryCatcher (/root/shadowsocks-hub/node_modules/bluebird/js/release/util.js:16:23)
0|sshub    |     at Promise._settlePromiseFromHandler (/root/shadowsocks-hub/node_modules/bluebird/js/release/promise.js:512:31)
0|sshub    | (node:14719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)
mysql> show tables
    -> ;
+----------------------+
| Tables_in_sshub      |
+----------------------+
| account              |
| admin_approval       |
| email_user           |
| knex_migrations      |
| knex_migrations_lock |
| node                 |
| payment              |
| product              |
| purchase             |
| server               |
| ss_account           |
| traffic              |
| user                 |
+----------------------+
13 rows in set (0.00 sec)

mysql> select * from traffic;
+--------------------------------------+--------------------------------------+------------+------------------+---------------+
| id                                   | accountId                            | usage      | lastMeterReading | createdTime   |
+--------------------------------------+--------------------------------------+------------+------------------+---------------+
| 17cd5842-90ce-4943-821f-8cbb9174476d | 41086b18-1805-42d4-92ca-2c642cbb3a53 |    1204738 |          1204738 | 1537356180296 |
| 21dea69e-f4d3-4de2-855e-8b88110cbf12 | e477a97d-d7ec-4a4f-b8a6-f3c1c009d02c |  120256093 |        120256093 | 1537356180346 |
| 337d9d54-ef98-4c07-825d-aae2200518a4 | 80547596-1d49-4370-b3c1-8f4977a59cdb | 2914755990 |       2914755990 | 1537356180331 |
| 570d0afc-9e56-4e6c-a931-6e5843f99aaa | 1fc2b81a-61cb-482d-8437-82c03820d92a |  867385974 |        867385974 | 1537356180276 |
| 5714773e-4acc-4931-a1aa-d2ad57658edf | 80547596-1d49-4370-b3c1-8f4977a59cdb | 2914753899 |       2914753899 | 1537356168344 |
| 5c486c6d-69b7-4979-aed0-2652b19c6f35 | 6fef3077-57db-4f38-90cd-a814775f4920 |          0 |                0 | 1537356180322 |
| 85b8997b-42c9-49d2-b2ee-e13b7a688f8c | 5e3d7cef-6290-486d-85e9-540ef4fbefeb |          0 |                0 | 1537356180313 |
| c0fa33fd-030b-4c53-bf71-e3967b879408 | a8d87d32-8008-4f49-a47e-52b101113dda | 5879920021 |       5879920021 | 1537356180339 |
| e809e965-0ece-4de7-89f6-e324b60a400a | 1fc2b81a-61cb-482d-8437-82c03820d92a |  867384710 |        867384710 | 1537356168274 |
+--------------------------------------+--------------------------------------+------------+------------------+---------------+
9 rows in set (0.00 sec)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.