aur support

This commit is contained in:
tylermurphy534 2022-11-08 22:07:02 -05:00
parent c4c70d9695
commit c0f8085da8
6 changed files with 64 additions and 11 deletions

2
Cargo.lock generated
View file

@ -34,7 +34,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "crab" name = "crab"
version = "4.2.0" version = "0.0.1"
dependencies = [ dependencies = [
"exec", "exec",
"nix", "nix",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "crab" name = "crab"
version = "4.2.0" version = "0.0.1"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

11
deployments/aur/.SRCINFO Normal file
View file

@ -0,0 +1,11 @@
pkgbase = crab
pkgdesc = A rusty permission authentication system
pkgver = 0.0.1
pkgrel = 1
url = https://g.tylerm.dev/tylermurphy534/crab.git
arch = x86_64
license = GPL
source = git+https://g.tylerm.dev/tylermurphy534/crab.git
md5sums = SKIP
pkgname = crab

42
deployments/aur/PKGBUILD Normal file
View file

@ -0,0 +1,42 @@
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.
# Maintainer: Tyler Murphy <tylermurphy534@gmail.com>
pkgname=crab
pkgver=0.0.1
pkgrel=1
epoch=
pkgdesc="A rusty permission authentication system"
arch=(x86_64)
url="https://g.tylerm.dev/tylermurphy534/crab.git"
license=('GPL')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("git+$url")
noextract=()
md5sums=('SKIP')
validpgpkeys=()
build() {
cd crab
cargo build --release
}
package() {
cd crab
install -D --mode=6755 --owner=root --group=root ./target/release/crab ${pkgdir}/usr/bin/crab
install -D --mode=660 --owner=root --group=root pam ${pkgdir}/etc/pam.d/crab
install -D --mode=664 --owner=root --group=root conf ${pkgdir}/usr/share/crab/crab.conf
}

View file

@ -5,12 +5,6 @@ if [[ $(/usr/bin/id -u) -ne 0 ]]; then
exit exit
fi fi
# Make sure rust is able to build as root
rustup default stable
# Build crab
cargo build --release
# Copy executable to bin # Copy executable to bin
cp ./target/release/crab /bin/crab cp ./target/release/crab /bin/crab
chown root:root /bin/crab chown root:root /bin/crab
@ -19,3 +13,4 @@ chmod 6755 /bin/crab
# Set up config files # Set up config files
cp pam /etc/pam.d/crab cp pam /etc/pam.d/crab
cp -n conf /etc/crab.conf cp -n conf /etc/crab.conf
chmod 660 /etc/crab.conf

View file

@ -2,7 +2,12 @@
`Crab`, a.k.a `Cool Rust Authentication Binary` is a rusty replacement for sudo and doas on Linux systems `Crab`, a.k.a `Cool Rust Authentication Binary` is a rusty replacement for sudo and doas on Linux systems
# Installation # Installation
Run `build.sh` as the root user to build the rust binary, and install files. ### From Source
First run `cargo install --release` to compile the binary.
Then run `install.sh` as the root user to install files.
### Arch Based Systems
If you are on arch-linux, the pakage is avaliable on the AUR as `crab-git`.
# Configuration # Configuration
Crab supports multiple users and persistence. Each line of the config is the username, then `true` of `false` if the crab authentication persists, seperated by a space. Crab supports multiple users and persistence. Each line of the config is the username, then `true` of `false` if the crab authentication persists, seperated by a space.
@ -12,4 +17,4 @@ For Example
root true root true
tylerm false tylerm false
``` ```
The configuration file is stored in `/etc/crab.conf` The default configuration file is stored in `/usr/share/crab/crab.conf` and must be coppied to `/etc/crab.conf`.