Merge branch 'develop' of github.com:RiV-chain/RiV-mesh into develop

This commit is contained in:
Mihail Slobodyanuk 2022-12-14 07:45:07 +02:00
commit 8e7ea86b42
28 changed files with 137 additions and 126 deletions

View file

@ -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

View file

@ -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

View file

@ -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/>

View file

@ -52,8 +52,6 @@ PKGNAME=$(sh contrib/semver/name.sh)
PKGVERSION=$(sh contrib/msi/msversion.sh --bare)
PKGVERSIONMS=$(echo $PKGVERSION | tr - .)
PKGUIFOLDER=contrib/ui/mesh-ui/ui/
PKGWEBVIEWRESOURCESFOLDER="${PKGUIFOLDER}assets/"
PKGFONTSRESOURCESFOLDER="${PKGUIFOLDER}webfonts/"
PKGLICENSEFILE=LICENSE.rtf
@ -112,6 +110,10 @@ else
exit 1
fi
PKG_UI_ASSETS_ZIP=$(pwd)/ui.zip
( cd "$PKGUIFOLDER" && 7z a "$PKG_UI_ASSETS_ZIP" * )
PKG_UI_ASSETS_ZIP=ui.zip
if [ $PKGNAME != "master" ]; then
PKGDISPLAYNAME="RiV-mesh Network (${PKGNAME} branch)"
else
@ -155,49 +157,10 @@ cat > wix.xml << EOF
<Icon Id="icon.ico" SourceFile="riv.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<Property Id="SOURCEDIRECTORY" Value="${PKGUIFOLDER}" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="DesktopFolder" SourceName="Desktop"/>
<Directory Id="${PKGINSTFOLDER}" Name="PFiles">
<Directory Id="MeshInstallFolder" Name="RiV-mesh">
<Directory Id="WebViewUIFolder" Name="ui" >
<Directory Id="AssetsFolder" Name="assets" >
<Component Id="AssetsResources" Guid="6e9af115-daa0-4aac-8e6a-5ba65e720a4d">
<File
Id="AllMinCssFile"
Name="all.min.css"
DiskId="1"
Source="${PKGWEBVIEWRESOURCESFOLDER}all.min.css" />
<File
Id="BulmaswatchCssFile"
Name="bulmaswatch.min.css"
DiskId="1"
Source="${PKGWEBVIEWRESOURCESFOLDER}bulmaswatch.min.css" />
<File
Id="BulmaswatchCssMapFile"
Name="bulmaswatch.min.css.map"
DiskId="1"
Source="${PKGWEBVIEWRESOURCESFOLDER}bulmaswatch.min.css.map" />
</Component>
</Directory>
<Directory Id="WebfontsFolder" Name="webfonts" >
<Component Id="FontsResources" Guid="4ffeb20b-61a8-4c7f-ba16-0d0c8e43b09a">
<File
Id="FontFile"
Name="fa-solid-900.woff2"
DiskId="1"
Source="${PKGFONTSRESOURCESFOLDER}fa-solid-900.woff2" />
</Component>
</Directory>
<Component Id="WebViewResources" Guid="a4a5a50a-a336-4789-bf61-ca76fe217e3f">
<File
Id="WebViewHtmlFile"
Name="index.html"
DiskId="1"
Source="${PKGUIFOLDER}index.html" />
</Component>
</Directory>
<Component Id="MainExecutable" Guid="c2119231-2aa3-4962-867a-9759c87beb24">
<File
Id="Mesh"
@ -220,7 +183,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]ui.zip"'
Vital="yes" />
<ServiceControl
Id="MeshServiceControl"
@ -258,6 +221,12 @@ cat > wix.xml << EOF
DiskId="1"
Source="${PKGWEBVIEWFILELOADER}" />
<File
Id="UiAssets"
Name="ui.zip"
DiskId="1"
Source="${PKG_UI_ASSETS_ZIP}" />
</Component>
@ -268,7 +237,7 @@ cat > wix.xml << EOF
DiskId="1"
Source="updateconfig.bat"
KeyPath="yes"/>
</Component>
</Component>
</Directory>
</Directory>
@ -276,9 +245,6 @@ cat > wix.xml << EOF
<Feature Id="MeshFeature" Title="Mesh" Level="1">
<ComponentRef Id="MainExecutable" />
<ComponentRef Id="WebViewResources" />
<ComponentRef Id="AssetsResources" />
<ComponentRef Id="FontsResources" />
<ComponentRef Id="UIExecutable" />
<ComponentRef Id="CtrlExecutable" />
<ComponentRef Id="cmpDesktopShortcut" />
@ -306,7 +272,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 +291,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 +303,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>

View file

@ -67,6 +67,9 @@ echo "coping ui package..."
cp contrib/ui/nas-netgear-os6/package/apps /tmp/$PKGNAME/ -r
cp contrib/ui/www/* /tmp/$PKGNAME/apps/mesh/www/ -r
echo "coping postinstall, postrm, prerm scripts"
cp contrib/ui/nas-netgear-os6/package/DEBIAN/* /tmp/$PKGNAME/DEBIAN/ -r
cat > /tmp/$PKGNAME/debian/changelog << EOF
Please see https://github.com/RiV-chain/RiV-mesh/
EOF

View file

@ -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/ui"
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
TimeoutStopSec=5

View file

@ -237,13 +237,13 @@
}
function togglePrivKeyVisibility() {
if (this.classList.contains("fa-eye-slash")) {
this.classList.remove("fa-eye-slash");
this.classList.add("fa-eye");
document.getElementById("priv_key_visible").innerHTML = document.getElementById("priv_key").innerHTML;
} else {
if (this.classList.contains("fa-eye")) {
this.classList.remove("fa-eye");
this.classList.add("fa-eye-slash");
document.getElementById("priv_key_visible").innerHTML = document.getElementById("priv_key").innerHTML;
} else {
this.classList.remove("fa-eye-slash");
this.classList.add("fa-eye");
document.getElementById("priv_key_visible").innerHTML = "••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••";
}
}
@ -459,7 +459,7 @@
<div id="priv_key_visible" class="item push-right overflow-ellipsis">
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••</div>
<div class="item">
<a class="fas fa-light fa-eye-slash" onclick="(togglePrivKeyVisibility.bind(this))()"></a>
<a class="fas fa-light fa-eye" onclick="(togglePrivKeyVisibility.bind(this))()"></a>
</div>
<div class="item">
<a class="fas fa-copy" onclick="copy2clipboard(document.getElementById('priv_key').innerHTML);"></a>

View file

@ -54,8 +54,8 @@ fi
chmod 755 /etc/mesh.conf
if command -v systemctl >/dev/null; then
systemctl daemon-reload || echo -n "daemon not reloaded!"
systemctl enable mesh || echo -n "systemctl enable failed!"
systemctl restart mesh || echo -n "systemctl restart failed!"
systemctl enable fvapp-mesh || echo -n "systemctl enable failed!"
systemctl restart fvapp-mesh || echo -n "systemctl restart failed!"
fi
exit 0