diff --git a/Dockerfile b/Dockerfile index b3a8041..e3d4edd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,16 @@ FROM debian:12 +RUN true RUN apt-get update && apt-get upgrade -y && apt-get clean -RUN apt-get install -y supervisor apache2 php libapache2-mod-php php-mbstring php-zip curl git openscad zip cmake build-essential php-opcache +RUN apt-get install -y supervisor apache2 php libapache2-mod-php php-mbstring php-zip curl git openscad zip cmake build-essential php-opcache wget RUN apt-get clean RUN chown -R www-data:www-data /var/www -RUN curl https://files.openscad.org/snapshots/OpenSCAD-2024.03.28.ai18952-x86_64.AppImage > /tmp/openscad -RUN chmod +x /tmp/openscad +ADD htmlq /usr/local/bin/ +ADD openscad_installer /tmp/ +RUN /tmp/openscad_installer WORKDIR /opt -RUN /tmp/openscad --appimage-extract -RUN ln -s /opt/squashfs-root/usr/bin/openscad /usr/local/bin/openscad RUN git clone https://github.com/jschobben/colorscad WORKDIR /opt/colorscad/3mfmerge/build +RUN pwd; ls;ls .. RUN cmake .. -DLIB3MF_TESTS=OFF RUN cmake --build . WORKDIR /opt/colorscad/test diff --git a/htmlq b/htmlq new file mode 100755 index 0000000..42fdb2e Binary files /dev/null and b/htmlq differ diff --git a/openscad_installer b/openscad_installer new file mode 100755 index 0000000..79f3d9e --- /dev/null +++ b/openscad_installer @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + + +set -e +function getFileName() { + curl -s https://files.openscad.org/snapshots/ | htmlq 'a[href$="x86_64.AppImage"]' -a href | tail -n1 +} + +function getDownloadUrl() { + echo "https://files.openscad.org/snapshots/$(getFileName)" +} + + +wget -q -O /tmp/openscad "$(getDownloadUrl)" +chmod +x /tmp/openscad +chmod +x /tmp/openscad +cd /opt + /tmp/openscad --appimage-extract + ln -s /opt/squashfs-root/usr/bin/openscad /usr/local/bin/openscad diff --git a/src/index.php b/src/index.php index e215479..06e4156 100644 --- a/src/index.php +++ b/src/index.php @@ -1,11 +1,24 @@ $tag,"symbolPre"=>"","symbolPost"=>""]; + if($useSymbols){ + $tag['symbolPre']=substr($tag['text'],0,1); + $tag['symbolPost']=substr($tag['text'],-1); + $tag['text']=substr($tag['text'],1,-1); + } + return $tag; + },$tags); + if (empty($tags)) { header("Location: /?err=notags"); exit(); @@ -98,8 +111,11 @@ switch ($_GET["err"]) {

c3RE AuerBoxTag Generator

- - + +
+

diff --git a/src/queueWorker b/src/queueWorker index b91732e..838cf32 100755 --- a/src/queueWorker +++ b/src/queueWorker @@ -23,7 +23,9 @@ $jobId = basename($jobFile, ".json"); $tags = json_decode(file_get_contents($jobFile), true); $zipFile = $dlDir . $jobId . ".zip"; chdir(__DIR__ . "/../AuerNameTag"); -$shellArgs = array_map("escapeshellarg", $tags); +$shellArgs = array_map(function($tag){ + return escapeshellarg($tag['name'].' '.$tag['symbolPrefix'].' '.$tag['symbolPost']); +}, $tags); system("rm -rf out"); system("git reset --hard"); system("./make.sh " . implode(" ", $shellArgs));