How to set APNS Auth path on Heroku vapor app - swift

How do you reference a file path when a vapor swift application is deployed on Heroku? This works on my local, but not when I deploy to Heroku. the local machine I added file path in environment variable like this APNS_AUTH_KEY_PATH: $(SRCROOT)/apikeys/AuthKey_Y8HP6L5K6P.p8 and it's working fine on the local machine. Added the same key path on the Heroku application config variable. But its saying, not able find file and application crashed on Heroku

{SRCROOT} is an Xcode concept that doesn't translate to Linux. So you either have to copy the key over into Heroku and reference the fully qualified path or just inject the contents of the key as the environment variables itself. The second option is far better as you're not committing the key into source control

Related

How can I securely store a google keys file on deploy?

Im using the Adonis GCS Drive and it uses the following environment variables:
GCS_KEY_FILENAME
GCS_BUCKET
So I went on the Google Cloud Console and generated it. On the GCS_KEY_FILENAME I set the path to the GCS Key File. And now Im not sure how can I deploy this.
I though on create the file dinamically by setting env variables with the file info, but Im not sure if its the best solution.
Obs: I intend to deploy to heroku.

Why is the gcloud sdk's deploy command looking at my home directory for files?

I'm attempting to deploy a python server to Google App Engine.
I'm trying to use the gcloud sdk to do so.
It appears the command I need to use is gcloud app deploy.
I get the following error:
me#mymachine:~/development/some-app/backend$ gcloud app deploy
ERROR: (gcloud.app.deploy) Error Response: [3] The directory [~/.config/google-chrome/Default/Cache] has too many files (greater than 1000).
I had to add ~/.config to my .gcloudignore to get past this error.
Why was it looking there at all?
The full repo of my project is public but I believe I've included the relevant portion.
I looked at your linked repo and there aren't any yaml files. As far as I know, a GAE project needs an app.yaml file because that file tells GAE what your runtime is so that GAE knows how to deploy/run your code. In fact, according to the gcloud app deploy documentation, if you don't specify any yaml files to be deployed, it will default to app.yaml in the current directory. If it can't find any in the current directory, it will try to build one.
Your repo also shows you have a Dockerfile. GAE documentation for custom runtimes says ...Custom runtimes let you build apps that run in an environment defined by a Dockerfile... In the app.yaml file for custom runtimes, you will have the following entry
runtime: custom
env: flex
Since you don't have an app.yaml file and you have a Docker file in which you are downloading and installing Chrome, it seems to me that gcloud app deploy is trying to infer your runtime and this has led to it executing some or all of the contents of the Dockerfile before it attempts to then push it to Production. This is what is making it take a peek at the config file on your local machine till you explicitly tell it to ignore it. To be clear, I'm not 100% sure of this, just trying to see if I can draw a logical conclusion.
My suggestion would be to create an app.yaml file and specify a custom runtime. Or just use the python runtime with flex

How can an extension obtain remote URL of file in currently connected remote server?

I'm writing an extension targeted for VSCode Remote environment.
In this setup, one extension (UI extension) runs in client and another (workspace extension) runs in remote server.
Now, here's a question - is there any way to generate an URL that can be used by UI extension to access file on the server?
I know I can use vscode-remote://ssh-remote+<hostname>/file/on/server syntax to express this type of remote URL, but the issue here is that I cannot find any way for extension to discover one. Using vscode.Uri.file() API only generates file: URL, which is meaningless for UI extension running in client environment.
Since vscode-remote: scheme is fixed and ssh-remote part can be extracted from vscode.env.remoteName variable, the last piece I need is the hostname that was used to open current VSCode Remote session. Is there any API/variable to discover this?

Does Angular 5+ has similar global variable data like web.config in asp.net?

In asp.net web application, we can save some settings or key attribute in web.config like database connection string, key variable like salt, api url or ftp location which won't be exposed to outside user, while when working in Angular 5 project,
where can we store these information?
I noticed there is an environment.ts file in environment folder
but not sure whatever stored in this environment.ts file would be
exposed to outside?
And also there is a environment.prod.ts file, if my setting on
dev would be same as prod, does it mean we need to copy everything
from environment.ts to environment.prod.ts file?

Local configuration in deployed Clojure apps

What is the idiomatic way to store and retrieve configuration settings in a deployed Clojure Luminus app?
In the Luminus template on which I base my app, the profiles.clj file is used to store the database connection string. However, when I compile the app using lein uberjar the profiles.clj settings do not seem to be included in the compiled file. And I would nevertheless not want the database connection to be stored in the compiled file but rather reside in a configuration file on the production server.
Optimally, local configurations should be stored and retrieved in the same manner regardless of whether the app is run in development or production mode. But I can't figure out how to do it.
You may be interested in using the environ library. From their README:
Let's say you have an application that requires a database connection. Often you'll need three different databases, one for development, one for testing, and one for production.
Lets pull the database connection details from the key :database-url on the environ.core/env map.
(require '[environ.core :refer [env]])
(def database-url
(env :database-url))
The value of this key can be set in several different ways. The most common way during development is to use a local profiles.clj file in your project directory. This file contained a map that is merged with the standard project.clj file, but can be kept out of version control and reserved for local development options.
{:dev {:env {:database-url "jdbc:postgresql://localhost/dev"}}
:test {:env {:database-url "jdbc:postgresql://localhost/test"}}}
The http://www.luminusweb.net/docs/environment.md#edn_based_configuration page helped me.
java -Dconf=config.edn -jar app.jar will start a compiled app with the configurations stored in config.edn.