NetTalk Central

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 - DonnEdwards

Pages: 1 2 3 [4]
46
Web Server - Ask For Help / NetTalkServer extra buttons
« on: April 16, 2021, 07:44:27 AM »
I have created two useful buttons to help me set up the secure and insecure ports correctly. See attached image

These are the items to add near the end of the Webserver Window using the Window Structure Editor:

Code: [Select]
          BUTTON('Insecure Address'),AT(6,297),USE(?InsecureButton),TIP('Open the browser with' & |
            ' the insecure address and port')
          BUTTON('Secure Address'),AT(82,297),USE(?SecureButton),TIP('Open the browser with ' & |
            'the secure address and port')

In the Local data "Generated Declarations" embed point, add in:

Code: [Select]
! Secure and Insecure Address buttons
loc:Run           cstring(255)
loc:parameters    cstring (255)
loc:ret           long
st                StringTheory

For the "?InsecureButton" Accepted embed point add in:

Code: [Select]
  ! Open the insecure address
  IF len(clip(set:Domains)) > 4 THEN            ! Domains are listed
        st.SetValue(CLIP(set:Domains) & '<13,10>') ! Get the domains, add a CR LF to the end
        loc:Run = 'http://' & CLIP(st.Before('<13,10>')) & ':' & CLIP(set:InsecurePort) ! First listed domain
  ELSIF LEN(CLIP(set:BindToIpAddress)) > 4 THEN ! IP Address filled in
        loc:Run = 'http://' & CLIP(set:BindToIpAddress) & ':' & CLIP(set:InsecurePort)
  ELSE                                          ! IP Address missing
        loc:Run = 'http://127.0.0.1:' & CLIP(set:InsecurePort)
  END                                           ! IP Address
  loc:parameters = ''
  loc:ret = OS_ShellExecute(0{prop:clienthandle}, 0, address(loc:Run), address(loc:Parameters), 0, 1) ! Open the URL

Similarly for the "?SecureButton"

Code: [Select]
  ! Open the secure address
  IF set:SecurePort > 0 THEN                ! Secure port set
        IF len(clip(set:Domains)) > 4 THEN            ! Domains are listed
            st.SetValue(CLIP(set:Domains) & '<13,10>')  ! Get the domains, add a CR LF to the end
            loc:Run = 'https://' & CLIP(st.Before('<13,10>')) & ':' & CLIP(set:SecurePort) ! First listed domain
        ELSIF LEN(CLIP(set:BindToIpAddress)) > 4 THEN ! IP Address filled in
            loc:Run = 'https://' & CLIP(set:BindToIpAddress) & ':' & CLIP(set:SecurePort)

        ELSE                                ! IP Address missing
            loc:Run = 'https://127.0.0.1:' & CLIP(set:SecurePort)
        END                                 ! IP Address
        loc:parameters = ''
        loc:ret = OS_ShellExecute(0{prop:clienthandle}, 0, address(loc:Run), address(loc:Parameters), 0, 1)  ! Open the URL
  ELSE                                      ! Secure port is zero
        MESSAGE('Secure Port not set')
  END                                       ! Secure port

I'm not entirely sure I have got it right. Please could you guys have a look at my code and tell me how I can improve it further. I'm still very new at all of this.
Thanks in advance
Donn

47
Web Server - Ask For Help / Missing Conditional Compilation Symbols
« on: April 15, 2021, 10:27:54 AM »
My NetTalk server app uses quite a few conditional compilation symbols, most of which are (mercifully) handled for me.

See attachment

But from time to time, for no reason I can determine, all these symbols disappear. The entire set, including FM2=>1 which FileManager3 needs.

I was editing an embed, which I saved, and then I clicked "Start without Debugger (Builds solution)" and poof! All gone and the build failed because FM2=>1 was missing.

Am I doing something wrong? Is this a known bug in C11? In NT 12?

48
Web Server - Ask For Help / Re: Access-Control-Allow-Origin issues
« on: March 08, 2020, 12:59:18 AM »
The tests are working correctly, except for HTTP 404 and HTTP 403 errors. They are still giving
Access-Control-Allow-Origin: *
I'm not sure if this is a bug or by design. Either way, I can't see how it could be exploited.

49
Web Server - Ask For Help / Re: Access-Control-Allow-Origin issues
« on: March 06, 2020, 09:38:45 AM »
I was on build 11.25 but I have now updated to build 11.30, including all the other packages, and recompiled. Everything is working correctly now.

I guess in addition to RTFM I should add Check the version number  :D

50
Web Server - Ask For Help / Access-Control-Allow-Origin issues
« on: March 06, 2020, 03:15:41 AM »
Hi all, I am having a problem with Access-Control-Allow-Origin

I took the sample NetTalk Login code, and made a few cosmetic changes to reflect the name of my project, and built it and shipped it to a live server. See
http://kgoffice.co.za which instantly and gracefully redirects the user to https://kgoffice.co.za
Perfect!

If I use https://websniffer.cc/?url=https://kgoffice.co.za/ it shows (amongst other things in the header)
Code: [Select]
Access-Control-Allow-Origin: *which is correct, and the default.

However a lot of security review programs and websites complain that Access-Control-Allow-Origin should not be set to "*" but should be set to https://kgoffice.co.za

I tried changing it in the live server settings. See attachment ServerSettings.jpg
But this hasn't changed anything. https://websniffer.cc/?url=https://kgoffice.co.za/
still shows the Access-Control-Allow-Origin header as "*", even after closing the server and starting it again.

What should I be doing differently?


51
Web Server - Ask For Help / Re: Setup for MultiSite
« on: January 30, 2020, 04:07:23 AM »
Thanks Vinnie. Much appreciated.

I guess I've been listening to too many episodes of the DarkNet Diaries podcast (www.darknetdiaries.com) and I'm now totally paranoid about PC security ;-)

52
Web Server - Ask For Help / Setup for MultiSite
« on: January 29, 2020, 08:57:22 AM »
Hi all, this is my first post
I have watched Don Ridley's presentation on ClarionLive #527 about setting up a MultiSite host, but I just want to check and make absolutely sure.

I am setting up a cloud server at HostAfrica (hostafrica.co.za) and I want to host two NetTalk apps on the same box.

The first one will be at https://kgoffice.co.za and is for office admin on a PC or laptop.
The second one will be https://kgon.co.za and is a mobile app

Please confirm that both domains can use the same IP address, and that I won't have to buy a second static IP?

Also, please confirm that Windows 2009 should NOT have IIS installed. Hopefully I can block all incoming traffic except for port 443. Any other services I can disable?

If I am using basic authentication, do I need to create a Windows user and password for each website user, or does NetTalk manage the basic authentication for me?

Thanks in advance
Donn

Pages: 1 2 3 [4]