Search code examples
macossecuritycloudhostingvapor

Hot to protect Vapor code from access (any type of access, even physical)?


I am writing backend using Vapor 3 and macOS 10.15 (Mac Mini). The project is ready and working. Problem is how to protect code. I don't want to store code on server unprotected. Question is: how to protect code from anyone who can access to this server (direct, physical access too: someone, who know password can clone it to flash drive)? I heard that it's impossible to build or compile Vapor app in Xcode like iOS application (Product -> Archive) (Compiling Vapor as Standalone App on MacOS). If it's possible, please let me know. Code hardening (make code hardly readable) is easy to breach (at least, my version of hardening). Maybe, can I store code (some files with .swift extension) in some cloud storage (Github, Google Drive)? Or, is there any other way to protect code?

Thank you for any help or advice!


Solution

  • It is possible to launch just binary file.

    1) Launch swift build -c release in your project folder, in the end it will show you the way to compiled binary file.

    2) copy compiled binary file (Run) to another macOS machine and launch

    The only limitation that on another macOS machine you should have installed all needed libs and packages at the same paths.