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

@667/ghost-storage-github

v1.2.0

Published

Save Ghost Blog Content to Github

Downloads

20

Readme

Ghost Storage GitHub

This project is a custom storage adapter for Ghost that allows you to use GitHub (a completely free solution) as a storage backend.

Inspiration

This project was inspired by ifvictr/ghost-storage-github. However, due to that project appearing to be abandoned (last update by the author 3 years ago) and no other solutions existing for using GitHub as a storage backend, this project was completely rewritten.

Features

  • GitHub as Storage Backend: Seamlessly integrate Ghost with GitHub to store your content.
  • Image Transcoding: Supports automatic image transcoding, optimizing images for different use cases, particularly quicker images being served for your blog (images are transcoded to webp by default)

Configuration

Example Docker Swarm/Compose partial config:

    environment:
      storage__active: github
      storage__github__token: <your GitHub Personal Access Token here>
      storage__github__owner: <your GitHub user here>
      storage__github__repo: <your GitHub repo here>
      GHOST_STORAGE_GITHUB_TOKEN: <your GitHub Personal Access Token here>
      GHOST_STORAGE_GITHUB_OWNER: <your GitHub user here>
      GHOST_STORAGE_GITHUB_REPO: <your GitHub repo here>
    volumes:
      - type: bind
        source: content
        target: /var/lib/ghost/content
    command: ["/var/lib/ghost/content/copy-storage-adapter.sh", "docker-entrypoint.sh", "node", "current/index.js"]

Note that either the GHOST_STORAGE_GITHUB_ or storage__github__ way of configuring this storage plugin works, while the former overrides the latter.

As well, the plugin code is found in the docker image's content directory so if you also mount that image (thus making the contents unavailable otherwise) the copy-storage-adapter.sh script does exactly that.

Here's a comprehensive list of configurations:

| Name | Required? | Description | Environment variable (prefixed with GHOST_STORAGE_GITHUB_) | |-------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------| |token| yes|GitHub Personal access token https://github.com/settings/tokens|GHOST_STORAGE_GITHUB_TOKEN | | owner | yes | Username of the user/organization the repo is under | GHOST_STORAGE_GITHUB_OWNER | | repo | yes | Name of the repo | GHOST_STORAGE_GITHUB_REPO | | branch | no | Branch to push assets to. Defaults to main | GHOST_STORAGE_GITHUB_BRANCH | | destination | no | Directory to push assets to. Defaults to / | GHOST_STORAGE_GITHUB_DESTINATION | | origin | no | URL Origin of newly saved images. Uses raw.githubusercontent.com by default | GHOST_STORAGE_GITHUB_ORIGIN | | useRelativeUrls | no | Whether or not to return relative URLs (i.e. under /content/images) instead of absolute URLs. Might be of use to people who generate and serve a static version of their Ghost blog. | USE_RELATIVE_URLS | |imageFormat|no|image format to transcode images to. Uses the sharp npm package under the hood https://www.npmjs.com/package/sharp so the same formats are available (i.e. jpeg, png, webp, gif, jp2, tiff, avif, heif, jxl, raw)|GHOST_STORAGE_GITHUB_IMAGE_FORMAT | |etagCacheSize|no|GitHub Personal access token https://github.com/settings/tokens|GHOST_STORAGE_GITHUB_ETAG_CACHE_SIZE |

Usage

Once configured, Ghost will use your specified GitHub repository to store images.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.