Skip to content

Commit 03f4c88

Browse files
authored
Merge branch 'master' into fix/fixing-Ctrl-+-v-and-Ctrl-+-c-in-terminal
2 parents 71e5c64 + 24e5ba4 commit 03f4c88

File tree

118 files changed

+9409
-430
lines changed

Some content is hidden

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

118 files changed

+9409
-430
lines changed

.github/workflows/security.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121

2222
- name: Run Trivy vulnerability scanner
2323
uses: aquasecurity/trivy-action@master
24+
env:
25+
TRIVY_DISABLE_VEX_NOTICE: "1"
2426
with:
2527
scan-type: 'fs'
2628
scan-ref: '.'

CHANGELOG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
1+
# [0.1.0-alpha.42](https://github.com/raghavyuva/nixopus/compare/v0.1.0-alpha.41...v0.1.0-alpha.42) (2025-10-17)
2+
3+
4+
### Features
5+
6+
* setup development environment with cli installer ([#508](https://github.com/raghavyuva/nixopus/issues/508)) ([a3647c6](https://github.com/raghavyuva/nixopus/commit/a3647c6f47bc2a75b1367a146a13ed143daedfa6))
7+
8+
9+
10+
# [0.1.0-alpha.41](https://github.com/raghavyuva/nixopus/compare/v0.1.0-alpha.40...v0.1.0-alpha.41) (2025-10-16)
11+
12+
13+
### Bug Fixes
14+
15+
* security scan to have TRIVY_DISABLE_VEX_NOTICE ([43546b8](https://github.com/raghavyuva/nixopus/commit/43546b88b507aa776e2260d24a1ac68594630fe0))
16+
17+
18+
19+
# [0.1.0-alpha.40](https://github.com/raghavyuva/nixopus/compare/v0.1.0-alpha.39...v0.1.0-alpha.40) (2025-10-15)
20+
21+
22+
### Bug Fixes
23+
24+
* db getting wiped due to hosts permission issue, switches back to named docker maintained volumes ([#507](https://github.com/raghavyuva/nixopus/issues/507)) ([f8fd796](https://github.com/raghavyuva/nixopus/commit/f8fd7964da4c0a69b67c2696fd25694433238718))
25+
* update dockerfile to copy extensions templates folder in production ([5492582](https://github.com/raghavyuva/nixopus/commit/5492582a8c249cd1a169cb8c0ac9615cb67c2984))
26+
27+
28+
29+
# [0.1.0-alpha.39](https://github.com/raghavyuva/nixopus/compare/v0.1.0-alpha.38...v0.1.0-alpha.39) (2025-10-15)
30+
31+
32+
### Bug Fixes
33+
34+
* supertokens connection URI handling for ip addr and domains ([#503](https://github.com/raghavyuva/nixopus/issues/503)) ([9d62c8d](https://github.com/raghavyuva/nixopus/commit/9d62c8d1d3317a0fef008945e09982b0429ad487))
35+
36+
37+
38+
# [0.1.0-alpha.38](https://github.com/raghavyuva/nixopus/compare/v0.1.0-alpha.37...v0.1.0-alpha.38) (2025-10-15)
39+
40+
41+
### Bug Fixes
42+
43+
* extension step execution ([3b03319](https://github.com/raghavyuva/nixopus/commit/3b033195f4c856a3c050e8e5b7c8c79c329f1a5e))
44+
* overflow of descriptions with readmore option ([dab77db](https://github.com/raghavyuva/nixopus/commit/dab77db2868edd1eb49d81489e01579c5c61e2c2))
45+
* rbac permissions according to supertokens changes ([4c3db53](https://github.com/raghavyuva/nixopus/commit/4c3db539e37f497c96943c1b79e4d8b024cacca4))
46+
* search and sorting in extensions ([9558b28](https://github.com/raghavyuva/nixopus/commit/9558b28fd8715307a2358784c21cd33fb0256aef))
47+
* wrap extension page and sidebar in feature flag and rbac guards ([340ff69](https://github.com/raghavyuva/nixopus/commit/340ff696dec012a925603c92135e2530a9211da7))
48+
49+
50+
### Features
51+
52+
* add button for install / run in extension detail page ([e88d011](https://github.com/raghavyuva/nixopus/commit/e88d011988c82d79ba60290889a103b6cd605188))
53+
* add deploy templates ([1bd2fa0](https://github.com/raghavyuva/nixopus/commit/1bd2fa0c034bcdfb8a42db21543c7f2d9496ca01))
54+
* add migrations for extensions permissions, auditing, feature flags ([5d302ac](https://github.com/raghavyuva/nixopus/commit/5d302ac41128fedf21dbb9f09b5059bda41768a5))
55+
* add routes for listing extensions ([9a5e87a](https://github.com/raghavyuva/nixopus/commit/9a5e87a51b6b42216f58626a4b7e919fd7639cb4))
56+
* allow pagination search, sorting and integrate with view ([882c741](https://github.com/raghavyuva/nixopus/commit/882c74159ead7c01c6f4ee379fcc0ee3e264802a))
57+
* define migration for extensions ([a0c64aa](https://github.com/raghavyuva/nixopus/commit/a0c64aab8bdbba5107f4d3b60fe6ab6c460013b0))
58+
* display of status colors based on extension running ([9e490dc](https://github.com/raghavyuva/nixopus/commit/9e490dcce6598c72ea4364b1eb7af4d55279699c))
59+
* enable extension execution with run and cancel apis ([#455](https://github.com/raghavyuva/nixopus/issues/455)) ([9572671](https://github.com/raghavyuva/nixopus/commit/957267176c9804d8066ab6fe03f5d0563f467baa))
60+
* extension category as badges ([0e5d58d](https://github.com/raghavyuva/nixopus/commit/0e5d58ddf4da2ab678c6aa68786f35b7c6489a5a))
61+
* extension details ([#470](https://github.com/raghavyuva/nixopus/issues/470)) ([7fcee25](https://github.com/raghavyuva/nixopus/commit/7fcee25eaa17679a5828eb073fc438dafbd2c296))
62+
* extension discovery and saving to database on api init ([12661f0](https://github.com/raghavyuva/nixopus/commit/12661f0a6e97ea194688035c087597faa4b6cb91))
63+
* extension forking ([#464](https://github.com/raghavyuva/nixopus/issues/464)) ([76238a7](https://github.com/raghavyuva/nixopus/commit/76238a701835a5df4b8c810f4f21c8103625be70))
64+
* extensions ui design with dummy data ([798fef9](https://github.com/raghavyuva/nixopus/commit/798fef94b685e4280a872e56b75b5d85927d9e38))
65+
* log extension execution ([fac665f](https://github.com/raghavyuva/nixopus/commit/fac665f50fdcba7f2335ca573ca58dc72fd72f6e))
66+
* refactor extension executor ([9c89d61](https://github.com/raghavyuva/nixopus/commit/9c89d6103e1a9df938d0414846987163a9df537c))
67+
* rename extension permission migration files ([52d3331](https://github.com/raghavyuva/nixopus/commit/52d3331836ffa60dd3890e8c25cedf688d584942))
68+
69+
70+
171
# [0.1.0-alpha.37](https://github.com/raghavyuva/nixopus/compare/v0.1.0-alpha.36...v0.1.0-alpha.37) (2025-10-12)
272

373

api/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN go mod download
99

1010
COPY . .
1111
COPY ./migrations /app/migrations
12+
COPY ./templates /app/templates
1213

1314
RUN make build
1415

@@ -20,6 +21,7 @@ WORKDIR /app
2021

2122
COPY --from=builder /app/bin/nixopus-api .
2223
COPY --from=builder /app/migrations ./migrations
24+
COPY --from=builder /app/templates ./templates
2325

2426
RUN mkdir -p /etc/nixopus/ssh && \
2527
chmod 700 /etc/nixopus/ssh && \

api/Dockerfile.dev

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM golang:alpine
2+
ARG API_PORT=8443
3+
4+
# Install air for live reload
5+
RUN apk add --no-cache bash git curl make && \
6+
go install github.com/air-verse/air@latest
7+
8+
WORKDIR /app
9+
10+
# Pre-download dependencies
11+
COPY go.mod go.sum ./
12+
RUN go mod download
13+
COPY . .
14+
15+
# Source code is mounted via volume
16+
ENV PORT=${API_PORT}
17+
EXPOSE ${API_PORT}
18+
19+
# Use air with default config for live reload
20+
CMD ["air"]
21+

api/api/versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
{
44
"version": "v1",
55
"status": "active",
6-
"release_date": "2025-10-11T20:19:39.955308752+05:30",
6+
"release_date": "2025-10-15T21:35:07.482629937+05:30",
77
"end_of_life": "0001-01-01T00:00:00Z",
88
"changes": [
99
"Initial API version"
1010
]
1111
}
1212
]
13-
}
13+
}

api/doc/openapi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package controller
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/go-fuego/fuego"
7+
"github.com/raghavyuva/nixopus-api/internal/features/logger"
8+
)
9+
10+
func (c *ExtensionsController) DeleteFork(ctx fuego.ContextNoBody) (*struct {
11+
Status string `json:"status"`
12+
}, error) {
13+
id := ctx.PathParam("id")
14+
if id == "" {
15+
return nil, fuego.HTTPError{Err: nil, Status: http.StatusBadRequest}
16+
}
17+
if err := c.service.DeleteFork(id); err != nil {
18+
c.logger.Log(logger.Error, err.Error(), "")
19+
return nil, fuego.HTTPError{Err: err, Status: http.StatusBadRequest}
20+
}
21+
return &struct {
22+
Status string `json:"status"`
23+
}{Status: "ok"}, nil
24+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package controller
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/go-fuego/fuego"
7+
"github.com/raghavyuva/nixopus-api/internal/features/logger"
8+
"github.com/raghavyuva/nixopus-api/internal/types"
9+
)
10+
11+
type ForkExtensionRequest struct {
12+
YAMLContent *string `json:"yaml_content"`
13+
}
14+
15+
func (c *ExtensionsController) ForkExtension(ctx fuego.ContextWithBody[ForkExtensionRequest]) (types.Extension, error) {
16+
extensionID := ctx.PathParam("extension_id")
17+
if extensionID == "" {
18+
return types.Extension{}, fuego.HTTPError{Err: nil, Status: http.StatusBadRequest}
19+
}
20+
req, err := ctx.Body()
21+
if err != nil {
22+
return types.Extension{}, fuego.HTTPError{Err: err, Status: http.StatusBadRequest}
23+
}
24+
var yamlOverride string
25+
if req.YAMLContent != nil {
26+
yamlOverride = *req.YAMLContent
27+
}
28+
authorName := ""
29+
if userAny := ctx.Request().Context().Value(types.UserContextKey); userAny != nil {
30+
if u, ok := userAny.(*types.User); ok && u != nil {
31+
authorName = u.Username
32+
}
33+
}
34+
newExt, err := c.service.ForkExtension(extensionID, yamlOverride, authorName)
35+
if err != nil {
36+
c.logger.Log(logger.Error, err.Error(), "")
37+
return types.Extension{}, fuego.HTTPError{Err: err, Status: http.StatusInternalServerError}
38+
}
39+
return *newExt, nil
40+
}
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
package controller
2+
3+
import (
4+
"net/http"
5+
"strconv"
6+
7+
"github.com/go-fuego/fuego"
8+
"github.com/raghavyuva/nixopus-api/internal/features/logger"
9+
"github.com/raghavyuva/nixopus-api/internal/types"
10+
)
11+
12+
func (c *ExtensionsController) GetExtensions(ctx fuego.ContextNoBody) (*types.ExtensionListResponse, error) {
13+
params := types.ExtensionListParams{}
14+
15+
categoryParam := ctx.QueryParam("category")
16+
if categoryParam != "" {
17+
cat := types.ExtensionCategory(categoryParam)
18+
params.Category = &cat
19+
}
20+
21+
searchParam := ctx.QueryParam("search")
22+
if searchParam != "" {
23+
params.Search = searchParam
24+
}
25+
26+
if typeParam := ctx.QueryParam("type"); typeParam != "" {
27+
et := types.ExtensionType(typeParam)
28+
params.Type = &et
29+
}
30+
31+
sortByParam := ctx.QueryParam("sort_by")
32+
if sortByParam != "" {
33+
params.SortBy = types.ExtensionSortField(sortByParam)
34+
}
35+
36+
sortDirParam := ctx.QueryParam("sort_dir")
37+
if sortDirParam != "" {
38+
params.SortDir = types.SortDirection(sortDirParam)
39+
}
40+
41+
pageParam := ctx.QueryParam("page")
42+
if pageParam != "" {
43+
if page, err := strconv.Atoi(pageParam); err == nil && page > 0 {
44+
params.Page = page
45+
}
46+
}
47+
48+
pageSizeParam := ctx.QueryParam("page_size")
49+
if pageSizeParam != "" {
50+
if pageSize, err := strconv.Atoi(pageSizeParam); err == nil && pageSize > 0 {
51+
params.PageSize = pageSize
52+
}
53+
}
54+
55+
response, err := c.service.ListExtensions(params)
56+
if err != nil {
57+
c.logger.Log(logger.Error, err.Error(), "")
58+
return nil, fuego.HTTPError{
59+
Err: err,
60+
Status: http.StatusInternalServerError,
61+
}
62+
}
63+
64+
return response, nil
65+
}
66+
67+
func (c *ExtensionsController) GetCategories(ctx fuego.ContextNoBody) ([]types.ExtensionCategory, error) {
68+
cats, err := c.service.ListCategories()
69+
if err != nil {
70+
c.logger.Log(logger.Error, err.Error(), "")
71+
return nil, fuego.HTTPError{Err: err, Status: http.StatusInternalServerError}
72+
}
73+
return cats, nil
74+
}
75+
76+
func (c *ExtensionsController) GetExtension(ctx fuego.ContextNoBody) (types.Extension, error) {
77+
id := ctx.PathParam("id")
78+
if id == "" {
79+
return types.Extension{}, fuego.HTTPError{
80+
Err: nil,
81+
Status: http.StatusBadRequest,
82+
}
83+
}
84+
85+
extension, err := c.service.GetExtension(id)
86+
if err != nil {
87+
if err.Error() == "extension not found" {
88+
return types.Extension{}, fuego.HTTPError{
89+
Err: err,
90+
Status: http.StatusNotFound,
91+
}
92+
}
93+
c.logger.Log(logger.Error, err.Error(), "")
94+
return types.Extension{}, fuego.HTTPError{
95+
Err: err,
96+
Status: http.StatusInternalServerError,
97+
}
98+
}
99+
100+
return *extension, nil
101+
}
102+
103+
func (c *ExtensionsController) GetExtensionByExtensionID(ctx fuego.ContextNoBody) (types.Extension, error) {
104+
extensionID := ctx.PathParam("extension_id")
105+
if extensionID == "" {
106+
return types.Extension{}, fuego.HTTPError{
107+
Err: nil,
108+
Status: http.StatusBadRequest,
109+
}
110+
}
111+
112+
extension, err := c.service.GetExtensionByID(extensionID)
113+
if err != nil {
114+
if err.Error() == "extension not found" {
115+
return types.Extension{}, fuego.HTTPError{
116+
Err: err,
117+
Status: http.StatusNotFound,
118+
}
119+
}
120+
c.logger.Log(logger.Error, err.Error(), "")
121+
return types.Extension{}, fuego.HTTPError{
122+
Err: err,
123+
Status: http.StatusInternalServerError,
124+
}
125+
}
126+
127+
return *extension, nil
128+
}
129+
130+
func (c *ExtensionsController) GetExecution(ctx fuego.ContextNoBody) (*types.ExtensionExecution, error) {
131+
id := ctx.PathParam("execution_id")
132+
if id == "" {
133+
return nil, fuego.HTTPError{
134+
Err: nil,
135+
Status: http.StatusBadRequest,
136+
}
137+
}
138+
139+
exec, err := c.service.GetExecutionByID(id)
140+
if err != nil {
141+
c.logger.Log(logger.Error, err.Error(), "")
142+
return nil, fuego.HTTPError{
143+
Err: err,
144+
Status: http.StatusInternalServerError,
145+
}
146+
}
147+
return exec, nil
148+
}
149+
150+
func (c *ExtensionsController) ListExecutionsByExtensionID(ctx fuego.ContextNoBody) ([]types.ExtensionExecution, error) {
151+
extensionID := ctx.PathParam("extension_id")
152+
if extensionID == "" {
153+
return nil, fuego.HTTPError{
154+
Err: nil,
155+
Status: http.StatusBadRequest,
156+
}
157+
}
158+
execs, err := c.service.ListExecutionsByExtensionID(extensionID)
159+
if err != nil {
160+
c.logger.Log(logger.Error, err.Error(), "")
161+
return nil, fuego.HTTPError{
162+
Err: err,
163+
Status: http.StatusInternalServerError,
164+
}
165+
}
166+
return execs, nil
167+
}

0 commit comments

Comments
 (0)