Commit graph

398 commits

Author SHA1 Message Date
704e12e5ca
Change edit_file function to require &EditKind parameter instead of boolean
- Define `EditKind` type and replace edit boolean in order to
  prevent accidental misparameterisation
- Fix the `edit_file` invocation in the desktop module with the
  `&EditKind::Edit` parameter.
2025-03-19 19:13:40 -04:00
339dedf049
Remove unnecessary return statement 2025-03-18 22:39:16 -04:00
f8c82d8bf2
Fix Xwayland bug relating to Xauthority presence
XAuthority file may not be present under a Wayland session. Therefore
we only mount it into the container if it is present.
2025-03-19 18:10:41 -04:00
a849e30528
Lint dist scripting
- Most `shellcheck` warnings and errors fixed
- Restructure workspace validation scripting
- Declare `set -eEo pipefail` at the top of each script
- Declare proper, semantic bash arrays for runtime script
- Use a semantic shebang for scripting
2025-03-18 21:08:31 -04:00
d556e43427
Update process opts and revise manual entry
- Process `--id-list` option now requires the `-t, --target` option to be
  specified without the omission thereof.
- Fix command-flow for `-h, --help` with process option.
- Revise manual with elaboration on display and enumeration options
2025-02-15 02:01:10 -05:00
561e0eb97c
Implement HelpObject trait and migrate help functions to modules 2025-02-13 17:38:04 -05:00
0503f514f6
Update documentation and manpage
- Add documentation for the `to_xdg_runtime` and `to_xdg_home`
  filesystem modules
- Amend documentation to reflect the revised `root` module
- Clarify some of the verbiage in filesystems documentation
2025-02-11 20:18:08 -05:00
c65110f9f6
Don't serialize default values in root filesystem module 2025-02-11 19:38:58 -05:00
712892e8b3
Propagate alpm errors in agent 2025-02-11 19:31:53 -05:00
74d5571434
Add desktop entry to --help menu along with examples 2025-02-11 19:31:12 -05:00
e790ddaaa3
Replace print_warning and print_error utility functions with macros
- Implement `eprintln_warn` and `eprintln_warn` macros.
- Move generalised, utility macros to the utils module.
- Refactor `format_str` to `format_static`.
- Remove re-exports of ansi functions from utils module.
2025-02-09 23:22:34 -05:00
f5e5c01697
Inline utils::whitespace 2025-02-09 22:39:25 -05:00
83f6e6e43e
Addition of proper --help options and deprecate old command flow
- Deprecate `--list` and `--desktop` in the utilities command module.
- Updated help entries for `--desktop` and `--list`
- `--help` in list and desktop command modules
2025-02-09 22:37:09 -05:00
45466638fe
Replace lazy_static crate with LazyLock using the lazy_lock macro
- Introduce `lazy_lock` macro to maintain compatibility with former
  lazy_static declarations, and remove `lazy_static` as a package
  dependency for pacwrap-core.
- Replace needlessly verbose ansi functions with `ansi` macro block.
- Update workspace 'Cargo.toml' and `README.md` to change the MSRV
  from 1.72 to 1.80.
- Update `Cargo.lock`
2025-02-09 19:49:44 -05:00
9c2a986374
Desktop module rework
- Implement rudimentary, lazy INI parsing to handle files following the
  XDG Desktop Entry Specification. Data such as the application name and
  container name are parsed from these files.
- List table expanded to three columns, with container metadata if
  applicable, providing application name. container name, the name of
  desktop entries.
- `-f/--find` CLI parameter to filter the table listing by predicate.
- Add extend function to utils::table module.
2025-02-07 22:30:50 -05:00
42be9498ea
Update copyright year 2025-02-03 21:13:07 -05:00
a13be3886b
Support declaration of root volumes
- Support declaration of volume mounts in root filesystem module.
- Default impls for home and root filesystem modules and the none
  permission module.
- Declare consts for default volume mounts.
2025-02-03 21:06:47 -05:00
7a2365bb06
Support symlinks and provide valid TryFrom fields for desktop entries
- Support desktop entries referenced by a symbolic link
- Provide a general purpose path canonicalization API for containers
  with the `exec::path::resolve_path` function.
- TryExec fields are now replaced with a valid entry referring to the
  pacwrap binary
2024-12-25 18:01:44 -05:00
fb65029371
Few bugs fixes for xdg_home
- Qualify and only warn if XDG directories are missing, otherwise
  disqualify with an error.
- Fix registration iter chain to ensure location is qualified.
2024-12-26 18:16:17 -05:00
8e2a1a5b5e
Unit test implemented for args module 2024-12-25 14:27:59 -05:00
b5bdce84a7
Omit timezone offset for UTC timezone 2024-12-25 02:38:36 -05:00
62f8c0923a
Use lifetime elision for PermissionVisitor impl in config::filesystem 2024-12-25 02:36:06 -05:00
f20f46b28e
Genericised From<T> trait impl for Error types
- Error type in the error module now implements a broadly generic From<T>
  impl for error conversion into the pacwrap-core library's Error type.
- `ErrorGeneric::prepend` and `ErrorGeneric::prepend_io` both now accept
  borrowed or heap-allocated String return types without additional sugar.
- A lone unary postfix operator has been applied to external function calls
  where deemed most appropriate, removing unnecessary function calls to
  `ErrorGeneric::prepend` and `ErrorGeneric::prepend_io`.
2024-12-25 02:00:04 -05:00
6e5bb8df5a
Implement xdg_runtime filesystem module
Provides a shortcut to easily mount sockets and other miscelleny from
the $XDG_RUNTIME_DIR location into containers. With the use of the
`to_run` key, with a standard key/value structure for filesystem
volume mounts.
2024-12-24 21:09:34 -05:00
b14b1fd22f
Clean up of pipewire and pulseaudio filesystem modules
- Make use of `skip_serializing_none` macro, from the serde_with crate,
  in both the `pipewire` and `pulseaudio` filesystem modules to clean up
  the data structure.
- Utilise the `split_whitespace()` in function chain for the
  `AlpmConfiguration::sig_level(&self)` function.
- In gpu module, use any instead of filter and is_empty in iter chain
  for the nvidia variable.
2024-12-24 20:59:36 -05:00
fc0ea7dd62
Deserialize 'ro' and 'rw' strs into Permission enum
- Implement serde Serializer and Deserializer for the Permission enum in
  Filesystem module.
- Breaking: Refactor ExecutionArgs API, combining the 'robind' and
  'bind' functions into a single function named 'bind'.
2024-11-11 00:11:51 -05:00
36ed2db1d2
tmp filesystem module 2024-11-10 19:47:30 -05:00
dfc3d7059c
xdg_home permissions module and some refactoring 2024-11-10 19:38:53 -05:00
a9d85bcc16
-h/--help option in command submodules 2024-12-18 19:56:25 -05:00
7745598117
Fix elided lifetimes
All checks were successful
Build / Check format (push) Successful in 50s
Build / Lint pacwrap (push) Successful in 1m23s
Build / Build pacwrap (push) Successful in 1m35s
2024-12-18 19:44:23 -05:00
3f4b842e14
Update Cargo.lock
Some checks failed
Build / Check format (push) Successful in 53s
Build / Lint pacwrap (push) Failing after 1m17s
Build / Build pacwrap (push) Successful in 1m38s
2024-12-18 19:28:44 -05:00
1287f1eb60
Add Update container step
All checks were successful
Build / Check format (push) Successful in 42s
Build / Lint pacwrap (push) Successful in 1m6s
Build / Build pacwrap (push) Successful in 1m23s
Since the Arch Linux OCI image can sometimes be out-of-sync, update the
keyring and base packages prior to installing the requisite packages.
This will hopefully ensure a cached container image can no longer
trigger a pipeline failure.
2024-11-16 23:41:45 -05:00
293ebaa788
Release 0.8.7
All checks were successful
Build / Check format (push) Successful in 49s
Build / Lint pacwrap (push) Successful in 1m20s
Build / Build pacwrap (push) Successful in 1m33s
2024-11-08 18:53:48 -05:00
c2c2496ad8
Cleaned up display permission module and bounds check
All checks were successful
Build / Check format (push) Successful in 49s
Build / Lint pacwrap (push) Successful in 1m17s
Build / Build pacwrap (push) Successful in 1m32s
- Check `DISPLAY` for colon delimiter to ensure array bounds and avoid
  a runtime panic.
- Set `WAYLAND_DISPLAY` to `wayland-0` inside the container.
2024-11-05 21:06:16 -05:00
45c349aa6e
Merge pull request #4 from jullanggit/master
All checks were successful
Build / Check format (push) Successful in 48s
Build / Lint pacwrap (push) Successful in 1m16s
Build / Build pacwrap (push) Successful in 1m33s
Fix missing / in WAYLAND_SOCKET
2024-11-06 00:32:03 +00:00
e8acbc5ea8
Require 1 instead of boolean for PACWRAP_SCHEMA_BUILT
All checks were successful
Build / Check format (push) Successful in 49s
Build / Lint pacwrap (push) Successful in 1m19s
Build / Build pacwrap (push) Successful in 1m32s
2024-11-05 18:20:27 -05:00
jullang
2178eb0a74 fix missing / in WAYLAND_SOCKET 2024-11-03 13:15:30 +01:00
3c685c617a
Update Cargo.lock
All checks were successful
Build / Check format (push) Successful in 49s
Build / Lint pacwrap (push) Successful in 1m13s
Build / Build pacwrap (push) Successful in 1m31s
2024-11-02 02:25:01 -04:00
660ab2b910
Separate lint job
- Separate Build and Lint jobs for better clarity
- Fixed PACWRAP_SCHEMA_BUILT envvar check in pacwrap build script
2024-11-02 02:22:42 -04:00
80c6042c3b
Tidy up manifests and inclusion of workspace dependencies
All checks were successful
Build / Check format (push) Successful in 48s
Build / Build pacwrap (push) Successful in 1m40s
- `alpm` and `pacwrap-core` defined as workspace dependencies being
  imported by each crate.
- Set workspace resolver version to `2`
2024-10-31 16:22:08 -04:00
ed2a8ac1ca
Validate version string and clean up of subshell cmd sequences 2024-10-31 16:12:47 -04:00
e7fb0e3ca6
Revert README.md
All checks were successful
Build / Check format (push) Successful in 45s
Build / Build pacwrap (push) Successful in 1m42s
2024-10-30 23:55:52 -04:00
58084985cf
Pre-release 0.8.7
All checks were successful
Build / Check format (push) Successful in 50s
Build / Build pacwrap (push) Successful in 1m41s
Note: This is a test release intended to ensure nothing breaks when the
associated crates are published to crates.io.

- Update to version '0.8.7-pre'.
- Testing new `Cargo.toml` workspace manifest, of which brings manifest
  keys in all three pacwrap crates together. Most package keys now, with
  the exception of crate-specific metadata, are now located in the
  workspace manifest.
- Update common.sh to accomodate this change.
- Update README.md to again use relative paths.
2024-10-30 23:24:48 -04:00
20f7ed7d8d
Enable workflow dispatch
All checks were successful
Build / Check format (push) Successful in 42s
Build / Build pacwrap (push) Successful in 1m33s
2024-10-20 20:08:16 -04:00
4c1269e458
Use crate's Result type
All checks were successful
Build / Check format (push) Successful in 39s
Build / Build pacwrap (push) Successful in 1m33s
2024-10-13 19:18:46 -04:00
33dd4911ff
Formatting
All checks were successful
Build / Check format (push) Successful in 47s
Build / Build pacwrap (push) Successful in 1m32s
2024-10-11 19:54:49 -04:00
27845d8188
Modify scope and synchronise workflows
All checks were successful
Build / Check format (push) Successful in 41s
Build / Build pacwrap (push) Successful in 1m37s
2024-10-06 23:28:14 -04:00
ffabc563e8
Merge pull request #3 from pacwrap/readme_test
All checks were successful
Build / Check format (push) Successful in 41s
Build / Build pacwrap (push) Successful in 1m33s
Update README.md
2024-10-07 02:51:25 +00:00
52ca04a5cf
Update README.md 2024-10-06 22:31:35 -04:00
1c66a7e4a4
Github workflow
All checks were successful
Build / Check format (push) Successful in 41s
Build / Build pacwrap (push) Successful in 1m36s
2024-10-06 20:36:15 -04:00