Merge pull request #232235 from cyberus-technology/outline-0.69.2
outline: 0.68.1 -> 0.69.2
This commit is contained in:
commit
078d3ebcaa
|
@ -586,7 +586,7 @@ in
|
||||||
|
|
||||||
# Create an outline-sequalize wrapper (a wrapper around the wrapper) that
|
# Create an outline-sequalize wrapper (a wrapper around the wrapper) that
|
||||||
# has the config file's path baked in. This is necessary because there is
|
# has the config file's path baked in. This is necessary because there is
|
||||||
# at least one occurrence of outline calling this from its own code.
|
# at least two occurrences of outline calling this from its own code.
|
||||||
sequelize = pkgs.writeShellScriptBin "outline-sequelize" ''
|
sequelize = pkgs.writeShellScriptBin "outline-sequelize" ''
|
||||||
exec ${cfg.package}/bin/outline-sequelize \
|
exec ${cfg.package}/bin/outline-sequelize \
|
||||||
--config $RUNTIME_DIRECTORY/database.json \
|
--config $RUNTIME_DIRECTORY/database.json \
|
||||||
|
@ -687,21 +687,18 @@ in
|
||||||
openssl rand -hex 32 > ${lib.escapeShellArg cfg.utilsSecretFile}
|
openssl rand -hex 32 > ${lib.escapeShellArg cfg.utilsSecretFile}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The config file is required for the CLI, the DATABASE_URL environment
|
# The config file is required for the sequelize CLI.
|
||||||
# variable is read by the app.
|
|
||||||
${if (cfg.databaseUrl == "local") then ''
|
${if (cfg.databaseUrl == "local") then ''
|
||||||
cat <<EOF > $RUNTIME_DIRECTORY/database.json
|
cat <<EOF > $RUNTIME_DIRECTORY/database.json
|
||||||
{
|
{
|
||||||
"production": {
|
"production-ssl-disabled": {
|
||||||
"dialect": "postgres",
|
|
||||||
"host": "/run/postgresql",
|
"host": "/run/postgresql",
|
||||||
"username": null,
|
"username": null,
|
||||||
"password": null
|
"password": null,
|
||||||
|
"dialect": "postgres"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
export DATABASE_URL=${lib.escapeShellArg localPostgresqlUrl}
|
|
||||||
export PGSSLMODE=disable
|
|
||||||
'' else ''
|
'' else ''
|
||||||
cat <<EOF > $RUNTIME_DIRECTORY/database.json
|
cat <<EOF > $RUNTIME_DIRECTORY/database.json
|
||||||
{
|
{
|
||||||
|
@ -720,11 +717,7 @@ in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
export DATABASE_URL=${lib.escapeShellArg cfg.databaseUrl}
|
|
||||||
''}
|
''}
|
||||||
|
|
||||||
cd $RUNTIME_DIRECTORY
|
|
||||||
${sequelize}/bin/outline-sequelize db:migrate
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
|
@ -781,7 +774,7 @@ in
|
||||||
RuntimeDirectoryMode = "0750";
|
RuntimeDirectoryMode = "0750";
|
||||||
# This working directory is required to find stuff like the set of
|
# This working directory is required to find stuff like the set of
|
||||||
# onboarding files:
|
# onboarding files:
|
||||||
WorkingDirectory = "${cfg.package}/share/outline/build";
|
WorkingDirectory = "${cfg.package}/share/outline";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -555,6 +555,7 @@ in {
|
||||||
openstack-image-userdata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).userdata or {};
|
openstack-image-userdata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).userdata or {};
|
||||||
opentabletdriver = handleTest ./opentabletdriver.nix {};
|
opentabletdriver = handleTest ./opentabletdriver.nix {};
|
||||||
owncast = handleTest ./owncast.nix {};
|
owncast = handleTest ./owncast.nix {};
|
||||||
|
outline = handleTest ./outline.nix {};
|
||||||
image-contents = handleTest ./image-contents.nix {};
|
image-contents = handleTest ./image-contents.nix {};
|
||||||
openvscode-server = handleTest ./openvscode-server.nix {};
|
openvscode-server = handleTest ./openvscode-server.nix {};
|
||||||
orangefs = handleTest ./orangefs.nix {};
|
orangefs = handleTest ./orangefs.nix {};
|
||||||
|
|
54
nixos/tests/outline.nix
Normal file
54
nixos/tests/outline.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
import ./make-test-python.nix ({ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
accessKey = "BKIKJAA5BMMU2RHO6IBB";
|
||||||
|
secretKey = "V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12";
|
||||||
|
secretKeyFile = pkgs.writeText "outline-secret-key" ''
|
||||||
|
${secretKey}
|
||||||
|
'';
|
||||||
|
rootCredentialsFile = pkgs.writeText "minio-credentials-full" ''
|
||||||
|
MINIO_ROOT_USER=${accessKey}
|
||||||
|
MINIO_ROOT_PASSWORD=${secretKey}
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = "outline";
|
||||||
|
|
||||||
|
meta.maintainers = with lib.maintainers; [ xanderio ];
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
outline = { pkgs, config, ... }: {
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
environment.systemPackages = [ pkgs.minio-client ];
|
||||||
|
services.outline = {
|
||||||
|
enable = true;
|
||||||
|
forceHttps = false;
|
||||||
|
storage = {
|
||||||
|
inherit accessKey secretKeyFile;
|
||||||
|
uploadBucketUrl = "http://localhost:9000";
|
||||||
|
uploadBucketName = "outline";
|
||||||
|
region = config.services.minio.region;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.minio = {
|
||||||
|
enable = true;
|
||||||
|
inherit rootCredentialsFile;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript =
|
||||||
|
''
|
||||||
|
machine.wait_for_unit("minio.service")
|
||||||
|
machine.wait_for_open_port(9000)
|
||||||
|
|
||||||
|
# Create a test bucket on the server
|
||||||
|
machine.succeed(
|
||||||
|
"mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4"
|
||||||
|
)
|
||||||
|
machine.succeed("mc mb minio/outline")
|
||||||
|
|
||||||
|
outline.wait_for_unit("outline.service")
|
||||||
|
outline.wait_for_open_port(3000)
|
||||||
|
outline.succeed("curl --fail http://localhost:3000/")
|
||||||
|
'';
|
||||||
|
})
|
|
@ -5,24 +5,25 @@
|
||||||
, nodejs
|
, nodejs
|
||||||
, yarn
|
, yarn
|
||||||
, yarn2nix-moretea
|
, yarn2nix-moretea
|
||||||
|
, nixosTests
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "outline";
|
pname = "outline";
|
||||||
version = "0.68.1";
|
version = "0.69.2";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "outline";
|
owner = "outline";
|
||||||
repo = "outline";
|
repo = "outline";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-pln3cdozZPEodfXeUtTbBvhHb5yqE4uu0VKA95Zv6ro=";
|
hash = "sha256-XevrCUvPmAbPTysJ/o7i2xAZTQ+UFYtVal/aZKvt+Ls=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper yarn2nix-moretea.fixup_yarn_lock ];
|
nativeBuildInputs = [ makeWrapper yarn2nix-moretea.fixup_yarn_lock ];
|
||||||
buildInputs = [ yarn nodejs ];
|
buildInputs = [ yarn nodejs ];
|
||||||
|
|
||||||
# Replace the inline call to yarn with our sequalize wrapper. This should be
|
# Replace the inline calls to yarn with our sequalize wrapper. These should be
|
||||||
# the only occurrence:
|
# the two occurrences:
|
||||||
# https://github.com/outline/outline/search?l=TypeScript&q=yarn
|
# https://github.com/outline/outline/search?l=TypeScript&q=yarn
|
||||||
patches = [ ./sequelize-command.patch ];
|
patches = [ ./sequelize-command.patch ];
|
||||||
|
|
||||||
|
@ -43,12 +44,10 @@ stdenv.mkDerivation rec {
|
||||||
--frozen-lockfile \
|
--frozen-lockfile \
|
||||||
--ignore-engines --ignore-scripts
|
--ignore-engines --ignore-scripts
|
||||||
patchShebangs node_modules/
|
patchShebangs node_modules/
|
||||||
|
# apply upstream patches with `patch-package`
|
||||||
|
yarn run postinstall
|
||||||
yarn build
|
yarn build
|
||||||
|
|
||||||
pushd server
|
|
||||||
cp -r config migrations onboarding ../build/server/
|
|
||||||
popd
|
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -56,16 +55,11 @@ stdenv.mkDerivation rec {
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
mkdir -p $out/bin $out/share/outline
|
mkdir -p $out/bin $out/share/outline
|
||||||
mv public node_modules build $out/share/outline/
|
mv build server public node_modules $out/share/outline/
|
||||||
|
|
||||||
node_modules=$out/share/outline/node_modules
|
node_modules=$out/share/outline/node_modules
|
||||||
build=$out/share/outline/build
|
build=$out/share/outline/build
|
||||||
|
server=$out/share/outline/server
|
||||||
# On NixOS the WorkingDirectory is set to the build directory, as
|
|
||||||
# this contains files needed in the onboarding process. This folder
|
|
||||||
# must also contain the `public` folder for mail notifications to
|
|
||||||
# work, as it contains the mail templates.
|
|
||||||
ln -s $out/share/outline/public $build/public
|
|
||||||
|
|
||||||
makeWrapper ${nodejs}/bin/node $out/bin/outline-server \
|
makeWrapper ${nodejs}/bin/node $out/bin/outline-server \
|
||||||
--add-flags $build/server/index.js \
|
--add-flags $build/server/index.js \
|
||||||
|
@ -74,21 +68,25 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
makeWrapper ${nodejs}/bin/node $out/bin/outline-sequelize \
|
makeWrapper ${nodejs}/bin/node $out/bin/outline-sequelize \
|
||||||
--add-flags $node_modules/.bin/sequelize \
|
--add-flags $node_modules/.bin/sequelize \
|
||||||
--add-flags "--migrations-path $build/server/migrations" \
|
--add-flags "--migrations-path $server/migrations" \
|
||||||
--add-flags "--models-path $build/server/models" \
|
--add-flags "--models-path $server/models" \
|
||||||
--add-flags "--seeders-path $build/server/models/fixtures" \
|
--add-flags "--seeders-path $server/models/fixtures" \
|
||||||
--set NODE_ENV production \
|
--set NODE_ENV production \
|
||||||
--set NODE_PATH $node_modules
|
--set NODE_PATH $node_modules
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
basic-functionality = nixosTests.outline;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "The fastest wiki and knowledge base for growing teams. Beautiful, feature rich, and markdown compatible";
|
description = "The fastest wiki and knowledge base for growing teams. Beautiful, feature rich, and markdown compatible";
|
||||||
homepage = "https://www.getoutline.com/";
|
homepage = "https://www.getoutline.com/";
|
||||||
changelog = "https://github.com/outline/outline/releases";
|
changelog = "https://github.com/outline/outline/releases";
|
||||||
license = licenses.bsl11;
|
license = licenses.bsl11;
|
||||||
maintainers = with maintainers; [ cab404 yrd ];
|
maintainers = with maintainers; [ cab404 yrd xanderio ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,22 @@
|
||||||
diff --git a/server/utils/startup.ts b/server/utils/startup.ts
|
diff --git a/server/utils/startup.ts b/server/utils/startup.ts
|
||||||
index 7554b854..6641f805 100644
|
index 444de475..b883f71a 100644
|
||||||
--- a/server/utils/startup.ts
|
--- a/server/utils/startup.ts
|
||||||
+++ b/server/utils/startup.ts
|
+++ b/server/utils/startup.ts
|
||||||
@@ -8,9 +8,7 @@ import Team from "@server/models/Team";
|
@@ -8,7 +8,7 @@ import Team from "@server/models/Team";
|
||||||
export function checkPendingMigrations() {
|
|
||||||
try {
|
function getPendingMigrations() {
|
||||||
const commandResult = execSync(
|
const commandResult = execSync(
|
||||||
- `yarn sequelize db:migrate:status${
|
- `yarn sequelize db:migrate:status${
|
||||||
- env.PGSSLMODE === "disable" ? " --env=production-ssl-disabled" : ""
|
+ `outline-sequelize db:migrate:status${
|
||||||
- }`
|
env.PGSSLMODE === "disable" ? " --env=production-ssl-disabled" : ""
|
||||||
+ "outline-sequelize db:migrate:status"
|
}`
|
||||||
);
|
);
|
||||||
const commandResultArray = Buffer.from(commandResult)
|
@@ -26,7 +26,7 @@ function getPendingMigrations() {
|
||||||
.toString("utf-8")
|
function runMigrations() {
|
||||||
|
Logger.info("database", "Running migrations...");
|
||||||
|
const cmdResult = execSync(
|
||||||
|
- `yarn db:migrate${
|
||||||
|
+ `outline-sequelize db:migrate${
|
||||||
|
env.PGSSLMODE === "disable" ? " --env=production-ssl-disabled" : ""
|
||||||
|
}`
|
||||||
|
);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -25702,7 +25702,7 @@ with pkgs;
|
||||||
outline = callPackage ../servers/web-apps/outline (lib.fix (super: {
|
outline = callPackage ../servers/web-apps/outline (lib.fix (super: {
|
||||||
yarn2nix-moretea = yarn2nix-moretea.override { inherit (super) nodejs yarn; };
|
yarn2nix-moretea = yarn2nix-moretea.override { inherit (super) nodejs yarn; };
|
||||||
yarn = yarn.override { inherit (super) nodejs; };
|
yarn = yarn.override { inherit (super) nodejs; };
|
||||||
nodejs = nodejs_16;
|
nodejs = nodejs_18;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
openbgpd = callPackage ../servers/openbgpd { };
|
openbgpd = callPackage ../servers/openbgpd { };
|
||||||
|
|
Loading…
Reference in a new issue