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

arangodb: Add a NixOS service #31880

Closed
wants to merge 1 commit into from
Closed

arangodb: Add a NixOS service #31880

wants to merge 1 commit into from

Conversation

earldouglas
Copy link
Member

Motivation for this change

Make it easy to launch ArangoDB as a service in NixOS.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@earldouglas
Copy link
Member Author

This is my first crack at this, so it probably needs extra scrutiny.

I based the server arguments on https://github.com/arangodb/arangodb/blob/v3.2.3/scripts/startArangoDBClusterLocal.sh

Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few nitpicks :-)

{ config, lib, pkgs, ... }:
let
cfg = config.services.arangodb;
stateDir = "/var/lib/arango";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't make it sense to add an option for this (when I grep over nixpkgs, it seems as the services that require a statePath also provide an option for this)


services.arangodb = {

enable = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module system provides a mkEnableOption "<description>" function

--log.file ${stateDir}/arangodb.log \
--working-directory ${stateDir} \
--cluster.password root \
> ${stateDir}/arangodb.stdout 2>&1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't systemd log all the output in the journal logs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

systemd journal can also differentiate between stdout and stderr.

--javascript.app-path ${stateDir} \
--log.file ${stateDir}/arangodb.log \
--working-directory ${stateDir} \
--cluster.password root \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a secure default to hard-code passwords?

@earldouglas
Copy link
Member Author

Thanks for the feedback. I will address these this week, and update the PR.

@bachp
Copy link
Member

bachp commented Feb 18, 2018

@earldouglas Did you make any progress on this?

@earldouglas
Copy link
Member Author

earldouglas commented Feb 18, 2018

@bachp No, but I haven't abandoned it yet.

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See @Ma27's comments

@babariviere
Copy link
Member

Any progress ? I can make it if it's needed.

@earldouglas
Copy link
Member Author

@babariviere Sorry, this is still in my personal backlog. Feel free to take it.

@c0bw3b
Copy link
Contributor

c0bw3b commented May 18, 2019

New work in #40167

@c0bw3b c0bw3b closed this May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants