I'm using Meteor.Settings to access secrets stored within a settings.json.
Everything works fine using meteor --settings settings.json, but ideally i'd like to just call meteor and have it automatically pick up the settings. Is there a meteor way of specifying default options to the meteor cli? E.g. a file like meteor.opts that would contain flags?
That is what the --settings command is for. I can't see the issue with just running with the --settings command
Related
I am facing an issue where the build process of my Symfony application fails, as explained in many different forums (none recent). For instance:
When doing composer install with --no-dev only the production packages
are installed (as it should be). However when composer launches the
symfony scripts they are launched in development modes and thus start
throwing errors when AppKernel.php can not find packages needed for
development. These scripts should also be executed in production mode!
Quote source
The above Github issue is closed, as it apparently can be fixed by setting the SYMFONY_ENV env variable to the environment of your choice: export SYMFONY_ENV=prod.
I have done that, and calling printenv correctly prints the variable. I can even call the Symfony console php bin/console manually. and it will launch in prod environment.
Success? Seemingly, but no... Calling composer install still forces all scripts to launch in dev environment. What gives?
The root cause appears to be the environment variable not being set globally, so whatever user the commands ended up running as, www-data via my deploy script, or root(as I called sudo composer?) from the console, did not have the environment variable set that I created with my default user.
Adding SYMFONY_ENV=prod on a new line in /etc/environment, and then restarting fixed the issue, and the scripts are now running in prod.
I am trying to use Visual Studio Code as an alternative to Webstorm to edit and debug a toy Meteor app. After installing the MeteorHelper extension which is announced as provided "Meteor CLI integration into VSCode" and try to run any Meteor command I get the error msg:
"X is not a meteor project directory, check your workspace definition".
I don't know whether the problem is the LOCATION of my directory X, or its CONTENT (something is missing?). I changed the meteorhelper.relativeProjectPath string in the settings.json file to various possible values to no avail.
Has anyone out there tried to use VSCode to edit and debug a Meteor app and got that error?
A Meteor project directory is what gets created when using the command:
meteor create my-app
This command creates a folder that contains your Meteor applications' code. Typically, the directory structure looks something like this:
my-app/
.meteor/
client/
imports/
server/
package.json
The error you're describing would be encountered while attempting to run a project-specific meteor command from outside of a Meteor project. In the above example, I would access the project directory by first entering
cd my-app
on the command line.
For those who use Digital Ocean for hosting and mupx for deployment:
I can not successfully implement usage of settings.json file to run on deployment. Previously it caused failure of deployment, and now, for instance, when I tried to add the package okgrow:analytics, it doesn't work and this appear on browser console:
Missing analyticsSettings in Meteor.settings.public
although it is there.
{
"public": {
"analyticsSettings": {
"Google Analytics" : {
"trackingId": "xxxxxxx"
}
}
}
}
When running locally, one has to type meteor --settings settings.json to start the app. Is there something equivalent for the mupx? How can I configure accordingly?
Needless to say, I need settings.json for sensitive data which shall be ignored for git as well. Perhaps just meteor command should first check if settings.json exists, and accordingly run with the settings inside (if any). Then one doesn't need to type meteor --settings settings.json...
I realised my problem was due to having the settings.json file in the root of the project rather than within the mupx deploy folder.
It was sufficient, then, to just run mupx deploy
I'm trying to deploy a site to firebase.
firebase init worked fine. I then ran firebase bootstrap and chose the tetris template. So far so good. But when I run firebase deploy I get Preparing to deploy Public Directory... and then it just hangs forever.
How can I figure out what's going wrong?
Random info in case it helps:
My firebase-tools is version 1.0.1; node is version 0.8.20; npm is version 1.4.23. I ran sudo npm install -g firebase-tools to get the CLI. I'm running on a debian chroot on Android 4.4.3 device. My wifi works fine. On a lark I even tried running sudo firebase deploy in case it depends on ICMP packets or something, but there was no difference.
Firstly, the main reason it's not working is that Node.js version 0.10 or greater is required.
However, even once you've upgraded Node (and I'd recommend getting the latest of firebase-tools too) you're likely to be attempting to deploy the directory that you ran the initial firebase init command from, or at least the folder you specified in the setup (which defaults to the folder you ran the command from).
You should change directory and run the firebase deploy command from the folder that was created by the bootstrap command - which would have been named after the name of the Firebase it was created with, and you can delete the firebase.json file created in the parent directory.
The reason is that firebase init and firebase bootstrap are two different ways of doing the same thing - getting a folder in a deployable state. firebase init is for existing projects with files that will eventually be deployed, and firebase bootstrap is for creating a project from one of the existing templates. By running both, the initial firebase init would have created a firebase.json file containing the settings specified by the prompts, and then the firebase bootstrap command would have created a whole new sub-folder with its own firebase.json for the different settings.
How to deploy a app with password in meteor using linux. It's deploy good when with out set password.But i need to deploy app with password in meteor. I did but gets some error messages i didn't understand the following messages.So please see the below deployment process and suggestions me what to do?
[root#localhost myapp]# meteor deploy myapp.meteor.com --password
deploy: the --password option needs a value.
Try 'meteor help deploy' for help.
[root#localhost myapp]# meteor deploy myapp.meteor.com 123456
deploy: too many arguments.
Usage: meteor deploy <site> [--settings settings.json] [--debug] [--delete]
Deploys the project in your current directory to Meteor's servers.
You can deploy to any available name under 'meteor.com'
without any additional configuration, for example,
'myapp.meteor.com'. If you deploy to a custom domain, such as
'myapp.mydomain.com', then you'll also need to configure your domain's
DNS records. See the Meteor docs for details.
The --settings flag can be used to pass deploy-specific information to
the application. It will be available at runtime in Meteor.settings, but only
on the server. If the object contains a key named 'public', then
Meteor.settings.public will also be available on the client. The argument
is the name of a file containing the JSON data to use. The settings will
persist across deployments until you again specify a settings file. To
unset Meteor.settings, pass an empty settings file.
The --delete flag permanently removes a deployed application, including
all of its stored data.
Options:
--delete, -D permanently delete this deployment
--debug deploy in debug mode (don't minify, etc)
--settings set optional data for Meteor.settings
--star a star (tarball) to deploy instead of the current Meteor app
[root#localhost myapp]#
Perhaps you should use both command and option:
meteor deploy myapp.meteor.com --password 123456