Skip to content

Commit 38eafac

Browse files
committed
Bring back the old Jekyll site with a few new changes
1 parent e8c6523 commit 38eafac

14 files changed

+123
-65
lines changed

Gemfile

-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@ source 'https://rubygems.org'
22

33
gem 'github-pages'
44
gem 'rake'
5-
6-
group :jekyll_plugins do
7-
gem 'octopress-filters'
8-
end

Rakefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace :advisories do
1111

1212
desc 'Updates the advisory db'
1313
task :update => '_advisories' do
14-
Dir.chdir('_advisories') { sh 'git pull' } unless ENV['CI']
14+
Dir.chdir('_advisories') { sh 'git pull --ff-only' } unless ENV['CI']
1515
end
1616

1717
desc 'Regenerate the advisory posts'
@@ -20,7 +20,9 @@ namespace :advisories do
2020
advisory = YAML.load_file(advisory_path)
2121

2222
id = if advisory['cve'] then "CVE-#{advisory['cve']}"
23-
else "OSVDB-#{advisory['osvdb']}"
23+
elsif advisory['ghsa'] then "GHSA-#{advisory['ghsa']}"
24+
elsif advisory['osvdb'] then "OSVDB-#{advisory['osvdb']}"
25+
else File.basename(advisory_path, ".*")
2426
end
2527
slug = "#{advisory['date']}-#{id}"
2628
post = File.join('advisories', '_posts', "#{slug}.md")

_config.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
url: http://rubysec.com
1+
url: https://rubysec.com
22
title: RubySec
33
subtitle: Providing security resources for the Ruby community
44
author: RubySec
55
simple_search: https://www.google.com/search
66
description: Advisory database of security vulnerabilities found in Ruby projects
77

88
exclude:
9-
- _advisories
10-
- Gemfile
11-
- Gemfile.lock
12-
- Rakefile
13-
- README.md
14-
- vendor
15-
16-
gems:
17-
- octopress-filters
18-
- jekyll-paginate
9+
[
10+
.bundle,
11+
.github,
12+
_advisories,
13+
CNAME,
14+
Gemfile,
15+
Rakefile,
16+
README.md,
17+
vendor,
18+
]
1919

2020
subscribe_rss: /atom.xml
2121
@@ -28,7 +28,7 @@ pagination_dir: advisories # Directory base for pagination URLs eg. /blog/p
2828
recent_posts: 5 # Posts in the sidebar Recent Posts section
2929
excerpt_link: "Read on →" # "Continue reading" link text at the bottom of excerpted articles
3030

31-
titlecase: true # Converts page and post titles to titlecase
31+
titlecase: false # Converts page and post titles to titlecase
3232

3333
twitter_user: rubysec
3434
twitter_tweet_button: true

_includes/after_footer.html

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
1+
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
22
<script src="{{ root_url }}/assets/bootstrap/js/bootstrap.min.js"></script>
3-
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
3+
<script>window.twttr = (function(d, s, id) {
4+
var js, fjs = d.getElementsByTagName(s)[0],
5+
t = window.twttr || {};
6+
if (d.getElementById(id)) return t;
7+
js = d.createElement(s);
8+
js.id = id;
9+
js.src = "https://platform.twitter.com/widgets.js";
10+
fjs.parentNode.insertBefore(js, fjs);
11+
12+
t._e = [];
13+
t.ready = function(f) {
14+
t._e.push(f);
15+
};
16+
17+
return t;
18+
}(document, "script", "twitter-wjs"));</script>

_includes/archive_post.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<h3><small><time datetime="{{ post.date | datetime | date_to_xmlschema }}" pubdate>{{ post.date | date: "<span class='month'>%b</span> <span class='day'>%d</span>"}}</time></small></h3>
33
</td>
44
<td>
5-
{% capture category %}{{ post.categories | size }}{% endcapture %}
65
<h3><a href="{{ root_url }}{{ post.url }}">{{post.title}}</a></h3>
7-
{% if category != '0' %}
8-
<h3><small>posted in {{ post.categories | category_links }}</small></h3>
6+
{% if post.categories != empty or post.tags != empty %}
7+
<h3><small>posted in {% include category_links.html categories=post.categories tags=post.tags %}</small></h3>
98
{% endif %}
109
</td>

_includes/category_links.html

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% if include.categories != empty %} •
2+
{% for category in include.categories %}
3+
{% assign no_comma = forloop.last %}
4+
{% for archive in site.archives %}
5+
{% if archive.type == "category" and archive.title == category %}
6+
<a href="{{ archive.url | relative_url }}">{{ archive.title | escape }}</a>{% unless no_comma %},{% endunless %}
7+
{% endif %}
8+
{% endfor %}
9+
{% endfor %}
10+
{% endif %}
11+
12+
{% if include.tags != empty %} •
13+
{% for tag in include.tags %}
14+
{% assign no_comma = forloop.last %}
15+
{% for archive in site.archives %}
16+
{% if archive.type == "tag" and archive.title == tag %}
17+
<a href="{{ archive.url | relative_url }}">{{ archive.title | escape }}</a>{% unless no_comma %},{% endunless %}
18+
{% endif %}
19+
{% endfor %}
20+
{% endfor %}
21+
{% endif %}

_includes/footer.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
<p>
2-
Copyright &copy; {{ site.time | date: "%Y" }} - {{ site.author }}
3-
</p>
1+
<section class="footer">
2+
<div class="disclaimer">
3+
<p>Copyright &copy; {{ site.time | date: "%Y" }} - {{ site.author }}</p>
4+
<p class="acknowledgement">This domain was graciously donated by Jordi Massaguer.</p>
5+
</div>
6+
</section>

_includes/head.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
2020
<link rel="canonical" href="{{ canonical }}">
21-
<link href="{{ root_url }}/favicon.ico" rel="icon">
21+
<link href="{{ root_url }}/favicon.png" rel="icon">
2222

2323
<link href="{{ root_url }}/assets/bootstrap/css/spacelab.min.css" rel="stylesheet" type="text/css">
2424
<link href="{{ root_url }}/assets/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css">

_includes/header.html

+28-22
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
1-
<div class="subscribe">
2-
<table>
3-
<tr>
4-
<td><span>Get Updates: &nbsp;</span></td>
5-
{% if site.subscribe_rss %}
6-
<td><a href="{{site.subscribe_rss}}" class="btn"><i class="icon-cog"></i> By ATOM</a></td>
7-
{% endif %}
8-
<td>&nbsp;</td>
9-
{% if site.twitter_user %}
10-
<td><a href="https://twitter.com/{{site.twitter_user}}" class="btn"><i class="icon-twitter-sign"></i> On Twitter</a></td>
11-
{% endif %}
12-
<td>&nbsp;</td>
13-
{% if site.github_repo %}
14-
<td><a href="https://github.com/{{site.github_repo}}" class="btn"><i class="icon-github-sign"></i> On GitHub</a></td>
15-
{% endif %}
16-
</tr>
17-
</table>
18-
</div>
1+
<section class="header">
2+
<div class="subscribe">
3+
<table>
4+
<tr>
5+
<td><span>Get Updates: &nbsp;</span></td>
6+
{% if site.subscribe_rss %}
7+
<td><a href="{{site.subscribe_rss}}" class="btn"><i class="icon-cog"></i> By ATOM</a></td>
8+
{% endif %}
9+
<td>&nbsp;</td>
10+
{% if site.twitter_user %}
11+
<td><a href="https://twitter.com/{{site.twitter_user}}" class="btn"><i class="icon-twitter-sign"></i> On Twitter</a></td>
12+
{% endif %}
13+
<td>&nbsp;</td>
14+
{% if site.github_repo %}
15+
<td><a href="https://github.com/{{site.github_repo}}" class="btn"><i class="icon-github-sign"></i> On GitHub</a></td>
16+
{% endif %}
17+
</tr>
18+
</table>
19+
</div>
1920

20-
<h1 class="title">{{ site.title }}</h1>
21-
{% if site.subtitle %}
22-
<p class="lead">{{ site.subtitle }}</p>
23-
{% endif %}
21+
<div>
22+
<h1 class="title">
23+
<a href="/"><img src="{{ site.url }}/images/rubysec-logo.png" width="80" height="80"></a>
24+
{{ site.title }}
25+
</h1>
26+
{% if site.subtitle %}
27+
<p class="lead">{{ site.subtitle }}</p>
28+
{% endif %}
29+
</div>

_includes/post/categories.html

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
{% capture category %}{% if post %}{{ post.categories | category_links | size }}{% else %}{{ page.categories | category_links | size }}{% endif %}{% endcapture %}
2-
{% unless category == '0' %}
1+
{% if post.categories != empty or post.tags != empty or page.categories != empty or page.tags != empty %}
32
<span class="categories">
43
{% if post %}
5-
{{ post.categories | category_links }}
4+
{% include category_links.html categories=post.categories tags=post.tags %}
65
{% else %}
7-
{{ page.categories | category_links }}
6+
{% include category_links.html categories=page.categories tags=page.tags %}
87
{% endif %}
98
</span>
10-
{% endunless %}
9+
{% endif %}

_includes/sidebar.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% unless page.sidebar == false %}
22
<div class="span4 sidebar">
33
<div class="well">
4-
Contact us <a href="https://twitter.com/rubysec">@rubysec</a>, info at rubysec.com, or chat in #rubysec on freenode.
4+
Contact us <a href="https://twitter.com/rubysec">@rubysec</a> or <a href="https://github.com/rubysec/ruby-advisory-db">open an issue on our GitHub repository</a>.
55
</div>
66
<div class="well">
77
<section>

_layouts/advisory.html

+18-1
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ <h3>ADVISORIES</h3>
1111
</li>
1212
{% endif %}
1313

14+
{% if page.advisory.ghsa %}
15+
<li>
16+
<a href="https://github.com/advisories/GHSA-{{ page.advisory.ghsa }}">GHSA-{{ page.advisory.ghsa }}</a>
17+
</li>
18+
{% endif %}
19+
1420
{% if page.advisory.osvdb %}
1521
<li>
1622
OSVDB-{{ page.advisory.osvdb }}
1723
</li>
1824
{% endif %}
1925

2026
{% unless page.advisory.url contains 'osvdb.org' or page.advisory.url contains 'web.nvd.nist.gov'
21-
or page.advisory.url contains 'cve.mitre.org' %}
27+
or page.advisory.url contains 'cve.mitre.org' or page.advisory.url contains 'github.com/advisories' %}
2228
<li>
2329
<a href="{{ page.advisory.url }}">Vendor Advisory</a>
2430
</li>
@@ -37,6 +43,17 @@ <h3>FRAMEWORK</h3>
3743
<p>{{ page.advisory.framework }}</p>
3844
{% endif %}
3945

46+
{% if page.advisory.cvss_v2 or page.advisory.cvss_v3 %}
47+
<h3>SEVERITY</h3>
48+
49+
{% if page.advisory.cvss_v3 %}
50+
<p><strong>CVSS v3</strong>: {{ page.advisory.cvss_v3 }}</p>
51+
{% endif %}
52+
{% if page.advisory.cvss_v2 %}
53+
<p><strong>CVSS v2</strong>: {{ page.advisory.cvss_v2 }}</p>
54+
{% endif %}
55+
{% endif %}
56+
4057
{% if page.advisory.unaffected_versions %}
4158
<h3>UNAFFECTED VERSIONS</h3>
4259

images/rubysec-logo.png

161 KB
Loading

index.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
title: Home
44
---
55

6+
<p>We help maintain the following projects:</p>
7+
68
<div class="row">
79
<div class="span4">
8-
<h2>Advisory Database</h2>
10+
<h2><a href="https://github.com/rubysec/ruby-advisory-db" target="_blank">Ruby Advisory Database</a></h2>
11+
<p>
12+
The canonical, community-maintained, plain-text database of security vulnerability advisories affecting Ruby libraries and virtual machines.
13+
</p>
914
<p>
10-
The Ruby advisory database seeks to serve as a canonical repository of vulnerabilities affecting ruby libraries.
15+
Receive updates via atom or <a href="https://github.com/rubysec/ruby-advisory-db" target="_blank">browse the database</a>.
1116
</p>
1217
<p>
1318
We are always looking for contributors.
1419
</p>
15-
<a class="btn btn-large btn-github" href="https://github.com/rubysec/ruby-advisory-db/" target="_blank">
16-
<i class="icon-github icon-2x pull-left"></i>
17-
View Project<br>on GitHub</a>
1820
</div>
1921
<div class="span4">
20-
<h2>Mailing List</h2>
21-
<p>The rubysec-announce google group is our primary means of distribution.</p>
22-
<p>Join our free mailing list to receive notifications on published advisories and information regarding recent vulnerabilities.</p>
23-
<p><a class="btn" href="https://groups.google.com/group/rubysec-announce" target="_blank">View details &raquo;</a></p>
22+
<h2><a href="https://github.com/rubysec/bundler-audit" target="_blank">Bundler-Audit</a></h2>
23+
<p>Free utility that audits your Gemfile.lock against the advisory database.</p>
2424
</div>
2525

2626
{% include sidebar.html %}

0 commit comments

Comments
 (0)