diff --git a/net/gotify-server/Makefile b/net/gotify-server/Makefile index be61a496a9c7..d23ff5a75bd2 100644 --- a/net/gotify-server/Makefile +++ b/net/gotify-server/Makefile @@ -1,84 +1,87 @@ PORTNAME= gotify-server -PORTVERSION= 2.9.1 +PORTVERSION= 3.0.0 DISTVERSIONPREFIX= v -PORTREVISION= 4 CATEGORIES= net MASTER_SITES= https://github.com/mfechner/freebsd-net-gotify-server/raw/refs/heads/main/:yarn_cache DISTNAME= server DISTFILES= ${PORTNAME}-yarn-offline-cache-${DISTVERSION}${EXTRACT_SUFX}:yarn_cache MAINTAINER= mfechner@FreeBSD.org COMMENT= Simple server for sending and receiving messages WWW= https://github.com/gotify/server LICENSE= MIT ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= Npm cache only for amd64 generated BUILD_DEPENDS= yarn${NODEJS_SUFFIX}>=1.10.0:www/yarn${NODEJS_SUFFIX} \ USES= go:modules nodejs:build +USE_GITHUB= yes +GH_ACCOUNT= gotify +GH_PROJECT= server USE_RC_SUBR= gotify_server +GO_MOD_DIST= github GO_MODULE= github.com/gotify/server/v2 _BUILD_DATE= $$(date -u "+%Y-%m-%d-%H%M UTC") #GO_TARGET= ./ GO_BUILDFLAGS= -buildmode=pie -modcacherw \ -ldflags=" \ -X 'main.Version=${PORTVERSION}' \ -X 'main.Commit=${GL_TAGNAME:C/^(........).*/\1/}' \ -X 'main.BuildDate=${_BUILD_DATE}' \ -X 'main.Mode=prod'" MAKE_ENV+= NODE_OPTIONS=--openssl-legacy-provider USERS= gotify GROUPS= gotify PLIST_FILES= bin/gotify-server post-patch: # setup yarnrc for offline node_modules installatio @${ECHO_CMD} 'yarn-offline-mirror "${WRKDIR}/yarn-offline-cache"' >> ${WRKSRC}/ui/.yarnrc pre-build: @cd ${WRKSRC}/ui && ${SETENV} ${MAKE_ENV} HOME=${WRKDIR} PUPPETEER_SKIP_DOWNLOAD=true yarn install --offline @cd ${WRKSRC}/ui && ${SETENV} ${MAKE_ENV} yarn build #${RM} -r ${STAGEDIR}${PREFIX}/share/.cache pre-install: @${RM} ${WRKSRC}/.yarnrc do-install: @${INSTALL_PROGRAM} ${WRKDIR}/bin/gotify-server ${STAGEDIR}${PREFIX}/bin/gotify-server - @${MV} ${WRKSRC}/config.example.yml ${WRKSRC}/config.yml.sample + @${MV} ${WRKSRC}/gotify-server.env.example ${WRKSRC}/server.env.sample @${MKDIR} ${STAGEDIR}${ETCDIR} -.for x in config.yml.sample +.for x in server.env.sample @${CP} ${WRKSRC}/${x} ${STAGEDIR}${ETCDIR}/${x} .endfor @${MKDIR} ${STAGEDIR}/var/db/gotify post-install: - @${ECHO} "@sample ${ETCDIR}/config.yml.sample" >> ${TMPPLIST} + @${ECHO} "@sample ${ETCDIR}/server.env.sample" >> ${TMPPLIST} @${ECHO_CMD} "@owner gotify" >> ${TMPPLIST} @${ECHO_CMD} "@group gotify" >> ${TMPPLIST} @${ECHO_CMD} "@dir /var/db/gotify" >> ${TMPPLIST} #@${ECHO_CMD} "@dir /var/db/gotify/certs" >> ${TMPPLIST} # To update # 1. comment DISTFILES # 2. Run 'make makesum' # 3. Run 'make make-yarn-cache' # 4. Upload yarn cache # 5. Uncomment DITSFILES # 6. Run 'make makesum' make-yarn-cache: patch ${RM} -r ${WRKDIR}/yarn-offline-cache cd ${WRKSRC}/ui && ${SETENV} ${MAKE_ENV} PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn --frozen-lockfile --ignore-scripts cd ${WRKDIR} && ${TAR} -czf ${PORTNAME}-yarn-offline-cache-${DISTVERSION}${EXTRACT_SUFX} yarn-offline-cache @${ECHO_CMD} upload ${PORTNAME}-yarn-offline-cache-${DISTVERSION}${EXTRACT_SUFX} #@${ECHO_CMD} scp work/gotify-server-yarn-offline-cache-*.tar.gz mfechner@freefall.freebsd.org:public_distfiles/ .include diff --git a/net/gotify-server/distinfo b/net/gotify-server/distinfo index 3659326b84e9..249bef278a5c 100644 --- a/net/gotify-server/distinfo +++ b/net/gotify-server/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1772689105 -SHA256 (go/net_gotify-server/server/gotify-server-yarn-offline-cache-2.9.1.tar.gz) = 42f7b80c03c6d556a2228608ff367bb8629fa14dd031bd75cb1b86dd97178ab6 -SIZE (go/net_gotify-server/server/gotify-server-yarn-offline-cache-2.9.1.tar.gz) = 192375366 -SHA256 (go/net_gotify-server/server/v2.9.1.mod) = f2071c81e8ec40818c234ac508a50ed909f8bb7df3951a02b6ab041210537c2c -SIZE (go/net_gotify-server/server/v2.9.1.mod) = 2758 -SHA256 (go/net_gotify-server/server/v2.9.1.zip) = d8416bb79737d3f253f1a21f1fdff99203ea227cfadf99eaeda1e7d824294970 -SIZE (go/net_gotify-server/server/v2.9.1.zip) = 597342 +TIMESTAMP = 1786447344 +SHA256 (go/net_gotify-server/gotify-server-v3.0.0_GH0/gotify-server-yarn-offline-cache-3.0.0.tar.gz) = b376a7272d7285c15ca3fbadfd9a6970a2938df58c968d19ebe98349f39c525b +SIZE (go/net_gotify-server/gotify-server-v3.0.0_GH0/gotify-server-yarn-offline-cache-3.0.0.tar.gz) = 195254309 +SHA256 (go/net_gotify-server/gotify-server-v3.0.0_GH0/go.mod) = d4530c78bf15d9152ae8196a63b4b2ed2d8912908cd5269e70f0e0c321962449 +SIZE (go/net_gotify-server/gotify-server-v3.0.0_GH0/go.mod) = 3468 +SHA256 (go/net_gotify-server/gotify-server-v3.0.0_GH0/gotify-server-v3.0.0_GH0.tar.gz) = b073a482b634b7f08f7e5f1f001bf3e5e9224842f8d282c8767efb4ac57d0bb2 +SIZE (go/net_gotify-server/gotify-server-v3.0.0_GH0/gotify-server-v3.0.0_GH0.tar.gz) = 532586 diff --git a/net/gotify-server/files/patch-config.example.yml b/net/gotify-server/files/patch-config.example.yml deleted file mode 100644 index cf6470cfd400..000000000000 --- a/net/gotify-server/files/patch-config.example.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- config.example.yml.orig 1979-11-29 23:00:00 UTC -+++ config.example.yml -@@ -4,7 +4,7 @@ server: - server: - keepaliveperiodseconds: 0 # 0 = use Go default (15s); -1 = disable keepalive; set the interval in which keepalive packets will be sent. Only change this value if you know what you are doing. - listenaddr: "" # the address to bind on, leave empty to bind on all addresses. Prefix with "unix:" to create a unix socket. Example: "unix:/tmp/gotify.sock". -- port: 80 # the port the HTTP server will listen on -+ port: 9071 # the port the HTTP server will listen on - - ssl: - enabled: false # if https should be enabled -@@ -16,7 +16,7 @@ server: - letsencrypt: - enabled: false # if the certificate should be requested from letsencrypt - accepttos: false # if you accept the tos from letsencrypt -- cache: data/certs # the directory of the cache from letsencrypt -+ cache: /var/db/gotify/certs # the directory of the cache from letsencrypt - directoryurl: # override the directory url of the ACME server - # Let's Encrypt highly recommend testing against their staging environment before using their production environment. - # Staging server has high rate limits for testing and debugging, issued certificates are not valid -@@ -50,12 +50,12 @@ database: # for database see (configure database secti - - database: # for database see (configure database section) - dialect: sqlite3 -- connection: data/gotify.db -+ connection: /var/db/gotify/gotify.db - - defaultuser: # on database creation, gotify creates an admin user - name: admin # the username of the default user - pass: admin # the password of the default user - passstrength: 10 # the bcrypt password strength (higher = better but also slower) --uploadedimagesdir: data/images # the directory for storing uploaded images --pluginsdir: data/plugins # the directory where plugin resides -+uploadedimagesdir: /var/db/gotify/data/images # the directory for storing uploaded images -+pluginsdir: /var/db/gotify/data/plugins # the directory where plugin resides - registration: false # enable registrations diff --git a/net/gotify-server/files/patch-config_config.go b/net/gotify-server/files/patch-config_config.go deleted file mode 100644 index fc561187840a..000000000000 --- a/net/gotify-server/files/patch-config_config.go +++ /dev/null @@ -1,11 +0,0 @@ ---- config/config.go.orig 1979-11-29 23:00:00 UTC -+++ config/config.go -@@ -61,7 +61,7 @@ func configFiles() []string { - if mode.Get() == mode.TestDev { - return []string{"config.yml"} - } -- return []string{"config.yml", "/etc/gotify/config.yml"} -+ return []string{"config.yml", "/usr/local/etc/gotify-server/config.yml"} - } - - // Get returns the configuration extracted from env variables or config file. diff --git a/net/gotify-server/files/patch-config_file.go b/net/gotify-server/files/patch-config_file.go new file mode 100644 index 000000000000..498384f03f27 --- /dev/null +++ b/net/gotify-server/files/patch-config_file.go @@ -0,0 +1,11 @@ +--- config/file.go.orig 2026-08-11 11:36:05 UTC ++++ config/file.go +@@ -46,7 +46,7 @@ func getFiles() []string { + if configHome := getConfigHome(); configHome != "" { + result = append(result, filepath.Join(configHome, "gotify/gotify-server.env")) + } +- return append(result, "/etc/gotify/server.env") ++ return append(result, "/usr/local/etc/gotify-server/server.env") + } + + func getConfigHome() string { diff --git a/net/gotify-server/files/patch-gotify-server.env.example b/net/gotify-server/files/patch-gotify-server.env.example new file mode 100644 index 000000000000..0c177b51c549 --- /dev/null +++ b/net/gotify-server/files/patch-gotify-server.env.example @@ -0,0 +1,46 @@ +--- gotify-server.env.example.orig 2026-08-11 11:36:41 UTC ++++ gotify-server.env.example +@@ -50,7 +50,7 @@ + + # Port the HTTP server listens on. + # Type: number +-# GOTIFY_SERVER_PORT=80 ++GOTIFY_SERVER_PORT=9071 + + # Enable the HTTPS listener. Requires either CERTFILE+CERTKEY or LETSENCRYPT_ENABLED=true. + # Type: boolean +@@ -97,7 +97,7 @@ + # + # Type: text + # Example: /var/lib/gotify/certs +-# GOTIFY_SERVER_SSL_LETSENCRYPT_CACHE=data/certs ++GOTIFY_SERVER_SSL_LETSENCRYPT_CACHE=/var/db/gotify/certs + + # Override the ACME directory URL. Leave empty to use the Let's Encrypt + # production server. The staging server has higher rate limits useful for +@@ -237,7 +237,7 @@ + # mysql: gotify:secret@tcp(localhost:3306)/gotifydb?charset=utf8&parseTime=True&loc=Local + # postgres: host=localhost port=5432 user=gotify dbname=gotifydb password=secret + # When using postgres without SSL, append `sslmode=disable` (see https://github.com/gotify/server/issues/90). +-# GOTIFY_DATABASE_CONNECTION=data/gotify.db ++GOTIFY_DATABASE_CONNECTION=/var/db/gotify/gotify.db + + # Username for the initial admin account. Only applied when the database is + # first created; later changes must be made through the WebUI. +@@ -262,14 +262,14 @@ + # + # Type: text + # Example: /var/lib/gotify/images +-# GOTIFY_UPLOADEDIMAGESDIR=data/images ++GOTIFY_UPLOADEDIMAGESDIR=/var/db/gotify/data/images + + # Directory scanned for plugin shared libraries on startup. Leave empty to + # disable plugin loading. + # + # Type: text + # Example: /var/lib/gotify/plugins +-# GOTIFY_PLUGINSDIR=data/plugins ++GOTIFY_PLUGINSDIR=/var/db/gotify/data/plugins + + # Allow unauthenticated users to register new user accounts via the public + # registration endpoint. diff --git a/net/gotify-server/files/patch-ui_tsconfig.json b/net/gotify-server/files/patch-ui_tsconfig.json index 67b8c2844c69..1fafdfc5c692 100644 --- a/net/gotify-server/files/patch-ui_tsconfig.json +++ b/net/gotify-server/files/patch-ui_tsconfig.json @@ -1,12 +1,12 @@ ---- ui/tsconfig.json.orig 1979-11-29 23:00:00 UTC +--- ui/tsconfig.json.orig 2026-07-18 12:08:41 UTC +++ ui/tsconfig.json -@@ -32,7 +32,8 @@ +@@ -33,7 +33,8 @@ "acceptance-tests", "webpack", "jest", - "src/setupTests.ts" + "src/setupTests.ts", + "**/test/*.ts" ], "include": [ "src"