Skip to content

Commit 8bbc135

Browse files
author
root
committed
improve my apps
1 parent a7fb0d9 commit 8bbc135

130 files changed

Lines changed: 14574 additions & 2273 deletions

File tree

Some content is hidden

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

Makefile

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
.PHONY: help install tidy build run test test-strict test-fast lint lint-strict lint-fast fmt fmt-strict fmt-fast check check-fast sec sec-strict sec-fast artifact-scan \
33
backend web backend-targeted backend-iac backend-software fast strict build-local latest dev \
4-
image start stop restart logs stats delete rm kill-port redo sync-store \
4+
image start stop restart logs stats delete rm kill-port redo sync-store tl \
55
openapi-gen openapi-merge openapi-check openapi-sync
66

77
# ============================================================
@@ -14,6 +14,7 @@ COMPOSE_CMD := cd build && docker compose
1414
# Support positional args: make kill-port 9091
1515
ARG2 := $(word 2,$(MAKECMDGOALS))
1616
ARG3 := $(word 3,$(MAKECMDGOALS))
17+
ARG4 := $(word 4,$(MAKECMDGOALS))
1718
QUALITY_MODE := $(if $(filter fast,$(ARG2) $(ARG3)),fast,strict)
1819
QUALITY_SCOPE := $(firstword $(filter-out fast,$(ARG2) $(ARG3)))
1920
GITLEAKS_ARGS := $(if $(CI),--redact,--no-git --redact)
@@ -93,6 +94,13 @@ help:
9394
@echo ""
9495
@printf "\033[36mUtilities:\033[0m\n"
9596
@echo " make kill-port 9091 Kill process using port"
97+
@echo " make tl Show template tooling commands"
98+
@echo " make tl validate Validate normalized templates"
99+
@echo " make tl validate wordpress Validate one normalized template sample"
100+
@echo " make tl ingress Render sample template ingress payload (default: wordpress)"
101+
@echo " make tl ingress wordpress Render sample template ingress payload for one template"
102+
@echo " make tl ingress wordpress TL_VALUES=templates/tests/examples/wordpress.values.json"
103+
@echo " make tl verify Run template validation and ingress rendering"
96104
@echo " make help Show this help"
97105
@echo ""
98106

@@ -257,12 +265,42 @@ run:
257265
@echo "Hot reload: copying pre-built artifacts..."
258266
@docker cp backend/appos $(CONTAINER):/usr/local/bin/appos
259267
@docker cp web/dist/. $(CONTAINER):/usr/share/nginx/html/web/
268+
@docker cp templates/apps/. $(CONTAINER):/appos/data/templates/apps/
260269
@docker cp build/nginx.conf $(CONTAINER):/etc/nginx/nginx.conf
261270
@docker exec $(CONTAINER) nginx -t
262271
@docker exec $(CONTAINER) supervisorctl -c /etc/supervisor/supervisord.conf restart appos nginx
263272
@echo "✓ Hot reload complete"
264273
@echo " → http://127.0.0.1:$(PORT_EFFECTIVE)/"
265274

275+
tl:
276+
ifeq ($(ARG2),validate)
277+
@echo "Running template validation..."
278+
@cd $(CURDIR) && python3 templates/tests/validate_templates.py $(ARG3)
279+
@echo "✓ Template validation completed"
280+
else ifeq ($(ARG2),ingress)
281+
@echo "Rendering template ingress payload..."
282+
@cd $(CURDIR) && python3 templates/tools/render_ingress_payload.py $(or $(ARG3),$(TL_TEMPLATE)) $(if $(TL_VALUES),--values $(TL_VALUES),)
283+
@echo "✓ Template ingress payload rendered"
284+
else ifeq ($(ARG2),verify)
285+
@echo "Running template verify flow..."
286+
@$(MAKE) tl validate $(ARG3)
287+
@$(MAKE) tl ingress $(or $(ARG3),wordpress)
288+
@echo "✓ Template verify flow completed"
289+
else
290+
@echo ""
291+
@printf "\033[1mTemplate Tooling Commands\033[0m\n"
292+
@echo "========================="
293+
@echo ""
294+
@echo " make tl validate"
295+
@echo " make tl validate wordpress"
296+
@echo " make tl ingress"
297+
@echo " make tl ingress wordpress"
298+
@echo " make tl ingress wordpress TL_VALUES=templates/tests/examples/wordpress.values.json"
299+
@echo " make tl verify"
300+
@echo " make tl verify wordpress"
301+
@echo ""
302+
endif
303+
266304
# ============================================================
267305
# Testing & Quality
268306
# ============================================================

Note.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,17 @@ addons 的 netdata restart 报错
150150

151151
数据初始化怎么做的?
152152

153-
rss hub 网站
153+
rss hub 网站
154+
155+
顶部增加一个搜索入口,它搜索主要是搜索页面
156+
157+
docker.1ms.run
158+
159+
数据库的随机密码,不应该太复杂。否则部署应用时,很慢
160+
161+
162+
163+
164+
1. queued 的 Action 没有显示在 actions list 中
165+
2. queued 的应用,竟然也是 installed
166+
3. Uninstall 也在等待一个 install running 的

backend/docs/openapi/api.yaml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,52 @@ paths:
846846
/api/actions:
847847
get:
848848
operationId: get_api_actions
849+
parameters:
850+
- in: query
851+
name: appId
852+
required: false
853+
schema:
854+
type: string
855+
- in: query
856+
name: excludeServer
857+
required: false
858+
schema:
859+
type: string
860+
- in: query
861+
name: excludeSource
862+
required: false
863+
schema:
864+
type: string
865+
- in: query
866+
name: excludeStatus
867+
required: false
868+
schema:
869+
type: string
870+
- in: query
871+
name: page
872+
required: false
873+
schema:
874+
type: string
875+
- in: query
876+
name: perPage
877+
required: false
878+
schema:
879+
type: string
880+
- in: query
881+
name: q
882+
required: false
883+
schema:
884+
type: string
885+
- in: query
886+
name: sortDir
887+
required: false
888+
schema:
889+
type: string
890+
- in: query
891+
name: sortField
892+
required: false
893+
schema:
894+
type: string
849895
responses:
850896
"200":
851897
content:
@@ -1193,6 +1239,60 @@ paths:
11931239
summary: Check install name availability
11941240
tags:
11951241
- Actions
1242+
/api/actions/install/template:
1243+
post:
1244+
operationId: post_api_actions_install_template
1245+
requestBody:
1246+
content:
1247+
application/json:
1248+
schema:
1249+
$ref: '#/components/schemas/GenericRequest'
1250+
required: false
1251+
responses:
1252+
"200":
1253+
content:
1254+
application/json:
1255+
schema:
1256+
$ref: '#/components/schemas/SuccessEnvelope'
1257+
description: OK
1258+
"401":
1259+
content:
1260+
application/json:
1261+
schema:
1262+
$ref: '#/components/schemas/ErrorEnvelope'
1263+
description: Unauthorized
1264+
security:
1265+
- bearerAuth: []
1266+
summary: Create or execute actions install template
1267+
tags:
1268+
- Actions
1269+
/api/actions/install/template/check:
1270+
post:
1271+
operationId: post_api_actions_install_template_check
1272+
requestBody:
1273+
content:
1274+
application/json:
1275+
schema:
1276+
$ref: '#/components/schemas/GenericRequest'
1277+
required: false
1278+
responses:
1279+
"200":
1280+
content:
1281+
application/json:
1282+
schema:
1283+
$ref: '#/components/schemas/SuccessEnvelope'
1284+
description: OK
1285+
"401":
1286+
content:
1287+
application/json:
1288+
schema:
1289+
$ref: '#/components/schemas/ErrorEnvelope'
1290+
description: Unauthorized
1291+
security:
1292+
- bearerAuth: []
1293+
summary: Create or execute actions install template check
1294+
tags:
1295+
- Actions
11961296
/api/ai-providers:
11971297
get:
11981298
operationId: get_api_ai-providers
@@ -3098,6 +3198,33 @@ paths:
30983198
summary: Get catalog apps by key deploy source
30993199
tags:
31003200
- Catalog
3201+
/api/catalog/apps/{key}/template:
3202+
get:
3203+
operationId: get_api_catalog_apps_key_template
3204+
parameters:
3205+
- in: path
3206+
name: key
3207+
required: true
3208+
schema:
3209+
type: string
3210+
responses:
3211+
"200":
3212+
content:
3213+
application/json:
3214+
schema:
3215+
$ref: '#/components/schemas/SuccessEnvelope'
3216+
description: OK
3217+
"401":
3218+
content:
3219+
application/json:
3220+
schema:
3221+
$ref: '#/components/schemas/ErrorEnvelope'
3222+
description: Unauthorized
3223+
security:
3224+
- bearerAuth: []
3225+
summary: Get catalog apps by key template
3226+
tags:
3227+
- Catalog
31013228
/api/catalog/categories:
31023229
get:
31033230
operationId: get_api_catalog_categories

backend/docs/openapi/ext-api.yaml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,52 @@ paths:
696696
tags: [Actions]
697697
summary: Get actions
698698
operationId: get_api_actions
699+
parameters:
700+
- name: appId
701+
in: query
702+
required: false
703+
schema:
704+
type: string
705+
- name: excludeServer
706+
in: query
707+
required: false
708+
schema:
709+
type: string
710+
- name: excludeSource
711+
in: query
712+
required: false
713+
schema:
714+
type: string
715+
- name: excludeStatus
716+
in: query
717+
required: false
718+
schema:
719+
type: string
720+
- name: page
721+
in: query
722+
required: false
723+
schema:
724+
type: string
725+
- name: perPage
726+
in: query
727+
required: false
728+
schema:
729+
type: string
730+
- name: q
731+
in: query
732+
required: false
733+
schema:
734+
type: string
735+
- name: sortDir
736+
in: query
737+
required: false
738+
schema:
739+
type: string
740+
- name: sortField
741+
in: query
742+
required: false
743+
schema:
744+
type: string
699745
security:
700746
- bearerAuth: [] # superuser required
701747
responses:
@@ -895,6 +941,58 @@ paths:
895941
schema:
896942
type: object
897943
additionalProperties: true
944+
/api/actions/install/template:
945+
post:
946+
tags: [Actions]
947+
summary: Create or execute actions install template
948+
operationId: post_api_actions_install_template
949+
requestBody:
950+
required: false
951+
content:
952+
application/json:
953+
schema:
954+
$ref: '#/components/schemas/GenericRequest'
955+
security:
956+
- bearerAuth: [] # superuser required
957+
responses:
958+
"200":
959+
description: OK
960+
content:
961+
application/json:
962+
schema:
963+
$ref: '#/components/schemas/SuccessEnvelope'
964+
"401":
965+
description: Unauthorized
966+
content:
967+
application/json:
968+
schema:
969+
$ref: '#/components/schemas/ErrorEnvelope'
970+
/api/actions/install/template/check:
971+
post:
972+
tags: [Actions]
973+
summary: Create or execute actions install template check
974+
operationId: post_api_actions_install_template_check
975+
requestBody:
976+
required: false
977+
content:
978+
application/json:
979+
schema:
980+
$ref: '#/components/schemas/GenericRequest'
981+
security:
982+
- bearerAuth: [] # superuser required
983+
responses:
984+
"200":
985+
description: OK
986+
content:
987+
application/json:
988+
schema:
989+
$ref: '#/components/schemas/SuccessEnvelope'
990+
"401":
991+
description: Unauthorized
992+
content:
993+
application/json:
994+
schema:
995+
$ref: '#/components/schemas/ErrorEnvelope'
898996
/api/actions/{id}:
899997
delete:
900998
tags: [Actions]
@@ -2818,6 +2916,32 @@ paths:
28182916
application/json:
28192917
schema:
28202918
$ref: '#/components/schemas/ErrorEnvelope'
2919+
/api/catalog/apps/{key}/template:
2920+
get:
2921+
tags: [Catalog]
2922+
summary: Get catalog apps by key template
2923+
operationId: get_api_catalog_apps_key_template
2924+
parameters:
2925+
- name: key
2926+
in: path
2927+
required: true
2928+
schema:
2929+
type: string
2930+
security:
2931+
- bearerAuth: []
2932+
responses:
2933+
"200":
2934+
description: OK
2935+
content:
2936+
application/json:
2937+
schema:
2938+
$ref: '#/components/schemas/SuccessEnvelope'
2939+
"401":
2940+
description: Unauthorized
2941+
content:
2942+
application/json:
2943+
schema:
2944+
$ref: '#/components/schemas/ErrorEnvelope'
28212945
/api/catalog/categories:
28222946
get:
28232947
tags: [Catalog]

0 commit comments

Comments
 (0)