Expand README's setup steps (#520)
* Remove duplicate key * Improve test specs * Update README
This commit is contained in:
parent
3d3c8cc529
commit
2dbf16eeb2
6 changed files with 15 additions and 9 deletions
|
|
@ -171,6 +171,7 @@ This section provides a high-level requirement & quick start guide. For detailed
|
|||
* If you are missing `ENV` variables on bootup, `envied` gem will alert you with messages similar to `'error_on_missing_variables!': The following environment variables should be set: A_MISSING_KEY.`.
|
||||
* You do not need "real" keys for basic development. Some features require certain keys, so you may be able to add them as you go.
|
||||
1. Run `bin/setup`
|
||||
1. That's it! Run `bin/startup` to start the application and head to `http://localhost:3000/`
|
||||
|
||||
#### Starting the application
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class GistTag < LiquidTagBase
|
|||
end
|
||||
|
||||
def valid_link?(link)
|
||||
(link =~ /(http|https):\/\/(gist.github.com).*/)&.zero?
|
||||
(link =~ /^(http(s)?:)?\/\/(gist.github.com)\/.*/)&.zero?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ podcast_objects = [
|
|||
title: "CodingBlocks",
|
||||
description: "",
|
||||
feed_url: "http://feeds.podtrac.com/c8yBGHRafqhz",
|
||||
image: Faker::Avatar.image,
|
||||
slug: "codingblocks",
|
||||
twitter_username: "CodingBlocks",
|
||||
website_url: "http://codingblocks.net",
|
||||
|
|
@ -138,7 +137,6 @@ podcast_objects = [
|
|||
title: "Talk Python",
|
||||
description: "",
|
||||
feed_url: "https://talkpython.fm/episodes/rss",
|
||||
image: Faker::Avatar.image,
|
||||
slug: "talkpython",
|
||||
twitter_username: "TalkPython",
|
||||
website_url: "https://talkpython.fm",
|
||||
|
|
@ -152,7 +150,6 @@ podcast_objects = [
|
|||
description: "",
|
||||
feed_url: "http://developeronfire.com/rss.xml",
|
||||
itunes_url: "https://itunes.apple.com/us/podcast/developer-on-fire/id1006105326", # rubocop:disable Metrics/LineLength
|
||||
image: Faker::Avatar.image,
|
||||
slug: "developeronfire",
|
||||
twitter_username: "raelyard",
|
||||
website_url: "http://developeronfire.com",
|
||||
|
|
@ -166,7 +163,6 @@ podcast_objects = [
|
|||
description: "",
|
||||
feed_url: "https://building.fireside.fm/rss",
|
||||
itunes_url: "https://itunes.apple.com/us/podcast/building-programmers/id1149043456", # rubocop:disable Metrics/LineLength
|
||||
image: Faker::Avatar.image,
|
||||
slug: "buildingprogrammers",
|
||||
twitter_username: "run_kmc",
|
||||
website_url: "https://building.fireside.fm",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ There are two ways to install Yarn.
|
|||
1. run `sudo apt update && sudo apt install postgresql postgresql-contrib libpq-dev`.
|
||||
2. To test the installation you can run `sudo -u postgres psql` which should open a PostgreSQL prompt. Exit the prompt by running `\q` then run `sudo -u postgres createuser -s $YOUR_USERNAME` where $YOUR_USERNAME is the username you are currently logged in as. Lastly, at least on Debian based systems, in the codebase under /config/database.yml you'll want to comment out the `host: localhost` to configure the database to use Unix domain sockets as outlined [here](https://stackoverflow.com/questions/23375740/pgconnectionbad-fe-sendauth-no-password-supplied).
|
||||
|
||||
Check out the official [PostgreSQL](https://www.postgresql.org/) site for more information.
|
||||
There are more than one way to setup Postgres. For additional configuration, check out our [postgres doc](/additional-postgres-setup) or the official [PostgreSQL](https://www.postgresql.org/) site for more information.
|
||||
|
||||
## Installing Dev.to
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ Please refer to their [installation guide](https://yarnpkg.com/en/docs/install).
|
|||
|
||||
Dev.to requires PostgreSQL version 9.4 or higher. The easiest way to get started is to use [Postgres.app](https://postgresapp.com/). Alternatively, check out the official [PostgreSQL](https://www.postgresql.org/) site for more granular version.
|
||||
|
||||
For additional configuration, [click here](/additional-postgres-setup)
|
||||
|
||||
## Installing Dev.to
|
||||
|
||||
1. Fork dev.to repository, ie. https://github.com/thepracticaldev/dev.to/fork
|
||||
|
|
|
|||
|
|
@ -3,6 +3,13 @@ require "rails_helper"
|
|||
RSpec.describe GistTag, type: :liquid_template do
|
||||
describe "#link" do
|
||||
let(:gist_link) { "https://gist.github.com/vaidehijoshi/6536e03b81e93a78c56537117791c3f1" }
|
||||
let(:bad_links) do
|
||||
[
|
||||
"//pastebin.com/raw/b77FrXUA#gist.github.com",
|
||||
"https://gist.github.com@evil.com",
|
||||
"https://gist.github.com.evil.com",
|
||||
]
|
||||
end
|
||||
|
||||
def generate_new_liquid(link)
|
||||
Liquid::Template.register_tag("gist", GistTag)
|
||||
|
|
@ -30,9 +37,9 @@ RSpec.describe GistTag, type: :liquid_template do
|
|||
end
|
||||
|
||||
it "rejects XSS attempts" do
|
||||
expect do
|
||||
generate_new_liquid("//pastebin.com/raw/b77FrXUA#gist.github.com")
|
||||
end.to raise_error(StandardError)
|
||||
bad_links.each do |link|
|
||||
expect { generate_new_liquid(link) } .to raise_error(StandardError)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue