trojan-gfw / trojan-manager Goto Github PK
View Code? Open in Web Editor NEWA command line interface that manages trojan users and more.
License: GNU General Public License v3.0
A command line interface that manages trojan users and more.
License: GNU General Public License v3.0
I have intalled trojan server and client , they both run well with default password which is without mysql auth.
When I finished to config mysql , created user and quota, the auth module did not work !
Now I can only use the global default password.
The operation doc is https://trojan-gfw.github.io/trojan/authenticator .
[trojan]> show quota
+----+----------+----------------------------------------------------------+---------------+----------+--------+
| ID | Username | Password | Quota | Download | Upload |
+----+----------+----------------------------------------------------------+---------------+----------+--------+
| 8 | myusername | b4fff45290308abcc96f0aca235703659b7b077c62cb22897e6ebb77 | 1073741824000 | 0 | 0 |
+----+----------+----------------------------------------------------------+---------------+----------+--------
Part of /usr/src/trojan/server.conf :
"mysql": {
"enabled": true,
"server_addr": "127.0.0.1",
"server_port": 3306,
"database": "trojan",
"username": "trojan_mysql", // yeah, i changed the db username
"password": "mypassword",
"key": "",
"cert": "",
"ca": ""
}
Part of Client/config.json
"password": [
"mypassword" // just the same as password in /usr/src/trojan/server.conf
],
Did I make something wrong?
Ubuntu 19.04,
Python 2.7.16, Python 3.7.3,
pip 19.1.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
mysql Ver 14.14 Distrib 5.7.26, for Linux (x86_64) using EditLine wrapper
all the requirements have been successfully installed
the script use python3, but MySQLdb is not supported by python3
python3 trojan_manager.py int
Traceback (most recent call last):
File "trojan_manager.py", line 19, in <module>
import MySQLdb
ModuleNotFoundError: No module named 'MySQLdb'
try to use pymysql instead:
import pymysql
pymysql.install_as_MySQLdb()
then successfully get in
but when I've added a user, quit, and query again, there's nothing in the database
journalctl -u mysql
Aborted connection to db: 'trojan' user: 'trojan' host: 'localhost' (Got an error reading communication packets)
sorry for the poor english
the add user command not working,i think you forgot to uncomment the 151 line.
self.connection.commit() !?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.