Never have been used Amazon's S3 but decided to use this service to store Tinode's files.Unfortunately, can't get it working and don't know if there is something wrong in Tinode's settings or on Amazon.I am uploading files from Webapp.tinode.conf:"use_handler": "s3",....."access_key_id": "***","secret_access_key": "***","region": "eu-west-3","bucket": "tinode","cors_origins": ["https://www.domain1.com,https://www.domain2.com"]Is "cors_origins" correct? I tried also to put each domain it double quotes:
Stll can not upload files not to filesystem nor to S3.I already generated an API key a long time ago. When I try to upload files to Amazon, I get this error:I2021/05/04 11:02:51 Upload request /v0/file/u/I2021/05/04 11:02:51 media upload: 403 valid API key required / <nil>
When I try to upload files to filesystem, I get anothet error:Access to fetch at 'https://www.***net:6060/v0/file/u/' from origin 'https://www.***.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.I guess this problem already has been fixed some time ago but it still exists.Today I decided to generate a new API key:./keygenAPI key v1 seq1 [ordinary]: AQAAAAABAABvV8sRjJZQSkU4R15h3XNgUsed HMAC salt: 4Og7p0lYX2Etwcs0wpLr8oVWt7744zExVOhbRCnysVg=
Pasted API key into /src/config.js file. Pasted Salt into tinode.conf file. restarted Tinode.It does not work either.
I2021/05/18 11:42:43 Using config from '/home/www/tinode/tinode.conf'I2021/05/18 11:42:43 stats: variables exposed at '/debug/vars'I2021/05/18 11:42:43 Cluster: running as a standalone server.I2021/05/18 11:42:43 DB adapter mysqlI2021/05/18 11:42:43 Restricted tags: ['tel' 'basic' 'email']I2021/05/18 11:42:43 plugins: no active plugins foundI2021/05/18 11:42:43 gRPC/1.28.0 secure server is registered at [***.net:6061]I2021/05/18 11:42:43 Serving static content from '/home/www/tinode/static' at '/'I2021/05/18 11:42:43 API served from root URL path '/'I2021/05/18 11:42:43 Large media handling enabled s3I2021/05/18 11:42:43 Listening for client HTTPS connections on [***.net:6060]W2021/05/18 11:42:43 invalid apikey signatureE2021/05/18 11:42:43 ws: Missing, invalid or expired API keyW2021/05/18 11:43:02 invalid apikey signatureE2021/05/18 11:43:02 ws: Missing, invalid or expired API keyW2021/05/18 11:43:05 invalid apikey signatureE2021/05/18 11:43:05 ws: Missing, invalid or expired API keyW2021/05/18 11:43:07 invalid apikey signatureE2021/05/18 11:43:07 ws: Missing, invalid or expired API keyChanged back to the old API key and salt. Error ws: Missing, invalid or expired API key disappeared but when Uploading files to S3 I still get error media upload: 403 valid API key required / <nil>I can not understand anything. The new APi key is not valid at all, the old API key only is not valid to upload files, when uploading files to the filesystem, there is no cors header...Any help would be appreciated.
If somedy have had this problem and resolved it, please let mw know how the solution.Update.In both cases - uploading files to the filesystem or to S3, browser console shows the same error:Access to fetch at 'https://www.tinode-server.com:6060/v0/file/u/' from origin 'https://www.domain1.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.Webapp is located not on the same server where Tinode is running and actually I don't know if Tinode does not allow upload files from a different server or I have another problem.tinode.conf file contains "cors_origins" for both fs and s3.The issue has been reported already here and the answer was that cors is not supported for fs. I have the lastest version of Tinode but the fix does not work. Not only for fs, but for s3 either.
--
You received this message because you are subscribed to the Google Groups "Tinode General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/64502d1d-7a1f-4c93-881c-3dcba1a8d09cn%40googlegroups.com.
The problem is that Tinode does not handle preflight requests
and does not send the correct preflight response.
You can see the problem without any specific installation or setup by doing the following:1. change tinode.conf file on sandbox.tinode.co and add
"cors_origins": ["web.tinode.co"] within s3 or fs depending of which media handler uses sandbox.tinode.co
1. change tinode.conf file on sandbox.tinode.co and add"cors_origins": ["web.tinode.co"] within s3 or fs depending of which media handler uses sandbox.tinode.coSorry, no. Use curl (https://curl.se/) or a similar tool. Show what you are sending, what you are receiving, what you expect and why the response is wrong.Or provide me with a docker container or specific setup instructions.