npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ghost-s3-file-store

v0.0.3

Published

Configures Ghost to allow for files to be uploaded to AWS S3 for hosting rather then living on the file system

Downloads

5

Readme

Ghost S3 File Store

This plugin allows you to use S3 as a file store for your ghost installation. It comes configured to allow for cloudfront domains and fall back to S3 domains. This plugin is known to work in version 0.5.7 of Ghost and with minimal change to the ghost source.

Installation

npm install --save ghost-s3-file-store

Configuration

In your ghost config.js setup the necessary blocks of information. This includes setting up an aws key for each environment as so:

fileStore: 'ghost-s3-file-store',
aws: {
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  bucket: process.env.AWS_BUCKET,
  region: process.env.AWS_REGION,
  assetHost: proccess.env.AWS_ASSET_HOST # Optional
}

Then all you need to do is open up the core/server/storage/index.js file and change it to look like this:

var errors  = require('../errors'),
config  = require('../config'),
storage = {}; 

function getStorage(storageChoice) {
    // TODO: this is where the check for storage apps should go
    // Local file system is the default.  Fow now that is all we support.
    storageChoice = config.fileStore;

    if (storage[storageChoice]) {
        return storage[storageChoice];
    }   

    try {
        // TODO: determine if storage has all the necessary methods.
        storage[storageChoice] = require('./' + storageChoice);
    } catch (e) {
        try {
            storage[storageChoice] = require(storageChoice);
        } catch (e) {
            errors.logError(e);
        }   
    }   

    // Instantiate and cache the storage module instance.
    storage[storageChoice] = new storage[storageChoice]();

    return storage[storageChoice];
}

module.exports.getStorage = getStorage;

Questions

Feel free to post comments or issues in the issues tab, I will be more then willing to help out on any issues you have getting this configured.

License

Read LICENSE.