From 8aad02dbf2d7df061e98cdb540427659cc227ec2 Mon Sep 17 00:00:00 2001 From: ArtemBaskal Date: Thu, 30 Apr 2020 18:50:05 +0300 Subject: [PATCH 1/5] + client: Add icons for Apple products --- client/public/apple-touch-icon-180x180.png | Bin 0 -> 2137 bytes client/public/index.html | 2 ++ client/public/install.html | 2 ++ client/public/login.html | 2 ++ client/public/safari-pinned-tab.svg | 16 ++++++++++++++++ 5 files changed, 22 insertions(+) create mode 100644 client/public/apple-touch-icon-180x180.png create mode 100644 client/public/safari-pinned-tab.svg diff --git a/client/public/apple-touch-icon-180x180.png b/client/public/apple-touch-icon-180x180.png new file mode 100644 index 0000000000000000000000000000000000000000..ebc0be5067efcf4d8366a70cb7a4777327d9cfc4 GIT binary patch literal 2137 zcmV-f2&VUmP)crq!>P&7z9NmVd#Fb-aXcxPNW8d~3CPYP5Q2w0dZ>d1tbDYQ1xAzjt%N ze0Rftd&Pr*$B2Z<@WpcUc-0}JI{r~-|*0OWDf_1`ulh2vW>Cox+>i+-!vf8eHpys`dN!X}ogi_33W6e#hp^`TY5V$cuZwiN)o~qSmLO)uxZh zn!@D8w%@y{*0I0h!shho;qv3T;Jvioxw720n9ibgxrLw3s=VFA%;nO_eqR=-A=#DjK%w$)VEh)xzM(gTRt$ zvwLo}f8+7y-|ymVw0(EFhwu0B`~Lg2*}jp^my*ezkIt5_*|(+Au#3c*^ZN67!-3T7 z*Sg%o^Z4|N%aMM-i{|p_Z?=HB-oV}M;nnKe*X`MIxPknBVc?cf5ql=+5f_h~xkO1(HcbK~#7F?b!pDTTL9t@n7vs*7nry+TNr#*L=*{ zwr$(CZMUzdSl&f)Cz-jq$vN|R1>b|=AKH*4Ns=To#rM zweQfelfgiYZtfnQUfw>we*OW0LBSz#DxqQFts~kSNCUKi&Rx28>)xX$^wuk=ck4bi zwJOmy`u6khKOhqNXciUS&Oof7R>b(k#)ZJK;u8{+h#IQGm>e6I0tZQL-JY}M`ei#r#Ef@kGziJYl8;2i$ z`<+_y2YCFcMYQoR{PZ`qXaIQpqd~N>KYj|NmSuoTC*jfm2I8mx+^9t!;Pb!e=zk~U zrzumZWj^3DO?32hRGLApmTu{Dubz2xxax^2XWDhP-Qx`ZYp?96BfM~Rf5M->t=%25>e6Rs1lM-Rg40! z(L~+SWy@ErT(#P2bS$cMrE125*FQwfnzfOrv~IoS=;5d~o2oII!A)hXwP7P_MQ*Yb z{Wq$O7)#Ym1;5S2sx6UF*xGdTj7U@o*+x~xg5P#x-6kmP*x6L{;2o$|Le=d8zh*?m zZYYH8X&l|Pws{^^murTCR=3l=8==r_X~XCe6RM@>vJ4U-LJ?81Z$A_c9IPK*Slj%M zC;Rt-_B-{V!%$dJFS_4vsNqXl^neIQIuSK{LZEO|5q+$#Ie@YlWP%XWh^pf|ps=hq z`ot8}7;mI3W5ve?mHmJ zCBk3@6fR#Ogm$TG#zM-*529Qp3=Up{!u7o*`5)9OHBvS=Ac`rEFt~XO3cL55L9H_r zDVx4KAWR}*ar*)k?x0p=Kla~raqbc(r+-6}=1^AiAy7NQ_zpOecMQ>P@8M*Ic2tY@908{j-^Y6NrxZA$UdOFO z=PrzdbDG}KQuMaZa9U;4nvNc9hBIqvXdLYx2qzc%rD1eQPdLB124%GSSGa^HW9p*E zoq?-()3GW#KL{?wJc|(OHpc|l@<&_WW{@OFk|arzBuSDaNs=T + + AdGuard Home diff --git a/client/public/install.html b/client/public/install.html index 2fd3bb7d..51858294 100644 --- a/client/public/install.html +++ b/client/public/install.html @@ -5,6 +5,8 @@ + + Setup AdGuard Home diff --git a/client/public/login.html b/client/public/login.html index 03179b42..7e45e484 100644 --- a/client/public/login.html +++ b/client/public/login.html @@ -5,6 +5,8 @@ + + Login diff --git a/client/public/safari-pinned-tab.svg b/client/public/safari-pinned-tab.svg new file mode 100644 index 00000000..d2cd031d --- /dev/null +++ b/client/public/safari-pinned-tab.svg @@ -0,0 +1,16 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + From 26ac9e422488998290ddfe4db1b0ceaabca0441c Mon Sep 17 00:00:00 2001 From: ArtemBaskal Date: Thu, 14 May 2020 12:06:22 +0300 Subject: [PATCH 2/5] Add icons to server --- home/auth.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/home/auth.go b/home/auth.go index c72ca546..5e6c59f6 100644 --- a/home/auth.go +++ b/home/auth.go @@ -381,6 +381,8 @@ func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.Re } } else if r.URL.Path == "/favicon.png" || + r.URL.Path == "/safari-pinned-tab.svg" || + strings.HasPrefix(r.URL.Path, "/apple-touch-icon") || strings.HasPrefix(r.URL.Path, "/login.") || strings.HasPrefix(r.URL.Path, "/__locales/") { // process as usual From 5f13d4ab4a2a02eed867aabab0da094d63936ceb Mon Sep 17 00:00:00 2001 From: ArtemBaskal Date: Thu, 14 May 2020 14:45:16 +0300 Subject: [PATCH 3/5] Add assets folder --- .../{ => assets}/apple-touch-icon-180x180.png | Bin client/public/{ => assets}/favicon.png | Bin client/public/{ => assets}/safari-pinned-tab.svg | 0 client/public/index.html | 6 +++--- client/public/install.html | 6 +++--- client/public/login.html | 6 +++--- client/webpack.common.js | 5 +++-- home/auth.go | 4 +--- 8 files changed, 13 insertions(+), 14 deletions(-) rename client/public/{ => assets}/apple-touch-icon-180x180.png (100%) rename client/public/{ => assets}/favicon.png (100%) rename client/public/{ => assets}/safari-pinned-tab.svg (100%) diff --git a/client/public/apple-touch-icon-180x180.png b/client/public/assets/apple-touch-icon-180x180.png similarity index 100% rename from client/public/apple-touch-icon-180x180.png rename to client/public/assets/apple-touch-icon-180x180.png diff --git a/client/public/favicon.png b/client/public/assets/favicon.png similarity index 100% rename from client/public/favicon.png rename to client/public/assets/favicon.png diff --git a/client/public/safari-pinned-tab.svg b/client/public/assets/safari-pinned-tab.svg similarity index 100% rename from client/public/safari-pinned-tab.svg rename to client/public/assets/safari-pinned-tab.svg diff --git a/client/public/index.html b/client/public/index.html index 8bd0eaf6..ecf811ec 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -6,9 +6,9 @@ - - - + + + AdGuard Home diff --git a/client/public/install.html b/client/public/install.html index 51858294..3a09704c 100644 --- a/client/public/install.html +++ b/client/public/install.html @@ -5,9 +5,9 @@ - - - + + + Setup AdGuard Home diff --git a/client/public/login.html b/client/public/login.html index 7e45e484..9f06fc03 100644 --- a/client/public/login.html +++ b/client/public/login.html @@ -5,9 +5,9 @@ - - - + + + Login diff --git a/client/webpack.common.js b/client/webpack.common.js index 99b6dbae..f4f0bae4 100644 --- a/client/webpack.common.js +++ b/client/webpack.common.js @@ -14,9 +14,10 @@ const ENTRY_LOGIN = path.resolve(RESOURCES_PATH, 'src/login/index.js'); const HTML_PATH = path.resolve(RESOURCES_PATH, 'public/index.html'); const HTML_INSTALL_PATH = path.resolve(RESOURCES_PATH, 'public/install.html'); const HTML_LOGIN_PATH = path.resolve(RESOURCES_PATH, 'public/login.html'); -const FAVICON_PATH = path.resolve(RESOURCES_PATH, 'public/favicon.png'); +const ASSETS_PATH = path.resolve(RESOURCES_PATH, 'public/assets'); const PUBLIC_PATH = path.resolve(__dirname, '../build/static'); +const PUBLIC_ASSETS_PATH = path.resolve(PUBLIC_PATH, 'assets'); const config = { target: 'web', @@ -134,7 +135,7 @@ const config = { filename: '[name].[contenthash].css', }), new CopyPlugin([ - { from: FAVICON_PATH, to: PUBLIC_PATH }, + { from: ASSETS_PATH, to: PUBLIC_ASSETS_PATH }, ]), ], }; diff --git a/home/auth.go b/home/auth.go index 5e6c59f6..36aa53fe 100644 --- a/home/auth.go +++ b/home/auth.go @@ -380,9 +380,7 @@ func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.Re } } - } else if r.URL.Path == "/favicon.png" || - r.URL.Path == "/safari-pinned-tab.svg" || - strings.HasPrefix(r.URL.Path, "/apple-touch-icon") || + } else if strings.HasPrefix(r.URL.Path,"/assets/") || strings.HasPrefix(r.URL.Path, "/login.") || strings.HasPrefix(r.URL.Path, "/__locales/") { // process as usual From 11d65330a093090e335cfa7ab1d048bd1647a2d4 Mon Sep 17 00:00:00 2001 From: ArtemBaskal Date: Thu, 14 May 2020 15:03:00 +0300 Subject: [PATCH 4/5] Fix go lint warning --- home/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/auth.go b/home/auth.go index 36aa53fe..82918f78 100644 --- a/home/auth.go +++ b/home/auth.go @@ -380,7 +380,7 @@ func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.Re } } - } else if strings.HasPrefix(r.URL.Path,"/assets/") || + } else if strings.HasPrefix(r.URL.Path, "/assets/") || strings.HasPrefix(r.URL.Path, "/login.") || strings.HasPrefix(r.URL.Path, "/__locales/") { // process as usual From 502fe3cfc5feea46f287854d0c3ebb9e66676bdd Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Thu, 14 May 2020 18:37:25 +0300 Subject: [PATCH 5/5] *(home): fix assets access --- home/auth.go | 5 ++--- home/control.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/home/auth.go b/home/auth.go index 82918f78..a2d6d5f2 100644 --- a/home/auth.go +++ b/home/auth.go @@ -381,10 +381,9 @@ func optionalAuth(handler func(http.ResponseWriter, *http.Request)) func(http.Re } } else if strings.HasPrefix(r.URL.Path, "/assets/") || - strings.HasPrefix(r.URL.Path, "/login.") || - strings.HasPrefix(r.URL.Path, "/__locales/") { + strings.HasPrefix(r.URL.Path, "/login.") { // process as usual - + // no additional auth requirements } else if Context.auth != nil && Context.auth.AuthRequired() { // redirect to login page if not authenticated ok := false diff --git a/home/control.go b/home/control.go index 310b9f20..744fc327 100644 --- a/home/control.go +++ b/home/control.go @@ -188,7 +188,7 @@ func postInstall(handler func(http.ResponseWriter, *http.Request)) func(http.Res if Context.firstRun && !strings.HasPrefix(r.URL.Path, "/install.") && - r.URL.Path != "/favicon.png" { + !strings.HasPrefix(r.URL.Path, "/assets/") { http.Redirect(w, r, "/install.html", http.StatusFound) return }