* * *

Author Topic: Anyone using mORMot with Lazarus? I need help getting started.  (Read 983 times)

RedOctober

  • Full Member
  • ***
  • Posts: 210
I posted this over in the mORMot forum, but I thought it might be more appropriate posted here.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I used to use Delphi 1 to XE7. Then it got too pricey and buggy.  Now I use Lazarus (1.8.2) on Free Pascal (3.0.4) and target only the Windows 10 platform on full size desktop computers (for now). I have written an app in Lazarus that I now need to build a "licensing" module for.  I asked about Delphi MVC being ported to Lazarus FPC, on the DMVC Facebook Page and Daniel Teti said that DMVC wd not be ported to Lazarus.  One of the other ppl in the DMVC FB group told me about mORMot.  After trying to plow through the massive introduction docs, I'm lost as to where to begin.  To make this simple, I'll state there what I am trying to accomplish, and if some kind person could tell me how to do it with mORMot, I will learn the rest as I need to.

Project Goal:

I build small utilities that I would like to have a "licensing" function in, that ensures that my end user has a paid for license to use my software.  Let's call it the "LF" for short.  The job of the LF is very simple.  When the utility software first starts, it asks the end user for the GUID (license key) that I have sent them via email.  After the user types in the License Key, in the background, the LF calls into a dedicated server at my home office, using HTTPS REST web technology, and submits the license key.  The REST server decides if it is a legitimate license key and responds with one of two phrases to be shown to the end user:  "Success! You are licensed!" or "Invalid License Key".. AS WELL AS.. in the background, not shown to the user, a text BLOB, which is just the end user's name and address and email address, and, another GUID which is the "hidden" license key.

What I don't need help with:

I can write the client side LF in Lazarus.  I can handle all the database stuff.  I use Firebird 3x RDBMS.

What I DO need help with:

- How do I build the HTTPS REST server side that does what I want using mORMot in Lazarus?
- How do I build the Licensing Function into my existing Lazarus FPC client that "talks to" the mORMot server side in Lazarus?

Thanks in advance for any help you can provide.

To be clear:

This is not to produce any kind of visible web page.  My utilities run only on Windows 7 to 10 and my server is a Windows 2016 Essentials server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

GetMem

  • Hero Member
  • *****
  • Posts: 3022
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #1 on: May 03, 2018, 07:51:21 pm »
Quote
After the user types in the License Key, in the background, the LF calls into a dedicated server at my home office, using HTTPS REST web technology, and submits the license key.  The REST server decides if it is a legitimate license key and responds with one of two phrases to be shown to the end user:  "Success! You are licensed!" or "Invalid License Key".. AS WELL AS.. in the background, not shown to the user, a text BLOB, which is just the end user's name and address and email address, and, another GUID which is the "hidden" license key.
You're licensing technique is fundamentally flawed(I'm not trying to rude, so please take it as a constructive criticism). To crack your system, all I need to do is to change a JNE line(jump if not equal) to JE with Ollydbg. Your "Invalid License Key" message makes the problem even worse. A better idea is to ship a second, smaller exe to your clients. The second exe sends the registration code, if it's a valid one the server sends back the full version of your exe.

RedOctober

  • Full Member
  • ***
  • Posts: 210
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #2 on: May 03, 2018, 08:13:05 pm »
Good point GetMem.  (Though I still need help with the mORMot stuff for the "Launcher" (second .exe in your response) )  :-)

Soner

  • New member
  • *
  • Posts: 29
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #3 on: May 03, 2018, 08:30:00 pm »
I would not learn such complex system like mormot for only this issue.
Make it with Indy as client/server application. You have choice between http, tcp or udp client/server.
You can find in Indy 9 demos enough example for this. Look here http://www.indyproject.org/Sockets/Demos/index.EN.aspx

GetMem

  • Hero Member
  • *****
  • Posts: 3022
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #4 on: May 03, 2018, 08:34:28 pm »
Yes, I agree with Soner. Mormot is a high performance framework but is an overkill for this particular task.

RedOctober

  • Full Member
  • ***
  • Posts: 210
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #5 on: May 04, 2018, 02:01:52 am »
Good points all.  Hey, as part of a "minimalist" or perhaps "additional" anti-piracy check, what if I put the file size (in bytes) into one of the file description fields.  Example:

Product Version
Company Name
File Description  <-- Maybe I cd put the .exe file size here
File Version

So, upon startup, I cd check what's in the File Description field and compare it with a FileSize() done on the running .exe and if they don't match, I shut down.  One catch is, every time I enter the file size info in the source code, the size of the .exe will change.

 

MSGEndoDoc

  • New member
  • *
  • Posts: 5
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #6 on: May 04, 2018, 12:54:17 pm »
Hi RedOctober

I too am looking at Mormot  and am perplexed at the shear scale and complexity of it all.    But I still would like to use Mormot as I know it will be able to do just about anything you might want an ORM and client/server framework to do.  Later on I hope to have less technical debt as Mormot will have a solution to most problems.   Why not join the Mormot forum and ask there?  Arnaud Boucher  the main contributor is very active on the forum and knows anything and everything about Mormot. 

As a wider thought, I have discussed Mormot to my Delphi group and a recent meeting and they also seemed to be inhibited by Mormot's complexity to engage with it.   But My concept is that if a more user friendly API could be developed on top of Mormot then it would become a very competent but easily used solution for developers.   It needs to be made easier.   Moreover, what if we went further and developed a front end GUI to allow drag and drop design of enterprise level ORM + Client/Server solutions which any business analyst or SME business owner could set up themselves?  Essentially non developers could model their business or other problems directly and set up a full software solution.  This would basically be like a mini SAP, but open source and in Pascal.   There would be a business opportunity for developers to become like SAP consultants and help businesses or others with the set up where required, and of course get paid for that consultancy work.   Does anyone think this could be viable? I think Mormot really has this potential.  It just needs someone to have the vision and time and make it happen. 

Cheers,

Martin
PS I am fully employed and don't have the time  :) But does someone else? 
Martin

Handoko

  • Hero Member
  • *****
  • Posts: 2254
  • My goal: build my own game engine using Lazarus
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #7 on: May 04, 2018, 01:17:59 pm »
Hey guys. If you're building commercial projects and need helps, maybe you can consider to create a bounty:
http://forum.lazarus.freepascal.org/index.php/board,41.0.html
http://wiki.freepascal.org/Bounties

I see the job and bounty sections here are not active. I was a member in WordPress forum and others, they have better management for commercial support, marketplace, plugin reviews, etc. That makes a big difference, it will attract skilled and serious programmers to join the developer team.
« Last Edit: May 04, 2018, 01:22:39 pm by Handoko »

RedOctober

  • Full Member
  • ***
  • Posts: 210
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #8 on: May 04, 2018, 04:04:55 pm »
Hi MSGEndoDoc. So, I am not the only one.  You make very good points about mORMot.

I wish that Daniel Teti wd port Delphi MVC Framework over to Lazarus.  DMVCF is relatively simple to use (especially compared to mORMot).  I hired Daniel to help me build a project using DMVCF and I was very impressed.  The learning curve is relatively low, but I didn't have much time so I had to hire Daniel directly to get the project done in time.

Thaddy

  • Hero Member
  • *****
  • Posts: 5994
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #9 on: May 04, 2018, 06:02:04 pm »
mORMot is on a basic level simple to use, but it has too many options, you can't see the wood for the tree's or the other way around. It also lacks some fancy generators to help.
I use it a lot.
I might not give the answer that you want me to.. Peter Green 1969

MSGEndoDoc

  • New member
  • *
  • Posts: 5
Re: Anyone using mORMot with Lazarus? I need help getting started.
« Reply #10 on: May 05, 2018, 07:28:38 am »
Hi Thaddy,

Good to hear you use Mormot a lot - so any tips on how to get proficient quickly  - how to find the wood in the trees!  I have tried some of the samples of course and set up Nos 27 and 29 servers.   I have read Taming the Mormot site too but still am not confident.   

Cheers,

Martin
Martin

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus