• Welcome, Guest. Please login.
 
December 10, 2019, 03:46:29 am

News:

Welcome to the SQLitening support forums!


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - cj

1
Very interesting read:
https://proprivacy.com/vpn/comparison/nigeria-vpn

I have been successfully using SQLitening over a VPN between machines that share the exact same dedicated VPN server using the same user name and password.  This might be the best way to go if this is allowed.
I paid nothing extra and didn't need any dedicated IP address (other then share same exact server.)

I will finally have time to work on encrypting SQLitening on 12/3.
2
https://help.logmein.com/pkb_Home?q=share%20a%20port&l=en_US&c=products%3Almihamachi2&atype=FAQ__kav

It looks like you share a folder and use Windows mapping.
I only connected 2 machines and used chat.
I didn't use SQLite with it.
There are links to PDF files at the bottom of their home page.
Many use it so there must be better docs on the net, don't know where.
3
Windows 10 has a built-in VPN server, but I couldn't connect.
Some on the internet say there is a problem introduced in a Windows update.
https://pureinfotech.com/setup-vpn-server-windows-10/

I got Hamachi to connect, but didn't go any further.

I'll go back to encrypting the TCP data being transmit to the server.
4
Paid NordVPN connected with a couple machines using same username/password on one of their servers marked as allowing dedicated connections.  Might break terms of service or not work with more machines.
5
I will look into it later today.
NordVPN worked great.
I don't like the price of the dedicated server.
I will also add AES256 to SQLitening TCP within a few days.


6
I will do the same.
7
NordVPN has a feature called Internet Kill switch.
The SQLitening server can't be accessed while it is on.

8
Another way to go would be to install a VPN server.  I would still encrypt the TCP sends and receives.
It is amazing that I can't find much information on people doing this.  Looking in the wrong places.

https://www.howtogeek.com/135996/how-to-create-a-vpn-server-on-your-windows-computer-without-installing-any-software/

I would definitely check this inexpensive route with Hamachi that installs as a service.
Free up to 5 users, $49 a year for 32 users.
https://vpn.net/

https://www.vpnmentor.com/reviews/logmein-hamachi/


Other VPN's to compare to:
https://vpnpro.com/vpn-solutions/logmein-hamachi-review/

https://beebom.com/hamachi-alternatives/
9
From NordVPN:

If you were to purchase this very week, we can offer the following pricing:

Advanced NordVPN Teams package for 75 USD/ user along with a Dedicated gateway/ server for 336 USD for a year.





This at least shows one way to go.
I always thought that routers could be setup or flashed to connect securely to each other?
10
From NordVPN:

Business packages start from 5 annual accounts.

Regarding connectivity, yes, you can connect from anywhere in the world to a particular country of our shared servers. You can also purchase a Dedicated server to have one static IP that is not shared between anyone but your team, which you can assign particular users to it and use it per your preferences.

We also have a Back Friday deal going on this very week, if you make a purchase until the end of it.

We could add AES256 to SQLitening's TCP routines.
11
I am using a VPN service and can connect to the SQLitening server only if using the same dedicated VPN server.

I don't know if a person using the same VPN service could connect to the server from another account or if they need my username and password?
I have sent an email to the VPN service.

12
SQLiteningServer.Cfg:
Port=51234
Hosts=192.168.0.2

Logins using slConnect:
The local computers connect to the local IP address or machine name and port of the server.
The remote computers connect to the remote IP address and port of the server.

Router:
The router needs to forward the local IP address and port to the server machine.
The IP address at command prompt of server: Type IPCONFIG  it is the IPV4 address.
I would use the address reservation page of the router to lock in the IP address of the server
so it never changes if the network is rebooted.

Windows Firewall:

SQLiteningServer.exe needs to be added to "Allow an app through the firewall."

Shortcuts:
Mark "Run as Administrator" to SqliteningServer.exe and SqliteningServerAdmin.exe

SQLitening is not secure over the internet.  Connections are not encrypted or authenticated.

CubeSQL seems to be a lot like SQLitening and uses JSON.  It might be an option.
https://sqlabs.com/cubesql

SQLTools might also be an option to consider and use another SQL.



Test server with 12 connections by using threads

#INCLUDE "win32api.inc"
#INCLUDE "sqlitening.inc"
GLOBAL gs() AS STRING
FUNCTION PBMAIN () AS LONG
 LOCAL x,hThread AS LONG
 DIM gs(12) 'each user puts recordset into an element
 FOR x = 1 TO UBOUND(gs)
  THREAD CREATE MyThread(x) TO hthread
  THREAD CLOSE hThread TO hThread
 NEXT
 DO:SLEEP 50:LOOP UNTIL THREADCOUNT=1
 ? JOIN$(gs(),$CR)
END FUNCTION

THREAD FUNCTION MyThread(BYVAL Num AS LONG) AS LONG
 DIM s() AS STRING
 slConnect "192.168.0.2",51234
 slOpen "sample.db3"
 slselary "select rowid,redref from parts where rowid=" + STR$(Num),s(),"Q9c"
 gs(Num) = JOIN$(s(),$CR)  'put into array
 slDisconnect
END FUNCTION
13
If using the server everyone can share the server without a problem.
I've read many reasons on the SQLite site why not to use SQLite peer to peer.

I am sure TLS with SocketTools would work by modifying the client and server code, but
the server would require a certificate.  I noticed SocketTools added some encryption
code, but that isn't unique to SocketTools. If you create your own certificates is
not suggested, but talking to SocketTools they might be interested.
It would be easy for them.



14
Both routines are compared in this posting.

Bern,
Nice, learned a lot!!

Bern routine results:
1 payment record must exist to return results for a client
2 credit balances do not display (they weren't asked for)
3 optional, modified to add payments (passed as negative amounts)

The CJ routine could eliminate the creating temp table by reading
through the recordset and handling the debit/credit as they occur.
Made it easier by just creating a temp file with the balances.

Also, for some reason when I dropped the what I thought was unneeded third column in the
union statement t1,t2,t3 the union was not always correct.  Need to look into that.
Leaving "as is" is suggested.

In this example CJ will return 4-records and Bern will return 2-records.
Fredrick, these differences should be considered.

#INCLUDE "sqlitening.inc"

FUNCTION showit(sql AS STRING) AS STRING
 LOCAL sArray() AS STRING
 slselary sql,sArray(),"Q9"
 FUNCTION = JOIN$(sArray(),$CR) + $CR
END FUNCTION

FUNCTION PBMAIN AS LONG
 bern
 cj
END FUNCTION

SUB InsertData
 slexe  "insert into T1 values(1,10),(1,20),(2,10),(4,100)"
 slexe  "insert into T2 values(1,30),(1,40),(2,10)"
 slexe  "insert into T3 values(1,-200),(2,0),(3,-1)"
END SUB

FUNCTION Bern AS LONG

 LOCAL s AS STRING
 KILL   "temp.db3":IF ERR THEN ? STR$(ERRCLEAR)
 slopen "temp.db3","C"

 slexe  "create table if not exists T1 (surname1 int,Amount1 int)"
 slexe  "create table if not exists T2 (surname2 int,Amount2 int)"
 slexe  "create table if not exists T3 (surname3 int,Amount3 int)"
 InsertData

 '? ShowIt("select * from t1") + $CR + ShowIt("select * from t2") + $CR + ShowIt("select * from t3")

 s=  "WITH"
 s+="   TempT1(TT1Surname,TT1Total) AS (SELECT Surname1, Amount1"
 s+="     FROM T1),"
 s+="   TempT2(TT2Surname,TT2Total) AS (SELECT Surname2, Amount2"
 s+="     FROM T2),"
 s+="   SumT1( ST1Surname, ST1Total) AS (SELECT TT1Surname, TOTAL( TT1Total)"
 s+="     FROM TempT1 GROUP BY TT1Surname),"
 s+="   SumT2( ST2Surname, ST2Total) AS (SELECT TT2Surname, TOTAL( TT2Total)"
 s+="     FROM TempT2 GROUP BY TT2Surname),"
 s+="   SumT3( ST3Surname, ST3Total) AS (SELECT Surname3, TOTAL( Amount3)"
 s+="     FROM T3 GROUP BY Surname3)"
 s+=" SELECT ST3Surname as acct, ST1Total + ST2Total + ST3Total as amt"
 s+="   FROM SumT3"
 s+="   INNER JOIN SumT1 ON ST3Surname = ST1Surname"
 s+="   INNER JOIN SumT2 ON ST3Surname = ST2Surname"
 s+="   WHERE ST1Total + ST2Total <> ST3Total" 'made <> instead of subtract

 '? s,,"Sql"
 ?  ShowIt(s)
 'DIM sArray() AS STRING
 'slselAry s,sArray(),"Q9"
 '? JOIN$(sArray(),$CR),,FUNCNAME$
 slClose

END FUNCTION

FUNCTION CJ () AS LONG

 LOCAL sData(),sBind AS STRING, x AS LONG
 KILL   "temp.db3"
 slopen "temp.db3","C"

 slexe  "create table if not exists t1 (surname1 int,amt int)"     'charges table1
 slexe  "create table if not exists t2 (surname2 int,amt int)"     'charges table2
 slexe  "create table if not exists t3 (surname3 int,amt int)"     'payments
 slexe  "drop table if exists TempBalances
 slexe  "create table TempBalances(acct unique,amt)"
 InsertData

 'combine tables and payments
 slselary " select surname1,sum(amt),'t1' from t1 group by surname1"  +_     'charges table1
          " union "                                      +_
          " select surname2,sum(amt),'t2' from t2 group by surname2"  +_     'charges table2
          " union "                                      +_
          " select surname3,sum(amt),'t3' from t3 group by surname3",sData() 'payments table3

 'update TempBalances() from above sData()
 FOR x = 1 TO UBOUND(sdata,2)
  sBind = slBuildBindDat(sdata(1,x),"T") + slBuildBindDat(sData(2,x),"T")
  slexebind "Insert into TempBalances values(?,?) ON conflict(acct) DO update SET amt=amt+" + sData(2,x),sBind
 NEXT
 ? showit("select * from TempBalances"),,FUNCNAME$
 slclose
END FUNCTION
15
balances.png

#INCLUDE "sqlitening.inc"

FUNCTION PBMAIN () AS LONG
 LOCAL sData(),sBind AS STRING, x AS LONG

 KILL   "temp.db3"
 slopen "temp.db3","C"

 slexe  "create table if not exists t1 (acct,amt)"     'charges table1
 slexe  "create table if not exists t2 (acct,amt)"     'charges table2
 slexe  "create table if not exists t3 (acct,amt)"     'payments
 slexe  "drop table if exists TempBalances;create table TempBalances(acct unique,amt)"

 slexe  "insert into t1 values(1,1000),(2,2000),(3,3000)"             'charges t1
 slexe  "insert into t2 values(4,4000)"                               'charges t2
 slexe  "insert into t3 values(4,-2000),(1,-500),(2,-1000),(3,-1500)" 'apply payments

 'combine tables and payments
 slselary " select acct,sum(amt),'t1' from t1 group by acct"  +_     'charges table1
          " union "                                      +_
          " select acct,sum(amt),'t2' from t2 group by acct"  +_     'charges table2
          " union "                                      +_
          " select acct,sum(amt),'t3' from t3 group by acct",sData() 'payments table3

 'update TempBalances() from above sData()
 FOR x = 1 TO UBOUND(sdata,2)
  sBind = slBuildBindDat(sdata(1,x),"T") + slBuildBindDat(sData(2,x),"T")
  slexebind "Insert into TempBalances values(?,?) ON conflict(acct) DO update SET amt=amt+" + sData(2,x),sBind
 NEXT
 ? showit("select * from TempBalances"),,"Balances"
END FUNCTION

FUNCTION showit(sql AS STRING) AS STRING
 LOCAL sArray() AS STRING
 slselary sql,sArray(),"Q9"
 FUNCTION = JOIN$(sArray(),$CR) + $CR
END FUNCTION