diff --git a/.gitignore b/.gitignore
index dc1e3b44..f8132751 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,9 +54,9 @@ typings/
# dotenv environment variable files
.env*
-# build files
+# gatsby files
.cache/
-build
+public
# Mac files
.DS_Store
diff --git a/gatsby-config.js b/gatsby-config.js
new file mode 100644
index 00000000..1d173ea0
--- /dev/null
+++ b/gatsby-config.js
@@ -0,0 +1,35 @@
+module.exports = {
+ siteMetadata: {
+ title: `Skynet`,
+ description: `Skynet is a decentralized file sharing and content distribution protocol.`,
+ author: `Nebulous`
+ },
+ plugins: [
+ `gatsby-plugin-sass`,
+ `gatsby-plugin-react-helmet`,
+ {
+ resolve: `gatsby-source-filesystem`,
+ options: {
+ name: `images`,
+ path: `${__dirname}/src/images`
+ }
+ },
+ `gatsby-transformer-sharp`,
+ `gatsby-plugin-sharp`,
+ {
+ resolve: `gatsby-plugin-manifest`,
+ options: {
+ name: `Skynet`,
+ short_name: `Skynet`,
+ start_url: `/`,
+ background_color: `#f1f7f2`,
+ theme_color: `#f1f7f2`,
+ display: `minimal-ui`,
+ icon: `src/images/logo.svg` // This path is relative to the root of the site.
+ }
+ }
+ // this (optional) plugin enables Progressive Web App + Offline functionality
+ // To learn more, visit: https://gatsby.dev/offline
+ // `gatsby-plugin-offline`,
+ ]
+};
diff --git a/netlify.toml b/netlify.toml
new file mode 100644
index 00000000..1519294a
--- /dev/null
+++ b/netlify.toml
@@ -0,0 +1,21 @@
+[[redirects]]
+ from = "/skynet/skyfile"
+ to = "https://siasky.net/skynet/skyfile"
+ status = 200
+ force = true
+
+[[redirects]]
+ from = "/file/*"
+ to = "https://siasky.net/file/:splat"
+ status = 200
+ force = true
+
+[[redirects]]
+ from = "/"
+ to = "/"
+ status = 200
+
+[[redirects]]
+ from = "/*"
+ to = "https://siasky.net/:splat"
+ status = 200
\ No newline at end of file
diff --git a/package.json b/package.json
index cdf3fb30..7eea907c 100644
--- a/package.json
+++ b/package.json
@@ -1,13 +1,19 @@
{
"name": "skynet-webportal",
+ "description": "Sia Skynet",
"version": "1.0.0",
- "homepage": "https://siasky.net",
+ "author": "Nebulous",
"dependencies": {
- "@testing-library/dom": "^6.12.2",
- "@testing-library/jest-dom": "^5.1.1",
- "@testing-library/react": "^9.3.2",
- "@testing-library/user-event": "^10.0.0",
"classnames": "^2.2.6",
+ "gatsby": "^2.19.7",
+ "gatsby-image": "^2.2.39",
+ "gatsby-plugin-manifest": "^2.2.39",
+ "gatsby-plugin-offline": "^3.0.32",
+ "gatsby-plugin-react-helmet": "^3.1.21",
+ "gatsby-plugin-sass": "^2.1.28",
+ "gatsby-plugin-sharp": "^2.4.3",
+ "gatsby-source-filesystem": "^2.1.46",
+ "gatsby-transformer-sharp": "^2.3.13",
"jsonp": "^0.2.1",
"node-sass": "^4.13.1",
"prop-types": "^15.7.2",
@@ -15,10 +21,10 @@
"react-countup": "^4.3.3",
"react-dom": "^16.12.0",
"react-dropzone": "^10.2.1",
+ "react-helmet": "^5.2.1",
"react-mailchimp-form": "^1.0.2",
"react-mailchimp-subscribe": "^2.1.0",
"react-reveal": "^1.2.2",
- "react-scripts": "^3.4.0",
"react-syntax-highlighter": "^12.2.1",
"react-visibility-sensor": "^5.1.1",
"shortid": "^2.2.15"
@@ -26,25 +32,28 @@
"devDependencies": {
"prettier": "^1.19.1"
},
+ "keywords": [
+ "sia",
+ "skynet",
+ "nebulous",
+ "blockchain",
+ "decentralized",
+ "cloud storage"
+ ],
+ "license": "MIT",
"scripts": {
- "start": "react-scripts start",
- "build": "react-scripts build",
- "test": "react-scripts test",
- "format": "prettier --write \"**/*.{js,jsx,json,md}\""
+ "build": "gatsby build",
+ "develop": "gatsby develop",
+ "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
+ "start": "yarn run develop",
+ "serve": "gatsby serve",
+ "clean": "gatsby clean"
},
- "eslintConfig": {
- "extends": "react-app"
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/NebulousLabs/skynet-webportal"
},
- "browserslist": {
- "production": [
- ">0.2%",
- "not dead",
- "not op_mini all"
- ],
- "development": [
- "last 1 chrome version",
- "last 1 firefox version",
- "last 1 safari version"
- ]
+ "bugs": {
+ "url": "https://github.com/NebulousLabs/skynet-webportal/issues"
}
}
diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png
deleted file mode 100644
index 4106f04c..00000000
Binary files a/public/android-chrome-192x192.png and /dev/null differ
diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png
deleted file mode 100644
index 5699b1a7..00000000
Binary files a/public/android-chrome-512x512.png and /dev/null differ
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index 795a3062..00000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/public/images/footer-cube.svg b/public/images/footer-cube.svg
deleted file mode 100644
index fd60814b..00000000
--- a/public/images/footer-cube.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
\ No newline at end of file
diff --git a/public/images/top-swoosh.svg b/public/images/top-swoosh.svg
deleted file mode 100644
index e3b4c20f..00000000
--- a/public/images/top-swoosh.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index fbe1314e..00000000
--- a/public/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Skynet
-
-
-
-
-
-
-
diff --git a/public/manifest.json b/public/manifest.json
deleted file mode 100644
index dbe6bdef..00000000
--- a/public/manifest.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "short_name": "Skynet",
- "name": "Skynet",
- "icons": [
- {
- "src": "favicon.ico",
- "sizes": "64x64 32x32 24x24 16x16",
- "type": "image/x-icon"
- },
- {
- "src": "android-chrome-192x192.png",
- "type": "image/png",
- "sizes": "192x192"
- },
- {
- "src": "android-chrome-512x512.png",
- "type": "image/png",
- "sizes": "512x512"
- }
- ],
- "start_url": ".",
- "display": "standalone",
- "theme_color": "#000000",
- "background_color": "#ffffff"
-}
diff --git a/public/privacy.pdf b/public/privacy.pdf
deleted file mode 100644
index 727d791d..00000000
Binary files a/public/privacy.pdf and /dev/null differ
diff --git a/public/robots.txt b/public/robots.txt
deleted file mode 100644
index e9e57dc4..00000000
--- a/public/robots.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# https://www.robotstxt.org/robotstxt.html
-User-agent: *
-Disallow:
diff --git a/public/terms.pdf b/public/terms.pdf
deleted file mode 100644
index 957e4132..00000000
Binary files a/public/terms.pdf and /dev/null differ
diff --git a/setup-scripts/README.md b/setup-scripts/README.md
index cfe23dfa..49867c4c 100644
--- a/setup-scripts/README.md
+++ b/setup-scripts/README.md
@@ -82,4 +82,4 @@ You can check that with `node -v` and `yarn -v` commands respectively.
- run `yarn` to build dependencies
- run `yarn build` to build the client package
-Client package will be outputted to `/build` and nginx configuration will pick it up automatically.
+Client package will be outputted to `/public` and nginx configuration will pick it up automatically.
diff --git a/setup-scripts/setup.sh b/setup-scripts/setup.sh
index 56d457da..ea1b5a27 100755
--- a/setup-scripts/setup.sh
+++ b/setup-scripts/setup.sh
@@ -11,10 +11,10 @@ sudo cp ./ssh_config /etc/ssh/ssh_config
mkdir -p ~/.ssh
cat ./authorized_keys >> ~/.ssh/authorized_keys
-# Nodejs install prerequisite. From official documentation.
+# Nodejs install prerequisite https://nodejs.org/en/download/package-manager/
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
-# Yarn install prerequisite.
+# Yarn install prerequisite https://classic.yarnpkg.com/en/docs/install
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@@ -23,9 +23,6 @@ sudo apt-get update
sudo apt-get -y install ufw tmux ranger htop nload nginx certbot \
python-certbot-nginx nodejs gcc g++ make yarn git vim
-# Install pm2
-sudo npm i -g pm2
-
# terminfo for alacritty terminal via ssh
# If you don't use the alacritty terminal you can remove this step.
wget -c https://raw.githubusercontent.com/alacritty/alacritty/master/extra/alacritty.info
@@ -66,3 +63,4 @@ cd Sia && git checkout viewnode && make
cd $cwd
cd ../
yarn
+yarn build
diff --git a/setup-scripts/skynet-nginx.conf b/setup-scripts/skynet-nginx.conf
index 168080c3..f9a7b504 100644
--- a/setup-scripts/skynet-nginx.conf
+++ b/setup-scripts/skynet-nginx.conf
@@ -10,8 +10,10 @@ server {
listen [::]:443 ssl http2;
server_name siasky.net www.siasky.net; # replace with actual server names
+ # NOTE: make sure to enable any additional configuration you might need like gzip
+
location / {
- root /home/user/skynet-webportal/build; # path to root of index.html
+ root /home/user/skynet-webportal/public; # path to root of index.html
}
location /skynet/skyfile/ {
diff --git a/src/components/App/App.js b/src/components/App/App.js
index 8a9c3ee1..36bdde8e 100644
--- a/src/components/App/App.js
+++ b/src/components/App/App.js
@@ -1,12 +1,12 @@
import React from "react";
-
+import TopSwoosh from "../../svg/TopSwoosh";
import "./App.scss";
import { HomeTop, HomeUpload, HomeBuilt, HomeSamples, HomeStay, HomeNetwork, Footer } from "../";
function App() {
return (
-
+
diff --git a/src/components/CodeExamples/CodeExamples.js b/src/components/CodeExamples/CodeExamples.js
index 4d264763..d7573773 100644
--- a/src/components/CodeExamples/CodeExamples.js
+++ b/src/components/CodeExamples/CodeExamples.js
@@ -1,53 +1,58 @@
import React, { useState } from "react";
-import SyntaxHighlighter from "react-syntax-highlighter";
import classNames from "classnames";
-
-import "./CodeExamples.scss";
+import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
+import { javascript, go, python, bash } from 'react-syntax-highlighter/dist/esm/languages/hljs';
import Colors from "./Colors";
-import { python, curl, node, go } from "./Code";
+import * as snippets from "./Code";
+import "./CodeExamples.scss";
+
+SyntaxHighlighter.registerLanguage('javascript', javascript);
+SyntaxHighlighter.registerLanguage('go', go);
+SyntaxHighlighter.registerLanguage('python', python);
+SyntaxHighlighter.registerLanguage('bash', bash);
export default function CodeExamples() {
const [active, setActive] = useState(1);
return (
-
- - setActive(1)} className={classNames({ active: active === 1 })}>
+
+
+
+
+
+
{active === 1 && (
-
- {curl}
+
+ {snippets.curl}
)}
{active === 2 && (
- {python}
+ {snippets.python}
)}
{active === 3 && (
-
- {node}
+
+ {snippets.node}
)}
{active === 4 && (
- {go}
+ {snippets.go}
)}
diff --git a/src/components/CodeExamples/CodeExamples.scss b/src/components/CodeExamples/CodeExamples.scss
index b174a0ff..f4ae1ead 100644
--- a/src/components/CodeExamples/CodeExamples.scss
+++ b/src/components/CodeExamples/CodeExamples.scss
@@ -7,7 +7,7 @@
align-items: flex-end;
height: 65px;
- li {
+ button {
display: block;
flex: 1;
color: $white60;
@@ -30,23 +30,23 @@
}
}
- li:hover,
- li.active {
+ button:hover,
+ button.active {
color: $white;
background-color: #171917;
line-height: 65px;
}
- li:first-child {
+ button:first-child {
border-top-left-radius: 12px;
}
- li:last-child {
+ button:last-child {
border-top-right-radius: 12px;
}
- li.filler,
- li.filler:hover {
+ button.filler,
+ button.filler:hover {
flex: 1;
height: 57px;
border-top-right-radius: 12px;
diff --git a/src/components/Mailing/Mailing.scss b/src/components/Mailing/Mailing.scss
index 33b46dd2..bb95a4a8 100644
--- a/src/components/Mailing/Mailing.scss
+++ b/src/components/Mailing/Mailing.scss
@@ -43,7 +43,7 @@
display: inline-block;
vertical-align: middle;
margin: -2px 8px 0 0;
- background-image: url('/images/green-check.svg');
+ background-image: url('../../images/green-check.svg');
background-repeat: no-repeat;
background-size: 28px;
background-position: top -300px center;
diff --git a/src/components/seo.js b/src/components/seo.js
new file mode 100644
index 00000000..cacf237e
--- /dev/null
+++ b/src/components/seo.js
@@ -0,0 +1,83 @@
+/**
+ * SEO component that queries for data with
+ * Gatsby's useStaticQuery React hook
+ *
+ * See: https://www.gatsbyjs.org/docs/use-static-query/
+ */
+
+import React from "react";
+import PropTypes from "prop-types";
+import Helmet from "react-helmet";
+import { useStaticQuery, graphql } from "gatsby";
+
+function SEO({ lang, meta }) {
+ const { site } = useStaticQuery(
+ graphql`
+ query {
+ site {
+ siteMetadata {
+ title
+ author
+ description
+ }
+ }
+ }
+ `
+ );
+
+ return (
+
+ );
+}
+
+SEO.defaultProps = {
+ lang: `en`,
+ meta: [],
+ description: ``
+};
+
+SEO.propTypes = {
+ lang: PropTypes.string,
+ meta: PropTypes.arrayOf(PropTypes.object)
+};
+
+export default SEO;
diff --git a/public/fonts/hinted-subset-HaasGrotDispR-55Roman.woff b/src/fonts/hinted-subset-HaasGrotDispR-55Roman.woff
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotDispR-55Roman.woff
rename to src/fonts/hinted-subset-HaasGrotDispR-55Roman.woff
diff --git a/public/fonts/hinted-subset-HaasGrotDispR-55Roman.woff2 b/src/fonts/hinted-subset-HaasGrotDispR-55Roman.woff2
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotDispR-55Roman.woff2
rename to src/fonts/hinted-subset-HaasGrotDispR-55Roman.woff2
diff --git a/public/fonts/hinted-subset-HaasGrotDispR-65Medium.woff b/src/fonts/hinted-subset-HaasGrotDispR-65Medium.woff
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotDispR-65Medium.woff
rename to src/fonts/hinted-subset-HaasGrotDispR-65Medium.woff
diff --git a/public/fonts/hinted-subset-HaasGrotDispR-65Medium.woff2 b/src/fonts/hinted-subset-HaasGrotDispR-65Medium.woff2
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotDispR-65Medium.woff2
rename to src/fonts/hinted-subset-HaasGrotDispR-65Medium.woff2
diff --git a/public/fonts/hinted-subset-HaasGrotTextR-55Roman.woff b/src/fonts/hinted-subset-HaasGrotTextR-55Roman.woff
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotTextR-55Roman.woff
rename to src/fonts/hinted-subset-HaasGrotTextR-55Roman.woff
diff --git a/public/fonts/hinted-subset-HaasGrotTextR-55Roman.woff2 b/src/fonts/hinted-subset-HaasGrotTextR-55Roman.woff2
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotTextR-55Roman.woff2
rename to src/fonts/hinted-subset-HaasGrotTextR-55Roman.woff2
diff --git a/public/fonts/hinted-subset-HaasGrotTextR-65Medium.woff b/src/fonts/hinted-subset-HaasGrotTextR-65Medium.woff
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotTextR-65Medium.woff
rename to src/fonts/hinted-subset-HaasGrotTextR-65Medium.woff
diff --git a/public/fonts/hinted-subset-HaasGrotTextR-65Medium.woff2 b/src/fonts/hinted-subset-HaasGrotTextR-65Medium.woff2
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotTextR-65Medium.woff2
rename to src/fonts/hinted-subset-HaasGrotTextR-65Medium.woff2
diff --git a/public/fonts/hinted-subset-HaasGrotTextR-75Bold.woff b/src/fonts/hinted-subset-HaasGrotTextR-75Bold.woff
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotTextR-75Bold.woff
rename to src/fonts/hinted-subset-HaasGrotTextR-75Bold.woff
diff --git a/public/fonts/hinted-subset-HaasGrotTextR-75Bold.woff2 b/src/fonts/hinted-subset-HaasGrotTextR-75Bold.woff2
similarity index 100%
rename from public/fonts/hinted-subset-HaasGrotTextR-75Bold.woff2
rename to src/fonts/hinted-subset-HaasGrotTextR-75Bold.woff2
diff --git a/src/global.scss b/src/global.scss
index 5418630f..705ba4d8 100644
--- a/src/global.scss
+++ b/src/global.scss
@@ -2,40 +2,40 @@
@font-face {
font-family: "Haas Grot Disp";
- src: url("/fonts/hinted-subset-HaasGrotDispR-55Roman.woff2") format("woff2"),
- url("/fonts/hinted-subset-HaasGrotDispR-55Roman.woff") format("woff");
+ src: url("./fonts/hinted-subset-HaasGrotDispR-55Roman.woff2") format("woff2"),
+ url("./fonts/hinted-subset-HaasGrotDispR-55Roman.woff") format("woff");
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: "Haas Grot Disp";
- src: url("/fonts/hinted-subset-HaasGrotDispR-65Medium.woff2") format("woff2"),
- url("/fonts/hinted-subset-HaasGrotDispR-65Medium.woff") format("woff");
+ src: url("./fonts/hinted-subset-HaasGrotDispR-65Medium.woff2") format("woff2"),
+ url("./fonts/hinted-subset-HaasGrotDispR-65Medium.woff") format("woff");
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: "Haas Grot Text";
- src: url("/fonts/hinted-subset-HaasGrotTextR-75Bold.woff2") format("woff2"),
- url("/fonts/hinted-subset-HaasGrotTextR-75Bold.woff") format("woff");
+ src: url("./fonts/hinted-subset-HaasGrotTextR-75Bold.woff2") format("woff2"),
+ url("./fonts/hinted-subset-HaasGrotTextR-75Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: "Haas Grot Text";
- src: url("/fonts/hinted-subset-HaasGrotTextR-65Medium.woff2") format("woff2"),
- url("/fonts/hinted-subset-HaasGrotTextR-65Medium.woff") format("woff");
+ src: url("./fonts/hinted-subset-HaasGrotTextR-65Medium.woff2") format("woff2"),
+ url("./fonts/hinted-subset-HaasGrotTextR-65Medium.woff") format("woff");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "Haas Grot Text";
- src: url("/fonts/hinted-subset-HaasGrotTextR-55Roman.woff2") format("woff2"),
- url("/fonts/hinted-subset-HaasGrotTextR-55Roman.woff") format("woff");
+ src: url("./fonts/hinted-subset-HaasGrotTextR-55Roman.woff2") format("woff2"),
+ url("./fonts/hinted-subset-HaasGrotTextR-55Roman.woff") format("woff");
font-weight: normal;
font-style: normal;
}
diff --git a/public/images/green-check.svg b/src/images/green-check.svg
similarity index 100%
rename from public/images/green-check.svg
rename to src/images/green-check.svg
diff --git a/src/images/logo.svg b/src/images/logo.svg
index 452f0d32..16c695f9 100644
--- a/src/images/logo.svg
+++ b/src/images/logo.svg
@@ -1,4 +1,4 @@
-