Skip to content
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

customizer.sh endpoint capabilities #66

Open
AleixMT opened this issue Jan 20, 2023 · 1 comment
Open

customizer.sh endpoint capabilities #66

AleixMT opened this issue Jan 20, 2023 · 1 comment
Assignees
Labels
Critical Critical priority Customizer Core Relative to Customizer capabilities Enhancement Relative to changes and general additions

Comments

@AleixMT
Copy link
Collaborator

AleixMT commented Jan 20, 2023

Capabilities

  • We will be using the flags of the customizer core to keep the state of the flags that we want to pass to each call.
  • Move wrappers to the endpoint.
  • The endpoint recognizes and uses the same args and flags as the installers, so a -v at customizer endpoint level will be passed to each call of the backend.

customizer.sh modes

  • install
  • uninstall
  • parallel
  • status
  • update: git fetch
  • upgrade: git pull

Argument specification.

Main
  Import functions common () 
  Locate install uninstall scripts()

  Process initial args and set flags()
  Choose algorithm based on initial args()
  
  Init call strings depending on algortihm()
  Process rest of args()

  String callString = Process call()
  Exec $callString 

Args:

They choose the general behaviour of how the arguments will be translated to calls to the backend scripts of the customizer.sh endpoint.

  • --sudo, --user, --deduce-privileges
    By default uses --deduce-privileges, which makes the call to backend customizer with sudo only if required.
    If --user then all calls will be non privileged. Otherwise with --sudo.

  • --maximize-calls, --optimize-calls, --minimize-calls
    By default uses --optimize-calls, which appends to the current string call if the mode has not changed. If the mode changes then the call of the current mode finishes and the string is appended to the final call string. This mode respects strictly the order of the installations.
    --maximize-calls appends the current call string to the final call string every time a feature is processed in the arguments. This mode respects strictly the order of the installations.
    --minimize-calls uses at maximum four calls, one for each mode if needed. The order will be starting with sudo uninstall, followed by sudo install and then uninstall and install.

  • --foreground, --background
    By default --foreground, which executes the final call while trapping your prompt
    --background Adds a & to the final call in order to make it in the background and get the prompt as soon as the final call is issued.

  • --sequential, --safe-sequential, --parallel=bash, --parallel=gnome-terminal, --parallel=gnu,
    By default --safe-sequential which appends the calls using &&
    --sequential uses ; to append the calls to each other
    --parallel=bash appends the call using &, so each call is made parallel in the same terminal.
    --parallel=gnome-terminal appends the call as argument to a call to gnome-terminal in background
    --parallel=gnu uses gnu parallel to run each call as a call to be done by parallel.

  • --handle-dependencies, --ignore-dependencies
    By default --handle-dependencies, which applies only when installing obligated user features that have root dependencies. In those cases, if any of the dependencies is not present, the call will be converted to a sudo call with the --dependencies (to be implemented) argument to install the dependencies only, and the subsequent user call to install the feature.
    --ignore-dependencies treats each feature as is

@AleixMT AleixMT self-assigned this Jan 27, 2023
@AleixMT AleixMT added Enhancement Relative to changes and general additions Customizer Core Relative to Customizer capabilities Critical Critical priority labels Jan 27, 2023
@AleixMT
Copy link
Collaborator Author

AleixMT commented Feb 13, 2024

https://stackoverflow.com/questions/8861673/run-a-command-without-privileges-in-a-root-shell

This can be used to control the customizer with and without privileges

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical Critical priority Customizer Core Relative to Customizer capabilities Enhancement Relative to changes and general additions
Projects
None yet
Development

No branches or pull requests

1 participant