clonos / control-pane

ClonOS WEB control panel (CBSD WEB UI)
https://clonos.tekroutine.com
139 stars 35 forks source link

* tweaked db class #31

Closed bozhinov closed 3 years ago

bozhinov commented 3 years ago

getting to know the code

bozhinov commented 3 years ago

The shell escape prevention code is ready as well but it depends on this pull

olevole commented 3 years ago

Thanks!

olevole commented 3 years ago

Hmm, reverted. this commit breaks the work with the database and when I try to log in I get: 'Error! User not found!'

bozhinov commented 3 years ago

I really need a test bed Kinda mentioned in the commit that it needs testing

bozhinov commented 3 years ago

May I have some actual sqlite files for testing ? recreating them will take some time.

olevole commented 3 years ago

This is dump of /var/db/clonos/clonos.sqlite ( admin/admin login/password ): ( sqlite3 /var/db/clonos/clonos.sqlite .dump )

PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE sys_helpers_list (  id INTEGER PRIMARY KEY AUTOINCREMENT, module VARCHAR(128)  );
INSERT INTO sys_helpers_list VALUES(61,'elasticsearch');
INSERT INTO sys_helpers_list VALUES(62,'memcached');
INSERT INTO sys_helpers_list VALUES(63,'php');
INSERT INTO sys_helpers_list VALUES(64,'postgresql');
INSERT INTO sys_helpers_list VALUES(65,'prometheus');
INSERT INTO sys_helpers_list VALUES(66,'rabbitmq');
INSERT INTO sys_helpers_list VALUES(67,'redis');
INSERT INTO sys_helpers_list VALUES(68,'rtorrent');
CREATE TABLE jails_helpers_list (  id INTEGER PRIMARY KEY AUTOINCREMENT, module VARCHAR(128)  );
INSERT INTO jails_helpers_list VALUES(96,'elasticsearch');
INSERT INTO jails_helpers_list VALUES(97,'memcached');
INSERT INTO jails_helpers_list VALUES(98,'php');
INSERT INTO jails_helpers_list VALUES(99,'postgresql');
INSERT INTO jails_helpers_list VALUES(100,'prometheus');
INSERT INTO jails_helpers_list VALUES(101,'rabbitmq');
INSERT INTO jails_helpers_list VALUES(102,'redis');
INSERT INTO jails_helpers_list VALUES(103,'rtorrent');
CREATE TABLE auth_user (  id INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(150) UNIQUE NOT NULL, password VARCHAR(128) NOT NULL, first_name VARCHAR(32), last_name VARCHAR(32), last_login TIMESTAMP DATE, is_active BOOLEAN DEFAULT 'true' NULL, date_joined TIMESTAMP DATE DEFAULT (datetime('now','localtime'))  );
INSERT INTO auth_user VALUES(1,'admin','abe9cf767b1acc6ad8afe931ef59e332be32d126866940d1ae91748315d18c78','Admin','Admin',NULL,1,'2020-10-03 22:46:49');
CREATE TABLE auth_list (  id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER, sess_id VARCHAR(128), secure_sess_id VARCHAR(128), user_ip VARCHAR(46), auth_time TIMESTAMP DATE  );
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('sys_helpers_list',68);
INSERT INTO sqlite_sequence VALUES('jails_helpers_list',103);
INSERT INTO sqlite_sequence VALUES('auth_user',1);
INSERT INTO sqlite_sequence VALUES('auth_list',7);
COMMIT;
bozhinov commented 3 years ago

Thank you. it will be useful for the synthetic tests but I need the entire solution to actually work. Please check the rest of the issues I ve raised here and with the ports