Giter Club home page Giter Club logo

openvpn-monitor's Introduction

openvpn-monitor

How to compile for FreeBSD from Windows and deploy to pfSense

Disclaimer

Using cross is probably a simpler solution, but booting up a 2GiB container for each compilation takes too long, so I decided to use a FreeBSD VM.

This is NOT a step-by-step tutorial but a collection of steps that I remember doing to get this to work.

How it works (starting from sync.sh)

  • The following directories and files are synced to the FreeBSD VM using rsync
    • /Cargo.toml
    • /Cargo.lock
    • /src/*
  • build_and_run.sh is executed on the FreeBSD VM in the project directory
    • Build the project in release mode for x86_64-unknown-freebsd
    • Send SIGTERM to all running openvpn-monitor processes using killall
    • Wait until all openvpn-monitor processes have exited
    • Copy the compiled binary to /usr/local/bin
    • Run the binary in the background

Virtual Machine

  • Download a FreeBSD image
  • Add the following to /etc/ssh/sshd_config
    • PermitRootLogin yes
    • AuthorizedKeysFile /root/.ssh/authorized_keys
  • Add your SSH key from Windows to /root/.ssh/authorized_keys
  • Install Rust on the FreeBSD VM
  • Generate an SSH key using ssh-keygen -t ed25519
  • Install rsync using pkg install rsync
  • Install bash using pkg install bash

pfSense

  • Add the SSH key from the FreeBSD VM to the admin user
    • System -> User Manager -> Users -> admin -> Authorized SSH Keys

Windows

openvpn-monitor's People

Contributors

cryeprecision avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.