Exit on bad config flag

Home Forums Discussions Support Exit on bad config flag

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #12695
    xxxxzzz
    Participant

      Vadim, Privet!

      Current behaviour: if your configuration file is corrupt or does not exist wiresock will continue running while trying to connect for infinite duration (see pic)

      Right now I am controlling wiresock using a separate c# watchdog process (it also watches over several other processes but that doesnt matter).

      Thing is: I assume that if wireguard is running, it is connected (as it’s not really possible to query the actual connection state to my knowledge).

      Desired behaviour: wiresock process exits if config file is bad/does not exist.

      So maybe its worth adding a flag to exit on bad config text/non-existing config so process wouldn’t be running.

      (Command line used: wiresock-client.exe run -config c:\vpn.conf -log-level debug)

      #12696
      Vadim Smirnov
      Keymaster

        Thing is: I assume that if wireguard is running, it is connected (as it’s not really possible to query the actual connection state to my knowledge).

        Desired behaviour: wiresock process exits if config file is bad/does not exist.

        Even so, running service != active tunnel. For example, the configuration file may be present and correct, but Wireguard server may be down or unreachable.

        I already have several requests to add a simple application with a tray icon to indicate the status of a WireSock tunnel. So, I need to add some IPC for communication between service and tray app. Probably the simplest would be to create a shared memory section to represent the current state of the service/tunnel, or a simple named pipe request-response mechanism.

        More complex, but at the same time more modern and flexible, would be to add a simple web socket server using a third-party library such as websocketpp.

        I will give it a think until the next weekend. Any suggestions are appreciated.

        #12699
        xxxxzzz
        Participant

          Hey Vadim!
          I do not use the service as you can see from my command line (I assume running wiresock-client does not interact with services by any means).

          But in my opinion the situation when config is ok and Wireguard server is unreachable VS config is bad/missing are two completely different situations, and I would expect wiresock exiting on trying to import a bad config.

          May sound not intuitive but with a flag it sounds like a good idea in my head.
          So something like wiresock-client.exe run -config vpn.conf -exitonbadconfig would just close the process after failing to import/validate the vpn.conf file

          #12700
          Vadim Smirnov
          Keymaster

            You may be right, at least for the case where wiresock-client is running as an application and neither the primary nor secondary configurations are good/available, it makes sense to exit. As for the service, it may constantly try to restart.

            #12701
            xxxxzzz
            Participant

              wiresock-client is running as an application

              Exactly, you got my idea 🙂

              #12719
              Vadim Smirnov
              Keymaster

                The proposed changes were implemented in v1.2.13. Please give it a try.

                #12724
                xxxxzzz
                Participant

                  Vadim, privet!
                  It works if log level is debug/all, does not work in none log level mode it seems

                  #12725
                  Vadim Smirnov
                  Keymaster

                    Yes, sorry, my fault. Fixed in v1.2.14. Please try.

                    #12726
                    xxxxzzz
                    Participant

                      Works perfectly!
                      Unrelated suggestion: display version info in the initial notice message i.e.

                      Wiresock WireGuard Vpn Client v1.2.14 running as..

                      #12727
                      Vadim Smirnov
                      Keymaster

                        Works perfectly!

                        Thanks for checking!

                        Unrelated suggestion: display version info in the initial notice message

                        As you wish, v1.2.15!

                      Viewing 10 posts - 1 through 10 (of 10 total)
                      • You must be logged in to reply to this topic.