Electron Application crash on macOS

Comments

To fix production build crash issues on macOS because of:
  • GPU loading
  • Network loading
  • Keychain API inaccessible
  • Other crash error from Electron Chromium on macOS
To note and help someone get crash error in Electron macOS production builds (all run well in development mode).
  • Check Application "entitlements.plist" file by `codesign -d --entitlements - --xml {.app path}`
  • Check every entry in that file if it needed, in common case, this `entitlements.plist` will work.
  • 
      
      
        
          com.apple.security.cs.allow-jit
          
          com.apple.security.device.audio-input
          
          com.apple.security.device.bluetooth
          
          com.apple.security.device.camera
          
          com.apple.security.device.print
          
          com.apple.security.device.usb
          
          com.apple.security.personal-information.location
          
        
      
    ]]>
    
  • Example additional entries to enable Keychain API:
  • com.apple.security.cs.allow-unsigned-executable-memory
    
    com.apple.security.cs.disable-executable-page-protection
    
    com.apple.security.cs.disable-library-validation
    
    keychain-access-groups
    
      {your application-identifier}
    
    ]]>
    
  • Disable Electron Builder signing step (set env CSC_IDENTITY_AUTO_DISCOVERY=false), add script "after-sign.js" and configure Electron Builder to call it to do:
    • Signing steps
    • Notarize app
    • Create final DMG file
  • Add mac config to Electron Builder to include keychain groups defined in entitlements.plist
  • conf.mac.extendInfo = {
      "keychain-access-groups": [
        `{your application-identifier}`,
      ]
    }
    
Script "after-sign.js:

Hope you found this useful!

Spring Security - Multiple Authentication Providers

Comments

Example how to configure Spring Security to support multiple Authentication Providers.

We have 2 Authentication Providers:

  • InternalAuthenticationProvider - for from-login with username & password parametters
  • AuthenticationTokenProvider - for the login by token string

SSH without password

Comments

SSH to server without entering password

$ ssh-keygen $ ssh-copy-id -i root@ip_address $ ssh root@ip_address

Localtunnel

Comments

Localtunnel is very awesome

It allows you to easily share a web service on your local development machine without messing with DNS and firewall settings.

Spring Security 4x support Websocket

Comments

According to article Preview Spring Security WebSocket Support, Spring Security 4x now fully support Web Socket => happy

For people who wanna to see a complete example Example Spring Security 4x support Web Socket

Caution, by default Spring Security will be failed if there is a Reverse proxy on the server. To fix this, the server need to be configured to support Web Socket handshake. For example this is configuration of Nginx