diff --git a/pkgs/build-support/node/fetch-yarn-deps/index.js b/pkgs/build-support/node/fetch-yarn-deps/index.js index ea2f4a73ca12..1799fbc71d68 100755 --- a/pkgs/build-support/node/fetch-yarn-deps/index.js +++ b/pkgs/build-support/node/fetch-yarn-deps/index.js @@ -10,6 +10,7 @@ const path = require('path') const lockfile = require('./yarnpkg-lockfile.js') const { promisify } = require('util') const url = require('url') +const { URL } = url; const { urlToName } = require('./common.js') const execFile = promisify(child_process.execFile) @@ -20,7 +21,7 @@ const exec = async (...args) => { return res } -const downloadFileHttps = (fileName, url, expectedHash, hashType = 'sha1') => { +const downloadFileHttps = (fileName, url, expectedHash, verbose, hashType = 'sha1') => { return new Promise((resolve, reject) => { const get = (url, redirects = 0) => https.get(url, (res) => { if(redirects > 10) { @@ -28,7 +29,9 @@ const downloadFileHttps = (fileName, url, expectedHash, hashType = 'sha1') => { return; } if(res.statusCode === 301 || res.statusCode === 302) { - return get(res.headers.location, redirects + 1) + const location = new URL(res.headers.location, url); + if (verbose) console.log('following redirect to ' + location); + return get(location, redirects + 1); } const file = fs.createWriteStream(fileName) const hash = crypto.createHash(hashType) @@ -119,9 +122,9 @@ const downloadPkg = (pkg, verbose) => { } else if (url.startsWith('https://')) { if (typeof pkg.integrity === 'string' || pkg.integrity instanceof String) { const [ type, checksum ] = pkg.integrity.split('-') - return downloadFileHttps(fileName, url, Buffer.from(checksum, 'base64').toString('hex'), type) + return downloadFileHttps(fileName, url, Buffer.from(checksum, 'base64').toString('hex'), verbose, type) } - return downloadFileHttps(fileName, url, hash) + return downloadFileHttps(fileName, url, hash, verbose) } else if (url.startsWith('file:')) { console.warn(`ignoring unsupported file:path url "${url}"`) } else { diff --git a/pkgs/servers/web-apps/outline/default.nix b/pkgs/servers/web-apps/outline/default.nix index 1423876c41b5..1c91181dc8f7 100644 --- a/pkgs/servers/web-apps/outline/default.nix +++ b/pkgs/servers/web-apps/outline/default.nix @@ -14,13 +14,13 @@ stdenv.mkDerivation rec { pname = "outline"; - version = "0.85.1"; + version = "0.86.1"; src = fetchFromGitHub { owner = "outline"; repo = "outline"; rev = "v${version}"; - hash = "sha256-lErNsYzxqZYVl1MAQdMk062nBORjQGd3C+UbGbZMzvA="; + hash = "sha256-lsiwTpmb9E6C5FuYFfko4PqulDcqWU9sQnzSEJ3Y4NE="; }; nativeBuildInputs = [ @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { yarnOfflineCache = fetchYarnDeps { yarnLock = "${src}/yarn.lock"; - hash = "sha256-/CXIZKI8eeK21PRIVZnRMOkwNNbj0vC0PZuT6rZBwG4="; + hash = "sha256-9xJ+N+UaHTlBzXvFPyYgB4jNwdiWCkvCSN22kEGuIxI="; }; configurePhase = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index db14e2e1bb15..a9f9a72f4029 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10234,7 +10234,7 @@ with pkgs; outline = callPackage ../servers/web-apps/outline ( lib.fix (super: { yarn = yarn.override { inherit (super) nodejs; }; - nodejs = nodejs_20; + nodejs = nodejs_22; }) );