2023-03-12 02:10:30 +01:00
|
|
|
## About
|
2023-01-14 18:30:29 +01:00
|
|
|
|
2023-06-10 02:25:23 +02:00
|
|
|
portzap is a utility that manages a local copy of the
|
2024-05-11 22:45:59 +02:00
|
|
|
[HardenedBSD ports tree](https://git.HardenedBSD.org/HardenedBSD/ports).
|
2024-04-19 02:31:54 +02:00
|
|
|
The copy of the ports tree is maintained by members of
|
|
|
|
the `_portzap` group, and the copy of the ports tree
|
2024-05-22 02:28:35 +02:00
|
|
|
can be installed into `/usr/ports/` by root.
|
2024-04-18 22:06:58 +02:00
|
|
|
|
2024-08-07 07:39:09 +02:00
|
|
|
## CLI
|
2023-01-16 02:36:35 +01:00
|
|
|
|
2024-08-17 22:15:30 +02:00
|
|
|
### CLI: setup
|
2024-04-19 10:49:49 +02:00
|
|
|
|
2024-08-17 22:15:30 +02:00
|
|
|
`portzap setup` should be run after installing portzap for
|
|
|
|
the first time. <br> There is no harm in running `portzap setup`
|
2024-07-26 15:54:28 +02:00
|
|
|
multiple times:
|
2024-04-19 10:49:49 +02:00
|
|
|
|
2024-05-22 03:29:30 +02:00
|
|
|
# Add the '_portzap' user, group and home directory
|
2024-05-22 03:24:36 +02:00
|
|
|
# This command requires root privileges
|
2024-08-17 22:15:30 +02:00
|
|
|
root@localhost# portzap setup
|
|
|
|
|
|
|
|
# Reverse the changes made by 'portzap setup'
|
|
|
|
# This command requires root privileges
|
|
|
|
root@localhost# portzap teardown
|
2024-04-19 10:49:49 +02:00
|
|
|
|
2024-08-07 07:20:07 +02:00
|
|
|
### CLI: group
|
2024-04-19 10:49:49 +02:00
|
|
|
|
2024-08-07 07:20:07 +02:00
|
|
|
The following commands are delegated to the `_portzap` user and
|
|
|
|
restricted to members of the `_portzap` group. The restrictions
|
|
|
|
are enforced by portzap and to a lesser extent by
|
|
|
|
[doas(1)](https://man.openbsd.org/doas):
|
2023-01-14 18:30:29 +01:00
|
|
|
|
2024-08-07 07:39:09 +02:00
|
|
|
* **portzap clone** <br>
|
2024-08-07 07:20:07 +02:00
|
|
|
Clone the HardenedBSD ports tree into `/home/_portzap/ports/` <br>
|
2023-01-14 18:30:29 +01:00
|
|
|
|
2024-08-07 07:39:09 +02:00
|
|
|
* **portzap pull** <br>
|
2024-08-07 07:20:07 +02:00
|
|
|
Pull updates into `/home/_portzap/ports/` <br>
|
2024-05-22 03:24:36 +02:00
|
|
|
|
2024-08-07 07:39:09 +02:00
|
|
|
* **portzap checkout** <br>
|
2024-08-07 07:20:07 +02:00
|
|
|
Checkout a branch other than the default: `hardenedbsd/main` <br>
|
2023-01-14 18:30:29 +01:00
|
|
|
|
2024-08-07 07:39:09 +02:00
|
|
|
* **portzap sh** <br>
|
2024-08-07 07:20:07 +02:00
|
|
|
Run `/bin/sh` within `/home/_portzap/ports/` <br>
|
2024-04-20 07:23:20 +02:00
|
|
|
|
2024-08-07 07:20:07 +02:00
|
|
|
### CLI: superuser
|
|
|
|
|
|
|
|
The following commands are restricted to root. <br>
|
|
|
|
The restrictions are enforced by portzap:
|
|
|
|
|
2024-08-07 07:39:09 +02:00
|
|
|
* **portzap rm** <br>
|
2024-08-07 07:20:07 +02:00
|
|
|
Remove the contents of `/usr/ports/` and `/home/_portzap/ports/` <br>
|
|
|
|
|
2024-08-07 07:39:09 +02:00
|
|
|
* **portzap install** <br>
|
2024-08-07 07:20:07 +02:00
|
|
|
Install `/home/_portzap/ports/` into `/usr/ports/` <br>
|
2024-08-07 07:08:54 +02:00
|
|
|
|
2024-08-07 07:20:07 +02:00
|
|
|
## Environment
|
2023-06-10 01:47:34 +02:00
|
|
|
|
2024-05-23 22:00:03 +02:00
|
|
|
* __$PORTZAP\_CLONEURL__ <br>
|
|
|
|
The URL of a git repository <br>
|
2024-05-22 03:24:36 +02:00
|
|
|
Default: https://git.HardenedBSD.org/HardenedBSD/ports.git
|
2024-04-17 21:37:16 +02:00
|
|
|
|
2024-04-02 04:49:45 +02:00
|
|
|
* __$PORTZAP\_INSTALLDIR__ <br>
|
2024-05-22 03:24:36 +02:00
|
|
|
The directory where the ports collection will be installed <br>
|
|
|
|
Default: /usr/ports/
|
2023-06-10 03:04:38 +02:00
|
|
|
|
2023-06-10 02:25:23 +02:00
|
|
|
## Install
|
2023-03-19 20:03:04 +01:00
|
|
|
|
2024-04-17 19:22:46 +02:00
|
|
|
|
|
|
|
portzap is available
|
2024-08-07 07:39:09 +02:00
|
|
|
[from the HardenedBSD ports tree](https://git.HardenedBSD.org/HardenedBSD/ports/-/tree/HardenedBSD/main/hardenedbsd/portzap).
|
|
|
|
`pkg install portzap` should work too but expect slower updates. The most
|
|
|
|
recent version of portzap can be installed via git:
|
2024-04-17 19:22:46 +02:00
|
|
|
|
2024-07-16 23:09:24 +02:00
|
|
|
# Clone
|
2024-06-01 10:27:11 +02:00
|
|
|
user@localhost$ git clone https://git.hardenedbsd.org/0x1eef/portzap.git
|
2024-05-23 18:53:21 +02:00
|
|
|
user@localhost$ cd portzap
|
2024-07-16 23:09:24 +02:00
|
|
|
|
|
|
|
# Install
|
2024-05-23 21:20:04 +02:00
|
|
|
root@localhost# make install
|
2024-08-17 22:15:30 +02:00
|
|
|
root@localhost# portzap setup
|
2024-07-16 23:09:24 +02:00
|
|
|
|
|
|
|
# Add user to '_portzap' group
|
2024-05-23 18:53:21 +02:00
|
|
|
root@localhost# pw groupmod -n _portzap -m <user>
|
2023-03-19 20:03:04 +01:00
|
|
|
|
2024-04-08 01:27:18 +02:00
|
|
|
## Requirements
|
|
|
|
|
2024-06-01 10:27:11 +02:00
|
|
|
* [doas](https://man.openbsd.org/doas)
|
|
|
|
* [git](https://www.man7.org/linux/man-pages/man1/git.1.html)
|
2024-04-08 01:27:18 +02:00
|
|
|
|
2023-03-12 02:10:30 +01:00
|
|
|
## Sources
|
2023-01-14 18:45:46 +01:00
|
|
|
|
2023-06-10 02:25:23 +02:00
|
|
|
* [GitHub](https://github.com/0x1eef/portzap)
|
|
|
|
* [GitLab](https://gitlab.com/0x1eef/portzap)
|
2024-07-08 19:13:57 +02:00
|
|
|
* [git.HardenedBSD.org/@0x1eef](https://git.HardenedBSD.org/0x1eef/portzap)
|
|
|
|
* [brew.bsd.cafe/@0x1eef](https://brew.bsd.cafe/0x1eef/portzap)
|
2023-03-12 02:15:32 +01:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
2024-05-22 03:24:36 +02:00
|
|
|
[BSD Zero Clause](https://choosealicense.com/licenses/0bsd/) <br>
|
|
|
|
See [LICENSE](./LICENSE)
|