nas-samba v1.0.1: health check, hostname, remove demo credentials
- Add health check (curl /api/health) so Traefik can verify container health - Set container hostname to nas.alexzaw.dev - Remove hardcoded demo credentials from login page - Remove admin123 fallback password — require SMB_PASSWORD env var - Fail fast if no admin password is configured
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
"dynamic_config": true,
|
||||
"no_gui": false,
|
||||
"tipi_version": 2,
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"categories": ["network", "utilities"],
|
||||
"description": "All-in-one NAS container with Samba SMB file sharing and CloudNAS web file manager. Browse files via web UI or connect via SMB at \\\\192.168.0.15\\data with username alexz. No database required — uses filesystem + SQLite.",
|
||||
"short_desc": "NAS with SMB + web file manager",
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
"services": [
|
||||
{
|
||||
"name": "nas-samba",
|
||||
"image": "git.alexzaw.dev/alexz/nas-samba:1.0.0",
|
||||
"image": "git.alexzaw.dev/alexz/nas-samba:1.0.1",
|
||||
"isMain": true,
|
||||
"internalPort": 8080,
|
||||
"hostname": "nas.alexzaw.dev",
|
||||
"addPorts": [
|
||||
{ "hostPort": 445, "containerPort": 445, "interface": "${BIND_IP}" },
|
||||
{ "hostPort": 139, "containerPort": 139, "interface": "${BIND_IP}" }
|
||||
@@ -19,7 +20,14 @@
|
||||
{ "key": "SMB_PASSWORD", "value": "${SMB_PASSWORD}" },
|
||||
{ "key": "JWT_SECRET", "value": "${JWT_SECRET}" },
|
||||
{ "key": "TZ", "value": "${TZ}" }
|
||||
]
|
||||
],
|
||||
"healthCheck": {
|
||||
"test": "curl --fail http://127.0.0.1:8080/api/health || exit 1",
|
||||
"interval": "30s",
|
||||
"timeout": "10s",
|
||||
"retries": 3,
|
||||
"startPeriod": "15s"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"files": {
|
||||
"main.css": "/static/css/main.da1289f2.css",
|
||||
"main.js": "/static/js/main.fcd0e5c7.js",
|
||||
"main.css": "/static/css/main.f6816838.css",
|
||||
"main.js": "/static/js/main.2e7681ef.js",
|
||||
"index.html": "/index.html",
|
||||
"main.da1289f2.css.map": "/static/css/main.da1289f2.css.map",
|
||||
"main.fcd0e5c7.js.map": "/static/js/main.fcd0e5c7.js.map"
|
||||
"main.f6816838.css.map": "/static/css/main.f6816838.css.map",
|
||||
"main.2e7681ef.js.map": "/static/js/main.2e7681ef.js.map"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.da1289f2.css",
|
||||
"static/js/main.fcd0e5c7.js"
|
||||
"static/css/main.f6816838.css",
|
||||
"static/js/main.2e7681ef.js"
|
||||
]
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#0F172A"/><meta name="description" content="CloudSync - Enterprise File Manager"/><title>CloudSync - Enterprise File Manager</title><script defer="defer" src="/static/js/main.fcd0e5c7.js"></script><link href="/static/css/main.da1289f2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#0F172A"/><meta name="description" content="CloudSync - Enterprise File Manager"/><title>CloudSync - Enterprise File Manager</title><script defer="defer" src="/static/js/main.2e7681ef.js"></script><link href="/static/css/main.f6816838.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
25
apps/nas-samba/source/app/frontend/package-lock.json
generated
25
apps/nas-samba/source/app/frontend/package-lock.json
generated
@@ -14315,22 +14315,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/tailwindcss/node_modules/yaml": {
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz",
|
||||
"integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"yaml": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/eemeli"
|
||||
}
|
||||
},
|
||||
"node_modules/tapable": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz",
|
||||
@@ -14779,16 +14763,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"version": "4.9.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17"
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/unbox-primitive": {
|
||||
|
||||
@@ -129,11 +129,7 @@ function LoginPage() {
|
||||
|
||||
<div className="mt-8 p-4 bg-muted rounded-lg">
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<span className="font-medium text-foreground">Demo credentials:</span>
|
||||
<br />
|
||||
Username: <code className="font-mono bg-background px-1 rounded">admin</code>
|
||||
<br />
|
||||
Password: <code className="font-mono bg-background px-1 rounded">admin123</code>
|
||||
Use your NAS credentials to sign in. Contact your administrator if you need access.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ const JWT_SECRET = process.env.JWT_SECRET || 'cloudsync_secret_key';
|
||||
const JWT_ALGORITHM = 'HS256';
|
||||
const JWT_EXPIRATION_HOURS = 24;
|
||||
const ADMIN_USERNAME = process.env.ADMIN_USERNAME || 'alexz';
|
||||
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || process.env.SMB_PASSWORD || 'admin123';
|
||||
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || process.env.SMB_PASSWORD;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// SQLite setup
|
||||
@@ -1461,6 +1461,10 @@ app.get('*', (_req, res) => {
|
||||
// Seed admin user
|
||||
// ---------------------------------------------------------------------------
|
||||
function seedAdmin() {
|
||||
if (!ADMIN_PASSWORD) {
|
||||
console.error('FATAL: No admin password configured. Set SMB_PASSWORD or ADMIN_PASSWORD.');
|
||||
process.exit(1);
|
||||
}
|
||||
const count = sqlDb.prepare('SELECT COUNT(*) as count FROM users').get().count;
|
||||
if (count === 0) {
|
||||
const adminId = crypto.randomUUID();
|
||||
|
||||
Reference in New Issue
Block a user