Add web launcher for desktop users

This commit is contained in:
Alan Pope 2020-06-26 12:19:29 +01:00
parent 7a77dadab0
commit 8863e61e8e
8 changed files with 55 additions and 1 deletions

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

View File

@ -14,7 +14,16 @@ description: |
grade: stable
confinement: strict
architectures:
- build-on: amd64
- build-on: armhf
- build-on: i386
- build-on: arm64
parts:
web-launcher:
plugin: dump
source: snap/local
adguard-home:
plugin: make
source: .
@ -29,4 +38,7 @@ apps:
command: AdGuardHome -w ${SNAP_DATA} --no-check-update
plugs: [ network-bind ]
daemon: simple
restart-condition: always
restart-condition: always
adguard-home-web:
command: adguard-home-web.sh
plugs: [desktop]

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

10
snap/local/adguard-home-web.sh Executable file
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

View File

@ -24,6 +24,9 @@ architectures:
- build-on: arm64
parts:
web-launcher:
plugin: dump
source: snap/local
adguard-home:
plugin: make
source: .
@ -39,3 +42,6 @@ apps:
plugs: [ network-bind ]
daemon: simple
restart-condition: always
adguard-home-web:
command: adguard-home-web.sh
plugs: [desktop]