Giter VIP home page Giter VIP logo

ghost-v4-on-heroku's Introduction

Notice: If you are getting a Heroku policy error please refer to this discussion.

Ghost is world's most popular modern publishing platform for creating a new media platform. It has been used by Apple, SkyNews, Buffer, OpenAI, and thousands more. You can visit the project's website at https://ghost.org, or read the docs on https://ghost.org/docs.

Deploy

Deploy

I am available to work with individuals or companies who are looking to build their blazingly super-fast publishing platform. Contact-Me

If the above button does not work for you, disable anything that might be blocking Heroku from inferring the referrer (e.g. Brave shield), or try this: https://heroku.com/deploy?template=https://github.com/thelovekesh/ghost-v4-on-heroku (if you're using a fork, make sure to point the template link to your repo).

NOTE: we do not support deploying by downloading the source file or by copying over a cloned folder. Downloading/copying folders tends to break symlinks, so we recommend that you deploy by clicking the button in this repository or your fork on GitHub.

Things you should know

After deployment,

  • First, visit Ghost at https://YOURAPPNAME.herokuapp.com/ghost to set up your admin account.
  • The app may take a few minutes to come to life.
  • Your blog will be publicly accessible at https://YOURAPPNAME.herokuapp.com.
  • If you subsequently set up a custom domain for your blog, you’ll need to update your Ghost blog’s APP_PUBLIC_URL environment variable accordingly.
  • If you create a lot of content or decide to scale-up the dynos to support more traffic, a more substantial, paid database plan will be required.

Enable SSL using Cloudflare

Please checkout this article.

Configuring S3 file uploads

The blog is configured to use Cloudinary file storage by default. If you want to configure S3 file storage, create an S3 bucket on Amazon AWS, and then specify the following details as environment variables on the Heroku deployment page (or add these environment variables to your app after deployment via the Heroku dashboard):

  • S3_ACCESS_KEY_ID and S3_ACCESS_SECRET_KEY: Required if using S3 uploads. These fields are the AWS key/secret pair needed to authenticate with Amazon S3. You must have granted this keypair sufficient permissions on the S3 bucket in question in order for S3 uploads to work.

  • S3_BUCKET_NAME: Required if using S3 uploads. This is the name you gave to your S3 bucket.

  • S3_BUCKET_REGION: Required if using S3 uploads. Specify the region the bucket has been created in, using slug format (e.g. us-east-1, eu-west-1). A full list of S3 regions is available here.

  • S3_ASSET_HOST_URL: Optional, even if using S3 uploads. Use this variable to specify the S3 bucket URL in virtual host style, path style or using a custom domain. You should also include a trailing slash (example https://my.custom.domain/). See this page for details.

Once your app is up and running with these variables in place, you should be able to upload images via the Ghost interface and they’ll be stored in Amazon S3. ✨

Setting up SMTP service

When you spin up your heroku dyno for the first time, mailgun is by default setup with a sandbox account. It means, sending emails to only authorized reciepients is supported. If you want to send emails / invite your collaborators you need to set their email in authorized recipient section on mailgun dashboard. See https://help.mailgun.com/hc/en-us/articles/217531258-Authorized-Recipients for more.

A more permanent solution would be to use a custom domain and verify your domain via mailgun customer support. Cheers!

FYI: You can access mailgun dashboard by visiting heroku dashboard > click on your app > resources tab > click on mailgun addon.

Change Config Vars Value in Heroku

How can I change the value of APP_PUBLIC_URL, MAILGUN_API_KEY, MAILGUN_DOMAIN, MAILGUN_PUBLIC_KEY, MAILGUN_SMTP_LOGIN, MYSQL_DATABASE_URL or JAWSDB_URL, S3_ACCESS_KEY_ID ...etc? You cannot change the value in the config.production.json but you can change the values using the Heroku CLI or Heroku Dashboard. For more information read here

Disclaimer

This repo has some blocks of open-source code. I have taken that code from the repositories of the previous version of ghost deployment on Heroku.

Problems or need help?

License

Released under the MIT license, just like the Ghost project itself.

ghost-v4-on-heroku's People

Contributors

dependabot[bot] avatar jon-dearaujo avatar raulriera avatar thelovekesh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ghost-v4-on-heroku's Issues

routes.yaml not persisting after dyno sleeps

Heroku dynos have ephemeral storage so the cloudinary/s3 storage adapters take care of images. But other items such as the all important routes.yaml which is uploaded via Settings>Labs doesn't persist

I already had to find a work around for custom themes uploaded too by committing them into my fork of this repo.

But am not sure where to include routes.yaml / if even possible. Maybe a postinstall script?

I'm new to ghost.

Can anyone help / advise?

Edit 1:

All of Ghost’s routing configuration is defined in content/settings/routes.yaml - which you can edit directly, but you can also upload/download this file from within your Ghost admin panel under Settings » Labs.

seems like overwriting content/settings/routes.yaml with a local committed file will work

Edit 2:

Seems that simply committing my routes.yaml to content/settings/routes.yaml inside this repo works

Closing issue - but will leave for future reference

ER_USER_LIMIT_REACHED: User 'xxxx' has exceeded the 'max_questions' resource (current value: 3600)

Mysql (Jawsdb) on Heroku will ignore connection pool settings to spawn a new connection for every alteration. If you're editing posts on Ghost beyond x amount of time (15m for me), it will exceed the database limit and you're effectively locked out.

FWIW I'm on a Nextjs front-end, deployed on Vercel.

I suppose upgrading the database plan might fix this, but a seemingly light activity shouldn't cause this issue to begin with. I would expect needing to upgrade if I was publishing 2-3 blog posts a day, not editing one for two hours 🥲

Reproduction

  • Add a couple of posts on Ghost
  • EITHER: wait for it to throw the error (which takes me 15-20m), or
  • Read the instance APIs using the same stack

EDIT: I have confirmed that the error goes away when you upgrade the database base plan (I did Kitefin -> Leopard), so it's definitely related to the db limit.

How to further develop via git after deploying?

When deployed via the button in this repo, I am unable to get the git access to further customize & develop the application.
For example the command heroku git:clone -a APP-NAME returns an empty repo.

However, as per doc, I was able to download code using the below command:

heroku slugs:download -a APP-NAME

But the download is not a git repo. What is the right method to continue development once the deployment is done? For example, how can I make changes in the code or install a new plugin or update the version of ghost deployed to heroku via this repo?

No deployment of ghost V4 to heroku

Hello all,

deploying ghost V4 with AWS S3 credentials to heroku gives the following error:
"messageItem could not be created:
We couldn't deploy your app because the source code violates the Salesforce Acceptable Use and External-Facing Services Policy.
"

Please check the issue!

Thanks!

Best regards
Gerrit

Unable to clone ghost to local

Hi,

I was successfully able to create an app with the ghost template. But, when I tried cloning it to my local using the git commands, it gives me an empty repo. How do I get the source code of the heroku app into my GIT?

Can you please help me with this issue?

Thanks,
Neha

"Source code violates the Salesforce Acceptable Use..."

When trying to deploy on Heroku, I get the following error:
image

Recreate: Log in to Heroku. Click on the Deploy to Heroku button on the "ghost-v4-on-heroku" github page. Fill out the app name and APP_PUBLIC_URL. Click Deploy app.

The app fails and the above error message pops up in the top right.

Is anyone else experiencing this issue?

Updating to Ghost V5

Hello,

I would like to update the ghost version to v5 since I need some of the new features. Is it even possible with this repo?

Update ghost and fix deployment issues on Heroku

Currently, some users are facing an issue during the deployment of Ghost v4 on Heroku. During the deployment, an error is being shown related to the Heroku policies.

I believe it is due to some outdated project dependencies in Ghost v4.2 and the dependencies might have some vulnerabilities that's why Heroku is unable to deploy the Ghost apps.

Tasks to be done:

  • Update Ghost to latest version.
  • Update the Nodejs engine in package.json
  • Update the JAWS DB Mysql addon with JAWS DB Maria DB

Cannot create custom integrations (or delete users). Getting http 500

Hi,

Thanks for your job with this plugin 🙏 .

I'm having trouble creating new integrations and don't know why. I'm logged in with role Owner.

See attached screenshot.

This is a fresh install on a heroku dyno by clicking the button on github. Version 4.9.3 with mysql (JawsDB).

Any idea how to proceed with this?

Sidenote: I cannot remove previously created users either only create new ones..

Skärmavbild 2022-06-27 kl  07 59 41

Mailgun isn't sending emails

I've used your repo to create a new Ghost v4 site. Thank you!

I updated the Mailgun account so I can send emails. I've updated the DNS settings, SMTP credentials, Mailgun domain, API keys, etc. I've tested these manually using curl and received the email. But when I try to send an email from the website (subscription confirmation), it doesn't work. Mailgun isn't even reporting the attempt.

Are you able to help, please?

Could be deployed to Heroku

Heroku returns the next message, when attempting the deploy:
Item could not be created:
We couldn't deploy your app because the source code violates the Salesforce Acceptable Use and External-Facing Services Policy.
Screenshot 2022-05-14 at 8 57 44 PM

Cannot read property 'connection' of undefined

I get this

TypeError: Cannot read property 'connection' of undefined        
remote: �[1G           at exports.Provider.sanitizeDatabaseProperties (/app/node_modules/ghost/core/shared/config/utils.js:103:25)        
remote: �[1G           at Object.loadNconf (/app/node_modules/ghost/core/shared/config/index.js:54:11)        
remote: �[1G           at Object.<anonymous> (/app/node_modules/ghost/core/shared/config/index.js:93:27)        
remote: �[1G           at Module._compile (node:internal/modules/cjs/loader:1092:14)        
remote: �[1G           at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)        
remote: �[1G           at Module.load (node:internal/modules/cjs/loader:972:32)        
remote: �[1G           at Function.Module._load (node:internal/modules/cjs/loader:813:14)        
remote: �[1G           at Module.require (node:internal/modules/cjs/loader:996:19)        
remote: �[1G           at require (node:internal/modules/cjs/helpers:92:18)        
remote: �[1G           at bootGhost (/app/node_modules/ghost/core/boot.js:238:18)

Env variables:

APP_PUBLIC_URL:        ●●●●●●.●●●.●●●●●.●●●
DATABASE_URL:          mysql://mysql:●●●●●●●●●●●●@dokku-mysql-●●●●●●:3306/●●●●●●
DOKKU_APP_TYPE:        herokuish
MAILGUN_API_KEY:       ●●●-●●●●●●●●●●
MAILGUN_DOMAIN:        ●●●●●.●●●●●●●.●●●
MAILGUN_PUBLIC_KEY:    ●●●●●●●-●●●●●●●●●●●●●●●●●●●●
MAILGUN_SMTP_LOGIN:    postmaster@●●●●●.●●●●●●.●●●
MYSQL_DATABASE_URL:    mysql://mysql:●●●●●●●●●●●●@dokku-mysql-●●●●●●:3306/●●●●●●
S3_ACCESS_KEY_ID:      ●●●●●●●●●●●●●●●●●●●●
S3_ACCESS_SECRET_KEY:  ●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
S3_ASSET_HOST_URL:     ●●●●●●.ap-south-1.●●●●●●.●●●
S3_BUCKET_NAME:        ●●●●●●
S3_BUCKET_REGION:      ap-south-1

impossible to update existing heroku instance

node thelovekesh.js

TypeError: Cannot read property 'connection' of undefined
at exports.Provider.sanitizeDatabaseProperties (/Users//Repositories/ghost-v4-on-heroku/node_modules/ghost/core/shared/config/utils.js:103:25)
at Object.loadNconf (/Users//Repositories/ghost-v4-on-heroku/node_modules/ghost/core/shared/config/index.js:54:11)
at Object. (/Users//Repositories/ghost-v4-on-heroku/node_modules/ghost/core/shared/config/index.js:93:27)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at bootGhost (/Users//Repositories/ghost-v4-on-heroku/node_modules/ghost/core/boot.js:250:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node thelovekesh.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Critical security update available

Hello,
After installing your repo, I git this error message:
Critical security update available — please update Ghost as soon as possible. Details here: GHSA-9fgx-q25h-jxrg

Fixed in 4.3.3, all 4.x sites should upgrade as soon as possible.
As the endpoint is unused, the patch simply removes it.

Favicon/publication icon doesn't work

I have used this version of ghost on three publications but the favicon/publication icon does not work or does not show up.

What I have tried already

  • Adding the favicon via the ghost admin settings panel under branding.
  • Adding it via code injection in the {{ head }} section.
  • Adding it locally by adding the favicon link tag in the theme itself.
  • Clearing the browser cache, opened the websites from different devices.
  • Clearing the build cache for node apps on heroku.
    All these have failed to work, I have started thinking this could be an issue with ghost itself though I am not sure.
    When I tried using ghost V3, the favicon was showing, but I cant use it on my publications because it doesn't have some core features I like.

Any help on resolving this will be highly appreciated.
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.