gina 0.1.6-alpha.11 → 0.1.6-alpha.110
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.
- package/LICENSE +1 -1
- package/README-4Contributors.md +14 -8
- package/README.md +4 -4
- package/bin/cli +14 -0
- package/bin/gina +29 -1
- package/framework/{v0.1.6-alpha.11/lib/inherits → v0.1.6-alpha.110}/LICENSE +1 -1
- package/framework/v0.1.6-alpha.110/VERSION +1 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/plugin/README.md +1 -0
- package/framework/v0.1.6-alpha.110/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/plugin/dist/vendor/gina/js/gina.js +582 -217
- package/framework/v0.1.6-alpha.110/core/asset/plugin/dist/vendor/gina/js/gina.min.js +777 -0
- package/framework/v0.1.6-alpha.110/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
- package/framework/v0.1.6-alpha.110/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +8 -0
- package/framework/v0.1.6-alpha.110/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/config.js +157 -80
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/index.js +105 -25
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/connector.v4.js +124 -22
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/controller/controller.js +653 -160
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/controller/index.js +2 -2
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/.github/workflows/ci.yml +24 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/.github/workflows/lint.yml +23 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/README.md +191 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +149 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +143 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +154 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +148 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/lib/index.js +57 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/lib/types/multipart.js +680 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/lib/types/urlencoded.js +350 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/lib/utils.js +596 -0
- package/framework/v0.1.6-alpha.110/core/deps/busboy-1.6.0/package.json +22 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/.travis.yml +4 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/LICENSE +21 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/bool.js +10 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/boolean_double.js +7 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/boolean_single.js +7 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/default_hash.js +8 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/default_singles.js +7 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/divide.js +8 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/line_count.js +20 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/line_count_options.js +29 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/line_count_wrap.js +29 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/nonopt.js +4 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/reflect.js +2 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/short.js +3 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/string.js +11 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/usage-options.js +19 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/example/xup.js +10 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/index.js +343 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/package.json +31 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/package.json.dist +39 -0
- package/framework/v0.1.6-alpha.110/core/deps/optimist-0.6.1/readme.markdown +513 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/HISTORY.md +498 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/LICENSE +7 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/README.md +88 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/bin/swig.js +161 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/bin/swig.js.dist +161 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/dist/swig.min.js +7 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/dist/swig.min.js.map +8 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/index.js +1 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/dateformatter.js +198 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/filters.js +630 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/lexer.js +306 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/loaders/filesystem.js +59 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/loaders/index.js +53 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/loaders/memory.js +63 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/parser.js +744 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/swig.js +740 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/autoescape.js +37 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/block.js +25 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/else.js +25 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/elseif.js +28 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/extends.js +19 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/filter.js +68 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/for.js +130 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/if.js +86 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/import.js +91 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/include.js +100 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/index.js +16 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/macro.js +79 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/parent.js +51 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/raw.js +23 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/set.js +109 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/tags/spaceless.js +42 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/lib/utils.js +184 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/package.json +57 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-1.4.2/package.json.dist +61 -0
- package/framework/v0.1.6-alpha.110/core/deps/swig-client/swig.js +5031 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/dev/index.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/dev/lib/factory.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/gna.js +104 -22
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/index.js +3 -3
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/src/make.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/mime.types +1 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/model/entity.js +5 -5
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/model/index.js +30 -26
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/model/template/entityFactory.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/model/template/index.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/index.js +3 -3
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/file/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/intl/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/storage/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/validator/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/validator/src/form-validator.js +39 -27
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/validator/src/main.js +360 -85
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/router.js +92 -47
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/server.isaac.js +91 -10
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/server.js +305 -129
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/status.codes +1 -11
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/controllers/setup.js +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/command/gina.tpl +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/conf/env.json +19 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/conf/templates.json +4 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/console.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/context.js +29 -12
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/data/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/data/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/dateFormat.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/index.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/json/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/json/src/main.js +6 -4
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/path.js +31 -15
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/plugins/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/plugins/src/api-error.js +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/plugins/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/task.js +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/text.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/archiver/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/archiver/src/main.js +11 -11
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/add.js +2 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/start.js +21 -8
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/get.js +1 -1
- package/framework/v0.1.6-alpha.110/lib/cmd/env/help.js +30 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/build.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/init.js +18 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/link-node-modules.js +2 -3
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/link.js +1 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/tail.js +28 -11
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/version.js +15 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/helper.js +6 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/index.js +1 -1
- package/framework/v0.1.6-alpha.110/lib/cmd/minion/help.txt +18 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/add.js +3 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/build.js +4 -4
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/list.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/protocol/list.js +71 -50
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/collection/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/collection/src/main.js +20 -14
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/config.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cron/package.json +2 -2
- package/framework/v0.1.6-alpha.110/lib/domain/dist/2025-03-14_13-41-20_UTC.dat +15754 -0
- package/framework/v0.1.6-alpha.110/lib/domain/dist/public_suffix_list.dat +15754 -0
- package/framework/v0.1.6-alpha.110/lib/domain/exemples/backend.js +12 -0
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/domain/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/domain/src/main.js +20 -6
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/generator/index.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/index.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110/lib/inherits}/LICENSE +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/inherits/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/inherits/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/containers/mq/listener.js +10 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/helper.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/main.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/math/index.js +1 -1
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/merge/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/model.js +3 -3
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/proc.js +10 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/routing/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/routing/src/main.js +72 -25
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/session-store.js +3 -3
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/swig-filters/package.json +2 -2
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/swig-filters/src/main.js +70 -15
- package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/validator.js +2 -2
- package/framework/v0.1.6-alpha.110/package.json +11 -0
- package/package.json +3 -3
- package/resources/package.json.template +1 -1
- package/script/post_install.js +1 -1
- package/script/pre_install.js +1 -1
- package/utils/helper.js +24 -0
- package/framework/v0.1.6-alpha.11/VERSION +0 -1
- package/framework/v0.1.6-alpha.11/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
- package/framework/v0.1.6-alpha.11/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -766
- package/framework/v0.1.6-alpha.11/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
- package/framework/v0.1.6-alpha.11/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -7
- package/framework/v0.1.6-alpha.11/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
- package/framework/v0.1.6-alpha.11/core/deps/busboy/.travis.yml +0 -17
- package/framework/v0.1.6-alpha.11/core/deps/busboy/README.md +0 -225
- package/framework/v0.1.6-alpha.11/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -73
- package/framework/v0.1.6-alpha.11/core/deps/busboy/deps/encoding/encoding.js +0 -2391
- package/framework/v0.1.6-alpha.11/core/deps/busboy/lib/main.js +0 -89
- package/framework/v0.1.6-alpha.11/core/deps/busboy/lib/types/multipart.js +0 -328
- package/framework/v0.1.6-alpha.11/core/deps/busboy/lib/types/urlencoded.js +0 -214
- package/framework/v0.1.6-alpha.11/core/deps/busboy/lib/utils.js +0 -191
- package/framework/v0.1.6-alpha.11/core/deps/busboy/package.json +0 -69
- package/framework/v0.1.6-alpha.11/lib/domain/dist/public_suffix_list.dat +0 -14186
- package/framework/v0.1.6-alpha.11/lib/domain/exemples/backend.js +0 -0
- package/framework/v0.1.6-alpha.11/package.json +0 -14
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/AUTHORS +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/html/nolayout.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/html/static.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/img/android-chrome-192x192.png +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/img/android-chrome-512x512.png +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/img/apple-touch-icon.png +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/img/favicon-16x16.png +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/img/favicon-32x32.png +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/img/favicon.ico +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/asset/plugin/uuid.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/connector.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/connector.v2.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/connector.v3.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/n1ql.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/session-store.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/controller/controller.framework.js +0 -0
- /package/framework/{v0.1.6-alpha.11/core/deps/busboy → v0.1.6-alpha.110/core/deps/busboy-1.6.0}/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/dev/lib/class.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/dev/lib/tools.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/currency.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/dist/language/en.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/dist/language/fr.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/dist/region/en.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/dist/region/fr.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/src/resources/currency.csv +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/src/resources/region.csv +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/locales/src/resources/region.mapping.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/file/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/file/build.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/intl/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/intl/build.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/intl/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/storage/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/storage/build.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/storage/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/validator/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/plugins/lib/validator/build.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/server.express.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/_gitignore +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/config/app.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/config/routing.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/config/settings.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/config/templates.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle/index.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_public/css/default.css +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_public/readme.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/command/gina.bat.tpl +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/conf/manifest.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/conf/package.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/conf/settings.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/conf/statics.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/error/client/json/401.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/error/client/json/403.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/error/client/json/404.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/error/server/html/50x.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/error/server/json/500.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/error/server/json/503.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/core/template/extensions/logger/config.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/data/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/data/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/json/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/json/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/plugins/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/helpers/prototypes.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/archiver/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/archiver/build.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/archiver/src/dep/jszip.min.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/aliases.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/arguments.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/copy.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/cp.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/help.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/list.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/rename.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/status.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/bundle/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/add.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/link-dev.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/list.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/set.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/unset.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/env/use.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/dot.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/get.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/help.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/msg.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/open.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/set.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/start.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/status.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/framework/update.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/gina-dev.1.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/gina-framework.1.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/gina.1.md +0 -0
- /package/framework/{v0.1.6-alpha.11/lib/cmd/env → v0.1.6-alpha.110/lib/cmd/minion}/help.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/msg.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/port/help.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/port/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/port/inc/scan.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/port/list.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/port/reset.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/port/set.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/arguments.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/help.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/import.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/move.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/rename.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/restart.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/start.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/status.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/project/stop.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/protocol/help.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/protocol/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/protocol/set.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/add.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/help.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/help.txt +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/link-local.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/link-production.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/list.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/remove.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/rm.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/scope/use.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cmd/view/add.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/collection/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/collection/build.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cron/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/cron/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/domain/LICENSE +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/domain/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/domain/exemples/frontend.html +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/inherits/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/inherits/example/protected_inheritance.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/inherits/example/simple_inheritance.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/containers/default/index.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/containers/file/index.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/containers/mq/index.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/logger/src/containers/mq/speaker.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/merge/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/merge/example/merge.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/merge/example/merge_2_literal objects.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/merge/example/merge_and_preserve_first.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/merge/src/main.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/routing/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/routing/build.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/shell.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/swig-filters/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/url/README.md +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/url/index.js +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/url/mocks.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/url/routing.json +0 -0
- /package/framework/{v0.1.6-alpha.11 → v0.1.6-alpha.110}/lib/url/test.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
3
|
* This file is part of the gina package.
|
|
4
|
-
* Copyright (c) 2009-
|
|
4
|
+
* Copyright (c) 2009-2025 Rhinostone <contact@gina.io>
|
|
5
5
|
*
|
|
6
6
|
* For the full copyright and license information, please view the LICENSE
|
|
7
7
|
* file that was distributed with this source code.
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
//Imports.
|
|
11
11
|
var fs = require('fs');
|
|
12
12
|
const {promises: {readFile}} = require("fs");
|
|
13
|
+
const exec = require('child_process').exec;
|
|
13
14
|
var util = require('util');
|
|
14
15
|
var promisify = util.promisify;
|
|
15
16
|
var EventEmitter = require('events').EventEmitter;
|
|
16
|
-
var zlib = require('zlib');
|
|
17
|
+
var zlib = require('zlib'); // Included with NodeJS
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
const { Resolver } = require('node:dns').promises;
|
|
20
|
+
const resolver = new Resolver();
|
|
19
21
|
// var tls = require('tls');
|
|
20
22
|
// var crypto = require('crypto');
|
|
21
23
|
|
|
@@ -25,9 +27,10 @@ var inherits = lib.inherits;
|
|
|
25
27
|
var console = lib.logger;
|
|
26
28
|
var Collection = lib.Collection;
|
|
27
29
|
var routingLib = lib.routing;
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
var Domain = lib.Domain;
|
|
31
|
+
var domainLib = new Domain();
|
|
32
|
+
var swig = require('./../deps/swig-1.4.2');
|
|
33
|
+
const { type } = require('node:os');
|
|
31
34
|
var SwigFilters = lib.SwigFilters;
|
|
32
35
|
var statusCodes = requireJSON( _( getPath('gina').core + '/status.codes') );
|
|
33
36
|
|
|
@@ -68,24 +71,19 @@ function SuperController(options) {
|
|
|
68
71
|
var init = function() {
|
|
69
72
|
|
|
70
73
|
if ( typeof(SuperController.initialized) != 'undefined' ) {
|
|
71
|
-
return getInstance()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
SuperController.instance = self;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
if (local.options) {
|
|
78
|
-
SuperController.instance._options = local.options;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
SuperController.initialized = true;
|
|
74
|
+
return getInstance();
|
|
75
|
+
}
|
|
82
76
|
|
|
77
|
+
SuperController.instance = self;
|
|
78
|
+
if (local.options) {
|
|
79
|
+
SuperController.instance._options = local.options;
|
|
83
80
|
}
|
|
81
|
+
SuperController.initialized = true;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
var getInstance = function() {
|
|
87
85
|
local.options = SuperController.instance._options = options;
|
|
88
|
-
// 2022-03-07
|
|
86
|
+
// Fixed on 2022-03-07 for none-developpement environnements (without cache)
|
|
89
87
|
self._options = local.options;
|
|
90
88
|
|
|
91
89
|
return SuperController.instance;
|
|
@@ -240,12 +238,12 @@ function SuperController(options) {
|
|
|
240
238
|
|
|
241
239
|
if ( /^:/.test(value) ) {
|
|
242
240
|
str = 'page.view.params.'+ key + '.';
|
|
243
|
-
set(str.
|
|
241
|
+
set(str.substring(0, str.length-1), req.params[value.substring(1)]);
|
|
244
242
|
} else if (/^(file|title)$/.test(key)) {
|
|
245
243
|
str = 'page.view.'+ key + '.';
|
|
246
|
-
set(str.
|
|
244
|
+
set(str.substring(0, str.length-1), value);
|
|
247
245
|
} else {
|
|
248
|
-
set(str.
|
|
246
|
+
set(str.substring(0, str.length-1), value)
|
|
249
247
|
}
|
|
250
248
|
|
|
251
249
|
str = 'page.'
|
|
@@ -322,10 +320,24 @@ function SuperController(options) {
|
|
|
322
320
|
|
|
323
321
|
var ctx = getContext('gina');
|
|
324
322
|
// new declaration && overrides
|
|
323
|
+
var arch = process.arch;
|
|
324
|
+
switch (process.arch) {
|
|
325
|
+
case 'x64':
|
|
326
|
+
arch = 'amd64'
|
|
327
|
+
break;
|
|
328
|
+
case 'armv7l':
|
|
329
|
+
arch = 'armhf'
|
|
330
|
+
break;
|
|
331
|
+
case 'x86':
|
|
332
|
+
arch = 'i386'
|
|
333
|
+
break;
|
|
334
|
+
default:
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
325
337
|
var version = {
|
|
326
338
|
"number" : ctx.version,
|
|
327
339
|
"platform" : process.platform,
|
|
328
|
-
"arch" :
|
|
340
|
+
"arch" : arch,
|
|
329
341
|
"nodejs" : process.versions.node,
|
|
330
342
|
"middleware" : ctx.middleware
|
|
331
343
|
};
|
|
@@ -336,15 +348,124 @@ function SuperController(options) {
|
|
|
336
348
|
set('page.environment.gina pid', GINA_PID);
|
|
337
349
|
set('page.environment.nodejs', version.nodejs +' '+ version.platform +' '+ version.arch);
|
|
338
350
|
set('page.environment.engine', options.conf.server.engine);//version.middleware
|
|
351
|
+
set('page.environment.uvThreadpoolSize', process.env.UV_THREADPOOL_SIZE);
|
|
339
352
|
set('page.environment.env', process.env.NODE_ENV);
|
|
340
|
-
set('page.environment.envIsDev',
|
|
353
|
+
set('page.environment.envIsDev', /^true$/i.test(process.env.NODE_ENV_IS_DEV) );
|
|
341
354
|
set('page.environment.scope', process.env.NODE_SCOPE);
|
|
342
355
|
set('page.environment.scopeIsLocal', /^true$/i.test(process.env.NODE_SCOPE_IS_LOCAL) );
|
|
343
356
|
set('page.environment.scopeIsProduction', /^true$/i.test(process.env.NODE_SCOPE_IS_PRODUCTION) );
|
|
344
357
|
set('page.environment.date.now', new Date().format("isoDateTime"));
|
|
358
|
+
set('page.environment.isCacheless', self.isCacheless());
|
|
359
|
+
|
|
360
|
+
// var requestPort = req.headers.port || req.headers[':port'];
|
|
361
|
+
// var isProxyHost = (
|
|
362
|
+
// typeof(req.headers.host) != 'undefined'
|
|
363
|
+
// && typeof(requestPort) != 'undefined'
|
|
364
|
+
// && /^(80|443)$/.test(requestPort)
|
|
365
|
+
// && local.options.conf.server.scheme +'://'+ req.headers.host +':'+ requestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
|
|
366
|
+
// ||
|
|
367
|
+
// typeof(req.headers[':authority']) != 'undefined'
|
|
368
|
+
// && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname
|
|
369
|
+
// ||
|
|
370
|
+
// typeof(req.headers.host) != 'undefined'
|
|
371
|
+
// && typeof(requestPort) != 'undefined'
|
|
372
|
+
// && /^(80|443)$/.test(requestPort)
|
|
373
|
+
// && req.headers.host == local.options.conf.host
|
|
374
|
+
// ||
|
|
375
|
+
// typeof(req.headers['x-nginx-proxy']) != 'undefined'
|
|
376
|
+
// && /^true$/i.test(req.headers['x-nginx-proxy'])
|
|
377
|
+
// ) ? true : false;
|
|
378
|
+
// setContext('isProxyHost', isProxyHost);
|
|
379
|
+
var isProxyHost = getContext('isProxyHost') || false;
|
|
380
|
+
set('page.environment.isProxyHost', isProxyHost);
|
|
381
|
+
if ( /^true$/.test(isProxyHost) ) {
|
|
382
|
+
set('page.environment.proxyHost', process.gina.PROXY_HOST);
|
|
383
|
+
set('page.environment.proxyHostname', process.gina.PROXY_HOSTNAME);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
var _config = ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV];
|
|
387
|
+
// by default
|
|
388
|
+
var hostname = _config.hostname + _config.server.webroot;
|
|
389
|
+
var scheme = hostname.match(/^(https|http)/)[0];
|
|
390
|
+
var requestPort = (local.req.headers.port||local.req.headers[':port']);
|
|
391
|
+
|
|
392
|
+
var hostPort = hostname.match(/(\:d+\/|\:\d+)$/);
|
|
393
|
+
hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : _config.port[_config.server.protocol][_config.server.scheme];
|
|
394
|
+
// Linking bundle B from bundle A wihtout proxy
|
|
395
|
+
var isSpecialCase = (
|
|
396
|
+
getContext('bundle') != _config.bundle
|
|
397
|
+
&& requestPort != hostPort
|
|
398
|
+
&& local.req.headers[':host'] != process.gina.PROXY_HOST
|
|
399
|
+
) ? true : false;
|
|
345
400
|
|
|
401
|
+
if (isSpecialCase) {
|
|
402
|
+
hostname = _config.hostname;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// if (
|
|
406
|
+
// isProxyHost
|
|
407
|
+
// && !isSpecialCase
|
|
408
|
+
// ) {
|
|
409
|
+
// // Rewrite hostname vs req.headers.host
|
|
410
|
+
// hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
|
|
411
|
+
|
|
412
|
+
// if (
|
|
413
|
+
// !/^(80|443)$/.test(requestPort)
|
|
414
|
+
// && !new RegExp(requestPort+'$').test(hostname)
|
|
415
|
+
// ) {
|
|
416
|
+
// hostname += ':'+ requestPort;
|
|
417
|
+
// }
|
|
418
|
+
// }
|
|
419
|
+
|
|
420
|
+
set('page.environment.hostname', hostname);
|
|
421
|
+
// Updating _config.rootDomain - 2024/04/15
|
|
422
|
+
// _config.rootDomain = domainLib.getRootDomain(hostname).value;
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
set('page.environment.rootDomain', _config.rootDomain);
|
|
426
|
+
set('page.environment.webroot', options.conf.server.webroot);
|
|
427
|
+
|
|
428
|
+
if ( typeof(ctx.config.envConf._isRoutingUpdateNeeded) == 'undefined') {
|
|
429
|
+
ctx.config.envConf._isRoutingUpdateNeeded = false;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if (
|
|
433
|
+
typeof(ctx.config.envConf._proxyHostname) == 'undefined'
|
|
434
|
+
||
|
|
435
|
+
hostname != ctx.config.envConf._proxyHostname
|
|
436
|
+
) {
|
|
437
|
+
ctx.config.envConf._proxyHostname = (isProxyHost) ? hostname : null;
|
|
438
|
+
ctx.config.envConf._isRoutingUpdateNeeded = true;
|
|
439
|
+
}
|
|
346
440
|
|
|
347
|
-
|
|
441
|
+
if ( typeof(ctx.config.envConf._routingCloned) == 'undefined' ) {
|
|
442
|
+
ctx.config.envConf._routingCloned = JSON.clone(ctx.config.envConf.routing);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
var routing = local.options.conf.routing = ctx.config.envConf._routingCloned; // all routes
|
|
446
|
+
if ( /^true$/i.test(ctx.config.envConf._isRoutingUpdateNeeded) ) {
|
|
447
|
+
|
|
448
|
+
for (let r in ctx.config.envConf.routing) {
|
|
449
|
+
if ( isProxyHost ) {
|
|
450
|
+
local.options.conf.routing[r].host = hostname.replace(/^(https|http)\:\/\//, '');
|
|
451
|
+
local.options.conf.routing[r].hostname = hostname;
|
|
452
|
+
let scheme = hostname.match(/^(https|http)/)[0];
|
|
453
|
+
local.options.conf.routing[r].hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
|
|
454
|
+
let requestPort = (local.req.headers.port||local.req.headers[':port']);
|
|
455
|
+
if (
|
|
456
|
+
!/^(80|443)$/.test(requestPort)
|
|
457
|
+
&& !new RegExp(requestPort+'$').test(local.options.conf.routing[r].hostname)
|
|
458
|
+
) {
|
|
459
|
+
local.options.conf.routing[r].hostname += ':'+ requestPort
|
|
460
|
+
}
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
local.options.conf.routing[r].host = ctx.config.envConf.routing[r].host;
|
|
464
|
+
local.options.conf.routing[r].hostname = ctx.config.envConf.routing[r].hostname;
|
|
465
|
+
}
|
|
466
|
+
ctx.config.envConf._isRoutingUpdateNeeded = false;
|
|
467
|
+
|
|
468
|
+
}
|
|
348
469
|
set('page.environment.routing', encodeRFC5987ValueChars(JSON.stringify(routing))); // export for GFF
|
|
349
470
|
//reverseRouting
|
|
350
471
|
var reverseRouting = local.options.conf.reverseRouting = ctx.config.envConf.reverseRouting; // all routes
|
|
@@ -354,9 +475,8 @@ function SuperController(options) {
|
|
|
354
475
|
set('page.environment.forms', encodeRFC5987ValueChars(JSON.stringify(forms))); // export for GFF
|
|
355
476
|
set('page.forms', options.conf.content.forms);
|
|
356
477
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
set('page.environment.webroot', options.conf.server.webroot);
|
|
478
|
+
|
|
479
|
+
|
|
360
480
|
set('page.environment.bundle', options.conf.bundle);
|
|
361
481
|
set('page.environment.project', options.conf.projectName);
|
|
362
482
|
set('page.environment.protocol', options.conf.server.protocol);
|
|
@@ -426,7 +546,7 @@ function SuperController(options) {
|
|
|
426
546
|
// user locale
|
|
427
547
|
options.conf.locale = new Collection(userLocales).findOne({ short: userCountryCode }) || {};
|
|
428
548
|
|
|
429
|
-
//
|
|
549
|
+
// current date
|
|
430
550
|
if ( typeof(options.conf.locale) == 'undefined' || !options.conf.locale ) {
|
|
431
551
|
options.conf.locale = {}
|
|
432
552
|
}
|
|
@@ -437,11 +557,6 @@ function SuperController(options) {
|
|
|
437
557
|
set('page.view.lang', userCulture);
|
|
438
558
|
}
|
|
439
559
|
|
|
440
|
-
if ( !getContext('isProxyHost') ) {
|
|
441
|
-
var isProxyHost = ( typeof(req.headers.host) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers.host != local.options.conf.hostname || typeof(req.headers[':authority']) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname ) ? true : false;
|
|
442
|
-
setContext('isProxyHost', isProxyHost);
|
|
443
|
-
isProxyHost = null;
|
|
444
|
-
}
|
|
445
560
|
|
|
446
561
|
//TODO - detect when to use swig
|
|
447
562
|
var dir = null;
|
|
@@ -451,7 +566,7 @@ function SuperController(options) {
|
|
|
451
566
|
var swigOptions = {
|
|
452
567
|
autoescape : ( typeof(local.options.autoescape) != 'undefined') ? local.options.autoescape : false,
|
|
453
568
|
// `memory` is no working yet ... advanced rendering setup required
|
|
454
|
-
// cache : (local.options.
|
|
569
|
+
// cache : (local.options.isCacheless) ? false : 'memory'
|
|
455
570
|
cache : false
|
|
456
571
|
};
|
|
457
572
|
if (dir) {
|
|
@@ -498,7 +613,7 @@ function SuperController(options) {
|
|
|
498
613
|
* Extend default filters
|
|
499
614
|
* - length
|
|
500
615
|
*
|
|
501
|
-
*
|
|
616
|
+
* Available filters:
|
|
502
617
|
* - getWebroot()
|
|
503
618
|
* - getUrl()
|
|
504
619
|
*
|
|
@@ -839,12 +954,28 @@ function SuperController(options) {
|
|
|
839
954
|
return;
|
|
840
955
|
}
|
|
841
956
|
|
|
957
|
+
var localRequestPort = local.req.headers.port || local.req.headers[':port'];
|
|
842
958
|
var isProxyHost = (
|
|
843
959
|
typeof(local.req.headers.host) != 'undefined'
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
960
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
961
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
962
|
+
&& localOptions.conf.server.scheme +'://'+ local.req.headers.host+':'+ localRequestPort != localOptions.conf.hostname.replace(/\:\d+$/, '') +':'+ localOptions.conf.server.port
|
|
963
|
+
||
|
|
964
|
+
typeof(local.req.headers[':authority']) != 'undefined'
|
|
965
|
+
&& localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname
|
|
966
|
+
||
|
|
967
|
+
typeof(local.req.headers.host) != 'undefined'
|
|
968
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
969
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
970
|
+
&& local.req.headers.host == localOptions.conf.host
|
|
971
|
+
||
|
|
972
|
+
typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
|
|
973
|
+
&& /^true$/i.test(local.req.headers['x-nginx-proxy'])
|
|
974
|
+
||
|
|
975
|
+
typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
|
|
847
976
|
) ? true : false;
|
|
977
|
+
|
|
978
|
+
|
|
848
979
|
// setup swig default filters
|
|
849
980
|
var filters = SwigFilters({
|
|
850
981
|
options : JSON.clone(localOptions),
|
|
@@ -883,6 +1014,7 @@ function SuperController(options) {
|
|
|
883
1014
|
, XHRData = null
|
|
884
1015
|
, XHRView = null
|
|
885
1016
|
, isDeferModeEnabled = null
|
|
1017
|
+
, hasExternalsPlugins = null
|
|
886
1018
|
, viewInfos = null
|
|
887
1019
|
, filename = null
|
|
888
1020
|
, isWithSwigLayout = null
|
|
@@ -898,7 +1030,9 @@ function SuperController(options) {
|
|
|
898
1030
|
if (isWithoutLayout) {
|
|
899
1031
|
data.page.view.layout = layoutPath;
|
|
900
1032
|
}
|
|
901
|
-
}
|
|
1033
|
+
}
|
|
1034
|
+
// without layout case
|
|
1035
|
+
else {
|
|
902
1036
|
|
|
903
1037
|
// by default
|
|
904
1038
|
layoutPath = localOptions.template.layout;
|
|
@@ -926,10 +1060,8 @@ function SuperController(options) {
|
|
|
926
1060
|
self.throwError(err);
|
|
927
1061
|
return;
|
|
928
1062
|
}
|
|
929
|
-
|
|
930
1063
|
}
|
|
931
1064
|
|
|
932
|
-
|
|
933
1065
|
var isLoadingPartial = false;
|
|
934
1066
|
try {
|
|
935
1067
|
assets = {assets:"${assets}"};
|
|
@@ -1023,6 +1155,7 @@ function SuperController(options) {
|
|
|
1023
1155
|
// }
|
|
1024
1156
|
|
|
1025
1157
|
isDeferModeEnabled = localOptions.template.javascriptsDeferEnabled || localOptions.conf.content.templates._common.javascriptsDeferEnabled || false;
|
|
1158
|
+
hasExternalsPlugins = (localOptions.template.externalPlugins.length > 0) ? true : false;
|
|
1026
1159
|
|
|
1027
1160
|
// iframe case - without HTML TAG
|
|
1028
1161
|
if (!self.isXMLRequest() && !/\<html/.test(layout) ) {
|
|
@@ -1092,8 +1225,8 @@ function SuperController(options) {
|
|
|
1092
1225
|
+ '{%- set userDataInspector.view.scripts = "ignored-by-toolbar" -%}'
|
|
1093
1226
|
+ '{%- set userDataInspector.view.stylesheets = "ignored-by-toolbar" -%}'
|
|
1094
1227
|
+ '{%- set userDataInspector.view.assets = '+ JSON.stringify(assets) +' -%}'
|
|
1095
|
-
+ '{%- include "'+ getPath('gina').core +'/asset/plugin/dist/vendor/gina/html/toolbar.html" with { gina: ginaDataInspector, user: userDataInspector } -%}'// jshint ignore:line
|
|
1096
1228
|
+ '{# END Gina Toolbar #}'
|
|
1229
|
+
+ '{%- include "'+ getPath('gina').core +'/asset/plugin/dist/vendor/gina/html/toolbar.html" with { gina: ginaDataInspector, user: userDataInspector } -%}'// jshint ignore:line
|
|
1097
1230
|
;
|
|
1098
1231
|
|
|
1099
1232
|
|
|
@@ -1124,10 +1257,18 @@ function SuperController(options) {
|
|
|
1124
1257
|
if (isLoadingPartial) {
|
|
1125
1258
|
layout += '\t{{ page.view.scripts }}';
|
|
1126
1259
|
} else {
|
|
1260
|
+
// placed in the HEAD
|
|
1127
1261
|
if ( isDeferModeEnabled ) {
|
|
1128
1262
|
layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
|
|
1129
|
-
}
|
|
1263
|
+
}
|
|
1264
|
+
// placed in the BODY
|
|
1265
|
+
else {
|
|
1130
1266
|
layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
|
|
1267
|
+
if (hasExternalsPlugins) {
|
|
1268
|
+
for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
|
|
1269
|
+
layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1131
1272
|
}
|
|
1132
1273
|
}
|
|
1133
1274
|
|
|
@@ -1173,6 +1314,11 @@ function SuperController(options) {
|
|
|
1173
1314
|
// layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
|
|
1174
1315
|
// } else { // placed in the BODY
|
|
1175
1316
|
// layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
|
|
1317
|
+
// if (hasExternalsPlugins) {
|
|
1318
|
+
// for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
|
|
1319
|
+
// layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
|
|
1320
|
+
// }
|
|
1321
|
+
// }
|
|
1176
1322
|
// }
|
|
1177
1323
|
// }
|
|
1178
1324
|
|
|
@@ -1189,11 +1335,18 @@ function SuperController(options) {
|
|
|
1189
1335
|
layout += '\t'+ localOptions.template.ginaLoader +'\n';
|
|
1190
1336
|
}
|
|
1191
1337
|
} else {
|
|
1338
|
+
// placed in the HEAD
|
|
1192
1339
|
if ( isDeferModeEnabled && /\<\/head\>/i.test(layout) ) { // placed in the HEAD
|
|
1193
1340
|
layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
|
|
1194
|
-
|
|
1195
|
-
|
|
1341
|
+
}
|
|
1342
|
+
// placed in the BODY
|
|
1343
|
+
else {
|
|
1196
1344
|
layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
|
|
1345
|
+
if (hasExternalsPlugins) {
|
|
1346
|
+
for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
|
|
1347
|
+
layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1197
1350
|
}
|
|
1198
1351
|
// ginaLoader cannot be deferred
|
|
1199
1352
|
if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
|
|
@@ -1295,6 +1448,40 @@ function SuperController(options) {
|
|
|
1295
1448
|
) {
|
|
1296
1449
|
layout = layout.replace('{"assets":"${assets}"}', assets );
|
|
1297
1450
|
}
|
|
1451
|
+
|
|
1452
|
+
if ( !self.isCacheless() ) {
|
|
1453
|
+
var links = local.options.template.h2Links;
|
|
1454
|
+
for (let l in localOptions.template.assets) {
|
|
1455
|
+
let link = localOptions.template.assets[l]
|
|
1456
|
+
if (
|
|
1457
|
+
/^_/.test(l)
|
|
1458
|
+
|| typeof(link.as) == 'undefined'
|
|
1459
|
+
|| typeof(link.as) != 'undefined'
|
|
1460
|
+
&& link.as != 'null'
|
|
1461
|
+
&& !link.isAvailable
|
|
1462
|
+
|| !link.as
|
|
1463
|
+
) {
|
|
1464
|
+
// ignoring
|
|
1465
|
+
continue;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
links += '<'+ l +'>; as='+ link.as +'; '
|
|
1469
|
+
if ( link.imagesrcset) {
|
|
1470
|
+
links += 'imagesrcset='+ link.imagesrcset +'; ';
|
|
1471
|
+
}
|
|
1472
|
+
if ( link.imagesizes) {
|
|
1473
|
+
links += 'imagesizes='+ link.imagesizes +'; ';
|
|
1474
|
+
}
|
|
1475
|
+
links += 'rel=preload,'
|
|
1476
|
+
|
|
1477
|
+
}
|
|
1478
|
+
if ( /\,$/.test(links) ) {
|
|
1479
|
+
links = links.substring(0, links.length-1);
|
|
1480
|
+
}
|
|
1481
|
+
local.res.setHeader('link', links);
|
|
1482
|
+
links = null;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1298
1485
|
assets = null;
|
|
1299
1486
|
|
|
1300
1487
|
} catch (err) {
|
|
@@ -1425,7 +1612,6 @@ function SuperController(options) {
|
|
|
1425
1612
|
}
|
|
1426
1613
|
}
|
|
1427
1614
|
|
|
1428
|
-
|
|
1429
1615
|
// Internet Explorer override
|
|
1430
1616
|
if ( /msie/i.test(request.headers['user-agent']) ) {
|
|
1431
1617
|
response.setHeader('content-type', 'text/plain' + '; charset='+ local.options.conf.encoding)
|
|
@@ -1433,58 +1619,57 @@ function SuperController(options) {
|
|
|
1433
1619
|
response.setHeader('content-type', local.options.conf.server.coreConfiguration.mime['json'] + '; charset='+ local.options.conf.encoding)
|
|
1434
1620
|
}
|
|
1435
1621
|
|
|
1436
|
-
|
|
1437
|
-
console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
|
|
1622
|
+
console.info(request.method +' ['+ response.statusCode +'] '+ request.url);
|
|
1438
1623
|
|
|
1439
1624
|
|
|
1440
|
-
|
|
1625
|
+
if ( local.options.isXMLRequest && self.isWithCredentials() ) {
|
|
1441
1626
|
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
response.write(data);
|
|
1449
|
-
|
|
1450
|
-
// required to close connection
|
|
1451
|
-
setTimeout(function () {
|
|
1452
|
-
response.end();
|
|
1453
|
-
try {
|
|
1454
|
-
response.headersSent = true;
|
|
1455
|
-
} catch(err) {
|
|
1456
|
-
// Ignoring warning
|
|
1457
|
-
//console.warn(err);
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
if ( next ) {
|
|
1461
|
-
next()
|
|
1462
|
-
}
|
|
1627
|
+
// content length must be the right size !
|
|
1628
|
+
var len = Buffer.byteLength(data, 'utf8') || 0;
|
|
1629
|
+
if ( !headersSent(response) ) {
|
|
1630
|
+
response.setHeader("content-length", len);
|
|
1631
|
+
}
|
|
1463
1632
|
|
|
1464
|
-
|
|
1465
|
-
}, 200);
|
|
1633
|
+
response.write(data);
|
|
1466
1634
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
// normal case
|
|
1471
|
-
response.end(JSON.stringify(jsonObj));
|
|
1472
|
-
if (!headersSent(response)) {
|
|
1635
|
+
// required to close connection
|
|
1636
|
+
setTimeout(function () {
|
|
1637
|
+
response.end();
|
|
1473
1638
|
try {
|
|
1474
1639
|
response.headersSent = true;
|
|
1475
1640
|
} catch(err) {
|
|
1476
1641
|
// Ignoring warning
|
|
1477
1642
|
//console.warn(err);
|
|
1478
1643
|
}
|
|
1644
|
+
|
|
1645
|
+
if ( next ) {
|
|
1646
|
+
next()
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
freeMemory([jsonObj, data, request, response, next]);
|
|
1650
|
+
}, 200);
|
|
1651
|
+
|
|
1652
|
+
// force completion
|
|
1653
|
+
return
|
|
1654
|
+
}
|
|
1655
|
+
// normal case
|
|
1656
|
+
response.end(JSON.stringify(jsonObj));
|
|
1657
|
+
if (!headersSent(response)) {
|
|
1658
|
+
try {
|
|
1659
|
+
response.headersSent = true;
|
|
1660
|
+
} catch(err) {
|
|
1661
|
+
// Ignoring warning
|
|
1662
|
+
//console.warn(err);
|
|
1479
1663
|
}
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1664
|
+
}
|
|
1665
|
+
if ( next ) {
|
|
1666
|
+
return next()
|
|
1667
|
+
}
|
|
1483
1668
|
|
|
1484
|
-
|
|
1669
|
+
freeMemory([jsonObj, data, request, response, next]);
|
|
1670
|
+
|
|
1671
|
+
return;
|
|
1485
1672
|
|
|
1486
|
-
return;
|
|
1487
|
-
// }
|
|
1488
1673
|
} catch (err) {
|
|
1489
1674
|
return self.throwError(response, 500, err);
|
|
1490
1675
|
}
|
|
@@ -1577,7 +1762,7 @@ function SuperController(options) {
|
|
|
1577
1762
|
|
|
1578
1763
|
++_count;
|
|
1579
1764
|
if (k == len-1) {
|
|
1580
|
-
str = str.
|
|
1765
|
+
str = str.substring(0, str.length-1);
|
|
1581
1766
|
str += "\"_content_\"";
|
|
1582
1767
|
for (let c = 0; c<_count; ++c) {
|
|
1583
1768
|
str += "}"
|
|
@@ -1619,22 +1804,35 @@ function SuperController(options) {
|
|
|
1619
1804
|
var authority = ( typeof(local.req.headers['x-forwarded-proto']) != 'undefined' ) ? local.req.headers['x-forwarded-proto'] : local.options.conf.server.scheme;
|
|
1620
1805
|
authority += '://'+ local.req.headers.host;
|
|
1621
1806
|
var useWebroot = false;
|
|
1622
|
-
if (
|
|
1807
|
+
if (
|
|
1808
|
+
!/^\/$/.test(local.options.conf.server.webroot)
|
|
1809
|
+
&& local.options.conf.server.webroot.length > 0
|
|
1810
|
+
// && local.options.conf.hostname.replace(/\:\d+$/, '') == authority
|
|
1811
|
+
) {
|
|
1623
1812
|
useWebroot = true
|
|
1624
1813
|
}
|
|
1625
1814
|
authority = null;
|
|
1626
1815
|
|
|
1627
1816
|
var reURL = new RegExp('^'+ local.options.conf.server.webroot);
|
|
1628
1817
|
|
|
1629
|
-
var cssStr
|
|
1630
|
-
|
|
1818
|
+
var cssStr = ''
|
|
1819
|
+
, jsStr = ''
|
|
1820
|
+
;
|
|
1631
1821
|
//Get css
|
|
1632
1822
|
if( viewConf.stylesheets ) {
|
|
1633
|
-
cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL)
|
|
1823
|
+
// cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL);
|
|
1824
|
+
// Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
|
|
1825
|
+
var cssColl = new Collection(viewConf.stylesheets).orderBy({route: 'asc'})
|
|
1826
|
+
cssStr = getNodeRes('css', cssColl, useWebroot, reURL);
|
|
1827
|
+
cssColl = null;
|
|
1634
1828
|
}
|
|
1635
1829
|
//Get js
|
|
1636
1830
|
if( viewConf.javascripts ) {
|
|
1637
|
-
jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL)
|
|
1831
|
+
// jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL);
|
|
1832
|
+
// Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
|
|
1833
|
+
var jsColl = new Collection(viewConf.javascripts).orderBy({route: 'asc'})
|
|
1834
|
+
jsStr = getNodeRes('js', jsColl, useWebroot, reURL);
|
|
1835
|
+
jsColl = null;
|
|
1638
1836
|
}
|
|
1639
1837
|
|
|
1640
1838
|
set('page.view.stylesheets', cssStr);
|
|
@@ -1651,7 +1849,8 @@ function SuperController(options) {
|
|
|
1651
1849
|
* @param {string} type
|
|
1652
1850
|
* @param {string} resStr
|
|
1653
1851
|
* @param {array} resArr
|
|
1654
|
-
* @param {
|
|
1852
|
+
* @param {boolean} useWebroot
|
|
1853
|
+
* @param {object} reURL - RegExp for webroot
|
|
1655
1854
|
*
|
|
1656
1855
|
* @returns {object} content
|
|
1657
1856
|
*
|
|
@@ -1663,29 +1862,69 @@ function SuperController(options) {
|
|
|
1663
1862
|
, rLen = resArr.length
|
|
1664
1863
|
, obj = null
|
|
1665
1864
|
, str = ''
|
|
1865
|
+
, isProxyHost = getContext('isProxyHost')
|
|
1666
1866
|
, requestHost = ( /http\/2/.test(local.options.conf.server.protocol) )
|
|
1667
1867
|
? local.req.headers[':host']
|
|
1668
1868
|
: local.req.headers.host
|
|
1669
1869
|
, hostname = ( typeof(requestHost) != 'undefined' && local.options.conf.host != requestHost)
|
|
1670
|
-
? local.options.conf.server.scheme +'://'+ requestHost
|
|
1870
|
+
? local.options.conf.server.scheme +'://'+ requestHost
|
|
1671
1871
|
: local.options.conf.hostname
|
|
1872
|
+
, scheme = hostname.match(/^(https|http)/)[0]
|
|
1672
1873
|
;
|
|
1874
|
+
var requestPort = (local.req.headers.port||local.req.headers[':port']);
|
|
1875
|
+
var hostPort = local.options.conf.hostname.match(/(\:d+\/|\:\d+)$/);
|
|
1876
|
+
hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : local.options.conf.port[local.options.conf.server.protocol][local.options.conf.server.scheme];
|
|
1877
|
+
// Linking bundle B from bundle A wihtout proxy
|
|
1878
|
+
var isSpecialCase = (
|
|
1879
|
+
getContext('bundle') != local.options.conf.bundle
|
|
1880
|
+
&& requestPort != hostPort
|
|
1881
|
+
&& local.req.headers[':host'] != process.gina.PROXY_HOST
|
|
1882
|
+
) ? true : false;
|
|
1883
|
+
|
|
1884
|
+
if (isSpecialCase) {
|
|
1885
|
+
hostname = local.options.conf.hostname
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
if (
|
|
1890
|
+
isProxyHost
|
|
1891
|
+
&& !isSpecialCase
|
|
1892
|
+
) {
|
|
1893
|
+
|
|
1894
|
+
hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']||process.gina.PROXY_HOST);
|
|
1895
|
+
|
|
1896
|
+
if (
|
|
1897
|
+
!/^(80|443)$/.test(requestPort)
|
|
1898
|
+
&& !new RegExp(requestPort+'$').test(hostname)
|
|
1899
|
+
) {
|
|
1900
|
+
hostname += ':'+ requestPort;
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1673
1904
|
switch(type){
|
|
1674
1905
|
case 'css':
|
|
1675
1906
|
for (; r < rLen; ++r) {
|
|
1676
1907
|
obj = resArr[r];
|
|
1677
1908
|
if (useWebroot && !reURL.test(obj.url) ) {
|
|
1678
|
-
obj.url = local.options.conf.server.webroot + obj.url.
|
|
1909
|
+
obj.url = local.options.conf.server.webroot + obj.url.substring(1);
|
|
1910
|
+
}
|
|
1911
|
+
// HTTP2 Push via Link
|
|
1912
|
+
if (
|
|
1913
|
+
/http\/2/.test(local.options.conf.server.protocol)
|
|
1914
|
+
&& !self.isCacheless()
|
|
1915
|
+
) {
|
|
1916
|
+
local.options.template.h2Links += '<'+ obj.url +'>; as=style; rel=preload,'
|
|
1679
1917
|
}
|
|
1680
1918
|
// TODO - add support for cdn
|
|
1681
1919
|
if (!/\:\/\//.test(obj.url) ) {
|
|
1682
1920
|
obj.url = hostname + obj.url;
|
|
1683
1921
|
}
|
|
1684
1922
|
|
|
1685
|
-
if (obj.media)
|
|
1923
|
+
if (obj.media) {
|
|
1686
1924
|
str += '\n\t\t<link href="'+ obj.url +'" media="'+ obj.media +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
|
|
1687
|
-
else
|
|
1925
|
+
} else {
|
|
1688
1926
|
str += '\n\t\t<link href="'+ obj.url +'" rel="'+ obj.rel +'" type="'+ obj.type +'">';
|
|
1927
|
+
}
|
|
1689
1928
|
}
|
|
1690
1929
|
break;
|
|
1691
1930
|
|
|
@@ -1695,13 +1934,34 @@ function SuperController(options) {
|
|
|
1695
1934
|
for (; r < rLen; ++r) {
|
|
1696
1935
|
obj = resArr[r];
|
|
1697
1936
|
if (useWebroot && !reURL.test(obj.url) ) {
|
|
1698
|
-
obj.url = local.options.conf.server.webroot + obj.url.
|
|
1937
|
+
obj.url = local.options.conf.server.webroot + obj.url.substring(1);
|
|
1938
|
+
}
|
|
1939
|
+
// HTTP2 Push via Link
|
|
1940
|
+
if (
|
|
1941
|
+
/http\/2/.test(local.options.conf.server.protocol)
|
|
1942
|
+
&& !self.isCacheless()
|
|
1943
|
+
) {
|
|
1944
|
+
local.options.template.h2Links += '<'+ obj.url +'>; as=script; rel=preload,'
|
|
1699
1945
|
}
|
|
1700
1946
|
// TODO - add support for cdn
|
|
1701
1947
|
if (!/\:\/\//.test(obj.url) ) {
|
|
1702
1948
|
obj.url = hostname + obj.url;
|
|
1703
1949
|
}
|
|
1704
|
-
|
|
1950
|
+
|
|
1951
|
+
|
|
1952
|
+
if ( /\/jquery\.(.*)\.(min\.js|js)$/i.test(obj.url) ) {
|
|
1953
|
+
console.warn('jQuery Plugin found in templates.json !\nIf you want to load it before [gina.min.js], you should declare it at the top of your handler using requireJS or add property "isExternalPlugin: true" in your templates.json, under: '+ (obj.route || local.req.routing.rule) +' .');
|
|
1954
|
+
}
|
|
1955
|
+
// Allow jQuery & other external plugins to be loaded in the HEAD section before gina
|
|
1956
|
+
if (
|
|
1957
|
+
obj.isExternalPlugin
|
|
1958
|
+
) {
|
|
1959
|
+
local.options.template.externalPlugins.splice(1, 0, '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>');
|
|
1960
|
+
}
|
|
1961
|
+
else {
|
|
1962
|
+
// normal case
|
|
1963
|
+
str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>';
|
|
1964
|
+
}
|
|
1705
1965
|
}
|
|
1706
1966
|
break;
|
|
1707
1967
|
}
|
|
@@ -1797,7 +2057,7 @@ function SuperController(options) {
|
|
|
1797
2057
|
|
|
1798
2058
|
if (
|
|
1799
2059
|
staticProps.isStaticFilename && staticsArr.indexOf(url) > -1
|
|
1800
|
-
|| staticProps.isStaticFilename && staticsArr.indexOf( url.replace(url.
|
|
2060
|
+
|| staticProps.isStaticFilename && staticsArr.indexOf( url.replace(url.substring(url.lastIndexOf('/')+1), '') ) > -1
|
|
1801
2061
|
|| staticProps.isStaticFilename && staticsArr.indexOf(staticProps.firstLevel) > -1
|
|
1802
2062
|
) {
|
|
1803
2063
|
staticProps = null;
|
|
@@ -1895,9 +2155,9 @@ function SuperController(options) {
|
|
|
1895
2155
|
// ignoreWebRoot = false
|
|
1896
2156
|
// } else
|
|
1897
2157
|
if (typeof(res) === 'string' || typeof(res) === 'number' || typeof(res) === 'boolean') {
|
|
1898
|
-
if (
|
|
2158
|
+
if ( /^(true|1)$/i.test(res) ) {
|
|
1899
2159
|
ignoreWebRoot = true
|
|
1900
|
-
} else if (
|
|
2160
|
+
} else if ( /^(false|0)$/i.test(res) ) {
|
|
1901
2161
|
ignoreWebRoot = false
|
|
1902
2162
|
} else {
|
|
1903
2163
|
res = local.res;
|
|
@@ -1918,13 +2178,13 @@ function SuperController(options) {
|
|
|
1918
2178
|
|
|
1919
2179
|
}
|
|
1920
2180
|
|
|
1921
|
-
if ( req.
|
|
1922
|
-
// if (wroot.
|
|
1923
|
-
// wroot = wroot.
|
|
2181
|
+
if ( req.substring(0,1) === '/') { // is relative (not checking if the URI is defined in the routing.json)
|
|
2182
|
+
// if (wroot.substring(wroot.length-1,1) == '/') {
|
|
2183
|
+
// wroot = wroot.substring(wroot.length-1,1).replace('/', '')
|
|
1924
2184
|
// }
|
|
1925
2185
|
|
|
1926
2186
|
if ( /^\//.test(req) && !ignoreWebRoot )
|
|
1927
|
-
req = req.
|
|
2187
|
+
req = req.substring(1);
|
|
1928
2188
|
|
|
1929
2189
|
rte = ( ignoreWebRoot != null && ignoreWebRoot ) ? req : wroot + req;
|
|
1930
2190
|
// cleaning url in case of ?param=value
|
|
@@ -2015,11 +2275,32 @@ function SuperController(options) {
|
|
|
2015
2275
|
|
|
2016
2276
|
if ( !self.forward404Unless(condition, req, res) ) { // forward to 404 if bad route
|
|
2017
2277
|
|
|
2018
|
-
var
|
|
2019
|
-
var
|
|
2278
|
+
var localRequestPort = local.req.headers.port || local.req.headers[':port'];
|
|
2279
|
+
var isProxyHost = (
|
|
2280
|
+
typeof(local.req.headers.host) != 'undefined'
|
|
2281
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
2282
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
2283
|
+
&& local.options.conf.server.scheme +'://'+ local.req.headers.host +':'+ localRequestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
|
|
2284
|
+
||
|
|
2285
|
+
typeof(local.req.headers[':authority']) != 'undefined'
|
|
2286
|
+
&& local.options.conf.server.scheme +'://'+ local.req.headers[':authority'] != local.options.conf.hostname
|
|
2287
|
+
||
|
|
2288
|
+
typeof(local.req.headers.host) != 'undefined'
|
|
2289
|
+
&& typeof(localRequestPort) != 'undefined'
|
|
2290
|
+
&& /^(80|443)$/.test(localRequestPort)
|
|
2291
|
+
&& req.headers.host == local.options.conf.host
|
|
2292
|
+
||
|
|
2293
|
+
typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
|
|
2294
|
+
&& /^true$/i.test(local.req.headers['x-nginx-proxy'])
|
|
2295
|
+
||
|
|
2296
|
+
typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
|
|
2297
|
+
) ? true : false;
|
|
2298
|
+
|
|
2299
|
+
// var isProxyHost = getContext('isProxyHost');
|
|
2300
|
+
var hostname = (isProxyHost)
|
|
2301
|
+
? process.gina.PROXY_HOSTNAME
|
|
2302
|
+
: ctx.config.envConf[bundle][env].hostname;
|
|
2020
2303
|
|
|
2021
|
-
// if ( !/\:\d+$/.test(req.headers.host) )
|
|
2022
|
-
// hostname = hostname.replace(/\:\d+$/, '');
|
|
2023
2304
|
|
|
2024
2305
|
if (route) { // will go with route first
|
|
2025
2306
|
|
|
@@ -2078,7 +2359,7 @@ function SuperController(options) {
|
|
|
2078
2359
|
originalMethod && !/GET/i.test(originalMethod)
|
|
2079
2360
|
) { // trying to redirect using the wrong method ?
|
|
2080
2361
|
|
|
2081
|
-
console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\
|
|
2362
|
+
console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\nDon\'t panic :)\nSwitching request method to `GET` method instead.\n').message);
|
|
2082
2363
|
method = local.req.method = self.setRequestMethod('GET', conf);
|
|
2083
2364
|
code = 303;
|
|
2084
2365
|
}
|
|
@@ -2326,7 +2607,7 @@ function SuperController(options) {
|
|
|
2326
2607
|
|
|
2327
2608
|
if ( /\:\/\//.test(url) ) {
|
|
2328
2609
|
scheme = url.match(/^\w+\:/)[0];
|
|
2329
|
-
scheme = scheme.
|
|
2610
|
+
scheme = scheme.substring(0, scheme.length-1);
|
|
2330
2611
|
|
|
2331
2612
|
if ( !/^http/.test(scheme) ) {
|
|
2332
2613
|
self.throwError(local.res, 500, new Error('[ '+ scheme +' ] Scheme not supported. Ref.: `http` or `https` only'));
|
|
@@ -2344,7 +2625,7 @@ function SuperController(options) {
|
|
|
2344
2625
|
//defining port
|
|
2345
2626
|
var port = url.match(/\:\d+\//) || null;
|
|
2346
2627
|
if ( port != null ) {
|
|
2347
|
-
port = port[0].
|
|
2628
|
+
port = port[0].substring(1, port[0].length-2);
|
|
2348
2629
|
requestOptions.port = ~~port;
|
|
2349
2630
|
}
|
|
2350
2631
|
|
|
@@ -2376,7 +2657,7 @@ function SuperController(options) {
|
|
|
2376
2657
|
opt.contentDisposition += '; filename=' + filename;
|
|
2377
2658
|
}
|
|
2378
2659
|
|
|
2379
|
-
var ext = filename.match(/\.\w+$/)[0].
|
|
2660
|
+
var ext = filename.match(/\.\w+$/)[0].substring(1)
|
|
2380
2661
|
, contentType = null
|
|
2381
2662
|
, tmp = _(GINA_TMPDIR +'/'+ filename, true)
|
|
2382
2663
|
;
|
|
@@ -2659,7 +2940,8 @@ function SuperController(options) {
|
|
|
2659
2940
|
) {
|
|
2660
2941
|
return false
|
|
2661
2942
|
}
|
|
2662
|
-
|
|
2943
|
+
// by default
|
|
2944
|
+
self.isProcessingError = false;
|
|
2663
2945
|
|
|
2664
2946
|
var queryData = {}
|
|
2665
2947
|
, defaultOptions = local.query.options
|
|
@@ -2669,14 +2951,14 @@ function SuperController(options) {
|
|
|
2669
2951
|
|
|
2670
2952
|
// options must be used as a copy in case of multiple calls of self.query(options, ...)
|
|
2671
2953
|
options = merge(JSON.clone(options), defaultOptions);
|
|
2672
|
-
// options = merge(options, defaultOptions);
|
|
2673
2954
|
|
|
2674
|
-
for (
|
|
2955
|
+
for (let o in options) {//cleaning
|
|
2675
2956
|
if ( typeof(options[o]) == 'undefined' || options[o] == undefined) {
|
|
2676
2957
|
delete options[o]
|
|
2677
2958
|
}
|
|
2678
2959
|
}
|
|
2679
2960
|
|
|
2961
|
+
|
|
2680
2962
|
if (self.isCacheless() || self.isLocalScope() ) {
|
|
2681
2963
|
options.rejectUnauthorized = false;
|
|
2682
2964
|
}
|
|
@@ -2745,14 +3027,17 @@ function SuperController(options) {
|
|
|
2745
3027
|
if ( local.req != null && typeof(local.req.ginaHeaders) != 'undefined' ) {
|
|
2746
3028
|
// gina form headers
|
|
2747
3029
|
for (let h in local.req.ginaHeaders.form) {
|
|
2748
|
-
let k = h.
|
|
3030
|
+
let k = h.substring(0,1).toUpperCase() + h.substring(1);
|
|
2749
3031
|
options.headers['X-Gina-Form-' + k ] = local.req.ginaHeaders.form[h];
|
|
2750
3032
|
}
|
|
2751
3033
|
}
|
|
2752
3034
|
|
|
2753
|
-
var ctx
|
|
2754
|
-
, protocol
|
|
2755
|
-
, scheme
|
|
3035
|
+
var ctx = getContext()
|
|
3036
|
+
, protocol = null
|
|
3037
|
+
, scheme = null
|
|
3038
|
+
, isProxyHost = getContext('isProxyHost')
|
|
3039
|
+
, bundle = null
|
|
3040
|
+
, webroot = options.webroot || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.webroot;// bundle servers's webroot by default
|
|
2756
3041
|
;
|
|
2757
3042
|
// cleanup options.path
|
|
2758
3043
|
if (/\:\/\//.test(options.path)) {
|
|
@@ -2769,11 +3054,16 @@ function SuperController(options) {
|
|
|
2769
3054
|
.replace(':'+port, '');
|
|
2770
3055
|
}
|
|
2771
3056
|
|
|
3057
|
+
// if ( typeof(options.protocol) == 'undefined' ) {
|
|
3058
|
+
// options.protocol = ctx.gina.config.envConf[ctx.bundle][ctx.env].server.protocol;
|
|
3059
|
+
// }
|
|
3060
|
+
|
|
2772
3061
|
// retrieve protocol & scheme: if empty, take the bundles protocol
|
|
2773
3062
|
protocol = options.protocol || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.protocol;// bundle servers's protocol by default
|
|
2774
3063
|
protocol = protocol.match(/[.a-z 0-9]+/ig)[0];
|
|
2775
3064
|
scheme = options.scheme || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.scheme;// bundle servers's scheme by default
|
|
2776
3065
|
scheme = scheme.match(/[a-z 0-9]+/ig)[0];
|
|
3066
|
+
|
|
2777
3067
|
// retrieve credentials
|
|
2778
3068
|
if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
|
|
2779
3069
|
options.ca = ctx.gina.config.envConf[ctx.bundle][ctx.env].server.credentials.ca;
|
|
@@ -2782,24 +3072,18 @@ function SuperController(options) {
|
|
|
2782
3072
|
//retrieving dynamic host, hostname & port
|
|
2783
3073
|
if ( /\@/.test(options.hostname) ) {
|
|
2784
3074
|
|
|
2785
|
-
|
|
2786
|
-
|
|
3075
|
+
bundle = ( options.hostname.replace(/(.*)\:\/\//, '') ).split(/\@/)[0];
|
|
2787
3076
|
// No shorcut possible because conf.hostname might differ from user inputs
|
|
2788
3077
|
options.host = ctx.gina.config.envConf[bundle][ctx.env].host.replace(/(.*)\:\/\//, '').replace(/\:\d+/, '');
|
|
2789
3078
|
options.hostname = ctx.gina.config.envConf[bundle][ctx.env].hostname;
|
|
2790
3079
|
options.port = ctx.gina.config.envConf[bundle][ctx.env].server.port;
|
|
2791
|
-
|
|
2792
|
-
options.protocol = ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
|
|
3080
|
+
options.protocol = options.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
|
|
2793
3081
|
options.scheme = ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
|
|
2794
3082
|
|
|
2795
3083
|
// retrieve credentials
|
|
2796
3084
|
if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
|
|
2797
3085
|
options.ca = ctx.gina.config.envConf[bundle][ctx.env].server.credentials.ca;
|
|
2798
3086
|
}
|
|
2799
|
-
|
|
2800
|
-
// might be != from the bundle requesting
|
|
2801
|
-
//options.protocol = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
|
|
2802
|
-
//options.scheme = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.scheme || ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
|
|
2803
3087
|
}
|
|
2804
3088
|
|
|
2805
3089
|
if ( typeof(options.protocol) == 'undefined' ) {
|
|
@@ -2813,45 +3097,224 @@ function SuperController(options) {
|
|
|
2813
3097
|
|
|
2814
3098
|
|
|
2815
3099
|
// reformating scheme
|
|
2816
|
-
if( !/\:$/.test(options.scheme) )
|
|
3100
|
+
if( !/\:$/.test(options.scheme) ) {
|
|
2817
3101
|
options.scheme += ':';
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
if (isProxyHost) {
|
|
3105
|
+
// X-Forwarded-Host
|
|
3106
|
+
options.headers['x-forwarded-host'] = process.gina.PROXY_HOST;
|
|
3107
|
+
// X-Forwarded-Proto
|
|
3108
|
+
options.headers['x-forwarded-proto'] = process.gina.PROXY_SCHEME;
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
if ( ctx.gina.config.envConf[ctx.bundle][ctx.env].server.resolvers.length > 0 ) {
|
|
3112
|
+
var resolversColl = new Collection(ctx.gina.config.envConf[ctx.bundle][ctx.env].server.resolvers);
|
|
3113
|
+
options.nameservers = resolversColl.findOne({ scope: process.env.NODE_SCOPE}).nameservers;
|
|
3114
|
+
resolversColl = null;
|
|
3115
|
+
}
|
|
2818
3116
|
|
|
2819
3117
|
try {
|
|
2820
3118
|
options.queryData = queryData;
|
|
3119
|
+
|
|
3120
|
+
bundle = null;
|
|
3121
|
+
|
|
3122
|
+
// TODO - Add preferred communication method option: cCurl or HTTP
|
|
3123
|
+
// return handleCurlRequest(options, callback);
|
|
3124
|
+
|
|
2821
3125
|
var protocolVersion = ~~options.protocol.match(/\/(.*)$/)[1].replace(/\.\d+/, '');
|
|
2822
3126
|
var httpLib = options.protocol.match(/^(.*)\//)[1] + ( (protocolVersion >= 2) ? protocolVersion : '' );
|
|
2823
3127
|
if ( !/http2/.test(httpLib) && /https/.test(options.scheme) ) {
|
|
2824
3128
|
httpLib += 's';
|
|
2825
3129
|
}
|
|
2826
|
-
|
|
2827
3130
|
browser = require(''+ httpLib);
|
|
2828
|
-
|
|
2829
3131
|
if ( /http2/.test(httpLib) ) {
|
|
2830
3132
|
return handleHTTP2ClientRequest(browser, options, callback);
|
|
2831
3133
|
} else {
|
|
2832
3134
|
return handleHTTP1ClientRequest(browser, options, callback);
|
|
2833
3135
|
}
|
|
2834
3136
|
|
|
2835
|
-
|
|
2836
3137
|
} catch(err) {
|
|
2837
3138
|
if (callback) {
|
|
2838
3139
|
return callback(err)
|
|
2839
3140
|
}
|
|
2840
3141
|
self.emit('query#complete', err)
|
|
2841
3142
|
}
|
|
3143
|
+
}
|
|
3144
|
+
|
|
3145
|
+
var handleCurlRequest = async function(opt, callback) {
|
|
3146
|
+
|
|
3147
|
+
|
|
3148
|
+
var body = null;
|
|
3149
|
+
// https://docs.couchbase.com/server/current/n1ql-rest-query/index.html#Request
|
|
3150
|
+
var cmd = [
|
|
3151
|
+
'$(which curl)'
|
|
3152
|
+
];
|
|
3153
|
+
|
|
3154
|
+
if (!opt.rejectUnauthorized) {
|
|
3155
|
+
// (SSL) This option explicitly allows curl to perform "insecure" SSL connections and transfers
|
|
3156
|
+
// same as --insecure
|
|
3157
|
+
cmd.splice(1,0,'-k');
|
|
3158
|
+
}
|
|
3159
|
+
|
|
3160
|
+
// method
|
|
3161
|
+
if ( !/get/i.test(opt.method) ) {
|
|
3162
|
+
cmd.splice(1,0,'-X '+ opt.method.toUpperCase() );
|
|
3163
|
+
}
|
|
3164
|
+
|
|
3165
|
+
|
|
3166
|
+
if ( /(post|put)/i.test(opt.method) && opt.queryData.length > 0) {
|
|
3167
|
+
cmd.push('-d '+ opt.queryData );
|
|
3168
|
+
body = Buffer.from(opt.queryData);
|
|
3169
|
+
opt.headers['content-length'] = body.length;
|
|
3170
|
+
} else if (
|
|
3171
|
+
/get/i.test(opt.method)
|
|
3172
|
+
&& typeof(opt.headers['content-length']) != 'undefined'
|
|
3173
|
+
) {
|
|
3174
|
+
delete opt.headers['content-length'];
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
if ( opt.headers.count() > 0) {
|
|
3178
|
+
for (let h in opt.headers) {
|
|
3179
|
+
cmd.splice(1,0,'-H "'+ h +': '+ opt.headers[h] +'"');
|
|
3180
|
+
}
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
// resolvers
|
|
3184
|
+
if (opt.nameservers) {
|
|
3185
|
+
resolver.setServers(opt.nameservers);
|
|
3186
|
+
await resolver
|
|
3187
|
+
.resolve4(opt.host)
|
|
3188
|
+
.catch( function onResolverErr(e) {
|
|
3189
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3190
|
+
var msg = 'Could not resolve with these `settings.server.resolvers`:\n'+ opt.nameservers.toString() +'\n' + e.stack+ '\nController Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r';
|
|
3191
|
+
var exception = new Error(msg);
|
|
3192
|
+
exception.status = 500;
|
|
3193
|
+
return self.throwError(exception);
|
|
3194
|
+
})
|
|
3195
|
+
.then( function onResolved(ips) {
|
|
3196
|
+
if ( typeof(ips) == 'undefined' || !Array.isArray(ips) || !ips.length ) {
|
|
3197
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3198
|
+
var e = new Error('`Unable to resolve ${opt.host}`');
|
|
3199
|
+
var msg = 'Please check`settings.server.resolvers`:\n'+ opt.nameservers.toString() +'\n'+ e.stack + 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r';
|
|
3200
|
+
var exception = new Error(msg);
|
|
3201
|
+
exception.status = 500;
|
|
3202
|
+
return self.throwError(exception);
|
|
3203
|
+
}
|
|
3204
|
+
for (let i=0, len=ips.length; i<len; i++) {
|
|
3205
|
+
// e.g.: --resolve www.example.com:443:127.0.0.1
|
|
3206
|
+
cmd.push('--resolve '+ opt.host +':'+ opt.port +':'+ ips[i]);
|
|
3207
|
+
}
|
|
3208
|
+
});
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
|
|
3212
|
+
|
|
3213
|
+
|
|
3214
|
+
cmd.push('-v "'+ opt.hostname + opt.path +'"');
|
|
3215
|
+
|
|
3216
|
+
// Default maxBuffer is 200KB (=> 1024 * 200)
|
|
3217
|
+
// Setting it to 10MB - preventing: stdout maxBuffer length exceeded
|
|
3218
|
+
var maxBuffer = (1024 * 1024 * 10);
|
|
3219
|
+
exec(cmd.join(' '), { maxBuffer: maxBuffer }, function onResult(err, dataStr, infos) {
|
|
3220
|
+
var error = null;
|
|
3221
|
+
if (err) {
|
|
3222
|
+
try {
|
|
3223
|
+
// by default
|
|
3224
|
+
error = new Error('[ CONTROLLER ][ CURL#query ] request aborted\n'+ err.stack);
|
|
3225
|
+
if (
|
|
3226
|
+
typeof(err.message) != 'undefined'
|
|
3227
|
+
&& /Failed to connect/i.test(err.message)
|
|
3228
|
+
) {
|
|
3229
|
+
var port = getContext('gina').ports[opt.protocol][opt.scheme.replace(/\:/, '')][ opt.port ];
|
|
3230
|
+
error.accessPoint = port;
|
|
3231
|
+
error.message = 'Could not connect to [ ' + error.accessPoint + ' ].\nThe `'+port.split(/\@/)[0]+'` bundle is offline or unreachable.\n';
|
|
3232
|
+
}
|
|
3233
|
+
console.error(error.stack);
|
|
3234
|
+
if ( typeof(callback) != 'undefined' ) {
|
|
3235
|
+
callback(error)
|
|
3236
|
+
} else {
|
|
3237
|
+
self.emit('query#complete', error)
|
|
3238
|
+
}
|
|
3239
|
+
} catch (e) {
|
|
3240
|
+
// console.error(e.stack);
|
|
3241
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3242
|
+
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3243
|
+
var exception = new Error(msg);
|
|
3244
|
+
exception.status = 500;
|
|
3245
|
+
self.throwError(exception);
|
|
3246
|
+
}
|
|
3247
|
+
return;
|
|
3248
|
+
}
|
|
3249
|
+
|
|
2842
3250
|
|
|
3251
|
+
try {
|
|
3252
|
+
let data = JSON.parse(dataStr);
|
|
3253
|
+
if ( typeof(data) == 'undefined' ) {
|
|
3254
|
+
data = {}
|
|
3255
|
+
}
|
|
3256
|
+
if ( typeof(callback) != 'undefined' ) {
|
|
3257
|
+
callback(err, data)
|
|
3258
|
+
} else {
|
|
3259
|
+
self.emit('query#complete', err, data)
|
|
3260
|
+
}
|
|
3261
|
+
} catch (e) {
|
|
3262
|
+
// _err.stack = '[ CONTROLLER ][ CURL#query ] onCallbackError: '+ e.stack;
|
|
3263
|
+
// console.error(e.stack);
|
|
3264
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3265
|
+
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3266
|
+
var exception = new Error(msg);
|
|
3267
|
+
exception.status = 500;
|
|
3268
|
+
self.throwError(exception);
|
|
3269
|
+
return;
|
|
3270
|
+
}
|
|
3271
|
+
});
|
|
2843
3272
|
}
|
|
2844
3273
|
|
|
3274
|
+
var handleHTTP1ClientRequestv2 = function (browser, options, callback) {
|
|
3275
|
+
var agent = new browser.Agent({ keepAlive: true });
|
|
3276
|
+
var options = {
|
|
3277
|
+
host: options.host,
|
|
3278
|
+
port: options.port,
|
|
3279
|
+
path: options.path,
|
|
3280
|
+
method: 'GET',
|
|
3281
|
+
agent: agent
|
|
3282
|
+
};
|
|
3283
|
+
|
|
3284
|
+
var req = browser.request(options, function(res) {
|
|
3285
|
+
var str = "";
|
|
3286
|
+
var err = false;
|
|
3287
|
+
res.on('data', function (chunk) {
|
|
3288
|
+
str += chunk;
|
|
3289
|
+
});
|
|
3290
|
+
res.on('end', function () {
|
|
3291
|
+
// done
|
|
3292
|
+
return callback( err, data );
|
|
3293
|
+
});
|
|
3294
|
+
});
|
|
3295
|
+
req.write('');
|
|
3296
|
+
req.end();
|
|
3297
|
+
req.on('error', function(error) {
|
|
3298
|
+
err = error
|
|
3299
|
+
});
|
|
3300
|
+
};
|
|
3301
|
+
|
|
2845
3302
|
var handleHTTP1ClientRequest = function(browser, options, callback) {
|
|
2846
3303
|
|
|
2847
3304
|
var altOpt = JSON.clone(options);
|
|
3305
|
+
// var credentials = self.getConfig('settings').server.credentials;
|
|
3306
|
+
// options.ca = credentials.ca;
|
|
3307
|
+
// options.encKey = credentials.privateKey;
|
|
3308
|
+
// options.encCert = credentials.certificate;
|
|
3309
|
+
|
|
2848
3310
|
|
|
2849
3311
|
altOpt.protocol = options.scheme;
|
|
2850
3312
|
altOpt.hostname = options.host;
|
|
2851
3313
|
altOpt.port = options.port;
|
|
3314
|
+
altOpt.maxSockets = options.maxSockets || 1;
|
|
2852
3315
|
if ( typeof(altOpt.encKey) != 'undefined' ) {
|
|
2853
3316
|
try {
|
|
2854
|
-
altOpt.encKey = fs.readFileSync(
|
|
3317
|
+
altOpt.encKey = fs.readFileSync(altOpt.encKey);
|
|
2855
3318
|
} catch(err) {
|
|
2856
3319
|
self.emit('query#complete', err);
|
|
2857
3320
|
}
|
|
@@ -2862,7 +3325,7 @@ function SuperController(options) {
|
|
|
2862
3325
|
|
|
2863
3326
|
if ( typeof(altOpt.encCert) != 'undefined' ) {
|
|
2864
3327
|
try {
|
|
2865
|
-
altOpt.encCert = fs.readFileSync(
|
|
3328
|
+
altOpt.encCert = fs.readFileSync(altOpt.encCert);
|
|
2866
3329
|
} catch(err) {
|
|
2867
3330
|
self.emit('query#complete', err);
|
|
2868
3331
|
}
|
|
@@ -2871,6 +3334,11 @@ function SuperController(options) {
|
|
|
2871
3334
|
console.warn('[ CONTROLLER ][ HTTP/1.0#query ] options.encCert not found !');
|
|
2872
3335
|
}
|
|
2873
3336
|
|
|
3337
|
+
|
|
3338
|
+
delete altOpt.ca;
|
|
3339
|
+
delete altOpt.encKey;
|
|
3340
|
+
delete altOpt.encCert;
|
|
3341
|
+
|
|
2874
3342
|
altOpt.agent = new browser.Agent(altOpt);
|
|
2875
3343
|
|
|
2876
3344
|
var req = browser.request(altOpt, function(res) {
|
|
@@ -2930,7 +3398,7 @@ function SuperController(options) {
|
|
|
2930
3398
|
return;
|
|
2931
3399
|
}
|
|
2932
3400
|
} catch (e) {
|
|
2933
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3401
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
2934
3402
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
2935
3403
|
var exception = new Error(msg);
|
|
2936
3404
|
exception.status = 500;
|
|
@@ -3024,7 +3492,7 @@ function SuperController(options) {
|
|
|
3024
3492
|
cb(err, data)
|
|
3025
3493
|
}
|
|
3026
3494
|
} catch (e) {
|
|
3027
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3495
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3028
3496
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3029
3497
|
var exception = new Error(msg);
|
|
3030
3498
|
exception.status = 500;
|
|
@@ -3101,10 +3569,8 @@ function SuperController(options) {
|
|
|
3101
3569
|
delete options.queryData;
|
|
3102
3570
|
|
|
3103
3571
|
|
|
3104
|
-
|
|
3105
3572
|
const client = browser.connect(options.hostname, options);
|
|
3106
3573
|
|
|
3107
|
-
|
|
3108
3574
|
const {
|
|
3109
3575
|
HTTP2_HEADER_PROTOCOL,
|
|
3110
3576
|
HTTP2_HEADER_SCHEME,
|
|
@@ -3127,6 +3593,25 @@ function SuperController(options) {
|
|
|
3127
3593
|
options.headers['content-type'] = local.req.headers['content-type']
|
|
3128
3594
|
}
|
|
3129
3595
|
|
|
3596
|
+
// x-forwarded-for check
|
|
3597
|
+
console.debug('[ CONTROLLER ][ HTTP/2.0#query ] checking x-forwarded-for');
|
|
3598
|
+
if (
|
|
3599
|
+
typeof(local.req.headers['x-forwarded-for']) != 'undefined'
|
|
3600
|
+
&& local.req.headers['x-forwarded-for'] != ""
|
|
3601
|
+
) {
|
|
3602
|
+
console.debug('[ CONTROLLER ][ HTTP/2.0#query ] options.headers', JSON.stringify(options.headers, null, 2));
|
|
3603
|
+
console.debug('[ CONTROLLER ][ HTTP/2.0#query ] local.req.headers', JSON.stringify(local.req.headers, null, 2));
|
|
3604
|
+
var xForwardedFor = local.req.headers['x-forwarded-for'];
|
|
3605
|
+
if ( xForwardedFor.split(", ").length > 1) {
|
|
3606
|
+
console.debug('[ CONTROLLER ][ HTTP/2.0#query ] found more than one proxy !');
|
|
3607
|
+
// keeping only the last in list
|
|
3608
|
+
xForwardedFor = xForwardedFor.split(', ').pop();
|
|
3609
|
+
options.headers['x-forwarded-for'] = xForwardedFor;
|
|
3610
|
+
}
|
|
3611
|
+
xForwardedFor = null;
|
|
3612
|
+
console.debug('[ CONTROLLER ][ HTTP/2.0#query ] options.headers["x-forwarded-for"]', options.headers['x-forwarded-for']);
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3130
3615
|
var headers = merge({
|
|
3131
3616
|
[HTTP2_HEADER_METHOD]: options[':method'],
|
|
3132
3617
|
[HTTP2_HEADER_PATH]: options[':path']
|
|
@@ -3134,7 +3619,11 @@ function SuperController(options) {
|
|
|
3134
3619
|
|
|
3135
3620
|
// merging with user options
|
|
3136
3621
|
for (var o in options) {
|
|
3137
|
-
if (
|
|
3622
|
+
if (
|
|
3623
|
+
!/^\:/.test(o)
|
|
3624
|
+
&& !/headers/.test(o)
|
|
3625
|
+
&& typeof(headers[o]) == 'undefined'
|
|
3626
|
+
) {
|
|
3138
3627
|
headers[o] = options[o]
|
|
3139
3628
|
}
|
|
3140
3629
|
}
|
|
@@ -3154,6 +3643,7 @@ function SuperController(options) {
|
|
|
3154
3643
|
}
|
|
3155
3644
|
|
|
3156
3645
|
|
|
3646
|
+
|
|
3157
3647
|
client.on('error', (error) => {
|
|
3158
3648
|
|
|
3159
3649
|
console.error( '`'+ options[':path']+ '` : '+ error.stack||error.message);
|
|
@@ -3289,7 +3779,7 @@ function SuperController(options) {
|
|
|
3289
3779
|
}
|
|
3290
3780
|
|
|
3291
3781
|
} catch (e) {
|
|
3292
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3782
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3293
3783
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3294
3784
|
var exception = new Error(msg);
|
|
3295
3785
|
exception.status = 500;
|
|
@@ -3367,7 +3857,7 @@ function SuperController(options) {
|
|
|
3367
3857
|
cb(err, data)
|
|
3368
3858
|
}
|
|
3369
3859
|
} catch (e) {
|
|
3370
|
-
var infos = local.options, controllerName = infos.controller.
|
|
3860
|
+
var infos = local.options, controllerName = infos.controller.substring(infos.controller.lastIndexOf('/'));
|
|
3371
3861
|
var msg = 'Controller Query Exception while catching back.\nBundle: '+ infos.bundle +'\nController File: /controllers'+ controllerName +'\nControl: this.'+ infos.control +'(...)\n\r' + e.stack;
|
|
3372
3862
|
var exception = new Error(msg);
|
|
3373
3863
|
exception.status = 500;
|
|
@@ -3502,11 +3992,11 @@ function SuperController(options) {
|
|
|
3502
3992
|
project = route.param.project;
|
|
3503
3993
|
} // TODO - add support for project pointer : getContext('gina').projects[project]
|
|
3504
3994
|
if (/\@(.*)$/.test(route.param.url)) {
|
|
3505
|
-
var targetedBundle = route.param.url.
|
|
3995
|
+
var targetedBundle = route.param.url.substring(route.param.url.lastIndexOf('@')+1);
|
|
3506
3996
|
hostname = targetedBundle +'@'+ project;
|
|
3507
3997
|
port = hostname;
|
|
3508
3998
|
var webroot = getContext('gina').config.envConf[targetedBundle][local.options.conf.env].server.webroot;
|
|
3509
|
-
path = (/\/$/.test(webroot)) ? webroot.
|
|
3999
|
+
path = (/\/$/.test(webroot)) ? webroot.substring(0, webroot.length-1) : webroot;
|
|
3510
4000
|
} else {
|
|
3511
4001
|
hostname = route.param.hostname;
|
|
3512
4002
|
port = route.param.port;
|
|
@@ -3560,24 +4050,28 @@ function SuperController(options) {
|
|
|
3560
4050
|
*
|
|
3561
4051
|
* */
|
|
3562
4052
|
this.getConfig = function(name) {
|
|
4053
|
+
var tmp = null;
|
|
3563
4054
|
if ( typeof(name) != 'undefined' ) {
|
|
3564
4055
|
try {
|
|
3565
|
-
//
|
|
3566
|
-
|
|
3567
|
-
//config = Object.freeze(local.options.conf.content[name]);
|
|
3568
|
-
//Object.seal(local.options.conf.content[name]);
|
|
3569
|
-
//Object.freeze(local.options.conf.content[name]);
|
|
3570
|
-
// if ( self.isCacheless() ) {
|
|
3571
|
-
// }
|
|
3572
|
-
return JSON.clone(local.options.conf.content[name]);
|
|
4056
|
+
// Needs to be read only
|
|
4057
|
+
tmp = JSON.clone(local.options.conf.content[name]);
|
|
3573
4058
|
} catch (err) {
|
|
3574
4059
|
return undefined;
|
|
3575
4060
|
}
|
|
3576
4061
|
} else {
|
|
3577
|
-
|
|
3578
|
-
// return JSON.parse(config)
|
|
3579
|
-
return JSON.clone(local.options.conf);
|
|
4062
|
+
tmp = JSON.clone(local.options.conf);
|
|
3580
4063
|
}
|
|
4064
|
+
|
|
4065
|
+
if (
|
|
4066
|
+
getContext('isProxyHost')
|
|
4067
|
+
&& typeof(tmp.hostname) != 'undefined'
|
|
4068
|
+
) {
|
|
4069
|
+
tmp.hostname = process.gina.PROXY_HOSTNAME;
|
|
4070
|
+
tmp.host = process.gina.PROXY_HOST;
|
|
4071
|
+
// tmp.hostname = getContext('gina').config.envConf._proxyHostname
|
|
4072
|
+
// tmp.host = tmp.hostname.replace(/^(https|http)\:\/\//, '');
|
|
4073
|
+
}
|
|
4074
|
+
return tmp;
|
|
3581
4075
|
}
|
|
3582
4076
|
|
|
3583
4077
|
/**
|
|
@@ -4002,7 +4496,7 @@ function SuperController(options) {
|
|
|
4002
4496
|
//instance: self.serverInstance,
|
|
4003
4497
|
//template: (routeHasViews) ? bundleConf.content.templates[templateName] : undefined,
|
|
4004
4498
|
//isUsingTemplate: local.isUsingTemplate,
|
|
4005
|
-
//
|
|
4499
|
+
//isCacheless: isCacheless,
|
|
4006
4500
|
path: null //, // user custom path : namespace should be ignored | left blank
|
|
4007
4501
|
//assets: {}
|
|
4008
4502
|
};
|
|
@@ -4228,11 +4722,11 @@ function SuperController(options) {
|
|
|
4228
4722
|
, ext = null
|
|
4229
4723
|
, isHtmlContent = false
|
|
4230
4724
|
, hasCustomErrorFile = false
|
|
4231
|
-
, eCode = code.toString().
|
|
4725
|
+
, eCode = code.toString().substring(0,1) + 'xx'
|
|
4232
4726
|
;
|
|
4233
|
-
var extArr = url.
|
|
4727
|
+
var extArr = url.substring(url.lastIndexOf('.')).match(/(\.[A-Za-z0-9]+)/);
|
|
4234
4728
|
if (extArr) {
|
|
4235
|
-
ext = extArr[0].
|
|
4729
|
+
ext = extArr[0].substring(1);
|
|
4236
4730
|
}
|
|
4237
4731
|
if ( !ext || /^(html|htm)$/i.test(ext) ) {
|
|
4238
4732
|
isHtmlContent = true;
|
|
@@ -4306,8 +4800,7 @@ function SuperController(options) {
|
|
|
4306
4800
|
|
|
4307
4801
|
local.req.routing = routeObj;
|
|
4308
4802
|
local.req.params.errorObject = errorObject;
|
|
4309
|
-
self.renderCustomError(local.req, res, local.next);
|
|
4310
|
-
return;
|
|
4803
|
+
return self.renderCustomError(local.req, res, local.next);
|
|
4311
4804
|
}
|
|
4312
4805
|
|
|
4313
4806
|
}
|
|
@@ -4390,7 +4883,7 @@ function SuperController(options) {
|
|
|
4390
4883
|
return next();
|
|
4391
4884
|
}
|
|
4392
4885
|
|
|
4393
|
-
if ( /http\/2/.test(protocol) ) {
|
|
4886
|
+
if ( stream && /http\/2/.test(protocol) ) {
|
|
4394
4887
|
return stream.end();
|
|
4395
4888
|
}
|
|
4396
4889
|
|