Skip to content
Snippets Groups Projects
Commit 51115d70 authored by Bob Mottram's avatar Bob Mottram
Browse files

Show qrcode for syncthing within web UI

parent fb5cbadb
No related branches found
No related tags found
No related merge requests found
......@@ -260,9 +260,13 @@ function web_admin_create_add_apps {
continue
fi
# remove any qrcode images
if [ -f "$webadmin_install_dir/app_qrcode_${app_name}.png" ]; then
rm "$webadmin_install_dir/app_qrcode_${app_name}.png"
fi
if [ -f "$webadmin_install_dir/${app_name}_qrcode.png" ]; then
rm "$webadmin_install_dir/${app_name}_qrcode.png"
fi
app_name_upper=$(echo "$app_name" | awk '{print toupper($0)}')
SHORT_DESCRIPTION=
......@@ -509,7 +513,19 @@ function web_admin_create_installed_apps {
if [[ "${onion_domain_name}" == *'.'* ]]; then
sed -i "s|ONIONURL|<a href=\"app_qrcode_${app_name}.png\">http://${onion_domain_name}</a>|g" "$filename"
else
sed -i '/ONIONURL/d' "$filename"
if [[ "$app_name" == 'syncthing' ]]; then
syncthing_id=$(cat "/home/$MY_USERNAME/.syncthing-server-id")
if [ ! -f "$webadmin_install_dir/${app_name}_qrcode.png" ]; then
if [ ! -f /usr/local/bin/myqr ]; then
echo -n "$syncthing_id" | qrencode -t PNG -o "$webadmin_install_dir/${app_name}_qrcode.png"
else
myqr "syncthing_id" -p /root/freedombone/img/onion.png -c -n "$webadmin_install_dir/${app_name}_qrcode.png"
fi
fi
sed -i "s|ONIONURL|<a href=\"${app_name}_qrcode.png\">${syncthing_id}</a>|g" "$filename"
else
sed -i '/ONIONURL/d' "$filename"
fi
fi
if [[ "$ONION_ONLY" != 'no' ]]; then
sed -i '/APPURL/d' "$filename"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment