mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-12-24 02:43:57 +08:00
all: imp style
This commit is contained in:
@@ -366,7 +366,6 @@ var _ httputil.Middleware = (*authMiddlewareDefault)(nil)
|
|||||||
func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) {
|
func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
path := r.URL.Path
|
|
||||||
|
|
||||||
if !mw.needsAuthentication(ctx) {
|
if !mw.needsAuthentication(ctx) {
|
||||||
h.ServeHTTP(w, r)
|
h.ServeHTTP(w, r)
|
||||||
@@ -374,6 +373,7 @@ func (mw *authMiddlewareDefault) Wrap(h http.Handler) (wrapped http.Handler) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path := r.URL.Path
|
||||||
if mw.handleAuthenticatedUser(ctx, w, r, h, path) {
|
if mw.handleAuthenticatedUser(ctx, w, r, h, path) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,9 +260,9 @@ func finalizeWindowsUpdate(ctx context.Context,
|
|||||||
var commandConf *executil.CommandConfig
|
var commandConf *executil.CommandConfig
|
||||||
|
|
||||||
if runningAsService {
|
if runningAsService {
|
||||||
// NOTE: We can't restart the service via "kardianos/service"
|
// NOTE: We can't restart the service via "kardianos/service" package,
|
||||||
// package, because it kills the process first we can't start a new
|
// because it kills the process first we can't start a new instance,
|
||||||
// instance, because Windows doesn't allow it.
|
// because Windows doesn't allow it.
|
||||||
//
|
//
|
||||||
// TODO(a.garipov): Recheck the claim above.
|
// TODO(a.garipov): Recheck the claim above.
|
||||||
commandConf = &executil.CommandConfig{
|
commandConf = &executil.CommandConfig{
|
||||||
|
|||||||
@@ -678,7 +678,6 @@ func run(
|
|||||||
done chan struct{},
|
done chan struct{},
|
||||||
sigHdlr *signalHandler,
|
sigHdlr *signalHandler,
|
||||||
) {
|
) {
|
||||||
var err error
|
|
||||||
initEnvironment(ctx, opts, slogLogger)
|
initEnvironment(ctx, opts, slogLogger)
|
||||||
|
|
||||||
isFirstRun := detectFirstRun()
|
isFirstRun := detectFirstRun()
|
||||||
@@ -687,7 +686,7 @@ func run(
|
|||||||
confPath, upd, isCustomURL := initUpdate(ctx, slogLogger, opts, tlsMgr, isFirstRun)
|
confPath, upd, isCustomURL := initUpdate(ctx, slogLogger, opts, tlsMgr, isFirstRun)
|
||||||
|
|
||||||
dataDir := globalContext.getDataDir()
|
dataDir := globalContext.getDataDir()
|
||||||
err = os.MkdirAll(dataDir, aghos.DefaultPermDir)
|
err := os.MkdirAll(dataDir, aghos.DefaultPermDir)
|
||||||
fatalOnError(errors.Annotate(err, "creating DNS data dir at %s: %w", dataDir))
|
fatalOnError(errors.Annotate(err, "creating DNS data dir at %s: %w", dataDir))
|
||||||
|
|
||||||
auth, err := initUsers(ctx, slogLogger, opts.glinetMode)
|
auth, err := initUsers(ctx, slogLogger, opts.glinetMode)
|
||||||
|
|||||||
Reference in New Issue
Block a user