Skip to content

Commit

Permalink
readme cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed Feb 22, 2024
1 parent 2caca9a commit 7650e0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ Nix Module for [IXP-Manager](https://www.ixpmanager.org/).
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
ixp-manager = {
url = "github:dd-ix/ixp-manager.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
Expand Down
6 changes: 3 additions & 3 deletions module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ in
ExecStartPre = mkIf cfg.createDatabaseLocally [
"!${pkgs.writeShellScript "librenms-db-init" ''
DB_PASSWORD=$(${pkgs.envsubst}/bin/envsubst -i ${configFile} | grep DB_PASSWORD | sed s/DB_PASSWORD=//g | sed s/\"//g)
echo "ALTER USER ${cfg.settings.DB_USERNAME}@localhost IDENTIFIED WITH caching_sha2_password BY '$DB_PASSWORD';" | ${pkgs.mysql80}/bin/mysql -u root
echo "ALTER USER ${cfg.settings.DB_USERNAME}@localhost IDENTIFIED WITH caching_sha2_password BY \"''$DB_PASSWORD\"";" | ${pkgs.mysql80}/bin/mysql -u root
''}"
];
};
Expand Down Expand Up @@ -461,7 +461,7 @@ in
${artisanWrapper}/bin/ixp-manager-artisan migrate --force
# regenerate views
mysql -h $DB_HOST -u $DB_USERNAME -p$DB_PASSWORD $DB_DATABASE < ${package}/tools/sql/views.sql
mysql -h ''$DB_HOST -u ''$DB_USERNAME -p''$DB_PASSWORD ''$DB_DATABASE < ${package}/tools/sql/views.sql
# version file empty --> initial installation
if [[ ! -s ${cfg.dataDir}/version ]]; then
Expand All @@ -473,7 +473,7 @@ in
HASH_PW=$( ${phpPackage}/bin/php -r "echo escapeshellarg( crypt( '$IXPM_ADMIN_PW', sprintf( '\$2a\$%02d\$%s', 10, substr( '$ADMIN_PW_SALT', 0, 22 ) ) ) );" )
# snippet from https://docs.ixpmanager.org/install/manually/
mysql -h $DB_HOST -u $DB_USERNAME "-p$DB_PASSWORD" $DB_DATABASE <<END_SQL
mysql -h ''$DB_HOST -u ''$DB_USERNAME "-p''$DB_PASSWORD" ''$DB_DATABASE <<END_SQL
INSERT INTO infrastructure ( name, shortname, isPrimary, created_at, updated_at )
VALUES ( 'Infrastructure #1', '#1', 1, NOW(), NOW() );
SET @infraid = LAST_INSERT_ID();
Expand Down

0 comments on commit 7650e0c

Please sign in to comment.