Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS feeds for private blogs #9001

Closed
6 tasks done
ErisDS opened this issue Sep 12, 2017 · 9 comments
Closed
6 tasks done

RSS feeds for private blogs #9001

ErisDS opened this issue Sep 12, 2017 · 9 comments
Assignees
Labels
feature [triage] New features we're planning or working on server / core Issues relating to the server or core of Ghost

Comments

@ErisDS
Copy link
Member

ErisDS commented Sep 12, 2017

At the moment, private blogs serve an RSS feed at /rss/. This only works if you already logged in
such that your browser provides a cookie, and is basically useless for anything RSS might be used for 😁 .

Meanwhile, we've seen a few times that even though a site is private, the RSS feed would still be useful to have in some capacity. People with access to the site may wish to subscribe, and the feed is useful for setting up email news letters using things like MailChimp's RSS-to-email feature.

Problem: we want to provide an RSS feed, but keep it private. That means that we can't include the passphrase in the url, or use HTTP basic auth, etc.

Solution: to work around this, we will instead expose the RSS feed on a private, unguessable URL e.g. blogdomain.com/<unguessable string>/rss/.

Some requirements:

  • The string used should be:
    • an unguessable set of characters
    • stored in the settings table along with other private blogging info
  • The old blogdomain.com/rss/URL should cease to exist on private blogs (e.g. require auth and THEN 404).
  • The new private rss route should not require the passphrase.
  • The private blogging UI in the admin needs to be updated to display the URL:

Some small things to think about:

  • Does it makes sense to also use the same pattern for our tag rss feeds? e.g. blogdomain.com/tag/tag-name/<unguessable string>/rss/ or blogdomain.com/<unguessable string>/tag/tag-name/rss/.
  • Do we need a way to force regenerate the string? (I think no to start, can be manually changed in the DB if needed, if we get requests, add this feature later).
  • Bonus: can we disable the generation of sitemaps for private blogs?

Extra background info

Previously, when you enabled private blogging, the sitemap & rss feed were set to 404. We recently realised this can expose some information about your blog (because themes can pull data into the 404 template) and changed it so that these redirect to the passphrase screen, as every other part of the site does (Raised in #8990, fixed in #8999).

The original intention of the private blogging feature was that RSS and sitemaps should be fully disabled for private blogs, as they create unnecessary overhead. Sitemaps in particular, never need to be generated, as the site is not going to be indexed.

  • use settings cache in private blogging app (Refactored private blogging app: use settings cache #9086)
  • 404 for all rss page if private blogging is enabled and session is authenticated
  • add a new random public hash to the settings table
  • show hash in the admin UI
  • be able to serve the rss feed via a public hashed url (for the main rss url for now)
  • delegate docs update for help.ghost.org
@ErisDS ErisDS added feature [triage] New features we're planning or working on server / core Issues relating to the server or core of Ghost labels Sep 12, 2017
@jxhn
Copy link
Contributor

jxhn commented Sep 15, 2017

If you're happy to have the <unguessable string> as a product of something like

crypto.randomBytes(20, function(err, buf) {
  var unguessable = buf.toString('hex');
  . . .
});

then I'm sure I could achieve this.

@kirrg001
Copy link
Contributor

@jomahoney Thanks for your interest.

There are many ways to generate an unguessable string. I think if private blogging is enabled, the requirements for the string are:

  • contains uppercase/lowercase letters
  • contains numbers
  • is minimum 12 characters

We have a utility which generates a random string (in core/server/utils/index e.g. utils.uid(12)), which you could use.

See also http://password-checker.online-domain-tools.com/.

If you have any questions, let us know. Don't hesitate to ask :)

@jxhn
Copy link
Contributor

jxhn commented Sep 15, 2017

Ah cool - sounds even more achievable then. I was just lifting the above from something else I wrote.

Happy to take this on then.

@nuclearpengy
Copy link

I just noticed something on Bitbucket and thought I'd mention the concept here.

What about having. /rss?token=$randomstring

The idea being that the token is generated per user so that a user's token can be invalidated and as a result not have access to the feed anymore.

@ErisDS
Copy link
Member Author

ErisDS commented Sep 19, 2017

@nuclearpengy We don't have a concept of users for the content part of the site - so there cannot be a user-specific token at this time.

@jomahoney let us know if there are any problems getting this implemented 😊

@kirrg001
Copy link
Contributor

@jomahoney Hey. Do you have any update? The Ghost team would like to take this feature over if it's not finished till next Monday. Just wanted to let you know 🙃

@jxhn
Copy link
Contributor

jxhn commented Sep 27, 2017

@kirrg001 No update unfortunately. Got crazy busy with work so haven't had the time. Could certainly spend time at the weekend implementing but feel free to take over

@kirrg001 kirrg001 self-assigned this Oct 2, 2017
kirrg001 added a commit to kirrg001/Ghost that referenced this issue Oct 3, 2017
no issue

- preparation for TryGhost#9001
- no need to require the settings API, we can simply fetch the data from the settings cache
- the settings API uses the settings cache anyway
ErisDS pushed a commit that referenced this issue Oct 3, 2017
no issue

- preparation for #9001
- no need to require the settings API, we can simply fetch the data from the settings cache
- the settings API uses the settings cache anyway
@kirrg001 kirrg001 mentioned this issue Oct 3, 2017
6 tasks
kirrg001 added a commit to kirrg001/Ghost-Admin that referenced this issue Oct 5, 2017
refs TryGhost/Ghost#9001

- show private feed url if private blogging is enabled
kevinansfield pushed a commit to TryGhost/Admin that referenced this issue Oct 5, 2017
refs TryGhost/Ghost#9001

- show private feed url if private blogging is enabled
- added a `.avoid-break-out` CSS utility class to prevent layout issues caused by non-breaking text such as long links
kevinansfield pushed a commit that referenced this issue Oct 5, 2017
refs #9001

When a blog is in private mode there is now an unguessable URL that allows access to the RSS feed for internal use, commenting systems, etc.

- add public hash for private blogging
  - auto generate on bootstrap if missing
  - global hash, we can re-use in the future
- update private blogging middleware to detect the private RSS URL and rewrite it so that the normal rss route/code is used for display
- if a normal `/rss/` route is accessed with a private session return a 404
@kirrg001
Copy link
Contributor

kirrg001 commented Oct 5, 2017

@ErisDS Do you want me to raise an issue for

Bonus: can we disable the generation of sitemaps for private blogs?

@ErisDS
Copy link
Member Author

ErisDS commented Oct 5, 2017

I have this on a separate todo as part of a general revisit of sitemaps, so will add it to that issue when I raise it.

@ErisDS ErisDS closed this as completed Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [triage] New features we're planning or working on server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

4 participants