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

Implement custom posix permissions for pack and packArchive #89

Open
norru opened this issue Sep 24, 2015 · 1 comment
Open

Implement custom posix permissions for pack and packArchive #89

norru opened this issue Sep 24, 2015 · 1 comment

Comments

@norru
Copy link

norru commented Sep 24, 2015

Hello,

our current deployment policy dictates that:

  • the application executable must be in the root of the archive rather than in the /bin directory
  • none of the unpacked files must be world readable at any time (so they need to be stored in the tarball as 0xx0)
  • some of the unpacked files need custom permissions

It is not feasible to change these constraints in the short term.

As a general purpose solution, I would suggest to add some sort of mapping/callback to the create(.*)entry methods so that a filter can be injected as a setting.

Something like this:

  private def createTarEntry(file: File, fileName: String, binDir: File, 
    perms: (File) => Option[Int]) = {
    val archiveEntry = new TarArchiveEntry(file, fileName)
    perms(file) foreach { mode => archiveEntry.setMode(mode) }
    archiveEntry
  }

I have worked this around for the pack task by scanning the target/pack directory tree and changing the permissions on the file system. Unfortunately the packArchive task ignores the filesystem settings.

At the moment I'm not able to fork/pull request.

Regards
Nico

@norru
Copy link
Author

norru commented Sep 24, 2015

Scrap that. I did manage something that can be worked into a fix

#90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant