From 370cf52efc747163c0c40ebc22f3430830687955 Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 30 Dec 2025 08:36:42 -0500 Subject: [PATCH 1/9] init commit --- ontampa-devs/links/Dockerfile | 74 ++++ ontampa-devs/links/README.md | 318 ++++++++++++++++++ .../links/conf/apache2/conf.d/ssl.conf | 42 +++ ontampa-devs/links/conf/apache2/httpd.conf | 115 +++++++ ontampa-devs/links/conf/php/php.ini | 0 ontampa-devs/links/conf/ssl/openssl.cnf | 10 + ontampa-devs/links/docker-entrypoint.sh | 56 +++ 7 files changed, 615 insertions(+) create mode 100644 ontampa-devs/links/Dockerfile create mode 100644 ontampa-devs/links/README.md create mode 100644 ontampa-devs/links/conf/apache2/conf.d/ssl.conf create mode 100644 ontampa-devs/links/conf/apache2/httpd.conf create mode 100644 ontampa-devs/links/conf/php/php.ini create mode 100644 ontampa-devs/links/conf/ssl/openssl.cnf create mode 100644 ontampa-devs/links/docker-entrypoint.sh diff --git a/ontampa-devs/links/Dockerfile b/ontampa-devs/links/Dockerfile new file mode 100644 index 0000000..023d082 --- /dev/null +++ b/ontampa-devs/links/Dockerfile @@ -0,0 +1,74 @@ +FROM alpine:3.23.2 + +ENV TZ="UTC" +ENV SERVER_ADMIN="cloud@ontampa.dev" +ENV HTTP_SERVER_NAME="localhost.localdomain" +ENV HTTPS_SERVER_NAME="${HTTP_SERVER_NAME}" +ENV HTTP_SERVER_PORT="8080" +ENV HTTPS_SERVER_PORT="8443" +EXPOSE $HTTP_SERVER_PORT $HTTPS_SERVER_PORT + +ENV LOG_LEVEL="debug" +ENV PHP_MEMORY_LIMIT="512M" +ENV UPLOAD_MAX_FILESIZE="8M" + +RUN apk --no-cache --update \ + add apache2 \ + apache2-ctl \ + apache2-ssl \ + curl \ + php83-apache2 \ + php83-bcmath \ + php83-bz2 \ + php83-calendar \ + php83-common \ + php83-ctype \ + php83-curl \ + php83-dom \ + php83-fileinfo \ + php83-gd \ + php83-iconv \ + php83-json \ + php83-mbstring \ + php83-mysqli \ + php83-mysqlnd \ + php83-openssl \ + php83-pdo_mysql \ + php83-pdo_pgsql \ + php83-pdo_sqlite \ + php83-phar \ + php83-session \ + php83-xml \ + php83-tokenizer \ + php83-zip \ + php83-xmlwriter \ + php83-redis \ + tzdata \ + libarchive-tools \ + && mkdir /htdocs + + +COPY --chown=apache:apache conf/apache2/httpd.conf /etc/apache2/httpd.conf +COPY --chown=apache:apache conf/apache2/conf.d/ssl.conf /etc/apache2/conf.d/ssl.conf + +COPY --chown=apache:apache conf/php/php.ini /etc/php83/conf.d/40-custom.ini +COPY --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf + +COPY --chown=apache:apache src /htdocs +COPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/ + +RUN chown -R apache:apache /etc/php83 +RUN chown -R apache:apache /etc/ssl/openssl.cnf +RUN chown -R apache:apache /etc/apache2 +RUN chmod -R +rwX /etc/apache2 +RUN chmod -R 755 /etc/php83 + +RUN curl -sSL https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ + | bsdtar -xvf- -C /htdocs + +RUN apachectl configtest +USER apache:apache + +WORKDIR /htdocs +CMD ["docker-entrypoint.sh"] + diff --git a/ontampa-devs/links/README.md b/ontampa-devs/links/README.md new file mode 100644 index 0000000..e7f23ea --- /dev/null +++ b/ontampa-devs/links/README.md @@ -0,0 +1,318 @@ +

+
+ + + + +

+ +

Docker Edition


+

Pull, deploy, enjoy!


+ +

+ About • + About LinkStack • + Pull • + Supported Architectures • + Deployment • + Updating • + Build • + Persistent storage • + Reverse Proxy +


+ +

+ Live Demo +

+ +

+ + + + +

+ +

+ Docker Hub +

+ + +## About + +The official docker version of [LinkStack](https://github.com/linkstackorg/linkstack). This docker image is a simple to set up solution, containing everything you need to run LinkStack. + +The docker version of LinkStack retains all the features and customization options of the [original version](https://github.com/linkstackorg/linkstack). + +This docker is based on [Alpine Linux](https://www.alpinelinux.org/), a Linux distribution designed to be small, simple and secure. The web server is running [Apache2](https://www.apache.org/), a free and open-source cross-platform web server software. The docker comes with [PHP 8.3](https://www.php.net/releases/8.3/en.php) for high compatibility and performance. + +#### Using the docker is as simple as pulling and deploying. + +
+ + +## About LinkStack + +

+ + + + + + +

+ +

+LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface. + +

LinkStack allows you to create a personal profile page. Many social media platforms only allow for one link. With this, you can have all the links you want clickable on one site. Set up your personal site on your own server in a few clicks.

+

+ +
+ +

+Learn more about LinkStack, and all the features here: +

+ +
+ +

+ About LinkStack +

+ +
+ + +## Pull + +```shell +docker pull linkstackorg/linkstack +``` + +
+ +Alternative mirror: + +```shell +docker pull ghcr.io/linkstackorg/linkstack +``` + +
+ + +## Supported Architectures + +- [`linux/amd64`](https://hub.docker.com/r/linkstackorg/linkstack/tags) +- [`linux/arm/v6`](https://hub.docker.com/r/linkstackorg/linkstack/tags) +- [`linux/arm/v7`](https://hub.docker.com/r/linkstackorg/linkstack/tags) +- [`linux/arm64`](https://hub.docker.com/r/linkstackorg/linkstack/tags) + +
+ + +## Deployment + +You may change port *80*, *443* to your preferred values. + +Both HTTP and HTTPS are supported and exposed by default. + +### Optional environment variables + +- `SERVER_ADMIN` (the email, defaults to `you@example.com`) +- `HTTP_SERVER_NAME` (the [server name](https://httpd.apache.org/docs/2.4/fr/mod/core.html#servername), defaults to `localhost`) +- `HTTPS_SERVER_NAME` (the [server name](https://httpd.apache.org/docs/2.4/fr/mod/core.html#servername), defaults to `localhost`) +- `LOG_LEVEL` (the [log level](https://httpd.apache.org/docs/2.4/fr/mod/core.html#loglevel), defaults to `info`) +- `TZ` (the [timezone](https://www.php.net/manual/timezones.php), defaults to `UTC`) +- `PHP_MEMORY_LIMIT` (the [memory-limit](https://www.php.net/manual/ini.core.php#ini.memory-limit), defaults to `256M`) +- `UPLOAD_MAX_FILESIZE` (the [upload_max_filesize](https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize), defaults to `8M`) + +
+ +#### Deploy + +
+Read more about persistent storage + +
+ +**Create a new volume:** +
docker volume create linkstack
+ +
+ +
+docker run --detach \
+    --name linkstack \
+    --publish 80:80 \
+    --publish 443:443 \
+    --restart unless-stopped \
+    --mount source=linkstack,target=/htdocs \
+    linkstackorg/linkstack
+
+ +
+ +#### Custom deployment + +
+docker run --detach \
+    --name linkstack \
+    --hostname linkstack \
+    --env HTTP_SERVER_NAME="www.example.xyz" \
+    --env HTTPS_SERVER_NAME="www.example.xyz" \
+    --env SERVER_ADMIN="admin@example.xyz" \
+    --env TZ="Europe/Berlin" \
+    --env PHP_MEMORY_LIMIT="512M" \
+    --env UPLOAD_MAX_FILESIZE="16M" \
+    --publish 80:80 \
+    --publish 443:443 \
+    --restart unless-stopped \
+    --mount source=linkstack,target=/htdocs \
+    linkstackorg/linkstack
+
+ +
+ +#### Docker Compose +Use HTTPS for your reverse proxy to avoid issues
+Example config. + +
+version: "3.8"
+
+services:
+
+  linkstack:
+    hostname: 'linkstack'
+    image: 'linkstackorg/linkstack:latest'
+    environment:
+      TZ: 'Europe/Berlin'
+      SERVER_ADMIN: 'admin@example.com'
+      HTTP_SERVER_NAME: 'example.com'
+      HTTPS_SERVER_NAME: 'example.com'
+      LOG_LEVEL: 'info'
+      PHP_MEMORY_LIMIT: '256M'
+      UPLOAD_MAX_FILESIZE: '8M'
+    volumes:
+      - 'linkstack_data:/htdocs'
+    ports:
+      - '8190:443'
+    restart: unless-stopped
+
+volumes:
+  linkstack_data:
+
+ +
+ + +## Updating + +When a **new version** is released, you will get an update notification on your Admin Panel. + +### Automatic one click Updater +This updater allows you to update your installation with just one click. + +
+ +**How to use the Automatic Updater:** + +- To update your instance, click on the update notification on your Admin Panel. + +- Click on “Update automatically” and the updater will take care of the rest. + +
+ + +## Build + +**If you wish to build or modify your own docker version of LinkStack, you can do so with the instructions below:** + +- Download this GitHub repository as well as the latest release of LinkStack from [here](https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip). +- Place the downloaded release files directly into the linkstack folder from [this repository](https://github.com/linkstackorg/linkstack-docker/archive/refs/heads/main.zip). + +From the docker directory, run the command: +
+docker build -t linkstack .
+
You can now set up your application on your defined ports. + +
+ + +## Persistent storage + +Persistent storage for docker containers is storage that is **not** lost when the container is stopped or removed. + +This is advantageous since it means that data may be saved even if the container is removed. This is especially crucial when dealing with data that must be retained throughout restarts, such as a database. + + +All files important to run LinkStack are stored in the "htdocs" folder found in the root directory of your docker container. + +We recommend mounting that entire folder to an external volume. + +
+ +**However, some user may prefer to preserve only individual files.**
+_Expand the details section below to read more about this:_ + +
+If you wish to save only selective files, you may save the following files and folders: + +``` +/htdocs/.env +/htdocs/database/database.sqlite +/htdocs/config/advanced-config.php +/htdocs/assets/linkstack/images/avatar.png +/htdocs/themes (folder) +/htdocs/assets/img (folder) +``` + +**This might change with future releases.** +
+ +
+ + +## Reverse Proxy + +### NGINX: + +**Below is an example NGINX setup for a reverse proxy.**
+Make sure to use HTTPS to access your container to avoid mixed content errors +
+
+server {
+  listen        443 ssl;
+  listen        [::]:443 ssl;
+  listen        80;
+  listen        [::]:80;
+  server_name   your.domain.name;
+
+  location / {
+    # Replace with the IP address and port number of your Docker container.
+    proxy_pass                          https://127.0.0.1:443;
+    proxy_set_header Host               $host;
+    proxy_set_header X-Real-IP          $remote_addr;
+
+    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
+    proxy_set_header X-Forwarded-Proto  https;
+    proxy_set_header X-VerifiedViaNginx yes;
+    proxy_read_timeout                  60;
+    proxy_connect_timeout               60;
+    proxy_redirect                      off;
+
+    # Specific for websockets: force the use of HTTP/1.1 and set the Upgrade header
+    proxy_http_version 1.1;
+    proxy_set_header Upgrade $http_upgrade;
+    proxy_set_header Connection 'upgrade';
+    proxy_cache_bypass $http_upgrade;
+    proxy_set_header X-Forwarded-Proto $scheme;
+    
+    # Fixes Mixed Content errors.
+    add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
+  }
+}
+
+
+ +
+
diff --git a/ontampa-devs/links/conf/apache2/conf.d/ssl.conf b/ontampa-devs/links/conf/apache2/conf.d/ssl.conf new file mode 100644 index 0000000..efa62b7 --- /dev/null +++ b/ontampa-devs/links/conf/apache2/conf.d/ssl.conf @@ -0,0 +1,42 @@ +LoadModule ssl_module modules/mod_ssl.so +LoadModule socache_shmcb_module modules/mod_socache_shmcb.so + + + RewriteEngine On + RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/ + RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L] + + + + + SSLEngine on + SSLCertificateFile /etc/ssl/apache2/server.pem + SSLCertificateKeyFile /etc/ssl/apache2/server.key + + PassEnv HTTP_SERVER_NAME + ServerName ${HTTP_SERVER_NAME} + + PassEnv SERVER_ADMIN + ServerAdmin ${SERVER_ADMIN} + + ErrorLog /dev/stderr + TransferLog "logs/ssl-transfer.log" + CustomLog /dev/stderr combined + + PassEnv LOG_LEVEL + LogLevel ${LOG_LEVEL} + + + SSLOptions +StdEnvVars + + + + SSLOptions +StdEnvVars + + + BrowserMatch "MSIE [2-5]" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [ssl.conf] %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined + + diff --git a/ontampa-devs/links/conf/apache2/httpd.conf b/ontampa-devs/links/conf/apache2/httpd.conf new file mode 100644 index 0000000..27700aa --- /dev/null +++ b/ontampa-devs/links/conf/apache2/httpd.conf @@ -0,0 +1,115 @@ +ServerTokens OS +ServerRoot /var/www +DocumentRoot "/htdocs" +ServerSignature On + +PassEnv HTTP_SERVER_PORT +Listen ${HTTP_SERVER_PORT} + +PassEnv HTTPS_SERVER_PORT +Listen ${HTTPS_SERVER_PORT} + +PassEnv SERVER_ADMIN +ServerAdmin ${SERVER_ADMIN} + +PassEnv HTTP_SERVER_NAME +ServerName ${HTTP_SERVER_NAME} + +PidFile /htdocs/httpd.pid + +LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule authn_file_module modules/mod_authn_file.so +LoadModule authn_core_module modules/mod_authn_core.so +LoadModule authz_host_module modules/mod_authz_host.so +LoadModule authz_groupfile_module modules/mod_authz_groupfile.so +LoadModule authz_user_module modules/mod_authz_user.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule access_compat_module modules/mod_access_compat.so +LoadModule auth_basic_module modules/mod_auth_basic.so +LoadModule reqtimeout_module modules/mod_reqtimeout.so +LoadModule filter_module modules/mod_filter.so +LoadModule deflate_module modules/mod_deflate.so +LoadModule mime_module modules/mod_mime.so +LoadModule log_config_module modules/mod_log_config.so +LoadModule logio_module modules/mod_logio.so +LoadModule env_module modules/mod_env.so +LoadModule expires_module modules/mod_expires.so +LoadModule headers_module modules/mod_headers.so +LoadModule setenvif_module modules/mod_setenvif.so +LoadModule version_module modules/mod_version.so +LoadModule unixd_module modules/mod_unixd.so +LoadModule status_module modules/mod_status.so +LoadModule autoindex_module modules/mod_autoindex.so + + + + + + + +LoadModule dir_module modules/mod_dir.so +LoadModule alias_module modules/mod_alias.so +LoadModule rewrite_module modules/mod_rewrite.so +LoadModule negotiation_module modules/mod_negotiation.so + + + User apache + Group apache + + + + AllowOverride none + Require all denied + + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + + DirectoryIndex index.html + + + Require all denied + +ErrorLog /dev/stderr +PassEnv LOG_LEVEL +LogLevel ${LOG_LEVEL} + + LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [httpd.conf] %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined + LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [httpd.conf] %h %l %u \"%r\" %>s %b" common + + LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [httpd.conf] %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio + + BrowserMatchNoCase ^healthcheck nolog + CustomLog /dev/stdout combinedio env=!nolog + + + ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/" + + + + + + AllowOverride All + Options None + Require all granted + + + + RequestHeader unset Proxy early + + + + TypesConfig /etc/apache2/mime.types + AddType application/x-compress .Z + AddType application/x-gzip .gz .tgz + + + + MIMEMagicFile /etc/apache2/magic + + +IncludeOptional /etc/apache2/conf.d/*.conf +AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json diff --git a/ontampa-devs/links/conf/php/php.ini b/ontampa-devs/links/conf/php/php.ini new file mode 100644 index 0000000..e69de29 diff --git a/ontampa-devs/links/conf/ssl/openssl.cnf b/ontampa-devs/links/conf/ssl/openssl.cnf new file mode 100644 index 0000000..d18d08f --- /dev/null +++ b/ontampa-devs/links/conf/ssl/openssl.cnf @@ -0,0 +1,10 @@ +[req] +prompt = no +distinguished_name = dn + +[dn] +C = US +ST = State +L = City +O = Organization +CN = ${ENV::HTTP_SERVER_NAME} diff --git a/ontampa-devs/links/docker-entrypoint.sh b/ontampa-devs/links/docker-entrypoint.sh new file mode 100644 index 0000000..e1f03ba --- /dev/null +++ b/ontampa-devs/links/docker-entrypoint.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +set -eu +#- +export LOG_LEVEL="${LOG_LEVEL:-info}" +export TZ="${TZ:-UTC}" + +export SERVER_ADMIN="${SERVER_ADMIN:-you@example.com}" + +#- +export HTTP_SERVER_PORT="${HTTP_SERVER_PORT:-80}" +export HTTP_SERVER_NAME="${HTTP_SERVER_NAME:-localhost}" + +#- +export HTTPS_SERVER_PORT="${HTTPS_SERVER_PORT:-443}" +export HTTPS_SERVER_NAME="${HTTP_SERVER_NAME:-localhost}" + +#- +export PHP_MEMORY_LIMIT="${PHP_MEMORY_LIMIT:-512M}" +export UPLOAD_MAX_FILESIZE="${UPLOAD_MAX_FILESIZE:-8M}" + +v="$(cat /htdocs/version.json | tr -d '\r\n')" +vlen="$((27-${#v}))" + +echo '+ ------------------------------------------------------------------ +' +printf '| LINKSTACK v%s%*s|\n' "${v}" "$vlen" | tr ' ' " " + +# + ---------------- + # +# | -- HTTPD.CONF -- | # +# + ---------------- + # + +echo '+ ------------------------------------------------------------------ +' +echo '| Updating Configuration: Apache Base (/etc/apache2/httpd.conf) |' +echo '| Updating Configuration: Apache SSL (/etc/apache2/conf.d/ssl.conf) |' + +openssl req -x509 -nodes -days 365 -newkey rsa:2048 -config /etc/ssl/openssl.cnf \ + -keyout /etc/apache2/conf.d/server.key -out /etc/apache2/conf.d/server.pem &> /dev/null + +echo '| Updating Configuration: PHP (/etc/php83/40-custom.ini) |' +echo "| Setting PHP Configuration: |" +echo "| upload_max_filesize = ${UPLOAD_MAX_FILESIZE} |" +echo "| memory_limit = ${PHP_MEMORY_LIMIT} |" +echo "| date.timezone = ${TZ} |" + +echo "upload_max_filesize = ${UPLOAD_MAX_FILESIZE}" >> /etc/php83/conf.d/40-custom.ini +echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /etc/php83/conf.d/40-custom.ini +echo "date.timezone = ${TZ}" >> /etc/php83/conf.d/40-custom.ini + +rm -f /htdocs/httpd.pid + +echo '| Updating Configuration: Complete |' +echo '| ------------------------------------------------------------------ |' +echo '| Running Apache |' +echo '+ ------------------------------------------------------------------ +' + +httpd -D FOREGROUND From 525e06e0df1faa3810ffeff4447ae91770ca8c1d Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 30 Dec 2025 23:01:53 -0500 Subject: [PATCH 2/9] alpine has a native dns issue --- ontampa-devs/links/Dockerfile | 85 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/ontampa-devs/links/Dockerfile b/ontampa-devs/links/Dockerfile index 023d082..dfc16ae 100644 --- a/ontampa-devs/links/Dockerfile +++ b/ontampa-devs/links/Dockerfile @@ -12,49 +12,50 @@ ENV LOG_LEVEL="debug" ENV PHP_MEMORY_LIMIT="512M" ENV UPLOAD_MAX_FILESIZE="8M" -RUN apk --no-cache --update \ - add apache2 \ - apache2-ctl \ - apache2-ssl \ - curl \ - php83-apache2 \ - php83-bcmath \ - php83-bz2 \ - php83-calendar \ - php83-common \ - php83-ctype \ - php83-curl \ - php83-dom \ - php83-fileinfo \ - php83-gd \ - php83-iconv \ - php83-json \ - php83-mbstring \ - php83-mysqli \ - php83-mysqlnd \ - php83-openssl \ - php83-pdo_mysql \ - php83-pdo_pgsql \ - php83-pdo_sqlite \ - php83-phar \ - php83-session \ - php83-xml \ - php83-tokenizer \ - php83-zip \ - php83-xmlwriter \ - php83-redis \ - tzdata \ - libarchive-tools \ - && mkdir /htdocs +RUN echo 'nameserver 1.1.1.1' > /etc/resolv.conf +RUN apk --no-cache --update add \ + apache2 apache2-ctl \ + apache2-ssl \ + php83-apache2 \ + php83-bcmath \ + php83-bz2 \ + php83-calendar \ + php83-common \ + php83-ctype \ + php83-curl \ + php83-dom \ + php83-fileinfo \ + php83-gd \ + php83-iconv \ + php83-json \ + php83-mbstring \ + php83-mysqli \ + php83-mysqlnd \ + php83-openssl \ + php83-pdo_mysql \ + php83-pdo_pgsql \ + php83-pdo_sqlite \ + php83-phar \ + php83-session \ + php83-xml \ + php83-tokenizer \ + php83-zip \ + php83-xmlwriter \ + php83-redis \ + libarchive-tools \ + curl \ + tzdata \ + && mkdir /htdocs -COPY --chown=apache:apache conf/apache2/httpd.conf /etc/apache2/httpd.conf -COPY --chown=apache:apache conf/apache2/conf.d/ssl.conf /etc/apache2/conf.d/ssl.conf - -COPY --chown=apache:apache conf/php/php.ini /etc/php83/conf.d/40-custom.ini -COPY --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf +RUN curl -sSL https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ + | bsdtar -xvf- -C /htdocs -COPY --chown=apache:apache src /htdocs +COPY --chown=apache:apache conf/apache2/httpd.conf /etc/apache2/httpd.conf +COPY --chown=apache:apache conf/apache2/conf.d/ssl.conf /etc/apache2/conf.d/ssl.conf +COPY --chown=apache:apache conf/php/php.ini /etc/php83/conf.d/40-custom.ini +COPY --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf +COPY --chown=apache:apache src /htdocs COPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/ RUN chown -R apache:apache /etc/php83 @@ -63,12 +64,8 @@ RUN chown -R apache:apache /etc/apache2 RUN chmod -R +rwX /etc/apache2 RUN chmod -R 755 /etc/php83 -RUN curl -sSL https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ - | bsdtar -xvf- -C /htdocs - RUN apachectl configtest USER apache:apache WORKDIR /htdocs CMD ["docker-entrypoint.sh"] - From 9c1acff41d634a5de6bce6f3c0c1a1a63a348e82 Mon Sep 17 00:00:00 2001 From: jherron Date: Wed, 31 Dec 2025 15:05:14 -0500 Subject: [PATCH 3/9] switch to ubi9 --- ontampa-devs/links/Dockerfile | 99 +++++++++---------- ontampa-devs/links/Makefile | 6 ++ .../conf/{apache2 => httpd}/conf.d/ssl.conf | 20 ++-- .../links/conf/{apache2 => httpd}/httpd.conf | 11 +-- ontampa-devs/links/docker-entrypoint.sh | 15 ++- 5 files changed, 70 insertions(+), 81 deletions(-) create mode 100644 ontampa-devs/links/Makefile rename ontampa-devs/links/conf/{apache2 => httpd}/conf.d/ssl.conf (66%) rename ontampa-devs/links/conf/{apache2 => httpd}/httpd.conf (97%) diff --git a/ontampa-devs/links/Dockerfile b/ontampa-devs/links/Dockerfile index dfc16ae..6860cf6 100644 --- a/ontampa-devs/links/Dockerfile +++ b/ontampa-devs/links/Dockerfile @@ -1,71 +1,64 @@ -FROM alpine:3.23.2 +FROM registry.access.redhat.com/ubi9/ubi-minimal:latest -ENV TZ="UTC" ENV SERVER_ADMIN="cloud@ontampa.dev" -ENV HTTP_SERVER_NAME="localhost.localdomain" +ENV LOG_LEVEL="debug" +ENV PHP_MEMORY_LIMIT="512M" +ENV UPLOAD_MAX_FILESIZE="8M" + +ENV HTTP_SERVER_NAME="localhost" ENV HTTPS_SERVER_NAME="${HTTP_SERVER_NAME}" ENV HTTP_SERVER_PORT="8080" ENV HTTPS_SERVER_PORT="8443" + EXPOSE $HTTP_SERVER_PORT $HTTPS_SERVER_PORT -ENV LOG_LEVEL="debug" -ENV PHP_MEMORY_LIMIT="512M" -ENV UPLOAD_MAX_FILESIZE="8M" +# dnf optimization +RUN echo 'max_parallel_downloads=20' >> /etc/dnf/dnf.conf +RUN echo 'fastestmirror=True' >> /etc/dnf/dnf.conf + +# disable rhsm warnings +RUN printf "[rhsm]\nauto_enable_yum_plugins = 0\n" > rhsm.conf +RUN printf "[main]\nenabled=0\n" > /etc/dnf/plugins/subscription-manager.conf -RUN echo 'nameserver 1.1.1.1' > /etc/resolv.conf +RUN microdnf install -y dnf \ + && dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ + && dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm -RUN apk --no-cache --update add \ - apache2 apache2-ctl \ - apache2-ssl \ - php83-apache2 \ - php83-bcmath \ - php83-bz2 \ - php83-calendar \ - php83-common \ - php83-ctype \ - php83-curl \ - php83-dom \ - php83-fileinfo \ - php83-gd \ - php83-iconv \ - php83-json \ - php83-mbstring \ - php83-mysqli \ - php83-mysqlnd \ - php83-openssl \ - php83-pdo_mysql \ - php83-pdo_pgsql \ - php83-pdo_sqlite \ - php83-phar \ - php83-session \ - php83-xml \ - php83-tokenizer \ - php83-zip \ - php83-xmlwriter \ - php83-redis \ - libarchive-tools \ - curl \ - tzdata \ +RUN dnf config-manager --set-enabled remi-modular +RUN dnf module reset php -y \ + && dnf module enable php:remi-8.3 -y + +RUN microdnf install -y \ + httpd mod_ssl libarchive \ + php php-common php-bcmath php-gd \ + php-mbstring php-mysqlnd php-pgsql \ + php-xml php-pecl-zip php-pecl-redis \ + libarchive bsdtar openssl \ + && microdnf clean all \ && mkdir /htdocs -RUN curl -sSL https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ - | bsdtar -xvf- -C /htdocs +RUN curl -L --compressed --http2 --tcp-fastopen --buffer --keepalive-time 60 \ + https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ + | bsdtar -C /htdocs --strip-components 1 -xf- + -COPY --chown=apache:apache conf/apache2/httpd.conf /etc/apache2/httpd.conf -COPY --chown=apache:apache conf/apache2/conf.d/ssl.conf /etc/apache2/conf.d/ssl.conf -COPY --chown=apache:apache conf/php/php.ini /etc/php83/conf.d/40-custom.ini -COPY --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf -COPY --chown=apache:apache src /htdocs COPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/ -RUN chown -R apache:apache /etc/php83 -RUN chown -R apache:apache /etc/ssl/openssl.cnf -RUN chown -R apache:apache /etc/apache2 -RUN chmod -R +rwX /etc/apache2 -RUN chmod -R 755 /etc/php83 +COPY --chmod=0750 --chown=apache:apache conf/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf +COPY --chmod=0750 --chown=apache:apache conf/php/php.ini /etc/php.d/40-custom.ini +COPY --chmod=0750 --chown=apache:apache conf/httpd/httpd.conf /etc/httpd/httpd.conf +COPY --chmod=0750 --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf +COPY --chmod=0750 --chown=apache:apache src /htdocs + +RUN mkdir /etc/httpd/conf.d/$HTTP_SERVER_NAME \ + && chown apache:apache /etc/httpd/conf.d/$HTTP_SERVER_NAME -RUN apachectl configtest -USER apache:apache +RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ + -config /etc/ssl/openssl.cnf \ + -keyout /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} \ + -out /etc/httpd/conf.d/${HTTP_SERVER_NAME}/cert-${HTTP_SERVER_NAME} &> /dev/null +RUN httpd -t +USER apache WORKDIR /htdocs CMD ["docker-entrypoint.sh"] diff --git a/ontampa-devs/links/Makefile b/ontampa-devs/links/Makefile new file mode 100644 index 0000000..0b2a6f7 --- /dev/null +++ b/ontampa-devs/links/Makefile @@ -0,0 +1,6 @@ +TAG=localhost/linkstack-ontampa-dev:latest + +default: build + +build: + podman rmi -f $(TAG) && podman build --no-cache --squash-all . -t $(TAG) diff --git a/ontampa-devs/links/conf/apache2/conf.d/ssl.conf b/ontampa-devs/links/conf/httpd/conf.d/ssl.conf similarity index 66% rename from ontampa-devs/links/conf/apache2/conf.d/ssl.conf rename to ontampa-devs/links/conf/httpd/conf.d/ssl.conf index efa62b7..9471aea 100644 --- a/ontampa-devs/links/conf/apache2/conf.d/ssl.conf +++ b/ontampa-devs/links/conf/httpd/conf.d/ssl.conf @@ -1,29 +1,21 @@ -LoadModule ssl_module modules/mod_ssl.so -LoadModule socache_shmcb_module modules/mod_socache_shmcb.so + - - RewriteEngine On - RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/ - RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L] - + PassEnv HTTP_SERVER_NAME + PassEnv SERVER_ADMIN + PassEnv LOG_LEVEL - SSLEngine on - SSLCertificateFile /etc/ssl/apache2/server.pem - SSLCertificateKeyFile /etc/ssl/apache2/server.key + SSLCertificateFile /etc/httpd/conf.d/${HTTP_SERVER_NAME}/cert-${HTTP_SERVER_NAME} + SSLCertificateKeyFile /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} - PassEnv HTTP_SERVER_NAME ServerName ${HTTP_SERVER_NAME} - - PassEnv SERVER_ADMIN ServerAdmin ${SERVER_ADMIN} ErrorLog /dev/stderr TransferLog "logs/ssl-transfer.log" CustomLog /dev/stderr combined - PassEnv LOG_LEVEL LogLevel ${LOG_LEVEL} diff --git a/ontampa-devs/links/conf/apache2/httpd.conf b/ontampa-devs/links/conf/httpd/httpd.conf similarity index 97% rename from ontampa-devs/links/conf/apache2/httpd.conf rename to ontampa-devs/links/conf/httpd/httpd.conf index 27700aa..23e9829 100644 --- a/ontampa-devs/links/conf/apache2/httpd.conf +++ b/ontampa-devs/links/conf/httpd/httpd.conf @@ -5,9 +5,6 @@ ServerSignature On PassEnv HTTP_SERVER_PORT Listen ${HTTP_SERVER_PORT} - -PassEnv HTTPS_SERVER_PORT -Listen ${HTTPS_SERVER_PORT} PassEnv SERVER_ADMIN ServerAdmin ${SERVER_ADMIN} @@ -17,7 +14,9 @@ ServerName ${HTTP_SERVER_NAME} PidFile /htdocs/httpd.pid -LoadModule mpm_prefork_module modules/mod_mpm_prefork.so + +LoadModule autoindex_module modules/mod_autoindex.so + LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_core_module modules/mod_authn_core.so LoadModule authz_host_module modules/mod_authz_host.so @@ -30,6 +29,7 @@ LoadModule reqtimeout_module modules/mod_reqtimeout.so LoadModule filter_module modules/mod_filter.so LoadModule deflate_module modules/mod_deflate.so LoadModule mime_module modules/mod_mime.so +LoadModule mpm_prefork_module modules/mod_mpm_prefork.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so @@ -39,7 +39,6 @@ LoadModule setenvif_module modules/mod_setenvif.so LoadModule version_module modules/mod_version.so LoadModule unixd_module modules/mod_unixd.so LoadModule status_module modules/mod_status.so -LoadModule autoindex_module modules/mod_autoindex.so @@ -102,7 +101,7 @@ LogLevel ${LOG_LEVEL} - TypesConfig /etc/apache2/mime.types + TypesConfig /etc/httpd/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz diff --git a/ontampa-devs/links/docker-entrypoint.sh b/ontampa-devs/links/docker-entrypoint.sh index e1f03ba..d24cf51 100644 --- a/ontampa-devs/links/docker-entrypoint.sh +++ b/ontampa-devs/links/docker-entrypoint.sh @@ -30,21 +30,20 @@ printf '| LINKSTACK v%s%*s|\n' "${v}" "$vlen" | tr ' ' " " # + ---------------- + # echo '+ ------------------------------------------------------------------ +' -echo '| Updating Configuration: Apache Base (/etc/apache2/httpd.conf) |' -echo '| Updating Configuration: Apache SSL (/etc/apache2/conf.d/ssl.conf) |' +echo '| Updating Configuration: Apache Base (/etc/httpd/httpd.conf) |' +echo '| Updating Configuration: Apache SSL (/etc/httpd/conf.d/ssl.conf) |' -openssl req -x509 -nodes -days 365 -newkey rsa:2048 -config /etc/ssl/openssl.cnf \ - -keyout /etc/apache2/conf.d/server.key -out /etc/apache2/conf.d/server.pem &> /dev/null +#openssl req -x509 -nodes -days 365 -newkey rsa:2048 -config /etc/ssl/openssl.cnf -keyout /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} -out /etc/httpd/conf.d/server.pem -echo '| Updating Configuration: PHP (/etc/php83/40-custom.ini) |' +echo '| Updating Configuration: PHP (/etc/php.d/40-custom.ini) |' echo "| Setting PHP Configuration: |" echo "| upload_max_filesize = ${UPLOAD_MAX_FILESIZE} |" echo "| memory_limit = ${PHP_MEMORY_LIMIT} |" echo "| date.timezone = ${TZ} |" -echo "upload_max_filesize = ${UPLOAD_MAX_FILESIZE}" >> /etc/php83/conf.d/40-custom.ini -echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /etc/php83/conf.d/40-custom.ini -echo "date.timezone = ${TZ}" >> /etc/php83/conf.d/40-custom.ini +echo "upload_max_filesize = ${UPLOAD_MAX_FILESIZE}" >> /etc/php.d/40-custom.ini +echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /etc/php.d/40-custom.ini +echo "date.timezone = ${TZ}" >> /etc/php.d/40-custom.ini rm -f /htdocs/httpd.pid From 4696e7b846c8d3fadf0ff885b0f7d7139f3f2dd9 Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 6 Jan 2026 09:21:59 -0500 Subject: [PATCH 4/9] sync current status --- ontampa-devs/link/Dockerfile | 22 ++ ontampa-devs/{links => link}/Makefile | 0 .../conf/httpd/conf.d/host-linkstack.conf | 27 ++ .../conf/httpd/conf.d}/openssl.cnf | 0 ontampa-devs/link/conf/httpd/conf/httpd.conf | 93 +++++ .../{links => link}/conf/httpd/httpd.conf | 57 ++-- ontampa-devs/{links => link}/conf/php/php.ini | 0 ontampa-devs/link/entrypoint.sh | 35 ++ ontampa-devs/{links/Dockerfile => link/tmp} | 0 ontampa-devs/links/README.md | 318 ------------------ ontampa-devs/links/conf/httpd/conf.d/ssl.conf | 34 -- ontampa-devs/links/docker-entrypoint.sh | 55 --- 12 files changed, 200 insertions(+), 441 deletions(-) create mode 100644 ontampa-devs/link/Dockerfile rename ontampa-devs/{links => link}/Makefile (100%) create mode 100644 ontampa-devs/link/conf/httpd/conf.d/host-linkstack.conf rename ontampa-devs/{links/conf/ssl => link/conf/httpd/conf.d}/openssl.cnf (100%) create mode 100644 ontampa-devs/link/conf/httpd/conf/httpd.conf rename ontampa-devs/{links => link}/conf/httpd/httpd.conf (73%) rename ontampa-devs/{links => link}/conf/php/php.ini (100%) create mode 100644 ontampa-devs/link/entrypoint.sh rename ontampa-devs/{links/Dockerfile => link/tmp} (100%) delete mode 100644 ontampa-devs/links/README.md delete mode 100644 ontampa-devs/links/conf/httpd/conf.d/ssl.conf delete mode 100644 ontampa-devs/links/docker-entrypoint.sh diff --git a/ontampa-devs/link/Dockerfile b/ontampa-devs/link/Dockerfile new file mode 100644 index 0000000..6fd4f56 --- /dev/null +++ b/ontampa-devs/link/Dockerfile @@ -0,0 +1,22 @@ +FROM registry.access.redhat.com/ubi9/ubi-minimal:latest as builder +ENV UPSTREAM="https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip" +RUN 1>/dev/null \ + dnf install \ + -y \ + --disableplugin subscription-manager \ + httpd \ + mod_ssl \ + bsdtar \ + libarchive +RUN mkdir /htdocs \ + && curl -L \ + --compressed \ + --http2 \ + --tcp-fastopen \ + --buffer \ + --keepalive-time 60 ${UPSTREAM} \ + | bsdtar -C /var/www/html --strip-components 1 -xf- + +FROM quay.io/sclorg/php-83-c9s +COPY --from=builder /var/www/html /var/www/html + diff --git a/ontampa-devs/links/Makefile b/ontampa-devs/link/Makefile similarity index 100% rename from ontampa-devs/links/Makefile rename to ontampa-devs/link/Makefile diff --git a/ontampa-devs/link/conf/httpd/conf.d/host-linkstack.conf b/ontampa-devs/link/conf/httpd/conf.d/host-linkstack.conf new file mode 100644 index 0000000..4d826fc --- /dev/null +++ b/ontampa-devs/link/conf/httpd/conf.d/host-linkstack.conf @@ -0,0 +1,27 @@ + + + PassEnv HTTP_SERVER_NAME + ServerName ${HTTP_SERVER_NAME} + + PassEnv LOG_LEVEL + LogLevel ${LOG_LEVEL} + + DocumentRoot "/htdocs" + + ErrorLog /dev/stderr + CustomLog /dev/stderr combined + + + Options Indexes FollowSymLinks + AllowOverride None + Require all granted + + + + + + + + + + diff --git a/ontampa-devs/links/conf/ssl/openssl.cnf b/ontampa-devs/link/conf/httpd/conf.d/openssl.cnf similarity index 100% rename from ontampa-devs/links/conf/ssl/openssl.cnf rename to ontampa-devs/link/conf/httpd/conf.d/openssl.cnf diff --git a/ontampa-devs/link/conf/httpd/conf/httpd.conf b/ontampa-devs/link/conf/httpd/conf/httpd.conf new file mode 100644 index 0000000..5e95a24 --- /dev/null +++ b/ontampa-devs/link/conf/httpd/conf/httpd.conf @@ -0,0 +1,93 @@ +IncludeOptional conf.d/*.conf +Include conf.modules.d/*.conf + +ServerTokens OS +ServerSignature On + +ServerRoot "/etc/httpd" +ServerAdmin root@localhost + +PassEnv HTTP_SERVER_NAME +ServerName ${HTTP_SERVER_NAME} + +PassEnv HTTP_SERVER_PORT +Listen ${HTTP_SERVER_PORT} + +User apache +Group apache + + + AllowOverride none + Require all denied + + +DocumentRoot "/var/www/html" + + + AllowOverride None + Require all denied + + + + Options Indexes FollowSymLinks + AllowOverride None + Require all granted + + + + DirectoryIndex index.html + + + + Require all denied + + +ErrorLog /dev/stderr +PassEnv LOG_LEVEL +LogLevel ${LOG_LEVEL} + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined + LogFormat "%h %l %u %t \"%r\" %>s %b" common + + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio + + CustomLog /dev/stdout combinedio env=!nolog + + + + ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" + + + + AllowOverride None + Options None + Require all granted + + + + TypesConfig /etc/mime.types + AddType application/x-gzip .tgz + + AddEncoding x-compress .Z + AddEncoding x-gzip .gz .tgz + AddType application/x-compress .Z + AddType application/x-gzip .gz .tgz + AddHandler cgi-script .cgi + AddHandler type-map var + AddType text/html .shtml + AddOutputFilter INCLUDES .shtml + +AddDefaultCharset UTF-8 + + + MIMEMagicFile conf/magic + + +#ErrorDocument 500 "The server made a boo boo." +#ErrorDocument 404 /missing.html +#ErrorDocument 404 "/cgi-bin/missing_handler.pl" +#ErrorDocument 402 http://www.example.com/subscription_info.html + +EnableMMAP off +EnableSendfile on diff --git a/ontampa-devs/links/conf/httpd/httpd.conf b/ontampa-devs/link/conf/httpd/httpd.conf similarity index 73% rename from ontampa-devs/links/conf/httpd/httpd.conf rename to ontampa-devs/link/conf/httpd/httpd.conf index 23e9829..807ba87 100644 --- a/ontampa-devs/links/conf/httpd/httpd.conf +++ b/ontampa-devs/link/conf/httpd/httpd.conf @@ -1,50 +1,37 @@ ServerTokens OS -ServerRoot /var/www -DocumentRoot "/htdocs" ServerSignature On PassEnv HTTP_SERVER_PORT Listen ${HTTP_SERVER_PORT} -PassEnv SERVER_ADMIN -ServerAdmin ${SERVER_ADMIN} - PassEnv HTTP_SERVER_NAME ServerName ${HTTP_SERVER_NAME} -PidFile /htdocs/httpd.pid - - -LoadModule autoindex_module modules/mod_autoindex.so +PidFile /run/httpd/httpd.pid -LoadModule authn_file_module modules/mod_authn_file.so -LoadModule authn_core_module modules/mod_authn_core.so -LoadModule authz_host_module modules/mod_authz_host.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule authz_core_module modules/mod_authz_core.so LoadModule access_compat_module modules/mod_access_compat.so +LoadModule autoindex_module modules/mod_autoindex.so +LoadModule authn_file_module modules/mod_authn_file.so +LoadModule authn_core_module modules/mod_authn_core.so +LoadModule authz_host_module modules/mod_authz_host.so +LoadModule authz_groupfile_module modules/mod_authz_groupfile.so +LoadModule authz_user_module modules/mod_authz_user.so +LoadModule authz_core_module modules/mod_authz_core.so LoadModule auth_basic_module modules/mod_auth_basic.so -LoadModule reqtimeout_module modules/mod_reqtimeout.so -LoadModule filter_module modules/mod_filter.so LoadModule deflate_module modules/mod_deflate.so -LoadModule mime_module modules/mod_mime.so -LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule env_module modules/mod_env.so +LoadModule expires_module modules/mod_expires.so +LoadModule filter_module modules/mod_filter.so +LoadModule headers_module modules/mod_headers.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so -LoadModule env_module modules/mod_env.so -LoadModule expires_module modules/mod_expires.so -LoadModule headers_module modules/mod_headers.so +LoadModule mime_module modules/mod_mime.so +LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule reqtimeout_module modules/mod_reqtimeout.so +LoadModule status_module modules/mod_status.so LoadModule setenvif_module modules/mod_setenvif.so -LoadModule version_module modules/mod_version.so LoadModule unixd_module modules/mod_unixd.so -LoadModule status_module modules/mod_status.so - - - - - - +LoadModule version_module modules/mod_version.so LoadModule dir_module modules/mod_dir.so LoadModule alias_module modules/mod_alias.so @@ -66,9 +53,11 @@ LoadModule negotiation_module modules/mod_negotiation.so AllowOverride All Require all granted + DirectoryIndex index.html + Require all denied @@ -85,12 +74,12 @@ LogLevel ${LOG_LEVEL} CustomLog /dev/stdout combinedio env=!nolog - ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/" + ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" - + AllowOverride All Options None Require all granted @@ -101,7 +90,7 @@ LogLevel ${LOG_LEVEL} - TypesConfig /etc/httpd/mime.types + TypesConfig /etc/httpd/conf.d/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz @@ -110,5 +99,5 @@ LogLevel ${LOG_LEVEL} MIMEMagicFile /etc/apache2/magic -IncludeOptional /etc/apache2/conf.d/*.conf +IncludeOptional /etc/httpd/conf.d/*.conf AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json diff --git a/ontampa-devs/links/conf/php/php.ini b/ontampa-devs/link/conf/php/php.ini similarity index 100% rename from ontampa-devs/links/conf/php/php.ini rename to ontampa-devs/link/conf/php/php.ini diff --git a/ontampa-devs/link/entrypoint.sh b/ontampa-devs/link/entrypoint.sh new file mode 100644 index 0000000..2f1542c --- /dev/null +++ b/ontampa-devs/link/entrypoint.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +set -eu +#- +export LOG_LEVEL="${LOG_LEVEL:-info}" +export TZ="${TZ:-UTC}" + +#- +export HTTP_SERVER_PORT="${HTTP_SERVER_PORT:-8080}" +export HTTP_SERVER_NAME="${HTTP_SERVER_NAME:-localhost}" + +#- +export PHP_MEMORY_LIMIT="${PHP_MEMORY_LIMIT:-512M}" +export UPLOAD_MAX_FILESIZE="${UPLOAD_MAX_FILESIZE:-8M}" + +v="$(cat /htdocs/version.json | tr -d '\r\n')" +vlen="$((27-${#v}))" + +echo '+ -------------------------------------------------------------- +' +printf '| LINKSTACK v%s%*s|\n' "${v}" "$vlen" | tr ' ' " " + +echo '| Current configuration |' +echo '| HTTP Port: ${HTTP_SERVER_PORT} |' +echo '| Updating Configuration: PHP (/etc/php.d/40-custom.ini) |' +echo '+ ---------------------------------------------------------------+' +echo '| Setting PHP Configuration: |' +echo "| upload_max_filesize = ${UPLOAD_MAX_FILESIZE} |" +echo "| memory_limit = ${PHP_MEMORY_LIMIT} |" +echo "| date.timezone = ${TZ} |" + +echo "upload_max_filesize = ${UPLOAD_MAX_FILESIZE}" >> /etc/php.d/40-custom.ini +echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /etc/php.d/40-custom.ini +echo "date.timezone = ${TZ}" >> /etc/php.d/40-custom.ini + +httpd -DFOREGROUND diff --git a/ontampa-devs/links/Dockerfile b/ontampa-devs/link/tmp similarity index 100% rename from ontampa-devs/links/Dockerfile rename to ontampa-devs/link/tmp diff --git a/ontampa-devs/links/README.md b/ontampa-devs/links/README.md deleted file mode 100644 index e7f23ea..0000000 --- a/ontampa-devs/links/README.md +++ /dev/null @@ -1,318 +0,0 @@ -

-
- - - - -

- -

Docker Edition


-

Pull, deploy, enjoy!


- -

- About • - About LinkStack • - Pull • - Supported Architectures • - Deployment • - Updating • - Build • - Persistent storage • - Reverse Proxy -


- -

- Live Demo -

- -

- - - - -

- -

- Docker Hub -

- - -## About - -The official docker version of [LinkStack](https://github.com/linkstackorg/linkstack). This docker image is a simple to set up solution, containing everything you need to run LinkStack. - -The docker version of LinkStack retains all the features and customization options of the [original version](https://github.com/linkstackorg/linkstack). - -This docker is based on [Alpine Linux](https://www.alpinelinux.org/), a Linux distribution designed to be small, simple and secure. The web server is running [Apache2](https://www.apache.org/), a free and open-source cross-platform web server software. The docker comes with [PHP 8.3](https://www.php.net/releases/8.3/en.php) for high compatibility and performance. - -#### Using the docker is as simple as pulling and deploying. - -
- - -## About LinkStack - -

- - - - - - -

- -

-LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface. - -

LinkStack allows you to create a personal profile page. Many social media platforms only allow for one link. With this, you can have all the links you want clickable on one site. Set up your personal site on your own server in a few clicks.

-

- -
- -

-Learn more about LinkStack, and all the features here: -

- -
- -

- About LinkStack -

- -
- - -## Pull - -```shell -docker pull linkstackorg/linkstack -``` - -
- -Alternative mirror: - -```shell -docker pull ghcr.io/linkstackorg/linkstack -``` - -
- - -## Supported Architectures - -- [`linux/amd64`](https://hub.docker.com/r/linkstackorg/linkstack/tags) -- [`linux/arm/v6`](https://hub.docker.com/r/linkstackorg/linkstack/tags) -- [`linux/arm/v7`](https://hub.docker.com/r/linkstackorg/linkstack/tags) -- [`linux/arm64`](https://hub.docker.com/r/linkstackorg/linkstack/tags) - -
- - -## Deployment - -You may change port *80*, *443* to your preferred values. - -Both HTTP and HTTPS are supported and exposed by default. - -### Optional environment variables - -- `SERVER_ADMIN` (the email, defaults to `you@example.com`) -- `HTTP_SERVER_NAME` (the [server name](https://httpd.apache.org/docs/2.4/fr/mod/core.html#servername), defaults to `localhost`) -- `HTTPS_SERVER_NAME` (the [server name](https://httpd.apache.org/docs/2.4/fr/mod/core.html#servername), defaults to `localhost`) -- `LOG_LEVEL` (the [log level](https://httpd.apache.org/docs/2.4/fr/mod/core.html#loglevel), defaults to `info`) -- `TZ` (the [timezone](https://www.php.net/manual/timezones.php), defaults to `UTC`) -- `PHP_MEMORY_LIMIT` (the [memory-limit](https://www.php.net/manual/ini.core.php#ini.memory-limit), defaults to `256M`) -- `UPLOAD_MAX_FILESIZE` (the [upload_max_filesize](https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize), defaults to `8M`) - -
- -#### Deploy - -
-Read more about persistent storage - -
- -**Create a new volume:** -
docker volume create linkstack
- -
- -
-docker run --detach \
-    --name linkstack \
-    --publish 80:80 \
-    --publish 443:443 \
-    --restart unless-stopped \
-    --mount source=linkstack,target=/htdocs \
-    linkstackorg/linkstack
-
- -
- -#### Custom deployment - -
-docker run --detach \
-    --name linkstack \
-    --hostname linkstack \
-    --env HTTP_SERVER_NAME="www.example.xyz" \
-    --env HTTPS_SERVER_NAME="www.example.xyz" \
-    --env SERVER_ADMIN="admin@example.xyz" \
-    --env TZ="Europe/Berlin" \
-    --env PHP_MEMORY_LIMIT="512M" \
-    --env UPLOAD_MAX_FILESIZE="16M" \
-    --publish 80:80 \
-    --publish 443:443 \
-    --restart unless-stopped \
-    --mount source=linkstack,target=/htdocs \
-    linkstackorg/linkstack
-
- -
- -#### Docker Compose -Use HTTPS for your reverse proxy to avoid issues
-Example config. - -
-version: "3.8"
-
-services:
-
-  linkstack:
-    hostname: 'linkstack'
-    image: 'linkstackorg/linkstack:latest'
-    environment:
-      TZ: 'Europe/Berlin'
-      SERVER_ADMIN: 'admin@example.com'
-      HTTP_SERVER_NAME: 'example.com'
-      HTTPS_SERVER_NAME: 'example.com'
-      LOG_LEVEL: 'info'
-      PHP_MEMORY_LIMIT: '256M'
-      UPLOAD_MAX_FILESIZE: '8M'
-    volumes:
-      - 'linkstack_data:/htdocs'
-    ports:
-      - '8190:443'
-    restart: unless-stopped
-
-volumes:
-  linkstack_data:
-
- -
- - -## Updating - -When a **new version** is released, you will get an update notification on your Admin Panel. - -### Automatic one click Updater -This updater allows you to update your installation with just one click. - -
- -**How to use the Automatic Updater:** - -- To update your instance, click on the update notification on your Admin Panel. - -- Click on “Update automatically” and the updater will take care of the rest. - -
- - -## Build - -**If you wish to build or modify your own docker version of LinkStack, you can do so with the instructions below:** - -- Download this GitHub repository as well as the latest release of LinkStack from [here](https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip). -- Place the downloaded release files directly into the linkstack folder from [this repository](https://github.com/linkstackorg/linkstack-docker/archive/refs/heads/main.zip). - -From the docker directory, run the command: -
-docker build -t linkstack .
-
You can now set up your application on your defined ports. - -
- - -## Persistent storage - -Persistent storage for docker containers is storage that is **not** lost when the container is stopped or removed. - -This is advantageous since it means that data may be saved even if the container is removed. This is especially crucial when dealing with data that must be retained throughout restarts, such as a database. - - -All files important to run LinkStack are stored in the "htdocs" folder found in the root directory of your docker container. - -We recommend mounting that entire folder to an external volume. - -
- -**However, some user may prefer to preserve only individual files.**
-_Expand the details section below to read more about this:_ - -
-If you wish to save only selective files, you may save the following files and folders: - -``` -/htdocs/.env -/htdocs/database/database.sqlite -/htdocs/config/advanced-config.php -/htdocs/assets/linkstack/images/avatar.png -/htdocs/themes (folder) -/htdocs/assets/img (folder) -``` - -**This might change with future releases.** -
- -
- - -## Reverse Proxy - -### NGINX: - -**Below is an example NGINX setup for a reverse proxy.**
-Make sure to use HTTPS to access your container to avoid mixed content errors -
-
-server {
-  listen        443 ssl;
-  listen        [::]:443 ssl;
-  listen        80;
-  listen        [::]:80;
-  server_name   your.domain.name;
-
-  location / {
-    # Replace with the IP address and port number of your Docker container.
-    proxy_pass                          https://127.0.0.1:443;
-    proxy_set_header Host               $host;
-    proxy_set_header X-Real-IP          $remote_addr;
-
-    proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
-    proxy_set_header X-Forwarded-Proto  https;
-    proxy_set_header X-VerifiedViaNginx yes;
-    proxy_read_timeout                  60;
-    proxy_connect_timeout               60;
-    proxy_redirect                      off;
-
-    # Specific for websockets: force the use of HTTP/1.1 and set the Upgrade header
-    proxy_http_version 1.1;
-    proxy_set_header Upgrade $http_upgrade;
-    proxy_set_header Connection 'upgrade';
-    proxy_cache_bypass $http_upgrade;
-    proxy_set_header X-Forwarded-Proto $scheme;
-    
-    # Fixes Mixed Content errors.
-    add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
-  }
-}
-
-
- -
-
diff --git a/ontampa-devs/links/conf/httpd/conf.d/ssl.conf b/ontampa-devs/links/conf/httpd/conf.d/ssl.conf deleted file mode 100644 index 9471aea..0000000 --- a/ontampa-devs/links/conf/httpd/conf.d/ssl.conf +++ /dev/null @@ -1,34 +0,0 @@ - - - PassEnv HTTP_SERVER_NAME - PassEnv SERVER_ADMIN - PassEnv LOG_LEVEL - - - SSLEngine on - SSLCertificateFile /etc/httpd/conf.d/${HTTP_SERVER_NAME}/cert-${HTTP_SERVER_NAME} - SSLCertificateKeyFile /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} - - ServerName ${HTTP_SERVER_NAME} - ServerAdmin ${SERVER_ADMIN} - - ErrorLog /dev/stderr - TransferLog "logs/ssl-transfer.log" - CustomLog /dev/stderr combined - - LogLevel ${LOG_LEVEL} - - - SSLOptions +StdEnvVars - - - - SSLOptions +StdEnvVars - - - BrowserMatch "MSIE [2-5]" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [ssl.conf] %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined - - diff --git a/ontampa-devs/links/docker-entrypoint.sh b/ontampa-devs/links/docker-entrypoint.sh deleted file mode 100644 index d24cf51..0000000 --- a/ontampa-devs/links/docker-entrypoint.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -set -eu -#- -export LOG_LEVEL="${LOG_LEVEL:-info}" -export TZ="${TZ:-UTC}" - -export SERVER_ADMIN="${SERVER_ADMIN:-you@example.com}" - -#- -export HTTP_SERVER_PORT="${HTTP_SERVER_PORT:-80}" -export HTTP_SERVER_NAME="${HTTP_SERVER_NAME:-localhost}" - -#- -export HTTPS_SERVER_PORT="${HTTPS_SERVER_PORT:-443}" -export HTTPS_SERVER_NAME="${HTTP_SERVER_NAME:-localhost}" - -#- -export PHP_MEMORY_LIMIT="${PHP_MEMORY_LIMIT:-512M}" -export UPLOAD_MAX_FILESIZE="${UPLOAD_MAX_FILESIZE:-8M}" - -v="$(cat /htdocs/version.json | tr -d '\r\n')" -vlen="$((27-${#v}))" - -echo '+ ------------------------------------------------------------------ +' -printf '| LINKSTACK v%s%*s|\n' "${v}" "$vlen" | tr ' ' " " - -# + ---------------- + # -# | -- HTTPD.CONF -- | # -# + ---------------- + # - -echo '+ ------------------------------------------------------------------ +' -echo '| Updating Configuration: Apache Base (/etc/httpd/httpd.conf) |' -echo '| Updating Configuration: Apache SSL (/etc/httpd/conf.d/ssl.conf) |' - -#openssl req -x509 -nodes -days 365 -newkey rsa:2048 -config /etc/ssl/openssl.cnf -keyout /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} -out /etc/httpd/conf.d/server.pem - -echo '| Updating Configuration: PHP (/etc/php.d/40-custom.ini) |' -echo "| Setting PHP Configuration: |" -echo "| upload_max_filesize = ${UPLOAD_MAX_FILESIZE} |" -echo "| memory_limit = ${PHP_MEMORY_LIMIT} |" -echo "| date.timezone = ${TZ} |" - -echo "upload_max_filesize = ${UPLOAD_MAX_FILESIZE}" >> /etc/php.d/40-custom.ini -echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /etc/php.d/40-custom.ini -echo "date.timezone = ${TZ}" >> /etc/php.d/40-custom.ini - -rm -f /htdocs/httpd.pid - -echo '| Updating Configuration: Complete |' -echo '| ------------------------------------------------------------------ |' -echo '| Running Apache |' -echo '+ ------------------------------------------------------------------ +' - -httpd -D FOREGROUND From 1e12201f0967e1d2ab7e30a61ffa7197d054e1bb Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 6 Jan 2026 09:52:57 -0500 Subject: [PATCH 5/9] fix Dockerfile --- ontampa-devs/link/Dockerfile | 84 +++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 21 deletions(-) diff --git a/ontampa-devs/link/Dockerfile b/ontampa-devs/link/Dockerfile index 6fd4f56..6860cf6 100644 --- a/ontampa-devs/link/Dockerfile +++ b/ontampa-devs/link/Dockerfile @@ -1,22 +1,64 @@ -FROM registry.access.redhat.com/ubi9/ubi-minimal:latest as builder -ENV UPSTREAM="https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip" -RUN 1>/dev/null \ - dnf install \ - -y \ - --disableplugin subscription-manager \ - httpd \ - mod_ssl \ - bsdtar \ - libarchive -RUN mkdir /htdocs \ - && curl -L \ - --compressed \ - --http2 \ - --tcp-fastopen \ - --buffer \ - --keepalive-time 60 ${UPSTREAM} \ - | bsdtar -C /var/www/html --strip-components 1 -xf- - -FROM quay.io/sclorg/php-83-c9s -COPY --from=builder /var/www/html /var/www/html +FROM registry.access.redhat.com/ubi9/ubi-minimal:latest +ENV SERVER_ADMIN="cloud@ontampa.dev" +ENV LOG_LEVEL="debug" +ENV PHP_MEMORY_LIMIT="512M" +ENV UPLOAD_MAX_FILESIZE="8M" + +ENV HTTP_SERVER_NAME="localhost" +ENV HTTPS_SERVER_NAME="${HTTP_SERVER_NAME}" +ENV HTTP_SERVER_PORT="8080" +ENV HTTPS_SERVER_PORT="8443" + +EXPOSE $HTTP_SERVER_PORT $HTTPS_SERVER_PORT + +# dnf optimization +RUN echo 'max_parallel_downloads=20' >> /etc/dnf/dnf.conf +RUN echo 'fastestmirror=True' >> /etc/dnf/dnf.conf + +# disable rhsm warnings +RUN printf "[rhsm]\nauto_enable_yum_plugins = 0\n" > rhsm.conf +RUN printf "[main]\nenabled=0\n" > /etc/dnf/plugins/subscription-manager.conf + +RUN microdnf install -y dnf \ + && dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ + && dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm + +RUN dnf config-manager --set-enabled remi-modular +RUN dnf module reset php -y \ + && dnf module enable php:remi-8.3 -y + +RUN microdnf install -y \ + httpd mod_ssl libarchive \ + php php-common php-bcmath php-gd \ + php-mbstring php-mysqlnd php-pgsql \ + php-xml php-pecl-zip php-pecl-redis \ + libarchive bsdtar openssl \ + && microdnf clean all \ + && mkdir /htdocs + +RUN curl -L --compressed --http2 --tcp-fastopen --buffer --keepalive-time 60 \ + https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ + | bsdtar -C /htdocs --strip-components 1 -xf- + + +COPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/ + +COPY --chmod=0750 --chown=apache:apache conf/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf +COPY --chmod=0750 --chown=apache:apache conf/php/php.ini /etc/php.d/40-custom.ini +COPY --chmod=0750 --chown=apache:apache conf/httpd/httpd.conf /etc/httpd/httpd.conf +COPY --chmod=0750 --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf +COPY --chmod=0750 --chown=apache:apache src /htdocs + +RUN mkdir /etc/httpd/conf.d/$HTTP_SERVER_NAME \ + && chown apache:apache /etc/httpd/conf.d/$HTTP_SERVER_NAME + +RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ + -config /etc/ssl/openssl.cnf \ + -keyout /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} \ + -out /etc/httpd/conf.d/${HTTP_SERVER_NAME}/cert-${HTTP_SERVER_NAME} &> /dev/null +RUN httpd -t +USER apache + +WORKDIR /htdocs +CMD ["docker-entrypoint.sh"] From 8b414129636c9cf1127b70bc4e58ca1286371d1f Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 6 Jan 2026 10:09:09 -0500 Subject: [PATCH 6/9] fix build fail - linkstack-ontampa-dev-1 --- ontampa-devs/link/Dockerfile | 26 ++---- ontampa-devs/link/conf/httpd/httpd.conf | 103 ------------------------ 2 files changed, 5 insertions(+), 124 deletions(-) delete mode 100644 ontampa-devs/link/conf/httpd/httpd.conf diff --git a/ontampa-devs/link/Dockerfile b/ontampa-devs/link/Dockerfile index 6860cf6..7f01e9e 100644 --- a/ontampa-devs/link/Dockerfile +++ b/ontampa-devs/link/Dockerfile @@ -6,9 +6,7 @@ ENV PHP_MEMORY_LIMIT="512M" ENV UPLOAD_MAX_FILESIZE="8M" ENV HTTP_SERVER_NAME="localhost" -ENV HTTPS_SERVER_NAME="${HTTP_SERVER_NAME}" ENV HTTP_SERVER_PORT="8080" -ENV HTTPS_SERVER_PORT="8443" EXPOSE $HTTP_SERVER_PORT $HTTPS_SERVER_PORT @@ -16,10 +14,6 @@ EXPOSE $HTTP_SERVER_PORT $HTTPS_SERVER_PORT RUN echo 'max_parallel_downloads=20' >> /etc/dnf/dnf.conf RUN echo 'fastestmirror=True' >> /etc/dnf/dnf.conf -# disable rhsm warnings -RUN printf "[rhsm]\nauto_enable_yum_plugins = 0\n" > rhsm.conf -RUN printf "[main]\nenabled=0\n" > /etc/dnf/plugins/subscription-manager.conf - RUN microdnf install -y dnf \ && dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ && dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm @@ -41,24 +35,14 @@ RUN curl -L --compressed --http2 --tcp-fastopen --buffer --keepalive-time 60 \ https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ | bsdtar -C /htdocs --strip-components 1 -xf- +COPY --chown=apache:apache conf/php/php.ini /etc/php.d/40-custom.ini +COPY --chown=apache:apache conf/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf +COPY --chown=apache:apache conf/httpd/conf.d/host-linkstack.conf /etc/httpd/conf.d/host-linkstack.conf -COPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/ - -COPY --chmod=0750 --chown=apache:apache conf/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf -COPY --chmod=0750 --chown=apache:apache conf/php/php.ini /etc/php.d/40-custom.ini -COPY --chmod=0750 --chown=apache:apache conf/httpd/httpd.conf /etc/httpd/httpd.conf -COPY --chmod=0750 --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf -COPY --chmod=0750 --chown=apache:apache src /htdocs - -RUN mkdir /etc/httpd/conf.d/$HTTP_SERVER_NAME \ - && chown apache:apache /etc/httpd/conf.d/$HTTP_SERVER_NAME +COPY --chmod=0755 entrypoint.sh /usr/local/bin/ -RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ - -config /etc/ssl/openssl.cnf \ - -keyout /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} \ - -out /etc/httpd/conf.d/${HTTP_SERVER_NAME}/cert-${HTTP_SERVER_NAME} &> /dev/null RUN httpd -t USER apache WORKDIR /htdocs -CMD ["docker-entrypoint.sh"] +CMD ["entrypoint.sh"] diff --git a/ontampa-devs/link/conf/httpd/httpd.conf b/ontampa-devs/link/conf/httpd/httpd.conf deleted file mode 100644 index 807ba87..0000000 --- a/ontampa-devs/link/conf/httpd/httpd.conf +++ /dev/null @@ -1,103 +0,0 @@ -ServerTokens OS -ServerSignature On - -PassEnv HTTP_SERVER_PORT -Listen ${HTTP_SERVER_PORT} - -PassEnv HTTP_SERVER_NAME -ServerName ${HTTP_SERVER_NAME} - -PidFile /run/httpd/httpd.pid - -LoadModule access_compat_module modules/mod_access_compat.so -LoadModule autoindex_module modules/mod_autoindex.so -LoadModule authn_file_module modules/mod_authn_file.so -LoadModule authn_core_module modules/mod_authn_core.so -LoadModule authz_host_module modules/mod_authz_host.so -LoadModule authz_groupfile_module modules/mod_authz_groupfile.so -LoadModule authz_user_module modules/mod_authz_user.so -LoadModule authz_core_module modules/mod_authz_core.so -LoadModule auth_basic_module modules/mod_auth_basic.so -LoadModule deflate_module modules/mod_deflate.so -LoadModule env_module modules/mod_env.so -LoadModule expires_module modules/mod_expires.so -LoadModule filter_module modules/mod_filter.so -LoadModule headers_module modules/mod_headers.so -LoadModule log_config_module modules/mod_log_config.so -LoadModule logio_module modules/mod_logio.so -LoadModule mime_module modules/mod_mime.so -LoadModule mpm_prefork_module modules/mod_mpm_prefork.so -LoadModule reqtimeout_module modules/mod_reqtimeout.so -LoadModule status_module modules/mod_status.so -LoadModule setenvif_module modules/mod_setenvif.so -LoadModule unixd_module modules/mod_unixd.so -LoadModule version_module modules/mod_version.so - -LoadModule dir_module modules/mod_dir.so -LoadModule alias_module modules/mod_alias.so -LoadModule rewrite_module modules/mod_rewrite.so -LoadModule negotiation_module modules/mod_negotiation.so - - - User apache - Group apache - - - - AllowOverride none - Require all denied - - - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - - - - DirectoryIndex index.html - - - - Require all denied - -ErrorLog /dev/stderr -PassEnv LOG_LEVEL -LogLevel ${LOG_LEVEL} - - LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [httpd.conf] %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined - LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [httpd.conf] %h %l %u \"%r\" %>s %b" common - - LogFormat "[%{%a %b %d %H:%M:%S}t.%{usec_frac}t %{%Y}t] [httpd.conf] %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio - - BrowserMatchNoCase ^healthcheck nolog - CustomLog /dev/stdout combinedio env=!nolog - - - ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" - - - - - - AllowOverride All - Options None - Require all granted - - - - RequestHeader unset Proxy early - - - - TypesConfig /etc/httpd/conf.d/mime.types - AddType application/x-compress .Z - AddType application/x-gzip .gz .tgz - - - - MIMEMagicFile /etc/apache2/magic - - -IncludeOptional /etc/httpd/conf.d/*.conf -AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json From 9c1f49e21c83cb54ab39aa3b2838c327f62fc352 Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 6 Jan 2026 10:20:56 -0500 Subject: [PATCH 7/9] fix missing cert --- ontampa-devs/link/Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ontampa-devs/link/Dockerfile b/ontampa-devs/link/Dockerfile index 7f01e9e..2c28234 100644 --- a/ontampa-devs/link/Dockerfile +++ b/ontampa-devs/link/Dockerfile @@ -8,7 +8,7 @@ ENV UPLOAD_MAX_FILESIZE="8M" ENV HTTP_SERVER_NAME="localhost" ENV HTTP_SERVER_PORT="8080" -EXPOSE $HTTP_SERVER_PORT $HTTPS_SERVER_PORT +EXPOSE $HTTP_SERVER_PORT # dnf optimization RUN echo 'max_parallel_downloads=20' >> /etc/dnf/dnf.conf @@ -31,6 +31,12 @@ RUN microdnf install -y \ && microdnf clean all \ && mkdir /htdocs +# generate default cert for ssl.conf +RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ + -keyout /etc/pki/tls/private/localhost.key \ + -out /etc/pki/tls/certs/localhost.crt \ + -subj "/C=US/ST=FL/L=Tampa/O=TampaDevs/CN=localhost" + RUN curl -L --compressed --http2 --tcp-fastopen --buffer --keepalive-time 60 \ https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ | bsdtar -C /htdocs --strip-components 1 -xf- From 8e94076cd1e532ede4f55215255d869752ffc49c Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 6 Jan 2026 10:34:43 -0500 Subject: [PATCH 8/9] no need to dynamically change php settings --- ontampa-devs/link/Dockerfile | 2 - ontampa-devs/link/conf/php/php.ini | 3 ++ ontampa-devs/link/entrypoint.sh | 4 -- ontampa-devs/link/tmp | 64 ------------------------------ 4 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 ontampa-devs/link/tmp diff --git a/ontampa-devs/link/Dockerfile b/ontampa-devs/link/Dockerfile index 2c28234..319c51e 100644 --- a/ontampa-devs/link/Dockerfile +++ b/ontampa-devs/link/Dockerfile @@ -2,8 +2,6 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest ENV SERVER_ADMIN="cloud@ontampa.dev" ENV LOG_LEVEL="debug" -ENV PHP_MEMORY_LIMIT="512M" -ENV UPLOAD_MAX_FILESIZE="8M" ENV HTTP_SERVER_NAME="localhost" ENV HTTP_SERVER_PORT="8080" diff --git a/ontampa-devs/link/conf/php/php.ini b/ontampa-devs/link/conf/php/php.ini index e69de29..4282def 100644 --- a/ontampa-devs/link/conf/php/php.ini +++ b/ontampa-devs/link/conf/php/php.ini @@ -0,0 +1,3 @@ +upload_max_filesize = "512M" +memory_limit = "8M" + diff --git a/ontampa-devs/link/entrypoint.sh b/ontampa-devs/link/entrypoint.sh index 2f1542c..0898d5b 100644 --- a/ontampa-devs/link/entrypoint.sh +++ b/ontampa-devs/link/entrypoint.sh @@ -28,8 +28,4 @@ echo "| upload_max_filesize = ${UPLOAD_MAX_FILESIZE} |" echo "| memory_limit = ${PHP_MEMORY_LIMIT} |" echo "| date.timezone = ${TZ} |" -echo "upload_max_filesize = ${UPLOAD_MAX_FILESIZE}" >> /etc/php.d/40-custom.ini -echo "memory_limit = ${PHP_MEMORY_LIMIT}" >> /etc/php.d/40-custom.ini -echo "date.timezone = ${TZ}" >> /etc/php.d/40-custom.ini - httpd -DFOREGROUND diff --git a/ontampa-devs/link/tmp b/ontampa-devs/link/tmp deleted file mode 100644 index 6860cf6..0000000 --- a/ontampa-devs/link/tmp +++ /dev/null @@ -1,64 +0,0 @@ -FROM registry.access.redhat.com/ubi9/ubi-minimal:latest - -ENV SERVER_ADMIN="cloud@ontampa.dev" -ENV LOG_LEVEL="debug" -ENV PHP_MEMORY_LIMIT="512M" -ENV UPLOAD_MAX_FILESIZE="8M" - -ENV HTTP_SERVER_NAME="localhost" -ENV HTTPS_SERVER_NAME="${HTTP_SERVER_NAME}" -ENV HTTP_SERVER_PORT="8080" -ENV HTTPS_SERVER_PORT="8443" - -EXPOSE $HTTP_SERVER_PORT $HTTPS_SERVER_PORT - -# dnf optimization -RUN echo 'max_parallel_downloads=20' >> /etc/dnf/dnf.conf -RUN echo 'fastestmirror=True' >> /etc/dnf/dnf.conf - -# disable rhsm warnings -RUN printf "[rhsm]\nauto_enable_yum_plugins = 0\n" > rhsm.conf -RUN printf "[main]\nenabled=0\n" > /etc/dnf/plugins/subscription-manager.conf - -RUN microdnf install -y dnf \ - && dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ - && dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm - -RUN dnf config-manager --set-enabled remi-modular -RUN dnf module reset php -y \ - && dnf module enable php:remi-8.3 -y - -RUN microdnf install -y \ - httpd mod_ssl libarchive \ - php php-common php-bcmath php-gd \ - php-mbstring php-mysqlnd php-pgsql \ - php-xml php-pecl-zip php-pecl-redis \ - libarchive bsdtar openssl \ - && microdnf clean all \ - && mkdir /htdocs - -RUN curl -L --compressed --http2 --tcp-fastopen --buffer --keepalive-time 60 \ - https://github.com/linkstackorg/linkstack/releases/latest/download/linkstack.zip \ - | bsdtar -C /htdocs --strip-components 1 -xf- - - -COPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/ - -COPY --chmod=0750 --chown=apache:apache conf/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf -COPY --chmod=0750 --chown=apache:apache conf/php/php.ini /etc/php.d/40-custom.ini -COPY --chmod=0750 --chown=apache:apache conf/httpd/httpd.conf /etc/httpd/httpd.conf -COPY --chmod=0750 --chown=apache:apache conf/ssl/openssl.cnf /etc/ssl/openssl.cnf -COPY --chmod=0750 --chown=apache:apache src /htdocs - -RUN mkdir /etc/httpd/conf.d/$HTTP_SERVER_NAME \ - && chown apache:apache /etc/httpd/conf.d/$HTTP_SERVER_NAME - -RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ - -config /etc/ssl/openssl.cnf \ - -keyout /etc/httpd/conf.d/${HTTP_SERVER_NAME}/key-${HTTP_SERVER_NAME} \ - -out /etc/httpd/conf.d/${HTTP_SERVER_NAME}/cert-${HTTP_SERVER_NAME} &> /dev/null -RUN httpd -t -USER apache - -WORKDIR /htdocs -CMD ["docker-entrypoint.sh"] From 4ceca254b33fc428c985b471ae06bd1d8e55c7f6 Mon Sep 17 00:00:00 2001 From: jherron Date: Tue, 6 Jan 2026 10:39:38 -0500 Subject: [PATCH 9/9] fix perm issue with run/httpd --- ontampa-devs/link/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ontampa-devs/link/Dockerfile b/ontampa-devs/link/Dockerfile index 319c51e..94af835 100644 --- a/ontampa-devs/link/Dockerfile +++ b/ontampa-devs/link/Dockerfile @@ -42,6 +42,7 @@ RUN curl -L --compressed --http2 --tcp-fastopen --buffer --keepalive-time 60 \ COPY --chown=apache:apache conf/php/php.ini /etc/php.d/40-custom.ini COPY --chown=apache:apache conf/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf COPY --chown=apache:apache conf/httpd/conf.d/host-linkstack.conf /etc/httpd/conf.d/host-linkstack.conf +RUN chown -R apache:apache /run/httpd COPY --chmod=0755 entrypoint.sh /usr/local/bin/