diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 032041085..3d34fcce6 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -82,7 +82,6 @@ is completely normal for a development setup. If you see any of the following, they can be safely ignored: ``` -WARNING Twilio is not set up. You must set TWILIO_ACCOUNT_SID and TWILIO_TOKEN to use the Twilio ICE servers. WARNING GEO_IP_LICENSE_KEY not set! Unable to download GeoIP database! WARNING Unable to connect to RabbitMQ. Is it running? ConnectionError: [Errno 111] Connect call failed ('127.0.0.1', 5672) diff --git a/Pipfile b/Pipfile index cb28b0846..7aa976c2c 100644 --- a/Pipfile +++ b/Pipfile @@ -26,7 +26,6 @@ pyyaml = "*" sortedcontainers = "*" sqlalchemy = ">=2.0.0" trueskill = "*" -twilio = ">=7.0.0" uvloop = {version = "*", markers = "sys_platform != 'win32'"} [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index d4f6a747e..37be337e8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "816ffa2da529a42d808057d7505f783ebc0d3e5118df782527cd6e0611d3ae73" + "sha256": "3c8b85fbbcaa617c04c6573250a410fa5db532a7fd66d3d344b03af0461e7753" }, "pipfile-spec": 6, "requires": { @@ -125,14 +125,6 @@ "index": "pypi", "version": "==3.8.6" }, - "aiohttp-retry": { - "hashes": [ - "sha256:3aeeead8f6afe48272db93ced9440cf4eda8b6fd7ee2abb25357b7eb28525b45", - "sha256:9a8e637e31682ad36e1ff9f8bcba912fcfc7d7041722bc901a4b948da4d71ea9" - ], - "markers": "python_version >= '3.7'", - "version": "==2.8.3" - }, "aiomysql": { "git": "https://github.com/aio-libs/aiomysql", "ref": "83aa96e12b1b3f2bd373f60a9c585b6e73f40f52" @@ -237,99 +229,99 @@ }, "charset-normalizer": { "hashes": [ - "sha256:02673e456dc5ab13659f85196c534dc596d4ef260e4d86e856c3b2773ce09843", - "sha256:02af06682e3590ab952599fbadac535ede5d60d78848e555aa58d0c0abbde786", - "sha256:03680bb39035fbcffe828eae9c3f8afc0428c91d38e7d61aa992ef7a59fb120e", - "sha256:0570d21da019941634a531444364f2482e8db0b3425fcd5ac0c36565a64142c8", - "sha256:09c77f964f351a7369cc343911e0df63e762e42bac24cd7d18525961c81754f4", - "sha256:0d3d5b7db9ed8a2b11a774db2bbea7ba1884430a205dbd54a32d61d7c2a190fa", - "sha256:1063da2c85b95f2d1a430f1c33b55c9c17ffaf5e612e10aeaad641c55a9e2b9d", - "sha256:12ebea541c44fdc88ccb794a13fe861cc5e35d64ed689513a5c03d05b53b7c82", - "sha256:153e7b6e724761741e0974fc4dcd406d35ba70b92bfe3fedcb497226c93b9da7", - "sha256:15b26ddf78d57f1d143bdf32e820fd8935d36abe8a25eb9ec0b5a71c82eb3895", - "sha256:1872d01ac8c618a8da634e232f24793883d6e456a66593135aeafe3784b0848d", - "sha256:187d18082694a29005ba2944c882344b6748d5be69e3a89bf3cc9d878e548d5a", - "sha256:1b2919306936ac6efb3aed1fbf81039f7087ddadb3160882a57ee2ff74fd2382", - "sha256:232ac332403e37e4a03d209a3f92ed9071f7d3dbda70e2a5e9cff1c4ba9f0678", - "sha256:23e8565ab7ff33218530bc817922fae827420f143479b753104ab801145b1d5b", - "sha256:24817cb02cbef7cd499f7c9a2735286b4782bd47a5b3516a0e84c50eab44b98e", - "sha256:249c6470a2b60935bafd1d1d13cd613f8cd8388d53461c67397ee6a0f5dce741", - "sha256:24a91a981f185721542a0b7c92e9054b7ab4fea0508a795846bc5b0abf8118d4", - "sha256:2502dd2a736c879c0f0d3e2161e74d9907231e25d35794584b1ca5284e43f596", - "sha256:250c9eb0f4600361dd80d46112213dff2286231d92d3e52af1e5a6083d10cad9", - "sha256:278c296c6f96fa686d74eb449ea1697f3c03dc28b75f873b65b5201806346a69", - "sha256:2935ffc78db9645cb2086c2f8f4cfd23d9b73cc0dc80334bc30aac6f03f68f8c", - "sha256:2f4a0033ce9a76e391542c182f0d48d084855b5fcba5010f707c8e8c34663d77", - "sha256:30a85aed0b864ac88309b7d94be09f6046c834ef60762a8833b660139cfbad13", - "sha256:380c4bde80bce25c6e4f77b19386f5ec9db230df9f2f2ac1e5ad7af2caa70459", - "sha256:3ae38d325b512f63f8da31f826e6cb6c367336f95e418137286ba362925c877e", - "sha256:3b447982ad46348c02cb90d230b75ac34e9886273df3a93eec0539308a6296d7", - "sha256:3debd1150027933210c2fc321527c2299118aa929c2f5a0a80ab6953e3bd1908", - "sha256:4162918ef3098851fcd8a628bf9b6a98d10c380725df9e04caf5ca6dd48c847a", - "sha256:468d2a840567b13a590e67dd276c570f8de00ed767ecc611994c301d0f8c014f", - "sha256:4cc152c5dd831641e995764f9f0b6589519f6f5123258ccaca8c6d34572fefa8", - "sha256:542da1178c1c6af8873e143910e2269add130a299c9106eef2594e15dae5e482", - "sha256:557b21a44ceac6c6b9773bc65aa1b4cc3e248a5ad2f5b914b91579a32e22204d", - "sha256:5707a746c6083a3a74b46b3a631d78d129edab06195a92a8ece755aac25a3f3d", - "sha256:588245972aca710b5b68802c8cad9edaa98589b1b42ad2b53accd6910dad3545", - "sha256:5adf257bd58c1b8632046bbe43ee38c04e1038e9d37de9c57a94d6bd6ce5da34", - "sha256:619d1c96099be5823db34fe89e2582b336b5b074a7f47f819d6b3a57ff7bdb86", - "sha256:63563193aec44bce707e0c5ca64ff69fa72ed7cf34ce6e11d5127555756fd2f6", - "sha256:67b8cc9574bb518ec76dc8e705d4c39ae78bb96237cb533edac149352c1f39fe", - "sha256:6a685067d05e46641d5d1623d7c7fdf15a357546cbb2f71b0ebde91b175ffc3e", - "sha256:70f1d09c0d7748b73290b29219e854b3207aea922f839437870d8cc2168e31cc", - "sha256:750b446b2ffce1739e8578576092179160f6d26bd5e23eb1789c4d64d5af7dc7", - "sha256:7966951325782121e67c81299a031f4c115615e68046f79b85856b86ebffc4cd", - "sha256:7b8b8bf1189b3ba9b8de5c8db4d541b406611a71a955bbbd7385bbc45fcb786c", - "sha256:7f5d10bae5d78e4551b7be7a9b29643a95aded9d0f602aa2ba584f0388e7a557", - "sha256:805dfea4ca10411a5296bcc75638017215a93ffb584c9e344731eef0dcfb026a", - "sha256:81bf654678e575403736b85ba3a7867e31c2c30a69bc57fe88e3ace52fb17b89", - "sha256:82eb849f085624f6a607538ee7b83a6d8126df6d2f7d3b319cb837b289123078", - "sha256:85a32721ddde63c9df9ebb0d2045b9691d9750cb139c161c80e500d210f5e26e", - "sha256:86d1f65ac145e2c9ed71d8ffb1905e9bba3a91ae29ba55b4c46ae6fc31d7c0d4", - "sha256:86f63face3a527284f7bb8a9d4f78988e3c06823f7bea2bd6f0e0e9298ca0403", - "sha256:8eaf82f0eccd1505cf39a45a6bd0a8cf1c70dcfc30dba338207a969d91b965c0", - "sha256:93aa7eef6ee71c629b51ef873991d6911b906d7312c6e8e99790c0f33c576f89", - "sha256:96c2b49eb6a72c0e4991d62406e365d87067ca14c1a729a870d22354e6f68115", - "sha256:9cf3126b85822c4e53aa28c7ec9869b924d6fcfb76e77a45c44b83d91afd74f9", - "sha256:9fe359b2e3a7729010060fbca442ca225280c16e923b37db0e955ac2a2b72a05", - "sha256:a0ac5e7015a5920cfce654c06618ec40c33e12801711da6b4258af59a8eff00a", - "sha256:a3f93dab657839dfa61025056606600a11d0b696d79386f974e459a3fbc568ec", - "sha256:a4b71f4d1765639372a3b32d2638197f5cd5221b19531f9245fcc9ee62d38f56", - "sha256:aae32c93e0f64469f74ccc730a7cb21c7610af3a775157e50bbd38f816536b38", - "sha256:aaf7b34c5bc56b38c931a54f7952f1ff0ae77a2e82496583b247f7c969eb1479", - "sha256:abecce40dfebbfa6abf8e324e1860092eeca6f7375c8c4e655a8afb61af58f2c", - "sha256:abf0d9f45ea5fb95051c8bfe43cb40cda383772f7e5023a83cc481ca2604d74e", - "sha256:ac71b2977fb90c35d41c9453116e283fac47bb9096ad917b8819ca8b943abecd", - "sha256:ada214c6fa40f8d800e575de6b91a40d0548139e5dc457d2ebb61470abf50186", - "sha256:b09719a17a2301178fac4470d54b1680b18a5048b481cb8890e1ef820cb80455", - "sha256:b1121de0e9d6e6ca08289583d7491e7fcb18a439305b34a30b20d8215922d43c", - "sha256:b3b2316b25644b23b54a6f6401074cebcecd1244c0b8e80111c9a3f1c8e83d65", - "sha256:b3d9b48ee6e3967b7901c052b670c7dda6deb812c309439adaffdec55c6d7b78", - "sha256:b5bcf60a228acae568e9911f410f9d9e0d43197d030ae5799e20dca8df588287", - "sha256:b8f3307af845803fb0b060ab76cf6dd3a13adc15b6b451f54281d25911eb92df", - "sha256:c2af80fb58f0f24b3f3adcb9148e6203fa67dd3f61c4af146ecad033024dde43", - "sha256:c350354efb159b8767a6244c166f66e67506e06c8924ed74669b2c70bc8735b1", - "sha256:c5a74c359b2d47d26cdbbc7845e9662d6b08a1e915eb015d044729e92e7050b7", - "sha256:c71f16da1ed8949774ef79f4a0260d28b83b3a50c6576f8f4f0288d109777989", - "sha256:d47ecf253780c90ee181d4d871cd655a789da937454045b17b5798da9393901a", - "sha256:d7eff0f27edc5afa9e405f7165f85a6d782d308f3b6b9d96016c010597958e63", - "sha256:d97d85fa63f315a8bdaba2af9a6a686e0eceab77b3089af45133252618e70884", - "sha256:db756e48f9c5c607b5e33dd36b1d5872d0422e960145b08ab0ec7fd420e9d649", - "sha256:dc45229747b67ffc441b3de2f3ae5e62877a282ea828a5bdb67883c4ee4a8810", - "sha256:e0fc42822278451bc13a2e8626cf2218ba570f27856b536e00cfa53099724828", - "sha256:e39c7eb31e3f5b1f88caff88bcff1b7f8334975b46f6ac6e9fc725d829bc35d4", - "sha256:e46cd37076971c1040fc8c41273a8b3e2c624ce4f2be3f5dfcb7a430c1d3acc2", - "sha256:e5c1502d4ace69a179305abb3f0bb6141cbe4714bc9b31d427329a95acfc8bdd", - "sha256:edfe077ab09442d4ef3c52cb1f9dab89bff02f4524afc0acf2d46be17dc479f5", - "sha256:effe5406c9bd748a871dbcaf3ac69167c38d72db8c9baf3ff954c344f31c4cbe", - "sha256:f0d1e3732768fecb052d90d62b220af62ead5748ac51ef61e7b32c266cac9293", - "sha256:f5969baeaea61c97efa706b9b107dcba02784b1601c74ac84f2a532ea079403e", - "sha256:f8888e31e3a85943743f8fc15e71536bda1c81d5aa36d014a3c0c44481d7db6e", - "sha256:fc52b79d83a3fe3a360902d3f5d79073a993597d48114c29485e9431092905d8" + "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027", + "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087", + "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786", + "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8", + "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09", + "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185", + "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574", + "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e", + "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519", + "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898", + "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269", + "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3", + "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f", + "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6", + "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8", + "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a", + "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73", + "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc", + "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714", + "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2", + "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc", + "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce", + "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d", + "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e", + "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6", + "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269", + "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96", + "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d", + "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a", + "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4", + "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77", + "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d", + "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0", + "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed", + "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068", + "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac", + "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25", + "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8", + "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab", + "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26", + "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2", + "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db", + "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f", + "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5", + "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99", + "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c", + "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d", + "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811", + "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa", + "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a", + "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03", + "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b", + "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04", + "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c", + "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001", + "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458", + "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389", + "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99", + "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985", + "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537", + "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238", + "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f", + "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d", + "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796", + "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a", + "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143", + "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8", + "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c", + "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5", + "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5", + "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711", + "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4", + "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6", + "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c", + "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7", + "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4", + "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b", + "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae", + "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12", + "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c", + "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae", + "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8", + "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887", + "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b", + "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4", + "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f", + "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5", + "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33", + "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519", + "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561" ], "markers": "python_full_version >= '3.7.0'", - "version": "==3.3.0" + "version": "==3.3.2" }, "croniter": { "hashes": [ @@ -741,14 +733,6 @@ "index": "pypi", "version": "==6.0.1" }, - "requests": { - "hashes": [ - "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", - "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" - ], - "markers": "python_version >= '3.7'", - "version": "==2.31.0" - }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", @@ -827,14 +811,6 @@ "index": "pypi", "version": "==0.4.5" }, - "twilio": { - "hashes": [ - "sha256:3edc0bcde7320b5ae5f516484af9092bc4df2f5a3b1d4d94a66c29310adb924c", - "sha256:7bca5dc476d4d15e89e41d3074f8a265bd61445d1de9e8a697ca96cd8399eda6" - ], - "index": "pypi", - "version": "==8.9.1" - }, "typing-extensions": { "hashes": [ "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0", diff --git a/main.py b/main.py index 0c5f90592..3c0ab6677 100755 --- a/main.py +++ b/main.py @@ -26,7 +26,6 @@ from server.control import ControlServer from server.game_service import GameService from server.health import HealthServer -from server.ice_servers.nts import TwilioNTS from server.player_service import PlayerService from server.profiler import Profiler from server.protocol import QDataStreamProtocol, SimpleJsonProtocol @@ -80,18 +79,9 @@ def done_handler(sig: int, frame): # Set up services - twilio_nts = None - if config.TWILIO_ACCOUNT_SID: - twilio_nts = TwilioNTS() - else: - logger.warning( - "Twilio is not set up. You must set TWILIO_ACCOUNT_SID and TWILIO_TOKEN to use the Twilio ICE servers." - ) - instance = server.ServerInstance( "LobbyServer", database, - twilio_nts, loop ) player_service: PlayerService = instance.services["player_service"] diff --git a/server/__init__.py b/server/__init__.py index e3837209f..66fed5e0b 100644 --- a/server/__init__.py +++ b/server/__init__.py @@ -101,7 +101,6 @@ from .game_service import GameService from .gameconnection import GameConnection from .geoip_service import GeoIpService -from .ice_servers.nts import TwilioNTS from .ladder_service import LadderService from .ladder_service.violation_service import ViolationService from .lobbyconnection import LobbyConnection @@ -153,7 +152,6 @@ def __init__( self, name: str, database: FAFDatabase, - twilio_nts: Optional[TwilioNTS], loop: asyncio.BaseEventLoop, # For testing _override_services: Optional[dict[str, Service]] = None @@ -161,7 +159,6 @@ def __init__( self.name = name self._logger = logging.getLogger(self.name) self.database = database - self.twilio_nts = twilio_nts self.loop = loop self.started = False @@ -178,7 +175,6 @@ def __init__( database=database, geoip=self.services["geo_ip_service"], game_service=self.services["game_service"], - nts_client=twilio_nts, players=self.services["player_service"], ladder_service=self.services["ladder_service"], party_service=self.services["party_service"], diff --git a/server/config.py b/server/config.py index aade3ee29..3b71211dc 100644 --- a/server/config.py +++ b/server/config.py @@ -130,9 +130,6 @@ def __init__(self): self.MINORITY_BONUS = 1 self.MINORITY_BONUS_RATING_RANGE = 1250 - self.TWILIO_ACCOUNT_SID = "" - self.TWILIO_TOKEN = "" - self.TWILIO_TTL = 86400 self.COTURN_HOSTS = [] self.COTURN_KEYS = [] diff --git a/server/ice_servers/coturn.py b/server/ice_servers/coturn.py index 8ff62bef8..a792ae1e1 100644 --- a/server/ice_servers/coturn.py +++ b/server/ice_servers/coturn.py @@ -11,8 +11,6 @@ import time from hashlib import sha1 -from server.config import config - class CoturnHMAC: def __init__(self, coturn_hosts=[], coturn_keys=[]): @@ -21,7 +19,7 @@ def __init__(self, coturn_hosts=[], coturn_keys=[]): def server_tokens(self, username="faf-user", ttl=None) -> list[dict[str]]: if ttl is None: - ttl = config.TWILIO_TTL # pragma: no cover + ttl = 86400 # pragma: no cover servers = [] diff --git a/server/ice_servers/nts.py b/server/ice_servers/nts.py deleted file mode 100644 index 880cfa887..000000000 --- a/server/ice_servers/nts.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -Twilio API NTS token -""" - -import asyncio -from functools import partial - -from twilio.rest import Client as TwilioRestClient - -from server.config import config - - -class TwilioNTS: - """ - Twilio NTS Token Service - - Creates new twilio NTS tokens - """ - - def __init__(self, sid=None, token=None): - if sid is None: - sid = config.TWILIO_ACCOUNT_SID # pragma: no cover - if token is None: - token = config.TWILIO_TOKEN # pragma: no cover - - self.twilio_account_sid = sid - self.twilio_token = token - self.client = TwilioRestClient(self.twilio_account_sid, self.twilio_token) - - async def server_tokens(self, ttl=None) -> list[dict[str]]: - """ - Fetches token from Twilio - - # Params - - `ttl`: ttl in seconds - """ - if ttl is None: - ttl = config.TWILIO_TTL # pragma: no cover - - loop = asyncio.get_running_loop() - token = await loop.run_in_executor(None, partial(self.client.tokens.create, ttl)) - return token.ice_servers diff --git a/server/lobbyconnection.py b/server/lobbyconnection.py index e4c9c0e80..99db665b9 100644 --- a/server/lobbyconnection.py +++ b/server/lobbyconnection.py @@ -51,7 +51,6 @@ ) from .geoip_service import GeoIpService from .ice_servers.coturn import CoturnHMAC -from .ice_servers.nts import TwilioNTS from .ladder_service import LadderService from .oauth_service import OAuthService from .party_service import PartyService @@ -71,7 +70,6 @@ def __init__( database: FAFDatabase, game_service: GameService, players: PlayerService, - nts_client: Optional[TwilioNTS], geoip: GeoIpService, ladder_service: LadderService, party_service: PartyService, @@ -82,7 +80,6 @@ def __init__( self.geoip_service = geoip self.game_service = game_service self.player_service = players - self.nts_client = nts_client self.coturn_generator = CoturnHMAC(config.COTURN_HOSTS, config.COTURN_KEYS) self.ladder_service = ladder_service self.party_service = party_service @@ -1146,15 +1143,12 @@ async def command_ice_servers(self, message): if not self.player: return - ttl = config.TWILIO_TTL + ttl = 86400 ice_servers = self.coturn_generator.server_tokens( username=self.player.id, ttl=ttl ) - if self.nts_client: - ice_servers += await self.nts_client.server_tokens(ttl=ttl) - await self.send({ "command": "ice_servers", "ice_servers": ice_servers, diff --git a/tests/conftest.py b/tests/conftest.py index e057c0c73..85c42356c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -447,13 +447,3 @@ def coturn_credentials() -> Iterable[str]: "I5BcpufNrBb4JDj80KY/7VATNis=", "4wYEgoPz2MHf35Fva8NWulI3vVU=" ] - - -@pytest.fixture -def twilio_sid(): - return "a" - - -@pytest.fixture -def twilio_token(): - return "token_a" diff --git a/tests/data/test_conf.yaml b/tests/data/test_conf.yaml index ce082aa6e..e498e44f8 100644 --- a/tests/data/test_conf.yaml +++ b/tests/data/test_conf.yaml @@ -27,9 +27,6 @@ NEWBIE_BASE_MEAN: 500 NEWBIE_MIN_GAMES: 10 TOP_PLAYER_MIN_RATING: 1600 -TWILIO_ACCOUNT_SID: "" -TWILIO_TOKEN: "" -TWILIO_TTL: 86400 COTURN_HOSTS: [] COTURN_KEYS: [] diff --git a/tests/integration_tests/conftest.py b/tests/integration_tests/conftest.py index ffeaea92d..ce13f6b7f 100644 --- a/tests/integration_tests/conftest.py +++ b/tests/integration_tests/conftest.py @@ -141,7 +141,6 @@ async def make_lobby_server(config): instance = ServerInstance( "UnitTestServer", database, - twilio_nts=None, loop=event_loop, _override_services={ "broadcast_service": broadcast_service, diff --git a/tests/integration_tests/test_server_instance.py b/tests/integration_tests/test_server_instance.py index 0407e7877..1b805d6a8 100644 --- a/tests/integration_tests/test_server_instance.py +++ b/tests/integration_tests/test_server_instance.py @@ -38,7 +38,6 @@ async def test_multiple_contexts( instance = ServerInstance( "TestMultiContext", database, - twilio_nts=None, loop=event_loop, _override_services={ "broadcast_service": broadcast_service, diff --git a/tests/integration_tests/test_servercontext.py b/tests/integration_tests/test_servercontext.py index c09192ab8..f4d4885e7 100644 --- a/tests/integration_tests/test_servercontext.py +++ b/tests/integration_tests/test_servercontext.py @@ -55,7 +55,6 @@ def make_connection() -> LobbyConnection: database=mock.Mock(), game_service=mock.Mock(), players=mock.Mock(), - nts_client=mock.Mock(), geoip=mock.Mock(), ladder_service=mock.Mock(), party_service=mock.Mock(), diff --git a/tests/unit_tests/test_ice.py b/tests/unit_tests/test_ice.py index b6af773fc..1b4de0f5d 100644 --- a/tests/unit_tests/test_ice.py +++ b/tests/unit_tests/test_ice.py @@ -1,10 +1,8 @@ from unittest import mock import pytest -from twilio.rest import Client as TwilioRestClient from server.ice_servers.coturn import CoturnHMAC -from server.ice_servers.nts import TwilioNTS @pytest.fixture @@ -12,27 +10,6 @@ def coturn_hmac(coturn_hosts, coturn_keys): return CoturnHMAC(coturn_hosts=coturn_hosts, coturn_keys=coturn_keys) -@pytest.fixture -def twilio(twilio_sid, twilio_token): - with mock.patch("twilio.rest.Client", mock.Mock(spec=TwilioRestClient)): - mocked = TwilioNTS(sid=twilio_sid, token=twilio_token) - mocked.client.tokens.create = mock.Mock( - return_value=FakeTwilioServers() - ) - return mocked - - -class FakeTwilioServers: - def __init__(self): - self.ice_servers = \ - { - "urls": ["a", "b", "c"], - "username": "d", - "credential": "e", - "credentialType": "f" - } - - @mock.patch("time.time", mock.Mock(return_value=1000)) def test_coturn_tokens(coturn_hmac, coturn_hosts, coturn_credentials): servers = coturn_hmac.server_tokens(username="faf-test", ttl=123456) @@ -56,15 +33,3 @@ def test_coturn_tokens(coturn_hmac, coturn_hosts, coturn_credentials): assert server["credential"] == credential assert server["username"] == "124456:faf-test" - - -async def test_twilio_nts(twilio): - servers = await twilio.server_tokens(ttl=123456) - twilio.client.tokens.create.assert_called_once() - assert servers == \ - { - "urls": ["a", "b", "c"], - "username": "d", - "credential": "e", - "credentialType": "f" - } diff --git a/tests/unit_tests/test_lobbyconnection.py b/tests/unit_tests/test_lobbyconnection.py index 0de4aa751..7b545f107 100644 --- a/tests/unit_tests/test_lobbyconnection.py +++ b/tests/unit_tests/test_lobbyconnection.py @@ -13,7 +13,6 @@ from server.gameconnection import GameConnection from server.games import CustomGame, Game, GameState, InitMode, VisibilityState from server.geoip_service import GeoIpService -from server.ice_servers.nts import TwilioNTS from server.ladder_service import LadderService from server.lobbyconnection import LobbyConnection from server.matchmaker import Search @@ -58,11 +57,6 @@ def mock_player(player_factory): return player_factory("Dummy", player_id=42, lobby_connection_spec=None) -@pytest.fixture -def mock_nts_client(): - return mock.create_autospec(TwilioNTS) - - @pytest.fixture def mock_players(): return mock.create_autospec(PlayerService) @@ -92,7 +86,6 @@ def lobbyconnection( mock_players, mock_player, mock_geoip, - mock_nts_client, rating_service ): lc = LobbyConnection( @@ -100,7 +93,6 @@ def lobbyconnection( geoip=mock_geoip, game_service=mock_games, players=mock_players, - nts_client=mock_nts_client, ladder_service=mock.create_autospec(LadderService), party_service=mock.create_autospec(PartyService), oauth_service=mock.create_autospec(OAuthService), @@ -695,21 +687,18 @@ async def test_command_social_remove_friend(lobbyconnection, database): async def test_command_ice_servers( lobbyconnection: LobbyConnection, - mock_nts_client ): lobbyconnection.send = mock.AsyncMock() lobbyconnection.coturn_generator.server_tokens = mock.Mock( return_value=["coturn_tokens"] ) - mock_nts_client.server_tokens.return_value = ["twilio_tokens"] await lobbyconnection.on_message_received({"command": "ice_servers"}) - mock_nts_client.server_tokens.assert_called_once() lobbyconnection.send.assert_called_once_with({ "command": "ice_servers", - "ice_servers": ["coturn_tokens", "twilio_tokens"], - "ttl": config.TWILIO_TTL + "ice_servers": ["coturn_tokens"], + "ttl": 86400, }) @@ -1076,7 +1065,6 @@ async def test_check_policy_conformity_fatal(lobbyconnection, policy_server): async def test_abort_connection_if_banned( lobbyconnection: LobbyConnection, - mock_nts_client ): # test user that has never been banned lobbyconnection.player.id = 1 diff --git a/tests/unit_tests/test_server_instance.py b/tests/unit_tests/test_server_instance.py index 5cf3d43d7..abb03f60d 100644 --- a/tests/unit_tests/test_server_instance.py +++ b/tests/unit_tests/test_server_instance.py @@ -2,7 +2,7 @@ def test_auto_create_services(): - instance = ServerInstance("TestCreateServices", None, None, None, None) + instance = ServerInstance("TestCreateServices", None, None, None) assert instance.services != {} assert isinstance(instance.services["player_service"], PlayerService)