sourcezap/README.md

99 lines
2.9 KiB
Markdown
Raw Permalink Normal View History

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