mirror of
https://github.com/dockur/windows.git
synced 2026-01-22 02:43:06 +00:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
009c2c7deb | ||
|
|
06434c02f4 | ||
|
|
32b92cc03a | ||
|
|
d799079040 | ||
|
|
b57d34e11e | ||
|
|
61d7e0d3be | ||
|
|
e6d7495bac | ||
|
|
faa7c58366 | ||
|
|
c0f5cca574 | ||
|
|
d86731dc24 | ||
|
|
bca8cb6817 | ||
|
|
d9c7983bb5 | ||
|
|
28f6e9c76b | ||
|
|
1081855571 | ||
|
|
57193b0f59 | ||
|
|
6825b6a45a | ||
|
|
c82725ec61 | ||
|
|
1f0cdc9bd1 | ||
|
|
9654a945fb | ||
|
|
a4fdfbdf91 | ||
|
|
b84a2b60a9 | ||
|
|
a5b4d7760d |
@@ -1,7 +1,7 @@
|
|||||||
ARG VERSION_ARG="latest"
|
ARG VERSION_ARG="latest"
|
||||||
FROM scratch AS build-amd64
|
FROM scratch AS build-amd64
|
||||||
|
|
||||||
COPY --from=qemux/qemu-docker:6.08 / /
|
COPY --from=qemux/qemu-docker:6.17 / /
|
||||||
|
|
||||||
ARG DEBCONF_NOWARNINGS="yes"
|
ARG DEBCONF_NOWARNINGS="yes"
|
||||||
ARG DEBIAN_FRONTEND="noninteractive"
|
ARG DEBIAN_FRONTEND="noninteractive"
|
||||||
@@ -29,8 +29,7 @@ RUN set -eu && \
|
|||||||
COPY --chmod=755 ./src /run/
|
COPY --chmod=755 ./src /run/
|
||||||
COPY --chmod=755 ./assets /run/assets
|
COPY --chmod=755 ./assets /run/assets
|
||||||
|
|
||||||
ADD --chmod=755 https://raw.githubusercontent.com/christgau/wsdd/v0.8/src/wsdd.py /usr/sbin/wsdd
|
ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.44-0/virtio-win-1.9.44.tar.xz /drivers.txz
|
||||||
ADD --chmod=664 https://github.com/qemus/virtiso-whql/releases/download/v1.9.43-0/virtio-win-1.9.43.tar.xz /drivers.txz
|
|
||||||
|
|
||||||
FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64
|
FROM dockurr/windows-arm:${VERSION_ARG} AS build-arm64
|
||||||
FROM build-${TARGETARCH}
|
FROM build-${TARGETARCH}
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ services:
|
|||||||
VERSION: "11"
|
VERSION: "11"
|
||||||
devices:
|
devices:
|
||||||
- /dev/kvm
|
- /dev/kvm
|
||||||
|
- /dev/net/tun
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
ports:
|
ports:
|
||||||
- 8006:8006
|
- 8006:8006
|
||||||
- 3389:3389/tcp
|
- 3389:3389/tcp
|
||||||
- 3389:3389/udp
|
- 3389:3389/udp
|
||||||
|
restart: always
|
||||||
stop_grace_period: 2m
|
stop_grace_period: 2m
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: windows-pvc
|
name: windows-pvc
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 64Gi
|
storage: 64Gi
|
||||||
@@ -16,59 +17,61 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
name: windows
|
name: windows
|
||||||
spec:
|
spec:
|
||||||
terminationGracePeriodSeconds: 120 # the Kubernetes default is 30 seconds and it may be not enough
|
|
||||||
containers:
|
containers:
|
||||||
- name: windows
|
- name: windows
|
||||||
image: dockurr/windows
|
image: dockurr/windows
|
||||||
ports:
|
env:
|
||||||
- containerPort: 8006
|
- name: VERSION
|
||||||
protocol: TCP
|
value: "11"
|
||||||
- containerPort: 3389
|
- name: RAM_SIZE
|
||||||
protocol: TCP
|
value: "4G"
|
||||||
- containerPort: 3389
|
- name: CPU_CORES
|
||||||
protocol: UDP
|
value: "2"
|
||||||
securityContext:
|
- name: DISK_SIZE
|
||||||
privileged: true
|
value: "64G"
|
||||||
env:
|
ports:
|
||||||
- name: VERSION
|
- containerPort: 8006
|
||||||
value: "11"
|
- containerPort: 3389
|
||||||
- name: RAM_SIZE
|
- containerPort: 3389
|
||||||
value: "4G"
|
protocol: UDP
|
||||||
- name: CPU_CORES
|
securityContext:
|
||||||
value: "2"
|
capabilities:
|
||||||
- name: DISK_SIZE
|
add:
|
||||||
value: "64G"
|
- NET_ADMIN
|
||||||
volumeMounts:
|
privileged: true
|
||||||
- mountPath: /storage
|
volumeMounts:
|
||||||
name: storage
|
- mountPath: /storage
|
||||||
- mountPath: /dev/kvm
|
name: storage
|
||||||
name: dev-kvm
|
- mountPath: /dev/kvm
|
||||||
|
name: dev-kvm
|
||||||
|
- mountPath: /dev/net/tun
|
||||||
|
name: dev-tun
|
||||||
|
terminationGracePeriodSeconds: 120
|
||||||
volumes:
|
volumes:
|
||||||
- name: storage
|
- name: storage
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: windows-pvc
|
claimName: windows-pvc
|
||||||
- name: dev-kvm
|
- hostPath:
|
||||||
hostPath:
|
path: /dev/kvm
|
||||||
path: /dev/kvm
|
name: dev-kvm
|
||||||
|
- hostPath:
|
||||||
|
path: /dev/net/tun
|
||||||
|
type: CharDevice
|
||||||
|
name: dev-tun
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: windows
|
name: windows
|
||||||
spec:
|
spec:
|
||||||
type: NodePort
|
ports:
|
||||||
|
- name: tcp-8006
|
||||||
|
port: 8006
|
||||||
|
- name: tcp-3389
|
||||||
|
port: 3389
|
||||||
|
- name: udp-3389
|
||||||
|
port: 3389
|
||||||
|
protocol: UDP
|
||||||
selector:
|
selector:
|
||||||
name: windows
|
name: windows
|
||||||
ports:
|
type: NodePort
|
||||||
- name: tcp-8006
|
|
||||||
protocol: TCP
|
|
||||||
port: 8006
|
|
||||||
targetPort: 8006
|
|
||||||
- name: tcp-3389
|
|
||||||
protocol: TCP
|
|
||||||
port: 3389
|
|
||||||
targetPort: 3389
|
|
||||||
- name: udp-3389
|
|
||||||
protocol: UDP
|
|
||||||
port: 3389
|
|
||||||
targetPort: 3389
|
|
||||||
|
|||||||
14
readme.md
14
readme.md
@@ -37,19 +37,21 @@ services:
|
|||||||
VERSION: "11"
|
VERSION: "11"
|
||||||
devices:
|
devices:
|
||||||
- /dev/kvm
|
- /dev/kvm
|
||||||
|
- /dev/net/tun
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
ports:
|
ports:
|
||||||
- 8006:8006
|
- 8006:8006
|
||||||
- 3389:3389/tcp
|
- 3389:3389/tcp
|
||||||
- 3389:3389/udp
|
- 3389:3389/udp
|
||||||
|
restart: always
|
||||||
stop_grace_period: 2m
|
stop_grace_period: 2m
|
||||||
```
|
```
|
||||||
|
|
||||||
Via Docker CLI:
|
Via Docker CLI:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -it --rm -p 8006:8006 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows
|
docker run -it --rm -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 dockurr/windows
|
||||||
```
|
```
|
||||||
|
|
||||||
Via Kubernetes:
|
Via Kubernetes:
|
||||||
@@ -84,7 +86,7 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
|
|||||||
|
|
||||||
### How do I select the Windows version?
|
### How do I select the Windows version?
|
||||||
|
|
||||||
By default, Windows 11 will be installed. But you can add the `VERSION` environment variable to your compose file, in order to specify an alternative Windows version to be downloaded:
|
By default, Windows 11 Pro will be installed. But you can add the `VERSION` environment variable to your compose file, in order to specify an alternative Windows version to be downloaded:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
environment:
|
environment:
|
||||||
@@ -96,8 +98,8 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
|
|||||||
| **Value** | **Version** | **Size** |
|
| **Value** | **Version** | **Size** |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `11` | Windows 11 Pro | 5.4 GB |
|
| `11` | Windows 11 Pro | 5.4 GB |
|
||||||
| `11l` | Windows 11 LTSC | 4.2 GB |
|
| `11l` | Windows 11 LTSC | 4.7 GB |
|
||||||
| `11e` | Windows 11 Enterprise | 5.8 GB |
|
| `11e` | Windows 11 Enterprise | 4.0 GB |
|
||||||
||||
|
||||
|
||||||
| `10` | Windows 10 Pro | 5.7 GB |
|
| `10` | Windows 10 Pro | 5.7 GB |
|
||||||
| `10l` | Windows 10 LTSC | 4.6 GB |
|
| `10l` | Windows 10 LTSC | 4.6 GB |
|
||||||
@@ -176,7 +178,9 @@ kubectl apply -f https://raw.githubusercontent.com/dockur/windows/refs/heads/mas
|
|||||||
|
|
||||||
### How do I run a script after installation?
|
### How do I run a script after installation?
|
||||||
|
|
||||||
To run your own script after installation, you can create a file called `install.bat` and place it in a folder together with any additional files it needs (software to be installed for example). Then bind that folder in your compose file like this:
|
To run your own script after installation, you can create a file called `install.bat` and place it in a folder together with any additional files it needs (software to be installed for example).
|
||||||
|
|
||||||
|
Then bind that folder in your compose file like this:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
990
src/define.sh
990
src/define.sh
File diff suppressed because it is too large
Load Diff
@@ -76,8 +76,6 @@ startInstall() {
|
|||||||
|
|
||||||
BOOT="$STORAGE/$file"
|
BOOT="$STORAGE/$file"
|
||||||
|
|
||||||
! migrateFiles "$BOOT" "$VERSION" && error "Migration failed!" && exit 57
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
skipInstall "$BOOT" && return 1
|
skipInstall "$BOOT" && return 1
|
||||||
@@ -668,6 +666,11 @@ updateXML() {
|
|||||||
sed -z "s/<AdministratorPassword>...............<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset"
|
sed -z "s/<AdministratorPassword>...............<Value \/>/<AdministratorPassword>\n <Value>$admin<\/Value>/g" -i "$asset"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$EDITION" ]; then
|
||||||
|
[[ "${EDITION^^}" == "CORE" ]] && EDITION="STANDARDCORE"
|
||||||
|
sed -i "s/SERVERSTANDARD<\/Value>/SERVER${EDITION^^}<\/Value>/g" "$asset"
|
||||||
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -677,8 +680,13 @@ addDriver() {
|
|||||||
local path="$2"
|
local path="$2"
|
||||||
local target="$3"
|
local target="$3"
|
||||||
local driver="$4"
|
local driver="$4"
|
||||||
|
local desc=""
|
||||||
local folder=""
|
local folder=""
|
||||||
|
|
||||||
|
if [ -z "$id" ]; then
|
||||||
|
warn "no Windows version specified for \"$driver\" driver!" && return 0
|
||||||
|
fi
|
||||||
|
|
||||||
case "${id,,}" in
|
case "${id,,}" in
|
||||||
"win7x86"* ) folder="w7/x86" ;;
|
"win7x86"* ) folder="w7/x86" ;;
|
||||||
"win7x64"* ) folder="w7/amd64" ;;
|
"win7x64"* ) folder="w7/amd64" ;;
|
||||||
@@ -698,7 +706,8 @@ addDriver() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -z "$folder" ]; then
|
if [ -z "$folder" ]; then
|
||||||
warn "no \"$driver\" driver found for \"$DETECTED\" !" && return 0
|
desc=$(printVersion "$id" "$id")
|
||||||
|
warn "no \"$driver\" driver available for \"$desc\" !" && return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -d "$path/$driver/$folder" ] && return 0
|
[ ! -d "$path/$driver/$folder" ] && return 0
|
||||||
@@ -731,6 +740,11 @@ addDrivers() {
|
|||||||
local msg="Adding drivers to image..."
|
local msg="Adding drivers to image..."
|
||||||
info "$msg" && html "$msg"
|
info "$msg" && html "$msg"
|
||||||
|
|
||||||
|
if [ -z "$version" ]; then
|
||||||
|
version="win11x64"
|
||||||
|
warn "Windows version unknown, falling back to Windows 11 drivers..."
|
||||||
|
fi
|
||||||
|
|
||||||
if ! bsdtar -xf /drivers.txz -C "$drivers"; then
|
if ! bsdtar -xf /drivers.txz -C "$drivers"; then
|
||||||
error "Failed to extract drivers from archive!" && return 1
|
error "Failed to extract drivers from archive!" && return 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
35
src/mido.sh
35
src/mido.sh
@@ -4,25 +4,26 @@ set -Eeuo pipefail
|
|||||||
handle_curl_error() {
|
handle_curl_error() {
|
||||||
|
|
||||||
local error_code="$1"
|
local error_code="$1"
|
||||||
|
local server_name="$2"
|
||||||
|
|
||||||
case "$error_code" in
|
case "$error_code" in
|
||||||
1) error "Unsupported protocol!" ;;
|
1) error "Unsupported protocol!" ;;
|
||||||
2) error "Failed to initialize curl!" ;;
|
2) error "Failed to initialize curl!" ;;
|
||||||
3) error "The URL format is malformed!" ;;
|
3) error "The URL format is malformed!" ;;
|
||||||
5) error "Failed to resolve address of proxy host!" ;;
|
5) error "Failed to resolve address of proxy host!" ;;
|
||||||
6) error "Failed to resolve Microsoft servers! Is there an Internet connection?" ;;
|
6) error "Failed to resolve $server_name servers! Is there an Internet connection?" ;;
|
||||||
7) error "Failed to contact Microsoft servers! Is there an Internet connection or is the server down?" ;;
|
7) error "Failed to contact $server_name servers! Is there an Internet connection or is the server down?" ;;
|
||||||
8) error "Microsoft servers returned a malformed HTTP response!" ;;
|
8) error "$server_name servers returned a malformed HTTP response!" ;;
|
||||||
16) error "A problem was detected in the HTTP2 framing layer!" ;;
|
16) error "A problem was detected in the HTTP2 framing layer!" ;;
|
||||||
22) error "Microsoft servers returned a failing HTTP status code!" ;;
|
22) error "$server_name servers returned a failing HTTP status code!" ;;
|
||||||
23) error "Failed at writing Windows media to disk! Out of disk space or permission error?" ;;
|
23) error "Failed at writing Windows media to disk! Out of disk space or permission error?" ;;
|
||||||
26) error "Failed to read Windows media from disk!" ;;
|
26) error "Failed to read Windows media from disk!" ;;
|
||||||
27) error "Ran out of memory during download!" ;;
|
27) error "Ran out of memory during download!" ;;
|
||||||
28) error "Connection timed out to Microsoft server!" ;;
|
28) error "Connection timed out to $server_name server!" ;;
|
||||||
35) error "SSL connection error from Microsoft server!" ;;
|
35) error "SSL connection error from $server_name server!" ;;
|
||||||
36) error "Failed to continue earlier download!" ;;
|
36) error "Failed to continue earlier download!" ;;
|
||||||
52) error "Received no data from the Microsoft server!" ;;
|
52) error "Received no data from the $server_name server!" ;;
|
||||||
63) error "Microsoft servers returned an unexpectedly large response!" ;;
|
63) error "$server_name servers returned an unexpectedly large response!" ;;
|
||||||
# POSIX defines exit statuses 1-125 as usable by us
|
# POSIX defines exit statuses 1-125 as usable by us
|
||||||
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02
|
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02
|
||||||
$((error_code <= 125)))
|
$((error_code <= 125)))
|
||||||
@@ -100,7 +101,7 @@ download_windows() {
|
|||||||
# Remove "Accept" header that curl sends by default
|
# Remove "Accept" header that curl sends by default
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
|
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
|
||||||
download_page_html=$(curl --silent --max-time 30 --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
|
download_page_html=$(curl --silent --max-time 30 --user-agent "$user_agent" --header "Accept:" --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
|
||||||
handle_curl_error $?
|
handle_curl_error "$?" "Microsoft"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,14 +118,14 @@ download_windows() {
|
|||||||
# Permit Session ID
|
# Permit Session ID
|
||||||
curl --silent --max-time 30 --output /dev/null --user-agent "$user_agent" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=$session_id" || {
|
curl --silent --max-time 30 --output /dev/null --user-agent "$user_agent" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=$session_id" || {
|
||||||
# This should only happen if there's been some change to how this API works
|
# This should only happen if there's been some change to how this API works
|
||||||
handle_curl_error $?
|
handle_curl_error "$?" "Microsoft"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && echo -n "Getting language SKU ID: "
|
[[ "$DEBUG" == [Yy1]* ]] && echo -n "Getting language SKU ID: "
|
||||||
sku_url="https://www.microsoft.com/software-download-connector/api/getskuinformationbyproductedition?profile=$profile&ProductEditionId=$product_edition_id&SKU=undefined&friendlyFileName=undefined&Locale=en-US&sessionID=$session_id"
|
sku_url="https://www.microsoft.com/software-download-connector/api/getskuinformationbyproductedition?profile=$profile&ProductEditionId=$product_edition_id&SKU=undefined&friendlyFileName=undefined&Locale=en-US&sessionID=$session_id"
|
||||||
language_skuid_json=$(curl --silent --max-time 30 --request GET --user-agent "$user_agent" --referer "$url" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "$sku_url") || {
|
language_skuid_json=$(curl --silent --max-time 30 --request GET --user-agent "$user_agent" --referer "$url" --header "Accept:" --max-filesize 100K --fail --proto =https --tlsv1.2 --http1.1 -- "$sku_url") || {
|
||||||
handle_curl_error $?
|
handle_curl_error "$?" "Microsoft"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +230,7 @@ download_windows_eval() {
|
|||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
|
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
|
||||||
iso_download_page_html=$(curl --silent --max-time 30 --user-agent "$user_agent" --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
|
iso_download_page_html=$(curl --silent --max-time 30 --user-agent "$user_agent" --location --max-filesize 1M --fail --proto =https --tlsv1.2 --http1.1 -- "$url") || {
|
||||||
handle_curl_error $?
|
handle_curl_error "$?" "Microsoft"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,10 +242,10 @@ download_windows_eval() {
|
|||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && echo "Getting download link.."
|
[[ "$DEBUG" == [Yy1]* ]] && echo "Getting download link.."
|
||||||
|
|
||||||
if [[ "$enterprise_type" == "iot" ]]; then
|
filter="https://go.microsoft.com/fwlink/?linkid=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country,,}"
|
||||||
filter="https://go.microsoft.com/fwlink/?linkid=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country^^}"
|
|
||||||
else
|
if ! echo "$iso_download_page_html" | grep -io "$filter" > /dev/null; then
|
||||||
filter="https://go.microsoft.com/fwlink/p/?LinkID=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country^^}"
|
filter="https://go.microsoft.com/fwlink/p/?linkid=[0-9]\+&clcid=0x[0-9a-z]\+&culture=${culture,,}&country=${country,,}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
iso_download_links=$(echo "$iso_download_page_html" | grep -io "$filter") || {
|
iso_download_links=$(echo "$iso_download_page_html" | grep -io "$filter") || {
|
||||||
@@ -287,7 +288,7 @@ download_windows_eval() {
|
|||||||
|
|
||||||
iso_download_link=$(curl --silent --max-time 30 --user-agent "$user_agent" --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link") || {
|
iso_download_link=$(curl --silent --max-time 30 --user-agent "$user_agent" --location --output /dev/null --silent --write-out "%{url_effective}" --head --fail --proto =https --tlsv1.2 --http1.1 -- "$iso_download_link") || {
|
||||||
# This should only happen if the Microsoft servers are down
|
# This should only happen if the Microsoft servers are down
|
||||||
handle_curl_error $?
|
handle_curl_error "$?" "Microsoft"
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
src/samba.sh
10
src/samba.sh
@@ -71,6 +71,9 @@ addShare() {
|
|||||||
echo " guest account = nobody"
|
echo " guest account = nobody"
|
||||||
echo " map to guest = Bad User"
|
echo " map to guest = Bad User"
|
||||||
echo " server min protocol = NT1"
|
echo " server min protocol = NT1"
|
||||||
|
echo " follow symlinks = yes"
|
||||||
|
echo " wide links = yes"
|
||||||
|
echo " unix extensions = no"
|
||||||
echo ""
|
echo ""
|
||||||
echo " # disable printing services"
|
echo " # disable printing services"
|
||||||
echo " load printers = no"
|
echo " load printers = no"
|
||||||
@@ -89,6 +92,13 @@ addShare "$share" "Data" "Shared" || error "Failed to create shared folder!"
|
|||||||
[ -d "/data2" ] && addShare "/data2" "Data2" "Shared"
|
[ -d "/data2" ] && addShare "/data2" "Data2" "Shared"
|
||||||
[ -d "/data3" ] && addShare "/data3" "Data3" "Shared"
|
[ -d "/data3" ] && addShare "/data3" "Data3" "Shared"
|
||||||
|
|
||||||
|
IFS=',' read -r -a dirs <<< "${SHARES:-}"
|
||||||
|
for dir in "${dirs[@]}"; do
|
||||||
|
[ ! -d "$dir" ] && continue
|
||||||
|
dir_name=$(basename "$dir")
|
||||||
|
addShare "$dir" "$dir_name" "Shared $dir_name" || error "Failed to create shared folder for $dir!"
|
||||||
|
done
|
||||||
|
|
||||||
if ! smbd; then
|
if ! smbd; then
|
||||||
error "Samba daemon failed to start!"
|
error "Samba daemon failed to start!"
|
||||||
smbd -i --debug-stdout || true
|
smbd -i --debug-stdout || true
|
||||||
|
|||||||
Reference in New Issue
Block a user