File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ CREATE TABLE IF NOT EXISTS ` logs` (
2+ ` id` bigint (20 ) NOT NULL AUTO_INCREMENT,
3+ ` session_id` varchar (64 ) NOT NULL ,
4+ ` operator_id` varchar (64 ) NOT NULL ,
5+ ` session_created` varchar (64 ) NOT NULL ,
6+ ` session_connected` varchar (64 ) NOT NULL ,
7+ ` session_disconnected` varchar (64 ) NOT NULL ,
8+ PRIMARY KEY (` id` )
9+ ) ENGINE= InnoDB DEFAULT CHARSET= utf8
Original file line number Diff line number Diff line change 22
33logger -t " windmill" " SSH_START_SESSION: vpn_ip=$1 port=$2 "
44
5+ # create session log
6+ log_id=$( curl -s -X POST \
7+ -F " session_id=$3 " \
8+ -F " operator_id=$( whoami) " \
9+ " http://localhost:8080/api/logs/" | grep -P ' \d+' -o)
10+
511ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p $2 root@$1
612
13+ # after ssh close, update info on logs
14+ curl -s -X PUT \
15+ " http://localhost:8080/api/logs/$log_id " > /dev/null
16+
717exit 0
Original file line number Diff line number Diff line change 8383 tags :
8484 - windmill
8585
86+ - name : Copy logs.sql db to host
87+ copy : src=logs.sql dest=/tmp/logs.sql
88+ tags :
89+ - windmill
90+
91+ - name : Create logs table
92+ mysql_db :
93+ state : import
94+ name : windmill
95+ target : /tmp/logs.sql
96+ tags :
97+ - windmill
98+
8699- stat : path=/root/.my.cnf
87100 register : mariadb_pass
88101
You can’t perform that action at this time.
0 commit comments