main.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright © 2021 Ettore Di Giacinto <[email protected]>
  2. //
  3. // This program is free software; you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation; either version 2 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License along
  14. // with this program; if not, see <http://www.gnu.org/licenses/>.
  15. package main
  16. import (
  17. "fmt"
  18. "os"
  19. "github.com/urfave/cli"
  20. "github.com/mudler/edgevpn/cmd"
  21. internal "github.com/mudler/edgevpn/internal"
  22. )
  23. func main() {
  24. app := &cli.App{
  25. Name: "edgevpn",
  26. Version: internal.Version,
  27. Author: "Ettore Di Giacinto",
  28. Usage: "edgevpn --config /etc/edgevpn/config.yaml",
  29. Description: "edgevpn uses libp2p to build an immutable trusted blockchain addressable p2p network",
  30. Copyright: cmd.Copyright,
  31. Flags: cmd.MainFlags(),
  32. Commands: []cli.Command{
  33. cmd.Join(),
  34. cmd.API(),
  35. cmd.ServiceAdd(),
  36. cmd.ServiceConnect(),
  37. cmd.FileReceive(),
  38. cmd.FileSend(),
  39. },
  40. Action: cmd.Main(),
  41. }
  42. err := app.Run(os.Args)
  43. if err != nil {
  44. fmt.Println(err)
  45. os.Exit(1)
  46. }
  47. }