megabyte-labs / install.doctor

A glorious combination of application / theme settings and a performant cross-platform, desktop-oriented software suite.
https://megabyte.space
Other
100 stars 22 forks source link

Add user logic not working on macOS #5

Closed ProfessorManhattan closed 1 year ago

ProfessorManhattan commented 1 year ago

❔ What are you experiencing an issue with?

Latest Release

❔ Version

Latest

🐞 Description

On macOS, the ZX installer script (home/dot_local/bin/install-program) includes logic to add users / groups to macOS when packages in the software.yml have _groups defined. Anything defined in _groups should be added as a user and a group, and then the current user should also get that group added.

The ZX script needs to be updated with commands that actually make a system user / group. Here's what I tried fiddling with on the command line (which did not work and is what the script is currently using):

❯ sudo chown privoxy:privoxy config
chown: invalid user: ‘privoxy:privoxy’
❯ sudo chown privoxy config
chown: invalid user: ‘privoxy’
❯ sudo dscl . -create /Users/privoxy
❯ sudo dscl . -create /Groups/privoxy
❯ sudo dscl . -append /Groups/privoxy GroupMembership privoxy
❯ sudo chown privoxy config
chown: invalid user: ‘privoxy’
❯ sudo chown privoxy:privoxy config
chown: invalid user: ‘privoxy:privoxy’
❯ sudo sysadminctl -addUser privoxy
2023-03-27 02:17:35.914 sysadminctl[15945:6207548] User named 'privoxy' already exists.
❯ sudo chown privoxy config
chown: invalid user: ‘privoxy’

⏺️ Steps To Reproduce

No response

📒 Relevant Log Output

No response

💡 Possible Solution

No response