mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Moved UI resources to Wwwroot in embedded golang webserver RIVM-23
This commit is contained in:
parent
b52e1bb787
commit
dca4fdd689
6 changed files with 15 additions and 9 deletions
|
@ -294,10 +294,10 @@ func run(args yggArgs, ctx context.Context) {
|
|||
return
|
||||
}
|
||||
//override httpaddress and wwwroot parameters in cfg
|
||||
if len(args.httpaddress) > 0 {
|
||||
if len(cfg.HttpAddress) == 0 {
|
||||
cfg.HttpAddress = args.httpaddress
|
||||
}
|
||||
if len(args.wwwroot) > 0 {
|
||||
if len(cfg.WwwRoot) == 0 {
|
||||
cfg.WwwRoot = args.wwwroot
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ cat > /tmp/$PKGNAME/usr/share/applications/riv.desktop << EOF
|
|||
Name=RiV mesh
|
||||
GenericName=Mesh network
|
||||
Comment=RiV-mesh is an early-stage implementation of a fully end-to-end encrypted IPv6 network
|
||||
Exec=sh -c "/usr/bin/mesh-ui /usr/share/riv/ui/index.html"
|
||||
Exec=sh -c "/usr/bin/mesh-ui http://localhost:19019"
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=riv
|
||||
|
|
|
@ -54,7 +54,7 @@ cp contrib/macos/mesh.plist pkgbuild/root/Library/LaunchDaemons
|
|||
cat > pkgbuild/root/Applications/RiV-mesh.app/Contents/MacOS/open-mesh-ui << EOF
|
||||
#!/usr/bin/env bash
|
||||
|
||||
exec /Applications/RiV-mesh.app/Contents/MacOS/mesh-ui /Applications/RiV-mesh.app/Contents/Resources/ui/index.html 1>/tmp/mesh-ui.stdout.log 2>/tmp/mesh-ui.stderr.log
|
||||
exec /Applications/RiV-mesh.app/Contents/MacOS/mesh-ui http://localhost:19019 1>/tmp/mesh-ui.stdout.log 2>/tmp/mesh-ui.stderr.log
|
||||
EOF
|
||||
|
||||
# Create the postinstall script
|
||||
|
|
|
@ -9,6 +9,12 @@
|
|||
<string>/Applications/RiV-mesh.app/Contents/MacOS/mesh</string>
|
||||
<string>-useconffile</string>
|
||||
<string>/etc/mesh.conf</string>
|
||||
<string>-logto</string>
|
||||
<string>/var/log/mesh.log</string>
|
||||
<string>-httpaddress</string>
|
||||
<string>http://localhost:19019</string>
|
||||
<string>-wwwroot</string>
|
||||
<string>/Applications/RiV-mesh.app/Contents/Resources/ui</string>
|
||||
</array>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
|
|
|
@ -220,7 +220,7 @@ cat > wix.xml << EOF
|
|||
Name="Mesh"
|
||||
Start="auto"
|
||||
Type="ownProcess"
|
||||
Arguments='-useconffile "%ALLUSERSPROFILE%\\RiV-mesh\\mesh.conf" -logto "%ALLUSERSPROFILE%\\RiV-mesh\\mesh.log"'
|
||||
Arguments='-useconffile "%ALLUSERSPROFILE%\\RiV-mesh\\mesh.conf" -logto "%ALLUSERSPROFILE%\\RiV-mesh\\mesh.log" -httpaddress "http://localhost:19019" -wwwroot "[MeshInstallFolder]\\RiV-mesh\\ui"'
|
||||
Vital="yes" />
|
||||
<ServiceControl
|
||||
Id="MeshServiceControl"
|
||||
|
@ -306,7 +306,7 @@ cat > wix.xml << EOF
|
|||
<CustomAction Id="LaunchApplication"
|
||||
FileKey="MeshUI"
|
||||
Impersonate="yes"
|
||||
ExeCommand='"[MeshInstallFolder]ui\index.html"'
|
||||
ExeCommand='"http://localhost:19019"'
|
||||
Return="asyncNoWait" />
|
||||
|
||||
<!-- Step 3: Include the custom action -->
|
||||
|
@ -325,7 +325,7 @@ cat > wix.xml << EOF
|
|||
Description="RiV-mesh is IoT E2E encrypted network"
|
||||
Directory="DesktopFolder"
|
||||
Target="[MeshInstallFolder]mesh-ui.exe"
|
||||
Arguments="ui\index.html"
|
||||
Arguments="http://localhost:19019"
|
||||
WorkingDirectory="MeshInstallFolder"/>
|
||||
<RegistryValue Root="HKCU"
|
||||
Key="Software\RiV-chain\RiV-mesh"
|
||||
|
@ -337,7 +337,7 @@ cat > wix.xml << EOF
|
|||
Key="Software\Microsoft\Windows\CurrentVersion\Run"
|
||||
Name="RiV-mesh client"
|
||||
Type="string"
|
||||
Value='"[MeshInstallFolder]mesh-ui.exe" "[MeshInstallFolder]ui\index.html"' />
|
||||
Value='"[MeshInstallFolder]mesh-ui.exe" "http://localhost:19019"' />
|
||||
<Condition>ASSISTANCE_START_VIA_REGISTRY</Condition>
|
||||
</Component>
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ ProtectSystem=true
|
|||
SyslogIdentifier=mesh
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE
|
||||
ExecStartPre=+-/sbin/modprobe tun
|
||||
ExecStart=/usr/bin/mesh -useconffile /etc/mesh.conf
|
||||
ExecStart=/usr/bin/mesh -useconffile /etc/mesh.conf -logto /var/log/mesh.log -httpaddress "http://localhost:19019" -wwwroot "/usr/share/riv"
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Restart=always
|
||||
TimeoutStopSec=5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue