Giter Club home page Giter Club logo

Comments (3)

peter1000 avatar peter1000 commented on June 27, 2024

Why not add a small: conf-subuser file in the subuser base directory

simples option: using a 'conf-subuser.py' and import it when executing subuser (which should stay in the subuser base directory /bin or so

programsThatCanBeInstalledPath = "/blabla/bla"
subuser-binPath = "/blabla/bla"

or use a 'conf-subuser.json' and use json to handle it

from subuser.

timthelion avatar timthelion commented on June 27, 2024

I think that the proper approach is to add optional json files to the users home dir and the /etc/ directory which would specify alternate locations for things. Like:

~/.subuser/conf.json

and

/etc/subuser/conf.json

The key thing is that these config files have to be optional, so that the run-in-place variety of subuser still works without hitch.

from subuser.

timthelion avatar timthelion commented on June 27, 2024

subuser/logic/subuserCommands/subuserlib/paths.py will look for paths in the following order:

First it will look for paths in ~/.subuser/paths.json then /etc/subuser/paths.json then $SUBUSERDIR/paths.json. This will be a partial fallback method, so that ~/.subuser/paths.json and /etc/subuser/paths.json may contain some but not all of the paths. $SUBUSERDIR/paths.json must contain all paths though as it defines the paths. When expanding these paths the ENV_VAR $SUBUSER must be set appropriately.

Run os.path.expandvars(path) on the paths.

$SUBUSER/paths.json will look like:

{
  "repositories" : ["$SUBUSERDIR/programsThatCanBeInstalled"],
  "bin" : "$SUBUSERDIR/bin",
  "installed-programs.json" : "$SUBUSERDIR/installed-programs.json",
  "user-set-permissions-dir" : "$SUBUSERDIR/permissions/",
  "program-home-dirs-dir" : "$SUBUSERDIR/homes/"
}

paths.json will be documented the same way permissions.json is documented.

Once this is done, #12 (comment) will be fixed.

from subuser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.