Kaikki oikeudet pidätetään ©. Jos haluat tukea projektia (osallistua palvelinkustannuksiin, tarjota koodausvissyn tai tulevaisuudessa maksaa palkkaa), laita muutaman euron lahjoituksesi Danske Bank tilille FI15 8312 0710 7275 83 (SWIFT:DABAFIHH), maksun saaja Jari Kuivaniemi. Kirjoita viestikenttään nimesi ja asuinpaikkakuntasi. Kiitokset lahjoituksestasi.
Tuo edellisissä posteissa tehty palvelin (https://moijari.com:5008/) on pysynyt hyvin pystyssä.
Palvelin tulostaa seuraavankaltaisen sivun:
Hello world!
Tämä on artikkelin https://moijari.com?p=2990 testiohjelma.
Ohjelma löytyy tästä linkistä https://moijari.com:5008. Muutin myös html-versiota palvelimesta, se löytyy linkistä https://moijari.com:5009. Tee minulle palvelus ja painele näitä hetki, niin saan tarkistettua että ne toimivat oikein.
Seuraava kappale sisältää ressun tekemiä satunnaisbittejä. Ne ovat tässä vain tilan täytteeksi.
00000 815351217487910435669192172422951946696212529
00001 920813973742415362649994596558010088465040675
00002 240957540572627626019678885898823975217177955
00003 588737120498722070263736259491307364795007018
00004 099088516044714427477581177561019219994794028
00005 671836924618350610422165035986981986642212559
00006 903624466108326292581456051717969002015996523
00007 174214962253101545608670175806344579522732446
00008 582106588595739282558149472893211536930107155
00009 065077579202041683237466269212366696651544942
DBS3 version 0.15 ©, sha256(fb51c52020f4658aea34fa92a464228702888f91f21a688b72e72b6b5a9db329)
ja tulostaa seuraavankaltaisen html:n:
<!doctype html>
<html lang="fi">
<head>
<meta charset="utf-8">
<title>dbs3</title>
<meta name="author" content="Jari Kuivaniemi">
<meta name="copyright" content="Jari Kuivaniemi">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Hello world!</h1>
<p>Tämä on artikkelin
<a href="https://moijari.com?p=2990">https://moijari.com?p=2990</a>
testiohjelma.
</p>
<p>Ohjelma löytyy tästä linkistä
<a href="https://moijari.com:5008">https://moijari.com:5008</a>. Muutin myös
html-versiota palvelimesta, se löytyy linkistä
<a href="https://moijari.com:5009">https://moijari.com:5009</a>. Tee minulle
palvelus ja painele näitä hetki, niin saan tarkistettua että ne toimivat oikein.
</p>
<p>Seuraava kappale sisältää ressun tekemiä satunnaisbittejä. Ne ovat tässä vain tilan
täytteeksi.</p>
<code>00000 913172437725583125656813961989111569116651622<br>
00001 668091985964193551241952738289133440806661184<br>
00002 549190318300809959223119033099901889257655218<br>
00003 216375827226876174409310032753849534437058619<br>
00004 412828931075417056583548732955519735473364867<br>
00005 778209799556888690223374723126772360482730235<br>
00006 394862247871294866478215333972664754081371156<br>
00007 437070499366697726219758787597618390377022999<br>
00008 894827086752475366734695623137289506478059144<br>
00009 611628644764270179833791103311275126306740678<br>
</code>
<p>DBS3 version 0.15 ©,
sha256(fb51c52020f4658aea34fa92a464228702888f91f21a688b72e72b6b5a9db329)</p>
</body>
</html>
Samoin ressusta on kehitin uuden version 2 “ressu2” eli tässä taas kerrataan alkuperäistä tavoitetta: palvelimen pitäisi oppia ymmärtämään seuraavanlaisia rivejä:
'memberid' = "customerid", 'memberapp' = "customerid"
'memberid' = "countryid", 'memberapp' = "countryid"
'memberid' = "productid", 'memberapp' = "productid"
'memberid' = "billid", 'memberapp' = "billid"
'appid' = "country", 'chapter' = "header", 'memberid' = "countryid"
'appid' = "country", 'chapter' = "header", 'memberid' = "countryname"
'countryid' = "fi", 'countryname' = "Finland"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyid"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyname"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyaddress"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyzip"
'appid' = "company", 'chapter' = "header", 'memberid' = "companycountry"
'appid' = "company", 'chapter' = "header", 'memberid' = "fiscalyear"
'appid' = "company", 'chapter' = "header", 'memberid' = "fiscalperiod"
'companyid' = "1", 'companyname' = "Vene Oy", 'companyaddress' = "venekatu 1", 'companyzip' = "00500", 'companycountry' = "fi", 'fiscalyear' = "2025", 'fiscalperiod' = "1"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customerid"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customername"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customeraddress"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customerzip"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customercountry"
'customerid' = "1", 'customername' = "Asiakas 1", 'customeraddress' = "asiakaskatu 1", 'customerzip' = "00500", 'customercountry' = "fi"
'customerid' = "2", 'customername' = "Asiakas 2", 'customeraddress' = "asiakaskatu 2", 'customerzip' = "00500", 'customercountry' = "fi"
'customerid' = "3", 'customername' = "Asiakas 3", 'customeraddress' = "asiakaskatu 3", 'customerzip' = "00500", 'customercountry' = "fi"
'appid' = "product", 'chapter' = "header", 'memberid' = "productid"
'appid' = "product", 'chapter' = "header", 'memberid' = "productname"
'appid' = "product", 'chapter' = "header", 'memberid' = "productprice"
'productid' = "1", 'productname' = "Vene", 'productprice' = "100"
'productid' = "2", 'productname' = "Airot", 'productprice' = "10"
'productid' = "3", 'productname' = "Tappi", 'productprice' = "5"
'appid' = "bill", 'chapter' = "header", 'memberid' = "billid"
'appid' = "bill", 'chapter' = "header", 'memberid' = "companyid"
'appid' = "bill", 'chapter' = "header", 'memberid' = "customerid"
'appid' = "bill", 'chapter' = "header", 'memberid' = "customername"
'appid' = "bill", 'chapter' = "header", 'memberid' = "total"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "billid"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "billlineid"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "productid"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "productname"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "productprice"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "quantity"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "amount"
'billid' = "1", 'companyid' = "1", 'customerid' = "1", 'customername' = "Asiakas 1", 'total' = "115"
'billid' = "1", 'billlineid' = "1", 'productid' = "1", 'productname' = "Vene", 'productprice' = "100", 'quantity' = "1", 'amount' = "100"
'billid' = "1", 'billlineid' = "2", 'productid' = "1", 'productname' = "Airot", 'productprice' = "10", 'quantity' = "1", 'amount' = "10"
'billid' = "1", 'billlineid' = "3", 'productid' = "1", 'productname' = "Tappi", 'productprice' = "5", 'quantity' = "1", 'amount' = "5"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "transactionid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "companyid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "customerid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "customername"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "billid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "fiscalyear"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "fiscalperiod"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "transactionid"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "transactionlineid"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "productid"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "productprice"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "quantity"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "amount"
'transactionid' = "1", 'companyid' = "1", 'customerid' = "1", 'customername' = "Asiakas 1", 'billid' = "1", 'fiscalyear' = "2025", 'fiscalperiod' = "1"
'transactionid' = "1", 'transactionlineid' = "1", 'productid' = "1", 'productprice' = "100", 'quantity' = "1", 'amount' = "100"
'transactionid' = "1", 'transactionlineid' = "2", 'productid' = "2", 'productprice' = "10", 'quantity' = "1", 'amount' = "10"
'transactionid' = "1", 'transactionlineid' = "3", 'productid' = "3", 'productprice' = "5", 'quantity' = "1", 'amount' = "5"
, palvelin kirjoittaa seuraavankaltaisen lokin:
20250830175147UTC starting dbs3 "DBS3 version 0.09 ©", port:5008, https
20250830175147UTC cert xx xx xx xx...
20250830175147UTC private xx xx xx xx...
20250830175147UTC server_https_init()
20250830175147UTC SSL_library_init()
20250830175147UTC OpenSSL_add_ssl_algorithms()
20250830175147UTC OpenSSL_add_ciphers()
20250830175147UTC OpenSSL_load_error_strings()
20250830175147UTC SSLv23_server_method()
20250830175147UTC SSL_CTX_new()
20250830175147UTC SSL_CTX_use_certificate_file()
20250830175147UTC SSL_CTX_use_PrivateKey_file()
20250830175147UTC cert xx xx xx xx...
20250830175147UTC private xx xx xx xx...
20250830175147UTC SSL_CTX_load_verify_locations()
20250830175147UTC server_basic_socket()
20250830175147UTC server_getaddrinfo()
20250830175147UTC getaddrinfo()
20250830175147UTC server_socket()
20250830175147UTC socket()
20250830175147UTC server_bind()
20250830175147UTC bind()
20250830175147UTC freeaddrinfo()
20250830175147UTC server_listen()
20250830175147UTC listen()
20250830175147UTC accept()
20250830175201UTC ========================================
20250830175201UTC dbs_time_vars()
20250830175201UTC fork start (parent) getpid:12334 getppid:1
20250830175201UTC fork()
20250830175201UTC fork end (parent) pid:12335 getpid:12334 getppid:1
20250830175201UTC server_close()
20250830175201UTC init_child()
20250830175201UTC close()
20250830175201UTC close(s)
20250830175201UTC cert xx xx xx xx...
20250830175201UTC close(s)
20250830175201UTC private xx xx xx xx...
20250830175201UTC https_client()
20250830175201UTC accept()
20250830175201UTC SSL_new()
20250830175201UTC SSL_set_fd()
20250830175201UTC SSL_accept()
20250830175201UTC SSL_get_peer_certificate(), No peer certificate
20250830175201UTC SSL_read()
20250830175201UTC ========================================
20250830175201UTC dbs_time_vars()
20250830175201UTC fork start (parent) getpid:12334 getppid:1
20250830175201UTC fork()
20250830175201UTC fork end (parent) pid:12336 getpid:12334 getppid:1
20250830175201UTC init_child()
20250830175201UTC server_close()
20250830175201UTC close(s)
20250830175201UTC close()
20250830175201UTC cert xx xx xx xx...
20250830175201UTC close(s)
20250830175201UTC private xx xx xx xx...
20250830175201UTC https_client()
20250830175201UTC accept()
20250830175201UTC SSL_new()
20250830175201UTC SSL_set_fd()
20250830175201UTC SSL_accept()
20250830175201UTC SSL_get_peer_certificate(), No peer certificate
20250830175201UTC SSL_read()
20250830175201UTC SSL_read(), retval 540, errno: 0, SSL_get_error(): 0, ERR_get_error(): 0
20250830175201UTC (540 bytes)
20250830175201UTC GET / HTTP/1.1
Host: moijari.com:5008
Sec-Fetch-Dest: document
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: https://moijari.com:5008/
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Accept-Language: en-GB,en;q=0.9
Priority: u=0, i
Accept-Encoding: gzip, deflate, br
Cookie: PHPSESSID=xx xx xx xx...
Connection: keep-alive
_registerTMCloneTable
20250830175201UTC 1 reads, received 540 chars, read 540 total bytes, input buffer size 2048 chars, data="
20250830175201UTC "
20250830175201UTC htmlmethod: "GET"
20250830175201UTC htmlpath: "/"
20250830175201UTC htmlversion: "HTTP/1.1"
20250830175201UTC htmlfilename: ""
20250830175201UTC htmlfileextension: ""
20250830175201UTC htmlhost: "moijari.com:5008"
20250830175201UTC htmluseragent: "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.6 Mobile/15E148 Safari/604.1"
20250830175201UTC htmlcookie: "PHPSESSID=xx xx xx xx..."
20250830175201UTC enter dba_loop()
20250830175201UTC entering dba_loop()
20250830175201UTC fetching cookies
20250830175201UTC htmlsessionid: ""
20250830175201UTC htmlmode: ""
20250830175201UTC htmllanguage: ""
20250830175201UTC end fetching cookies
20250830175201UTC html prettyprinter
20250830175201UTC buffers1: 0:96 1:1423 2:0 3:0 4:116 5:0 6:0 7:0 8:0
20250830175201UTC buffers2: 0:96 1:0 2:0 3:0 4:0 5:0 6:0 7:1539 8:0
20250830175201UTC buffers3: 0:96 1:0 2:0 3:0 4:0 5:0 6:0 7:0 8:1624
20250830175201UTC html prettyprinter done.
20250830175201UTC exit dba_loop2()
20250830175201UTC entering dba_loop2()
20250830175201UTC exiting dba_loop2()
20250830175201UTC buffers(ssl): 0:196SSL_write()
20250830175201UTC 1:0 2:0 3:0 4:0 5:0 6:0 7:0 8:1624SSL_write()
20250830175201UTC HTTP/1.0 200 OK
Location:
Server: DBS3 version 0.09 ©
Date: Sat, 30 Aug 2025 17:52:01 GMT
Content-Length: 1624
SHA256: 14f9261ba8b2d0955cdcd88ce63cf1414837042ceeb56e99cbcd8f8b362a9f92
20250830175201UTC <!doctype html>
<html lang="fi">
<head>
<meta charset="utf-8">
<title>dbs3</title>
<meta name="author" content="Jari Kuivaniemi">
<meta name="copyright" content="Jari Kuivaniemi">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Hello world!</h1>
<p>Tämä on artikkelin
<a href="https://moijari.com?p=2990">https://moijari.com?p=2990</a>
testiohjelma. Ohjelma löytyy tästä linkistä
<a href="https://moijari.com:5008">https://moijari.com:5008</a>.
</p>
<p>Seuraava kappale sisältää ressun tekemiä satunnaisbittejä. Ne ovat tässä vain tilan
täytteeksi.</p>
<code>00000 20616874070457590523126122132497421268944884802220810261826959568<br>
00001 17192985807111595612468232713117700741936846802133961244101879900<br>
00002 02407386257484414673907086023803598802701388309148448685736962425<br>
00003 50279311953963128957788744672545836449370328271465324371081029118<br>
00004 70458842796761884608024944157410778280148696721938596935963966256<br>
00005 05578472692405139090352146280861261687819185840399999490749778727<br>
00006 42059647448790835009224071147698545710269723898238144550191259729<br>
00007 92523533467026772824174205506373861584249958499398660047182445533<br>
00008 17388179513424995966929981520791349290757431604968432604126712314<br>
00009 12602138335914743028665941174114691854493502124843486708760074618<br>
</code>
<p>DBS3 version 0.09 ©,
sha256(0ff070a4dda2dc67e499d2eb5b5ddf1efce64863ad517fdf2509bdfb4955cd5b)</p>
</body>
</html>
20250830175201UTC SSL connection using TLS_AES_128_GCM_SHA256
20250830175201UTC dbs_query_vars()
20250830175201UTC SSL_free()
20250830175201UTC critical_wait()
20250830175201UTC critical_post()
20250830175201UTC server_close(news)
20250830175201UTC close()
20250830175201UTC fork end (child) pid:0 getpid:12336 getppid:12334
20250830175201UTC exit_child()
20250830175201UTC unlink dbs3pid12336.log
20250830175201UTC ========================================
(ehdotin teille lukijani että lisäisitte tarvittavia tietoja siihen). Ajatus tässä ensimmäisessä versiossa oli määritellä maat (country), yritys (company), asiakas (customer), tuote (product), lasku(bill) ja liiketapahtuma (transaction).
Tämä oli tälläinen yksinkertaistettu malli, jossa syötetään lasku, keräillään sen perusteella (ei tilausta, toimitusta, keräilyä jne.). Samoin liiketapahtumat perustuivat yksinkertaiseen kirjanpitoon.
Ajatus on että näiden perusteella voin miettiä mitä toimintoja terttuun tarvitaan.
'memberid' = "customerid", 'memberapp' = "customerid"
'memberid' = "countryid", 'memberapp' = "countryid"
'memberid' = "productid", 'memberapp' = "productid"
'memberid' = "billid", 'memberapp' = "billid"
'appid' = "country", 'chapter' = "header", 'memberid' = "countryid"
'appid' = "country", 'chapter' = "header", 'memberid' = "countryname"
'countryid' = "fi", 'countryname' = "Finland"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyid"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyname"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyaddress"
'appid' = "company", 'chapter' = "header", 'memberid' = "companyzip"
'appid' = "company", 'chapter' = "header", 'memberid' = "companycountry"
'appid' = "company", 'chapter' = "header", 'memberid' = "fiscalyear"
'appid' = "company", 'chapter' = "header", 'memberid' = "fiscalperiod"
'companyid' = "1", 'companyname' = "Vene Oy", 'companyaddress' = "venekatu 1", 'companyzip' = "00500", 'companycountry' = "fi", 'fiscalyear' = "2025", 'fiscalperiod' = "1"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customerid"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customername"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customeraddress"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customerzip"
'appid' = "customer", 'chapter' = "header", 'memberid' = "customercountry"
'customerid' = "1", 'customername' = "Asiakas 1", 'customeraddress' = "asiakaskatu 1", 'customerzip' = "00500", 'customercountry' = "fi"
'customerid' = "2", 'customername' = "Asiakas 2", 'customeraddress' = "asiakaskatu 2", 'customerzip' = "00500", 'customercountry' = "fi"
'customerid' = "3", 'customername' = "Asiakas 3", 'customeraddress' = "asiakaskatu 3", 'customerzip' = "00500", 'customercountry' = "fi"
'appid' = "product", 'chapter' = "header", 'memberid' = "productid"
'appid' = "product", 'chapter' = "header", 'memberid' = "productname"
'appid' = "product", 'chapter' = "header", 'memberid' = "productprice"
'productid' = "1", 'productname' = "Vene", 'productprice' = "100"
'productid' = "2", 'productname' = "Airot", 'productprice' = "10"
'productid' = "3", 'productname' = "Tappi", 'productprice' = "5"
'appid' = "bill", 'chapter' = "header", 'memberid' = "billid"
'appid' = "bill", 'chapter' = "header", 'memberid' = "companyid"
'appid' = "bill", 'chapter' = "header", 'memberid' = "customerid"
'appid' = "bill", 'chapter' = "header", 'memberid' = "customername"
'appid' = "bill", 'chapter' = "header", 'memberid' = "total"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "billid"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "billlineid"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "productid"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "productname"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "productprice"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "quantity"
'appid' = "bill", 'chapter' = "lines", 'memberid' = "amount"
'billid' = "1", 'companyid' = "1", 'customerid' = "1", 'customername' = "Asiakas 1", 'total' = "115"
'billid' = "1", 'billlineid' = "1", 'productid' = "1", 'productname' = "Vene", 'productprice' = "100", 'quantity' = "1", 'amount' = "100"
'billid' = "1", 'billlineid' = "2", 'productid' = "1", 'productname' = "Airot", 'productprice' = "10", 'quantity' = "1", 'amount' = "10"
'billid' = "1", 'billlineid' = "3", 'productid' = "1", 'productname' = "Tappi", 'productprice' = "5", 'quantity' = "1", 'amount' = "5"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "transactionid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "companyid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "customerid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "customername"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "billid"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "fiscalyear"
'appid' = "transaction", 'chapter' = "header", 'memberid' = "fiscalperiod"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "transactionid"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "transactionlineid"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "productid"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "productprice"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "quantity"
'appid' = "transactionline", 'chapter' = "lines", 'memberid' = "amount"
'transactionid' = "1", 'companyid' = "1", 'customerid' = "1", 'customername' = "Asiakas 1", 'billid' = "1", 'fiscalyear' = "2025", 'fiscalperiod' = "1"
'transactionid' = "1", 'transactionlineid' = "1", 'productid' = "1", 'productprice' = "100", 'quantity' = "1", 'amount' = "100"
'transactionid' = "1", 'transactionlineid' = "2", 'productid' = "2", 'productprice' = "10", 'quantity' = "1", 'amount' = "10"
'transactionid' = "1", 'transactionlineid' = "3", 'productid' = "3", 'productprice' = "5", 'quantity' = "1", 'amount' = "5"
Perustoimintoja varten tarvitsette ainakin salasanan
'uname' = "testi", 'password' = "testaus", 'language' = "en"
Myös edellisten postien MR8 tarvitsee logon:ia, vapaasti MR8 perustui välimuisteihin ja peräkkäistiedostoon.