Skip to content

Simple application that uploads client-side encrypted attachments to the Exoscale Simple Object Storage

License

Notifications You must be signed in to change notification settings

FredericJacobs/Exoscale-PGP-Uploads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exoscale CORS Upload with PGP

This is a sample project to show issues of CORS uploads in FireFox with Exoscale. DO NOT USE ANY OF THIS CODE IN PRODUCTION.

Instructions

    1. Sign up and make a bucket on Exoscale's portal.
    1. Setup backend/backend-server with bucket, API Key and secret.
    1. Setup CORS configuration:
<?xml version="1.0" ?>
<CORSConfiguration xmlns="http:https://s3.amazonaws.com/doc/2006-03-01/">
  <CORSRule>
    <AllowedOrigin>WHATEVER OTHER DOMAIN YOU WANT TO TRY</AllowedOrigin>
    <AllowedOrigin>http:https://localhost:8080</AllowedOrigin>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedHeader>Authorization</AllowedHeader>
    <AllowedHeader>Content-Type</AllowedHeader>
    <AllowedHeader>Host</AllowedHeader>
  </CORSRule>
</CORSConfiguration>
    1. Launch terminal at root of the repository and run python backend/backend-server.py
    1. Open browser at http:https://localhost:8080/client/test.html in Chrome and upload a file
    1. The console doesn't report any CORS errors and the file should be in your bucket.
    1. Do the same in FireFox, and notice the following CORS issue in the console Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://sos.exo.io/XXXX. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

Adding <AllowedHeader>Access-Control-Allow-Origin</AllowedHeader> to configuration doesn't help.

About

Simple application that uploads client-side encrypted attachments to the Exoscale Simple Object Storage

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published