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

FIX #856 Add documentation for daemonUser/Group settings #967

Merged
merged 1 commit into from
Apr 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ object LinuxPlugin extends AutoPlugin {
name in Linux := name.value,
packageName in Linux := packageName.value,
executableScriptName in Linux := executableScriptName.value,
daemonUser in Linux := (packageName in Linux).value,
daemonUser := (packageName in Linux).value,
daemonUser in Linux := daemonUser.value,
daemonUserUid in Linux := None,
daemonGroup in Linux := (daemonUser in Linux).value,
daemonGroup := (daemonUser in Linux).value,
daemonGroup in Linux := daemonGroup.value,
daemonGroupGid in Linux := None,
daemonShell in Linux := "/bin/false",
defaultLinuxInstallLocation := "/usr/share",
Expand Down
22 changes: 22 additions & 0 deletions src/sphinx/archetypes/java_server/customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ Example `/etc/default/<normalizedName>` for SystemV:
COMPANY_API_KEY=123abc
export COMPANY_API_KEY

Daemon User and Group
~~~~~~~~~~~~~~~~~~~~~

Customize the daemon user and group for your application with the following settings.

.. code-block:: scala

// a different daemon user
daemonUser in Linux := "my-user"
// if there is an existing one you can specify the uid
daemonUserUid in Linux := Some("123")
// a different daemon group
daemonGroup in Linux := "my-group"
// if the group already exists you can specify the uid
daemonGroupGid in Linux := Some("1001")

Environment variables
~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -225,6 +240,13 @@ Linux Replacements
${{daemon_user}}
${{daemon_group}}

.. attention::
Every replacement corresponds to a single setting or task. For the `linuxScriptReplacements` you need
to override the setting/task in the `in Linux` scope. For example

``daemonUser in Linux := "new-user"``

overrides the ``daemon_user`` in the linuxScriptReplacements.

Example Configurations
======================
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx/archetypes/java_server/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ have sensible defaults.
UID of daemonUser

``daemonGroup``
Group to place daemonUser to.
Group to place daemonUser to

``daemonGroupGid``
GID of daemonGroup
Expand Down
3 changes: 0 additions & 3 deletions src/sphinx/archetypes/systemloaders.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ General Settings
``retryTimeout``
Timeout between retries in seconds

``fileDescriptorLimit``
Maximum number of open file descriptors for the spawned application. The default value is 1024.


SystemV
-------
Expand Down
2 changes: 1 addition & 1 deletion src/sphinx/formats/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Since ``dockerCommands`` is just a ``Sequence``, adding commands is straightforw
import com.typesafe.sbt.packager.docker._

// use += to add an item to a Sequence
dockerCommands += Cmd("USER", daemonUser.value)
dockerCommands += Cmd("USER", (daemonUser in Docker).value)

// use ++= to merge a sequence with an existing sequence
dockerCommands ++= Seq(
Expand Down
4 changes: 4 additions & 0 deletions src/sphinx/formats/linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ The required fields for any linux distribution are:
``linuxPackageMappings``
A list of files and their desired installation locations for the package, as well as other metainformation.

``fileDescriptorLimit``
Maximum number of open file descriptors for the spawned application. The default value is 1024.



Customize
---------
Expand Down