update to new react UI and various fixes

This commit is contained in:
Jon Lundy
2018-03-13 16:25:18 -06:00
parent 1dcd0f73cf
commit 0a6fa4bc53
14 changed files with 98 additions and 82 deletions

View File

@@ -9223,6 +9223,12 @@
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-4.0.0.tgz",
"integrity": "sha512-FlsPxavEyMuR6TjVbSSywovXSEyOg6ZDj5+Z8nbsRl9EkOzAhEIcS+GLoQDC5fz/t9suhUXWmUrOBrgeUvrMxw=="
},
"react-highlight": {
"version": "github:briancappello/react-highlight#ecf53ae1bb03deddb897515e7ed65b9e9f7af65b",
"requires": {
"highlight.js": "9.12.0"
}
},
"react-overlays": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-0.8.3.tgz",
@@ -10202,7 +10208,7 @@
}
},
"sour-is": {
"version": "git+ssh://git@git.dn42.us:xuu/souris-react.git#3ca08bd7a65e967bb4e95969ba59130f25287331",
"version": "file:src/vendor/sour-is",
"requires": {
"bootstrap": "3.3.7",
"crypto-js": "3.1.9-1",
@@ -10217,14 +10223,6 @@
"react-router-dom": "4.2.2",
"react-scripts": "1.1.1",
"seedrandom": "2.4.3"
},
"dependencies": {
"react-highlight": {
"version": "github:briancappello/react-highlight#ecf53ae1bb03deddb897515e7ed65b9e9f7af65b",
"requires": {
"highlight.js": "9.12.0"
}
}
}
},
"source-list-map": {

View File

@@ -6,12 +6,13 @@
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.1",
"sour-is": "git+ssh://git@git.dn42.us:xuu/souris-react.git"
"sour-is": "file:src/vendor/sour-is"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"postinstall": "npm install src/vendor/sour-is"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

45
assets/public/paste.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
if [ "$1" = "-h" ]; then
cat 1>&2 <<EOL
usage: echo /etc/passwd | ./paste.sh
env options:
PASTE_URL - Set the url base for paste operations (default: HTTPS://paste.dn42.us)
PASTE_GZIP - 0 = No Compression, 1 = Use gzip compression (default: 0)
PASTE_BURN - 0 = No Burn on Read, 1 = Burn on read (default: 0)
PASTE_DATE - Value to be used when setting expire date. (default: next-week)
EOL
exit
fi
PASTE_URL=${PASTE_URL-"https://paste.dn42.us"}
PASTE_BURN=${PASTE_BURN-0}
PASTE_DATE=${PASTE_DATE-"next-week"}
PASTE_GZIP=${PASTE_GZIP-0}
GZBIN="cat"
[ "$PASTE_GZIP" -eq "1" ] && GZBIN="gzip -c"
PASS=$(head -c 40 /dev/urandom);
CHK=$(echo -s $PASS | openssl dgst -sha256 -binary | openssl dgst -ripemd160 -binary | base64 | tr '/+' '_-' | tr -d '=')
PASS=$(echo -s $PASS | openssl dgst -sha256 -binary | base64 | tr '/+' '_-' | tr -d '=')
HASH=$((echo -e "exp:\t$(date +%s -d ${PASTE_DATE})"; \
echo -e "chk:\t$CHK"; \
[ "$PASTE_BURN" -eq "1" ] && echo -e "burn:\ttrue"; \
[ "$PASTE_GZIP" -eq "1" ] && echo -e "zip:\ttrue"; \
echo; \
cat /dev/stdin | $GZBIN | openssl aes-256-cbc -e -a -k $PASS) | \
curl -s -X POST ${PASTE_URL}/paste --data-binary @-)
HASH_OK=$(echo $HASH | cut -c1-2)
if [ "$HASH_OK" = "OK" ]; then
HASH=$(echo $HASH | cut -f2 -d' ')
echo "url: ${PASTE_URL}/#/${HASH}!${PASS}"
echo -n "shell: curl -s ${PASTE_URL}/api/get/${HASH} | sed '1,/^\$/d' | openssl aes-256-cbc -d -a -k ${PASS}"
[ "$PASTE_GZIP" -eq "1" ] && echo " | gzip -dc" || echo;
exit
fi
echo $HASH

View File

@@ -1,19 +1,22 @@
import React, { Component } from 'react';
import Paste from './vendor/src/paste/Paste';
import Framework from './vendor/src/sour-is/Framework';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { remoteService } from "./vendor/src/sour-is/RemoteService";
import 'bootstrap/dist/css/bootstrap.css';
import 'sour-is/src/sour-is/Framework.css';
import Paste from './vendor/sour-is/src/paste/Paste';
import { remoteService } from "./vendor/sour-is/src/sour-is/RemoteService";
const req = remoteService();
const APP_NAME = "DN42 Paste UI";
class App extends Component {
constructor(){
super()
super();
this.state = {
name: APP_NAME,
api: "Paste API (Version Snapshot)"
api: "Paste API (Version Snapshot)",
}
}
@@ -22,7 +25,7 @@ componentDidMount() {
.then((response) => {
if (response.ok) return response.text().catch(()=>"");
else return "Unknown API"; })
.then((text) => { this.setState({app:{name: APP_NAME, api: text}}); });
.then((text) => { this.setState({api: text}); });
}
render() {