Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Eggdrop 1.10.0 Stable release #18186

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

vanosg
Copy link
Contributor

@vanosg vanosg commented Jan 5, 2025

Also update develop to use Tcl9

Update develop to use Tcl9
@vanosg vanosg requested a review from a team as a code owner January 5, 2025 16:43
Copy link

github-actions bot commented Jan 5, 2025

Diff for 91ab7ba:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 286663e..c161518 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,17 +1,17 @@
 Maintainers: Geo Van O <[email protected]> (@vanosg)
 GitRepo: https://github.com/eggheads/eggdrop-docker.git
 
-Tags: 1.9, 1.9.5, stable, latest
+Tags: 1.9, 1.9.5
 Architectures: amd64, arm32v6, arm64v8
 GitCommit: 57fb1652a1880665b12e9f51775f173ecde24285
 Directory: 1.9
 
-Tags: 1.10.0rc1
+Tags: 1.10, 1.10.0, stable, latest
 Architectures: amd64, arm32v6, arm64v8
-GitCommit: e685e40a5bb54f0f6fd78193cef31429faa29a61
+GitCommit: 2861815d67478e41667b8ed2cf9d3f13a5e755c1
 Directory: 1.10
 
 Tags: develop
 Architectures: amd64, arm32v6, arm64v8
-GitCommit: e685e40a5bb54f0f6fd78193cef31429faa29a61
+GitCommit: 2861815d67478e41667b8ed2cf9d3f13a5e755c1
 Directory: develop
diff --git a/_bashbrew-list b/_bashbrew-list
index 7c099f2..bd3ecf8 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -1,6 +1,7 @@
 eggdrop:1.9
 eggdrop:1.9.5
-eggdrop:1.10.0rc1
+eggdrop:1.10
+eggdrop:1.10.0
 eggdrop:develop
 eggdrop:latest
 eggdrop:stable
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index c3d3311..52e3922 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -1,3 +1,3 @@
-eggdrop:1.10.0rc1
+eggdrop:1.9.5
 eggdrop:develop
 eggdrop:latest
diff --git a/eggdrop_1.10.0rc1/Dockerfile b/eggdrop_1.10.0rc1/Dockerfile
deleted file mode 100644
index 1fbeba3..0000000
diff --git a/eggdrop_1.10.0rc1/docker.tcl b/eggdrop_1.10.0rc1/docker.tcl
deleted file mode 100644
index f9b6a07..0000000
diff --git a/eggdrop_1.10.0rc1/entrypoint.sh b/eggdrop_1.10.0rc1/entrypoint.sh
deleted file mode 100755
index 1f924fd..0000000
diff --git a/eggdrop_latest/Dockerfile b/eggdrop_1.9.5/Dockerfile
similarity index 100%
copy from eggdrop_latest/Dockerfile
copy to eggdrop_1.9.5/Dockerfile
diff --git a/eggdrop_latest/docker.tcl b/eggdrop_1.9.5/docker.tcl
similarity index 100%
copy from eggdrop_latest/docker.tcl
copy to eggdrop_1.9.5/docker.tcl
diff --git a/eggdrop_latest/entrypoint.sh b/eggdrop_1.9.5/entrypoint.sh
similarity index 100%
copy from eggdrop_latest/entrypoint.sh
copy to eggdrop_1.9.5/entrypoint.sh
diff --git a/eggdrop_develop/Dockerfile b/eggdrop_develop/Dockerfile
index ec9eb3f..90cc5ad 100644
--- a/eggdrop_develop/Dockerfile
+++ b/eggdrop_develop/Dockerfile
@@ -8,22 +8,20 @@ RUN addgroup -S -g 3333 eggdrop \
 # grab su-exec for easy step-down from root
 RUN apk add --no-cache 'su-exec>=0.2' bash openssl
 
-ENV EGGDROP_SHA256=d185512ad282aeee49a75328e847f604c762e94be19fb1e01a7e8a4f927730b8
-ENV EGGDROP_COMMIT=f80f8ae468fd7bcec83407134ef5941225131104
+ENV EGGDROP_SHA256=34c09905c2e9df1e8ca4bae5bc395a8c60f4ca93123599788bae5164ebd8f8f5
+ENV EGGDROP_COMMIT=0f5599e1fafa97454dc7a8b147c6076638e95ba8
 
-RUN apk add --no-cache --virtual egg-deps wget ca-certificates make tar gnupg build-base openssl-dev \
-  && wget "https://prdownloads.sourceforge.net/tcl/tcl8.6.13-src.tar.gz" -O tcl8.6.13-src.tar.gz --progress=dot:giga \
-  && tar -zxf tcl8.6.13-src.tar.gz \
-  && ( cd tcl8.6.13 \
-# Fix Tcl UTF Emoji support
-    && sed -i "/define TCL_UTF_MAX/c\#define TCL_UTF_MAX 6" generic/tcl.h \
+RUN apk add --no-cache --virtual egg-deps wget ca-certificates make tar gnupg build-base openssl-dev bsd-compat-headers zlib-dev \
+  && wget "https://prdownloads.sourceforge.net/tcl/tcl9.0.1-src.tar.gz" -O tcl9.0.1-src.tar.gz --progress=dot:giga \
+  && tar -zxf tcl9.0.1-src.tar.gz \
+  && ( cd tcl9.0.1 \
     && cd unix \
     && ./configure \
     && nproc="$(nproc)" \
     && make -j"$nproc" \
     && make install ) \
-  && rm -rf tcl8.6.13-src.tar.gz \
-  && rm -rf tcl8.6.13 \
+  && rm -rf tcl9.0.1-src.tar.gz \
+  && rm -rf tcl9.0.1 \
   && wget "https://github.com/eggheads/eggdrop/archive/$EGGDROP_COMMIT.tar.gz" -O develop.tar.gz \
   && echo "$EGGDROP_SHA256 *develop.tar.gz" | sha256sum -c - \
   && tar -zxf develop.tar.gz \
diff --git a/eggdrop_latest/Dockerfile b/eggdrop_latest/Dockerfile
index 7063a8e..498692b 100644
--- a/eggdrop_latest/Dockerfile
+++ b/eggdrop_latest/Dockerfile
@@ -1,54 +1,56 @@
-FROM alpine:3.19
-MAINTAINER Geo Van O <[email protected]>
+FROM alpine:3.20
+LABEL org.opencontainers.image.authors="Geo Van O <[email protected]>" \
+      org.opencontainers.image.url="https://www.eggheads.org"
 
-RUN adduser -S eggdrop
+RUN addgroup -S -g 3333 eggdrop \
+    && adduser -S -u 3333 eggdrop eggdrop
 
 # grab su-exec for easy step-down from root
-RUN apk add --no-cache 'su-exec>=0.2'
+RUN apk add --no-cache 'su-exec>=0.2' bash openssl
 
-RUN apk add --no-cache tcl bash openssl
 RUN apk add --no-cache --virtual egg-deps wget ca-certificates make tar gnupg build-base openssl-dev \
-  && wget "https://prdownloads.sourceforge.net/tcl/tcl8.6.12-src.tar.gz" -O tcl8.6.12-src.tar.gz \
-  && tar -zxf tcl8.6.12-src.tar.gz \
-  && ( cd tcl8.6.12 \
+  && wget "https://prdownloads.sourceforge.net/tcl/tcl8.6.13-src.tar.gz" -O tcl8.6.13-src.tar.gz --progress=dot:giga \
+  && tar -zxf tcl8.6.13-src.tar.gz \
+  && ( cd tcl8.6.13 \
 # Fix Tcl UTF Emoji support
     && sed -i "/define TCL_UTF_MAX/c\#define TCL_UTF_MAX 6" generic/tcl.h \
     && cd unix \
     && ./configure \
-    && make \
+    && nproc="$(nproc)" \
+    && make -j"$nproc" \
     && make install ) \
-  && rm tcl8.6.12-src.tar.gz \
-  && rm -rf tcl8.6.12 \
-  && wget ftp://ftp.eggheads.org/pub/eggdrop/source/1.9/eggdrop-1.9.5.tar.gz \
-  && wget ftp://ftp.eggheads.org/pub/eggdrop/source/1.9/eggdrop-1.9.5.tar.gz.asc \
+  && rm -rf tcl8.6.13-src.tar.gz \
+  && rm -rf tcl8.6.13 \
+  && wget ftp://ftp.eggheads.org/pub/eggdrop/source/1.10/eggdrop-1.10.0.tar.gz \
+  && wget ftp://ftp.eggheads.org/pub/eggdrop/source/1.10/eggdrop-1.10.0.tar.gz.asc \
   && gpg --keyserver keyserver.ubuntu.com --recv-key E01C240484DE7DBE190FE141E7667DE1D1A39AFF \
-  && gpg --batch --verify eggdrop-1.9.5.tar.gz.asc eggdrop-1.9.5.tar.gz \
+  && gpg --batch --verify eggdrop-1.10.0.tar.gz.asc eggdrop-1.10.0.tar.gz \
   && command -v gpgconf > /dev/null \
   && gpgconf --kill all \
-  && rm eggdrop-1.9.5.tar.gz.asc \
-  && tar -zxvf eggdrop-1.9.5.tar.gz \
-  && rm eggdrop-1.9.5.tar.gz \
-  && ( cd eggdrop-1.9.5 \
+  && rm eggdrop-1.10.0.tar.gz.asc \
+  && tar -zxvf eggdrop-1.10.0.tar.gz \
+  && rm eggdrop-1.10.0.tar.gz \
+  && ( cd eggdrop-1.10.0 \
     && ./configure \
     && make config \
-    && make \
+    && nproc="$(nproc)" \
+    && make -j"$nproc" \
     && make install DEST=/home/eggdrop/eggdrop ) \
-  && rm -rf eggdrop-1.9.5 \
+  && rm -rf eggdrop-1.10 \
   && mkdir /home/eggdrop/eggdrop/data \
   && chown -R eggdrop /home/eggdrop/eggdrop \
-  && apk del egg-deps
+  && apk del --no-network egg-deps
 
 ENV NICK=""
 ENV SERVER=""
 ENV LISTEN="3333"
-ENV OWNER=""
 ENV USERFILE="eggdrop.user"
 ENV CHANFILE="eggdrop.chan"
 
 WORKDIR /home/eggdrop/eggdrop
 EXPOSE 3333
-COPY entrypoint.sh /home/eggdrop/eggdrop
-COPY docker.tcl /home/eggdrop/eggdrop/scripts/
+COPY entrypoint.sh ./
+COPY docker.tcl ./scripts/
 
 ENTRYPOINT ["/home/eggdrop/eggdrop/entrypoint.sh"]
 CMD ["eggdrop.conf"]
diff --git a/eggdrop_latest/docker.tcl b/eggdrop_latest/docker.tcl
index 16a466d..f9b6a07 100644
--- a/eggdrop_latest/docker.tcl
+++ b/eggdrop_latest/docker.tcl
@@ -25,3 +25,38 @@ proc nag_owner {hand idx} {
     putlog "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
   }
 }
+
+### Add user from host env variable
+if {![countusers]} {
+  if {[info exists ::env(EGGOWNER)]} {
+    if {![info exists ::env(EGGOWNER_PASS)]} {
+      putlog "* ERROR: Owner handle specified, but password environment variable missing."
+      die "Quitting. Set EGGOWNER_PASS to fix"
+    } else {
+      adduser $::env(EGGOWNER)
+      setuser $::env(EGGOWNER) PASS $::env(EGGOWNER_PASS)
+      chattr $::env(EGGOWNER) +n
+      putlog "* Added handle '$::env(EGGOWNER)' as the owner of this Eggdrop"
+    }
+  } else {
+    if {[info exists ::env(EGGOWNER)]} {
+      putlog "* EGGOWNER variable set, but userfile already contains users. Owner not added."
+    }
+  }
+}
+
+### Add channels from host env variable
+if {[info exists ::env(EGGOWNER)]} {
+  foreach eggchan [split $::env(CHANNELS) ","] {
+    if {[string index $eggchan 0] ne "#"} {
+      continue
+    }
+    if {[lsearch -exact [channels] $eggchan] < 0} {
+      channel add $eggchan
+      putlog "* Adding $eggchan to Eggdrop"
+    }
+  }
+}
+
+### Update $auto_path to look for packages installed from alpine repo
+set auto_path [linsert $auto_path 0 /usr/lib]
diff --git a/eggdrop_latest/entrypoint.sh b/eggdrop_latest/entrypoint.sh
index 502c174..1f924fd 100755
--- a/eggdrop_latest/entrypoint.sh
+++ b/eggdrop_latest/entrypoint.sh
@@ -77,19 +77,21 @@ EOS
     echo "Previous Eggdrop config file not detected, creating new persistent data file..."
     sed -i \
       -e "/set nick \"Lamestbot\"/c\set nick \"$NICK\"" \
-      -e "/server add/d" \
+      -e "/another.example.com 7000:password/d" \
+      -e "/you.need.to.change.this 6667/c\server add ${SERVER}" \
       -e "/#listen 3333 all/c\listen ${LISTEN} all" \
       -e "s/^#set dns-servers/set dns-servers/" \
-      -e "/#set owner \"MrLame, MrsLame\"/c\set owner \"${OWNER}\"" \
+      -e "/#set owner \"MrLame, MrsLame\"/c\set owner \"${EGGOWNER}\"" \
       -e "/set userfile \"LamestBot.user\"/c\set userfile data/${USERFILE}" \
       -e "/set chanfile \"LamestBot.chan\"/c\set chanfile data/${CHANFILE}" \
       -e "/set realname \"\/msg LamestBot hello\"/c\set realname \"Docker Eggdrop!\"" \
       -e '/edit your config file completely like you were told/d' \
       -e '/Please make sure you edit your config file completely/d' eggdrop.conf
-    echo "server add ${SERVER}" >> ${CONFIG}
-    echo "if {[catch {source scripts/docker.tcl} err]} {" >> ${CONFIG}
-    echo "  putlog \"INFO: Could not load docker.tcl file\"" >> ${CONFIG}
-    echo "}" >> ${CONFIG}
+      echo "server add ${SERVER}" >> eggdrop.conf
+      echo "if {[catch {source scripts/docker.tcl} err]} {" >> eggdrop.conf
+      echo "  putlog \"INFO: Could not load docker.tcl file\"" >> eggdrop.conf
+      echo "  putlog \"Error: \$err\"" >> eggdrop.conf
+      echo "}" >> eggdrop.conf
       mv /home/eggdrop/eggdrop/eggdrop.conf /home/eggdrop/eggdrop/data/${CONFIG}
   else
     if [ -e /home/eggdrop/eggdrop/eggdrop.conf ]; then
@@ -113,12 +115,16 @@ EOS
 
 
 ### Remove previous pid file, if present
-  PID=$(grep "set pidfile" ${CONFIG} |awk '{print $3}')
+  PID=$(grep "set pidfile" ${CONFIG})
   if [[ $PID == \#* ]]; then
-    PID=$(grep "set botnet-nick" ${CONFIG} |awk '{print $3}')
-    if [[ $PID == \#* ]]; then
-      PID=$(grep "set nick" ${CONFIG} |awk '{print $3}')
+    PIDNEXT=$(grep "set botnet-nick" ${CONFIG})
+    if [[ $PIDNEXT == \#* ]]; then
+      PIDNEXT=$(grep "set nick" ${CONFIG})
     fi
+    PIDBASE=$(echo $PIDNEXT|awk '{gsub("\"", "", $3); print $3}')
+    PID=$(echo pid.$PIDBASE)
+  else
+    PID=$(echo $PID|awk '{gsub("\"", "", $3); print $3}')
   fi
   if [ -e "$PID" ]; then
     PID="${PID//\"}"
@@ -126,6 +132,6 @@ EOS
     rm $PID;
   fi
 
-  exec ./eggdrop -t -m ${CONFIG}
+  exec ./eggdrop -nt -m ${CONFIG}
 fi
 exec "$@"

Relevant Maintainers:

@yosifkit yosifkit merged commit 280f483 into docker-library:master Jan 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants