website/content/baguette/overview/index.md

250 lines
13 KiB
Markdown
Raw Normal View History

+++
title = "BaguetteOS: quick overview"
paginate_by = 5
+++
BaguetteOS status: Work In Progress.
A beta will be available circa mid-2020 for advanced users.
End of the year for simple users.
<red>Warning:</red> this documentation is currently mostly oriented towards advanced unix users.
We provide insights on system administration, expose our ideas and point of view.
Documentation for simple users will be split in another page, soon.
- [Objectives for **simple users**](#simple-users)
- [Objectives for **advanced users**](#advanced-users)
- [Objectives for **contributors**](#contributors)
- [Inspiration](#inspiration)
- [Why not use X?](#why-not-x)
<a name="simple-users"></a>
## Objectives, for simple users
BaguetteOS aims at providing a simple unix-like system, with an **unified web interface**.
**No command-line required for simple users.** *let users be just users*<br />
Simplicity should not only come from an interface, but be inherent to the whole system.
If the OS is simple, there is no need to hack it.
**Unified interface is better than features.**<br />
Our web interface will directly provide the basic features such as mail, instant messaging, etc.
The list of features covered by our interface will grow continuously.
We do not want a patchwork of very different software, each of them having its own particularities.
**Online services.** *day-to-day use*<br />
The web interface should cover online services, providing an unified experience for main usages: mails, calendar, instant messaging, personal website, file sharing, etc.
**One-click management.** *service installs, updates, etc.*<br />
The web interface should handle basic system and network configurations, such as adding users, dhcp, DNS, backups, etc.
**Well-known, reliable software.** *for real*<br />
BaguetteOS relies on software known for robustness (opensmtpd, ssh, etc.).
Final users may not be familiar to these software, and <u>they won't have to</u> since BaguetteOS will provide a user interface.
At no point the user should be forced to reinstall, a misconfiguration has to be easily fixable.
We use static compilation for *(at least)* system tools: there is almost no chance for an update to break the system (yes, *almost*, people are creative these days).
**Hardware support.** *new or old, fast or slow, it doesn't matter*<br />
We provide support for RPi and other small cards: if our kernel runs on it, it has to work.
Minimal hardware requirement should be around 100 MB RAM, 50 MB disk.
**Documentation.** *simple, reliable, useful, all-in-one-place*<br />
Similar to the OpenBSD FAQ: updated, complete, concise and well-written.
**Constrained devices use case.** *wanna see what small systems can do?*<br />
By default, we try to provide the smallest memory footprint: we do not provide manuals nor runtime libraries when not required.
Our programs will never require you to download development libraries, nor alternative package managers.
We choose all of our tools with size in mind.
As a result, our system can be installed quickly even on slow machines.
<a name="advanced-users"></a>
## Objectives, for advanced users
**A knowable OS.** *simplicity at (almost) all cost*<br />
Any interested user should be able to understand the role of every part of the base system: no compromise.
This means having a very small and consistent set of tools, easy to learn, easy to remember.
**Basic system and network management.** *with the simplest tools ever*<br />
We provide a web interface that should handle basic system and network configurations, such as adding users, firewall management, dhcp, DNS, backups, etc.
CLI tools are available to manage services, they are designed to be simple, consistent and reliable.
**Officially supported services.** *so you are sure to get them working*<br />
We use some services for our own personal usage, so we will provide support for them.
For instance: gitea, postgresql, etc.
**One need, one tool.** *this time for real*<br />
Installing an application or a library is done by [package][package].
Other methods are not supported **and the base system will never require them**.
We avoid to rely on `pip`, `cpanm`, or other third party package manager and dependency tree.
Starting, stopping, or configuring a service is done by [service][service].
This program alone is used to manage services on the OS.
Users should not be required to manually configure each software; instead, most of the configuration should be done upstream using templates.
Users should be able to change the default configuration through command-line options.
Manual configuration is the last option.
**Slotting.** *any software can be installed on any machine at any time, no extra tooling*<br />
[Slotting](#slotting) by default helps to install many programs, even with peculiar library version requirements.
The same program can be installed in several versions without conflicts.
See more in the [technical section](#technical-choices).
<a name="contributors"></a>
## Objectives, for contributors
**Simple to contribute to.** *you can focus on providing recipes for packages, we handle the tooling*<br />
Packaging applications and libraries should be possible with the fewest and simplest tooling possible.
BaguetteOS provides [a simple tool to package applications](#packaging) (`packaging`) which allows simple recipes for your packages.
`packaging` handles [slotting](#slotting), compiling, stripping binaries and libraries, splitting the result into different packages (`-man`, `-lib`, `-doc`, etc.), authenticating, etc.
All that, just by typing
```sh
$ packaging app
```
nothing more.
<img src="/meanie-makefile.png" alt="meanie meanie dev" class="meanie-img" />
**No Makefile?** *no problem*<br />
Your application or your library lacks a build system? Here is a [tool to create makefiles](#build.zsh).
It works on any language. *yes, even that one*
**Stable and development versions: same thing.** *slotting, again and again*<br />
One of the coolest aspect of slotting is: you don't need to change your system *at all* to be on the development version of the OS.
The newest version is just slotted in `/usr/baguette-dev` and that's it.
Switching OS version is just a few environment variables away.
**New OS, open to explore** *we are open to new ideas*<br />
BaguetteOS does not suffer from cumbersome historical decisions: no overly engineered package format, no stupidly complex patchwork of mismatch tools.
**Easy-to-write documentation.** *and hopefully less procrastination*<br />
Online documentation and man pages are written in Markdown (thanks to `zola` and [scdoc][scdoc]).
Every tool has a man page: no man page = no integration in base.
## Inspiration
- [CRUX][crux], [alpine][alpine]: simple-to-understand Linux systems
- [OpenBSD][openbsd]: security-oriented system, therefore simple
- [PFsense][pfsense]: advanced networking administration through a simple website
- [Plan9][plan9] and [Inferno][inferno]: OS with an *everything is a file* philosophy *no, seriously guys*
- [suckless][suckless] and [cat-v][cat-v]: documentation and tools, all about simplicity, code readability and re-usability
- [morpheus][morpheus]: OS based on statically compiled tools
## Why not use another system?
An operating system is mostly a kernel handling the hardware and a bunch of small programs (named `coreutils`) doing basic tasks (copy a file, list the content of a directory, print the date, etc.).
Additionaly, an OS also has a package manager (such as `apt` on Debian-like systems).
**A few reasons why none of the candidates cover it all.** *some are mentionned bellow*<br />
1. **we want slotting**<br />
So we could change the way we install and maintain packages.
2. **we want fast install and startup on really simple devices** <side-note>*see Raspberry Pi and such*</side-note><br />
Coreutils shrank to bare minimum, thanks to `toybox`.
We won't require a full-feature system with several hundred megabytes of disk-space used.
3. **documentation is important, but not for all installations**<br />
Your 42nd test install on a virtual machine doesn't need a manual for CLI tools you won't use since you do everything through the web interface.
Software and its documentation will be split: manual pages won't be provided by default.
4. **we want automatic tests, and to enable people to test our system**<br />
We want easy chroot installs, on any system.
5. **we want to run on tiny ARM boxes, old laptops, top-notch servers**<br />
So we need to run on any available kernel.
6. **we want to control software distribution releases**<br />
We don't accept to follow updates from an upstream OS that could break our system at any time.
*(Note: this section could be expanded in the future.)*
---
**Now, let's take a look at each candidate.**
**OpenBSD.** *we will get there quick, but will focus on Linux a bit before* <br />
We definitively want to use OpenBSD, currently we just focus on Linux for hardware compatibility reasons (and out of habits) but it's not set in stone.
We love OpenBSD big time, some of us use it daily.
We aim at providing rootfs for running our system under an OpenBSD kernel and environment.<br />
*(also, snapshots could be great, guys)*
**PFsense.** *network focused* <br />
Great system, does the job very well, but won't fit our objectives as it is way too focused on networking.
**CRUX and Alpine.** *great source of inspiration* <br />
We **do** use the CRUX's `rc` script, and as Alpine it is a source of inspiration for package recipes.
However, since we have to change all packages to get slotting, the service manager to have tokenized services, the packaging software to get declarative recipes (...), why even bother use those systems?
**GUIX (and Nix).** *not simple enough*<br />
GUIX approach of package management is interesting, having to learn a language to make recipes isn't.
And that sums up this technology pretty well.
It's great, but not to put everywhere.
Every part of BaguetteOS is simple to understand, GUIX is not simple *enough*.
But keep it up guys, it's still awesome.
**Plan9, Inferno, morpheus, etc.** *kinda abandoned systems* <br />
That's it.
# Wanna see more?
[See the technical choices](/baguette/technical-choices/)
[service]: https://git.baguette.netlib.re/Baguette/service
[package]: https://git.baguette.netlib.re/Baguette/package
[packaging]: https://git.baguette.netlib.re/Baguette/packaging
[build.zsh]: https://git.baguette.netlib.re/Baguette/build.zsh
[libipc]: https://git.baguette.netlib.re/Baguette/libipc
[todod]: https://git.baguette.netlib.re/Baguette/todod
[webhooksd]: https://git.baguette.netlib.re/Baguette/
[tap-aggregator]: https://git.baguette.netlib.re/Baguette/tap-aggregator
[baguette-gitea]: https://git.baguette.netlib.re/
[baguette-rc]: https://git.baguette.netlib.re/Baguette/recipes/src/branch/master/rc
[baguette-profile]: https://git.baguette.netlib.re/Baguette/recipes/src/branch/master/rc/profile
[recipes]: https://git.baguette.netlib.re/Baguette/recipes/
[recipe-hello]: https://git.baguette.netlib.re/Baguette/recipes/src/branch/master/hello/recipe.spec
[recipe-dhcpcd]: https://git.baguette.netlib.re/Baguette/recipes/src/branch/master/dhcpcd/recipe.spec
[recipe-alsautils]: https://git.baguette.netlib.re/Baguette/recipes/src/branch/master/alsa-utils/recipe.spec
[autotools]: https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html
[toybox]: http://www.landley.net/toybox/
[cruxinit]: https://crux.nu/gitweb/?p=ports/core.git;a=blob;f=rc/rc;h=26b8ca08d67208ceda4d4004c8333d362bcdc689;hb=HEAD
[ksh]: https://github.com/att/ast
[zsh]: https://www.zsh.org/
[libarchive]: https://libarchive.org/
[bsdcpio]: https://libarchive.org/
[bsdtar]: https://libarchive.org/
[m4]: https://www.gnu.org/software/m4/m4.html
[gmake]: https://www.gnu.org/software/make/
[proot]: https://man.openbsd.org/proot
[crinja]: https://github.com/straight-shoota/crinja
[zig]: https://ziglang.org/
[openbsd]: https://openbsd.org/
[pfsense]: https://www.pfsense.org/
[alpine]: https://alpinelinux.org/
[crux]: https://crux.nu/
[inferno]: http://www.vitanuova.com/inferno/index.html
[plan9]: https://9p.io/plan9/index.html
[morpheus]: https://morpheus.2f30.org/
[suckless]: https://suckless.org/
[cat-v]: http://cat-v.org/
[working-service-asciinema]: https://asciinema.org/a/0p2vGNA1TUmvq0s61Lu0r4TN6
[ruby-memory-bp]: https://web.archive.org/web/20160329122617/http://blog.rubybestpractices.com/posts/ewong/005-Avoiding-system-calls.html
[scdoc]: https://git.sr.ht/~sircmpwn/scdoc
[pledge]: https://man.openbsd.org/pledge.2
[unveil]: https://man.openbsd.org/unveil.2
[retguard]: https://undeadly.org/cgi?action=article&sid=20170819230157
[cveqemu]: https://www.cvedetails.com/vulnerability-list.php?vendor_id=7506&product_id=0&version_id=0&page=1&hasexp=0&opdos=0&opec=0&opov=0&opcsrf=0&opgpriv=0&opsqli=0&opxss=0&opdirt=0&opmemc=0&ophttprs=0&opbyp=0&opfileinc=0&opginf=0&cvssscoremin=0&cvssscoremax=0&year=0&cweid=0&order=1&trc=276&sha=6055b0330a499f6aed7620adb79dc0cc143e50bc