Friday, September 23, 2022

Re: [MAINTAINER UPDATE] www/honk 0.9.7 -> 0.9.8

Thank you for the MESSAGE and README change.
I confirm that the backup/upgrade must be done *after* updating the package.
v0.9.8 is required to upgrade the old database.

On 9/23/22, Stuart Henderson <stu@spacehopper.org> wrote:
> On 2022/09/23 12:27, Horia Racoviceanu wrote:
>> Index: pkg/MESSAGE
>> ===================================================================
>> RCS file: pkg/MESSAGE
>> diff -N pkg/MESSAGE
>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>> +++ pkg/MESSAGE 23 Sep 2022 16:17:47 -0000
>> @@ -0,0 +1,15 @@
>> +The database has changed since version 0.9.7
>> +
>> +Stop the old honk process.
>> +honk# rcctl stop honk
>> +
>> +Backup the database.
>> +honk# doas -su _honk
>> +honk$ umask 077; cd ${LOCALSTATEDIR}/honk && honk backup `date
>> +backup-%F`
>> +
>> +Perform the upgrade with the upgrade command.
>> +honk$ honk upgrade
>> +honk$ exit
>> +
>> +Restart.
>> +honk# rcctl start honk
>
> This is too long for MESSAGE, we don't want pages of information
> scrolling after pkg_add. I suggest a single line and add the main
> bit to pkg-readme as below.
>
> I don't use this software. Can you confirm that the backup/upgrade
> steps are OK to do *after* updating the package, or do users need to
> do something *before* updating?
>
> If it's before, then the information will need to go in upgrade
> docs (via faq/current.html) instead because they won't see this message
> until after they've updated packages.
>
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/www/honk/Makefile,v
> retrieving revision 1.19
> diff -u -p -r1.19 Makefile
> --- Makefile 11 Mar 2022 20:09:55 -0000 1.19
> +++ Makefile 23 Sep 2022 16:35:04 -0000
> @@ -1,6 +1,6 @@
> COMMENT = federated status conveyance
>
> -DISTNAME = honk-0.9.7
> +DISTNAME = honk-0.9.8
> CATEGORIES = www
>
> HOMEPAGE = https://humungus.tedunangst.com/r/honk
> @@ -13,6 +13,8 @@ PERMIT_PACKAGE = Yes
> WANTLIB += c pthread sqlite3
>
> MASTER_SITES = ${HOMEPAGE}/d/
> +DISTFILES = ${EXTRACT_ONLY} honk-{../v/tip/d/views/}icon.png
> +EXTRACT_ONLY = ${DISTNAME}${EXTRACT_SUFX}
> EXTRACT_SUFX = .tgz
>
> MODULES = lang/go
> @@ -21,8 +23,7 @@ LIB_DEPENDS = databases/sqlite3
> NO_TEST = Yes
> ALL_TARGET = humungus.tedunangst.com/r/honk
>
> -SUBST_VARS += VARBASE \
> - SYSCONFDIR
> +SUBST_VARS += SYSCONFDIR
>
> DOCDIR ?= ${PREFIX}/share/doc/honk
> EXAMPLESDIR = ${PREFIX}/share/examples/honk
> @@ -53,5 +54,7 @@ post-install:
> ${EXAMPLESDIR}/views/
> ${INSTALL_DATA} ${MODGO_WORKSPACE}/src/${ALL_TARGET}/schema.sql \
> ${EXAMPLESDIR}/
> + ${INSTALL_DATA} ${DISTDIR}/honk-icon.png ${EXAMPLESDIR}/views/favicon.ico
> + ${INSTALL_DATA} ${DISTDIR}/honk-icon.png ${EXAMPLESDIR}/views/icon.png
>
> .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/www/honk/distinfo,v
> retrieving revision 1.11
> diff -u -p -r1.11 distinfo
> --- distinfo 2 Mar 2022 07:31:01 -0000 1.11
> +++ distinfo 23 Sep 2022 16:35:04 -0000
> @@ -1,2 +1,4 @@
> -SHA256 (honk-0.9.7.tgz) = t6EM5E98qvlnq6Y6vd21MvPBrWpkmo4qXdgNEUAeF7M=
> -SIZE (honk-0.9.7.tgz) = 522993
> +SHA256 (honk-0.9.8.tgz) = BmZgMvN7fFrft+W0+V2j3tezI5kRLl/7Fx5wIVXwCG4=
> +SHA256 (honk-icon.png) = 92RJuF2onJ/1OYs4E4TYDm9KbzmNKISl+1+MSdhpzUQ=
> +SIZE (honk-0.9.8.tgz) = 511957
> +SIZE (honk-icon.png) = 912
> Index: pkg/MESSAGE
> ===================================================================
> RCS file: pkg/MESSAGE
> diff -N pkg/MESSAGE
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pkg/MESSAGE 23 Sep 2022 16:35:04 -0000
> @@ -0,0 +1 @@
> +The database has changed since version 0.9.7. See the pkg-readme.
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/www/honk/pkg/PLIST,v
> retrieving revision 1.9
> diff -u -p -r1.9 PLIST
> --- pkg/PLIST 11 Mar 2022 20:09:55 -0000 1.9
> +++ pkg/PLIST 23 Sep 2022 16:35:04 -0000
> @@ -1,5 +1,5 @@
> @newgroup _honk:833
> -@newuser _honk:833:_honk:daemon:Honk User:${VARBASE}/honk:/sbin/nologin
> +@newuser _honk:833:_honk:daemon:Honk
> User:${LOCALSTATEDIR}/honk:/sbin/nologin
> @rcscript ${RCDIR}/honk
> @bin bin/autobonker
> @bin bin/gettoken
> @@ -19,11 +19,11 @@
> @mode 750
> @owner _honk
> @group _honk
> -@sample ${VARBASE}/honk/
> -@sample ${VARBASE}/honk/docs/
> -@sample ${VARBASE}/honk/emus/
> -@sample ${VARBASE}/honk/memes/
> -@sample ${VARBASE}/honk/views/
> +@sample ${LOCALSTATEDIR}/honk/
> +@sample ${LOCALSTATEDIR}/honk/docs/
> +@sample ${LOCALSTATEDIR}/honk/emus/
> +@sample ${LOCALSTATEDIR}/honk/memes/
> +@sample ${LOCALSTATEDIR}/honk/views/
> @mode
> @owner
> @group
> @@ -31,75 +31,79 @@ share/doc/honk/
> share/doc/honk/LICENSE
> share/doc/honk/README
> share/doc/honk/activitypub.7.html
> -@sample ${VARBASE}/honk/docs/activitypub.7.html
> +@sample ${LOCALSTATEDIR}/honk/docs/activitypub.7.html
> share/doc/honk/changelog.txt
> share/doc/honk/hfcs.1.html
> -@sample ${VARBASE}/honk/docs/hfcs.1.html
> +@sample ${LOCALSTATEDIR}/honk/docs/hfcs.1.html
> share/doc/honk/honk.1.html
> -@sample ${VARBASE}/honk/docs/honk.1.html
> +@sample ${LOCALSTATEDIR}/honk/docs/honk.1.html
> share/doc/honk/honk.3.html
> -@sample ${VARBASE}/honk/docs/honk.3.html
> +@sample ${LOCALSTATEDIR}/honk/docs/honk.3.html
> share/doc/honk/honk.5.html
> -@sample ${VARBASE}/honk/docs/honk.5.html
> +@sample ${LOCALSTATEDIR}/honk/docs/honk.5.html
> share/doc/honk/honk.8.html
> -@sample ${VARBASE}/honk/docs/honk.8.html
> +@sample ${LOCALSTATEDIR}/honk/docs/honk.8.html
> share/doc/honk/intro.1.html
> -@sample ${VARBASE}/honk/docs/intro.1.html
> +@sample ${LOCALSTATEDIR}/honk/docs/intro.1.html
> share/doc/honk/mandoc.css
> -@sample ${VARBASE}/honk/docs/mandoc.css
> +@sample ${LOCALSTATEDIR}/honk/docs/mandoc.css
> share/doc/honk/ping.txt
> share/doc/honk/screenshot-afterpost.jpg
> -@sample ${VARBASE}/honk/docs/screenshot-afterpost.jpg
> +@sample ${LOCALSTATEDIR}/honk/docs/screenshot-afterpost.jpg
> share/doc/honk/screenshot-compose.png
> -@sample ${VARBASE}/honk/docs/screenshot-compose.png
> +@sample ${LOCALSTATEDIR}/honk/docs/screenshot-compose.png
> share/doc/honk/screenshot-honk.png
> -@sample ${VARBASE}/honk/docs/screenshot-honk.png
> +@sample ${LOCALSTATEDIR}/honk/docs/screenshot-honk.png
> share/doc/honk/toys/
> share/doc/honk/toys/README
> share/doc/honk/vim.3.html
> -@sample ${VARBASE}/honk/docs/vim.3.html
> +@sample ${LOCALSTATEDIR}/honk/docs/vim.3.html
> share/doc/pkg-readmes/${PKGSTEM}
> share/examples/honk/
> share/examples/honk/schema.sql
> -@sample ${VARBASE}/honk/schema.sql
> +@sample ${LOCALSTATEDIR}/honk/schema.sql
> share/examples/honk/views/
> share/examples/honk/views/about.html
> -@sample ${VARBASE}/honk/views/about.html
> +@sample ${LOCALSTATEDIR}/honk/views/about.html
> share/examples/honk/views/account.html
> -@sample ${VARBASE}/honk/views/account.html
> +@sample ${LOCALSTATEDIR}/honk/views/account.html
> share/examples/honk/views/chatter.html
> -@sample ${VARBASE}/honk/views/chatter.html
> +@sample ${LOCALSTATEDIR}/honk/views/chatter.html
> share/examples/honk/views/combos.html
> -@sample ${VARBASE}/honk/views/combos.html
> +@sample ${LOCALSTATEDIR}/honk/views/combos.html
> +share/examples/honk/views/favicon.ico
> +@sample ${LOCALSTATEDIR}/honk/views/favicon.ico
> share/examples/honk/views/funzone.html
> -@sample ${VARBASE}/honk/views/funzone.html
> +@sample ${LOCALSTATEDIR}/honk/views/funzone.html
> share/examples/honk/views/header.html
> -@sample ${VARBASE}/honk/views/header.html
> +@sample ${LOCALSTATEDIR}/honk/views/header.html
> share/examples/honk/views/hfcs.html
> -@sample ${VARBASE}/honk/views/hfcs.html
> +@sample ${LOCALSTATEDIR}/honk/views/hfcs.html
> share/examples/honk/views/honk.html
> -@sample ${VARBASE}/honk/views/honk.html
> +@sample ${LOCALSTATEDIR}/honk/views/honk.html
> share/examples/honk/views/honkers.html
> -@sample ${VARBASE}/honk/views/honkers.html
> +@sample ${LOCALSTATEDIR}/honk/views/honkers.html
> share/examples/honk/views/honkform.html
> -@sample ${VARBASE}/honk/views/honkform.html
> +@sample ${LOCALSTATEDIR}/honk/views/honkform.html
> share/examples/honk/views/honkfrags.html
> -@sample ${VARBASE}/honk/views/honkfrags.html
> +@sample ${LOCALSTATEDIR}/honk/views/honkfrags.html
> share/examples/honk/views/honkpage.html
> -@sample ${VARBASE}/honk/views/honkpage.html
> +@sample ${LOCALSTATEDIR}/honk/views/honkpage.html
> share/examples/honk/views/honkpage.js
> -@sample ${VARBASE}/honk/views/honkpage.js
> +@sample ${LOCALSTATEDIR}/honk/views/honkpage.js
> +share/examples/honk/views/icon.png
> +@sample ${LOCALSTATEDIR}/honk/views/icon.png
> share/examples/honk/views/login.html
> -@sample ${VARBASE}/honk/views/login.html
> +@sample ${LOCALSTATEDIR}/honk/views/login.html
> share/examples/honk/views/msg.html
> -@sample ${VARBASE}/honk/views/msg.html
> +@sample ${LOCALSTATEDIR}/honk/views/msg.html
> share/examples/honk/views/onts.html
> -@sample ${VARBASE}/honk/views/onts.html
> +@sample ${LOCALSTATEDIR}/honk/views/onts.html
> share/examples/honk/views/pleroma.css
> -@sample ${VARBASE}/honk/views/pleroma.css
> +@sample ${LOCALSTATEDIR}/honk/views/pleroma.css
> share/examples/honk/views/style.css
> -@sample ${VARBASE}/honk/views/style.css
> +@sample ${LOCALSTATEDIR}/honk/views/style.css
> share/examples/honk/views/wonk.js
> -@sample ${VARBASE}/honk/views/wonk.js
> +@sample ${LOCALSTATEDIR}/honk/views/wonk.js
> share/examples/honk/views/xzone.html
> -@sample ${VARBASE}/honk/views/xzone.html
> +@sample ${LOCALSTATEDIR}/honk/views/xzone.html
> Index: pkg/README
> ===================================================================
> RCS file: /cvs/ports/www/honk/pkg/README,v
> retrieving revision 1.5
> diff -u -p -r1.5 README
> --- pkg/README 11 Mar 2022 20:09:55 -0000 1.5
> +++ pkg/README 23 Sep 2022 16:35:04 -0000
> @@ -9,108 +9,73 @@ honk expects to be fronted by a TLS term
> Make sure to pass the Host header for nginx(8)
> proxy_set_header Host $http_host;
>
> -Icon and favicon
> -----------------
> -
> -honk# mkdir ${VARBASE}/www/htdocs/honk
> -honk# ftp -o ${VARBASE}/www/htdocs/honk/icon.png \
> - https://honk.tedunangst.com/icon.png
> -honk# ftp -o ${VARBASE}/www/htdocs/honk/favicon.ico \
> - https://honk.tedunangst.com/favicon.ico
> -
> -httpd(8)
> ---------
> -
> -# httpd.conf(5)
> -server "honk.example.com" {
> - listen on * port http
> - location "/.well-known/acme-challenge/*" {
> - root "/acme"
> - request strip 2
> - }
> - location "/*icon.*" {
> - root "/htdocs/honk"
> - }
> - location "*" {
> - block return 302 "https://$HTTP_HOST$REQUEST_URI"
> - }
> -}
> -
> -honk# rcctl enable httpd
> -honk# rcctl start httpd
> +Setup
> +=====
>
> -acme-client(1)
> ---------------
> +Please see ${LOCALBASE}/share/doc/honk
>
> -# acme-client.conf(5)
> -domain honk.example.com {
> - domain key "${SYSCONFDIR}/ssl/private/honk.example.com.key"
> - domain full chain certificate "${SYSCONFDIR}/ssl/honk.example.com.crt"
> - sign with letsencrypt
> -}
> +honk(8)
> +-------
>
> -honk# acme-client -v honk.example.com
> -honk# ocspcheck -vNo /etc/ssl/honk.example.com.{ocsp,crt}
> +honk# doas -su _honk
> +honk$ umask 077; cd ${LOCALSTATEDIR}/honk && honk init
> +listenaddr: localhost:31337
> +servername: honk.example.com
> +honk$ touch ${LOCALSTATEDIR}/honk/savedinbox.json
> +honk$ exit
>
> -relayd(8)
> ----------
> +honk# rcctl enable honk
> +honk# rcctl start honk
>
> -# relayd.conf(5)
> -ext_ip="203.0.113.4"
> -ext_ip2="2001:0db8::4"
> -honk_port="31337"
> -table <honk> { 127.0.0.1 ::1 }
> -table <localhost> { 127.0.0.1 ::1 }
> -
> -http protocol "https" {
> - match request header append "X-Forwarded-For" value "$REMOTE_ADDR"
> - match request header append "X-Forwarded-By" \
> - value "$SERVER_ADDR:$SERVER_PORT"
> - match request header set "Connection" value "close"
> +Honk at https://honk.example.com
>
> - match request header "Host" value "honk.*" forward to <honk>
> - match request path "/*icon.*" forward to <localhost>
> +Customization
> +=============
>
> - tcp { sack, backlog 128 }
> - tls keypair honk.example.com
> -}
> -relay "https" {
> - listen on $ext_ip port https tls
> - protocol "https"
> - forward to <localhost> port http check http "/icon.png" code 200
> - forward to <honk> port $honk_port check tcp
> -}
> -relay "https2" {
> - listen on $ext_ip2 port https tls
> - protocol "https"
> - forward to <localhost> port http check http "/icon.png" code 200
> - forward to <honk> port $honk_port check tcp
> +Site CSS may be overridden by creating a views/local.css file in the
> +${LOCALSTATEDIR}/honk directory. Site JS may similarly be included by
> creating
> +views/local.js. A restart is required after changes.
> +
> +e.g. add this snippet to open all links in honks in new tabs.
> +
> +function adjusttargets() {
> + var els = document.querySelectorAll("p.content a")
> + for (var i = 0; i < els.length; i++) {
> + var e = els[i]
> + e.target = "_blank"
> + }
> }
> +document.addEventListener('DOMContentLoaded', adjusttargets, false);
>
> -honk# rcctl enable relayd
> -honk# rcctl start relayd
> +Maintenance
> +===========
>
> -pf(4)
> ------
> +The cleanup [days] command exists to purge old external data, by default
> 30
> +days. This removes unreferenced, unsaved posts and attachments. It does
> not
> +remove any original content.
>
> -# pf.conf(5)
> -anchor "relayd/*"
> +honk# crontab -eu _honk
>
> -honk# pfctl -f ${SYSCONFDIR}/pf.conf
> +# crontab(5)
> +MAILTO=root
> +@daily ${LOCALBASE}/bin/honk cleanup
>
> -Setup
> -=====
> +Database Upgrade
> +================
>
> -Please see ${LOCALBASE}/share/doc/honk
> +If you are upgrading from a version before 0.9.7, you will need to upgrade
> +the database format:
> +
> +Stop the old honk process.
> +honk# rcctl stop honk
>
> +Backup the database.
> honk# doas -su _honk
> -honk$ umask 077; cd ${VARBASE}/honk && honk init
> -listenaddr: localhost:31337
> -servername: honk.example.com
> -honk$ touch ${VARBASE}/honk/savedinbox.json
> +honk$ umask 077; cd ${LOCALSTATEDIR}/honk && honk backup `date +backup-%F`
> +
> +Perform the upgrade with the upgrade command.
> +honk$ honk upgrade
> honk$ exit
>
> -honk# rcctl enable honk
> +Restart.
> honk# rcctl start honk
> -
> -Honk at https://honk.example.com
> Index: pkg/honk.rc
> ===================================================================
> RCS file: /cvs/ports/www/honk/pkg/honk.rc,v
> retrieving revision 1.8
> diff -u -p -r1.8 honk.rc
> --- pkg/honk.rc 11 Mar 2022 20:09:55 -0000 1.8
> +++ pkg/honk.rc 23 Sep 2022 16:35:04 -0000
> @@ -1,7 +1,7 @@
> #!/bin/ksh
>
> daemon="${TRUEPREFIX}/bin/honk"
> -daemon_flags="-datadir ${VARBASE}/honk -viewdir ${VARBASE}/honk"
> +daemon_flags="-datadir ${LOCALSTATEDIR}/honk -viewdir
> ${LOCALSTATEDIR}/honk"
> daemon_logger="daemon.info"
> daemon_user="_honk"
>
>

No comments:

Post a Comment