Deployment with Password using Linux in Meteor? - meteor

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

Related

How do I add a webjob to my aspnet appservice using only the CLI

I am working on macOS with an external text editor (NOT VisualStudio).
I have an asp.net project that I push to my app service using
git push azure main:master
the remote is configured as such https://$name:pass#name.scm.azurewebsites.net:443/name.git
when I go to the web jobs section in the app service to add a web job, I get the error message:
I want to continue using my source control push method while developing...
however I would also like to add a csharp console webjob .
I have followed the tutorial here (A) https://learn.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started, and have a functoining console app that consumes a message from a queue.
How can I push this extra console app to my Kudu instance?
I read here that there is a 'hidden' structure not in the main doucmentation (A) I linked above for the tutorial: https://github.com/projectkudu/kudu/wiki/WebJobs.
Do I have to manually zip the result of dotnet publish -c Release to some Kudu folder? Or is there a more elegant way by somehow including this project inside my git repo that I push normally... or using an az cli tool to push the webjob to the app?
I created the Web Job and tried to Add it from App service, got the below error.
Using Azure CLI, we can deploy our Web Jobs to App Service
Web Jobs need to be deployed to the below folder in KUDU Console, Create a folder with Web Job Name in the below path
app_data\jobs\triggered\NewFolder
Zip all the contents of the Web Job into one folder.
wwwroot folder path will be read-only mode, we need to enable it by setting WEBSITE_RUN_FROM_PACKAGE to 1
Set the WEBSITE_RUN_FROM_PACKAGE to 1 in WebApp => Configuration => Application Settings or run the CLI command to set it.
az webapp config appsettings set --resource-group YourRGName --name AppServiceName --settings WEBSITE_RUN_FROM_PACKAGE="1"
Zip deploy Web Job to the existing Azure App service
az webapp deployment source config-zip --resource-group YourRGName --name YourAppService --src YourZipFilePath
We can directly drag and drop the Web Jobs Zip folder from the KUDU Console as well
We can deploy our Web Jobs in many ways.
We can FTP / Use Build Pipelines/ Zip Deploy.
Found a way to push directly using az cli
az webapp deploy --name $APP_NAME -g $RG \
--src-path program.py \
--type static \
--target-path /home/site/Jobs/continuous/Job$RANDOM/program.py
for larger programs in .net I just dumped the project on Kudu, unzipped, and rebuilt (I'm on a mac m1 so can't build against x64 without some hoops, this was easier workaround)
# on my machine
az webapp deploy --name $APP_NAME -g $RG \
--src-path path_to_dotnet_project.zip \
--type static \
--target-path /home/site/Jobs/continuous/Job5/myproject.zip
then on the app service (using kudu cmd/powershell)
cd /home/site/Jobs/continuous/Job5
unzip myproject.zip
dotnet build -c Release
cp bin/release/net6.0/* /home/site/Jobs/continuous/MyNewJob
#job in MyNewJob automatically starts since this is in the 'continuous' folder

How do I read a file from the local file system from inside a meteor app?

I have a meteor app that needs to periodically read a file located on the host's file system, outside of the app package. I am using node's fs to accomplish this, and it works fine on my (macOS) development machine.
However, when I run mup deploy to deploy it to my (Ubuntu 14) server, mup returns the following error after starting meteor:
Error: ENOENT: no such file or directory, open '/home/sam/data/all_data.json'
at Object.fs.openSync (fs.js:652:18)
at Object.fs.readFileSync (fs.js:553:33)
Does anyone know why this might be happening?
you should follow mup documentation closely. Have you seen volumes setup in mup config? Try this to solve your issue.
Reason: mup runs app in docker without any access to host file system unless specified. Volumes setup does this for you with mup deployment.
Below is the part of mup config from http://meteor-up.com/docs.html, Everything Configured, read more to get a better idea.
name: 'app',
path: '../app',
// lets you add docker volumes (optional). Can be used to
// store files between app deploys and restarts.
volumes: {
// passed as '-v /host/path:/container/path' to the docker run command
'/host/path': '/container/path',
'/second/host/path': '/second/container/path'
},
The user you have that is running your meteor build on the server needs to have access to that folder - read access. I would store the file in a different directory than the home one, because you don't want to mess it up. Either way doing something like chmod -R 444 /home/sam/data should give read access to any user for all files in that directory. You are probably running meteor as your local user(sam?) in development mode on your macOS, but the built up gets run as meteor or some other user on ubuntu, because of mup and forever.

Unable to publish to an NPM Registry (local)

I am running Nexus 3.0.1-01, and am using it to host both Maven repositories and NPM registries. For NPM, I have a local mirror of npmjs.org, a local NPM registry and a group that combines the two...
I have been using this with npm internally, where I can use the npm-public group as my registry and this has been working fine. So, I can use Nexus to mirror npmjs.
The next step is to take locally written npm modules and publish them to npm-releases (on my Nexus instance) so that these modules can be shared amongst the delivery teams here. I've been able to build out a package, and npm pack seems to behave.
I have run npm adduser to provide my Nexus credentials to my npm environment. I am using the same username/password I use when I log into the Nexus web app, and my user is assigned the admin role (so I should have all permissions). I can see the credentials in my .npmrc file
My registry value is still the npm-public group which combined the mirror and my local registry. I have ensured that the package.json of the module I am attempting to deploy has a "publishConfig" section that points to the url of the local registry (not the public group)
However, despite all of that, calling "npm publish" results in a 401 error...
Looking at the npm-debug.log, I can see it's attempting to call the HTTP PUT call to push the assembled tgz file to the registry, and this is returning a 401 error
I have enabled debug logging on the shiro package in the server, but I only ever see a single message thinking it needs authentication
2016-09-13 08:56:28,590+1000 DEBUG [qtp1257823896-4030] *UNKNOWN org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter - Authentication required: sending 401 Authentication challenge response.
According to the documentation, I've done all I'm supposed to do (npm add user) but I am unable to successfully deploy an npm module to my local repository.
Are there additional options I need to use when calling npm publish? Are there additional settings I need to make to the hosted npm repository in my server that will allow me to publish to it? I pretty much created it using the default values. Have I missed a step that is preventing me from deploying to my hosted npm registry?
Any help would be greatly appreciated, as I am stuck at the moment.
As it turns out, I did not have the Npm Bearer Token Realm in my list of active realms. Once I moved it to Active, the publish completed successfully!
Additonally to #EdH's answer we discovered that the format of .npmrc has changed so base64 encoded _auth will not work anymore... and the token has to be created by logging into the repo.
old .npmrc
registry=https://host/repo
_auth=12afdjsljl123213
new .npmrc
//host/repo/:_authtoken=uuidOfToken
Additionally to #Daniel's answer, I discovered that when adding user credentials/logging into npm, you can't have a trailing slash on the registry url.
Bad:
npm adduser --registry=https://repo.localhost/repository/npm-internal/
Good:
npm adduser --registry=https://repo/repository/npm-internal
Also, if you're looking to automate the login (i.e. non-interactively), I used a good tool called npm-cli-login.
npm-cli-login -u admin -p admin123 -e nick#foo.bar -r https://repo/repository/npm-internal
I realize that this post is a couple years old now, but as of struggling with this issue for many hours, I finally found what worked for me that I've not seen in many other places. The problem was that I was not specifying the _authToken within the .npmrc file. Adding this as shown below resolved the issue and I was able to successfully run npm commands without a 401 error.
.npmrc
registry=https://test.repo.com/repository/npm-group/
//test.repo.com/repository/npm-group/:_authToken=NpmToken.${NPM_TOKEN}
Another reason why you might get such an error is that you might have enabled anonymous access to the server for the 'npm Bearer Token Realm'. After disabling anonymous access you must also remove .npmrc and re-add the registry and adduser.

How do I remove a subdomain that I created on meteor.com

I created a subdomain on meteor.com to try it out, but now I'm moving on to a new domain so want to remove the existing subdomain on Meteor. I didn't set any password to the subdomain. I'm really confused on how to remove it from meteor.com. I also deleted the local repository that I had from my machine. Please help.
You can do it through the command line like you did to deploy on meteor.com.
To delete a meteor.com deployment, just run the same command with the --delete flag:
# navigate to your Meteor project
cd /...
meteor deploy --delete
According to the command documentation:
The --delete flag permanently removes a deployed application, including
all of its stored data.
You can always get more information about a command by running meteor help followed by the command name:
meteor help deploy
Just wanted to make an addition to it for those following this thread.
meteor deploy <example.meteor.com> --delete (This is the proper command. Replace example with your subdomain)
You might want to login to your local repo before initialising the --delete command
meteor login --email 'email-id-used-to-login-at-meteor.com'
You'll be prompted to input email-id and password. Then you're logged in!
Hope this helps.

See git commit hash of running Dokku app?

I am running a Dokku app in production and need to know what version of the app is running on the server.
Is this possible with Dokku?
There's no need for a plugin.
All apps in dokku are git bare repositories. Just connect to your server, switch to the app directory (mine are in /home/dokku/<app-name>) and run a git log. That should do the trick as well.
To get the current git commit hash for a dokku app just run
dokku config:get <myapp> GIT_REV
Yes, you can add the SHA1 of the latest git commit using this plugin: https://github.com/dokku-alt/dokku-alt/tree/master/plugins/dokku-git-rev
There are many other alternatives based on different scenarios and different environments. If you are deploying Node.JS apps and using package.json properly, you can easily parse out the version using the fs standard lib; JSON.parse(fs.readFileSync('package.json')).version
You can also do dokku config:show myapp | grep GIT_REV to get it from the app's environment variables. The above command assumes your app name is myapp.
The fastest way to do this is to issue this command:
dokku config:get GIT_REV
This queries the server for the git revision that was most recently deployed. During deployment the GIT hash is set as an envirnoment variable, that's why it's possible to get with config:get.
You can also just bash into your doku app and echo $GIT_REV

Resources