-
-
Notifications
You must be signed in to change notification settings - Fork 71
feat: add extension templates #535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
dd37226
0fbd20d
0aba22f
276c8c1
c2f0866
2e0aab5
32dde13
eb11e63
128e4dc
ec38aed
75dd4fb
d10bf12
912cb37
fe18791
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ import ( | |
| "io" | ||
| "os" | ||
| "path/filepath" | ||
| "syscall" | ||
| // "syscall" | ||
| "time" | ||
|
|
||
| "github.com/pkg/sftp" | ||
|
|
@@ -91,15 +91,15 @@ func (f *FileManagerService) ListFiles(path string) ([]FileData, error) { | |
| } | ||
| } | ||
|
|
||
| sysInfo := info.Sys() | ||
| // sysInfo := info.Sys() | ||
| var ownerId, groupId int64 | ||
| var permissions int64 | ||
|
|
||
| if statInfo, ok := sysInfo.(*syscall.Stat_t); ok { | ||
| ownerId = int64(statInfo.Uid) | ||
| groupId = int64(statInfo.Gid) | ||
| permissions = int64(statInfo.Mode & 0777) | ||
| } | ||
| // if statInfo, ok := sysInfo.(*syscall.Stat_t); ok { | ||
| // ownerId = int64(statInfo.Uid) | ||
| // groupId = int64(statInfo.Gid) | ||
| // permissions = int64(statInfo.Mode & 0777) | ||
| // } | ||
|
Comment on lines
+94
to
+102
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainBreaking change: File permission and ownership data is no longer returned. Commenting out the stat extraction logic means the API will now return
If this change addresses platform compatibility issues (e.g., //go:build unix
package service
import "syscall"
func extractStatInfo(info os.FileInfo) (ownerId, groupId, permissions int64) {
if sysInfo := info.Sys(); sysInfo != nil {
if statInfo, ok := sysInfo.(*syscall.Stat_t); ok {
return int64(statInfo.Uid), int64(statInfo.Gid), int64(statInfo.Mode & 0777)
}
}
return 0, 0, 0
}Alternatively, if these fields are no longer supported, remove them from the Run the following script to check for API consumers that may depend on these fields: 🏁 Script executed: #!/bin/bash
# Search for usage of permissions, owner_id, or group_id fields from FileData responses
rg -nP --type=go -C3 '\b(Permissions|OwnerId|GroupId)\b' -g '!**/service/manager.go'Length of output: 2905 </script> 🏁 Script executed: #!/bin/bash
# Find FileData struct definition and API usage
echo "=== FileData struct definition ==="
rg -nP --type=go -B2 -A8 'type FileData struct' -g '!**/test/**'
echo -e "\n=== Handlers returning FileData ==="
rg -nP --type=go -B3 -A3 'FileData' -g '!**/service/manager.go' | head -50Length of output: 1102 </script> 🏁 Script executed: #!/bin/bash
# Get complete FileData struct definition and find API consumers
echo "=== Complete FileData struct ==="
sed -n '145,200p' api/internal/features/file-manager/service/manager.go
echo -e "\n=== API routes/handlers using file manager ==="
rg -nP --type=go 'FileData|file.*manager' api/internal/features/file-manager/handler/ api/internal/routes/ 2>/dev/null | head -40
echo -e "\n=== Check manager.go for OwnerId and GroupId fields ==="
rg -nP --type=go 'OwnerId|GroupId' api/internal/features/file-manager/Length of output: 2040 </script> 🏁 Script executed: #!/bin/bash
# View the full context of the commented code and assignments
echo "=== Context around lines 94-120 ==="
sed -n '80,125p' api/internal/features/file-manager/service/manager.go
echo -e "\n=== Search for routes/handlers in file-manager ==="
find api/internal/features/file-manager -name '*.go' -type f | xargs grep -l 'http\|route\|handler' | head -10
echo -e "\n=== List all files in file-manager ==="
find api/internal/features/file-manager -name '*.go' -type fLength of output: 2121 </script> 🏁 Script executed: #!/bin/bash
# Check test expectations and controller exposure
echo "=== Manager test file (checking for permission/owner assertions) ==="
cat api/internal/features/file-manager/tests/manager_test.go
echo -e "\n=== List files controller (checking HTTP exposure) ==="
cat api/internal/features/file-manager/controller/list_files.go | head -60Length of output: 4469 Breaking change: File permission and ownership data is no longer returned. Commenting out the stat extraction logic means the API will now return Clients that rely on permission data for access control decisions, UI display of file ownership, or security auditing will now receive zero values. If this change addresses platform compatibility issues (e.g., //go:build unix
package service
import "syscall"
func extractStatInfo(info os.FileInfo) (ownerId, groupId, permissions int64) {
if sysInfo := info.Sys(); sysInfo != nil {
if statInfo, ok := sysInfo.(*syscall.Stat_t); ok {
return int64(statInfo.Uid), int64(statInfo.Gid), int64(statInfo.Mode & 0777)
}
}
return 0, 0, 0
}Alternatively, if these fields are no longer supported on all platforms, remove them from the 🤖 Prompt for AI Agents |
||
|
|
||
| fullPath := filepath.Join(path, info.Name()) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| metadata: | ||
| id: "deploy-adguard-home" | ||
|
Comment on lines
+1
to
+2
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix filename typo: "adgaurd" should be "adguard". Line 2 shows the id as "deploy-adguard-home" but the filename is 🤖 Prompt for AI Agents |
||
| name: "AdGuard Home" | ||
| description: "AdGuard Home is a network-wide software for blocking ads and trackers via DNS filtering." | ||
| author: "Nixopus Team" | ||
| icon: "🛡️" | ||
| category: "Containers" | ||
| type: "install" | ||
| version: "1.0.0" | ||
| isVerified: false | ||
|
|
||
| variables: | ||
| image: | ||
| type: "string" | ||
| description: "Docker image for AdGuard Home" | ||
| default: "adguard/adguardhome" | ||
| is_required: true | ||
| tag: | ||
| type: "string" | ||
| description: "Docker image tag" | ||
| default: "latest" | ||
| is_required: true | ||
| container_name: | ||
| type: "string" | ||
| description: "Name of the AdGuard Home container" | ||
| default: "adguard-home" | ||
| is_required: true | ||
| host_port: | ||
| type: "integer" | ||
| description: "Host port to expose AdGuard Home web interface" | ||
| default: 3000 | ||
| is_required: true | ||
| container_port: | ||
| type: "integer" | ||
| description: "Container port AdGuard Home listens on" | ||
| default: 3000 | ||
| is_required: true | ||
| dns_port: | ||
| type: "integer" | ||
| description: "DNS port to expose" | ||
| default: 53 | ||
| is_required: true | ||
| data_volume: | ||
| type: "string" | ||
| description: "Host path to mount for persistent data" | ||
| default: "./adguard_data" | ||
| is_required: true | ||
|
|
||
| execution: | ||
| run: | ||
| - name: "Pull AdGuard Home image" | ||
| type: "docker" | ||
| properties: | ||
| action: "pull" | ||
| image: "{{ image }}" | ||
| tag: "{{ tag }}" | ||
| timeout: 300 | ||
|
|
||
| - name: "Run AdGuard Home container" | ||
| type: "docker" | ||
| properties: | ||
| action: "run" | ||
| name: "{{ container_name }}" | ||
| image: "{{ image }}" | ||
| tag: "{{ tag }}" | ||
| ports: | ||
| - "{{ host_port }}:{{ container_port }}" | ||
| - "{{ dns_port }}:{{ dns_port }}" | ||
| volumes: | ||
| - "{{ data_volume }}:/opt/adguardhome/work" | ||
| - "{{ data_volume }}:/opt/adguardhome/conf" | ||
| restart: "unless-stopped" | ||
| timeout: 180 | ||
|
|
||
| # validate: | ||
| # - name: "Check HTTP response from AdGuard Home" | ||
| # type: "command" | ||
| # properties: | ||
| # cmd: "curl -fsS -o /dev/null -w '%{http_code}\\n' http://localhost:{{ host_port }}/ | grep -E '^(200|301|302)$'" | ||
| # timeout: 60 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| metadata: | ||
| id: "deploy-alist" | ||
| name: "AList" | ||
| description: "AList is a file list/WebDAV program that supports multiple storage providers and provides a self-hosted file sharing/indexing solution." | ||
| author: "Nixopus Team" | ||
| icon: "📁" | ||
| category: "Containers" | ||
| type: "install" | ||
| version: "1.0.0" | ||
| isVerified: false | ||
|
|
||
| variables: | ||
| image: | ||
| type: "string" | ||
| description: "Docker image for AList" | ||
| default: "xhofe/alist" | ||
| is_required: true | ||
| tag: | ||
| type: "string" | ||
| description: "Docker image tag for AList" | ||
| default: "latest" | ||
| is_required: true | ||
| container_name: | ||
| type: "string" | ||
| description: "Name of the AList container" | ||
| default: "alist" | ||
| is_required: true | ||
| host_port: | ||
| type: "integer" | ||
| description: "Host port to expose for AList" | ||
| default: 5244 | ||
| is_required: true | ||
| container_port: | ||
| type: "integer" | ||
| description: "Container port AList listens on" | ||
| default: 5244 | ||
| is_required: true | ||
| data_volume: | ||
| type: "string" | ||
| description: "Host path to mount for AList persistent data" | ||
| default: "./alist_data" | ||
| is_required: true | ||
| PUID: | ||
| type: "integer" | ||
| description: "Host user ID to run container" | ||
| default: 0 | ||
| is_required: false | ||
| PGID: | ||
| type: "integer" | ||
| description: "Host group ID to run container" | ||
| default: 0 | ||
| is_required: false | ||
| UMASK: | ||
| type: "string" | ||
| description: "Umask for container file permissions" | ||
| default: "022" | ||
| is_required: false | ||
|
|
||
| execution: | ||
| run: | ||
| - name: "Pull AList image" | ||
| type: "docker" | ||
| properties: | ||
| action: "pull" | ||
| image: "{{ image }}" | ||
| tag: "{{ tag }}" | ||
| timeout: 300 | ||
|
|
||
| - name: "Run AList container" | ||
| type: "docker" | ||
| properties: | ||
| action: "run" | ||
| name: "{{ container_name }}" | ||
| image: "{{ image }}" | ||
| tag: "{{ tag }}" | ||
| ports: "{{ host_port }}:{{ container_port }}" | ||
| volumes: | ||
| - "{{ data_volume }}:/opt/alist/data" | ||
| environment: | ||
| - "PUID={{ PUID }}" | ||
| - "PGID={{ PGID }}" | ||
| - "UMASK={{ UMASK }}" | ||
| restart: "unless-stopped" | ||
| timeout: 180 | ||
|
|
||
| # validate: | ||
| # - name: "Check HTTP response from AList" | ||
| # type: "command" | ||
| # properties: | ||
| # cmd: "curl -fsS -o /dev/null -w '%{http_code}\\n' http://localhost:{{ host_port }} | grep -E '^(200|301|302)$'" | ||
| # timeout: 60 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| metadata: | ||
| id: "deploy-apache-superset" | ||
| name: "Apache Superset" | ||
| description: "Apache Superset is a modern data exploration and visualization platform designed for data analysis and dashboarding." | ||
| author: "Nixopus Team" | ||
| icon: "📊" | ||
| category: "Containers" | ||
| type: "install" | ||
| version: "1.0.0" | ||
| isVerified: false | ||
|
|
||
| variables: | ||
| image: | ||
| type: "string" | ||
| description: "Docker image for Apache Superset" | ||
| default: "apache/superset" | ||
| is_required: true | ||
|
|
||
| tag: | ||
| type: "string" | ||
| description: "Docker image tag" | ||
| default: "latest" | ||
| is_required: true | ||
|
Comment on lines
+19
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Avoid "latest" tag; use pinned versions for reproducibility. Using :latest tags in production should be avoided to ensure predictable builds. The default "latest" tag makes deployments non-deterministic and can introduce breaking changes across deployments. Recommend changing the default to a specific version (e.g., "3.0.2") to ensure consistent behavior across environments. tag:
type: "string"
description: "Docker image tag"
- default: "latest"
+ default: "3.0.2"
is_required: trueAlternatively, if supporting multiple versions is desired, provide clear documentation on the implications of using "latest" or require users to explicitly specify a version. 🤖 Prompt for AI Agents |
||
|
|
||
| container_name: | ||
| type: "string" | ||
| description: "Name of the container" | ||
| default: "superset" | ||
| is_required: true | ||
|
|
||
| host_port: | ||
| type: "integer" | ||
| description: "Host port to expose Superset" | ||
| default: 8088 | ||
| is_required: true | ||
|
|
||
| container_port: | ||
| type: "integer" | ||
| description: "Container port for Superset service" | ||
| default: 8088 | ||
| is_required: true | ||
|
|
||
| execution: | ||
| run: | ||
| - name: "Pull Apache Superset image" | ||
| type: "docker" | ||
| properties: | ||
| action: "pull" | ||
| image: "{{ image }}" | ||
| tag: "{{ tag }}" | ||
| timeout: 300 | ||
|
|
||
| - name: "Run Apache Superset container" | ||
| type: "docker" | ||
| properties: | ||
| action: "run" | ||
| name: "{{ container_name }}" | ||
| image: "{{ image }}" | ||
| tag: "{{ tag }}" | ||
| ports: "{{ host_port }}:{{ container_port }}" | ||
| restart: "unless-stopped" | ||
| timeout: 180 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.