summaryrefslogtreecommitdiff
path: root/www/imaginary
diff options
context:
space:
mode:
Diffstat (limited to 'www/imaginary')
-rw-r--r--www/imaginary/Makefile32
-rw-r--r--www/imaginary/distinfo15
-rw-r--r--www/imaginary/files/imaginary.in49
-rw-r--r--www/imaginary/pkg-descr16
-rw-r--r--www/imaginary/pkg-message23
5 files changed, 135 insertions, 0 deletions
diff --git a/www/imaginary/Makefile b/www/imaginary/Makefile
new file mode 100644
index 000000000000..b49859cb4898
--- /dev/null
+++ b/www/imaginary/Makefile
@@ -0,0 +1,32 @@
+PORTNAME= imaginary
+PORTVERSION= 20250114
+PORTREVISION= 1
+CATEGORIES= www
+
+MAINTAINER= skozlov@FreeBSD.org
+COMMENT= HTTP microservice for high-level image processing
+WWW= https://github.com/h2non/imaginary
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+USES= gettext-runtime gnome go:modules pkgconfig
+USE_RC_SUBR= ${PORTNAME}
+USE_GNOME= glib20
+
+LIB_DEPENDS= libvips.so:graphics/vips
+
+USE_GITHUB= yes
+GH_ACCOUNT= h2non
+GH_TAGNAME= 1d4e251cfcd58ea66f8361f8721d7b8cc85002a3
+GH_TUPLE= \
+ garyburd:redigo:v1.6.0:garyburd_redigo/vendor/github.com/garyburd/redigo \
+ h2non:bimg:v1.1.7:h2non_bimg/vendor/github.com/h2non/bimg \
+ h2non:filetype:v1.1.0:h2non_filetype/vendor/github.com/h2non/filetype \
+ hashicorp:golang-lru:0a025b7e63ad:hashicorp_golang_lru/vendor/github.com/hashicorp/golang-lru \
+ rs:cors:7af7a1e09ba3:rs_cors/vendor/github.com/rs/cors \
+ throttled:throttled:v2.0.3:throttled_throttled/vendor/github.com/throttled/throttled/v2
+
+PLIST_FILES= bin/${PORTNAME}
+
+.include <bsd.port.mk>
diff --git a/www/imaginary/distinfo b/www/imaginary/distinfo
new file mode 100644
index 000000000000..ca89e8715dec
--- /dev/null
+++ b/www/imaginary/distinfo
@@ -0,0 +1,15 @@
+TIMESTAMP = 1751718612
+SHA256 (h2non-imaginary-20250114-1d4e251cfcd58ea66f8361f8721d7b8cc85002a3_GH0.tar.gz) = 99b3b1669934520f7ea06d7f11dcf06ecffa6df8d7c636666cb20429a922853b
+SIZE (h2non-imaginary-20250114-1d4e251cfcd58ea66f8361f8721d7b8cc85002a3_GH0.tar.gz) = 2023334
+SHA256 (garyburd-redigo-v1.6.0_GH0.tar.gz) = 6a17aedbaea7737637ecc0ff90812c169cf1c2b51dfd0809df6998295abb8f19
+SIZE (garyburd-redigo-v1.6.0_GH0.tar.gz) = 42765
+SHA256 (h2non-bimg-v1.1.7_GH0.tar.gz) = 845226edf322704d751095a7d7d60c86ac38f450c1d72237545299852b1c498a
+SIZE (h2non-bimg-v1.1.7_GH0.tar.gz) = 23702365
+SHA256 (h2non-filetype-v1.1.0_GH0.tar.gz) = 6dcbe6e6b6f0a0571843ebdedb33daacde3bb6ef1196797879587a3e4cf8052b
+SIZE (h2non-filetype-v1.1.0_GH0.tar.gz) = 3632778
+SHA256 (hashicorp-golang-lru-0a025b7e63ad_GH0.tar.gz) = aaacd79222707a796c4c2b1c974c6c206b8492ace08f44f672ac1dd2c64c178b
+SIZE (hashicorp-golang-lru-0a025b7e63ad_GH0.tar.gz) = 12304
+SHA256 (rs-cors-7af7a1e09ba3_GH0.tar.gz) = 032d689446a8f30e563c5977518db6873a44d05ef31f41f2666d991923fca536
+SIZE (rs-cors-7af7a1e09ba3_GH0.tar.gz) = 9968
+SHA256 (throttled-throttled-v2.0.3_GH0.tar.gz) = fe9ec9469c0f9ef0fba16178bc5dcc5c30026e99b29ea2adceee71150d4a9e2e
+SIZE (throttled-throttled-v2.0.3_GH0.tar.gz) = 15514
diff --git a/www/imaginary/files/imaginary.in b/www/imaginary/files/imaginary.in
new file mode 100644
index 000000000000..d85abf379332
--- /dev/null
+++ b/www/imaginary/files/imaginary.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# PROVIDE: imaginary
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable imaginary:
+#
+# imaginary_enable (bool): Set to "NO" by default.
+# Set to "YES" to enable imaginary.
+# imaginary_user (str): Defaults to "nobody".
+# imaginary_group (str): Defaults to "nobody".
+# User and group to run imaginary with.
+# imaginary_flags (str): Additional flags to append to "imaginary" command.
+# run "imaginary -help" for more information.
+# imaginary_logdir (str): Default to "/var/log/imaginary".
+# Directory to store logs for imaginary
+
+. /etc/rc.subr
+
+name=imaginary
+rcvar=imaginary_enable
+desc=imaginary
+
+load_rc_config imaginary
+
+: ${imaginary_enable:=NO}
+: ${imaginary_user:=nobody}
+: ${imaginary_group:=nobody}
+: ${imaginary_logdir=/var/log/imaginary}
+
+pidfile=/var/run/${name}/${name}.pid
+start_precmd=imaginary_precmd
+procname="%%PREFIX%%/bin/imaginary"
+command=/usr/sbin/daemon
+command_args="-cf -p ${pidfile} -o ${imaginary_logdir}/imaginary.out ${procname} ${imaginary_flags}"
+
+imaginary_precmd()
+{
+ # Create PID file directory
+ install -d -o ${imaginary_user} -g ${imaginary_group} -m 0755 "$(dirname ${pidfile})"
+ # Create log file directory
+ install -d -o ${imaginary_user} -g ${imaginary_group} -m 0755 "${imaginary_logdir}"
+
+ # Remove default flags, they're added in `command_args` manually
+ rc_flags=""
+}
+
+run_rc_command "$1"
diff --git a/www/imaginary/pkg-descr b/www/imaginary/pkg-descr
new file mode 100644
index 000000000000..512b3f6f4c96
--- /dev/null
+++ b/www/imaginary/pkg-descr
@@ -0,0 +1,16 @@
+Fast HTTP microservice written in Go for high-level image processing backed by
+bimg and libvips. imaginary can be used as private or public HTTP service for
+massive image processing with first-class support for Docker & Fly.io. It's
+almost dependency-free and only uses net/http native package without additional
+abstractions for better performance.
+
+Supports multiple image operations exposed as a simple HTTP API, with
+additional optional features such as API token authorization, URL signature
+protection, HTTP traffic throttle strategy and CORS support for web clients.
+
+imaginary can read images from HTTP POST payloads, server local path or remote
+HTTP servers, supporting JPEG, PNG, WEBP, HEIF, and optionally TIFF, PDF, GIF
+and SVG formats.
+
+imaginary is able to output images as JPEG, PNG and WEBP formats, including
+transparent conversion across them.
diff --git a/www/imaginary/pkg-message b/www/imaginary/pkg-message
new file mode 100644
index 000000000000..0d87f5822cdb
--- /dev/null
+++ b/www/imaginary/pkg-message
@@ -0,0 +1,23 @@
+[
+{ type: install
+ message: <<EOM
+If you're running imaginary as a part of Nextcloud installation -
+configure it using:
+
+ # sysrc imaginary_flags="-return-size -max-allowed-resolution 222.2"
+
+Then add this to your Nextcloud's config.php:
+
+ 'enabledPreviewProviders' => [
+ 'OC\Preview\MP3',
+ 'OC\Preview\TXT',
+ 'OC\Preview\MarkDown',
+ 'OC\Preview\OpenDocument',
+ 'OC\Preview\Krita',
+ 'OC\Preview\Imaginary',
+ ],
+ 'preview_imaginary_url' => 'http://<url of imaginary>:<port>',
+
+EOM
+}
+]