Try it on the clientside instead
parent
17b8720e91
commit
e91f2bf45e
|
@ -6,7 +6,7 @@ ENV ADMIN_EMAIL='me@example.com'
|
||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
RUN apt-get update && apt-get install --yes \
|
RUN apt-get update && apt-get install --yes \
|
||||||
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq qrencode \
|
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Create dirs and temp files
|
# Create dirs and temp files
|
||||||
|
|
|
@ -6,7 +6,7 @@ ENV ADMIN_EMAIL='me@example.com'
|
||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
RUN apt-get update && apt-get install --yes \
|
RUN apt-get update && apt-get install --yes \
|
||||||
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq qrencode \
|
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Create dirs and temp files
|
# Create dirs and temp files
|
||||||
|
|
|
@ -159,5 +159,4 @@ while IFS=$'\t' read -r server_hostname server_ipv4 server_ipv6 server_pubkey se
|
||||||
fi
|
fi
|
||||||
done <"${SERVERS_FILE}"
|
done <"${SERVERS_FILE}"
|
||||||
wg_config="[Interface] # ${hostname}.${username}.${TLD}\nPrivateKey=${privkey:?}\nAddress=${address:?}\n${WG_DNS}\n${server_blocks:?}"
|
wg_config="[Interface] # ${hostname}.${username}.${TLD}\nPrivateKey=${privkey:?}\nAddress=${address:?}\n${WG_DNS}\n${server_blocks:?}"
|
||||||
qr_code="$(qrencode -t ansiutf8 <<<"${wg_config}")"
|
<<<"${wg_config}" "${LIB_DIR}/http_res" 202
|
||||||
printf '%s\n\n%s\n' "${wg_config}" "${qr_code}" | "${LIB_DIR}/http_res" 202
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
FROM httpd:2.4
|
FROM httpd:2.4
|
||||||
COPY admin.html /usr/local/apache2/htdocs/index.html
|
COPY admin.html /usr/local/apache2/htdocs/index.html
|
||||||
COPY admin.js knockout.min.js /usr/local/apache2/htdocs/
|
COPY admin.js knockout.min.js qrcode.min.js /usr/local/apache2/htdocs/
|
|
@ -49,8 +49,10 @@
|
||||||
|
|
||||||
<br><hr>
|
<br><hr>
|
||||||
<pre data-bind="text:newConfigText"></pre>
|
<pre data-bind="text:newConfigText"></pre>
|
||||||
|
<div id="qrcode"></div>
|
||||||
|
|
||||||
<script src="/knockout.min.js" integrity="sha512-vs7+jbztHoMto5Yd/yinM4/y2DOkPLt0fATcN+j+G4ANY2z4faIzZIOMkpBmWdcxt+596FemCh9M18NUJTZwvw=="></script>
|
<script src="/knockout.min.js" integrity="sha512-vs7+jbztHoMto5Yd/yinM4/y2DOkPLt0fATcN+j+G4ANY2z4faIzZIOMkpBmWdcxt+596FemCh9M18NUJTZwvw=="></script>
|
||||||
|
<script src="/qrcode.min.js" integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA=="></script>
|
||||||
<script src="/admin.js"></script>
|
<script src="/admin.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -107,6 +107,7 @@ function PeerList() {
|
||||||
cantDelete: true,
|
cantDelete: true,
|
||||||
}))
|
}))
|
||||||
self.newConfigText(parsedRes)
|
self.newConfigText(parsedRes)
|
||||||
|
new QRCode(document.getElementById('qrcode'),parsedRes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,6 +185,7 @@ function PeerList() {
|
||||||
cantDelete: true,
|
cantDelete: true,
|
||||||
}))
|
}))
|
||||||
self.newConfigText(parsedRes)
|
self.newConfigText(parsedRes)
|
||||||
|
new QRCode(document.getElementById('qrcode'),parsedRes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
FROM httpd:2.4
|
FROM httpd:2.4
|
||||||
COPY dashboard.html /usr/local/apache2/htdocs/index.html
|
COPY dashboard.html /usr/local/apache2/htdocs/index.html
|
||||||
COPY dashboard.js knockout.min.js /usr/local/apache2/htdocs/
|
COPY dashboard.js knockout.min.js qrcode.min.js /usr/local/apache2/htdocs/
|
|
@ -28,9 +28,11 @@
|
||||||
<p>After clicking "Add", the new peer's config will appear below. Copy and paste it into your wireguard client and start the service. <b>This configuration will not be shown again!</b>If you lose the config, you will need to delete the peer and recreate it. </p>
|
<p>After clicking "Add", the new peer's config will appear below. Copy and paste it into your wireguard client and start the service. <b>This configuration will not be shown again!</b>If you lose the config, you will need to delete the peer and recreate it. </p>
|
||||||
<hr>
|
<hr>
|
||||||
<pre data-bind="text:newConfigText"></pre>
|
<pre data-bind="text:newConfigText"></pre>
|
||||||
|
<div id="qrcode"></div>
|
||||||
|
|
||||||
<script src="/knockout.min.js" integrity="sha512-vs7+jbztHoMto5Yd/yinM4/y2DOkPLt0fATcN+j+G4ANY2z4faIzZIOMkpBmWdcxt+596FemCh9M18NUJTZwvw==
|
<script src="/knockout.min.js" integrity="sha512-vs7+jbztHoMto5Yd/yinM4/y2DOkPLt0fATcN+j+G4ANY2z4faIzZIOMkpBmWdcxt+596FemCh9M18NUJTZwvw==
|
||||||
"></script>
|
"></script>
|
||||||
|
<script src="/qrcode.min.js" integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA=="></script>
|
||||||
<script src="/dashboard.js"></script>
|
<script src="/dashboard.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -86,6 +86,7 @@ function PeerList() {
|
||||||
cantDelete: true,
|
cantDelete: true,
|
||||||
}))
|
}))
|
||||||
self.newConfigText(parsedRes)
|
self.newConfigText(parsedRes)
|
||||||
|
new QRCode(document.getElementById('qrcode'),parsedRes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue