Merge: snap desktop icon

* commit '82858474a5b165efb4181975067a36e3668b89da':
  Update adguard-home-web.sh
  Update adguard-home-web.sh
  Add web launcher for desktop users
This commit is contained in:
Andrey Meshkov 2020-07-17 10:38:19 +03:00
commit d794b11e7a
5 changed files with 40 additions and 6 deletions

View File

@ -10,8 +10,7 @@ before:
- go generate ./...
builds:
-
main: ./main.go
- main: ./main.go
ldflags:
- -s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}
env:
@ -43,8 +42,7 @@ builds:
goarch: mipsle
archives:
-
# Archive name template.
- # Archive name template.
# Defaults:
# - if format is `tar.gz`, `tar.xz`, `gz` or `zip`:
# - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
@ -62,8 +60,7 @@ archives:
- README.md
snapcrafts:
-
name: adguard-home
- name: adguard-home
base: core18
name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
summary: Network-wide ads & trackers blocking DNS server
@ -80,11 +77,24 @@ snapcrafts:
confinement: strict
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs: [ network-bind ]
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
checksum:
name_template: 'checksums.txt'

6
scripts/snap/README.md Normal file
View File

@ -0,0 +1,6 @@
# Snap GUI
These files are added to the AdGuard Home snap in order to add an app icon:
https://github.com/AdguardTeam/AdGuardHome/pull/1836
See .goreleaser.yml: snapcrafts.extra_files

View File

@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=AdGuard Home
Comment=Network-wide ads & trackers blocking DNS server
Exec=adguard-home.adguard-home-web
Icon=${SNAP}/meta/gui/adguard-home-web.png
Terminal=false

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,10 @@
#!/bin/bash
# Get admin tool port from configuration
bind_port=$(grep bind_port $SNAP_DATA/AdGuardHome.yaml | awk -F ' ' '{print $2}')
if [ -z "$bind_port" ]; then
xdg-open http://localhost:3000
else
xdg-open http://localhost:$bind_port
fi