diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index f70a5c3..8df930d 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -16,7 +16,7 @@ jobs: - name: "setup python" uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" - name: "install wheel" run: "python -m pip install --user wheel" diff --git a/CHANGELOG.md b/CHANGELOG.md index 923bc66..912776b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ ## CHANGELOG +### [24.10.0] - In Development +- Rewrote how Drop and Paste is handled - we now support dropping or pasting images and they are converted to Markdown Data URIs - however, there is a performance issue with large images - this won't get fixed until I migrate to CodeMirror 6 +- Updated `/logs` so it can scroll back through the history +- Increased the size of the `logring` from 128 to 1024 +- Updated Dockerfile so it sets `VIRTUAL_ENV` and `PATH` correctly +- Updated Dockerfile to use Python 3.13 +- Updated DataTemplate Export so it wraps long lines +- Updated Pandoc to 3.5 in Dockerfile + ### [24.9.0] - Sep 2, 2024 - Removed 'Fira Code' font from `/logs` as it adds no value over 'Consolas' - Updated `codemirror` JavaScript library to 5.65.17 @@ -329,6 +338,7 @@ ### 21.11.0 - Nov 29, 2021 - Initial release +[24.10.0]: https://github.com/cmason3/jinjafx_server/compare/24.9.0...24.10.0 [24.9.0]: https://github.com/cmason3/jinjafx_server/compare/24.6.4...24.9.0 [24.6.4]: https://github.com/cmason3/jinjafx_server/compare/24.6.3...24.6.4 [24.6.3]: https://github.com/cmason3/jinjafx_server/compare/24.6.2...24.6.3 diff --git a/README.md b/README.md index 49aabfd..8cdab9e 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ JinjaFx Server supports the ability to use "output" tags to create different out ``` +You can also paste in an image and it will convert it to a Base64 encoded Data URI that is formatted as Markdown. + ### Ansible Vault JinjaFx Server supports the ability to perform Ansible Vault encryption of strings from within the browser using client side JavaScript. By clicking on the padlock it will prompt you for your string and the password to use which you can then use within `vars.yml`. JinjaFx doesn't support the ability to use different passwords for different strings within the same DataTemplate so it is important that all vaulted strings are using the same password within the same DataTemplate. diff --git a/contrib/bootstrap.scss b/contrib/bootstrap.scss deleted file mode 100644 index e482542..0000000 --- a/contrib/bootstrap.scss +++ /dev/null @@ -1,35 +0,0 @@ -$primary_color: #0057b8; - -@function shade-color($color, $weight) { - @return mix(black, $color, $weight); -} - -@function tint-color($color, $weight) { - @return mix(white, $color, $weight); -} - -@function to-rgb($value) { - @return red($value), green($value), blue($value); -} - -.btn-primary { - --bs-btn-color: #fff; - --bs-btn-disabled-color: #fff; - --bs-btn-hover-color: #fff; - --bs-btn-active-color: #fff; - - --bs-btn-bg: #{$primary_color}; - --bs-btn-disabled-bg: #{$primary_color}; - --bs-btn-hover-bg: #{shade-color($primary_color, 15%)}; - --bs-btn-active-bg: #{shade-color($primary_color, 20%)}; - - --bs-btn-border-color: #{$primary_color}; - --bs-btn-disabled-border-color: #{$primary_color}; - --bs-btn-hover-border-color: #{shade-color($primary_color, 20%)}; - --bs-btn-active-border-color: #{shade-color($primary_color, 25%)}; - - --bs-btn-focus-shadow-rgb: #{to-rgb(tint-color($primary_color, 15%))}; -} -.nav-pills { - --bs-nav-pills-link-active-bg: #{$primary_color}; -} diff --git a/jinjafx_server.py b/jinjafx_server.py index fe300e4..8258c57 100755 --- a/jinjafx_server.py +++ b/jinjafx_server.py @@ -28,7 +28,7 @@ import re, argparse, hashlib, traceback, glob, hmac, uuid, struct, binascii, gzip, requests, ctypes, subprocess import cmarkgfm, emoji -__version__ = '24.9.0' +__version__ = '24.10.0' llock = threading.RLock() rlock = threading.RLock() @@ -601,7 +601,7 @@ def html_escape(text): try: if not self.ratelimit(remote_addr, 4, False): html = self.d(json.loads(postdata.decode('utf-8'))) - p = subprocess.run([pandoc, '-f', 'html', '-t', 'docx', '--sandbox', '--reference-doc=' + base + '/pandoc/reference.docx'], input=html, stdout=subprocess.PIPE, check=True) + p = subprocess.run([pandoc, '-f', 'html', '-t', 'docx', '--sandbox', '--standalone', '--embed-resources', '--reference-doc=' + base + '/pandoc/reference.docx'], input=html, stdout=subprocess.PIPE, check=True) self.send_response(200) self.send_header('Content-Type', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') self.send_header('Content-Length', str(len(p.stdout))) @@ -1047,7 +1047,7 @@ def log(t, ae=''): print('[' + timestamp + '] ' + t + ae) logring.append('[' + timestamp + '] ' + t + ae) - logring = logring[-128:] + logring = logring[-1024:] if logfile is not None: try: diff --git a/kubernetes/Dockerfile b/kubernetes/Dockerfile index 4b2292d..5af7146 100644 --- a/kubernetes/Dockerfile +++ b/kubernetes/Dockerfile @@ -1,23 +1,26 @@ -FROM docker.io/library/python:3.12-slim AS BUILD +FROM docker.io/library/python:3.13-slim AS BUILD -ARG BRANCH="main" +ARG BRANCH main RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends wget git build-essential; \ -wget -P /tmp https://github.com/jgm/pandoc/releases/download/3.3/pandoc-3.3-1-amd64.deb; \ -dpkg -i /tmp/pandoc-3.3-1-amd64.deb; \ +wget -P /tmp https://github.com/jgm/pandoc/releases/download/3.5/pandoc-3.5-1-amd64.deb; \ +dpkg -i /tmp/pandoc-3.5-1-amd64.deb; \ python3 -m venv /opt/jinjafx; \ /opt/jinjafx/bin/python3 -m pip install --upgrade git+https://github.com/cmason3/jinjafx_server.git@${BRANCH} lxml; \ /opt/jinjafx/bin/python3 -m pip uninstall -y pip -FROM docker.io/library/python:3.12-slim +FROM docker.io/library/python:3.13-slim COPY --from=BUILD /opt/jinjafx /opt/jinjafx COPY --from=BUILD /usr/bin/pandoc /usr/bin/pandoc -ENTRYPOINT [ "/opt/jinjafx/bin/python3", "-u", "-m", "jinjafx_server", "-s", "-l", "0.0.0.0", "-p", "8080" ] +ENV VIRTUAL_ENV /opt/jinjafx +ENV PATH /opt/jinjafx/bin:${PATH} + +ENTRYPOINT [ "python3", "-u", "-m", "jinjafx_server", "-s", "-l", "0.0.0.0", "-p", "8080" ] diff --git a/www/dt.html b/www/dt.html index bc77324..dfdf901 100644 --- a/www/dt.html +++ b/www/dt.html @@ -7,10 +7,11 @@ + -
+