-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add statelessness doc for users #408
Draft
davidjharder
wants to merge
1
commit into
master
Choose a base branch
from
statelessness-user
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Stateless Configuration | ||
|
||
TODO | ||
|
||
- Decide if "configuration (files)" or "configurations" should be used | ||
- Include other user areas: usr/local, /etc/, /opt, /home, and /var | ||
- Do we mention `%vendorconfdir` `%sysconfdir`, what about /usr/share/defaults/etc/ ? | ||
|
||
## What is Statelessness? | ||
|
||
Stateless configuration (commonly called _statelessness_) is a method of organizing configuration files for applications on Linux with the goal that users are provided with working defaults, and at the same time, are able to override these defaults such that the system gracefully returns to the defaults when the user removes their overriding configuration. | ||
|
||
This stateless behavior is acheived by having applications understand the **hierarchy of configuration files**. The User configuration overrides the System configuration, and the System configuration overrides the OS provided configuration. If no User configuration is provided, then the System configuration is used, and if no System configuration is provided, then the OS provided configuration is used. | ||
|
||
- User configurations _Highest priority_ | ||
- System configurations | ||
- OS provided configurations, AKA default configurations _Lowest priority_ | ||
|
||
### User configurations | ||
|
||
The user configurations can be distinct for each user profile on a machine. These configurations are stored in the `XDG_CONFIG_HOME` directory: `~/.config`, while some applications insist on placing configuration files straight into the home directory. For example the `fish` shell uses the `~/.config/fish` directory to store user configurations, while the `bash` shell uses the `~/.basrc`configuration file straight from the home directory. | ||
|
||
_The package manager will never touch User configurations._ | ||
|
||
### System configurations | ||
|
||
The system configurations are used by all users on a machine. These configurations are stored in the `/etc` directory, for example, the `fish` shell uses the `/etc/fish` directory. | ||
|
||
_The package manager will never touch System configurations._ | ||
|
||
### OS provided configurations | ||
|
||
The OS provided configurations are used by all users on a machine. These configurations are stored in the `/usr/share/defaults` directory. For example, the `sway` window manager uses `/usr/share/defaults/sway` | ||
|
||
_The package manager_ **will** _change OS provided configurations._ | ||
|
||
## Using statlessness | ||
|
||
Using statelessness, you can modify configurations knowing you always have the option to return to the Solus defaults. Additionally, your User configurations can contain the minimal set of desired changes and use default configuration for the rest. | ||
|
||
To demonstrate this in practice, we will use the `sway` window manager: | ||
|
||
Create a directory for your User configuration, then copy the default configuration file provided by Solus: | ||
|
||
```bash | ||
mkdir ~/.config/sway | ||
cp /usr/share/defaults/sway/config ~/.config/sway/config | ||
``` | ||
|
||
:::tip | ||
|
||
You could also place this configuration file in `/etc/sway`, where the configuration would apply to all users. | ||
|
||
::: | ||
|
||
Now you can edit your configuration file: | ||
|
||
```bash | ||
nano ~/.config/sway/config | ||
``` | ||
|
||
To return to Solus defaults, remove your configuration file: | ||
|
||
```bash | ||
rm ~/.config/sway/config | ||
``` | ||
|
||
If you think you have somehow changed the Solus provided defaults, re-install `sway` to overwrite any configuration in `/usr/share/defaults/sway`: | ||
|
||
```bash | ||
sudo eopkg install --reinstall sway | ||
``` | ||
|
||
You can see additional examples on the [Web Development page](/docs/user/software/development/web.md). | ||
|
||
## Common default configuration locations | ||
|
||
This is a list of common default configurations users may wish to copy and change. | ||
|
||
### SSH | ||
|
||
`/usr/share/defaults/etc/ssh/` | ||
|
||
### TODO: Others? | ||
|
||
- pam, ssl | ||
|
||
## Statelessness for packagers | ||
|
||
Refer to TODO future doc. | ||
|
||
## References | ||
|
||
This page relies heavily on the _Clear Linux Project Docs_ | ||
|
||
- https://www.clearlinux.org/clear-linux-documentation/guides/clear/stateless.html | ||
- https://www.clearlinux.org/clear-linux-documentation/reference/manpages/stateless.7.html |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samba, acupsd
Found this in /etc/, used by the APC UPS daemon (not installed by default, in the repos)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my mind, this list is for things that a typical user might change. I don't want to make an exhaustive list of all the configs we shipFor pam and ssl, I'm skeptical we should point users at these configs without some sort of big flashing danger signSee #409