Skip to content

Commit

Permalink
fix: begun fixing merge comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lucamattiazzi committed Dec 6, 2019
1 parent 5be0e55 commit 058cbc9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 67 deletions.
40 changes: 19 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,30 @@ but significant amounts of code were rewritten and simplified. Here are some shi
- **JSON5 webpack loader** to import .json5 files. [Read more about JSON5 here](https://json5.org/).

## Table of contents
- [!Accurapp](#accurapp)
- [Table of contents](#table-of-contents)
- [Creating a new project](#creating-a-new-project)
- [Setting up github](#setting-up-github)
- [Setting up the automatic deploy](#setting-up-the-automatic-deploy)
- [Commands](#commands)
- [Customization](#customization)
- [Customizing Webpack](#customizing-webpack)
- [Customizing Eslint](#customizing-eslint)
- [Customizing Babel](#customizing-babel)
- [Setting Env Variables](#setting-env-variables)
- [Customizing Env Variables](#customizing-env-variables)
- [Customizing Webpack](#customizing-webpack)
- [Customizing Eslint](#customizing-eslint)
- [Customizing Babel](#customizing-babel)
- [Setting Env Variables](#setting-env-variables)
- [Customizing Env Variables](#customizing-env-variables)
- [Available Env Variables](#available-env-variables)
- [Project Scaffolding](#project-scaffolding)
- [F.A.Q.](#faq)
- [Install `react-helmet` and `react-snap`](#install-react-helmet-and-react-snap)
- [Add meta tags for each route in the `render` function](#add-meta-tags-for-each-route-in-the-render-function)
- [Add `react-snap` in `src/index.js`](#add-react-snap-in-srcindexjs)
- [Add `react-snap` to `package.json`](#add-react-snap-to-packagejson)
- [Add the `react-snap` config in `bitbucket-pipelines.yml`](#add-the-react-snap-config-in-bitbucket-pipelinesyml)
- [OK, setup done! Now, how do I check if it is working?](#ok-setup-done-now-how-do-i-check-if-it-is-working)
- [Basic troubleshooting: `react-snap` works properly, but no links are found](#basic-troubleshooting-react-snap-works-properly-but-no-links-are-found)
- [Basic troubleshooting: I get a weird error for 404 pages](#basic-troubleshooting-i-get-a-weird-error-for-404-pages)
- [Basic troubleshooting: There is unknown code in my built index.html. Is it malicious? How do I remove it?](#basic-troubleshooting-there-is-unknown-code-in-my-built-indexhtml-is-it-malicious-how-do-i-remove-it)
- [Further troubleshooting](#further-troubleshooting)
- [What goes in the `<head>`?](#what-goes-in-the-head)
- [How do I enable hot reloading for the state?](#faq)
- [Where do I put the images?](#faq)
- [Where do I put the custom fonts?](#faq)
- [What is the public folder for?](#faq)
- [How do I handle svg files?](#faq)
- [How do I enable TypeScript?](#faq)
- [How do I override a webpack loader?](#faq)
- [What's all the fuss about FUSS?](#faq)
- [How do I enable prettier?](#faq)
- [I need to support IE11. What do I do?](#faq)
- [How do I use a web worker?](#faq)
- [How do I use a service worker?](#faq)
- [I need title and meta tags for each route for SEO. How do I do it?](#faq)
- [I need to build for Electron. How do I do it?](#faq)
- [Contributing](#contributing)

## Creating a new project
Expand Down
45 changes: 0 additions & 45 deletions packages/accurapp-scripts/utils/reverse-tunnel.js

This file was deleted.

44 changes: 43 additions & 1 deletion packages/accurapp-scripts/utils/tunnel-client.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,50 @@
const os = require('os')
const { Socket } = require('net')
const got = require('got')
const { createClient } = require('./reverse-tunnel')
const { Client } = require('ssh2')
const { extractCurrentRepo, extractCurrentBranch } = require('../utils/git-utils')

function noop() {}

function createClient(config, onReadyCb = noop, onConnectionCb = noop) {
const conn = new Client()
const errors = []

conn.on('ready', () => {
onReadyCb()
conn.forwardIn(config.dstHost, config.dstPort, (err, port) => {
if (err) return errors.push(err)
conn.emit('forward-in', port)
})
})

conn.on('tcp connection', (info, accept, reject) => {
let remote
const srcSocket = new Socket()

srcSocket.on('error', err => {
errors.push(err)
if (remote === undefined) {
reject()
} else {
remote.end()
}
})

srcSocket.connect(config.srcPort, config.srcHost, () => {
remote = accept()
srcSocket.pipe(remote).pipe(srcSocket)
if (errors.length === 0) {
onConnectionCb(null, conn)
} else {
onConnectionCb(errors, null)
}
})
})
conn.connect(config)
return conn
}

const { USER, SSH_AUTH_SOCK, TUNNEL_DOMAIN = 'internal.accurat.io' } = process.env

function generateSubdomain() {
Expand Down

0 comments on commit 058cbc9

Please sign in to comment.