From 760b11ea6c70805b1936109372faf903232a0c78 Mon Sep 17 00:00:00 2001 From: Michael Casadevall Date: Tue, 27 Jun 2023 05:00:32 -0400 Subject: [PATCH 1/5] Ok, it builds most of the dependencies out of the Makefile now Signed-off-by: Michael Casadevall --- Dockerfile | 134 +++------------------------- Makefile | 249 ++++++++++++----------------------------------------- 2 files changed, 67 insertions(+), 316 deletions(-) diff --git a/Dockerfile b/Dockerfile index 03c06059c..77817d09e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM ubuntu:22.04 AS rehash # Control variables -ENV REHASH_REPO=https://github.com/SoylentNews/rehash.git ENV REHASH_PREFIX=/srv/soylentnews.org ENV REHASH_ROOT=/srv/soylentnews.org/rehash ENV REHASH_SRC=/build/rehash +ENV REHASH_PERL=${REHASH_PREFIX}/perl/bin/perl # Mail smarthost ENV ENABLE_MAIL=false @@ -22,26 +22,12 @@ ENV MYSQL_DATABASE=soylentnews ENV MYSQL_USER=soylentnews ENV MYSQL_PASSWORD=soylentnews -ENV PERL_VERSION=5.36.1 -ENV PERL_DOWNLOAD=https://www.cpan.org/src/5.0/perl-${PERL_VERSION}.tar.gz - -ENV APACHE_VERSION=2.2.34 -ENV APACHE_DOWNLOAD=https://archive.apache.org/dist/httpd/httpd-${APACHE_VERSION}.tar.gz - -ENV MOD_PERL_VERSION=2.0.12 -ENV MOD_PERL_DOWNLOAD=https://mirror.cogentco.com/pub/apache/perl/mod_perl-${MOD_PERL_VERSION}.tar.gz - -# rehash uses its own Perl, make we need to define that -ENV REHASH_PERL=${REHASH_PREFIX}/perl/bin/perl -ENV REHASH_CPANM=${REHASH_PREFIX}/perl/bin/cpanm - # Open ports EXPOSE 80 # for ipn EXPOSE 2626 - # Unminimize the image since Perl's test suite requires it RUN apt-get update RUN yes | unminimize @@ -51,102 +37,16 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential libgd-dev RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 -WORKDIR /build -RUN wget ${PERL_DOWNLOAD} -RUN tar zxf perl-${PERL_VERSION}.tar.gz -WORKDIR /build/perl-${PERL_VERSION} - -RUN ./Configure -des -Dprefix=${REHASH_PREFIX}/perl -Duseshrplib -Dusethreads -RUN make -j8 -#RUN make check -RUN make install - -# Build Apache 2.2 -WORKDIR /build -RUN wget ${APACHE_DOWNLOAD} -RUN tar zxf httpd-${APACHE_VERSION}.tar.gz -WORKDIR /build/httpd-${APACHE_VERSION} - -RUN ./configure --prefix=${REHASH_PREFIX}/apache --enable-mods-shared=most -RUN make -RUN make install - -# Build mod_perl -WORKDIR /build -RUN wget ${MOD_PERL_DOWNLOAD} -RUN tar zxf mod_perl-${MOD_PERL_VERSION}.tar.gz -WORKDIR /build/mod_perl-${MOD_PERL_VERSION} - -RUN ${REHASH_PERL} Makefile.PL MP_APXS=${REHASH_PREFIX}/apache/bin/apxs -RUN make -RUN make test -RUN make install +# HACK ALERT - We want to still support building rehash out of the Makefile +# sans Docker, but simply copying the entire rehash folder here will rebuild +# the entire dependency tree, so just copy the base makefile, which will prevent +# Docker from rebuilding the whole fracking thing unless the actual Makefile +# changes (which should be extremely rare) -# Install CPAN Minus to make scriptable install possible WORKDIR /build -COPY utils/cpanm /build/cpanm -RUN ${REHASH_PERL} /build/cpanm App::cpanminus - -# The tests fail on Docker due to a connection upgrade inline issue. -# This is probably good enough, and we shoudln't be depending on external -# servers during building unnecessarily - -RUN NO_NETWORK_TESTING=1 ${REHASH_CPANM} Net::HTTP -RUN ${REHASH_CPANM} Apache2::Upload -RUN ${REHASH_CPANM} Cache::Memcached -RUN ${REHASH_CPANM} Cache::Memcached::Fast -RUN ${REHASH_CPANM} Data::JavaScript::Anon -RUN ${REHASH_CPANM} Date::Calc -RUN ${REHASH_CPANM} Date::Format -RUN ${REHASH_CPANM} Date::Parse -RUN ${REHASH_CPANM} DateTime::Format::MySQL -RUN ${REHASH_CPANM} DBD::mysql -RUN ${REHASH_CPANM} Digest::MD5 -RUN ${REHASH_CPANM} GD -RUN ${REHASH_CPANM} GD::Text::Align -RUN ${REHASH_CPANM} HTML::Entities -RUN ${REHASH_CPANM} HTML::FormatText -RUN ${REHASH_CPANM} HTML::Tagset -RUN ${REHASH_CPANM} HTML::TokeParser -RUN ${REHASH_CPANM} HTML::TreeBuilder -RUN ${REHASH_CPANM} HTTP::Request -RUN ${REHASH_CPANM} Image::Size -RUN ${REHASH_CPANM} JavaScript::Minifier -RUN ${REHASH_CPANM} JSON -RUN ${REHASH_CPANM} Lingua::Stem -RUN ${REHASH_CPANM} LWP::Parallel::UserAgent -RUN ${REHASH_CPANM} LWP::UserAgent -RUN ${REHASH_CPANM} Mail::Address -RUN ${REHASH_CPANM} Mail::Bulkmail - -# Disable tests on Mail::Sendmail because it works by sending an email to the author -RUN ${REHASH_CPANM} Mail::Sendmail --notest - -RUN ${REHASH_CPANM} MIME::Types -RUN ${REHASH_CPANM} Mojo::Server::Daemon -RUN ${REHASH_CPANM} Net::IP -RUN ${REHASH_CPANM} Net::Server - -# Time::ParseDate is a dependency of Schedule::Cron but has test problems -# -# This fails in Docker due to possibly missing tiemzone data, but rehash -# assumes and expects to be running on UTC so bypassing the test failure - -RUN ${REHASH_CPANM} Time::ParseDate --notest -RUN ${REHASH_CPANM} Schedule::Cron - -RUN ${REHASH_CPANM} SOAP::Lite -RUN ${REHASH_CPANM} Sphinx::Search -RUN ${REHASH_CPANM} URI::Encode -RUN ${REHASH_CPANM} Template -RUN ${REHASH_CPANM} XML::Parser -RUN ${REHASH_CPANM} XML::Parser::Expat -RUN ${REHASH_CPANM} XML::RSS -RUN ${REHASH_CPANM} Email::Valid - -RUN ${REHASH_CPANM} Crypt::CBC -RUN ${REHASH_CPANM} HTML::PopupTreeSelect -RUN ${REHASH_CPANM} Twitter::API +COPY Makefile /build +COPY utils/cpanm /build/utils/cpanm +RUN make build-environment ENVIRONMENT_PREFIX=${REHASH_PREFIX} DO_APACHE_CONFIG=0 # DBIx::Password is ... uh ... not easy to deal with. # Just copy in a pregenerated version @@ -157,11 +57,14 @@ RUN mkdir -p ${REHASH_PREFIX}/perl/lib/${PERL_VERSION}/DBIx/ RUN sh make_password_pm.sh ${MYSQL_HOST} ${MYSQL_DATABASE} ${MYSQL_USER} ${MYSQL_PASSWORD} > ${REHASH_PREFIX}/perl/lib/${PERL_VERSION}/DBIx/Password.pm RUN adduser --system --group --gecos "Slash" slash -# Copy in the rehash source code +# Assuming we have everything build now, we're ready to install rehash now ADD . ${REHASH_SRC}/ WORKDIR ${REHASH_SRC} + +# Copy in the rehash source code RUN make USER=slash GROUP=slash PERL=${REHASH_PERL} SLASH_PREFIX=${REHASH_ROOT} RUN make USER=slash GROUP=slash PERL=${REHASH_PERL} SLASH_PREFIX=${REHASH_ROOT} install +RUN make ENVIRONMENT_PREFIX=${REHASH_PREFIX} stamp/append-apache-config RUN cp ${REHASH_SRC}/httpd/site.conf ${REHASH_ROOT}/httpd/site.conf # Create the slashsites files @@ -184,16 +87,5 @@ RUN chown slash:slash -R ${REHASH_PREFIX}/rehash RUN chown slash:slash -R ${REHASH_PREFIX}/apache/logs RUN chown slash:slash -R /srv/soylentnews.logs -RUN echo "KeepAlive on" >> ${REHASH_PREFIX}/apache/conf/httpd.conf -RUN echo "KeepAliveTimeout 600" >> ${REHASH_PREFIX}/apache/conf/httpd.conf -RUN echo "MaxKeepAliveRequests 0" >> ${REHASH_PREFIX}/apache/conf/httpd.conf -RUN echo "TraceEnable Off" >> ${REHASH_PREFIX}/apache/conf/httpd.conf - -RUN echo "LoadModule apreq_module modules/mod_apreq2.so" >> ${REHASH_PREFIX}/apache/conf/httpd.conf -RUN echo "LoadModule perl_module modules/mod_perl.so" >> ${REHASH_PREFIX}/apache/conf/httpd.conf -RUN echo "Include /rehash-prefix/rehash/httpd/slash.conf" >> ${REHASH_PREFIX}/apache/conf/httpd.conf -RUN echo "Include /rehash-prefix/rehash/httpd/site.conf" >> ${REHASH_PREFIX}/rehash/httpd/slash.conf -RUN echo "LogLevel Debug" >> ${REHASH_PREFIX}/apache/conf/httpd.conf - COPY conf/postfix/main.cf /main.cf CMD /start-rehash diff --git a/Makefile b/Makefile index 7d18b406e..718bbb2f9 100644 --- a/Makefile +++ b/Makefile @@ -40,17 +40,20 @@ MAKE = make -s # Apache stuff APACHE_MIRROR=http://archive.apache.org/dist/httpd/ -APACHE_VER=2.2.29 +APACHE_VER=2.2.34 APACHE_DIR=httpd-$(APACHE_VER) APACHE_FILE=$(APACHE_DIR).tar.bz2 +APACHE_PREFIX=$(ENVIRONMENT_PREFIX)/apache +DO_APACHE_CONFIG=1 # Perl stuff PERL_MIRROR=http://www.cpan.org/src/5.0/ -PERL_VER=5.20.0 +PERL_VER=5.36.1 PERL_DIR=perl-$(PERL_VER) PERL_FILE=$(PERL_DIR).tar.gz -REHASH_PERL=$(ENVIRONMENT_PREFIX)/perl-$(PERL_VER)/bin/perl -REHASH_CPANM=$(ENVIRONMENT_PREFIX)/perl-$(PERL_VER)/bin/cpanm +PERL_PREFIX=$(ENVIRONMENT_PREFIX)/perl +REHASH_PERL=$(PERL_PREFIX)/bin/perl +REHASH_CPANM=$(PERL_PREFIX)/bin/cpanm # mod_perl stuff # mod_perl 2.0.9 is for 2.4 apache, unclear if it @@ -58,7 +61,7 @@ REHASH_CPANM=$(ENVIRONMENT_PREFIX)/perl-$(PERL_VER)/bin/cpanm MOD_PERL_MIRROR=http://mirror.cogentco.com/pub/apache/perl/ #MOD_PERL_VER=http://archive.apache.org/dist/perl/ -MOD_PERL_VER=2.0.9 +MOD_PERL_VER=2.0.12 MOD_PERL_DIR=mod_perl-$(MOD_PERL_VER) MOD_PERL_FILE=$(MOD_PERL_DIR).tar.gz @@ -338,7 +341,14 @@ manifest : rpm : rpm -ba slash.spec -build-environment: stamp/apache-built stamp/perl-built stamp/mod-perl-built stamp/install-cpamn stamp/install-apache2-upload stamp/install-cache-memcached stamp/install-cache-memcached-fast stamp/install-data-javascript-anon stamp/install-date-calc stamp/install-date-format stamp/install-date-language stamp/install-date-parse stamp/install-datetime-format-mysql stamp/install-dbd-mysql stamp/install-digest-md5 stamp/install-email-valid stamp/install-gd stamp/install-gd-text-align stamp/install-html-entities stamp/install-html-formattext stamp/install-html-tagset stamp/install-html-tokeparser stamp/install-html-treebuilder stamp/install-http-request stamp/install-image-size stamp/install-javascript-minifier stamp/install-json stamp/install-lingua-stem stamp/install-lwp-parallel-useragent stamp/install-lwp-useragent stamp/install-mail-address stamp/install-mail-bulkmail stamp/install-mail-sendmail stamp/install-mime-types stamp/install-mojo-server-daemon stamp/install-net-ip stamp/install-net-server stamp/install-schedule-cron stamp/install-soap-lite stamp/install-sphinx-search stamp/install-uri-encode stamp/install-template stamp/install-xml-parser stamp/install-xml-parser-expat stamp/install-xml-rss +build-environment: stamp/apache-built \ + stamp/perl-built \ + stamp/mod-perl-built \ + stamp/install-cpamn \ + stamp/install-perl-dependencies \ + stamp/append-apache-config + + @echo "Setting permissions on the $(ENVIRONMENT_PREFIX) directory" chown $(USER):$(GROUP) -R $(ENVIRONMENT_PREFIX) @echo "" @@ -351,19 +361,6 @@ build-environment: stamp/apache-built stamp/perl-built stamp/mod-perl-built stam @echo "perl: $(PERL_VER)" @echo "mod_perl: $(MOD_PERL_VER)" @echo "" - @echo "As well as the latest version of rehash's dependencies" - @echo "from CPAN. It's recommended everytime you upgrade" - @echo "your site, you re-run build-environment to update" - @echo "everything to the latest version." - @echo "" - @echo "If Upgrading:" - @echo "Your old apache/perl directories have been left in" - @echo "place; before switching over to the new versions," - @echo "make sure you update httpd.conf and migrate" - @echo "DBIx::Password to your new perl directory. See INSTALL" - @echo "for more information." - @echo "" - @echo "For New Installs:" @echo "Rehash has one final dependency not handled by this" @echo "script: DBIx::Password. You can install it by running" @echo "make install-dbi-password, but make sure to check " @@ -384,7 +381,11 @@ dist/$(APACHE_FILE): stamp/apache-built: dist/$(APACHE_FILE) -mkdir build stamp -rm -rf build/$(APACHE_DIR) - cd build && tar jxf ../dist/$(APACHE_FILE); cd $(APACHE_DIR) && ./configure --prefix=$(ENVIRONMENT_PREFIX)/apache-$(APACHE_VER) --enable-mods-shared=most && make && make install + cd build && \ + tar jxf ../dist/$(APACHE_FILE) && \ + cd $(APACHE_DIR) && ./configure --prefix=$(APACHE_PREFIX) --enable-mods-shared=most && \ + make && \ + make install touch stamp/apache-built dist/$(PERL_FILE): @@ -394,7 +395,12 @@ dist/$(PERL_FILE): stamp/perl-built: dist/$(PERL_FILE) -mkdir build stamp -rm -rf build/$(PERL_DIR) - cd build && tar zxf ../dist/$(PERL_FILE) && cd $(PERL_DIR) && ./Configure -des -Dprefix=$(ENVIRONMENT_PREFIX)/perl-$(PERL_VER) -Duseshrplib -Dusethreads && make && make check && make install + cd build && \ + tar zxf ../dist/$(PERL_FILE) && \ + cd $(PERL_DIR) && \ + ./Configure -des -Dprefix=$(PERL_PREFIX) -Duseshrplib -Dusethreads && \ + make && \ + make install touch stamp/perl-built dist/$(MOD_PERL_FILE): @@ -404,7 +410,13 @@ dist/$(MOD_PERL_FILE): stamp/mod-perl-built: dist/$(MOD_PERL_FILE) -mkdir build stamp -rm -rf build/$(MOD_PERL_DIR) - cd build && tar xvf ../dist/$(MOD_PERL_FILE) && cd $(MOD_PERL_DIR) && $(REHASH_PERL) Makefile.PL MP_APXS=$(ENVIRONMENT_PREFIX)/apache-$(APACHE_VER)/bin/apxs && make && make test && make install + cd build && \ + tar xvf ../dist/$(MOD_PERL_FILE) && \ + cd $(MOD_PERL_DIR) && \ + $(REHASH_PERL) Makefile.PL MP_APXS=$(APACHE_PREFIX)/bin/apxs && \ + make && \ + make test && \ + make install touch stamp/mod-perl-built stamp/install-cpamn: @@ -412,222 +424,69 @@ stamp/install-cpamn: $(REHASH_PERL) utils/cpanm App::cpanminus touch stamp/install-cpamn -stamp/install-apache2-upload: +stamp/install-perl-dependencies: -mkdir stamp $(REHASH_CPANM) Apache2::Upload - touch stamp/install-apache2-upload - -stamp/install-cache-memcached: - -mkdir stamp $(REHASH_CPANM) Cache::Memcached - touch stamp/install-cache-memcached - -stamp/install-cache-memcached-fast: - -mkdir stammp $(REHASH_CPANM) Cache::Memcached::Fast - touch stamp/install-cache-memcached-fast - -stamp/install-data-javascript-anon: - -mkdir stamp $(REHASH_CPANM) Data::JavaScript::Anon - touch stamp/install-data-javascript-anon - -stamp/install-date-calc: - -mkdir stamp $(REHASH_CPANM) Date::Calc - touch stamp/install-date-calc - -stamp/install-twitter-api: - -mkdir stamp - $(REHASH_CPANM) Twitter::API - touch stamp/install-twitter-api - -stamp/install-date-format: - -mkdir stamp $(REHASH_CPANM) Date::Format - touch stamp/install-date-format - -stamp/install-date-language: - -mkdir stamp $(REHASH_CPANM) Date::Language - touch stamp/install-date-language - -stamp/install-date-parse: - -mkdir stamp $(REHASH_CPANM) Date::Parse - touch stamp/install-date-parse - -stamp/install-datetime-format-mysql: - -mkdir stamp $(REHASH_CPANM) DateTime::Format::MySQL - touch stamp/install-datetime-format-mysql - -stamp/install-dbd-mysql: - -mkdir stamp $(REHASH_CPANM) DBD::mysql - touch stamp/install-dbd-mysql - -stamp/install-digest-md5: - -mkdir stamp $(REHASH_CPANM) Digest::MD5 - touch stamp/install-digest-md5 - -stamp/install-email-valid: - -mkdir stamp $(REHASH_CPANM) Email::Valid - touch stamp/install-email-valid - -stamp/install-gd: - -mkdir stamp $(REHASH_CPANM) GD - touch stamp/install-gd - -stamp/install-gd-text-align: - -mkdir stamp $(REHASH_CPANM) GD::Text::Align - touch stamp/install-gd-text-align - -stamp/install-html-entities: - -mkdir stamp $(REHASH_CPANM) HTML::Entities - touch stamp/install-html-entities - -stamp/install-html-formattext: - -mkdir stamp $(REHASH_CPANM) HTML::FormatText - touch stamp/install-html-formattext - -stamp/install-html-tagset: - -mkdir stamp $(REHASH_CPANM) HTML::Tagset - touch stamp/install-html-tagset - -stamp/install-html-tokeparser: - -mkdir stamp $(REHASH_CPANM) HTML::TokeParser - touch stamp/install-html-tokeparser - -stamp/install-html-treebuilder: - -mkdir stamp $(REHASH_CPANM) HTML::TreeBuilder - touch stamp/install-html-treebuilder - -stamp/install-http-request: - -mkdir stamp $(REHASH_CPANM) HTTP::Request - touch stamp/install-http-request - -stamp/install-image-size: - -mkdir stamp $(REHASH_CPANM) Image::Size - touch stamp/install-image-size - -stamp/install-javascript-minifier: - -mkdir stamp $(REHASH_CPANM) JavaScript::Minifier - touch stamp/install-javascript-minifier - -stamp/install-json: - -mkdir stamp $(REHASH_CPANM) JSON - touch stamp/install-json - -stamp/install-lingua-stem: - -mkdir stamp $(REHASH_CPANM) Lingua::Stem - touch stamp/install-lingua-stem - -stamp/install-lwp-parallel-useragent: - -mkdir stamp $(REHASH_CPANM) LWP::Parallel::UserAgent - touch stamp/install-lwp-parallel-useragent - -stamp/install-lwp-useragent: - -mkdir stamp $(REHASH_CPANM) LWP::UserAgent - touch stamp/install-lwp-useragent - -stamp/install-mail-address: - -mkdir stamp $(REHASH_CPANM) Mail::Address - touch stamp/install-mail-address - -stamp/install-mail-bulkmail: - -mkdir stamp $(REHASH_CPANM) Mail::Bulkmail - touch stamp/install-mail-bulkmail - -stamp/install-mail-sendmail: - -mkdir stamp - $(REHASH_CPANM) Mail::Sendmail - touch stamp/install-mail-sendmail - -stamp/install-mime-types: - -mkdir stamp + $(REHASH_CPANM) Mail::Sendmail --notest $(REHASH_CPANM) MIME::Types - touch stamp/install-mime-types - -stamp/install-mojo-server-daemon: - -mkdir stamp $(REHASH_CPANM) Mojo::Server::Daemon - touch stamp/install-mojo-server-daemon - -stamp/install-net-ip: - -mkdir stamp $(REHASH_CPANM) Net::IP - touch stamp/install-net-ip - -stamp/install-net-server: - -mkdir stamp $(REHASH_CPANM) Net::Server - touch stamp/install-net-server - -stamp/install-schedule-cron: - -mkdir stamp + $(REHASH_CPANM) Time::ParseDate --notest $(REHASH_CPANM) Schedule::Cron - touch stamp/install-schedule-cron - -stamp/install-soap-lite: - -mkdir stamp $(REHASH_CPANM) SOAP::Lite - touch stamp/install-soap-lite - -stamp/install-sphinx-search: - -mkdir stamp $(REHASH_CPANM) Sphinx::Search - touch stamp/install-sphinx-search - -stamp/install-uri-encode: - -mkdir stamp $(REHASH_CPANM) URI::Encode - touch stamp/install-uri-encode - -stamp/install-template: - -mkdir stamp $(REHASH_CPANM) Template - touch stamp/install-template - -stamp/install-xml-parser: - -mkdir stamp $(REHASH_CPANM) XML::Parser - touch stamp/install-xml-parser - -stamp/install-xml-parser-expat: - -mkdir stamp $(REHASH_CPANM) XML::Parser::Expat - touch stamp/install-xml-parser-expat - -stamp/install-xml-rss: - -mkdir stamp $(REHASH_CPANM) XML::RSS - touch stamp/install-xml-rss + $(REHASH_CPANM) Crypt::CBC + $(REHASH_CPANM) HTML::PopupTreeSelect + $(REHASH_CPANM) Twitter::API + @touch stamp/install-perl-dependencies install-dbix-password: $(REHASH_CPANM) --interactive DBIx::Password stamp/append-apache-config: - @echo "Appending Apache's configuration with necessary module configuration" - echo "LoadModule perl_module modules/mod_perl.so" >> $(ENVIRONMENT_PREFIX)/$(APACHE_DIR)/conf/httpd.conf - echo "LoadModule apreq_module modules/mod_apreq2.so" >> $(ENVIRONMENT_PREFIX)/$(APACHE_DIR)/conf/httpd.conf - echo "Include $(SLASH_PREFIX)/httpd/slash.conf" >> $(ENVIRONMENT_PREFIX)/$(APACHE_DIR)/conf/httpd.conf - touch stamp/append-apache-config: + -mkdir stamp +ifeq ($(DO_APACHE_CONFIG), 1) + echo "Appending Apache's configuration with necessary module configuration" + echo "KeepAlive on">> $(APACHE_PREFIX)/conf/httpd.conf + echo "KeepAliveTimeout 600" >> $(APACHE_PREFIX)/conf/httpd.conf + echo "MaxKeepAliveRequests 0" >> $(APACHE_PREFIX)/conf/httpd.conf + echo "TraceEnable Off" >> $(APACHE_PREFIX)/conf/httpd.conf + echo "LoadModule apreq_module modules/mod_apreq2.so">> $(APACHE_PREFIX)/conf/httpd.conf + echo "LoadModule perl_module modules/mod_perl.so">> $(APACHE_PREFIX)/conf/httpd.conf + echo "Include $(SLASH_PREFIX)/httpd/slash.conf">> $(APACHE_PREFIX)/conf/httpd.conf + echo "Include $(SLASH_PREFIX)/httpd/site.conf" >> $(APACHE_PREFIX)/conf/httpd.conf + touch stamp/append-apache-config; +endif From ea98e4d7e091701ebf09570891b51d5cff1b3dc4 Mon Sep 17 00:00:00 2001 From: Michael Casadevall Date: Thu, 29 Jun 2023 00:04:28 -0400 Subject: [PATCH 2/5] Ok the environment builds properly out of docker now when using the Makefile Signed-off-by: Michael Casadevall --- Dockerfile | 2 +- Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 77817d09e..3a123b0c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,5 +87,5 @@ RUN chown slash:slash -R ${REHASH_PREFIX}/rehash RUN chown slash:slash -R ${REHASH_PREFIX}/apache/logs RUN chown slash:slash -R /srv/soylentnews.logs -COPY conf/postfix/main.cf /main.cf +COPY conf/postfix/main.cf /etc/postfix/main.cf CMD /start-rehash diff --git a/Makefile b/Makefile index 718bbb2f9..782613292 100644 --- a/Makefile +++ b/Makefile @@ -426,6 +426,7 @@ stamp/install-cpamn: stamp/install-perl-dependencies: -mkdir stamp + NO_NETWORK_TESTING=1 ${REHASH_CPANM} Net::HTTP $(REHASH_CPANM) Apache2::Upload $(REHASH_CPANM) Cache::Memcached $(REHASH_CPANM) Cache::Memcached::Fast From ce6b1386ef79943236793c97a8ad5edf6aa41c20 Mon Sep 17 00:00:00 2001 From: Michael Casadevall Date: Thu, 29 Jun 2023 00:12:12 -0400 Subject: [PATCH 3/5] revert change on how main.cf is handled Signed-off-by: Michael Casadevall --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3a123b0c8..440aaf4d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,5 +87,5 @@ RUN chown slash:slash -R ${REHASH_PREFIX}/rehash RUN chown slash:slash -R ${REHASH_PREFIX}/apache/logs RUN chown slash:slash -R /srv/soylentnews.logs -COPY conf/postfix/main.cf /etc/postfix/main.cf +COPY /main.cf /etc/postfix/main.cf CMD /start-rehash From ca52b77be83e388636cd21d02fd1d20d2fc0e0de Mon Sep 17 00:00:00 2001 From: Michael Casadevall Date: Thu, 29 Jun 2023 00:12:52 -0400 Subject: [PATCH 4/5] Actually fix main.cf Signed-off-by: Michael Casadevall --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 440aaf4d1..77817d09e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,5 +87,5 @@ RUN chown slash:slash -R ${REHASH_PREFIX}/rehash RUN chown slash:slash -R ${REHASH_PREFIX}/apache/logs RUN chown slash:slash -R /srv/soylentnews.logs -COPY /main.cf /etc/postfix/main.cf +COPY conf/postfix/main.cf /main.cf CMD /start-rehash From b1dbca41b36f3f9aede04ffab02f24debe060ac3 Mon Sep 17 00:00:00 2001 From: Michael Casadevall Date: Thu, 29 Jun 2023 02:41:48 -0400 Subject: [PATCH 5/5] handle perl version Signed-off-by: Michael Casadevall --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 77817d09e..d50e54006 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,13 @@ ENV REHASH_ROOT=/srv/soylentnews.org/rehash ENV REHASH_SRC=/build/rehash ENV REHASH_PERL=${REHASH_PREFIX}/perl/bin/perl +# Perl version needs to be set here. This is also in the Makefile, but +# for bare metal installs, DBIx::Password is done interactively. However, +# for automated installs, we need to manually drop it into the right place + +# Bad things will happen if this number, and the one in the Makefile are out of sync +ENV PERL_VERSION=5.36.1 + # Mail smarthost ENV ENABLE_MAIL=false ENV MYHOSTNAME=soylentnews.org