mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-07 18:43:41 +08:00
Compare commits
5 Commits
e362c9a8a9
...
2c6efc45f2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c6efc45f2 | ||
|
|
24d795fbe3 | ||
|
|
7fae62d286 | ||
|
|
2135df07ea | ||
|
|
521beedf1c |
@@ -28,6 +28,7 @@ RUN set -eu && \
|
|||||||
unzip \
|
unzip \
|
||||||
nginx \
|
nginx \
|
||||||
procps \
|
procps \
|
||||||
|
ethtool \
|
||||||
python3 \
|
python3 \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
python3-msgpack \
|
python3-msgpack \
|
||||||
@@ -57,7 +58,7 @@ RUN set -eu && \
|
|||||||
COPY --chmod=755 ./src /run/
|
COPY --chmod=755 ./src /run/
|
||||||
COPY --chmod=755 ./web /var/www/
|
COPY --chmod=755 ./web /var/www/
|
||||||
COPY --chmod=755 --from=builder /qemu-host.bin /run/host.bin
|
COPY --chmod=755 --from=builder /qemu-host.bin /run/host.bin
|
||||||
COPY --chmod=744 ./web/conf/nginx.conf /etc/nginx/sites-enabled/web.conf
|
COPY --chmod=744 ./web/conf/nginx.conf /etc/nginx/default.conf
|
||||||
ADD --chmod=775 https://raw.githubusercontent.com/sud0woodo/patology/refs/heads/main/patology.py /run/extract.py
|
ADD --chmod=775 https://raw.githubusercontent.com/sud0woodo/patology/refs/heads/main/patology.py /run/extract.py
|
||||||
|
|
||||||
VOLUME /storage
|
VOLUME /storage
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ configureDHCP() {
|
|||||||
|
|
||||||
while ! ip link set "$VM_NET_TAP" up; do
|
while ! ip link set "$VM_NET_TAP" up; do
|
||||||
info "Waiting for MAC address $VM_NET_MAC to become available..."
|
info "Waiting for MAC address $VM_NET_MAC to become available..."
|
||||||
|
info "If you cloned this machine, please delete the 'dsm.mac' file to generate a different MAC address."
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -172,7 +173,7 @@ getUserPorts() {
|
|||||||
|
|
||||||
getHostPorts() {
|
getHostPorts() {
|
||||||
|
|
||||||
local list=$1
|
local list="$1"
|
||||||
|
|
||||||
[ -z "$list" ] && echo "" && return 0
|
[ -z "$list" ] && echo "" && return 0
|
||||||
|
|
||||||
@@ -392,6 +393,13 @@ getInfo() {
|
|||||||
error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 26
|
error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 26
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
NIC=$(ethtool -i "$VM_NET_DEV" | grep -m 1 -i 'driver:' | awk '{print $(2)}')
|
||||||
|
|
||||||
|
if [[ "${NIC,,}" != "veth" ]]; then
|
||||||
|
[[ "$DEBUG" == [Yy1]* ]] && info "Detected NIC: $NIC"
|
||||||
|
error "This container does not support host mode networking!" && exit 29
|
||||||
|
fi
|
||||||
|
|
||||||
BASE_IP="${VM_NET_IP%.*}."
|
BASE_IP="${VM_NET_IP%.*}."
|
||||||
|
|
||||||
if [ "${VM_NET_IP/$BASE_IP/}" -lt "3" ]; then
|
if [ "${VM_NET_IP/$BASE_IP/}" -lt "3" ]; then
|
||||||
@@ -526,7 +534,7 @@ else
|
|||||||
msg="podman detected, $msg"
|
msg="podman detected, $msg"
|
||||||
fi
|
fi
|
||||||
warn "$msg"
|
warn "$msg"
|
||||||
[ -z "$USER_PORTS" ] && info "Notice: port mapping will not work without \"USER_PORTS\" now."
|
[ -z "$USER_PORTS" ] && info "Notice: when you want to expose ports in this mode, map them using this variable: \"USER_PORTS=5000,5001\"."
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
15
src/reset.sh
15
src/reset.sh
@@ -202,19 +202,22 @@ addPackage() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
: "${WEB_PORT:="5000"}" # Webserver port
|
||||||
|
|
||||||
cp -r /var/www/* /run/shm
|
cp -r /var/www/* /run/shm
|
||||||
html "Starting $APP for Docker..."
|
html "Starting $APP for Docker..."
|
||||||
|
|
||||||
if [[ "${WEB:-}" != [Nn]* ]]; then
|
if [[ "${WEB:-}" != [Nn]* ]]; then
|
||||||
|
|
||||||
|
mkdir -p /etc/nginx/sites-enabled
|
||||||
|
cp /etc/nginx/default.conf /etc/nginx/sites-enabled/web.conf
|
||||||
|
|
||||||
|
sed -i "s/listen 5000 default_server;/listen $WEB_PORT default_server;/g" /etc/nginx/sites-enabled/web.conf
|
||||||
|
|
||||||
# shellcheck disable=SC2143
|
# shellcheck disable=SC2143
|
||||||
if [ -f /proc/net/if_inet6 ] && [ -n "$(ifconfig -a | grep inet6)" ]; then
|
if [ -f /proc/net/if_inet6 ] && [ -n "$(ifconfig -a | grep inet6)" ]; then
|
||||||
|
|
||||||
sed -i "s/listen 5000 default_server;/listen [::]:5000 default_server ipv6only=off;/g" /etc/nginx/sites-enabled/web.conf
|
sed -i "s/listen $WEB_PORT default_server;/listen [::]:$WEB_PORT default_server ipv6only=off;/g" /etc/nginx/sites-enabled/web.conf
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
sed -i "s/listen [::]:5000 default_server ipv6only=off;/listen 5000 default_server;/g" /etc/nginx/sites-enabled/web.conf
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user