diff --git a/www/opengist/Makefile b/www/opengist/Makefile index 0df11a53817d..cac6e4f7bfda 100644 --- a/www/opengist/Makefile +++ b/www/opengist/Makefile @@ -1,64 +1,69 @@ PORTNAME= opengist -PORTVERSION= 1.8.1 +PORTVERSION= 1.8.2 DISTVERSIONPREFIX= v CATEGORIES= www textproc MASTER_SITES= LOCAL/fox/:js DISTFILES= opengist-${DISTVERSION}-node_modules.tgz:js MAINTAINER= fox@FreeBSD.org COMMENT= Self-hosted pastebin powered by Git, open-source alternative to Github Gist. WWW= https://opengist.io/ LICENSE= AGPLv3 BROKEN_aarch64= fails to build BROKEN_i386= fails to build BUILD_DEPENDS= npm${NODEJS_SUFFIX}>0:www/npm${NODEJS_SUFFIX} RUN_DEPENDS= git:devel/git USES= go:modules nodejs:20,build USE_RC_SUBR= opengist USE_GITHUB= nodefault GH_ACCOUNT= thomiceli GH_PROJECT= opengist GO_MODULE= github.com/thomiceli/opengist GO_TARGET= . GO_BUILDFLAGS= -tags fs_embed \ -ldflags="-X github.com/thomiceli/opengist/internal/config.OpengistVersion=v${DISTVERSION}" post-extract: @${RLN} ${WRKDIR}/node_modules ${WRKSRC}/node_modules +post-patch: + @${REINPLACE_CMD} -e 's|opengist.db|file:/var/db/${PORTNAME}/opengist.db|g' \ + ${WRKSRC}/config.yml + pre-build: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} npx --offline vite -c public/vite.config.js build cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ EMBED=1 npx --offline postcss 'public/assets/embed-*.css' -c public/postcss.config.js --replace post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/${PORTNAME} ${INSTALL_DATA} ${WRKSRC}/config.yml ${STAGEDIR}${PREFIX}/etc/${PORTNAME}/config.yml.sample + ${MKDIR} ${STAGEDIR}/var/db/${PORTNAME} ${MKDIR} ${STAGEDIR}/var/run/${PORTNAME} ${MKDIR} ${STAGEDIR}${WWWDIR}/assets cd ${WRKSRC} && ${INSTALL_DATA} public/assets/* ${STAGEDIR}${WWWDIR}/assets cd ${WRKSRC} && ${INSTALL_DATA} public/manifest.json ${STAGEDIR}${WWWDIR} # # To update the opengist-${DISTVERSION}-node_modules.tgz archive: # 1. Comment out the DISTFILES and post-extract lines # 2. Run 'make makesum regenerate-node_modules-distfile clean' # 3. Upload the archive # 4. Uncomment the lines from step #1 # 5. Run 'make makesum' # regenerate-node_modules-distfile: patch cd ${WRKSRC} && \ ${RM} -r node_modules && \ ${MAKE_ENV} npm install --prefix ${WRKSRC} && \ ${TAR} czf ${DISTDIR}/opengist-${DISTVERSION}-node_modules.tgz node_modules && \ ${ECHO} "Please upload the file ${DISTDIR}/opengist-${DISTVERSION}-node_modules.tgz" .include diff --git a/www/opengist/distinfo b/www/opengist/distinfo index 57e46617b694..081c350d163a 100644 --- a/www/opengist/distinfo +++ b/www/opengist/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1731775790 -SHA256 (go/www_opengist/opengist-v1.8.1/opengist-1.8.1-node_modules.tgz) = e42cb24f3fe6c12cfdad2de2ac3ad829108cdcb99a988197177c924b65b8a885 -SIZE (go/www_opengist/opengist-v1.8.1/opengist-1.8.1-node_modules.tgz) = 22842430 -SHA256 (go/www_opengist/opengist-v1.8.1/v1.8.1.mod) = 5d7a604b4ac7fd4d6e52fcc87e825b75f6c8b7c5ea531111437e74304b9edc36 -SIZE (go/www_opengist/opengist-v1.8.1/v1.8.1.mod) = 5058 -SHA256 (go/www_opengist/opengist-v1.8.1/v1.8.1.zip) = f097bab3a178016af715e73f2e5008c4e89b9806456022141573ce19c454f7d8 -SIZE (go/www_opengist/opengist-v1.8.1/v1.8.1.zip) = 1610649 +TIMESTAMP = 1732608998 +SHA256 (go/www_opengist/opengist-v1.8.2/opengist-1.8.2-node_modules.tgz) = deb15e3a5500053f4eadba6ab5b2f4278d63f8d6f55bd6977442aa0ef0653a92 +SIZE (go/www_opengist/opengist-v1.8.2/opengist-1.8.2-node_modules.tgz) = 22839740 +SHA256 (go/www_opengist/opengist-v1.8.2/v1.8.2.mod) = e23e2417d8d5b9b0cfee169732e45679fe2cda94d3153c9edb51cc56ce7343ec +SIZE (go/www_opengist/opengist-v1.8.2/v1.8.2.mod) = 5060 +SHA256 (go/www_opengist/opengist-v1.8.2/v1.8.2.zip) = e62fc065354f96b04e3c98c8c195fe57e79bfdd2f5fff90a13995e2431dc14cc +SIZE (go/www_opengist/opengist-v1.8.2/v1.8.2.zip) = 1618924 diff --git a/www/opengist/files/patch-internal_cli_main.go b/www/opengist/files/patch-internal_cli_main.go new file mode 100644 index 000000000000..18226beeca97 --- /dev/null +++ b/www/opengist/files/patch-internal_cli_main.go @@ -0,0 +1,19 @@ +--- internal/cli/main.go.orig 1979-11-30 00:00:00 UTC ++++ internal/cli/main.go +@@ -92,12 +92,12 @@ func Initialize(ctx *cli.Context) { + "Current git version: " + gitVersion) + } + +- if err := git.InitGitConfig(); err != nil { +- log.Fatal().Err(err).Send() +- } +- + homePath := config.GetHomeDir() + log.Info().Msg("Data directory: " + homePath) ++ ++ if err := git.InitGitConfig(); err != nil { ++ log.Warn().Msg("Git config modification failed, ensure " + homePath + " is added to git safe directories, and receive.advertisePushOptions is set to true.") ++ } + + if err := createSymlink(homePath, ctx.String("config")); err != nil { + log.Fatal().Err(err).Msg("Failed to create symlinks") diff --git a/www/opengist/pkg-plist b/www/opengist/pkg-plist index 10b82af0fa2b..a5bbab4c2094 100644 --- a/www/opengist/pkg-plist +++ b/www/opengist/pkg-plist @@ -1,16 +1,17 @@ bin/opengist %%ETCDIR%%/config.yml.sample etc/rc.d/opengist %%WWWDIR%%/assets/admin-f49fd6c0.js %%WWWDIR%%/assets/default-f34219fc.png %%WWWDIR%%/assets/editor-dd91ca8c.js %%WWWDIR%%/assets/embed-3b762c54.css %%WWWDIR%%/assets/embed-ba879bc1.js %%WWWDIR%%/assets/favicon-32-5d82ace6.png %%WWWDIR%%/assets/gist-bdaf8125.js %%WWWDIR%%/assets/main-4eb45586.js %%WWWDIR%%/assets/main-54c7a69f.css %%WWWDIR%%/assets/opengist-85b89b9c.svg %%WWWDIR%%/assets/webauthn-da047c6d.js %%WWWDIR%%/manifest.json +@dir /var/db/opengist @dir /var/run/opengist