Report this

What is the reason for this report?

Droplet Environment Variables Disappearing

Posted on February 3, 2017

I have a Ghost droplet that I recently noticed was not taking image uploads as indicated by the following code that appeared when I tried to upload from the markdown editor file explorer ![]([object Object]). As a result I decided to ssh into my droplet to check out my config file where I am using environment variables to store images to my s3 bucket and noticed when I ran printenv that my environment variables were not there. I decided to set the env variables again like so: export AWS_ACCESS_KEY=*KEY ID* and ran printenv again and the key was there, but ssh’ing into the droplet a day later and the AWS_ACCESS_KEY is gone. Am I setting the env variables correctly? Any reason why they would disappear? I tend to run service ghost restart after setting them, but this didn’t reset the env variables.

Here is the storage configuration in my config.js:

storage: {
        active: 'ghost-s3',
        'ghost-s3': {
         accessKeyId: process.env.AWS_ACCESS_KEY,
         secretAccessKey: process.env.AWS_SECRET_KEY,
         bucket: process.env.S3_BUCKET,
         region: process.env.S3_REGION,
         assetHost: process.env.S3_URL
        }
        },

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.