12 Commits

Author SHA1 Message Date
Xuu
a55162b6b4 Merge branch 'paste' of git.dn42.dev:dn42/go-paste into paste 2020-08-31 12:36:16 -06:00
Xuu
10b5ccd0c4 update UI and fixes 2020-08-31 12:35:59 -06:00
xuu
b308e9fab6 fix 2020-08-29 01:55:57 +00:00
xuu
f8b806f3f4 fix 2020-08-29 01:46:51 +00:00
xuu
47f908ff47 test 2020-08-29 01:32:41 +00:00
xuu
63987f8fa1 test 2020-08-29 01:30:57 +00:00
Xuu
db0878bf44 Update '.drone.yml' 2020-08-29 01:27:29 +00:00
Xuu
a5289500cf Update '.drone.yml' 2020-08-29 01:24:01 +00:00
Xuu
220be8f732 release version 2.4.1 2020-08-28 17:23:12 -06:00
Xuu
4659727d3a . 2020-08-28 17:00:52 -06:00
Xuu
67c9c41a24 fix ui 2020-08-28 16:50:27 -06:00
Xuu
41924fbd8b release version 2.2.0-18 2020-08-28 16:03:48 -06:00
15 changed files with 324 additions and 364 deletions

View File

@@ -10,11 +10,13 @@ platform:
steps: steps:
- name: Setup - name: Setup
commands: commands:
- git fetch origin --tags
- make setup - make setup
- name: Test - name: Test
commands: commands:
- make test - make test
trigger: trigger:
event: event:
- push - push
@@ -31,15 +33,16 @@ platform:
steps: steps:
- name: Setup - name: Setup
commands: commands:
- git fetch origin --tags
- make setup - make setup
- name: Build Release - name: Build Release
commands: commands:
- cd debian - cd debian
- make release
- make build - make build
- make copy - make copy
- make deploy - make deploy
- make tag
trigger: trigger:
event: event:
- promote - promote

View File

@@ -4,6 +4,9 @@ DOCS_ASSET=src/docs/bindata.go
SOURCE=$(wildcard cmd/paste/*.go) $(filter-out src/routes/bindata.go, $(wildcard src/routes/*.go)) SOURCE=$(wildcard cmd/paste/*.go) $(filter-out src/routes/bindata.go, $(wildcard src/routes/*.go))
BINARY=paste BINARY=paste
VERSION:=$(shell debian/inc_version.sh -p $(shell git describe --tags `git rev-list --tags --max-count=1`))
DATE:=$(shell date -u +%FT%TZ)
define DUMMY_BINDATA define DUMMY_BINDATA
package docs package docs
import "net/http" import "net/http"
@@ -27,9 +30,13 @@ run: $(BINARY)
./$(BINARY) -vv serve ./$(BINARY) -vv serve
$(BINARY): $(SOURCE) $(ROUTE_ASSET) $(DOCS_ASSET) $(BINARY): $(SOURCE) $(ROUTE_ASSET) $(DOCS_ASSET)
go build "sour.is/x/paste/cmd/paste" go build \
-ldflags "-X main.AppVersion=$(VERSION) -X main.AppBuild=$(DATE)" \
"sour.is/x/paste/cmd/paste"
build-ui: $(ROUTE_ASSET) $(DOCS_ASSET) clean-ui:
rm -rf $(ROUTE_ASSET) $(DOCS_ASSET)
build-ui: clean-ui $(ROUTE_ASSET) $(DOCS_ASSET)
$(ROUTE_ASSET): $(ROUTE_ASSET):
cd assets; \ cd assets; \
rm -rf build ../public; \ rm -rf build ../public; \

183
assets/package-lock.json generated
View File

@@ -1402,25 +1402,6 @@
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz",
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw=="
}, },
"@popperjs/core": {
"version": "2.4.4",
"resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.4.4.tgz",
"integrity": "sha512-1oO6+dN5kdIA3sKPZhRGJTfGVP4SWV6KqlMOwry4J3HfyD68sl/3KmG7DeYUzvN+RbhXDnv/D8vNNB8168tAMg=="
},
"@restart/context": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/@restart/context/-/context-2.1.4.tgz",
"integrity": "sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q=="
},
"@restart/hooks": {
"version": "0.3.25",
"resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.3.25.tgz",
"integrity": "sha512-m2v3N5pxTsIiSH74/sb1yW8D9RxkJidGW+5Mfwn/lHb2QzhZNlaU1su7abSyT9EGf0xS/0waLjrf7/XxQHUk7w==",
"requires": {
"lodash": "^4.17.15",
"lodash-es": "^4.17.15"
}
},
"@svgr/babel-plugin-add-jsx-attribute": { "@svgr/babel-plugin-add-jsx-attribute": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz", "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.2.0.tgz",
@@ -1567,11 +1548,6 @@
"@babel/types": "^7.3.0" "@babel/types": "^7.3.0"
} }
}, },
"@types/classnames": {
"version": "2.2.10",
"resolved": "https://registry.npmjs.org/@types/classnames/-/classnames-2.2.10.tgz",
"integrity": "sha512-1UzDldn9GfYYEsWWnn/P4wkTlkZDH7lDb0wBMGbtIQc9zXEQq7FlKBdZUn6OBqD8sKZZ2RQO2mAjGpXiDGoRmQ=="
},
"@types/color-name": { "@types/color-name": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
@@ -1591,11 +1567,6 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/invariant": {
"version": "2.2.33",
"resolved": "https://registry.npmjs.org/@types/invariant/-/invariant-2.2.33.tgz",
"integrity": "sha512-/jUNmS8d4bCKdqslfxW6dg/9Gksfzxz67IYfqApHn+HvHlMVXwYv2zpTDnS/yaK9BB0i0GlBTaYci0EFE62Hmw=="
},
"@types/istanbul-lib-coverage": { "@types/istanbul-lib-coverage": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
@@ -1638,43 +1609,16 @@
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
}, },
"@types/prop-types": {
"version": "15.7.3",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
},
"@types/q": { "@types/q": {
"version": "1.5.4", "version": "1.5.4",
"resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz",
"integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==" "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug=="
}, },
"@types/react": {
"version": "16.9.46",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.46.tgz",
"integrity": "sha512-dbHzO3aAq1lB3jRQuNpuZ/mnu+CdD3H0WVaaBQA8LTT3S33xhVBUj232T8M3tAhSWJs/D/UqORYUlJNl/8VQZg==",
"requires": {
"@types/prop-types": "*",
"csstype": "^3.0.2"
}
},
"@types/react-transition-group": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.0.tgz",
"integrity": "sha512-/QfLHGpu+2fQOqQaXh8MG9q03bFENooTb/it4jr5kKaZlDQfWvjqWZg48AwzPVMBHlRuTRAY7hRHCEOXz5kV6w==",
"requires": {
"@types/react": "*"
}
},
"@types/stack-utils": { "@types/stack-utils": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz",
"integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==" "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw=="
}, },
"@types/warning": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/warning/-/warning-3.0.0.tgz",
"integrity": "sha1-DSUBJorY+ZYrdA04fEZU9fjiPlI="
},
"@types/yargs": { "@types/yargs": {
"version": "13.0.10", "version": "13.0.10",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.10.tgz", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.10.tgz",
@@ -2878,6 +2822,20 @@
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.2.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.2.tgz",
"integrity": "sha512-vlGn0bcySYl/iV+BGA544JkkZP5LB3jsmkeKLFQakCOwCM3AOk7VkldBz4jrzSe+Z0Ezn99NVXa1o45cQY4R6A==" "integrity": "sha512-vlGn0bcySYl/iV+BGA544JkkZP5LB3jsmkeKLFQakCOwCM3AOk7VkldBz4jrzSe+Z0Ezn99NVXa1o45cQY4R6A=="
}, },
"bootstrap-4-react": {
"version": "0.0.59",
"resolved": "https://registry.npmjs.org/bootstrap-4-react/-/bootstrap-4-react-0.0.59.tgz",
"integrity": "sha512-j3a618tWHl/ajYQi6zn0LdVfksRH+gyQ4RwIanTPin6xkHkgYfk+47ZlHFSwyiO9zVFn4xznoGjTwWA0AIlJkA==",
"requires": {
"bootstrap-4-required": "0.0.1",
"fsts": "0.0.44"
}
},
"bootstrap-4-required": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/bootstrap-4-required/-/bootstrap-4-required-0.0.1.tgz",
"integrity": "sha512-4S6Trn9pRVSR756GRYr3hy2cZL3Vc0tw0/H9E+mbNeOR+4tn6CeRgcLx0YqZmL2XlabtEV73+XAesmwkgTDKvQ=="
},
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -3337,11 +3295,6 @@
} }
} }
}, },
"classnames": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
"integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
},
"clean-css": { "clean-css": {
"version": "4.2.3", "version": "4.2.3",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz",
@@ -4056,11 +4009,6 @@
"cssom": "0.3.x" "cssom": "0.3.x"
} }
}, },
"csstype": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.2.tgz",
"integrity": "sha512-ofovWglpqoqbfLNOTBNZLSbMuGrblAf1efvvArGKOZMBrIoJeu5UsAipQolkijtyQx5MtAzT/J9IHj/CEY1mJw=="
},
"cyclist": { "cyclist": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz",
@@ -4377,15 +4325,6 @@
"utila": "~0.4" "utila": "~0.4"
} }
}, },
"dom-helpers": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.0.tgz",
"integrity": "sha512-Ru5o9+V8CpunKnz5LGgWXkmrH/20cGKwcHwS4m73zIvs54CN9epEmT/HLqFJW3kXpakAFkEdzgy1hzlJe3E4OQ==",
"requires": {
"@babel/runtime": "^7.8.7",
"csstype": "^3.0.2"
}
},
"dom-serializer": { "dom-serializer": {
"version": "0.2.2", "version": "0.2.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz",
@@ -5884,6 +5823,11 @@
"integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==",
"optional": true "optional": true
}, },
"fsts": {
"version": "0.0.44",
"resolved": "https://registry.npmjs.org/fsts/-/fsts-0.0.44.tgz",
"integrity": "sha512-0U4qvbzOE+3s2711DdszIyaAnZ3M0dbFAhnkez/ITy31MwzDI2lepGSkVeFOyx6jqWvwaSZr01RP4hdM4I8wxQ=="
},
"function-bind": { "function-bind": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
@@ -7864,11 +7808,6 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
}, },
"lodash-es": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz",
"integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ=="
},
"lodash._reinterpolate": { "lodash._reinterpolate": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz",
@@ -10161,15 +10100,6 @@
"react-is": "^16.8.1" "react-is": "^16.8.1"
} }
}, },
"prop-types-extra": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.1.tgz",
"integrity": "sha512-59+AHNnHYCdiC+vMwY52WmvP5dM3QLeoumYuEyceQDi9aEhtwN9zIQ2ZNo25sMyXnbh32h+P1ezDsUpUH3JAew==",
"requires": {
"react-is": "^16.3.2",
"warning": "^4.0.0"
}
},
"proxy-addr": { "proxy-addr": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
@@ -10354,31 +10284,6 @@
"whatwg-fetch": "^3.0.0" "whatwg-fetch": "^3.0.0"
} }
}, },
"react-bootstrap": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-1.3.0.tgz",
"integrity": "sha512-GYj0c6FO9mx7DaO8Xyz2zs0IcQ6CGCtM3O6/feIoCaG4N8B0+l4eqL7stlMcLpqO4d8NG2PoMO/AbUOD+MO7mg==",
"requires": {
"@babel/runtime": "^7.4.2",
"@restart/context": "^2.1.4",
"@restart/hooks": "^0.3.21",
"@types/classnames": "^2.2.10",
"@types/invariant": "^2.2.33",
"@types/prop-types": "^15.7.3",
"@types/react": "^16.9.35",
"@types/react-transition-group": "^4.4.0",
"@types/warning": "^3.0.0",
"classnames": "^2.2.6",
"dom-helpers": "^5.1.2",
"invariant": "^2.2.4",
"prop-types": "^15.7.2",
"prop-types-extra": "^1.1.0",
"react-overlays": "^4.1.0",
"react-transition-group": "^4.4.1",
"uncontrollable": "^7.0.0",
"warning": "^4.0.3"
}
},
"react-dev-utils": { "react-dev-utils": {
"version": "10.2.1", "version": "10.2.1",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz",
@@ -10609,11 +10514,6 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
}, },
"react-lifecycles-compat": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
},
"react-markdown": { "react-markdown": {
"version": "4.3.1", "version": "4.3.1",
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-4.3.1.tgz", "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-4.3.1.tgz",
@@ -10629,21 +10529,6 @@
"xtend": "^4.0.1" "xtend": "^4.0.1"
} }
}, },
"react-overlays": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-4.1.0.tgz",
"integrity": "sha512-vdRpnKe0ckWOOD9uWdqykLUPHLPndIiUV7XfEKsi5008xiyHCfL8bxsx4LbMrfnxW1LzRthLyfy50XYRFNQqqw==",
"requires": {
"@babel/runtime": "^7.4.5",
"@popperjs/core": "^2.0.0",
"@restart/hooks": "^0.3.12",
"@types/warning": "^3.0.0",
"dom-helpers": "^5.1.0",
"prop-types": "^15.7.2",
"uncontrollable": "^7.0.0",
"warning": "^4.0.3"
}
},
"react-router": { "react-router": {
"version": "5.2.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz",
@@ -10750,17 +10635,6 @@
"workbox-webpack-plugin": "4.3.1" "workbox-webpack-plugin": "4.3.1"
} }
}, },
"react-transition-group": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz",
"integrity": "sha512-Djqr7OQ2aPUiYurhPalTrVy9ddmFCCzwhqQmtN+J3+3DzLO209Fdr70QrN8Z3DsglWql6iY1lDWAfpFiBtuKGw==",
"requires": {
"@babel/runtime": "^7.5.5",
"dom-helpers": "^5.0.1",
"loose-envify": "^1.4.0",
"prop-types": "^15.6.2"
}
},
"read-pkg": { "read-pkg": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
@@ -12692,17 +12566,6 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
}, },
"uncontrollable": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.1.1.tgz",
"integrity": "sha512-EcPYhot3uWTS3w00R32R2+vS8Vr53tttrvMj/yA1uYRhf8hbTG2GyugGqWDY0qIskxn0uTTojVd6wPYW9ZEf8Q==",
"requires": {
"@babel/runtime": "^7.6.3",
"@types/react": "^16.9.11",
"invariant": "^2.2.4",
"react-lifecycles-compat": "^3.0.4"
}
},
"unherit": { "unherit": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz",
@@ -13076,14 +12939,6 @@
"makeerror": "1.0.x" "makeerror": "1.0.x"
} }
}, },
"warning": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
"integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
"requires": {
"loose-envify": "^1.0.0"
}
},
"watchpack": { "watchpack": {
"version": "1.7.4", "version": "1.7.4",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz",

View File

@@ -4,9 +4,9 @@
"private": true, "private": true,
"dependencies": { "dependencies": {
"bootstrap": "^4.5.2", "bootstrap": "^4.5.2",
"bootstrap-4-react": "0.0.59",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"react": "^16.9.0", "react": "^16.9.0",
"react-bootstrap": "^1.3.0",
"react-dom": "^16.9.0", "react-dom": "^16.9.0",
"react-highlight": "^0.12.0", "react-highlight": "^0.12.0",
"react-markdown": "^4.3.1", "react-markdown": "^4.3.1",

View File

@@ -1,7 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom'; import { BrowserRouter, Route, Switch } from 'react-router-dom';
import 'bootstrap/dist/css/bootstrap.css';
import './paste/Framework.css'; import './paste/Framework.css';
import Paste from './paste/Paste'; import Paste from './paste/Paste';
@@ -21,7 +20,7 @@ class App extends Component {
} }
componentDidMount() { componentDidMount() {
req('/app-info').get() req('https://paste.dn42.us/app-info').get()
.then((response) => { .then((response) => {
if (response.ok) return response.text().catch(()=>""); if (response.ok) return response.text().catch(()=>"");
else return "Unknown API"; }) else return "Unknown API"; })

View File

@@ -1,9 +1,9 @@
body,html {color: #c8c8c8; background-color: #272b30; } body,html {color: black !important; background-color: #272b30 !important; }
header + section { padding-top: 52px; padding-bottom: 2.1em } header + section { padding-top: 52px; padding-bottom: 2.1em }
footer { background-color: #3e444c; position:fixed; bottom:0; width: 100%; height: 2em; border-top: 1px solid #bbb; padding: 4px } footer { background-color: #3e444c; position:fixed; bottom:0; width: 100%; height: 2em; border-top: 1px solid #bbb; padding: 4px }
footer span.left { float: left; } footer span.left { float: left; }
footer span.right { float: right; } footer span.right { float: right; }
pre { color: black}
.breadcrumb label { color: black; } .breadcrumb label { color: black; }
.sidebar .list-group { .sidebar .list-group {

View File

@@ -1,5 +1,5 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { Form, Button, Alert } from "react-bootstrap"; import { Form, Button, Alert } from "bootstrap-4-react";
import "./paste.css"; import "./paste.css";
@@ -95,6 +95,8 @@ const PASTE_API = "https://paste.dn42.us/paste"
const syntaxItems = [ const syntaxItems = [
["text", "Plain Text"], ["text", "Plain Text"],
["markdown", "Markdown"],
["apache", "Apache"], ["apache", "Apache"],
["bash", "Bash"], ["bash", "Bash"],
["coffeescript", "CoffeeScript"], ["coffeescript", "CoffeeScript"],
@@ -108,7 +110,6 @@ const syntaxItems = [
["javascript", "JavaScript"], ["javascript", "JavaScript"],
["json", "JSON"], ["json", "JSON"],
["makefile", "Makefile"], ["makefile", "Makefile"],
["markdown", "Markdown"],
["nginx", "Nginx"], ["nginx", "Nginx"],
["objectivec", "Objective C"], ["objectivec", "Objective C"],
["perl", "Perl"], ["perl", "Perl"],
@@ -185,7 +186,7 @@ class Paste extends Component {
this.setState(function(state, props) { this.setState(function(state, props) {
return {entropy: state.entropy + s.length}; return {entropy: state.entropy + s.length};
} ); } );
Math.seedrandom(s, {entropy: true}); seedrandom(s, {entropy: true});
}; };
onChange(event) { onChange(event) {
@@ -313,40 +314,39 @@ function PasteCreate({error, onSubmit, onChange, syntax, syntaxItems, expire, ex
return ( return (
<section className="container"> <section className="container">
<div> <div>
{!!error ? {!!error &&
<Alert bsStyle="warning"> <Alert warning>
<strong>Holy guacamole!</strong> {error} <strong>Holy guacamole!</strong> {error}
</Alert> : ""} </Alert>}
<Form name='paste' onSubmit={onSubmit}> <Form name='paste' onSubmit={onSubmit}>
<div className="form form-inline"> <div className="form-inline">
<ol className='breadcrumb'> <label className="my-1 mr-2" for="syntax">Syntax</label>
<li> <select className='custom-select my-1 mr-sm-2' id="syntax" name="syntax" onChange={onChange} value={syntax}>
<label>Syntax</label>
<select className='form-control input-sm' name="syntax" onChange={onChange} value={syntax}>
{syntaxItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)} {syntaxItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)}
</select> </select>
</li>
<li> <label className="my-1 mr-2" for="expire">Expires</label>
<label>Expires</label> <select className='custom-select my-1 mr-sm-2' id="expire" name="expire" onChange={onChange} value={expire}>
<select className='form-control input-sm' name="expire" onChange={onChange} value={expire}>
{expireItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)} {expireItems.map((o) => <option key={o[0]} value={o[0]}>{o[1]}</option>)}
</select> </select>
</li>
<li> <div className="custom-control custom-checkbox my-1 mr-sm-2">
<label><input type='checkbox' name="burn" onChange={onChange} value={burn}/> Burn on Read</label> <input className="custom-control-input" type='checkbox' id="burn-on-read" name="burn" onChange={onChange} value={burn}/>
</li> <label className="custom-control-label" for="burn-on-read">Burn on Read</label>
</ol> </div>
</div> </div>
<textarea required className='form-control' rows='20' name="plain" onChange={onChange} value={plain}></textarea> <textarea required className='form-control' rows='20' name="plain" onChange={onChange} value={plain}></textarea>
<pre>Additional Entropy: {entropy} bytes / Content size: {blength(plain)} bytes</pre> <pre className="grey">Additional Entropy: {entropy} bytes / Content size: {blength(plain)} bytes</pre>
<Button type='submit' className='btn btn-default btn-lg btn-block'>Encrypt</Button> <Button type='submit' className='btn btn-default btn-lg btn-block'>Encrypt</Button>
</Form> </Form>
<br/>
<p>Create pastes from the command line! <a href='./paste.sh' download>paste.sh</a></p> <div className="card">
<div className="card-body">
<p>Create pastes from the command line! <a href='/paste.sh' download>paste.sh</a></p>
<pre>{`$ echo /etc/passwd | ./paste.sh <pre>{`$ echo /etc/passwd | ./paste.sh
env options: env options:
@@ -356,43 +356,54 @@ 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)`} PASTE_DATE - Value to be used when setting expire date. (default: next-week)`}
</pre> </pre>
</div> </div>
</div>
</div>
</section> </section>
); );
} }
function PasteView({hash, decryptKey, expires, gzip, cipher, plain, syntax, onNew, onCopy}) { function PasteView({hash, decryptKey, expires, burn, gzip, cipher, plain, syntax, onNew, onCopy}) {
const gzipOpts = gzip ? '| gzip -dc' : ''; const gzipOpts = gzip ? '| gzip -dc' : '';
return ( return (
<section className="container"> <section className="container">
<div className="input-group"> <div className="input-group">
<span className="input-group-btn"> <span className="input-group-prepend">
<a className="btn btn-default" type="button" onClick={onNew}>New</a> <button className="btn btn-default" type="button" onClick={onNew}>New</button>
</span> </span>
<input type='text' readOnly className='form-control' value={`${window.location.origin}/paste/#/${hash}!${decryptKey}`} onClick={(e) => e.target.select()}/> <input type='text' readOnly className='form-control' value={`${window.location.origin}/paste/#/${hash}!${decryptKey}`} onClick={(e) => e.target.select()}/>
<span className="input-group-btn"> <span className="input-group-append">
<a className="btn btn-default" type="button" onClick={onCopy}>Copy</a> <button className="btn btn-default" type="button" onClick={onCopy}>Copy</button>
</span> </span>
</div> </div>
<div ng-if="store.err == undefined"> <br/>
<div className='well well-sm'>
<b>Lang:</b> {syntax}, <b>Expires:</b> {expires} <div className="card">
<div className='card-header'>
<b>Lang:</b> {syntax}
&nbsp;
<b>Expires:</b> {expires}
&nbsp;
{burn && (<b> BURN ON READ </b>)}
</div> </div>
<div className="card-body">
{syntax==="markdown" ? ( {syntax==="markdown" ? (
<Markdown source={plain} /> <Markdown source={plain} />
) : ( ) : (
<Highlight className={syntax}>{plain}</Highlight> <Highlight className={syntax}>{plain}</Highlight>
)} )}
</div>
<div className="card-footer">
<pre>{`# Command Line: <pre>{`# Command Line:
curl -s "${PASTE_API}/${hash}" \\ curl -s "${PASTE_API}/${hash}" \\
| sed "1,/^\\$/d" \\ | sed "1,/^\\$/d" \\
| openssl aes-256-cbc -md md5 \\ | openssl aes-256-cbc -md md5 \\
-d -a -k "${decryptKey}" ${gzipOpts} -d -a -k "${decryptKey}" ${gzipOpts}
${cipher}`}</pre> ${cipher}`}</pre>
</div> </div>
</div>
</section> </section>
); );
} }

View File

@@ -2,6 +2,9 @@ section.container { margin-bottom: 2em; }
textarea { font-family: "Fira Code",hack,"Anonymous Pro",monospace; } textarea { font-family: "Fira Code",hack,"Anonymous Pro",monospace; }
pre { font-family: "Fira Code",hack,"Anonymous Pro",monospace; } pre { font-family: "Fira Code",hack,"Anonymous Pro",monospace; }
code { font-family: "Fira Code",hack,"Anonymous Pro",monospace; } code { font-family: "Fira Code",hack,"Anonymous Pro",monospace; }
pre.grey { background-color: lightgrey; }
label { color: lightgrey; }
table a:link { table a:link {
color: #666; color: #666;

35
cmd/paste/cors.go Normal file
View File

@@ -0,0 +1,35 @@
package main
import (
"net/http"
"sour.is/x/toolbox/httpsrv"
"sour.is/x/toolbox/ident"
)
func init() {
httpsrv.NewMiddleware("cors", doCORS).
Register(httpsrv.EventPreAuth)
}
func doCORS(_ string, w httpsrv.ResponseWriter, r *http.Request, _ ident.Ident) bool {
origin := r.Header.Get("origin")
headers := r.Header.Get("access-control-request-headers")
if origin != "" {
w.Header().Add("access-control-allow-origin", origin)
}
w.Header().Add("access-control-allow-methods", "GET, POST, PUT, DELETE, OPTIONS")
w.Header().Add("access-control-allow-credentials", "true")
w.Header().Add("access-control-max-age", "3600")
if headers != "" {
w.Header().Add("access-control-allow-headers", headers)
}
if r.Method == "OPTIONS" {
return false
}
return true
}

27
debian/Makefile vendored
View File

@@ -1,42 +1,39 @@
NAME=sour.is-paste NAME=sour.is-paste
VERSION:=$(shell cat VERSION) VERSION:=$(shell ./inc_version.sh -p $(shell git describe --tags `git rev-list --tags --max-count=1`)|cut -b2-)
RELEASE:=$(shell cat RELEASE) DATE:=$(shell date -u +%FT%TZ)
REPO_HOST="xuu@kapha" REPO_HOST="xuu@kapha"
ANSIBLE_HOST="kapha" ANSIBLE_HOST="kapha"
REPO_PATH="/opt/web/pub/sour.is/debian/" REPO_PATH="/opt/web/pub/sour.is/debian/"
all: release build copy all: build copy tag
clean: clean:
rm -r BUILD/* rm -r BUILD/*
release: tag:
@echo "release version $(RELEASE)" git tag -a -m "release version $(VERSION)" "v$(VERSION)"
@echo `expr $(RELEASE) + 1` > RELEASE
git commit -am "release version $(VERSION)-$(RELEASE)"
git tag -a -m "release version $(VERSION)-$(RELEASE)" "v$(VERSION)-$(RELEASE)"
git push --tags git push --tags
build: build:
export BUILD="BUILD/$(NAME)_$(VERSION)-$(RELEASE)"; \ export BUILD="BUILD/$(NAME)_$(VERSION)"; \
rm -rf ./$${BUILD}; \ rm -rf ./$${BUILD}; \
cp -r ROOT "$${BUILD}"; \ cp -r ROOT "$${BUILD}"; \
sed -i'.tmp' "s_Version:.*_Version: $(VERSION)-$(RELEASE)_" "$${BUILD}/DEBIAN/control" sed -i'.tmp' "s_Version:.*_Version: $(VERSION)_" "$${BUILD}/DEBIAN/control"
export DATE=`date -u +%FT%TZ`; \ export DATE=`date -u +%FT%TZ`; \
export BUILD="BUILD/$(NAME)_$(VERSION)-$(RELEASE)"; \ export BUILD="BUILD/$(NAME)_$(VERSION)"; \
env GOOS=linux GOARCH=amd64 go build -v -o $${BUILD}/opt/sour.is/bin/paste \ env GOOS=linux GOARCH=amd64 go build -v -o $${BUILD}/opt/sour.is/bin/paste \
-ldflags "-X main.AppVersion=$(VERSION)-$(RELEASE) -X main.AppBuild=$${DATE}"\ -ldflags "-X main.AppVersion=$(VERSION) -X main.AppBuild=$(DATE)"\
sour.is/x/paste/cmd/paste; \ sour.is/x/paste/cmd/paste; \
dpkg -b $${BUILD}; dpkg -b $${BUILD};
copy: copy:
export BUILD="BUILD/$(NAME)_$(VERSION)-$(RELEASE)"; \ export BUILD="BUILD/$(NAME)_$(VERSION)"; \
scp "$${BUILD}.deb" $(REPO_HOST):$(REPO_PATH); \ scp "$${BUILD}.deb" $(REPO_HOST):$(REPO_PATH); \
ssh $(REPO_HOST) -- $(REPO_PATH)scan.sh "$(REPO_PATH)$(NAME)_$(VERSION)-$(RELEASE).deb"; ssh $(REPO_HOST) -- $(REPO_PATH)scan.sh "$(REPO_PATH)$(NAME)_$(VERSION).deb";
deploy: deploy:
ansible $(ANSIBLE_HOST) -u xuu -b -m apt -a "name=sour.is-paste update_cache=yes state=latest" ansible $(ANSIBLE_HOST) -u xuu -b -m apt -a "name=sour.is-paste update_cache=yes state=latest"
.PHONY: clean release build copy # deploy .PHONY: clean tag build copy deploy

1
debian/RELEASE vendored
View File

@@ -1 +0,0 @@
18

1
debian/VERSION vendored
View File

@@ -1 +0,0 @@
2.2.0

52
debian/inc_version.sh vendored Executable file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# Increment a version string using Semantic Versioning (SemVer) terminology.
# Parse command line options.
while getopts ":Mmp" Option
do
case $Option in
M ) major=true;;
m ) minor=true;;
p ) patch=true;;
esac
done
shift $(($OPTIND - 1))
version=$1
# Build array from version string.
a=( ${version//./ } )
# If version string is missing or has the wrong number of members, show usage message.
if [ ${#a[@]} -ne 3 ]
then
>&2 echo "usage: $(basename $0) [-Mmp] major.minor.patch"
exit 1
fi
# Increment version numbers as requested.
if [ ! -z $major ]
then
((a[0]++))
a[1]=0
a[2]=0
fi
if [ ! -z $minor ]
then
((a[1]++))
a[2]=0
fi
if [ ! -z $patch ]
then
((a[2]++))
fi
echo "${a[0]}.${a[1]}.${a[2]}"

View File

@@ -254,7 +254,7 @@ func publicSwaggerJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "public/swagger.json", size: 4895, mode: os.FileMode(0644), modTime: time.Unix(1597685436, 0)} info := bindataFileInfo{name: "public/swagger.json", size: 4895, mode: os.FileMode(0644), modTime: time.Unix(1598898929, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xcc, 0xe, 0x5f, 0xc1, 0xe9, 0xd6, 0xa9, 0x46, 0x93, 0xde, 0x3d, 0x71, 0x10, 0x7f, 0xa9, 0x1e, 0x98, 0x11, 0x70, 0xc6, 0xcf, 0x1c, 0xa, 0x57, 0x84, 0xfc, 0x3c, 0xf7, 0x28, 0x3, 0x67}} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xcc, 0xe, 0x5f, 0xc1, 0xe9, 0xd6, 0xa9, 0x46, 0x93, 0xde, 0x3d, 0x71, 0x10, 0x7f, 0xa9, 0x1e, 0x98, 0x11, 0x70, 0xc6, 0xcf, 0x1c, 0xa, 0x57, 0x84, 0xfc, 0x3c, 0xf7, 0x28, 0x3, 0x67}}
return a, nil return a, nil
} }

File diff suppressed because one or more lines are too long