Skip to content

Commit dc9d377

Browse files
authored
Merge pull request #3 from FoxxMD/compose
feat: Re-architect and simplify stacks parsing to support parsed compose project
2 parents 0a689f2 + fa3899c commit dc9d377

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2841
-752
lines changed

.devcontainer/compose.mounts.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3.7'
2+
services:
3+
app:
4+
#volumes:
5+
# # Add local mounts here
6+
# - /home/myUser/homelab:/filesOnServer

.devcontainer/compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: '3.7'
2+
services:
3+
# Update this to the name of the service you want to work with in your docker-compose.yml file
4+
app:
5+
extends:
6+
file: compose.mounts.yml
7+
service: app
8+
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
9+
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
10+
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
11+
# array). The sample below assumes your primary file is in the root of your project.
12+
#
13+
# build:
14+
# context: .
15+
# dockerfile: .devcontainer/Dockerfile
16+
17+
image: mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm
18+
19+
volumes:
20+
# Update this to wherever you want VS Code to mount the folder of your project
21+
- ..:/workspaces:cached
22+
command: sleep infinity
23+
24+
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
25+
# cap_add:
26+
# - SYS_PTRACE
27+
# security_opt:
28+
# - seccomp:unconfined
29+
30+
# Overrides default command so things don't shut down after the process ends.
31+
#command: sleep infinity
32+
socket-proxy:
33+
image: lscr.io/linuxserver/socket-proxy:latest
34+
environment:
35+
- CONTAINERS=1
36+
- INFO=1
37+
- POST=0
38+
- PING=1
39+
- VERSION=1
40+
volumes:
41+
- /var/run/docker.sock:/var/run/docker.sock:ro
42+
read_only: true
43+
tmpfs:
44+
- /run

.devcontainer/devcontainer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
{
44
"name": "Node.js",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm",
6+
"dockerComposeFile": [
7+
"compose.yml"
8+
],
9+
10+
"service": "app",
11+
12+
"workspaceFolder": "/workspaces",
713

814
// Features to add to the dev container. More info: https://containers.dev/features.
915
// "features": {},

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,6 @@ build
137137
.github/act/out
138138
tmp-*
139139

140-
config/*.toml
140+
config/*.toml
141+
142+
.devcontainer/compose.mounts.yml

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENV TZ=Etc/GMT \
88
NODE_ENV="production" \
99
IS_DOCKER=true \
1010
COLORED_STD=true \
11-
FILES_ON_SERVER_DIR=/filesOnServer
11+
MOUNT_DIR=/filesOnServer
1212

1313
FROM base as builder
1414

compose.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,23 @@ services:
22
komodo-import:
33
image: foxxmd/komodo-import:latest
44
volumes:
5-
## ParentDirectory:FILES_ON_SERVER_DIR
6-
- ./myprojects:/filesOnServer
7-
8-
## optional, TOML is saved to file here when OUTPUT_DIR env is present
9-
#- ./output:/output
5+
## Mount the parent directory where all subfolders are compose projects
6+
- /home/myUser/homelab:/filesOnServer
107
environment:
11-
- TZ=America/New_York
8+
## Same as host directory mounted above
9+
- HOST_DIR=/home/myUser/homelab
10+
## where stacks are generated from. 'dir' or 'compose'
11+
- STACKS_FROM=dir
1212
## Komodo Server name to use for generated Stacks
1313
- SERVER_NAME=my-cool-server
14-
## ParentDirectory on the host use as Stack Run Directory prefix
15-
- HOST_PARENT_PATH=/my/cool/path
1614

1715
## optional
18-
#- FILES_ON_SERVER_DIR=/filesOnServer
16+
#- TZ=America/New_York
1917
#- IMAGE_REGISTRY_PROVIDER=
2018
#- IMAGE_REGISTRY_ACCOUNT=
2119
#- AUTO_UPDATE=false
2220
#- POLL_FOR_UPDATE=false
2321
#- KOMODO_ENV_NAME=
2422
#- COMPOSE_FILE_GLOB=
2523
#- ENV_FILE_GLOB=
26-
27-
## only saves to file if this ENV is present
28-
#- OUTPUT_DIR=/output
2924
restart: no

docsite/docs/help.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: 'Help and FAQ'
3+
---
4+
5+
## Where To Start?
6+
7+
If you are overwhelmed by the docs or not sure where to begin you should try out the [**Quickstart** guide](../quickstart). It uses step-by-step questions with interactive fields/buttons to help customize Komodo Import for your machine.
8+
9+
## Further Help with Komodo Import
10+
11+
If the [**Quickstart** guide](../quickstart) and [Usage docs](../usage/overview) do not cover what you want to do with Komodo Import or you do not fully understand how to use it please search the repository's [Github Discussions](https://github.com/FoxxMD/komodo-import/discussions) and if your question is not answered then [open a New Discussion](https://github.com/FoxxMD/komodo-import/discussions/new/choose).
12+
13+
## Found a Bug or Error?
14+
15+
If Komodo Import is not behaving as you expect it to or is outputting errors that break functionality please search [Github Issues](https://github.com/FoxxMD/komodo-import/issues) and [open a New Issue](https://github.com/FoxxMD/komodo-import/issues/new) if you cannot find a solution to your problem.

docsite/docs/installation/installation.mdx

Lines changed: 24 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Tabs from '@theme/Tabs';
77
import TabItem from '@theme/TabItem';
88
import CodeBlock from '@theme/CodeBlock';
99
import ComposeStack from '!!raw-loader!../../../compose.yaml';
10+
import ConsoleOutput from '../../src/components/QuickStartSnippets/consoleOutput.mdx'
11+
import TreeDirectory from '../../src/components/snippets/_directoryTree.mdx'
1012

1113
## Docker
1214

@@ -45,7 +47,7 @@ Or use the example `compose.yml`, found in the repo, after modifying it to fit y
4547

4648
:::tip
4749

48-
See the [**Quick Start Guide**](../quickstart.mdx) for another guided docker-compose example
50+
Use the [**Quick Start Guide**](../quickstart.mdx) for an interactive setup!
4951

5052
:::
5153

@@ -54,165 +56,28 @@ The example scenario:
5456
* You have [Komodo](https://komo.do/) already setup
5557
* You have installed [Periphery](https://komo.do/docs/connect-servers) on a machine
5658
* The Komodo Server name for this machine is `my-cool-server`
57-
* The machine is currently using dockge and has all of its compose projects located at `/home/myUser/homelab` like...
58-
* `/home/myUser/homelab/immich`
59-
* `/home/myUser/homelab/plex`
60-
* etc...
61-
62-
<Tabs groupId="runType" queryString>
63-
<TabItem value="docker" label="Docker">
64-
```bash
65-
docker run --name komodo-import -e "SERVER_NAME=my-cool-server" -e "HOST_PARENT_PATH=/home/myUser/homelab" -v /home/myUser/homelab:/filesOnServer foxxmd/komodo-import
66-
```
67-
</TabItem>
68-
<TabItem value="docker-compose" label="Docker Compose">
69-
See [`docker-compose.yml`](#docker) sample above for more options and annotations.
70-
71-
```yaml title="docker-compose.yml"
72-
services:
73-
komodo-import:
74-
image: foxxmd/komodo-import:latest
75-
volumes:
76-
## ParentDirectory:FILES_ON_SERVER_DIR
77-
- /home/myUser/homelab:/filesOnServer:ro
78-
environment:
79-
- TZ=America/New_York
80-
## Komodo Server name to use for generated Stacks
81-
- SERVER_NAME=my-cool-server
82-
## ParentDirectory on the host use as Stack Run Directory prefix
83-
- HOST_PARENT_PATH=/home/myUser/homelab
84-
restart: no
85-
```
86-
```shell
87-
docker compose up --no-log-prefix
88-
```
89-
</TabItem>
90-
</Tabs>
91-
92-
<details>
93-
94-
<summary>Output</summary>
95-
96-
```shell
97-
[2025-08-11 14:06:19.080 -0400] INFO : [Init] Debug Mode: NO
98-
[2025-08-11 14:06:19.094 -0400] INFO : [App] Version: 0.1.0
99-
[2025-08-11 14:06:19.095 -0400] INFO : [App] Files On Server Dir ENV: /filesOnServer -> Resolved: /filesOnServer
100-
[2025-08-11 14:06:19.096 -0400] INFO : [App] [Files On Server] Processing Stacks for 6 folders:
101-
/filesOnServer/compose.yaml
102-
/filesOnServer/immich
103-
/filesOnServer/jellyfin
104-
/filesOnServer/octoprint
105-
/filesOnServer/plex
106-
/filesOnServer/uptime-kuma
107-
[2025-08-11 14:06:19.096 -0400] INFO : [App] [Files On Server] Compose File Glob: **/{compose,docker-compose}*.y?(a)ml
108-
[2025-08-11 14:06:19.097 -0400] INFO : [App] [Files On Server] Env Glob: **/.env
109-
[2025-08-11 14:06:19.097 -0400] INFO : [App] [Files On Server] [compose] Found Stack 'compose' at dir /filesOnServer/compose.yaml
110-
[2025-08-11 14:06:19.103 -0400] WARN : [App] [Files On Server] [compose] Did not find any files patterns matching compose glob
111-
[2025-08-11 14:06:19.103 -0400] INFO : [App] [Files On Server] [compose] Stack config complete
112-
[2025-08-11 14:06:19.104 -0400] INFO : [App] [Files On Server] [immich] Found Stack 'immich' at dir /filesOnServer/immich
113-
[2025-08-11 14:06:19.107 -0400] INFO : [App] [Files On Server] [immich] Found 1 files matching compose glob:
114-
docker/docker-compose.yaml
115-
[2025-08-11 14:06:19.107 -0400] INFO : [App] [Files On Server] [immich] Using file(s): docker/docker-compose.yaml
116-
[2025-08-11 14:06:19.108 -0400] INFO : [App] [Files On Server] [immich] Stack config complete
117-
[2025-08-11 14:06:19.108 -0400] INFO : [App] [Files On Server] [jellyfin] Found Stack 'jellyfin' at dir /filesOnServer/jellyfin
118-
[2025-08-11 14:06:19.109 -0400] INFO : [App] [Files On Server] [jellyfin] Found 3 files matching compose glob:
119-
compose.yaml
120-
docker-compose.yaml
121-
docker/docker-compose.yaml
122-
[2025-08-11 14:06:19.110 -0400] INFO : [App] [Files On Server] [jellyfin] Using file: compose.yaml but not writing to file_paths since this is the Komodo default
123-
[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [jellyfin] Found 1 env files matching pattern **/.env:
124-
.env
125-
[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [jellyfin] Using .komodoEnv for Komodo-written env file
126-
[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [jellyfin] Stack config complete
127-
[2025-08-11 14:06:19.111 -0400] INFO : [App] [Files On Server] [octoprint] Found Stack 'octoprint' at dir /filesOnServer/octoprint
128-
[2025-08-11 14:06:19.112 -0400] WARN : [App] [Files On Server] [octoprint] Did not find any files patterns matching compose glob
129-
[2025-08-11 14:06:19.112 -0400] INFO : [App] [Files On Server] [octoprint] Stack config complete
130-
[2025-08-11 14:06:19.113 -0400] INFO : [App] [Files On Server] [plex] Found Stack 'plex' at dir /filesOnServer/plex
131-
[2025-08-11 14:06:19.114 -0400] INFO : [App] [Files On Server] [plex] Found 1 files matching compose glob:
132-
compose.yaml
133-
[2025-08-11 14:06:19.114 -0400] INFO : [App] [Files On Server] [plex] Using file: compose.yaml but not writing to file_paths since this is the Komodo default
134-
[2025-08-11 14:06:19.115 -0400] INFO : [App] [Files On Server] [plex] Stack config complete
135-
[2025-08-11 14:06:19.115 -0400] INFO : [App] [Files On Server] [uptime-kuma] Found Stack 'uptime-kuma' at dir /filesOnServer/uptime-kuma
136-
[2025-08-11 14:06:19.116 -0400] INFO : [App] [Files On Server] [uptime-kuma] Found 1 files matching compose glob:
137-
compose.yaml
138-
[2025-08-11 14:06:19.116 -0400] INFO : [App] [Files On Server] [uptime-kuma] Using file: compose.yaml but not writing to file_paths since this is the Komodo default
139-
[2025-08-11 14:06:19.117 -0400] INFO : [App] [Files On Server] [uptime-kuma] Found 1 env files matching pattern **/.env:
140-
.env
141-
[2025-08-11 14:06:19.117 -0400] INFO : [App] [Files On Server] [uptime-kuma] Using .komodoEnv for Komodo-written env file
142-
[2025-08-11 14:06:19.117 -0400] INFO : [App] [Files On Server] [uptime-kuma] Stack config complete
143-
[2025-08-11 14:06:19.118 -0400] INFO : [App] [Files On Server] Built Stack configs for 6 folders
144-
[2025-08-11 14:06:19.119 -0400] INFO : [App] Copy the text between the scissors to use as the *Resource File* contents within your Resource Sync
145-
146-
✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️
147-
[[stack]]
148-
name = "compose"
149-
150-
[stack.config]
151-
server = "my-cool-server"
152-
run_directory = "/home/myUser/homelab/compose"
153-
files_on_host = true
154-
auto_update = false
155-
poll_for_updates = false
156-
157-
[[stack]]
158-
name = "immich"
159-
160-
[stack.config]
161-
server = "my-cool-server"
162-
run_directory = "/home/myUser/homelab/immich"
163-
files_on_host = true
164-
auto_update = false
165-
poll_for_updates = false
166-
file_paths = [ "docker/docker-compose.yaml" ]
167-
168-
[[stack]]
169-
name = "jellyfin"
170-
171-
[stack.config]
172-
server = "my-cool-server"
173-
run_directory = "/home/myUser/homelab/jellyfin"
174-
files_on_host = true
175-
auto_update = false
176-
poll_for_updates = false
177-
env_file_path = ".komodoEnv"
178-
additional_env_files = [ ".env" ]
179-
180-
[[stack]]
181-
name = "octoprint"
182-
183-
[stack.config]
184-
server = "my-cool-server"
185-
run_directory = "/home/myUser/homelab/octoprint"
186-
files_on_host = true
187-
auto_update = false
188-
poll_for_updates = false
189-
190-
[[stack]]
191-
name = "plex"
192-
193-
[stack.config]
194-
server = "my-cool-server"
195-
run_directory = "/home/myUser/homelab/plex"
196-
files_on_host = true
197-
auto_update = false
198-
poll_for_updates = false
199-
200-
[[stack]]
201-
name = "uptime-kuma"
202-
203-
[stack.config]
204-
server = "my-cool-server"
205-
run_directory = "/home/myUser/homelab/uptime-kuma"
206-
files_on_host = true
207-
auto_update = false
208-
poll_for_updates = false
209-
env_file_path = ".komodoEnv"
210-
additional_env_files = [ ".env" ]
211-
✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️
212-
[2025-08-11 14:06:19.119 -0400] INFO : [App] Done!
59+
* The machine is currently using dockge and its projects directory looks like this:
60+
61+
<TreeDirectory/>
62+
63+
```yaml title="docker-compose.yml"
64+
services:
65+
komodo-import:
66+
image: foxxmd/komodo-import:latest
67+
volumes:
68+
- /home/myUser/homelab:/filesOnServer:ro
69+
environment:
70+
- TZ=America/New_York
71+
## Komodo Server name to use for generated Stacks
72+
- SERVER_NAME=my-cool-server
73+
## ParentDirectory on the host use as Stack Run Directory prefix
74+
- HOST_DIR=/home/myUser/homelab
75+
## generate stacks from mounted directory subfolders
76+
- STACKS_FROM=dir
77+
restart: no
21378
```
21479
215-
</details>
80+
<ConsoleOutput/>
21681
21782
## Local Installation
21883
@@ -232,5 +97,5 @@ npm run start
23297
#### Usage Examples
23398

23499
```shell
235-
SERVER_NAME=my-server HOST_PARENT_PATH=/my/parent/folder node src/index.js
100+
SERVER_NAME=my-cool-server STACKS_FROM=dir MOUNT_DIR=/my/parent/folder node src/index.js
236101
```

0 commit comments

Comments
 (0)