Merge branch 'master' of github.com:wikihost-opensource/als

This commit is contained in:
samlm
2022-09-24 16:23:17 +08:00
4 changed files with 16 additions and 5 deletions

View File

@@ -8,8 +8,7 @@ RUN npm i && \
FROM alpine:3.16
LABEL maintainer="samlm0 <update@ifdream.net>"
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk add --no-cache php81 php81-pecl-maxminddb php81-ctype php81-pecl-swoole nginx xz \
RUN apk add --no-cache php81 php81-pecl-maxminddb php81-ctype php81-pecl-swoole nginx xz \
iperf iperf3 \
mtr \
traceroute \
@@ -18,4 +17,4 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/re
ADD backend/app /app
COPY --from=0 /app/dist /app/webspaces
CMD php81 /app/app.php
CMD php81 /app/app.php

View File

@@ -7,6 +7,8 @@
docker run -d --name looking-glass --restart always --network host wikihostinc/looking-glass-server
```
[DEMO](http://lg.hk1-bgp.hkg.50network.com/)
## Host Requirements
- Can run docker (yes, only docker is required)
@@ -44,4 +46,4 @@ https://github.com/librespeed/speedtest
Code is licensed under MIT Public License.
* If you wish to support my efforts, keep the "Powered by LookingGlass" link intact.
* If you wish to support my efforts, keep the "Powered by LookingGlass" link intact.

View File

@@ -15,8 +15,13 @@ class Websocket
public function __construct($request, $response, $fd)
{
global $config;
$localConfig = $config;
$this->request = $request;
$this->clientIp = $this->request->header['x-real-ip'];
$localConfig['client_ip'] = $this->clientIp;
$this->response = $response;
$this->fd = $fd;
$this->sendChannel = new \Swoole\Coroutine\Channel(100);
@@ -29,7 +34,7 @@ class Websocket
}
});
$this->send('1000|' . json_encode($config));
$this->send('1000|' . json_encode($localConfig));
}
/**

View File

@@ -11,6 +11,9 @@
<div v-show="publicIpv6">
公网 IPv6 地址: <n-tag> [{{ publicIpv6 }}]</n-tag>
</div>
<div v-show="clientIp">
您当前的 IP 地址: <n-tag>{{ clientIp }}</n-tag>
</div>
</n-space>
<!-- <n-progress type=" line" :percentage="100" :show-indicator="false" processing /> -->
</n-card>
@@ -28,6 +31,7 @@ export default defineComponent({
data() {
return {
location: false,
clientIp: false,
publicIpv4: false,
publicIpv6: false,
}
@@ -39,6 +43,7 @@ export default defineComponent({
let data = JSON.parse(e[1])
this.wsMessage.splice(i, 1)
this.location = data.location
this.clientIp = data.client_ip
this.publicIpv4 = data.public_ipv4
this.publicIpv6 = data.public_ipv6
this.componentConfig.public_ipv4 = data.public_ipv4