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

Add lastUpdated value to maxmind server ip address list #1046

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ module.exports = {
'as-needed',
],
quotes: [
'warn',
'error',
'single',
],
'react-hooks/exhaustive-deps': 'warn',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@
"develop": "gatsby clean && GATSBY_URL=http://localhost:8000 gatsby develop",
"fix": "run-p fix:*",
"fix:content": "prettier --write '**/*.mdx' --embedded-language-formatting off",
"fix:json": "npm run lint:json --fix",
"fix:scripts": "npm run lint:scripts --fix",
"fix:styles": "npm run lint:styles --fix",
"fix:json": "npm run lint:json -- --fix",
"fix:scripts": "npm run lint:scripts -- --fix",
"fix:styles": "npm run lint:styles -- --fix",
"lint": "run-p lint:*",
"lint:configs": "eslint .*rc.js --no-ignore",
"lint:content": "prettier --check '**/*.mdx' --embedded-language-formatting off",
Expand Down
23 changes: 16 additions & 7 deletions src/components/IpAddresses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@ import * as React from 'react';

import MaxMindIpAddresses from '../../static/maxmind-server-ip-addresses.json';
import Example from './Example';
import { p as P } from './Mdx';

const lastUpdated = new Date(MaxMindIpAddresses.lastUpdated).toUTCString();

const IpAddresses: React.FC = () => (
<Example
language="bash"
>
{MaxMindIpAddresses.IPv4.join('\n')}
{'\n'}
{MaxMindIpAddresses.IPv6.join('\n')}
</Example>
<>
<Example
language="bash"
>
{MaxMindIpAddresses.IPv4.join('\n')}
{'\n'}
{MaxMindIpAddresses.IPv6.join('\n')}
</Example>
<P>
Last updated:
{lastUpdated}
</P>
</>
);

export default IpAddresses;
7 changes: 2 additions & 5 deletions src/gatsby/gatsby-config/feeds/createServerIpAddressesFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ export default (): any => ({
nodes {
IPv4
IPv6
lastUpdated
}
}
file {
modifiedTime
}
site {
siteMetadata {
siteUrl
Expand All @@ -23,10 +21,9 @@ export default (): any => ({
serialize: (args: any) => {
const { query } = args;
const { allJson } = query;
const { modifiedTime } = query.file;
const { siteUrl } = query.site.siteMetadata;

const date = new Date(modifiedTime);
const date = new Date(allJson.nodes[0].lastUpdated);

return [
{
Expand Down
3 changes: 2 additions & 1 deletion static/maxmind-server-ip-addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"2606:4700::6810:252f",
"2606:4700:7::a29f:8616",
"2606:4700:7::a29f:8716"
]
],
"lastUpdated": "2021-06-30T22:15:51.000-04:00"
}
2 changes: 1 addition & 1 deletion test/matchers/toHaveNoBrokenLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const toHaveNoBrokenLinks = (brokenLinks: any[]): any => {
Page: ${brokenLink.base.original} ${BR}
Broken Link Url: ${brokenLink.url.original} ${BR}
Broken Link Text: ${brokenLink.html.text} ${BR}
Broken Link Selector: ${brokenLink.html.selector} ${BR}`
Broken Link Selector: ${brokenLink.html.selector} ${BR}`;

return list;
});
Expand Down
Loading