Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add support to Google Cloud Storage
chetabahana4b5d4e019d1c
diff --git a/Pipfile b/Pipfileindex 67eda0c6a6..c8ae82d236 100644--- a/Pipfile+++ b/Pipfile@@ -27,7 +27,7 @@ django-prices = ">=1.0.2"django-prices-openexchangerates = ">=1.0.0"django-prices-vatlayer = ">=1.0.2"django-redis = ">=4.0.0"-django-storages = ">=1.4.1"+django-storages = {extras = ["google"],version = "*"}django-templated-email = ">=2.2.0"django-versatileimagefield = ">=1.10"django-webpack-loader = ">=0.3.0"diff --git a/Pipfile.lock b/Pipfile.lockindex b212ea145c..e27da5222d 100644--- a/Pipfile.lock+++ b/Pipfile.lock@@ -1,7 +1,7 @@{"_meta": {"hash": {- "sha256": "039dbd20e5fc6a90a36155b8e34c98739ffad3775e5433d7b6b9d65332ffd3ef"+ "sha256": "000dd71416a21fbce980cac522cb95780a37e6e9aee0f6925af2e17025d05065"},"pipfile-spec": 6,"requires": {@@ -60,18 +60,18 @@},"boto3": {"hashes": [- "sha256:925192ef89563b61f9ac870e15d904e17d9a1d09393a0f84b00b408aca9a382d",- "sha256:bddff6ec134781f171dbb26382714e191f3b4ba7560b2263ea4088bca595d059"+ "sha256:10fd4bf8fe88f9bb449a538e639c1afb9762cb91693dea8c17282ba5c9d00b51",+ "sha256:4d187262d30befec431b3b52ccce35e55c0062a86f19b9dd5328b18d6332c5aa"],"index": "pypi",- "version": "==1.9.144"+ "version": "==1.9.151"},"botocore": {"hashes": [- "sha256:25fde576bf32f4cf21bda67eb7db41d3489e290bc1a65feb143e4cbc75121fe7",- "sha256:2bce34206bec7f1837f0e2f77c6324f0dee5325da522bf51cbefac1976426f99"+ "sha256:5e4774c106bb02f8e4639818c2f8157b8ec114a76e481e17cd3fe6955206e088",+ "sha256:cfc667e7888aad09ead8f7e32129ea90aa5c7f602531094954bf6305db74aac4"],- "version": "==1.12.144"+ "version": "==1.12.151"},"braintree": {"hashes": [@@ -81,6 +81,13 @@"index": "pypi","version": "==3.49.0"},+ "cachetools": {+ "hashes": [+ "sha256:219b7dc6024195b6f2bc3d3f884d1fef458745cd323b04165378622dcc823852",+ "sha256:9efcc9fab3b49ab833475702b55edd5ae07af1af7a4c627678980b45e459c460"+ ],+ "version": "==3.1.0"+ },"cairocffi": {"hashes": ["sha256:01ac51ae12c4324ca5809ce270f9dd1b67f5166fe63bd3e497e9ea3ca91946ff"@@ -360,9 +367,9 @@},"django-render-block": {"hashes": [- "sha256:0eab0c4ef1b99ad307e1bd1bdd0daa6ee4252bc39363b1b30b29cf675b840968"+ "sha256:95c7dc9610378a10e0c4a10d8364ec7307210889afccd6a67a6aaa0fd599bd4d"],- "version": "==0.5"+ "version": "==0.6"},"django-silk": {"hashes": [@@ -373,6 +380,9 @@"version": "==2.0.0"},"django-storages": {+ "extras": [+ "google"+ ],"hashes": ["sha256:8e35d2c7baeda5dc6f0b4f9a0fc142d25f9a1bf72b8cebfcbc5db4863abc552d","sha256:b1a63cd5ea286ee5a9fb45de6c3c5c0ae132d58308d06f1ce9865cfcd5e470a7"@@ -429,11 +439,11 @@},"faker": {"hashes": [- "sha256:167cef2454482dc2fbd8b0ff6a5ba3dbac8d3a3ebdee6ba819d008100d9d9428",- "sha256:3f2f4570df28df2eb8f39b00520eb610081d6552975e926c6a2cbc64fd89c4c1"+ "sha256:1c0a5e7bb54d2c54569986a27124715c83899e592d8d61d4e372dbff6c699573",+ "sha256:60477f757a80f665bbe1fb3d1cfe5d205ec7b99d5240114de7b27b4c25d236ca"],"index": "pypi",- "version": "==1.0.5"+ "version": "==1.0.7"},"freezegun": {"hashes": [@@ -443,6 +453,34 @@"index": "pypi","version": "==0.3.11"},+ "google-api-core": {+ "hashes": [+ "sha256:5e29af30d9bb5791ea2c6f7817c4c9630b92b914c5e253ba52b8ce6b0eed888e",+ "sha256:a77d98bd733ec455b03a91dc732cce6e7dfc900db4ff44c52743826e3d28a741"+ ],+ "version": "==1.11.0"+ },+ "google-auth": {+ "hashes": [+ "sha256:0f7c6a64927d34c1a474da92cfc59e552a5d3b940d3266606c6a28b72888b9e4",+ "sha256:20705f6803fd2c4d1cc2dcb0df09d4dfcb9a7d51fd59e94a3a28231fd93119ed"+ ],+ "version": "==1.6.3"+ },+ "google-cloud-core": {+ "hashes": [+ "sha256:5cf75936e3265cbfec028599ad013bccf10b855c79348b81488f7890ca3a3534",+ "sha256:a5d643a172d2e7ba1a77ea9fa874898a413a15cbc61bd7f1986a1bd38eb6b2b5"+ ],+ "version": "==1.0.0"+ },+ "google-cloud-storage": {+ "hashes": [+ "sha256:aad501a7b47a92b20ce998208fc706959805982d639cc178f079382c43161283",+ "sha256:fe98ecfba927f8de626b315cffe68d7c4a8da3658f95fee382269b92e3d71328"+ ],+ "version": "==1.16.0"+ },"google-i18n-address": {"hashes": ["sha256:95820e70309af471de48921551fb4351e9ba7b3671c1b5a6999f6ab0341939f4",@@ -458,6 +496,19 @@"index": "pypi","version": "==1.0.0"},+ "google-resumable-media": {+ "hashes": [+ "sha256:2dae98ee716efe799db3578a7b902fbf5592fc5c77d3c0906fc4ef9b1b930861",+ "sha256:3e38923493ca0d7de0ad91c31acfefc393c78586db89364e91cb4f11990e51ba"+ ],+ "version": "==0.3.2"+ },+ "googleapis-common-protos": {+ "hashes": [+ "sha256:d564872083af40bbcc7091340f17db778a316525c7c76497d58d11b98ca2aa74"+ ],+ "version": "==1.5.10"+ },"gprof2dot": {"hashes": ["sha256:48c1e168c28b8a8eb23bf30fda78fe2ef218269a41505341ec27c27083e47cf4"@@ -681,6 +732,29 @@],"version": "==2.2.1"},+ "protobuf": {+ "hashes": [+ "sha256:21e395d7959551e759d604940a115c51c6347d90a475c9baf471a1a86b5604a9",+ "sha256:57e05e16955aee9e6a0389fcbd58d8289dd2420e47df1a1096b3a232c26eb2dd",+ "sha256:67819e8e48a74c68d87f25cad9f40edfe2faf278cdba5ca73173211b9213b8c9",+ "sha256:75da7d43a2c8a13b0bc7238ab3c8ae217cbfd5979d33b01e98e1f78defb2d060",+ "sha256:78e08371e236f193ce947712c072542ff19d0043ab5318c2ea46bbc2aaebdca6",+ "sha256:7ee5b595db5abb0096e8c4755e69c20dfad38b2d0bcc9bc7bafc652d2496b471",+ "sha256:86260ecfe7a66c0e9d82d2c61f86a14aa974d340d159b829b26f35f710f615db",+ "sha256:92c77db4bd33ea4ee5f15152a835273f2338a5246b2cbb84bab5d0d7f6e9ba94",+ "sha256:9c7b90943e0e188394b4f068926a759e3b4f63738190d1ab3d500d53b9ce7614",+ "sha256:a77f217ea50b2542bae5b318f7acee50d9fc8c95dd6d3656eaeff646f7cab5ee",+ "sha256:ad589ed1d1f83db22df867b10e01fe445516a5a4d7cfa37fe3590a5f6cfc508b",+ "sha256:b06a794901bf573f4b2af87e6139e5cd36ac7c91ac85d7ae3fe5b5f6fc317513",+ "sha256:bd8592cc5f8b4371d0bad92543370d4658dc41a5ccaaf105597eb5524c616291",+ "sha256:be48e5a6248a928ec43adf2bea037073e5da692c0b3c10b34f9904793bd63138",+ "sha256:cc5eb13f5ccc4b1b642cc147c2cdd121a34278b341c7a4d79e91182fff425836",+ "sha256:cd3b0e0ad69b74ee55e7c321f52a98effed2b4f4cc9a10f3683d869de00590d5",+ "sha256:d6e88c4920660aa75c0c2c4b53407aef5efd9a6e0ca7d2fc84d79aba2ccbda3a",+ "sha256:ec3c49b6d247152e19110c3a53d9bb4cf917747882017f70796460728b02722e"+ ],+ "version": "==3.7.1"+ },"psycopg2-binary": {"hashes": ["sha256:007ca0df127b1862fc010125bc4100b7a630efc6841047bd11afceadb4754611",@@ -723,6 +797,20 @@"index": "pypi","version": "==1.5"},+ "pyasn1": {+ "hashes": [+ "sha256:da2420fe13a9452d8ae97a0e478adde1dee153b11ba832a95b223a2ba01c10f7",+ "sha256:da6b43a8c9ae93bc80e2739efb38cc776ba74a886e3e9318d65fe81a8b8a2c6e"+ ],+ "version": "==0.4.5"+ },+ "pyasn1-modules": {+ "hashes": [+ "sha256:ef721f68f7951fab9b0404d42590f479e30d9005daccb1699b0a51bb4177db96",+ "sha256:f309b6c94724aeaf7ca583feb1cc70430e10d7551de5e36edfc1ae6909bcfb3c"+ ],+ "version": "==0.2.5"+ },"pycodestyle": {"hashes": ["sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56",@@ -738,10 +826,10 @@},"pygments": {"hashes": [- "sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a",- "sha256:e8218dd399a61674745138520d0d4cf2621d7e032439341bc3f647bff125818d"+ "sha256:31cba6ffb739f099a85e243eff8cb717089fdd3c7300767d9fc34cb8e1b065f5",+ "sha256:5ad302949b3c98dd73f8d9fcdc7e9cb592f120e32a18e23efd7f3dc51194472b"],- "version": "==2.3.1"+ "version": "==2.4.0"},"pyjwt": {"hashes": [@@ -806,11 +894,11 @@},"requests": {"hashes": [- "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e",- "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b"+ "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4",+ "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"],"index": "pypi",- "version": "==2.21.0"+ "version": "==2.22.0"},"requests-oauthlib": {"hashes": [@@ -819,6 +907,13 @@],"version": "==1.2.0"},+ "rsa": {+ "hashes": [+ "sha256:14ba45700ff1ec9eeb206a2ce76b32814958a98e372006c8fb76ba820211be66",+ "sha256:1a836406405730121ae9823e19c6e806c62bbad73f890574fff50efa4122c487"+ ],+ "version": "==4.0"+ },"rx": {"hashes": ["sha256:13a1d8d9e252625c173dc795471e614eadfe1cf40ffc684e08b8fff0d9748c23",@@ -873,11 +968,11 @@},"stripe": {"hashes": [- "sha256:43cf1addbd5685d166c483f29f2b13e514304b091086561c2e22a3c7664043a2",- "sha256:814e6a87fdb679cf2ddca9a12099a93aaf437dac0b09edac4851c6ba9ebd7e5f"+ "sha256:1036267bbc4c394376bd3f4fc5a7867b7fe3cc1f0c4444b49cdd6929cee36daf",+ "sha256:472e8eab5769e64cff02ba4c29e2a9f9c46a739093d589e57881da8f22cc53a2"],"index": "pypi",- "version": "==2.27.0"+ "version": "==2.28.0"},"sympy": {"hashes": [@@ -1074,11 +1169,11 @@},"django-extensions": {"hashes": [- "sha256:109004f80b6f45ad1f56addaa59debca91d94aa0dc1cb19678b9364b4fe9b6f4",- "sha256:307766e5e6c1caffe76c5d99239d8115d14ae3f7cab2cd991fcffd763dad904b"+ "sha256:6766c573ffe63693cd485512a02f3b59622c884cbfeca241d1278ffdf0ac39ae",+ "sha256:c43e46cc95985c278afda645480b79f9a85cfe5a82c957accd08b8045793b707"],"index": "pypi",- "version": "==2.1.6"+ "version": "==2.1.7"},"execnet": {"hashes": [@@ -1089,17 +1184,17 @@},"filelock": {"hashes": [- "sha256:b8d5ca5ca1c815e1574aee746650ea7301de63d87935b3463d26368b76e31633",- "sha256:d610c1bb404daf85976d7a82eb2ada120f04671007266b708606565dd03b5be6"+ "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59",+ "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"],- "version": "==3.0.10"+ "version": "==3.0.12"},"identify": {"hashes": [- "sha256:443f419ca6160773cbaf22dbb302b1e436a386f23129dbb5482b68a147c2eca9",- "sha256:bd7f15fe07112b713fb68fbdde3a34dd774d9062128f2c398104889f783f989d"+ "sha256:432c548d6138cb57a3d8f62f079a025a29b8ae34a50dd3b496bbf661818f2bc0",+ "sha256:d4401d60bf1938aa3074a352a5cc9044107edf11a6fedd3a1db172c141619b81"],- "version": "==1.4.2"+ "version": "==1.4.3"},"idna": {"hashes": [@@ -1110,41 +1205,41 @@},"importlib-metadata": {"hashes": [- "sha256:46fc60c34b6ed7547e2a723fc8de6dc2e3a1173f8423246b3ce497f064e9c3de",- "sha256:bc136180e961875af88b1ab85b4009f4f1278f8396a60526c0009f503a1a96ca"+ "sha256:0e375a4c177090292988d1c2f997c7c2467d908c1adbed3e08fb511486c85457",+ "sha256:440815529340fb7fdd6a83ebf4258cc2860fb3770d37b52875e37c6f509a4cd6"],- "version": "==0.9"+ "version": "==0.13"},"isort": {"hashes": [- "sha256:1349c6f7c2a0f7539f5f2ace51a9a8e4a37086ce4de6f78f5f53fb041d0a3cd5",- "sha256:f09911f6eb114e5592abe635aded8bf3d2c3144ebcfcaf81ee32e7af7b7d1870"+ "sha256:c40744b6bc5162bbb39c1257fe298b7a393861d50978b565f3ccd9cb9de0182a",+ "sha256:f57abacd059dc3bd666258d1efb0377510a89777fda3e3274e3c01f7c03ae22d"],"index": "pypi",- "version": "==4.3.18"+ "version": "==4.3.20"},"lazy-object-proxy": {"hashes": [- "sha256:118d53f8819f9457732dd0e418752f2850f395c5405b2e12485f52336e4ad0f5",- "sha256:495c583b363c3eded649e2c00177093f03f856f5c9f95b527420084a9ce17b9d",- "sha256:55fa9eab93482891ce97473e63610efdd9c8fa5c05cca9f60468c412e602e499",- "sha256:642fc0a9b61920669dab66e400f79f1b8b0e8f698dcde85f7e9ae5528dbcaf4a",- "sha256:7003959a170fde9b92936c38562810f94679c80608fb4b007e026b915bef8b27",- "sha256:7e63da94f5a1ddb0d2dcdb5d17ff4d1d33f51f3368bdf0475d5f56c0f3b99592",- "sha256:7fb11d33d99a374e4b0c3fb20128890b9cf784ca7e4b91ecbb191d34618bd9fe",- "sha256:8758715ea005afa293783797498d64f40ab14d1ded208b3e282760cde9512f1d",- "sha256:8995543f47a8b81962e384f12791114af9f4997be7a0db71abc40d2a2dfee961",- "sha256:91c7e1316116fedda36818ce7cd269378fffc4219781536eff441ea1e68e1caf",- "sha256:9b41ec246d31ca6a840dcf67673b2668adc5a095c64310d26d73292588563ea3",- "sha256:a8be3cfd7c3154e8d39276c627c5e7ee55d1f2094597b060ece99620ef9fe86b",- "sha256:afcab74f471652b643900e0862b31892ac5fe5a75e435b786a1825855f4effdf",- "sha256:d49a90c27074f44c8dc147d83e31140523948ee147b3248634c540e053caea58",- "sha256:d6957cadc9c079ef4697564af500d52fba6d14fb2f08d20ce92f52201fb77050",- "sha256:da7f2a6c82a11dc4e05bab73522f0d6dd4f3bbc8378cd4b0769137f342cdb3f0",- "sha256:f03a21f6f6e54778860122a620f70c8b148ec4ee175968782bcaaa94955a46f9",- "sha256:f6c718ffca055852479880debbe717da952fcfd60067a0ddb6fe3b053b1d4de0"- ],- "version": "==1.4.0"+ "sha256:159a745e61422217881c4de71f9eafd9d703b93af95618635849fe469a283661",+ "sha256:23f63c0821cc96a23332e45dfaa83266feff8adc72b9bcaef86c202af765244f",+ "sha256:3b11be575475db2e8a6e11215f5aa95b9ec14de658628776e10d96fa0b4dac13",+ "sha256:3f447aff8bc61ca8b42b73304f6a44fa0d915487de144652816f950a3f1ab821",+ "sha256:4ba73f6089cd9b9478bc0a4fa807b47dbdb8fad1d8f31a0f0a5dbf26a4527a71",+ "sha256:4f53eadd9932055eac465bd3ca1bd610e4d7141e1278012bd1f28646aebc1d0e",+ "sha256:64483bd7154580158ea90de5b8e5e6fc29a16a9b4db24f10193f0c1ae3f9d1ea",+ "sha256:6f72d42b0d04bfee2397aa1862262654b56922c20a9bb66bb76b6f0e5e4f9229",+ "sha256:7c7f1ec07b227bdc561299fa2328e85000f90179a2f44ea30579d38e037cb3d4",+ "sha256:7c8b1ba1e15c10b13cad4171cfa77f5bb5ec2580abc5a353907780805ebe158e",+ "sha256:8559b94b823f85342e10d3d9ca4ba5478168e1ac5658a8a2f18c991ba9c52c20",+ "sha256:a262c7dfb046f00e12a2bdd1bafaed2408114a89ac414b0af8755c696eb3fc16",+ "sha256:acce4e3267610c4fdb6632b3886fe3f2f7dd641158a843cf6b6a68e4ce81477b",+ "sha256:be089bb6b83fac7f29d357b2dc4cf2b8eb8d98fe9d9ff89f9ea6012970a853c7",+ "sha256:bfab710d859c779f273cc48fb86af38d6e9210f38287df0069a63e40b45a2f5c",+ "sha256:c10d29019927301d524a22ced72706380de7cfc50f767217485a912b4c8bd82a",+ "sha256:dd6e2b598849b3d7aee2295ac765a578879830fb8966f70be8cd472e6069932e",+ "sha256:e408f1eacc0a68fed0c08da45f31d0ebb38079f043328dce69ff133b95c29dc1"+ ],+ "version": "==1.4.1"},"mccabe": {"hashes": [@@ -1210,11 +1305,11 @@},"pre-commit": {"hashes": [- "sha256:3fac7032a23c37d3dd9ec15f4c7b8342145e1ae943532c01cf1497277157aa59",- "sha256:b05c26279a6c36d2043ded6f9f7a1a0af8d4d71ed0bf1274afc5fbd3ca3e0ec7"+ "sha256:6ca409d1f22d444af427fb023a33ca8b69625d508a50e1b7eaabd59247c93043",+ "sha256:94dd519597f5bff06a4b0df194a79c524b78f4b1534c1ce63241a9d4fb23b926"],"index": "pypi",- "version": "==1.16.0"+ "version": "==1.16.1"},"py": {"hashes": [@@ -1271,11 +1366,11 @@},"pytest": {"hashes": [- "sha256:3773f4c235918987d51daf1db66d51c99fac654c81d6f2f709a046ab446d5e5d",- "sha256:b7802283b70ca24d7119b32915efa7c409982f59913c1a6c0640aacf118b95f5"+ "sha256:1a8aa4fa958f8f451ac5441f3ac130d9fc86ea38780dd2715e6d5c5882700b24",+ "sha256:b8bf138592384bd4e87338cb0f256bf5f615398a649d4bd83915f0e4047a5ca6"],"index": "pypi",- "version": "==4.4.1"+ "version": "==4.5.0"},"pytest-cov": {"hashes": [@@ -1348,11 +1443,11 @@},"requests": {"hashes": [- "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e",- "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b"+ "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4",+ "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"],"index": "pypi",- "version": "==2.21.0"+ "version": "==2.22.0"},"six": {"hashes": [@@ -1377,11 +1472,11 @@},"tox": {"hashes": [- "sha256:1b166b93d2ce66bb7b253ba944d2be89e0c9d432d49eeb9da2988b4902a4684e",- "sha256:665cbdd99f5c196dd80d1d8db8c8cf5d48b1ae1f778bccd1bdf14d5aaf4ca0fc"+ "sha256:0b0f24aabc4296719c1008df82452bbba07f29713c2448f6923850396b7b9586",+ "sha256:1fa40cf60654c981ae8f0dafc8b87fe4ffd1ec3381d90694b97e1eec02e0b5d9"],"index": "pypi",- "version": "==3.9.0"+ "version": "==3.11.1"},"transifex-client": {"hashes": [@@ -1439,10 +1534,17 @@},"virtualenv": {"hashes": [- "sha256:15ee248d13e4001a691d9583948ad3947bcb8a289775102e4c4aa98a8b7a6d73",- "sha256:bfc98bb9b42a3029ee41b96dc00a34c2f254cbf7716bec824477b2c82741a5c4"+ "sha256:99acaf1e35c7ccf9763db9ba2accbca2f4254d61d1912c5ee364f9cc4a8942a0",+ "sha256:fe51cdbf04e5d8152af06c075404745a7419de27495a83f0d72518ad50be3ce8"+ ],+ "version": "==16.6.0"+ },+ "wcwidth": {+ "hashes": [+ "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e",+ "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c"],- "version": "==16.5.0"+ "version": "==0.1.7"},"wrapt": {"hashes": [@@ -1477,10 +1579,10 @@},"zipp": {"hashes": [- "sha256:139391b239594fd8b91d856bc530fbd2df0892b17dd8d98a91f018715954185f",- "sha256:8047e4575ce8d700370a3301bbfc972896a5845eb62dd535da395b86be95dfad"+ "sha256:8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d",+ "sha256:ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3"],- "version": "==0.4.0"+ "version": "==0.5.1"}}}diff --git a/docs/deployment.rst b/docs/deployment.rstindex 882f832614..04de08f03a 100644--- a/docs/deployment.rst+++ b/docs/deployment.rst@@ -7,3 +7,4 @@ Deploymentdeployment/dockerdeployment/herokudeployment/s3+ deployment/gcsdiff --git a/docs/deployment/gcs.rst b/docs/deployment/gcs.rstnew file mode 100644index 0000000000..b5774891b5--- /dev/null+++ b/docs/deployment/gcs.rst@@ -0,0 +1,84 @@+.. _amazon-s3:++Storing Files on Google Cloud Storage (GCS)+===========================================++If you're using containers for deployment (including Docker and Heroku) you'll want to avoid storing files in the container's volatile filesystem. This integration allows you to delegate storing such files to `Google Cloud Storage (GCS) <https://django-storages.readthedocs.io/en/latest/backends/gcloud.html>`_ service.++Base configuration+------------------++``GOOGLE_APPLICATION_CREDENTIALS``+ Set an environment variable to path of the json file.++``GS_CREDENTIALS`` (optional)+ The OAuth 2 credentials to use for the connection.+ If unset, falls back to the default inferred from the environment (i.e. GOOGLE_APPLICATION_CREDENTIALS)++Serving media files with a GCS bucket+-------------------------------------++If you want to store and serve media files, set the following environment+variable to use GCS as media bucket:++``GS_MEDIA_BUCKET_NAME``+ The GCS bucket name to use for media files.++If you are intending into using a custom domain for your media GCS bucket,+you can set this environment variable to your custom GCS media domain:++``GS_MEDIA_CUSTOM_DOMAIN``+ The GCS custom domain to use for the media bucket.+++.. note::+ The media files are every data uploaded through the dashboard+ (product images, category images, etc.)+++Serving static files with a GCS bucket+--------------------------------------++By default static files (such as CSS and JS files required to display your pages) will be served by the application server.++If you intend to use GCS for your static files as well, set an additional environment variable:++``GS_STORAGE_BUCKET_NAME``+ The GCS bucket name to use for static files.++If you are intending into using a custom domain for your static GCS bucket,+you can set this environment variable to your custom GCS domain:++``GS_STATIC_CUSTOM_DOMAIN``+ The GCS custom domain to use for the static bucket.+++.. note::+ You will need to configure your GCS bucket to allow cross origin requests for+ some files to be properly served (SVG files, Javascript files, etc.).+ For that, you have to set below instructions in your+ GCS Bucket's permissions tab under the `CORS section <https://cloud.google.com/storage/docs/xml-api/put-bucket-cors>`_.++ .. code-block:: xml++ <?xml version="1.0" encoding="UTF-8"?>+ <CorsConfig>+ <Cors>+ <Origins>+ <Origin>http://origin1.example.com</Origin>+ <Origin>http://origin2.example.com</Origin>+ </Origins>+ <Methods>+ <Method>GET</Method>+ <Method>HEAD</Method>+ <Method>PUT</Method>+ <Method>POST</Method>+ <Method>DELETE</Method>+ </Methods>+ <ResponseHeaders>+ <ResponseHeader>x-goog-meta-foo1</ResponseHeader>+ <ResponseHeader>x-goog-meta-foo2</ResponseHeader>+ </ResponseHeaders>+ <MaxAgeSec>1800</MaxAgeSec>+ </Cors>+ </CorsConfig>diff --git a/requirements.txt b/requirements.txtindex c6b41ed0bc..760e135b3f 100644--- a/requirements.txt+++ b/requirements.txt@@ -5,9 +5,10 @@ autopep8==1.4.4babel==2.6.0billiard==3.6.0.0bleach==2.1.4-boto3==1.9.144-botocore==1.12.144+boto3==1.9.151+botocore==1.12.151braintree==3.49.0+cachetools==3.1.0cairocffi==1.0.2cairosvg==2.3.1celery[redis]==4.3.0@@ -40,9 +41,9 @@ django-prices-vatlayer==1.0.2django-prices==1.0.4django-recaptcha==1.5.0django-redis==4.10.0-django-render-block==0.5+django-render-block==0.6django-silk==2.0.0-django-storages==1.7.1+django-storages[google]==1.7.1django-templated-email==2.3.0django-versatileimagefield==1.10django-webpack-loader==0.6.0@@ -50,10 +51,16 @@ django==2.2.1docutils==0.14elasticsearch-dsl==6.0.1elasticsearch==6.3.1-faker==1.0.5+faker==1.0.7freezegun==0.3.11+google-api-core==1.11.0+google-auth==1.6.3+google-cloud-core==1.0.0+google-cloud-storage==1.16.0google-i18n-address==2.3.4google-measurement-protocol==1.0.0+google-resumable-media==0.3.2+googleapis-common-protos==1.5.10gprof2dot==2016.10.13graphene-django-optimizer==0.4.0graphene-django==2.2.0@@ -78,11 +85,14 @@ phonenumberslite==8.10.9pillow==5.4.1prices==1.0.0promise==2.2.1+protobuf==3.7.1psycopg2-binary==2.8.2purl==1.5+pyasn1-modules==0.2.5+pyasn1==0.4.5pycodestyle==2.5.0pycparser==2.19-pygments==2.3.1+pygments==2.4.0pyjwt==1.7.1pyphen==0.9.5python-dateutil==2.8.0 ; python_version >= '2.7'@@ -92,7 +102,8 @@ raven==6.9.0razorpay==1.2.0redis==3.2.1requests-oauthlib==1.2.0-requests==2.21.0+requests==2.22.0+rsa==4.0rx==1.6.1s3transfer==0.2.0singledispatch==3.4.0.3@@ -100,7 +111,7 @@ six==1.12.0social-auth-app-django==3.1.0social-auth-core==3.1.0sqlparse==0.3.0-stripe==2.27.0+stripe==2.28.0sympy==1.4text-unidecode==1.2tinycss2==1.0.2diff --git a/requirements_dev.txt b/requirements_dev.txtindex a0fc3bcadc..3d64f46dc4 100644--- a/requirements_dev.txt+++ b/requirements_dev.txt@@ -12,20 +12,20 @@ chardet==3.0.4click==7.0codecov==2.0.15coverage==4.5.3-django-extensions==2.1.6+django-extensions==2.1.7execnet==1.6.0-filelock==3.0.10-identify==1.4.2+filelock==3.0.12+identify==1.4.3idna==2.8-importlib-metadata==0.9-isort==4.3.18-lazy-object-proxy==1.4.0+importlib-metadata==0.13+isort==4.3.20+lazy-object-proxy==1.4.1mccabe==0.6.1more-itertools==7.0.0 ; python_version > '2.7'multidict==4.5.2nodeenv==1.3.3pluggy==0.11.0-pre-commit==1.16.0+pre-commit==1.16.1py==1.8.0pycodestyle==2.5.0pydocstyle==3.0.0@@ -39,21 +39,22 @@ pytest-forked==1.0.2pytest-mock==1.10.4pytest-vcr==1.0.2pytest-xdist==1.28.0-pytest==4.4.1+pytest==4.5.0python-slugify==1.2.6pyyaml==5.1-requests==2.21.0+requests==2.22.0six==1.12.0snowballstemmer==1.2.1toml==0.10.0-tox==3.9.0+tox==3.11.1transifex-client==0.13.6typed-ast==1.3.5 ; implementation_name == 'cpython'unidecode==1.0.23urllib3==1.24.3vcrpy==2.0.1-virtualenv==16.5.0+virtualenv==16.6.0+wcwidth==0.1.7wrapt==1.11.1yapf==0.27.0yarl==1.3.0 ; python_version >= '3.4'-zipp==0.4.0+zipp==0.5.1diff --git a/saleor/core/storages.py b/saleor/core/storages.pyindex aa4d84274b..b80a157c40 100644--- a/saleor/core/storages.py+++ b/saleor/core/storages.py@@ -1,4 +1,5 @@from django.conf import settings+from storages.backends.gcloud import GoogleCloudStoragefrom storages.backends.s3boto3 import S3Boto3Storage@@ -7,3 +8,9 @@ class S3MediaStorage(S3Boto3Storage):self.bucket_name = settings.AWS_MEDIA_BUCKET_NAMEself.custom_domain = settings.AWS_MEDIA_CUSTOM_DOMAINsuper().__init__(*args, **kwargs)+++class GCSMediaStorage(GoogleCloudStorage):+ def __init__(self, *args, **kwargs):+ self.bucket_name = settings.GS_MEDIA_BUCKET_NAME+ super().__init__(*args, **kwargs)diff --git a/saleor/settings.py b/saleor/settings.pyindex a7ca841189..b47717ac0f 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -411,12 +411,28 @@ AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY")AWS_STORAGE_BUCKET_NAME = os.environ.get("AWS_STORAGE_BUCKET_NAME")AWS_DEFAULT_ACL = os.environ.get("AWS_DEFAULT_ACL", None)+# Google Cloud Storage configuration+GS_PROJECT_ID = os.environ.get("GS_PROJECT_ID")+GS_STORAGE_BUCKET_NAME = os.environ.get("GS_STORAGE_BUCKET_NAME")+GS_MEDIA_BUCKET_NAME = os.environ.get("GS_MEDIA_BUCKET_NAME")+GS_AUTO_CREATE_BUCKET = get_bool_from_env("GS_AUTO_CREATE_BUCKET", False)++# If GOOGLE_APPLICATION_CREDENTIALS is set there is no need to load OAuth token+# See https://django-storages.readthedocs.io/en/latest/backends/gcloud.html+if "GOOGLE_APPLICATION_CREDENTIALS" not in os.environ:+ GS_CREDENTIALS = os.environ.get("GS_CREDENTIALS")+if AWS_STORAGE_BUCKET_NAME:STATICFILES_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"+elif GS_STORAGE_BUCKET_NAME:+ STATICFILES_STORAGE = "storages.backends.gcloud.GoogleCloudStorage"if AWS_MEDIA_BUCKET_NAME:DEFAULT_FILE_STORAGE = "saleor.core.storages.S3MediaStorage"THUMBNAIL_DEFAULT_STORAGE = DEFAULT_FILE_STORAGE+elif GS_MEDIA_BUCKET_NAME:+ DEFAULT_FILE_STORAGE = "saleor.core.storages.GCSMediaStorage"+ THUMBNAIL_DEFAULT_STORAGE = DEFAULT_FILE_STORAGEMESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"