Skip to content

Commit

Permalink
tunnels: regenerate vtun config on save
Browse files Browse the repository at this point in the history
  • Loading branch information
USA-RedDragon committed Jan 21, 2024
1 parent e701411 commit f9bb7c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/server/api/controllers/v1/tunnels.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,13 @@ func PATCHTunnel(c *gin.Context) {
return
}

err = vtun.GenerateAndSave(config, db)
if err != nil {
fmt.Printf("PATCHTunnel: Error generating vtun config: %v\n", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error generating vtun config"})
return
}

err = vtun.GenerateAndSaveClient(config, db)
if err != nil {
fmt.Printf("PATCHTunnel: Error generating vtun client config: %v\n", err)
Expand Down

0 comments on commit f9bb7c4

Please sign in to comment.