atlas-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 the-Drunken-coder
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # Atlas Core CLI
2
+
3
+ `atlas-core` installs and operates one durable Atlas Core deployment on an arm64 or x64 macOS or Linux host with Docker Compose.
4
+ The npm package is the operator interface. Atlas Core itself runs from the matching
5
+ `ghcr.io/the-drunken-coder/atlas-core` container image.
6
+
7
+ ## Install
8
+
9
+ Install Node.js 24 or newer and Docker with Compose 2.17.0 or newer, then install the CLI globally. The CLI requires a
10
+ local Linux Docker daemon over a Unix socket; it refuses remote Docker contexts because the fixed deployment names and
11
+ durable volumes belong to one host.
12
+
13
+ ```bash
14
+ npm install --global atlas-core
15
+ atlas-core init
16
+ atlas-core start
17
+ ```
18
+
19
+ `init` generates strong local credentials and provisions the MinIO bucket only when it can prove the deployment is
20
+ new. It refuses to create new credentials over existing Atlas containers or volumes. Configuration is stored in `~/.atlas/core`
21
+ with owner-only permissions. Set `ATLAS_CORE_HOME` before the first command to choose another location.
22
+
23
+ ## Commands
24
+
25
+ ```text
26
+ atlas-core help
27
+ atlas-core init
28
+ atlas-core start
29
+ atlas-core stop
30
+ atlas-core restart
31
+ atlas-core status
32
+ atlas-core logs [core|postgres|minio] [--follow]
33
+ atlas-core doctor
34
+ atlas-core version
35
+ ```
36
+
37
+ `stop` removes containers and the private Compose network. It preserves PostgreSQL and MinIO volumes. Removing the
38
+ npm package also leaves those durable volumes untouched.
39
+
40
+ The first release binds the Core API, PostgreSQL, and MinIO ports to loopback. It does not configure public ingress.
41
+ Installing a different CLI version does not upgrade an initialized deployment. `start` and `restart` stop with an
42
+ explicit version mismatch until a backup-aware upgrade path is available. Both commands require registry access and
43
+ pull the release's digest-pinned image before starting; neither a locally retagged image nor an overwritten registry
44
+ tag can replace the reviewed Core image.
45
+
46
+ ## External ingress
47
+
48
+ Run Cloudflare Tunnel or another reverse proxy separately and route only the Core HTTP endpoint at
49
+ `http://127.0.0.1:8000`. Atlas does not install the proxy or store its credentials. Follow the
50
+ [external ingress guide](https://github.com/the-Drunken-coder/Atlas-Modernization/blob/main/docs/atlas-core/EXTERNAL_INGRESS.md)
51
+ for CORS, command-interface configuration, readiness checks, and trusted-proxy behavior.
52
+
53
+ ## Storage safety
54
+
55
+ PostgreSQL and the configured MinIO bucket are one durable store. Back them up and restore them together. The CLI
56
+ never enables Core's destructive development startup mode and never passes `--volumes` to `docker compose down`.
57
+ After the first full-stack start attempt, it refuses to recreate either durable volume if one goes missing. It also
58
+ binds the state directory to the Docker engine that initialized it and verifies Docker Compose ownership labels before
59
+ using an existing container or volume. Initialization also takes a Docker-engine-scoped project lock, so different
60
+ configuration directories cannot initialize the same fixed deployment concurrently.
61
+
62
+ If `init` finds existing Atlas volumes without its matching configuration, it stops. Do not delete those volumes to
63
+ silence the check. Recover the credentials and paired storage instead.
@@ -0,0 +1,16 @@
1
+ name: atlas_core_production
2
+
3
+ services:
4
+ minio:
5
+ extends:
6
+ file: docker-compose.yml
7
+ service: minio
8
+
9
+ volumes:
10
+ minio_data:
11
+ external: true
12
+ name: atlas_core_production_minio_data
13
+
14
+ networks:
15
+ atlas_core_network:
16
+ driver: bridge
@@ -0,0 +1,126 @@
1
+ name: atlas_core_production
2
+
3
+ services:
4
+ api:
5
+ image: ${ATLAS_CORE_IMAGE:?ATLAS_CORE_IMAGE must be set by the atlas-core CLI}
6
+ container_name: atlas_core_production_api
7
+ restart: unless-stopped
8
+ environment:
9
+ DATABASE_URL: postgres://atlas:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}@postgres:5432/atlas_core
10
+ DATABASE_POOL_SIZE: ${DATABASE_POOL_SIZE:-5}
11
+ DATABASE_MAX_OVERFLOW: ${DATABASE_MAX_OVERFLOW:-10}
12
+ DATABASE_POOL_RECYCLE: ${DATABASE_POOL_RECYCLE:-3600}
13
+ DATABASE_POOL_TIMEOUT: ${DATABASE_POOL_TIMEOUT:-30}
14
+ DATABASE_POOL_IDLE_TIMEOUT: ${DATABASE_POOL_IDLE_TIMEOUT:-600}
15
+ DATABASE_POOL_PRE_PING: ${DATABASE_POOL_PRE_PING:-true}
16
+ DATABASE_RECREATE_ON_STARTUP: "false"
17
+ MINIO_ENDPOINT: minio:9000
18
+ MINIO_ACCESS_KEY: ${MINIO_ROOT_USER:?MINIO_ROOT_USER must be set}
19
+ MINIO_SECRET_KEY: ${MINIO_ROOT_PASSWORD:?MINIO_ROOT_PASSWORD must be set}
20
+ MINIO_BUCKET: ${MINIO_BUCKET:-atlas-media}
21
+ MINIO_SECURE: "false"
22
+ SERVER_PORT: "8000"
23
+ ENABLE_API_AUTH: "true"
24
+ CORS_ORIGINS: ${CORS_ORIGINS-}
25
+ CORS_ORIGIN_PATTERNS: ${CORS_ORIGIN_PATTERNS-}
26
+ TRUSTED_PROXY_CIDRS: ${TRUSTED_PROXY_CIDRS:-}
27
+ API_AUTH_KEY: ${API_AUTH_KEY:?API_AUTH_KEY must be set}
28
+ ATLAS_ADMIN_PASSWORD: ${ATLAS_ADMIN_PASSWORD:?ATLAS_ADMIN_PASSWORD must be set}
29
+ MAX_UPLOAD_SIZE_MB: ${MAX_UPLOAD_SIZE_MB:-100}
30
+ MAX_VIEW_SIZE_MB: ${MAX_VIEW_SIZE_MB:-10}
31
+ ports:
32
+ - "127.0.0.1:8000:8000"
33
+ depends_on:
34
+ postgres:
35
+ condition: service_healthy
36
+ minio:
37
+ condition: service_healthy
38
+ minio-init:
39
+ condition: service_completed_successfully
40
+ healthcheck:
41
+ test: ["CMD", "curl", "-f", "http://localhost:8000/readiness"]
42
+ interval: 10s
43
+ timeout: 5s
44
+ retries: 5
45
+ start_period: 10s
46
+ networks:
47
+ - atlas_core_network
48
+
49
+ postgres:
50
+ image: postgres:15@sha256:1b92e7a80c021647bf70f5d3eb66066a998e4f5cf43c07bb9dc9f729782cf88e
51
+ container_name: atlas_core_production_postgres
52
+ restart: unless-stopped
53
+ environment:
54
+ POSTGRES_DB: atlas_core
55
+ POSTGRES_USER: atlas
56
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
57
+ POSTGRES_INITDB_ARGS: "--auth-local=md5 --auth-host=md5"
58
+ command: ["postgres", "-c", "timezone=UTC"]
59
+ ports:
60
+ - "127.0.0.1:5432:5432"
61
+ volumes:
62
+ - postgres_data:/var/lib/postgresql/data
63
+ healthcheck:
64
+ test: ["CMD-SHELL", "PGPASSWORD=\"$$POSTGRES_PASSWORD\" pg_isready -U atlas -d atlas_core"]
65
+ interval: 10s
66
+ timeout: 5s
67
+ retries: 5
68
+ networks:
69
+ - atlas_core_network
70
+
71
+ minio:
72
+ image: minio/minio:RELEASE.2024-01-31T20-20-33Z@sha256:4092433a77e510826874b36f369696df43407a763d7f901a61d74e83e6fd95bc
73
+ container_name: atlas_core_production_minio
74
+ restart: unless-stopped
75
+ environment:
76
+ MINIO_ROOT_USER: ${MINIO_ROOT_USER:?MINIO_ROOT_USER must be set}
77
+ MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:?MINIO_ROOT_PASSWORD must be set}
78
+ ports:
79
+ - "127.0.0.1:9000:9000"
80
+ - "127.0.0.1:9001:9001"
81
+ volumes:
82
+ - minio_data:/data
83
+ command: server /data --console-address ":9001"
84
+ healthcheck:
85
+ test: ["CMD", "mc", "ready", "local"]
86
+ interval: 10s
87
+ timeout: 5s
88
+ retries: 5
89
+ start_period: 10s
90
+ networks:
91
+ - atlas_core_network
92
+
93
+ minio-init:
94
+ image: minio/mc:RELEASE.2024-01-31T08-59-40Z@sha256:c084c9a67c7a9ed5f37cc7f2a905010861aaa882bec76da10352305c9709b6d2
95
+ container_name: atlas_core_production_minio_init
96
+ restart: "no"
97
+ environment:
98
+ MINIO_ROOT_USER: ${MINIO_ROOT_USER:?MINIO_ROOT_USER must be set}
99
+ MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:?MINIO_ROOT_PASSWORD must be set}
100
+ MINIO_BUCKET: ${MINIO_BUCKET:-atlas-media}
101
+ depends_on:
102
+ minio:
103
+ condition: service_healthy
104
+ entrypoint: /bin/sh
105
+ command:
106
+ - -c
107
+ - |
108
+ set -e
109
+ mc alias set atlas http://minio:9000 "$$MINIO_ROOT_USER" "$$MINIO_ROOT_PASSWORD" >/dev/null
110
+ mc stat "atlas/$$MINIO_BUCKET" >/dev/null
111
+ mc anonymous set none "atlas/$$MINIO_BUCKET"
112
+ echo 'MinIO bucket verified successfully'
113
+ networks:
114
+ - atlas_core_network
115
+
116
+ volumes:
117
+ postgres_data:
118
+ external: true
119
+ name: atlas_core_production_postgres_data
120
+ minio_data:
121
+ external: true
122
+ name: atlas_core_production_minio_data
123
+
124
+ networks:
125
+ atlas_core_network:
126
+ driver: bridge