Bug 263955

Summary: handbook/ports: serving poudriere packages privately
Product: Documentation Reporter: Jonathan Vasquez <jon>
Component: Books & ArticlesAssignee: Graham Perrin <grahamperrin>
Status: Closed FIXED    
Severity: Affects Some People CC: doc, pauamma
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
[patch] serving poudriere packages privately
none
test
none
[patch] no-email header none

Description Jonathan Vasquez 2022-05-13 18:07:46 UTC
Created attachment 233897 [details]
[patch] serving poudriere packages privately

This change originally started as a drive by patch on github (https://github.com/freebsd/freebsd-doc/pull/66). Since then I decided to dive deeper into the docs and internalize the FDP a bit more and taking this as an opportunity to also improve my technical writing (as oppose to my informal technical writing :D).

Please let me know if there are any other improvements I should make. I've attached the diff (with a .txt extension as recommended in the FDP).

Thank you!
Comment 1 Pau Amma 2022-05-19 23:32:58 UTC
Comment on attachment 233897 [details]
[patch] serving poudriere packages privately

Thanks for coming back to it. That looks good to me besides the (very minor) quibble inline below, that's arguably a matter of taste.

>From 0e9a67f6781ed6641a39d1cfc3f41b6aec1b8266 Mon Sep 17 00:00:00 2001
>From: Jonathan Vasquez <jon@xyinn.org>
>Date: Fri, 13 May 2022 14:00:14 -0400
>Subject: [PATCH] handbook/ports: serving poudriere packages privately
>
>---
> .../content/en/books/handbook/ports/_index.adoc        | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
>diff --git a/documentation/content/en/books/handbook/ports/_index.adoc b/documentation/content/en/books/handbook/ports/_index.adoc
>index cfe881e847..7c011abdc9 100644
>--- a/documentation/content/en/books/handbook/ports/_index.adoc
>+++ b/documentation/content/en/books/handbook/ports/_index.adoc
>@@ -1301,6 +1301,16 @@ custom: {
> }
> ....
> 
>+If exposing the package repository to the internet is not desired, the `file://` protocol can be used to point to the repository directly:

I'd say "prefix" instead of protocol here, since it's not a network protocol.

>+
>+[.programlisting]
>+....
>+custom: {
>+	url: "file:///usr/local/poudriere/data/packages/11amd64",
>+	enabled: yes,
>+}
>+....
>+
> [[ports-nextsteps]]
> == Post-Installation Considerations
> 
>-- 
>2.36.1
>
Comment 2 Jonathan Vasquez 2022-05-20 09:34:26 UTC
Hey PauAmma,

Thanks for that. I've always learned "file://" as being a protocol. You are right in that it's not a network protocol, but it is still a protocol on that it's the way in which you will be communicating. file:// could be communicating over the network (if you have a mounted network drive - but that's more of an OS abstraction). We could also call it a URI scheme or scheme for short if more comfortable. Here are some references of people calling it protocol as well on both UNIX and Windows worlds (where in Windows it's coming directly from Microsoft):

https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/jj710207(v=vs.85)

https://stackoverflow.com/questions/40070699/meaning-of-after-file-protocol-url

https://en.m.wikipedia.org/wiki/File_URI_scheme
Comment 3 Jonathan Vasquez 2022-05-20 09:36:03 UTC
For the Microsoft Link, the final ) is not being used if you click the link, manually copy it.
Comment 4 Pau Amma 2022-05-21 23:33:44 UTC
(In reply to Jonathan Vasquez from comment #2)

Fair enough. Could you remove the extra text (email headers etc.) from your patch and reupload, checking the "this is a patch" checkbox when you do?
Comment 5 Jonathan Vasquez 2022-05-26 12:19:19 UTC
Created attachment 234229 [details]
test
Comment 6 Jonathan Vasquez 2022-05-26 12:23:17 UTC
Created attachment 234230 [details]
[patch] no-email header

I've attached the file without the email header. However due note, that the FDP explicitly states two different ways of generating the diff for submission:

1. Using git format-patch origin/main. It specifically mentions (in 1.2.2) that using this will include the email headers which makes it easier for FreeBSD developers to give credit to developers.

2. Using 'git diff' (for me: 'git diff main' since I'm running diff from my working branch and comparing against main for submission). This is standard diff and won't include the headers. Mentioned in 3.6.

https://docs.freebsd.org/en/books/fdp-primer/book/#overview-quick-start

If including email headers for patch submission isn't recommended, it shouldn't be mentioned in the FDP.
Comment 7 Pau Amma 2022-06-08 23:33:41 UTC
(In reply to Jonathan Vasquez from comment #6)

I haven't forgotten that I owe you an answer, but I'm swamped right now.
Comment 8 Jonathan Vasquez 2022-06-09 01:46:44 UTC
Haha np :). Thanks for the update, no rush.
Comment 9 Jonathan Vasquez 2023-05-05 13:54:43 UTC
Hello, just following up if there is anything else I need to do for this to be merged in? Thank you!
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-05-05 17:42:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/doc/commit/?id=56d55c92b940c9755f8aba81f9253b93c238a8c1

commit 56d55c92b940c9755f8aba81f9253b93c238a8c1
Author:     Jonathan Vasquez <jon@xyinn.org>
AuthorDate: 2022-05-13 18:00:14 +0000
Commit:     Graham Perrin <grahamperrin@FreeBSD.org>
CommitDate: 2023-05-05 17:28:17 +0000

    handbook/ports: file:// URLs for poudriere repos

    FreeBSD Handbook: …: Configuring pkg Clients to Use a Poudriere
    Repository

    Add a small section showing the user how to point to their packages
    repository (package directory in this case) via file://. Allow the user
    to not publicly expose their packages over the Internet.

    https://bugs.freebsd.org/263955

    PR:                      263955
    Reported by:             Jonathan Vasquez
    Reviewed by:             debdrup, pauamma
    Pull request:            https://github.com/freebsd/freebsd-doc/pull/66

 documentation/content/en/books/handbook/ports/_index.adoc | 10 ++++++++++
 1 file changed, 10 insertions(+)
Comment 11 Graham Perrin freebsd_committer freebsd_triage 2023-05-05 17:48:20 UTC
Comment on attachment 233897 [details]
[patch] serving poudriere packages privately

I chose this patch, and amended the commit before pushing: 

git -C /usr/doc commit --amend

Thanks for your contribution!
Comment 12 Jonathan Vasquez 2023-05-05 23:24:20 UTC
Thanks Graham. Looks good!