Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
thgh committed Dec 28, 2023
1 parent b39d6ad commit 88d3fb4
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 335 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The prototype contains these features:
- [x] Detect failing services
- [ ] Wildcard certificate generation
- [x] Environment variable editing
- [ ] Hover over system info to see live stats

Up for discussion:

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scripts": {
"dev": "vite-node --watch src/server.dev.ts",
"build": "vite build && bunchee --runtime nodejs --target nodenext --external ./index && node bunchee-patch.js",
"build": "vite build && pkgroll --dist bundle",
"start": "node server.mjs",
"cli": "node bin.mjs",
"test": "vitest",
Expand All @@ -26,6 +26,9 @@
"drun": "docker run --rm -i -v /var/run/docker.sock:/var/run/docker.sock:ro -e PORT=23077 -p 23077:23077 thgh/hivepanel",
"dpush": "docker push thgh/hivepanel"
},
"imports": {
"@": "src"
},
"exports": {
".": {
"import": "./bundle/index.mjs",
Expand Down Expand Up @@ -78,7 +81,6 @@
"@vitest/ui": "^0.34.5",
"autoprefixer": "^10.4.16",
"axios": "^1.5.0",
"bunchee": "^3.8.0",
"class-variance-authority": "^0.7.0",
"classnames": "^2.3.2",
"clsx": "^2.0.0",
Expand All @@ -92,6 +94,7 @@
"express": "^4.18.2",
"lucide-react": "^0.279.0",
"native-dns": "^0.7.0",
"pkgroll": "^2.0.1",
"postcss": "^8.4.30",
"prettier": "^3.0.3",
"prompts": "^2.4.2",
Expand Down
64 changes: 64 additions & 0 deletions public/registry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"services": [
{
"captainVersion": 4,
"services": {
"$$cap_appname": {
"image": "postgres:$$cap_postgres_version",
"volumes": ["$$cap_appname-data:/var/lib/postgresql/data"],
"restart": "always",
"environment": {
"POSTGRES_USER": "$$cap_pg_user",
"POSTGRES_PASSWORD": "$$cap_pg_pass",
"POSTGRES_DB": "$$cap_pg_db",
"POSTGRES_INITDB_ARGS": "$$cap_pg_initdb_args"
},
"caproverExtra": { "notExposeAsWebApp": "true" }
}
},
"caproverOneClickApp": {
"variables": [
{
"id": "$$cap_postgres_version",
"label": "Version",
"defaultValue": "14.5",
"description": "Check out their Docker page for the valid tags https://hub.docker.com/r/library/postgres/tags",
"validRegex": "/^([^\\s^\\/])+$/"
},
{
"id": "$$cap_pg_user",
"label": "Username",
"defaultValue": "postgres",
"validRegex": "/.{1,}/"
},
{
"id": "$$cap_pg_pass",
"label": "Password",
"defaultValue": "$$cap_gen_random_hex(16)",
"validRegex": "/.{1,}/"
},
{
"id": "$$cap_pg_db",
"label": "Default Database",
"defaultValue": "postgres",
"validRegex": "/.{1,}/"
},
{
"id": "$$cap_pg_initdb_args",
"label": "Optional Arguments",
"description": "Arguments will be appended to `postgres initdb`. Example: `--data-checksums`.",
"validRegex": "/.{0,}/"
}
],
"instructions": {
"start": "PostgreSQL, often simply Postgres, is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards-compliance.\nAs a database server, its primary function is to store data, securely and supporting best practices, and retrieve it later, as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet).\nIt can handle workloads ranging from small single-machine applications to large Internet-facing applications with many concurrent users.",
"end": "Postgres is deployed and available as `srv-captain--$$cap_appname:5432` to other apps.\nFor example with Node.js: `const client = new Client({ user: '$$cap_pg_user', host: 'srv-captain--$$cap_appname', database: '$$cap_pg_db', password: '$$cap_pg_pass', port: 5432})`"
},
"displayName": "PostgreSQL",
"isOfficial": true,
"description": "The PostgreSQL object-relational database system provides reliability and data integrity",
"documentation": "https://hub.docker.com/_/postgres"
}
}
]
}
2 changes: 1 addition & 1 deletion src/lib/swr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function useSwarmLinks() {
.filter((link) => link.type === 'hivepanel')

return {
hostname: nodes.data?.data[0].Description.Hostname,
hostname: nodes.data?.data?.[0].Description.Hostname,
links,
}
}
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { defineConfig } from 'vite'

export default defineConfig({
plugins: [react()],
build: {
chunkSizeWarningLimit: 600,
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
Expand Down
Loading

0 comments on commit 88d3fb4

Please sign in to comment.