Commit Graph

189 Commits

Author SHA1 Message Date
David Glasser
d4d349ca96 Don't overly escape Meteor.settings.public
Fixes #3730.

Testing Done:
Manual testing based on the report in #3730. Also confirmed that `</script>` is not a problem.

I would have added a test-packages test but there's no easy way to override Meteor.settings in test-packages.

Bugs closed: 3730

Reviewed at https://rbcommons.com/s/meteor/r/1/
2015-02-17 18:01:01 -08:00
Slava Kim
9a95c83b2a Don't use SIGUSR2 to communicate "refresh client program" from proxy to app
process. Use an ipc message instead.
2015-02-10 15:11:38 -08:00
David Glasser
7c40c3c5a6 Remove legacy proxy-binding
Also remove SIGHUP handler. This was designed for a legacy system, and
SIGHUP would be a better fit for what autoupdate currently uses SIGUSR2
for.  This includes removing some code in the ddp server to close
sockets on SIGHUP.
2015-01-29 14:03:11 -08:00
David Glasser
9023cccc28 Clean up PR 2015-01-09 15:53:49 -08:00
Tarang Patel
f319109634 Update webapp_server.js 2015-01-09 15:49:04 -08:00
Tarang Patel
5aba891199 Update webapp_server.js 2015-01-09 15:49:04 -08:00
David Glasser
096df9d62d Refactor parent pid check; drop --keepalive
This commit moves parent pid process from the webapp package to the boot
script. This means that daemonized apps without webapp will also exit
when the runner exits, if run from the runner. (For example, several
self-tests such as 'autoupdate' no longer leak node processes.) This is
controlled via the $METEOR_PARENT_PID environment variable instead of
from command line arguments, in order to make fewer assumptions about
how Meteor apps process arguments.

This also drops the old --keepalive support (which already has stopped
being used by the dev mode runner or any MDG deployment platforms).
Neither --parent-pid nor --keepalive were documented beforehand, and
--keepalive was already deprecated before 1.0.

These flags used to also incidentally trigger printing the LISTENING
line; this is now controlled by $METEOR_PRINT_ON_LISTEN.

Fixes #3315.
2015-01-05 15:48:32 -08:00
Tom Coleman
b04509389e Don’t apply the CDN prefix on cordova. #3278
Cordova serves assets directly from the device so it doesn’t make sense to hit the CDN for them. Besides it causes issues because they are served from /__cordova (on the real webserver) anyway.
2014-12-18 17:19:56 +11:00
Emily Stark
24d8fec98f Check for parent process only every few seconds.
Fixes #3252. Also probably fixes #2890, which we might have misattribued
to file watching in the tool process.
2014-12-07 09:34:45 -08:00
Emily Stark
70054e379d Use Meteor.absoluteUrl() to set ROOT_URL for cordova clients.
If we use `__meteor_runtime_config__.ROOT_URL` directly, as we were
previously, then we end up sending Cordova clients to http:// URLs even
if force-ssl is being used in the app. This is fairly bad on its own
(always sending cordova clients to http:// URLs instead of https://),
but made even worse by the fact that we don't set CORS headers on
force-ssl redirects (that is, the app breaks completely if the client
makes a DDP connection to an http:// URL for a force-ssl app).
2014-10-23 10:31:22 -07:00
Mitar
c2c92d9c44 Fixed comment. 2014-10-20 17:44:46 -07:00
Emily Stark
bb29469856 Replace runtime config regression selftest with simpler unit test 2014-10-08 14:28:24 -07:00
Emily Stark
a10b525494 Clone __meteor_runtime_config__ before extending it 2014-10-08 14:04:38 -07:00
Emily Stark
07f0c56a85 Preserve --mobile-server setting across hot code pushes.
The server sends hot code push updates to mobile clients with ROOT_URL
and DDP_DEFAULT_CONNECTION_URL taken from the MOBILE_ROOT_URL and
MOBILE_DDP_URL environment variables. These are set by the main meteor
process when it starts the app runner.
2014-10-03 15:46:43 -07:00
David Greenspan
0f4f77f8a2 Fix #2627 (source maps with a PATH_PREFIX)
When you set ROOT_URL_PATH_PREFIX, source maps are not found because the server serves them at a different path from where the client looks for them.

I don’t understand this code super well, but based on what’s reported in issue #2627, the new code seems strictly more correct than the old code.
2014-09-29 12:15:13 -07:00
Emily Stark
f510cd0174 Simplify validPid, thanks Ben 2014-09-26 14:42:12 -07:00
Emily Stark
1797d28d0e Factor out check for valid --parent-pid and add tests. 2014-09-26 14:36:40 -07:00
Emily Stark
a8d77fb91a Fix check for valid parent id.
Parse as decimal (which means you can't specify --parent-pid in hex,
that's fine). And convert back to string to check that the whole string
was parsed as an int (i.e. "123foobar" should not be converted to
"123").

Thanks Slava and Avital.
2014-09-26 14:23:57 -07:00
Emily Stark
6041122944 Exit immediately if --parent-pid doesn't look like an integer.
If you pass "--parent-pid foobar", then we immediately log an error
message and exit. This check happens via `parseInt` rather than testing
for exceptions in `process.kill(parentPid, 0)` because `process.kill`
converts its pid argument to an integer, so `process.kill('foobar', 0)`
returns true just as `process.kill(0, 0)` does.
2014-09-26 14:01:19 -07:00
Emily Stark
c592ec91ad Add comment about pid reuse to startCheckForLiveParent 2014-09-25 15:33:32 -07:00
Emily Stark
af3fe5624b Replace keepalives with a check if the parent pid is still running.
Downsides:
* Doesn't catch the case where the parent is CPU-hogging (but maybe we
  don't want to catch that case anyway, since the bundler not yielding
  is what's causing #2536).
* Could be fooled by pid re-use, i.e. if another process comes up and
  takes the parent process's place before the child process dies.

Untested so far because I haven't been able to actually kill a parent
process in such a way that the child stays alive.
2014-09-25 15:30:17 -07:00
Slava Kim
b19b269dc9 Use wrapAsync instead of Future.wrap 2014-09-23 15:00:43 -07:00
Emily Stark
ccfee68145 Merge branch 'master' into devel
Conflicts:
	docs/client/api.html
	docs/client/data.js
	docs/client/names.json
	meteor
	packages/autoupdate/package.js
	packages/base64/.gitignore
	packages/constraint-solver/package.js
	packages/device-orientation/.gitignore
	packages/less/package.js
	packages/meteor-tool/package.js
	packages/meteor/package.js
	packages/package-version-parser/package.js
	packages/webapp/webapp_server.js
	scripts/admin/meteor-release-experimental.json
	tools/commands.js
	tools/help.txt
	tools/package-version-parser.js
	tools/run-all.js
	tools/tests/apps/build-errors/packages/with-colon-plugin/.gitignore
2014-09-15 14:48:57 -07:00
Emily Stark
5dca0bb99a Fix html attributes in boilerplate generation.
We were not passing html attributes through to the Boilerplate object,
so appcache manifest was never showing up in the <html> tag. Add
'extraData' to `Boilerplate.toHTML` so that we can specify the html
attributes at request time.
2014-09-11 16:43:02 -07:00
Slava Kim
939bf1bc07 Fix a regression in __cordova paths 2014-09-09 16:38:11 -07:00
Matthew Arbesfeld
ec30f42945 Scope cordova path by using using __ prefix 2014-09-09 16:19:03 -07:00
Slava Kim
10599e5bc5 Hot Code Push working with pushing new boilerplate
at least on iOS
2014-09-09 15:56:11 -07:00
Matthew Arbesfeld
05b2765d61 Clean up serving of manifest.json 2014-09-06 11:02:26 -04:00
Slava Kim
497e47ca5b Another fix for webapp test and behavior.
The previous commit didn't really fix the issue
2014-09-05 15:31:06 -07:00
David Glasser
aa7bc6b2b9 Update a source map comment. 2014-09-04 16:13:45 -07:00
Slava Kim
620b095ec8 Invalidate memoization of boilerplate
Fixes bug introduced on the cordova-hcp branch. Fixes #2498
2014-09-03 12:07:33 -07:00
Slava Kim
3df58956e1 Emily's comments on webapp change 2014-09-02 14:59:22 -07:00
Slava Kim
f3d0c24d2e Invalidate memoization of boilerplate
Fixes bug introduced on the cordova-hcp branch. Fixes #2498
2014-09-02 14:57:33 -07:00
Slava Kim
d4f8f8ce25 Don't serve the manifest for Cordova program if such program is not present 2014-08-26 16:04:26 -07:00
Slava Kim
c6047a9cdf Implement public Meteor.settings for Cordova builds 2014-08-18 14:07:40 -07:00
Slava Kim
88edda5557 Extract WebApp-Hashing and use it from tool for Cordova builds 2014-08-15 17:38:16 -07:00
Slava Kim
fcdeda957d Revert "Remove unused webapp_server code"
This reverts commit 963a16f5f1.

It is not unused
2014-08-15 16:43:04 -07:00
Matthew Arbesfeld
c463a62477 Omit autoupdateCordova from hash 2014-08-15 16:06:07 -07:00
Matthew Arbesfeld
963a16f5f1 Remove unused webapp_server code 2014-08-15 14:48:25 -07:00
Slava Kim
e3ae279a60 more code duplication for having a separate update version for cordova 2014-08-15 14:46:45 -07:00
Slava Kim
5fbe4aea66 Hot Code Push executes the saved code after the bundled code 2014-08-14 20:32:41 -07:00
Slava Kim
348d765f65 wip 2014-08-14 17:00:12 -07:00
Matthew Arbesfeld
3c7ed69f6b Fix client.* -> web.* 2014-08-06 13:51:31 -07:00
Matthew Arbesfeld
9f2ee36e60 Merge branch 'packaging' into cordova-hcp
Conflicts:
	packages/constraint-solver/constraint-solver-tests.js
	packages/constraint-solver/constraint-solver.js
	packages/less/plugin/compile-less.js
	packages/meteor/plugin/basic-file-types.js
	packages/star-translate/translator.js
	packages/stylus/plugin/compile-stylus.js
	packages/templating/plugin/compile-templates.js
	packages/webapp/webapp_server.js
	tools/bundler.js
	tools/commands.js
	tools/compiler.js
	tools/package-source.js
	tools/run-app.js
	tools/selftest.js
	tools/tests/old/test-bundler-assets.js
	tools/tests/old/test-bundler-options.js
	tools/unipackage.js
2014-08-06 13:43:56 -07:00
Matthew Arbesfeld
8bcbd65344 Separate "browser" target into web.browser/cordova
Cordova projects often have a different set of files than web targets,
so we would like to be able to target different client architectures in
our bundles. Ideally, we allow the user to use arbitrary client
architectures - but this patch is a step in the right direction by
abstracting out more of the hard coded "browser"/"os" lines.

We accomplish this separation in a backwards compatible way by allowing
api.___ commands to target a "client" architecture. For example,
api.addFiles('a.js', 'client') adds 'a.js' to both the 'client.browser'
and 'client.cordova' targets.

Effects on 0.9 packaging stuff: packages don't have to change, but the
"data.json" file in ".meteor0" has "browser" in some places. We think we
have to fix the troposphere code where this data.json is created.

Some plugins will also be backwards-incompatible with this change, since
many have a "clientArch.matches("browser")" line in the plugin
code. Ideally, we fix plugins so that this stops being an issue, but for
now package authors can just patch that line.

At the compiled (unipackage) level the new names are 'web.browser' and
'web.cordova', replacing 'browser'. In package.js, the new names are
'client.browser' and 'client.cordova', serving as an adjunct to 'client'.
2014-07-31 14:12:15 -07:00
Matthew Arbesfeld
71f2798205 Add a DEFAULT_DDP_CONNECTION_URL and fix visible:hidden tag 2014-07-29 22:45:50 -07:00
Matthew Arbesfeld
3ea5e6d033 Hot code push works! yay 2014-07-29 15:43:32 -07:00
Matthew Arbesfeld
71966f407a Turn off auto-reload. Still not able to remove initial script from page 2014-07-29 04:38:46 -07:00
Matthew Arbesfeld
ae8c412c38 Fixed webapp tests for additional static files and __meteor_runtime_config__ 2014-07-28 11:57:28 -07:00
Slava Kim
c6b6e71fed Extract the Boilerplate generating code into a separate package 2014-07-25 18:56:14 -07:00