git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #31149 from LumiGuide/pgmanage-10.0.2

postage: replaced by pgmanage-10.0.2

commit9a1534496a0f2d8c6f10ebe7e4c75970d77ef28d authorDaiderd Jordan <daiderd@gmail.com> dateFri 3 Nov 2017, 12:32 (9 years ago) parent6fb9706c894327
8 files changed+131−64
nixos/doc/manual/release-notes/rl-1803.xml+9 nixos/modules/module-list.nix+1−1 nixos/modules/services/databases/postage.nix → nixos/modules/services/databases/pgmanage.nix+71−54 nixos/release.nix+1 nixos/tests/pgmanage.nix+39 pkgs/applications/misc/postage/default.nix → pkgs/applications/misc/pgmanage/default.nix+8−8 pkgs/top-level/aliases.nix+1 pkgs/top-level/all-packages.nix+1−1
nixos/doc/manual/release-notes/rl-1803.xml+9
@@ -63,6 +63,15 @@ following incompatible changes:</para>
6363 pass literal dollar signs through Postfix, double them.
6464 </para>
6565 </listitem>
66+ <listitem>
67+ <para>
68+ The <literal>postage</literal> package (for web-based PostgreSQL
69+ administration) has been renamed to <literal>pgmanage</literal>. The
70+ corresponding module has also been renamed. To migrate please rename all
71+ <option>services.postage</option> options to
72+ <option>services.pgmanage</option>.
73+ </para>
74+ </listitem>
6675</itemizedlist>
6776
6877</section>
nixos/modules/module-list.nix+1−1
@@ -185,7 +185,7 @@
185185 ./services/databases/neo4j.nix
186186 ./services/databases/openldap.nix
187187 ./services/databases/opentsdb.nix
188− ./services/databases/postage.nix
188+ ./services/databases/pgmanage.nix
189189 ./services/databases/postgresql.nix
190190 ./services/databases/redis.nix
191191 ./services/databases/riak.nix
nixos/modules/services/databases/postage.nix → nixos/modules/services/databases/pgmanage.nixrenamed+71−54
@@ -3,16 +3,16 @@
33with lib;
44
55let
6− cfg = config.services.postage;
6+ cfg = config.services.pgmanage;
77
88 confFile = pkgs.writeTextFile {
9− name = "postage.conf";
9+ name = "pgmanage.conf";
1010 text = ''
11− connection_file = ${postageConnectionsFile}
11+ connection_file = ${pgmanageConnectionsFile}
1212
1313 allow_custom_connections = ${builtins.toJSON cfg.allowCustomConnections}
1414
15− postage_port = ${toString cfg.port}
15+ pgmanage_port = ${toString cfg.port}
1616
1717 super_only = ${builtins.toJSON cfg.superOnly}
1818
@@ -20,7 +20,7 @@ let
2020
2121 login_timeout = ${toString cfg.loginTimeout}
2222
23− web_root = ${cfg.package}/etc/postage/web_root
23+ web_root = ${cfg.package}/etc/pgmanage/web_root
2424
2525 data_root = ${cfg.dataRoot}
2626
@@ -33,24 +33,23 @@ let
3333 '';
3434 };
3535
36− postageConnectionsFile = pkgs.writeTextFile {
37− name = "postage-connections.conf";
36+ pgmanageConnectionsFile = pkgs.writeTextFile {
37+ name = "pgmanage-connections.conf";
3838 text = concatStringsSep "\n"
3939 (mapAttrsToList (name : conn : "${name}: ${conn}") cfg.connections);
4040 };
4141
42− postage = "postage";
43−in {
42+ pgmanage = "pgmanage";
4443
45− options.services.postage = {
44+ pgmanageOptions = {
4645 enable = mkEnableOption "PostgreSQL Administration for the web";
4746
4847 package = mkOption {
4948 type = types.package;
50− default = pkgs.postage;
51− defaultText = "pkgs.postage";
49+ default = pkgs.pgmanage;
50+ defaultText = "pkgs.pgmanage";
5251 description = ''
53− The postage package to use.
52+ The pgmanage package to use.
5453 '';
5554 };
5655
@@ -62,14 +61,14 @@ in {
6261 "mini-server" = "hostaddr=127.0.0.1 port=5432 dbname=postgres sslmode=require";
6362 };
6463 description = ''
65− Postage requires at least one PostgreSQL server be defined.
64+ pgmanage requires at least one PostgreSQL server be defined.
6665 </para><para>
6766 Detailed information about PostgreSQL connection strings is available at:
6867 <link xlink:href="http://www.postgresql.org/docs/current/static/libpq-connect.html"/>
6968 </para><para>
7069 Note that you should not specify your user name or password. That
7170 information will be entered on the login screen. If you specify a
72− username or password, it will be removed by Postage before attempting to
71+ username or password, it will be removed by pgmanage before attempting to
7372 connect to a database.
7473 '';
7574 };
@@ -78,7 +77,7 @@ in {
7877 type = types.bool;
7978 default = false;
8079 description = ''
81− This tells Postage whether or not to allow anyone to use a custom
80+ This tells pgmanage whether or not to allow anyone to use a custom
8281 connection from the login screen.
8382 '';
8483 };
@@ -87,7 +86,7 @@ in {
8786 type = types.int;
8887 default = 8080;
8988 description = ''
90− This tells Postage what port to listen on for browser requests.
89+ This tells pgmanage what port to listen on for browser requests.
9190 '';
9291 };
9392
@@ -95,7 +94,7 @@ in {
9594 type = types.bool;
9695 default = true;
9796 description = ''
98− This tells Postage whether or not to set the listening socket to local
97+ This tells pgmanage whether or not to set the listening socket to local
9998 addresses only.
10099 '';
101100 };
@@ -104,10 +103,10 @@ in {
104103 type = types.bool;
105104 default = true;
106105 description = ''
107− This tells Postage whether or not to only allow super users to
106+ This tells pgmanage whether or not to only allow super users to
108107 login. The recommended value is true and will restrict users who are not
109108 super users from logging in to any PostgreSQL instance through
110− Postage. Note that a connection will be made to PostgreSQL in order to
109+ pgmanage. Note that a connection will be made to PostgreSQL in order to
111110 test if the user is a superuser.
112111 '';
113112 };
@@ -116,8 +115,8 @@ in {
116115 type = types.nullOr types.str;
117116 default = null;
118117 description = ''
119− This tells Postage to only allow users in a certain PostgreSQL group to
120− login to Postage. Note that a connection will be made to PostgreSQL in
118+ This tells pgmanage to only allow users in a certain PostgreSQL group to
119+ login to pgmanage. Note that a connection will be made to PostgreSQL in
121120 order to test if the user is a member of the login group.
122121 '';
123122 };
@@ -133,10 +132,10 @@ in {
133132
134133 dataRoot = mkOption {
135134 type = types.str;
136− default = "/var/lib/postage";
135+ default = "/var/lib/pgmanage";
137136 description = ''
138− This tells Postage where to put the SQL file history. All tabs are saved
139− to this location so that if you get disconnected from Postage you
137+ This tells pgmanage where to put the SQL file history. All tabs are saved
138+ to this location so that if you get disconnected from pgmanage you
140139 don't lose your work.
141140 '';
142141 };
@@ -156,15 +155,15 @@ in {
156155 });
157156 default = null;
158157 description = ''
159− These options tell Postage where the TLS Certificate and Key files
158+ These options tell pgmanage where the TLS Certificate and Key files
160159 reside. If you use these options then you'll only be able to access
161− Postage through a secure TLS connection. These options are only
162− necessary if you wish to connect directly to Postage using a secure TLS
163− connection. As an alternative, you can set up Postage in a reverse proxy
160+ pgmanage through a secure TLS connection. These options are only
161+ necessary if you wish to connect directly to pgmanage using a secure TLS
162+ connection. As an alternative, you can set up pgmanage in a reverse proxy
164163 configuration. This allows your web server to terminate the secure
165− connection and pass on the request to Postage. You can find help to set
164+ connection and pass on the request to pgmanage. You can find help to set
166165 up this configuration in:
167− <link xlink:href="https://github.com/workflowproducts/postage/blob/master/INSTALL_NGINX.md"/>
166+ <link xlink:href="https://github.com/pgManage/pgManage/blob/master/INSTALL_NGINX.md"/>
168167 '';
169168 };
170169
@@ -177,29 +176,47 @@ in {
177176 };
178177 };
179178
180− config = mkIf cfg.enable {
181− systemd.services.postage = {
182− description = "postage - PostgreSQL Administration for the web";
183− wants = [ "postgresql.service" ];
184− after = [ "postgresql.service" ];
185− wantedBy = [ "multi-user.target" ];
186− serviceConfig = {
187− User = postage;
188− Group = postage;
189− ExecStart = "${pkgs.postage}/sbin/postage -c ${confFile}" +
190− optionalString cfg.localOnly " --local-only=true";
191− };
192− };
193− users = {
194− users."${postage}" = {
195− name = postage;
196− group = postage;
197− home = cfg.dataRoot;
198− createHome = true;
179+
180+in {
181+
182+ options.services.pgmanage = pgmanageOptions;
183+
184+ # This is deprecated and should be removed for NixOS-18.03.
185+ options.services.postage = pgmanageOptions;
186+
187+ config = mkMerge [
188+ { assertions = [
189+ { assertion = !config.services.postage.enable;
190+ message =
191+ "services.postage is deprecated in favour of pgmanage. " +
192+ "They have the same options so just substitute postage for pgmanage." ;
193+ }
194+ ];
195+ }
196+ (mkIf cfg.enable {
197+ systemd.services.pgmanage = {
198+ description = "pgmanage - PostgreSQL Administration for the web";
199+ wants = [ "postgresql.service" ];
200+ after = [ "postgresql.service" ];
201+ wantedBy = [ "multi-user.target" ];
202+ serviceConfig = {
203+ User = pgmanage;
204+ Group = pgmanage;
205+ ExecStart = "${pkgs.pgmanage}/sbin/pgmanage -c ${confFile}" +
206+ optionalString cfg.localOnly " --local-only=true";
207+ };
199208 };
200− groups."${postage}" = {
201− name = postage;
209+ users = {
210+ users."${pgmanage}" = {
211+ name = pgmanage;
212+ group = pgmanage;
213+ home = cfg.dataRoot;
214+ createHome = true;
215+ };
216+ groups."${pgmanage}" = {
217+ name = pgmanage;
218+ };
202219 };
203− };
204− };
220+ })
221+ ];
205222}
nixos/release.nix+1
@@ -306,6 +306,7 @@ in rec {
306306 #tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; });
307307 tests.peerflix = callTest tests/peerflix.nix {};
308308 tests.postgresql = callSubTests tests/postgresql.nix {};
309+ tests.pgmanage = callTest tests/pgmanage.nix {};
309310 tests.postgis = callTest tests/postgis.nix {};
310311 #tests.pgjwt = callTest tests/pgjwt.nix {};
311312 tests.printing = callTest tests/printing.nix {};
nixos/tests/pgmanage.nixnew file+39
@@ -0,0 +1,39 @@
1+import ./make-test.nix ({ pkgs, ... } :
2+let
3+ role = "test";
4+ password = "secret";
5+ conn = "local";
6+in
7+{
8+ name = "pgmanage";
9+ meta = with pkgs.stdenv.lib.maintainers; {
10+ maintainers = [ basvandijk ];
11+ };
12+ nodes = {
13+ one = { config, pkgs, ... }: {
14+ services = {
15+ postgresql = {
16+ enable = true;
17+ initialScript = pkgs.writeText "pg-init-script" ''
18+ CREATE ROLE ${role} SUPERUSER LOGIN PASSWORD '${password}';
19+ '';
20+ };
21+ pgmanage = {
22+ enable = true;
23+ connections = {
24+ "${conn}" = "hostaddr=127.0.0.1 port=${toString config.services.postgresql.port} dbname=postgres";
25+ };
26+ };
27+ };
28+ };
29+ };
30+
31+ testScript = ''
32+ startAll;
33+ $one->waitForUnit("default.target");
34+ $one->requireActiveUnit("pgmanage.service");
35+
36+ # Test if we can log in.
37+ $one->waitUntilSucceeds("curl 'http://localhost:8080/pgmanage/auth' --data 'action=login&connname=${conn}&username=${role}&password=${password}' --fail");
38+ '';
39+})
pkgs/applications/misc/postage/default.nix → pkgs/applications/misc/pgmanage/default.nixrenamed+8−8
@@ -1,14 +1,14 @@
11{ stdenv, fetchFromGitHub, runCommand, postgresql, openssl } :
22
33stdenv.mkDerivation rec {
4− name = "postage-${version}";
5− version = "3.2.18";
4+ name = "pgmanage-${version}";
5+ version = "10.0.2";
66
77 src = fetchFromGitHub {
8− owner = "workflowproducts";
9− repo = "postage";
10− rev = "eV${version}";
11− sha256 = "1kdg8pw2vxwkxw3b6dim4s740s60j3iyrh96524wi3lqkkq98krn";
8+ owner = "pgManage";
9+ repo = "pgManage";
10+ rev = "v${version}";
11+ sha256 = "0g9kvhs9b6kc1s7j90fqv71amiy9v0w5p906yfvl0j7pf3ayq35a";
1212 };
1313
1414 buildInputs = [ postgresql openssl ];
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
2020 the style of NGINX and Node.js. This heart makes Postage as fast as any
2121 PostgreSQL interface can hope to be.
2222 '';
23− homepage = http://www.workflowproducts.com/postage.html;
24− license = licenses.asl20;
23+ homepage = https://github.com/pgManage/pgManage;
24+ license = licenses.postgresql;
2525 maintainers = [ maintainers.basvandijk ];
2626 };
2727}
pkgs/top-level/aliases.nix+1
@@ -116,6 +116,7 @@ mapAliases (rec {
116116 pgp-tools = signing-party; # added 2017-03-26
117117 pidgin-with-plugins = pidgin; # added 2016-06
118118 pidginlatexSF = pidginlatex; # added 2014-11-02
119+ postage = pgmanage; # added 2017-11-03
119120 poppler_qt5 = libsForQt5.poppler; # added 2015-12-19
120121 PPSSPP = ppsspp; # added 2017-10-01
121122 prometheus-statsd-bridge = prometheus-statsd-exporter; # added 2017-08-27
pkgs/top-level/all-packages.nix+1−1
@@ -19319,7 +19319,7 @@ with pkgs;
1931919319
1932019320 opkg-utils = callPackage ../tools/package-management/opkg-utils { };
1932119321
19322− postage = callPackage ../applications/misc/postage { };
19322+ pgmanage = callPackage ../applications/misc/pgmanage { };
1932319323
1932419324 pgadmin = callPackage ../applications/misc/pgadmin { };
1932519325