Giter Site home page Giter Site logo

validate names helper about libioc HOT 9 CLOSED

bsdci avatar bsdci commented on July 28, 2024
validate names helper

from libioc.

Comments (9)

gronke avatar gronke commented on July 28, 2024 1

We don't know the mountpoint of the iocage root dataset, so finding a suitable max length for names will probably end up in a random guess. I'm in favor of decoupling the jail identifier and name again. It's nice to represent a jail with it's name in the filesystem, but listing jail names and paths is not a big deal with the cli list command.

@skarekrow this would remove a recently introduced feature. Each jail would keep it's name though, but always use a UUID as filesystem reference.

Also this allows us to permit arbitrary characters as jail name. Why shouldn't mycustomer/webserver or ǝƃɐɔoı be valid names name.

from libioc.

igalic avatar igalic commented on July 28, 2024

this should also greatly help us with testing, btw.

from libioc.

gronke avatar gronke commented on July 28, 2024

Shouldn't we expect a much shorter path than that? The resulting path will be something like /iocage/jails/<NAME>/root/usr/local/etc/rc.conf, so that name is not allowed to have 255 characters.

Using uuids didn't have this limitation. Maybe rolling back to use UUIDs is the safest way to guarantee compatibility with long names. What do you think?

from libioc.

igalic avatar igalic commented on July 28, 2024

we're mixing concepts here.

You're talking about MAX_PATH, which in general is 1024:

/* from /usr/src/sys/sys/syslimits.h */
#define      PATH_MAX                 1024   /* max bytes in pathname */

a single component of a path underlies the restrictions of NAME_MAX

/* from /usr/src/sys/sys/syslimits.h */
#define      NAME_MAX                  255   /* max bytes in a file name */

however!!

freebsd's fstab imposes additional restrictions on a mount path's length until FreeBSD 12 is released, this will still be 88, and until then, we should equally restrict ourselves to making /iocage/jails/<NAME>/root/usr/local/etc/rc.conf a maximum of 88 (if not shorter)

from libioc.

igalic avatar igalic commented on July 28, 2024

so, uuid, name, hostname & tags should become distinct properties again. i'm all for it.
and, if we introduced the concept of --columns for to the cli, a user could decide for themself what they want printed on iocage list


see #12.

from libioc.

gronke avatar gronke commented on July 28, 2024

@igalic 🎉 https://github.com/iocage/libiocage/blob/6068a5c4ec7c4c2e7fdacaad8740e7f2d27cc3e3/libiocage/cli/list.py#L52

from libioc.

skarekrow avatar skarekrow commented on July 28, 2024

I don't see the point in limiting the max name, as that value will change eventually, and we're limiting for no reason at that point.

hostname has always been it's own property, still is. tag was never meant to be a property, and I do not agree with having 3 different ways of naming the jail. It was a conscious decision to use just one name. Not a limitation.

It's very hard for a user to see all the UUIDs and map them to their jails, when doing tasks like zfs send outside of iocage. In addition it means more book keeping on our part, for something that is unneccessary. Jails shouldn't have / in their name, as it would no longer be a valid dataset, by playing by zfs's rules everybody wins. There is a clear understanding of concepts for the user.

from libioc.

igalic avatar igalic commented on July 28, 2024

which brings us back to my initial proposal of having ascii-only names which are (severely;) limited in length, so we can fit them in all manner of mounts. Perhaps 16?

and we can use tags for the fancy things that @gronke suggested.

from libioc.

skarekrow avatar skarekrow commented on July 28, 2024

@igalic I agree with you. tags should be reintroduced as actual tags, not just symlinks in the filesystem. But a tagging system as I suggested a while back in iocage's issue tracker.

TLDR ; Limit names to some small value and don't do anything else until we have a database.

from libioc.

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.