@nocobase/cli 2.2.0-alpha.8 → 2.2.0-alpha.9

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.
@@ -489,6 +489,7 @@ function buildNginxManagedConfigBlock(context) {
489
489
  const v2PublicPathNoTrailingSlash = trimTrailingSlash(context.v2PublicPath);
490
490
  const apiBasePathNoTrailingSlash = trimTrailingSlash(context.apiBasePath);
491
491
  const appPublicPathNoTrailingSlash = trimTrailingSlash(context.appPublicPath);
492
+ const fileAccessPath = `${context.appPublicPath}files/`;
492
493
  const isRootMounted = context.appPublicPath === '/';
493
494
  const appPublicPathRedirectBlock = isRootMounted
494
495
  ? ''
@@ -526,6 +527,20 @@ function buildNginxManagedConfigBlock(context) {
526
527
  ` include ${context.snippetsDir}/proxy-location.conf;`,
527
528
  ' }',
528
529
  '',
530
+ ` location ^~ ${fileAccessPath} {`,
531
+ ` proxy_pass ${context.backendUrl};`,
532
+ ` include ${context.snippetsDir}/proxy-location.conf;`,
533
+ ' }',
534
+ ...(!isRootMounted
535
+ ? [
536
+ '',
537
+ ' location ^~ /files/ {',
538
+ ` proxy_pass ${context.backendUrl};`,
539
+ ` include ${context.snippetsDir}/proxy-location.conf;`,
540
+ ' }',
541
+ ]
542
+ : []),
543
+ '',
529
544
  ` location = ${apiBasePathNoTrailingSlash} {`,
530
545
  ` return 308 ${context.apiBasePath}$is_args$args;`,
531
546
  ' }',
@@ -1095,6 +1110,7 @@ function buildCaddyContextCommentLines(siteAddress, context, publicDir) {
1095
1110
  }
1096
1111
  function renderCaddyAppTemplate(siteAddress, context, publicDir) {
1097
1112
  const uploadsPath = `${context.appPublicPath}storage/uploads/`;
1113
+ const fileAccessPathMatcher = toCaddyPathMatcher(`${context.appPublicPath}files/`);
1098
1114
  const distPathMatcher = toCaddyPathMatcher(context.distPath);
1099
1115
  const uploadsPathMatcher = toCaddyPathMatcher(uploadsPath);
1100
1116
  const apiPathMatcher = toCaddyPathMatcher(context.apiBasePath);
@@ -1161,7 +1177,19 @@ function renderCaddyAppTemplate(siteAddress, context, publicDir) {
1161
1177
  ` reverse_proxy ${context.proxyHost}:${context.apiPort}`,
1162
1178
  ' }',
1163
1179
  '',
1164
- ' # Keep API and WS routes above the SPA fallbacks.',
1180
+ ' # Keep file, API and WS routes above the SPA fallbacks.',
1181
+ ` handle ${fileAccessPathMatcher} {`,
1182
+ ` reverse_proxy ${context.proxyHost}:${context.apiPort}`,
1183
+ ' }',
1184
+ ...(context.appPublicPath === DEFAULT_APP_PUBLIC_PATH
1185
+ ? []
1186
+ : [
1187
+ '',
1188
+ ' handle /files/* {',
1189
+ ` reverse_proxy ${context.proxyHost}:${context.apiPort}`,
1190
+ ' }',
1191
+ ]),
1192
+ '',
1165
1193
  ` handle ${apiPathMatcher} {`,
1166
1194
  ` reverse_proxy ${context.proxyHost}:${context.apiPort}`,
1167
1195
  ' }',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "2.2.0-alpha.8",
3
+ "version": "2.2.0-alpha.9",
4
4
  "description": "NocoBase Command Line Tool",
5
5
  "type": "module",
6
6
  "main": "dist/generated/command-registry.js",
@@ -144,5 +144,5 @@
144
144
  "type": "git",
145
145
  "url": "git+https://github.com/nocobase/nocobase.git"
146
146
  },
147
- "gitHead": "810c81e5963966bda7ec03b6453a3a80fe60e027"
147
+ "gitHead": "4949bf5ebcd92d77a3a0a718ed578c270e4bd570"
148
148
  }