-
Notifications
You must be signed in to change notification settings - Fork 446
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
Wip/server permissions #174
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,11 @@ object JavaServerAppPackaging { | |
def debianSettings: Seq[Setting[_]] = | ||
Seq( | ||
serverLoading := Upstart, | ||
daemonUser <<= appUser in Linux, | ||
// This one is begging for sbt 0.13 syntax... | ||
debianScriptReplacements <<= ( | ||
maintainer in Debian, packageSummary in Debian, serverLoading in Debian, daemonUser in Debian, normalizedName, | ||
maintainer in Debian, packageSummary in Debian, serverLoading in Debian, daemonUser in Linux, daemonGroup in Linux, normalizedName, | ||
sbt.Keys.version, defaultLinuxInstallLocation) | ||
map { (author, descr, loader, daemonUser, name, version, installLocation) => | ||
map { (author, descr, loader, daemonUser, daemonGroup, name, version, installLocation) => | ||
val appDir = installLocation + "/" + name | ||
|
||
JavaAppStartScript.makeReplacements( | ||
|
@@ -43,7 +42,8 @@ object JavaServerAppPackaging { | |
execScript = name, | ||
chdir = appDir, | ||
appName = name, | ||
daemonUser = daemonUser) | ||
daemonUser = daemonUser, | ||
daemonGroup = daemonGroup) | ||
}, | ||
// TODO - Default locations shouldn't be so hacky. | ||
|
||
|
@@ -55,15 +55,15 @@ object JavaServerAppPackaging { | |
map { (tmpDir, loader, replacements, template) => | ||
makeDebianMaintainerScript(JavaAppStartScript.startScript, Some(template))(tmpDir, loader, replacements) | ||
}, | ||
linuxPackageMappings in Debian <++= (debianMakeStartScript, normalizedName, serverLoading in Debian, appUser in Linux, appGroup in Linux) | ||
map { (script, name, loader, owner, ownerGroup) => | ||
linuxPackageMappings in Debian <++= (debianMakeStartScript, normalizedName, serverLoading in Debian) | ||
map { (script, name, loader) => | ||
val (path, permissions) = loader match { | ||
case Upstart => ("/etc/init/" + name + ".conf", "0644") | ||
case SystemV => ("/etc/init.d/" + name, "0755") | ||
} | ||
for { | ||
s <- script.toSeq | ||
} yield LinuxPackageMapping(Seq(s -> path), LinuxFileMetaData(owner, ownerGroup, permissions, "true")) | ||
} yield LinuxPackageMapping(Seq(s -> path), LinuxFileMetaData(Users.Root, Users.Root, permissions, "true")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm.... someone did request the ability to modify these before though, right? I think the direction we're taking is correct, but I'm still curious how this pans out with our audience. You can always drop down and specify mappings directly. I think you may be right we need to provide a convenient way to filter mappings successfully after the fact. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. I guess I'm not fully convinced this is the right path, but it's the best option right now, most likely. I think if we open one of your two suggested options, the point becomes moot as well. This will be a documentation problem, though :) |
||
}, | ||
|
||
// === etc config mapping === | ||
|
@@ -75,13 +75,13 @@ object JavaServerAppPackaging { | |
}, | ||
debianMakeEtcDefault <<= (normalizedName, target in Universal, linuxEtcDefaultTemplate in Debian, debianScriptReplacements) | ||
map makeEtcDefaultScript, | ||
linuxPackageMappings in Debian <++= (debianMakeEtcDefault, normalizedName, appUser in Linux, appGroup in Linux) map { (conf, name, owner, ownerGroup) => | ||
conf.map(c => LinuxPackageMapping(Seq(c -> ("/etc/default/" + name)), LinuxFileMetaData(owner, ownerGroup)).withConfig()).toSeq | ||
linuxPackageMappings in Debian <++= (debianMakeEtcDefault, normalizedName) map { (conf, name) => | ||
conf.map(c => LinuxPackageMapping(Seq(c -> ("/etc/default/" + name)), LinuxFileMetaData(Users.Root, Users.Root)).withConfig()).toSeq | ||
}, | ||
// TODO should we specify daemonGroup in configs? | ||
|
||
// === logging directory mapping === | ||
linuxPackageMappings in Debian <+= (normalizedName, defaultLinuxLogsLocation, target in Debian, appUser in Linux, appGroup in Linux) map { | ||
linuxPackageMappings in Debian <+= (normalizedName, defaultLinuxLogsLocation, target in Debian, daemonUser in Linux, daemonGroup in Linux) map { | ||
(name, logsDir, target, user, group) => | ||
// create empty var/log directory | ||
val d = target / logsDir | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT of using Scalariform, which although not my favorite style, will help prevent all of us from whitespace-line changing each other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm already using it through Eclipse (at least that's what the scalariform page says). However an integration in the build with sbt-scalariform would be helpful as everbody uses another IDE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preferences export from eclipse: https://dl.dropboxusercontent.com/u/2654300/formatterPreferences.properties