Giter Site home page Giter Site logo

skleeschulte / basic-to-passport-auth-http-proxy Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 19.0 338 KB

HTTP proxy server that can access resources which use the Passport SSI Version 1.4 Protocol for authorization with credentials supplied by Basic HTTP authentication.

License: MIT License

JavaScript 99.42% Dockerfile 0.58%

basic-to-passport-auth-http-proxy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

basic-to-passport-auth-http-proxy's Issues

'ERR_HTTP_HEADERS_SENT' terminate the script

Hello,
I use the script (as "root") with Node.js (v12) to establish a HyperBackup connection to OneDrive on a Synology server (DS214 + DSM6.2.3-25426 Update 3). I proceeded exactly according to "README". It works.

But after a while the following error messages appear and the script is terminated completely. Can no longer connect to OneDrive. Only when I restart the script.

  proxy:error [29502539/7982] Sending error response: 500 read ECONNRESET +1h                                              <<-- always other times
  proxy:error [29502539/7982] Sending error response: 500 Cannot call write after a stream was destroyed +37ms             <<-- always other times
_http_outgoing.js:526
    throw new ERR_HTTP_HEADERS_SENT('set');
    ^

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at ServerResponse.setHeader (_http_outgoing.js:526:11)
    at sendResponse (/usr/basic-to-passport-auth-http-proxy-master/lib/server.js:48:17)
    at ProxyServer.<anonymous> (/usr/basic-to-passport-auth-http-proxy-master/lib/server.js:264:5)
    at ProxyServer.emit (/usr/basic-to-passport-auth-http-proxy-master/node_modules/eventemitter3/index.js:210:27)
    at ClientRequest.proxyError (/usr/basic-to-passport-auth-http-proxy-master/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:163:18)
    at ClientRequest.emit (events.js:310:20)
    at TLSSocket.socketErrorListener (_http_client.js:426:9)
    at TLSSocket.emit (events.js:310:20)
    at errorOrDestroy (internal/streams/destroy.js:108:12)
    at onwriteError (_stream_writable.js:418:5) {
  code: 'ERR_HTTP_HEADERS_SENT'
}

What's wrong?
Or to put it better: What can I do to ensure that the connection is automatically re-established?

many greetings

Benjamin

need to build with new docker version

docker pull skleeschulte/basic-to-passport-auth-http-proxy
Error response from daemon: manifest for skleeschulte/basic-to-passport-auth-http-proxy:latest not found: manifest unknown: manifest unknown

git clone and local build, works fine.

Just build image with new docker version to fix it.

Error: 500 Did not receive Set Token Message after First Authenticated Request Message

Hallo Stefan,

first I want to thank you for providing this software.
I am using it since more than a year in a docker container on my Synology NAS for backups to MS Onedrive in the HyperBackup App.
The last successfull backup I created on June 5th 2024.
Now all Onedrive targets have the status "Offline".
In the logs I see the following error messages:

2024/07/10 20:27:20,stdout,2024-07-10T18:27:20.631Z proxy:error [168608926/9686] Sending error response: 500 Did not receive Set Token Message after First Authenticated Request Message
2024/07/10 20:27:20,stdout,2024-07-10T18:27:20.630Z proxy:error Did not receive Set Token Message after First Authenticated Request Message

Do you have any idea what is happening here? Would be very nice if you could fix this.

Thanks & Best Regards

Michael

Target offline

The backup to OneDrive ran without any problems for a long time, but now Hyper Backup always reports "Target: offline", which is definitely not true. What could be the problem?

webdav-protocol.cpp(168): Server error: status='413', msg = 'Request Entity too large'

I realized that there is a reoccuring problem with a specific Hyperbackup to Onedrive (Docker: basic-to-passport-auth-http-proxy). Some backups work fine, this doesn't. Do you have any idea how to fix the following error from the /var/log/message from my Synology NAS. Seems to be that one file might be too large for the webdav setting. Do you know how to solve this?

`cloudstorage/protocol/webdav/webdav-error.cpp(126): Undefined error : 500
img_worker: webdav-protocol.cpp(168): Server error: status='500', msg = 'Undefined http status code'

img_worker: transfer_webdav.cpp:235 need retry #0: send_file failed: -9900, Undefined http status code

img_worker: [28672]cand_chunks.cpp:206 Warning: two candidate chunks have the same checksum!!

img_worker: [28671]cand_chunks.cpp:206 Warning: two candidate chunks have the same checksum!!

img_worker: cloudstorage/protocol/webdav/webdav-error.cpp(126): Undefined error : 500

img_worker: webdav-protocol.cpp(168): Server error: status='500', msg = 'Undefined http status code'

img_worker: transfer_webdav.cpp:235 need retry #0: send_file failed: -9900, Undefined http status code

img_worker: webdav-protocol.cpp(168): Server error: status='413', msg = 'Request Entity too large'

img_worker: send_file:240 failed(-500,Request Entity too large) Failed to sendFile at [BackupMyNAS.hbk/Config/@Share/Backup/2.db.3]

img_worker: (27942) file_transfer.cpp:786 failed to sendfile to [BackupMyNAS.hbk/Config/@Share/Backup/2.db.3] from [/volume1/@img_bkp_cache/webdav_Drive4_.9Nrrd6/BackupMyNAS.hbk/Config/@Share/Backup/2.db], data_hot=[1], error = [3008]

img_worker: (27942) file_transfer.cpp:629 failed to sendfile: trg_relative path: [Config/@Share/Backup/2.db], err: [3008]

img_worker: (27942) cloud_upload_controller.cpp:2141 failed to sync upload file [Config/@Share/Backup/2.db], ret[36]

img_worker: (27942) cloud_upload_controller.cpp:2269 failed to upload file: [/volume1/@img_bkp_cache/webdav_Drive4_.9Nrrd6/BackupMyNAS.hbk/Config/@Share/Backup/2.db] --> [BackupMyNAS.hbk/Config/@Share/Backup/2.db], blRemoveAfterUpload: [0], dataClass: [1]

img_worker: (27942) cloud_upload_controller.cpp:1934 failed to do the job
img_backup: (27853) backup_controller.cpp:1364 Failed to [CMD_END]: response:[ST_TRANSFER_UNKNOWN], resume_status: [RESUMABLE]

img_backup: (27853) backup_controller.cpp:1505 failed to handle packet from cloud uploader

img_backup: (27853) backup_controller.cpp:1528 failed to handle worker response

img_backup: (27853) backup_controller.cpp:3693 INFO: abnormal terminate: blWorkerAlive[0], blWaitCloudUploaderEndResponse[0], blWaitBackupEnd:[0]`

WebDAV parameters might have changed

The proxy stopped working about two days ago. Nothing special in the log. When I run the litmus test, I get the following:

 -> running `basic':
 0. init.................. pass
 1. begin................. FAIL (Could not create new collection `/xxxxxxxxxxxxxxxx/litmus/' for tests: 401 Unauthorized
Server must allow `MKCOL /xxxxxxxxxxxxxxxx/litmus/' for tests to proceed)
<- summary for `basic': of 2 tests run: 1 passed, 1 failed. 50.0%
See debug.log for network/debug traces.

when I navigate to http://<my_proxy_ip>:3000/<my_CID>, I am redirected to https://onedrive.live.com/?id=<my_CID>%210%2A<some_random_string>&cid=<my_CID> and the page shows "This item might not exist or is no longer available". However if I change the link to https://onedrive.live.com/?id=root&cid=<my_CID> it shows my content.

here is a "sanitized" debug log (hopefully it is not going to byte me in the ass):

Never mind, I guess two factor authentication got turned on, or the app password got somehow deleted and I needed to create new app password.

Backup fails verification

Running docker on DSM 7 on a ds720+. 10 GB of RAM (I point this because I wonder if having more than 8 GB could cause some data corruption).

For a while It works as expected, but, after some weeks of daily backups, HyperBackup warns that the backup is corrupted and that it's only available for restore. The log shows some hundreds files corrupted. If I manually check the corrupted files, I can't open them. If I check other non corrupted files, they open fine.

The HB verification is not continuous, so it's possible that those files are corrupted from day one.

Destination corrupted - Restore Only

First of all: thank you for this proxy. I started using it 3 months ago on my DS220+ with DSM 7.0.1. Subscribed to Microsoft 365 Family because of it. Worked fine for almost 3 months, until 3 days ago (January 9th).

Hyper Backup says the destination is corrupted. It only lists a restore option, no option to take a backup.
Hyper Backup gives a 'log', but that only says:

Backup task was unable to run due to errors found at the backup destination.
The following files were found broken in the latest integrity check and cannot be restored.
There may be other broken files which were not detected this time.
If you have further questions, please contact Synology support.
Broken file(s):
[...]

The log from the Docker container lists nothing special either. 2 most recent lines:

2022-01-12T18:31:27.350Z proxy:info Proxy server listening: { address: '::', family: 'IPv6', port: 3000 }
2021-12-08T16:27:49.517Z proxy:info Proxy server listening: { address: '::', family: 'IPv6', port: 3000 }

Can I find other relevant information/logs?

DS220+ running DSM 7.0.1-42218 and Hyper Backup 3.0.2-2432.
Hyper Backup has just been updated, so the error occurred with a previous version.

I backed up approximately 700GB with it. Took 5 days 24/7 uploading, so just a 'quick' delete and try again isn't a viable option...

Thanks in advance!

Update the files to correct lot's of CVE

Hello,
Could you update the files in order to fix severals CVE present?

image

I would like to use your work to have a Hyperbackup to Onedrive on my Synology NAS.

Thanks in advance.

Cache overflowed while caching data

In the log after
"Proxy request: PUT /...."
I am getting the error
"RequestBodyCache: Cache overflowed while caching data"

This is a Synology Diskstation syncing to Onedrive via Hyperbackup. Smaller backups work fine, on large backups it seems to get this hickup and gets stuck. Perhaps a large file issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.