-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
7,625 additions
and
731 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set | ||
* text=auto | ||
|
||
# Require Unix line endings | ||
* text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# extra coverage files | ||
junit-testresults.xml | ||
out.tap | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
received-files/ | ||
logo/ | ||
*.test.js | ||
src/tests_coverage_map.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
# filerec | ||
<p align="center"> | ||
<img src="/logo/filerec.svg" alt="Filerec logo"/> | ||
</p> | ||
|
||
Easily spin up a local http server to accept files from your lan | ||
<p align="center"><strong>Local HTTP 1.1 server to securely receive files from friends and colleagues on the local network.</strong></p> | ||
|
||
<p align="center"> | ||
<a href="https://dev.azure.com/loige/loige/_build/latest"><img alt="Build Status" src="https://dev.azure.com/loige/loige/_apis/build/status/lmammino.filerec"/></a> | ||
<a href=""></a> | ||
<a href="https://badge.fury.io/js/filrerec"><img src="https://badge.fury.io/js/filrerec.svg" alt="npm version"></a> | ||
<a href="https://coveralls.io/github/lmammino/filrerec"><img src="https://coveralls.io/repos/github/lmammino/filrerec/badge.svg" alt="Coverage Status"></a> | ||
</p> | ||
|
||
... | ||
|
||
|
||
## Send a file with curl (encrypted) | ||
|
||
```bash | ||
FILENAME="/some/file" # change this | ||
SERVER="http://localhost:12345" # change this | ||
|
||
# get server public key | ||
SERVER_KEY="/tmp/filrerec-key-$(date +%s).pem" | ||
curl "${SERVER}/key" > "${SERVER_KEY}" | ||
|
||
# generate random symmetric key and initialization vector | ||
KEY=$(openssl rand -hex 32) | ||
IV=$(openssl rand 16) | ||
IV_B64=$(echo -ne "${IV}" | base64) | ||
IV_HEX=$(echo -ne "${IV}" | xxd -ps) | ||
|
||
# encrypt the key with server public key | ||
SEALED_KEY=$(echo -ne "${KEY}" | openssl rsautl -encrypt -oaep -pubin -inkey ${SERVER_KEY} | base64) | ||
|
||
# encrypt the file and send it with curl | ||
openssl enc -e -aes-256-cbc -nosalt -iv "${IV_HEX}" -K "${KEY}" -in "${FILENAME}" | \ | ||
curl -XPOST \ | ||
--data-binary @- \ | ||
-H "Content-Type: application/octet-stream" \ | ||
-H "X-Sealed-Key: ${SEALED_KEY}" \ | ||
-H "X-Encryption-IV: ${IV_B64}" \ | ||
-H "X-Filename: ${FILENAME}" \ | ||
"${SERVER}/file" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
strategy: | ||
matrix: | ||
node_12_x: | ||
node_version: 12.x | ||
node_11_x: | ||
node_version: 11.x | ||
|
||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(node_version) | ||
displayName: 'Install Node.js' | ||
|
||
- script: | | ||
npm install | ||
displayName: 'Install dependencies' | ||
|
||
- script: | | ||
npm test | ||
env: | ||
COVERALLS_REPO_TOKEN: $(coveralls.token) | ||
displayName: 'Run tests' | ||
|
||
- task: PublishTestResults@2 | ||
displayName: "Publish Test Results" | ||
condition: succeededOrFailed() | ||
inputs: | ||
testResultsFiles: "$(System.DefaultWorkingDirectory)/junit-testresults.xml" | ||
testRunTitle: TestRun Filerec on $(node_version) | ||
|
||
- task: PublishCodeCoverageResults@1 | ||
displayName: "Publish code coverage results" | ||
condition: succeededOrFailed() | ||
inputs: | ||
codeCoverageTool: "Cobertura" | ||
summaryFileLocation: "$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.