Skip to content

Commit

Permalink
Merge branch 'master' into ADG-7414
Browse files Browse the repository at this point in the history
  • Loading branch information
IldarKamalov committed Aug 28, 2023
2 parents cd1cee0 + 3f7089d commit 9ad6186
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 30 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ In this release, the schema version has changed from 24 to 25.

### Fixed

- Missing query log entries and statistics on service restart ([#6100]).
- Occasional DNS-over-QUIC and DNS-over-HTTP/3 errors ([#6133]).
- Legacy DNS rewrites containing IPv4-mapped IPv6 addresses are now matching the
`AAAA` requests, not `A` ([#6050]).
Expand All @@ -84,6 +85,7 @@ In this release, the schema version has changed from 24 to 25.
[#6050]: https://github.com/AdguardTeam/AdGuardHome/issues/6050
[#6053]: https://github.com/AdguardTeam/AdGuardHome/issues/6053
[#6093]: https://github.com/AdguardTeam/AdGuardHome/issues/6093
[#6100]: https://github.com/AdguardTeam/AdGuardHome/issues/6100
[#6122]: https://github.com/AdguardTeam/AdGuardHome/issues/6122
[#6133]: https://github.com/AdguardTeam/AdGuardHome/issues/6133

Expand Down
10 changes: 5 additions & 5 deletions client/src/components/App/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ body {
}

.container--wrap {
min-height: calc(100vh - 160px);
min-height: calc(100vh - 372px);
}

@media screen and (min-width: 992px) {
@media screen and (min-width: 768px) {
.container--wrap {
min-height: calc(100vh - 117px);
min-height: calc(100vh - 168px);
}
}

@media screen and (max-width: 992px) {
@media screen and (min-width: 992px) {
.container--wrap {
min-height: calc(100vh);
min-height: calc(100vh - 187px);
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const App = () => {
<LoadingBar className="loading-bar" updateTime={1000} />
<Header />
<ProtectionTimer />
<div className="container container--wrap pb-5">
<div className="container container--wrap pb-5 pt-5">
{processing && <Loading />}
{!isCoreRunning && <div className="row row-cards">
<div className="col-lg-12">
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/ui/PageTitle.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.page-header--logs {
flex-direction: row;
align-items: flex-end;
margin: 2rem 0 2.8rem;
margin: 0.5rem 0 2.8rem;
}

.page-header--logs .page-title {
Expand All @@ -18,7 +18,7 @@
.page-header--logs {
flex-direction: column;
align-items: center;
margin: 1.1rem 0;
margin-bottom: 0 0 1.1rem;
}

.page-header--logs .page-title {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ui/Tabler.css
Original file line number Diff line number Diff line change
Expand Up @@ -10204,7 +10204,7 @@ body.fixed-header .page {
-ms-flex-align: center;
align-items: center;
flex-direction: column;
margin: 1.5rem 0 1.5rem;
margin: 0 0 1.5rem;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
Expand Down
3 changes: 2 additions & 1 deletion client/src/install/Setup/Setup.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
}

.setup {
min-height: calc(100vh - 71px);
min-height: calc(100vh - 345px);
line-height: 1.48;
}

@media screen and (min-width: 768px) {
.setup {
padding: 50px 0;
min-height: calc(100vh - 141px);
}
}

Expand Down
4 changes: 0 additions & 4 deletions internal/home/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,10 @@ func closeDNSServer() {
if err != nil {
log.Debug("closing stats: %s", err)
}

// TODO(e.burkov): Find out if it's safe.
Context.stats = nil
}

if Context.queryLog != nil {
Context.queryLog.Close()
Context.queryLog = nil
}

log.Debug("all dns modules are closed")
Expand Down
15 changes: 9 additions & 6 deletions internal/home/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ func Main(clientBuildFS fs.FS) {
// package flag.
opts := loadCmdLineOpts()

done := make(chan struct{})

signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP, syscall.SIGQUIT)

go func() {
for {
sig := <-signals
Expand All @@ -112,19 +115,19 @@ func Main(clientBuildFS fs.FS) {
default:
cleanup(context.Background())
cleanupAlways()
os.Exit(0)
close(done)
}
}
}()

if opts.serviceControlAction != "" {
handleServiceControlAction(opts, clientBuildFS, signals)
handleServiceControlAction(opts, clientBuildFS, done)

return
}

// run the protection
run(opts, clientBuildFS)
run(opts, clientBuildFS, done)
}

// setupContext initializes [Context] fields. It also reads and upgrades
Expand Down Expand Up @@ -504,7 +507,7 @@ func fatalOnError(err error) {
}

// run configures and starts AdGuard Home.
func run(opts options, clientBuildFS fs.FS) {
func run(opts options, clientBuildFS fs.FS, done chan struct{}) {
// Configure config filename.
initConfigFilename(opts)

Expand Down Expand Up @@ -609,8 +612,8 @@ func run(opts options, clientBuildFS fs.FS) {

Context.web.start()

// Wait indefinitely for other goroutines to complete their job.
select {}
// Wait for other goroutines to complete their job.
<-done
}

// initUsers initializes context auth module. Clears config users field.
Expand Down
17 changes: 7 additions & 10 deletions internal/home/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const (
// daemon.
type program struct {
clientBuildFS fs.FS
signals chan os.Signal
done chan struct{}
opts options
}

Expand All @@ -46,19 +46,16 @@ func (p *program) Start(_ service.Service) (err error) {
args := p.opts
args.runningAsService = true

go run(args, p.clientBuildFS)
go run(args, p.clientBuildFS, p.done)

return nil
}

// Stop implements service.Interface interface for *program.
func (p *program) Stop(_ service.Service) (err error) {
select {
case p.signals <- syscall.SIGINT:
// Go on.
default:
// Stop should not block.
}
log.Info("service: stopping: waiting for cleanup")

<-p.done

return nil
}
Expand Down Expand Up @@ -198,7 +195,7 @@ func restartService() (err error) {
// - run: This is a special command that is not supposed to be used directly
// it is specified when we register a service, and it indicates to the app
// that it is being run as a service/daemon.
func handleServiceControlAction(opts options, clientBuildFS fs.FS, signals chan os.Signal) {
func handleServiceControlAction(opts options, clientBuildFS fs.FS, done chan struct{}) {
// Call chooseSystem explicitly to introduce OpenBSD support for service
// package. It's a noop for other GOOS values.
chooseSystem()
Expand Down Expand Up @@ -232,7 +229,7 @@ func handleServiceControlAction(opts options, clientBuildFS fs.FS, signals chan

s, err := service.New(&program{
clientBuildFS: clientBuildFS,
signals: signals,
done: done,
opts: runOpts,
}, svcConfig)
if err != nil {
Expand Down

0 comments on commit 9ad6186

Please sign in to comment.