This commit is contained in:
hand7s 2024-12-03 23:15:04 +01:00 committed by GitHub
commit 90f3081388
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 14 deletions

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env sh
# Start fail2ban # Start fail2ban
fail2ban-client -x start fail2ban-client -x start

View file

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env sh
case $1 in case $1 in
amd64) amd64)
ARCH="64" ARCH="64"

View file

@ -1,15 +1,15 @@
# ======================================================== # ========================================================
# Stage: Builder # Stage: Builder
# ======================================================== # ========================================================
FROM golang:1.23-alpine AS builder FROM golang:1.23-bookworm AS builder
WORKDIR /app WORKDIR /app
ARG TARGETARCH ARG TARGETARCH
RUN apk --no-cache --update add \ RUN apt-get update -y
build-base \ RUN apt-get install -y \
gcc \ gcc \
wget \ wget \
unzip unzip
COPY . . COPY . .
@ -21,12 +21,12 @@ RUN ./DockerInit.sh "$TARGETARCH"
# ======================================================== # ========================================================
# Stage: Final Image of 3x-ui # Stage: Final Image of 3x-ui
# ======================================================== # ========================================================
FROM alpine FROM ubuntu:rolling
ENV TZ=Asia/Tehran ENV TZ=Asia/Tehran
WORKDIR /app WORKDIR /app
RUN apk add --no-cache --update \ RUN apt-get update -y
ca-certificates \ RUN apt-get install -y \
tzdata \ tzdata \
fail2ban \ fail2ban \
bash bash
@ -37,7 +37,7 @@ COPY --from=builder /app/x-ui.sh /usr/bin/x-ui
# Configure fail2ban # Configure fail2ban
RUN rm -f /etc/fail2ban/jail.d/alpine-ssh.conf \ RUN rm -f /etc/fail2ban/jail.d/*.conf \
&& cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local \ && cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local \
&& sed -i "s/^\[ssh\]$/&\nenabled = false/" /etc/fail2ban/jail.local \ && sed -i "s/^\[ssh\]$/&\nenabled = false/" /etc/fail2ban/jail.local \
&& sed -i "s/^\[sshd\]$/&\nenabled = false/" /etc/fail2ban/jail.local \ && sed -i "s/^\[sshd\]$/&\nenabled = false/" /etc/fail2ban/jail.local \

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
red='\033[0;31m' red='\033[0;31m'
green='\033[0;32m' green='\033[0;32m'

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
red='\033[0;31m' red='\033[0;31m'
green='\033[0;32m' green='\033[0;32m'