Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4bb860526 | ||
|
|
6797dbada2 | ||
|
|
2ca1e67435 |
@@ -7,6 +7,7 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
actions: write
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
## [1.2.2](https://github.com/asepharyana/TeleUploader/compare/v1.2.1...v1.2.2) (2026-09-05)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **health:** resolve app version in Nix bundle at runtime ([6797dba](https://github.com/asepharyana/TeleUploader/commit/6797dbada27873b14c064e238589e61ad3ecb67c))
|
||||||
|
|
||||||
## [1.2.1](https://github.com/asepharyana/TeleUploader/compare/v1.2.0...v1.2.1) (2026-09-05)
|
## [1.2.1](https://github.com/asepharyana/TeleUploader/compare/v1.2.0...v1.2.1) (2026-09-05)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
# TeleUploader package
|
# TeleUploader package
|
||||||
teleuploader = pkgs.stdenvNoCC.mkDerivation rec {
|
teleuploader = pkgs.stdenvNoCC.mkDerivation rec {
|
||||||
pname = "teleuploader";
|
pname = "teleuploader";
|
||||||
version = "1.2.1";
|
version = "1.2.2";
|
||||||
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
@@ -61,6 +61,9 @@
|
|||||||
cp -r dist $out/share/teleuploader/dist
|
cp -r dist $out/share/teleuploader/dist
|
||||||
cp src/home.html $out/share/teleuploader/ 2>/dev/null || true
|
cp src/home.html $out/share/teleuploader/ 2>/dev/null || true
|
||||||
cp schema.sql $out/share/teleuploader/ 2>/dev/null || true
|
cp schema.sql $out/share/teleuploader/ 2>/dev/null || true
|
||||||
|
# Carry package.json into the store so runtime version lookup in
|
||||||
|
# env.ts readPackageVersion() resolves (dist/../package.json).
|
||||||
|
cp package.json $out/share/teleuploader/package.json
|
||||||
|
|
||||||
# Wrap with bun from Nix store (dependency sharing!)
|
# Wrap with bun from Nix store (dependency sharing!)
|
||||||
# Note: NO --chdir — systemd WorkingDirectory controls this
|
# Note: NO --chdir — systemd WorkingDirectory controls this
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "filedrop",
|
"name": "filedrop",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"description": "Telegram file uploader backend",
|
"description": "Telegram file uploader backend",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+8
-9
@@ -1,3 +1,4 @@
|
|||||||
|
import { readFileSync } from 'node:fs';
|
||||||
import logger from './shared/logger/index';
|
import logger from './shared/logger/index';
|
||||||
import { TELEGRAM_CHUNK_SIZE_MAX_BYTES } from './shared/utils/validation';
|
import { TELEGRAM_CHUNK_SIZE_MAX_BYTES } from './shared/utils/validation';
|
||||||
|
|
||||||
@@ -143,26 +144,24 @@ if (telegramChunkSizeBytes > TELEGRAM_CHUNK_SIZE_MAX_BYTES) {
|
|||||||
* value always matches the deployed build.
|
* value always matches the deployed build.
|
||||||
*/
|
*/
|
||||||
const readPackageVersion = (): string => {
|
const readPackageVersion = (): string => {
|
||||||
try {
|
// Candidates in priority order. In the Nix bundle the app lives at
|
||||||
|
// $out/share/teleuploader/dist/index.js, so the package.json that was
|
||||||
|
// copied alongside it is one level up from import.meta.dir. In a dev
|
||||||
|
// checkout it sits in the repo root (process.cwd()). Bun bundles JSON
|
||||||
|
// imports statically, so we read the file at runtime instead.
|
||||||
const candidates = [
|
const candidates = [
|
||||||
// node_modules resolution is only available when installed as a dep
|
|
||||||
import.meta.dir ? `${import.meta.dir}/../package.json` : undefined,
|
import.meta.dir ? `${import.meta.dir}/../package.json` : undefined,
|
||||||
`${process.cwd()}/package.json`,
|
`${process.cwd()}/package.json`,
|
||||||
];
|
];
|
||||||
for (const candidate of candidates) {
|
for (const candidate of candidates) {
|
||||||
if (!candidate) continue;
|
if (!candidate) continue;
|
||||||
try {
|
try {
|
||||||
const pkg = JSON.parse(import.meta.require(candidate).default ?? '{}') as {
|
const parsed = JSON.parse(readFileSync(candidate, 'utf8')) as { version?: string };
|
||||||
version?: string;
|
if (parsed.version) return parsed.version;
|
||||||
};
|
|
||||||
if (pkg.version) return pkg.version;
|
|
||||||
} catch {
|
} catch {
|
||||||
// try next candidate
|
// try next candidate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
|
||||||
// fall through
|
|
||||||
}
|
|
||||||
return '0.0.0';
|
return '0.0.0';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user