mirror of
https://github.com/adnanh/webhook.git
synced 2025-10-04 13:41:03 +00:00
refactor: add platform
This commit is contained in:
parent
8b887fc35d
commit
2b2997ce49
5 changed files with 17 additions and 14 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"github.com/adnanh/webhook/internal/hook"
|
||||
"github.com/adnanh/webhook/internal/middleware"
|
||||
"github.com/adnanh/webhook/internal/pidfile"
|
||||
"github.com/adnanh/webhook/internal/platform"
|
||||
|
||||
chimiddleware "github.com/go-chi/chi/middleware"
|
||||
"github.com/gorilla/mux"
|
||||
|
@ -144,7 +145,7 @@ func main() {
|
|||
}
|
||||
|
||||
if *setUID != 0 {
|
||||
err := dropPrivileges(*setUID, *setGID)
|
||||
err := platform.DropPrivileges(*setUID, *setGID)
|
||||
if err != nil {
|
||||
logQueue = append(logQueue, fmt.Sprintf("error dropping privileges: %s", err))
|
||||
// we'll bail out below
|
||||
|
@ -197,7 +198,7 @@ func main() {
|
|||
log.Println("version " + version + " starting")
|
||||
|
||||
// set os signal watcher
|
||||
setupSignals()
|
||||
platform.SetupSignals(signals, reloadAllHooks, pidFile)
|
||||
|
||||
// load and parse hooks
|
||||
for _, hooksFilePath := range hooksFiles {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue