From 93c3f1a7b3f0dbd9db8118a16701d63aab17a3ed Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 2 Dec 2020 16:39:41 +0000 Subject: [PATCH 01/14] Update quic-go --- go.mod | 4 ++-- go.sum | 31 +++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index d01c80860..59dad16d7 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.3.5 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-yamux v1.3.9 // indirect - github.com/lucas-clemente/quic-go v0.17.3 + github.com/lucas-clemente/quic-go v0.19.1 github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b github.com/matrix-org/go-http-js-libp2p v0.0.0-20200518170932-783164aeeda4 github.com/matrix-org/go-sqlite3-js v0.0.0-20200522092705-bc8506ccbcf3 @@ -40,7 +40,7 @@ require ( github.com/yggdrasil-network/yggdrasil-go v0.3.15-0.20201006093556-760d9a7fd5ee go.uber.org/atomic v1.6.0 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a - golang.org/x/net v0.0.0-20200528225125-3c3fba18258b + golang.org/x/net v0.0.0-20200707034311-ab3426394381 gopkg.in/h2non/bimg.v1 v1.1.4 gopkg.in/yaml.v2 v2.3.0 ) diff --git a/go.sum b/go.sum index 18715f86a..ac5c36441 100644 --- a/go.sum +++ b/go.sum @@ -111,6 +111,8 @@ github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8 github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -129,11 +131,15 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= +github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.4.0 h1:Rd1kQnQu0Hq3qvJppYSG0HtP+f5LPPUiDswTLiEegLg= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -547,8 +553,8 @@ github.com/libp2p/go-yamux v1.3.7 h1:v40A1eSPJDIZwz2AvrV3cxpTZEGDP11QJbukmEhYyQI github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.3.9 h1:aGCyO39LVHspu5+GARu+koNBzr6aYtxyAbwS1njzmrA= github.com/libp2p/go-yamux v1.3.9/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/lucas-clemente/quic-go v0.17.3 h1:jMX/MmDNCljfisgMmPGUcBJ+zUh9w3d3ia4YJjYS3TM= -github.com/lucas-clemente/quic-go v0.17.3/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= +github.com/lucas-clemente/quic-go v0.19.1 h1:J9TkQJGJVOR3UmGhd4zdVYwKSA0EoXbLRf15uQJ6gT4= +github.com/lucas-clemente/quic-go v0.19.1/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lxn/walk v0.0.0-20191128110447-55ccb3a9f5c1/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ= github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA= @@ -556,9 +562,11 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= -github.com/marten-seemann/qtls v0.9.1 h1:O0YKQxNVPaiFgMng0suWEOY2Sb4LT2sRn9Qimq3Z1IQ= -github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= +github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= +github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= +github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= +github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ= +github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b h1:xpcmnpfUImRC4O2SAS/dmTcJENDXvGmLUzey76V1R3Q= github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b/go.mod h1:NgPCr+UavRGH6n5jmdX8DuqFZ4JiCWIJoZiuhTRLSUg= github.com/matrix-org/go-http-js-libp2p v0.0.0-20200518170932-783164aeeda4 h1:eqE5OnGx9ZMWmrRbD3KF/3KtTunw0iQulI7YxOIdxo4= @@ -696,18 +704,20 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= @@ -905,6 +915,7 @@ golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5 h1:Q7tZBpemrlsc2I7IyODzht golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -927,7 +938,6 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -942,8 +952,11 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200528225125-3c3fba18258b h1:IYiJPiJfzktmDAO1HQiwjMjwjlYKHAL7KzeD544RJPs= golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -981,6 +994,7 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191003212358-c178f38b412c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -992,6 +1006,7 @@ golang.org/x/sys v0.0.0-20200301040627-c5d0d7b4ec88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From 3ef6187e96ca2d68b3014bbd150e69971b6f7800 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 2 Dec 2020 17:03:36 +0000 Subject: [PATCH 02/14] Revert "Update quic-go" This reverts commit 93c3f1a7b3f0dbd9db8118a16701d63aab17a3ed. --- go.mod | 4 ++-- go.sum | 31 ++++++++----------------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index 59dad16d7..d01c80860 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.3.5 github.com/libp2p/go-libp2p-record v0.1.3 github.com/libp2p/go-yamux v1.3.9 // indirect - github.com/lucas-clemente/quic-go v0.19.1 + github.com/lucas-clemente/quic-go v0.17.3 github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b github.com/matrix-org/go-http-js-libp2p v0.0.0-20200518170932-783164aeeda4 github.com/matrix-org/go-sqlite3-js v0.0.0-20200522092705-bc8506ccbcf3 @@ -40,7 +40,7 @@ require ( github.com/yggdrasil-network/yggdrasil-go v0.3.15-0.20201006093556-760d9a7fd5ee go.uber.org/atomic v1.6.0 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a - golang.org/x/net v0.0.0-20200707034311-ab3426394381 + golang.org/x/net v0.0.0-20200528225125-3c3fba18258b gopkg.in/h2non/bimg.v1 v1.1.4 gopkg.in/yaml.v2 v2.3.0 ) diff --git a/go.sum b/go.sum index ac5c36441..18715f86a 100644 --- a/go.sum +++ b/go.sum @@ -111,8 +111,6 @@ github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8 github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -131,15 +129,11 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= -github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.4.0 h1:Rd1kQnQu0Hq3qvJppYSG0HtP+f5LPPUiDswTLiEegLg= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -553,8 +547,8 @@ github.com/libp2p/go-yamux v1.3.7 h1:v40A1eSPJDIZwz2AvrV3cxpTZEGDP11QJbukmEhYyQI github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.3.9 h1:aGCyO39LVHspu5+GARu+koNBzr6aYtxyAbwS1njzmrA= github.com/libp2p/go-yamux v1.3.9/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/lucas-clemente/quic-go v0.19.1 h1:J9TkQJGJVOR3UmGhd4zdVYwKSA0EoXbLRf15uQJ6gT4= -github.com/lucas-clemente/quic-go v0.19.1/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= +github.com/lucas-clemente/quic-go v0.17.3 h1:jMX/MmDNCljfisgMmPGUcBJ+zUh9w3d3ia4YJjYS3TM= +github.com/lucas-clemente/quic-go v0.17.3/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lxn/walk v0.0.0-20191128110447-55ccb3a9f5c1/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ= github.com/lxn/win v0.0.0-20191128105842-2da648fda5b4/go.mod h1:ouWl4wViUNh8tPSIwxTVMuS014WakR1hqvBc2I0bMoA= @@ -562,11 +556,9 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= -github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= -github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= -github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ= -github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= +github.com/marten-seemann/qtls v0.9.1 h1:O0YKQxNVPaiFgMng0suWEOY2Sb4LT2sRn9Qimq3Z1IQ= +github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b h1:xpcmnpfUImRC4O2SAS/dmTcJENDXvGmLUzey76V1R3Q= github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b/go.mod h1:NgPCr+UavRGH6n5jmdX8DuqFZ4JiCWIJoZiuhTRLSUg= github.com/matrix-org/go-http-js-libp2p v0.0.0-20200518170932-783164aeeda4 h1:eqE5OnGx9ZMWmrRbD3KF/3KtTunw0iQulI7YxOIdxo4= @@ -704,20 +696,18 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= @@ -915,7 +905,6 @@ golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5 h1:Q7tZBpemrlsc2I7IyODzht golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -938,6 +927,7 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -952,11 +942,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200528225125-3c3fba18258b h1:IYiJPiJfzktmDAO1HQiwjMjwjlYKHAL7KzeD544RJPs= golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -994,7 +981,6 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191003212358-c178f38b412c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1006,7 +992,6 @@ golang.org/x/sys v0.0.0-20200301040627-c5d0d7b4ec88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From b5aa7ca3ab1c91397700637c91d60860a0535f1e Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 2 Dec 2020 17:41:00 +0000 Subject: [PATCH 03/14] Top-level setup package (#1605) * Move config, setup, mscs into "setup" top-level folder * oops, forgot the EDU server * Add setup * goimports --- appservice/appservice.go | 6 +++--- appservice/consumers/roomserver.go | 2 +- appservice/query/query.go | 2 +- appservice/storage/postgres/storage.go | 2 +- appservice/storage/sqlite3/storage.go | 2 +- appservice/storage/storage.go | 2 +- appservice/storage/storage_wasm.go | 2 +- appservice/types/types.go | 2 +- appservice/workers/transaction_scheduler.go | 2 +- build/gobind/monolith.go | 4 ++-- clientapi/auth/password.go | 2 +- clientapi/auth/user_interactive.go | 2 +- clientapi/auth/user_interactive_test.go | 2 +- clientapi/clientapi.go | 4 ++-- clientapi/routing/auth_fallback.go | 2 +- clientapi/routing/createroom.go | 2 +- clientapi/routing/directory.go | 2 +- clientapi/routing/directory_public.go | 2 +- clientapi/routing/getevent.go | 2 +- clientapi/routing/login.go | 2 +- clientapi/routing/membership.go | 2 +- clientapi/routing/memberships.go | 2 +- clientapi/routing/password.go | 2 +- clientapi/routing/profile.go | 2 +- clientapi/routing/rate_limiting.go | 2 +- clientapi/routing/redaction.go | 2 +- clientapi/routing/register.go | 2 +- clientapi/routing/register_test.go | 2 +- clientapi/routing/routing.go | 2 +- clientapi/routing/sendevent.go | 2 +- clientapi/routing/threepid.go | 2 +- clientapi/routing/voip.go | 2 +- clientapi/threepid/invites.go | 2 +- clientapi/threepid/threepid.go | 2 +- cmd/create-account/main.go | 2 +- cmd/dendrite-demo-libp2p/main.go | 4 ++-- cmd/dendrite-demo-libp2p/p2pdendrite.go | 4 ++-- cmd/dendrite-demo-yggdrasil/main.go | 4 ++-- cmd/dendrite-demo-yggdrasil/yggconn/client.go | 2 +- cmd/dendrite-monolith-server/main.go | 6 +++--- cmd/dendrite-polylith-multi/main.go | 4 ++-- .../personalities/appservice.go | 4 ++-- .../personalities/clientapi.go | 4 ++-- .../personalities/eduserver.go | 4 ++-- .../personalities/federationapi.go | 4 ++-- .../personalities/federationsender.go | 4 ++-- .../personalities/keyserver.go | 4 ++-- .../personalities/mediaapi.go | 4 ++-- .../personalities/roomserver.go | 4 ++-- .../personalities/signingkeyserver.go | 4 ++-- cmd/dendrite-polylith-multi/personalities/syncapi.go | 4 ++-- cmd/dendrite-polylith-multi/personalities/userapi.go | 4 ++-- cmd/dendritejs/main.go | 4 ++-- cmd/generate-config/main.go | 2 +- cmd/resolve-state/main.go | 2 +- cmd/roomserver-integration-tests/main.go | 2 +- cmd/syncserver-integration-tests/main.go | 2 +- eduserver/eduserver.go | 6 +++--- federationapi/federationapi.go | 2 +- federationapi/federationapi_test.go | 4 ++-- federationapi/routing/backfill.go | 2 +- federationapi/routing/invite.go | 2 +- federationapi/routing/join.go | 2 +- federationapi/routing/keys.go | 2 +- federationapi/routing/leave.go | 2 +- federationapi/routing/profile.go | 2 +- federationapi/routing/query.go | 2 +- federationapi/routing/routing.go | 2 +- federationapi/routing/send.go | 2 +- federationapi/routing/threepid.go | 2 +- federationsender/consumers/eduserver.go | 2 +- federationsender/consumers/keychange.go | 2 +- federationsender/consumers/roomserver.go | 2 +- federationsender/federationsender.go | 4 ++-- federationsender/internal/api.go | 2 +- federationsender/storage/postgres/storage.go | 2 +- federationsender/storage/sqlite3/storage.go | 2 +- federationsender/storage/storage.go | 2 +- federationsender/storage/storage_wasm.go | 2 +- internal/eventutil/events.go | 2 +- internal/log.go | 2 +- internal/sqlutil/migrate.go | 2 +- internal/sqlutil/trace.go | 2 +- internal/sqlutil/uri.go | 2 +- internal/test/config.go | 2 +- internal/test/server.go | 2 +- keyserver/keyserver.go | 4 ++-- keyserver/storage/postgres/storage.go | 2 +- keyserver/storage/sqlite3/storage.go | 2 +- keyserver/storage/storage.go | 2 +- keyserver/storage/storage_test.go | 2 +- keyserver/storage/storage_wasm.go | 2 +- mediaapi/fileutils/fileutils.go | 2 +- mediaapi/mediaapi.go | 2 +- mediaapi/routing/download.go | 2 +- mediaapi/routing/routing.go | 2 +- mediaapi/routing/upload.go | 2 +- mediaapi/storage/postgres/storage.go | 2 +- mediaapi/storage/sqlite3/storage.go | 2 +- mediaapi/storage/storage.go | 2 +- mediaapi/storage/storage_wasm.go | 2 +- mediaapi/thumbnailer/thumbnailer.go | 2 +- mediaapi/thumbnailer/thumbnailer_bimg.go | 2 +- mediaapi/thumbnailer/thumbnailer_nfnt.go | 2 +- mediaapi/types/types.go | 2 +- roomserver/internal/api.go | 2 +- roomserver/internal/perform/perform_invite.go | 2 +- roomserver/internal/perform/perform_join.go | 2 +- roomserver/internal/perform/perform_leave.go | 2 +- roomserver/internal/perform/perform_peek.go | 2 +- roomserver/roomserver.go | 6 +++--- roomserver/roomserver_test.go | 4 ++-- roomserver/storage/postgres/storage.go | 2 +- roomserver/storage/sqlite3/storage.go | 2 +- roomserver/storage/storage.go | 2 +- roomserver/storage/storage_wasm.go | 2 +- {internal/setup => setup}/base.go | 2 +- {internal => setup}/config/config.go | 0 {internal => setup}/config/config_appservice.go | 0 {internal => setup}/config/config_clientapi.go | 0 {internal => setup}/config/config_eduserver.go | 0 {internal => setup}/config/config_federationapi.go | 0 .../config/config_federationsender.go | 0 {internal => setup}/config/config_global.go | 0 {internal => setup}/config/config_kafka.go | 0 {internal => setup}/config/config_keyserver.go | 0 {internal => setup}/config/config_mediaapi.go | 0 {internal => setup}/config/config_mscs.go | 0 {internal => setup}/config/config_roomserver.go | 0 .../config/config_signingkeyserver.go | 0 {internal => setup}/config/config_syncapi.go | 0 {internal => setup}/config/config_test.go | 0 {internal => setup}/config/config_userapi.go | 0 {internal/setup => setup}/federation.go | 0 {internal/setup => setup}/flags.go | 2 +- {internal/setup => setup}/kafka/kafka.go | 2 +- {internal/setup => setup}/monolith.go | 2 +- {internal => setup}/mscs/msc2836/msc2836.go | 2 +- {internal => setup}/mscs/msc2836/msc2836_test.go | 6 +++--- {internal => setup}/mscs/msc2836/storage.go | 2 +- {internal => setup}/mscs/mscs.go | 4 ++-- signingkeyserver/internal/api.go | 2 +- signingkeyserver/serverkeyapi_test.go | 2 +- signingkeyserver/signingkeyserver.go | 2 +- signingkeyserver/storage/keydb.go | 2 +- signingkeyserver/storage/postgres/keydb.go | 2 +- signingkeyserver/storage/sqlite3/keydb.go | 2 +- syncapi/consumers/clientapi.go | 2 +- syncapi/consumers/eduserver_receipts.go | 2 +- syncapi/consumers/eduserver_sendtodevice.go | 2 +- syncapi/consumers/eduserver_typing.go | 2 +- syncapi/consumers/roomserver.go | 2 +- syncapi/internal/keychange_test.go | 2 +- syncapi/routing/messages.go | 2 +- syncapi/routing/routing.go | 2 +- syncapi/storage/postgres/syncserver.go | 2 +- syncapi/storage/sqlite3/syncserver.go | 2 +- syncapi/storage/storage.go | 2 +- syncapi/storage/storage_test.go | 2 +- syncapi/storage/storage_wasm.go | 2 +- syncapi/sync/requestpool.go | 2 +- syncapi/syncapi.go | 4 ++-- syncapi/types/types_test.go | 12 ++++++------ userapi/internal/api.go | 2 +- userapi/storage/accounts/postgres/storage.go | 2 +- userapi/storage/accounts/sqlite3/storage.go | 2 +- userapi/storage/accounts/storage.go | 2 +- userapi/storage/accounts/storage_wasm.go | 2 +- userapi/storage/devices/postgres/storage.go | 2 +- userapi/storage/devices/sqlite3/storage.go | 2 +- userapi/storage/devices/storage.go | 2 +- userapi/storage/devices/storage_wasm.go | 2 +- userapi/userapi.go | 2 +- userapi/userapi_test.go | 2 +- 174 files changed, 196 insertions(+), 196 deletions(-) rename {internal/setup => setup}/base.go (99%) rename {internal => setup}/config/config.go (100%) rename {internal => setup}/config/config_appservice.go (100%) rename {internal => setup}/config/config_clientapi.go (100%) rename {internal => setup}/config/config_eduserver.go (100%) rename {internal => setup}/config/config_federationapi.go (100%) rename {internal => setup}/config/config_federationsender.go (100%) rename {internal => setup}/config/config_global.go (100%) rename {internal => setup}/config/config_kafka.go (100%) rename {internal => setup}/config/config_keyserver.go (100%) rename {internal => setup}/config/config_mediaapi.go (100%) rename {internal => setup}/config/config_mscs.go (100%) rename {internal => setup}/config/config_roomserver.go (100%) rename {internal => setup}/config/config_signingkeyserver.go (100%) rename {internal => setup}/config/config_syncapi.go (100%) rename {internal => setup}/config/config_test.go (100%) rename {internal => setup}/config/config_userapi.go (100%) rename {internal/setup => setup}/federation.go (100%) rename {internal/setup => setup}/flags.go (96%) rename {internal/setup => setup}/kafka/kafka.go (97%) rename {internal/setup => setup}/monolith.go (98%) rename {internal => setup}/mscs/msc2836/msc2836.go (99%) rename {internal => setup}/mscs/msc2836/msc2836_test.go (99%) rename {internal => setup}/mscs/msc2836/storage.go (99%) rename {internal => setup}/mscs/mscs.go (92%) diff --git a/appservice/appservice.go b/appservice/appservice.go index cf9a47b74..7a438041a 100644 --- a/appservice/appservice.go +++ b/appservice/appservice.go @@ -28,10 +28,10 @@ import ( "github.com/matrix-org/dendrite/appservice/storage" "github.com/matrix-org/dendrite/appservice/types" "github.com/matrix-org/dendrite/appservice/workers" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" - "github.com/matrix-org/dendrite/internal/setup/kafka" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/kafka" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/sirupsen/logrus" ) diff --git a/appservice/consumers/roomserver.go b/appservice/consumers/roomserver.go index 4f6b4b4d4..0b251d43d 100644 --- a/appservice/consumers/roomserver.go +++ b/appservice/consumers/roomserver.go @@ -21,8 +21,8 @@ import ( "github.com/matrix-org/dendrite/appservice/storage" "github.com/matrix-org/dendrite/appservice/types" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/Shopify/sarama" diff --git a/appservice/query/query.go b/appservice/query/query.go index fa3844f68..7e5ac4753 100644 --- a/appservice/query/query.go +++ b/appservice/query/query.go @@ -23,7 +23,7 @@ import ( "time" "github.com/matrix-org/dendrite/appservice/api" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" opentracing "github.com/opentracing/opentracing-go" log "github.com/sirupsen/logrus" ) diff --git a/appservice/storage/postgres/storage.go b/appservice/storage/postgres/storage.go index 952158167..d2c3e261e 100644 --- a/appservice/storage/postgres/storage.go +++ b/appservice/storage/postgres/storage.go @@ -21,8 +21,8 @@ import ( // Import postgres database driver _ "github.com/lib/pq" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/appservice/storage/sqlite3/storage.go b/appservice/storage/sqlite3/storage.go index 916845ab2..6ba5a6f69 100644 --- a/appservice/storage/sqlite3/storage.go +++ b/appservice/storage/sqlite3/storage.go @@ -20,8 +20,8 @@ import ( "database/sql" // Import SQLite database driver - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" _ "github.com/mattn/go-sqlite3" ) diff --git a/appservice/storage/storage.go b/appservice/storage/storage.go index e2d7e4e54..b0df2b7dc 100644 --- a/appservice/storage/storage.go +++ b/appservice/storage/storage.go @@ -21,7 +21,7 @@ import ( "github.com/matrix-org/dendrite/appservice/storage/postgres" "github.com/matrix-org/dendrite/appservice/storage/sqlite3" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) // NewDatabase opens a new Postgres or Sqlite database (based on dataSourceName scheme) diff --git a/appservice/storage/storage_wasm.go b/appservice/storage/storage_wasm.go index 7eb7da26e..07d0e9ee1 100644 --- a/appservice/storage/storage_wasm.go +++ b/appservice/storage/storage_wasm.go @@ -18,7 +18,7 @@ import ( "fmt" "github.com/matrix-org/dendrite/appservice/storage/sqlite3" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) func NewDatabase(dbProperties *config.DatabaseOptions) (Database, error) { diff --git a/appservice/types/types.go b/appservice/types/types.go index b6386df67..098face62 100644 --- a/appservice/types/types.go +++ b/appservice/types/types.go @@ -15,7 +15,7 @@ package types import ( "sync" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) const ( diff --git a/appservice/workers/transaction_scheduler.go b/appservice/workers/transaction_scheduler.go index 6e8e8f4a3..6528fc1b6 100644 --- a/appservice/workers/transaction_scheduler.go +++ b/appservice/workers/transaction_scheduler.go @@ -26,7 +26,7 @@ import ( "github.com/matrix-org/dendrite/appservice/storage" "github.com/matrix-org/dendrite/appservice/types" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" log "github.com/sirupsen/logrus" ) diff --git a/build/gobind/monolith.go b/build/gobind/monolith.go index fdb148775..1fda9a62c 100644 --- a/build/gobind/monolith.go +++ b/build/gobind/monolith.go @@ -17,11 +17,11 @@ import ( "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/dendrite/federationsender" "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/keyserver" "github.com/matrix-org/dendrite/roomserver" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi" "github.com/matrix-org/gomatrixserverlib" "github.com/sirupsen/logrus" diff --git a/clientapi/auth/password.go b/clientapi/auth/password.go index d98019550..bf4a95366 100644 --- a/clientapi/auth/password.go +++ b/clientapi/auth/password.go @@ -20,7 +20,7 @@ import ( "github.com/matrix-org/dendrite/clientapi/jsonerror" "github.com/matrix-org/dendrite/clientapi/userutil" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/util" ) diff --git a/clientapi/auth/user_interactive.go b/clientapi/auth/user_interactive.go index b7414ebe9..839637351 100644 --- a/clientapi/auth/user_interactive.go +++ b/clientapi/auth/user_interactive.go @@ -20,7 +20,7 @@ import ( "net/http" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/util" "github.com/sirupsen/logrus" diff --git a/clientapi/auth/user_interactive_test.go b/clientapi/auth/user_interactive_test.go index 47d1cad36..0b7df3545 100644 --- a/clientapi/auth/user_interactive_test.go +++ b/clientapi/auth/user_interactive_test.go @@ -6,7 +6,7 @@ import ( "fmt" "testing" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/clientapi/clientapi.go b/clientapi/clientapi.go index ebe55aec9..8a2ea8fc4 100644 --- a/clientapi/clientapi.go +++ b/clientapi/clientapi.go @@ -22,11 +22,11 @@ import ( "github.com/matrix-org/dendrite/clientapi/routing" eduServerAPI "github.com/matrix-org/dendrite/eduserver/api" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup/kafka" "github.com/matrix-org/dendrite/internal/transactions" keyserverAPI "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/kafka" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" diff --git a/clientapi/routing/auth_fallback.go b/clientapi/routing/auth_fallback.go index e639b1015..839ca9e54 100644 --- a/clientapi/routing/auth_fallback.go +++ b/clientapi/routing/auth_fallback.go @@ -20,7 +20,7 @@ import ( "github.com/matrix-org/dendrite/clientapi/auth/authtypes" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/util" ) diff --git a/clientapi/routing/createroom.go b/clientapi/routing/createroom.go index 8f29fbe74..5a2ffea34 100644 --- a/clientapi/routing/createroom.go +++ b/clientapi/routing/createroom.go @@ -28,8 +28,8 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/clientapi/routing/directory.go b/clientapi/routing/directory.go index e64d6b233..1b844c4e4 100644 --- a/clientapi/routing/directory.go +++ b/clientapi/routing/directory.go @@ -21,8 +21,8 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" diff --git a/clientapi/routing/directory_public.go b/clientapi/routing/directory_public.go index fd7bc1e86..2e3283be1 100644 --- a/clientapi/routing/directory_public.go +++ b/clientapi/routing/directory_public.go @@ -26,8 +26,8 @@ import ( "github.com/matrix-org/dendrite/clientapi/api" "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" ) diff --git a/clientapi/routing/getevent.go b/clientapi/routing/getevent.go index cccab1ee7..29340cc04 100644 --- a/clientapi/routing/getevent.go +++ b/clientapi/routing/getevent.go @@ -18,8 +18,8 @@ import ( "net/http" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/clientapi/routing/login.go b/clientapi/routing/login.go index f84f078dd..589efe0b2 100644 --- a/clientapi/routing/login.go +++ b/clientapi/routing/login.go @@ -22,7 +22,7 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" "github.com/matrix-org/dendrite/clientapi/userutil" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index 5ca202b66..bc679631a 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -25,10 +25,10 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" "github.com/matrix-org/dendrite/clientapi/threepid" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/roomserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" diff --git a/clientapi/routing/memberships.go b/clientapi/routing/memberships.go index 613484875..457f81cbd 100644 --- a/clientapi/routing/memberships.go +++ b/clientapi/routing/memberships.go @@ -19,8 +19,8 @@ import ( "net/http" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/clientapi/routing/password.go b/clientapi/routing/password.go index 8b81b9f02..87d5f8ff3 100644 --- a/clientapi/routing/password.go +++ b/clientapi/routing/password.go @@ -7,7 +7,7 @@ import ( "github.com/matrix-org/dendrite/clientapi/auth/authtypes" "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" diff --git a/clientapi/routing/profile.go b/clientapi/routing/profile.go index 971f23689..0d47c91ea 100644 --- a/clientapi/routing/profile.go +++ b/clientapi/routing/profile.go @@ -23,9 +23,9 @@ import ( "github.com/matrix-org/dendrite/clientapi/auth/authtypes" "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" diff --git a/clientapi/routing/rate_limiting.go b/clientapi/routing/rate_limiting.go index 9d3f817a2..5291cabae 100644 --- a/clientapi/routing/rate_limiting.go +++ b/clientapi/routing/rate_limiting.go @@ -6,7 +6,7 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/util" ) diff --git a/clientapi/routing/redaction.go b/clientapi/routing/redaction.go index 7696bec0f..923759748 100644 --- a/clientapi/routing/redaction.go +++ b/clientapi/routing/redaction.go @@ -21,10 +21,10 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/roomserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index 528537ef4..c6365c67b 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -32,8 +32,8 @@ import ( "sync" "time" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/clientapi/auth" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" diff --git a/clientapi/routing/register_test.go b/clientapi/routing/register_test.go index 0a91ae0f1..ea07f30be 100644 --- a/clientapi/routing/register_test.go +++ b/clientapi/routing/register_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) var ( diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 65b622b3a..e6315b68f 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -28,11 +28,11 @@ import ( "github.com/matrix-org/dendrite/clientapi/producers" eduServerAPI "github.com/matrix-org/dendrite/eduserver/api" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" "github.com/matrix-org/dendrite/internal/transactions" keyserverAPI "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" diff --git a/clientapi/routing/sendevent.go b/clientapi/routing/sendevent.go index a4240cf34..bfb48f3df 100644 --- a/clientapi/routing/sendevent.go +++ b/clientapi/routing/sendevent.go @@ -20,10 +20,10 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/internal/transactions" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/clientapi/routing/threepid.go b/clientapi/routing/threepid.go index 54ffa53f6..f4d233798 100644 --- a/clientapi/routing/threepid.go +++ b/clientapi/routing/threepid.go @@ -21,7 +21,7 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" "github.com/matrix-org/dendrite/clientapi/threepid" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" diff --git a/clientapi/routing/voip.go b/clientapi/routing/voip.go index 536c69fba..13dca7ac0 100644 --- a/clientapi/routing/voip.go +++ b/clientapi/routing/voip.go @@ -23,7 +23,7 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrix" "github.com/matrix-org/util" diff --git a/clientapi/threepid/invites.go b/clientapi/threepid/invites.go index f49796fde..53cd6b8ca 100644 --- a/clientapi/threepid/invites.go +++ b/clientapi/threepid/invites.go @@ -25,9 +25,9 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" diff --git a/clientapi/threepid/threepid.go b/clientapi/threepid/threepid.go index 40fd161d6..2f817ef42 100644 --- a/clientapi/threepid/threepid.go +++ b/clientapi/threepid/threepid.go @@ -24,7 +24,7 @@ import ( "strconv" "strings" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) // EmailAssociationRequest represents the request defined at https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register-email-requesttoken diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index f6de2d0d4..6aa1e7281 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/cmd/dendrite-demo-libp2p/main.go b/cmd/dendrite-demo-libp2p/main.go index 61fdd801a..9aae34e38 100644 --- a/cmd/dendrite-demo-libp2p/main.go +++ b/cmd/dendrite-demo-libp2p/main.go @@ -31,11 +31,11 @@ import ( "github.com/matrix-org/dendrite/cmd/dendrite-demo-yggdrasil/embed" "github.com/matrix-org/dendrite/eduserver" "github.com/matrix-org/dendrite/federationsender" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/keyserver" "github.com/matrix-org/dendrite/roomserver" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/signingkeyserver" "github.com/matrix-org/dendrite/userapi" "github.com/matrix-org/gomatrixserverlib" diff --git a/cmd/dendrite-demo-libp2p/p2pdendrite.go b/cmd/dendrite-demo-libp2p/p2pdendrite.go index 8fff46af1..45eb42a9c 100644 --- a/cmd/dendrite-demo-libp2p/p2pdendrite.go +++ b/cmd/dendrite-demo-libp2p/p2pdendrite.go @@ -22,7 +22,7 @@ import ( pstore "github.com/libp2p/go-libp2p-core/peerstore" record "github.com/libp2p/go-libp2p-record" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" "github.com/libp2p/go-libp2p" circuit "github.com/libp2p/go-libp2p-circuit" @@ -34,7 +34,7 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/matrix-org/gomatrixserverlib" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) // P2PDendrite is a Peer-to-Peer variant of BaseDendrite. diff --git a/cmd/dendrite-demo-yggdrasil/main.go b/cmd/dendrite-demo-yggdrasil/main.go index a40973638..39643cc2f 100644 --- a/cmd/dendrite-demo-yggdrasil/main.go +++ b/cmd/dendrite-demo-yggdrasil/main.go @@ -34,11 +34,11 @@ import ( "github.com/matrix-org/dendrite/federationsender" "github.com/matrix-org/dendrite/federationsender/api" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/keyserver" "github.com/matrix-org/dendrite/roomserver" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi" "github.com/matrix-org/gomatrixserverlib" diff --git a/cmd/dendrite-demo-yggdrasil/yggconn/client.go b/cmd/dendrite-demo-yggdrasil/yggconn/client.go index a5f89439d..ea51f4b17 100644 --- a/cmd/dendrite-demo-yggdrasil/yggconn/client.go +++ b/cmd/dendrite-demo-yggdrasil/yggconn/client.go @@ -4,7 +4,7 @@ import ( "net/http" "time" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/cmd/dendrite-monolith-server/main.go b/cmd/dendrite-monolith-server/main.go index 70b81bbc8..a1ade7893 100644 --- a/cmd/dendrite-monolith-server/main.go +++ b/cmd/dendrite-monolith-server/main.go @@ -22,12 +22,12 @@ import ( "github.com/matrix-org/dendrite/eduserver" "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/dendrite/federationsender" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/mscs" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/keyserver" "github.com/matrix-org/dendrite/roomserver" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/mscs" "github.com/matrix-org/dendrite/signingkeyserver" "github.com/matrix-org/dendrite/userapi" "github.com/sirupsen/logrus" diff --git a/cmd/dendrite-polylith-multi/main.go b/cmd/dendrite-polylith-multi/main.go index 0d6406c01..979ab4367 100644 --- a/cmd/dendrite-polylith-multi/main.go +++ b/cmd/dendrite-polylith-multi/main.go @@ -20,8 +20,8 @@ import ( "strings" "github.com/matrix-org/dendrite/cmd/dendrite-polylith-multi/personalities" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/sirupsen/logrus" ) diff --git a/cmd/dendrite-polylith-multi/personalities/appservice.go b/cmd/dendrite-polylith-multi/personalities/appservice.go index 7fa87b115..d269b15d4 100644 --- a/cmd/dendrite-polylith-multi/personalities/appservice.go +++ b/cmd/dendrite-polylith-multi/personalities/appservice.go @@ -16,8 +16,8 @@ package personalities import ( "github.com/matrix-org/dendrite/appservice" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func Appservice(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/clientapi.go b/cmd/dendrite-polylith-multi/personalities/clientapi.go index 09fc63ab3..b3cc411b3 100644 --- a/cmd/dendrite-polylith-multi/personalities/clientapi.go +++ b/cmd/dendrite-polylith-multi/personalities/clientapi.go @@ -16,9 +16,9 @@ package personalities import ( "github.com/matrix-org/dendrite/clientapi" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/internal/transactions" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func ClientAPI(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/eduserver.go b/cmd/dendrite-polylith-multi/personalities/eduserver.go index a5d2926f1..55b986e8f 100644 --- a/cmd/dendrite-polylith-multi/personalities/eduserver.go +++ b/cmd/dendrite-polylith-multi/personalities/eduserver.go @@ -17,8 +17,8 @@ package personalities import ( "github.com/matrix-org/dendrite/eduserver" "github.com/matrix-org/dendrite/eduserver/cache" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func EDUServer(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/federationapi.go b/cmd/dendrite-polylith-multi/personalities/federationapi.go index a1bbeafad..7957b211f 100644 --- a/cmd/dendrite-polylith-multi/personalities/federationapi.go +++ b/cmd/dendrite-polylith-multi/personalities/federationapi.go @@ -16,8 +16,8 @@ package personalities import ( "github.com/matrix-org/dendrite/federationapi" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func FederationAPI(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/federationsender.go b/cmd/dendrite-polylith-multi/personalities/federationsender.go index 052523789..f8b6d3004 100644 --- a/cmd/dendrite-polylith-multi/personalities/federationsender.go +++ b/cmd/dendrite-polylith-multi/personalities/federationsender.go @@ -16,8 +16,8 @@ package personalities import ( "github.com/matrix-org/dendrite/federationsender" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func FederationSender(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/keyserver.go b/cmd/dendrite-polylith-multi/personalities/keyserver.go index 6a7907602..d7fc9f4fb 100644 --- a/cmd/dendrite-polylith-multi/personalities/keyserver.go +++ b/cmd/dendrite-polylith-multi/personalities/keyserver.go @@ -15,9 +15,9 @@ package personalities import ( - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/keyserver" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func KeyServer(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/mediaapi.go b/cmd/dendrite-polylith-multi/personalities/mediaapi.go index 64e5bc312..cf3e6882b 100644 --- a/cmd/dendrite-polylith-multi/personalities/mediaapi.go +++ b/cmd/dendrite-polylith-multi/personalities/mediaapi.go @@ -15,9 +15,9 @@ package personalities import ( - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/mediaapi" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func MediaAPI(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/roomserver.go b/cmd/dendrite-polylith-multi/personalities/roomserver.go index 91027506d..cf52a5c22 100644 --- a/cmd/dendrite-polylith-multi/personalities/roomserver.go +++ b/cmd/dendrite-polylith-multi/personalities/roomserver.go @@ -15,9 +15,9 @@ package personalities import ( - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/roomserver" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" ) func RoomServer(base *setup.BaseDendrite, cfg *config.Dendrite) { diff --git a/cmd/dendrite-polylith-multi/personalities/signingkeyserver.go b/cmd/dendrite-polylith-multi/personalities/signingkeyserver.go index a7bfff10b..0a7fc502a 100644 --- a/cmd/dendrite-polylith-multi/personalities/signingkeyserver.go +++ b/cmd/dendrite-polylith-multi/personalities/signingkeyserver.go @@ -15,8 +15,8 @@ package personalities import ( - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/signingkeyserver" ) diff --git a/cmd/dendrite-polylith-multi/personalities/syncapi.go b/cmd/dendrite-polylith-multi/personalities/syncapi.go index 2d5c0b525..1c33286e2 100644 --- a/cmd/dendrite-polylith-multi/personalities/syncapi.go +++ b/cmd/dendrite-polylith-multi/personalities/syncapi.go @@ -15,8 +15,8 @@ package personalities import ( - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi" ) diff --git a/cmd/dendrite-polylith-multi/personalities/userapi.go b/cmd/dendrite-polylith-multi/personalities/userapi.go index fe5e4fbd0..6feb906d3 100644 --- a/cmd/dendrite-polylith-multi/personalities/userapi.go +++ b/cmd/dendrite-polylith-multi/personalities/userapi.go @@ -15,8 +15,8 @@ package personalities import ( - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi" ) diff --git a/cmd/dendritejs/main.go b/cmd/dendritejs/main.go index 85cc8a9fb..f247bc241 100644 --- a/cmd/dendritejs/main.go +++ b/cmd/dendritejs/main.go @@ -26,11 +26,11 @@ import ( "github.com/matrix-org/dendrite/eduserver" "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/dendrite/federationsender" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/keyserver" "github.com/matrix-org/dendrite/roomserver" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi" go_http_js_libp2p "github.com/matrix-org/go-http-js-libp2p" diff --git a/cmd/generate-config/main.go b/cmd/generate-config/main.go index e65723e65..3233cf809 100644 --- a/cmd/generate-config/main.go +++ b/cmd/generate-config/main.go @@ -4,7 +4,7 @@ import ( "flag" "fmt" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "gopkg.in/yaml.v2" ) diff --git a/cmd/resolve-state/main.go b/cmd/resolve-state/main.go index a622fbf28..efa583331 100644 --- a/cmd/resolve-state/main.go +++ b/cmd/resolve-state/main.go @@ -8,10 +8,10 @@ import ( "strconv" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/roomserver/state" "github.com/matrix-org/dendrite/roomserver/storage" "github.com/matrix-org/dendrite/roomserver/types" + "github.com/matrix-org/dendrite/setup" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/cmd/roomserver-integration-tests/main.go b/cmd/roomserver-integration-tests/main.go index 41ea6f4d8..ff3f06b6e 100644 --- a/cmd/roomserver-integration-tests/main.go +++ b/cmd/roomserver-integration-tests/main.go @@ -29,10 +29,10 @@ import ( "net/http" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/test" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/inthttp" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/cmd/syncserver-integration-tests/main.go b/cmd/syncserver-integration-tests/main.go index cbbcaa7e0..332bde10e 100644 --- a/cmd/syncserver-integration-tests/main.go +++ b/cmd/syncserver-integration-tests/main.go @@ -24,9 +24,9 @@ import ( "path/filepath" "time" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/test" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/eduserver/eduserver.go b/eduserver/eduserver.go index d5ab36818..7cc405108 100644 --- a/eduserver/eduserver.go +++ b/eduserver/eduserver.go @@ -22,9 +22,9 @@ import ( "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/dendrite/eduserver/input" "github.com/matrix-org/dendrite/eduserver/inthttp" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" - "github.com/matrix-org/dendrite/internal/setup/kafka" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/kafka" userapi "github.com/matrix-org/dendrite/userapi/api" ) diff --git a/federationapi/federationapi.go b/federationapi/federationapi.go index 944e2797c..350d58538 100644 --- a/federationapi/federationapi.go +++ b/federationapi/federationapi.go @@ -18,9 +18,9 @@ import ( "github.com/gorilla/mux" eduserverAPI "github.com/matrix-org/dendrite/eduserver/api" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" keyserverAPI "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/federationapi/routing" diff --git a/federationapi/federationapi_test.go b/federationapi/federationapi_test.go index 00101fe95..aed47a362 100644 --- a/federationapi/federationapi_test.go +++ b/federationapi/federationapi_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/matrix-org/dendrite/federationapi" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/internal/test" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrix" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/federationapi/routing/backfill.go b/federationapi/routing/backfill.go index 717289a2a..31005209f 100644 --- a/federationapi/routing/backfill.go +++ b/federationapi/routing/backfill.go @@ -22,8 +22,8 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" ) diff --git a/federationapi/routing/invite.go b/federationapi/routing/invite.go index 54f9e6848..8795118ee 100644 --- a/federationapi/routing/invite.go +++ b/federationapi/routing/invite.go @@ -21,9 +21,9 @@ import ( "net/http" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" roomserverVersion "github.com/matrix-org/dendrite/roomserver/version" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" ) diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index c8e7e627b..3afc8d5e1 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -21,9 +21,9 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" ) diff --git a/federationapi/routing/keys.go b/federationapi/routing/keys.go index 4779bcb2b..1f39094bc 100644 --- a/federationapi/routing/keys.go +++ b/federationapi/routing/keys.go @@ -22,8 +22,8 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/keyserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" "github.com/sirupsen/logrus" diff --git a/federationapi/routing/leave.go b/federationapi/routing/leave.go index 498532de0..1a8542618 100644 --- a/federationapi/routing/leave.go +++ b/federationapi/routing/leave.go @@ -17,9 +17,9 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" ) diff --git a/federationapi/routing/profile.go b/federationapi/routing/profile.go index f1d90bbf4..dbc209ce1 100644 --- a/federationapi/routing/profile.go +++ b/federationapi/routing/profile.go @@ -19,8 +19,8 @@ import ( "net/http" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/federationapi/routing/query.go b/federationapi/routing/query.go index 99b5460bc..6c25b4d3f 100644 --- a/federationapi/routing/query.go +++ b/federationapi/routing/query.go @@ -20,8 +20,8 @@ import ( "github.com/matrix-org/dendrite/clientapi/jsonerror" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrix" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index 06ed57af6..c957e26d0 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -21,10 +21,10 @@ import ( "github.com/matrix-org/dendrite/clientapi/jsonerror" eduserverAPI "github.com/matrix-org/dendrite/eduserver/api" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" keyserverAPI "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index a3011b500..f50b9c3d6 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -25,9 +25,9 @@ import ( "github.com/matrix-org/dendrite/clientapi/jsonerror" eduserverAPI "github.com/matrix-org/dendrite/eduserver/api" - "github.com/matrix-org/dendrite/internal/config" keyapi "github.com/matrix-org/dendrite/keyserver/api" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" "github.com/sirupsen/logrus" diff --git a/federationapi/routing/threepid.go b/federationapi/routing/threepid.go index ed6af526e..5ba28881c 100644 --- a/federationapi/routing/threepid.go +++ b/federationapi/routing/threepid.go @@ -23,8 +23,8 @@ import ( "github.com/matrix-org/dendrite/clientapi/httputil" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" diff --git a/federationsender/consumers/eduserver.go b/federationsender/consumers/eduserver.go index 9d7574e68..6d11eb88a 100644 --- a/federationsender/consumers/eduserver.go +++ b/federationsender/consumers/eduserver.go @@ -24,7 +24,7 @@ import ( "github.com/matrix-org/dendrite/federationsender/queue" "github.com/matrix-org/dendrite/federationsender/storage" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" log "github.com/sirupsen/logrus" diff --git a/federationsender/consumers/keychange.go b/federationsender/consumers/keychange.go index 28244e923..5006ac28d 100644 --- a/federationsender/consumers/keychange.go +++ b/federationsender/consumers/keychange.go @@ -23,9 +23,9 @@ import ( "github.com/matrix-org/dendrite/federationsender/queue" "github.com/matrix-org/dendrite/federationsender/storage" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" log "github.com/sirupsen/logrus" ) diff --git a/federationsender/consumers/roomserver.go b/federationsender/consumers/roomserver.go index 873c1e981..13c415bc7 100644 --- a/federationsender/consumers/roomserver.go +++ b/federationsender/consumers/roomserver.go @@ -24,8 +24,8 @@ import ( "github.com/matrix-org/dendrite/federationsender/storage" "github.com/matrix-org/dendrite/federationsender/types" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" log "github.com/sirupsen/logrus" ) diff --git a/federationsender/federationsender.go b/federationsender/federationsender.go index 7b75cb372..fc0ba6d5f 100644 --- a/federationsender/federationsender.go +++ b/federationsender/federationsender.go @@ -23,9 +23,9 @@ import ( "github.com/matrix-org/dendrite/federationsender/queue" "github.com/matrix-org/dendrite/federationsender/statistics" "github.com/matrix-org/dendrite/federationsender/storage" - "github.com/matrix-org/dendrite/internal/setup" - "github.com/matrix-org/dendrite/internal/setup/kafka" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/kafka" "github.com/matrix-org/gomatrixserverlib" "github.com/sirupsen/logrus" ) diff --git a/federationsender/internal/api.go b/federationsender/internal/api.go index 31617045e..a14cf3caa 100644 --- a/federationsender/internal/api.go +++ b/federationsender/internal/api.go @@ -9,8 +9,8 @@ import ( "github.com/matrix-org/dendrite/federationsender/queue" "github.com/matrix-org/dendrite/federationsender/statistics" "github.com/matrix-org/dendrite/federationsender/storage" - "github.com/matrix-org/dendrite/internal/config" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrix" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/federationsender/storage/postgres/storage.go b/federationsender/storage/postgres/storage.go index b3b4da398..f314f8493 100644 --- a/federationsender/storage/postgres/storage.go +++ b/federationsender/storage/postgres/storage.go @@ -19,8 +19,8 @@ import ( "database/sql" "github.com/matrix-org/dendrite/federationsender/storage/shared" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" ) // Database stores information needed by the federation sender diff --git a/federationsender/storage/sqlite3/storage.go b/federationsender/storage/sqlite3/storage.go index ba467f026..4f663f645 100644 --- a/federationsender/storage/sqlite3/storage.go +++ b/federationsender/storage/sqlite3/storage.go @@ -21,8 +21,8 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/matrix-org/dendrite/federationsender/storage/shared" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" ) // Database stores information needed by the federation sender diff --git a/federationsender/storage/storage.go b/federationsender/storage/storage.go index 1380fefd1..f36138229 100644 --- a/federationsender/storage/storage.go +++ b/federationsender/storage/storage.go @@ -21,7 +21,7 @@ import ( "github.com/matrix-org/dendrite/federationsender/storage/postgres" "github.com/matrix-org/dendrite/federationsender/storage/sqlite3" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) // NewDatabase opens a new database diff --git a/federationsender/storage/storage_wasm.go b/federationsender/storage/storage_wasm.go index 459329e97..c35b4828c 100644 --- a/federationsender/storage/storage_wasm.go +++ b/federationsender/storage/storage_wasm.go @@ -18,7 +18,7 @@ import ( "fmt" "github.com/matrix-org/dendrite/federationsender/storage/sqlite3" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) // NewDatabase opens a new database diff --git a/internal/eventutil/events.go b/internal/eventutil/events.go index a650b4b3a..b8691c50d 100644 --- a/internal/eventutil/events.go +++ b/internal/eventutil/events.go @@ -20,8 +20,8 @@ import ( "fmt" "time" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/internal/log.go b/internal/log.go index fd2b84ab9..0f374bd4a 100644 --- a/internal/log.go +++ b/internal/log.go @@ -27,7 +27,7 @@ import ( "github.com/matrix-org/util" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dugong" "github.com/sirupsen/logrus" ) diff --git a/internal/sqlutil/migrate.go b/internal/sqlutil/migrate.go index 833977ba4..62b1c8fad 100644 --- a/internal/sqlutil/migrate.go +++ b/internal/sqlutil/migrate.go @@ -6,7 +6,7 @@ import ( "runtime" "sort" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/pressly/goose" ) diff --git a/internal/sqlutil/trace.go b/internal/sqlutil/trace.go index 0684e92e1..ad0044559 100644 --- a/internal/sqlutil/trace.go +++ b/internal/sqlutil/trace.go @@ -28,7 +28,7 @@ import ( "sync" "time" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/ngrok/sqlmw" "github.com/sirupsen/logrus" ) diff --git a/internal/sqlutil/uri.go b/internal/sqlutil/uri.go index e2c825d9d..44910f4a9 100644 --- a/internal/sqlutil/uri.go +++ b/internal/sqlutil/uri.go @@ -19,7 +19,7 @@ import ( "fmt" "net/url" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) // ParseFileURI returns the filepath in the given file: URI. Specifically, this will handle diff --git a/internal/test/config.go b/internal/test/config.go index 69fc5a873..7e68d6d2e 100644 --- a/internal/test/config.go +++ b/internal/test/config.go @@ -28,7 +28,7 @@ import ( "strings" "time" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "gopkg.in/yaml.v2" ) diff --git a/internal/test/server.go b/internal/test/server.go index ed4e7e28e..ca14ea1bf 100644 --- a/internal/test/server.go +++ b/internal/test/server.go @@ -26,7 +26,7 @@ import ( "sync" "testing" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" ) // Defaulting allows assignment of string variables with a fallback default value diff --git a/keyserver/keyserver.go b/keyserver/keyserver.go index 6c54d2a08..7e8fc2e0d 100644 --- a/keyserver/keyserver.go +++ b/keyserver/keyserver.go @@ -17,13 +17,13 @@ package keyserver import ( "github.com/gorilla/mux" fedsenderapi "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup/kafka" "github.com/matrix-org/dendrite/keyserver/api" "github.com/matrix-org/dendrite/keyserver/internal" "github.com/matrix-org/dendrite/keyserver/inthttp" "github.com/matrix-org/dendrite/keyserver/producers" "github.com/matrix-org/dendrite/keyserver/storage" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/kafka" "github.com/sirupsen/logrus" ) diff --git a/keyserver/storage/postgres/storage.go b/keyserver/storage/postgres/storage.go index 783303c0e..cb16ffaa7 100644 --- a/keyserver/storage/postgres/storage.go +++ b/keyserver/storage/postgres/storage.go @@ -15,9 +15,9 @@ package postgres import ( - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" "github.com/matrix-org/dendrite/keyserver/storage/shared" + "github.com/matrix-org/dendrite/setup/config" ) // NewDatabase creates a new sync server database diff --git a/keyserver/storage/sqlite3/storage.go b/keyserver/storage/sqlite3/storage.go index 1d5382c06..ca1e7560c 100644 --- a/keyserver/storage/sqlite3/storage.go +++ b/keyserver/storage/sqlite3/storage.go @@ -15,9 +15,9 @@ package sqlite3 import ( - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" "github.com/matrix-org/dendrite/keyserver/storage/shared" + "github.com/matrix-org/dendrite/setup/config" ) func NewDatabase(dbProperties *config.DatabaseOptions) (*shared.Database, error) { diff --git a/keyserver/storage/storage.go b/keyserver/storage/storage.go index e1deaf93d..8f05d0030 100644 --- a/keyserver/storage/storage.go +++ b/keyserver/storage/storage.go @@ -19,9 +19,9 @@ package storage import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/keyserver/storage/postgres" "github.com/matrix-org/dendrite/keyserver/storage/sqlite3" + "github.com/matrix-org/dendrite/setup/config" ) // NewDatabase opens a new Postgres or Sqlite database (based on dataSourceName scheme) diff --git a/keyserver/storage/storage_test.go b/keyserver/storage/storage_test.go index 358f11e75..afdb086de 100644 --- a/keyserver/storage/storage_test.go +++ b/keyserver/storage/storage_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/Shopify/sarama" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/keyserver/api" + "github.com/matrix-org/dendrite/setup/config" ) var ctx = context.Background() diff --git a/keyserver/storage/storage_wasm.go b/keyserver/storage/storage_wasm.go index 792cd4a59..8b31bfd01 100644 --- a/keyserver/storage/storage_wasm.go +++ b/keyserver/storage/storage_wasm.go @@ -17,8 +17,8 @@ package storage import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/keyserver/storage/sqlite3" + "github.com/matrix-org/dendrite/setup/config" ) func NewDatabase(dbProperties *config.DatabaseOptions) (Database, error) { diff --git a/mediaapi/fileutils/fileutils.go b/mediaapi/fileutils/fileutils.go index 92ce64001..df19eee4a 100644 --- a/mediaapi/fileutils/fileutils.go +++ b/mediaapi/fileutils/fileutils.go @@ -26,8 +26,8 @@ import ( "path/filepath" "strings" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/util" log "github.com/sirupsen/logrus" ) diff --git a/mediaapi/mediaapi.go b/mediaapi/mediaapi.go index 1c14559f5..811d8e4a4 100644 --- a/mediaapi/mediaapi.go +++ b/mediaapi/mediaapi.go @@ -16,9 +16,9 @@ package mediaapi import ( "github.com/gorilla/mux" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/routing" "github.com/matrix-org/dendrite/mediaapi/storage" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/sirupsen/logrus" diff --git a/mediaapi/routing/download.go b/mediaapi/routing/download.go index be0419048..8ea1b97f7 100644 --- a/mediaapi/routing/download.go +++ b/mediaapi/routing/download.go @@ -31,11 +31,11 @@ import ( "unicode" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/fileutils" "github.com/matrix-org/dendrite/mediaapi/storage" "github.com/matrix-org/dendrite/mediaapi/thumbnailer" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" "github.com/pkg/errors" diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go index 4b6d2fd75..917a85964 100644 --- a/mediaapi/routing/routing.go +++ b/mediaapi/routing/routing.go @@ -21,10 +21,10 @@ import ( userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/gorilla/mux" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" "github.com/matrix-org/dendrite/mediaapi/storage" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" "github.com/prometheus/client_golang/prometheus" diff --git a/mediaapi/routing/upload.go b/mediaapi/routing/upload.go index 1724ad255..1dcf4e17b 100644 --- a/mediaapi/routing/upload.go +++ b/mediaapi/routing/upload.go @@ -26,11 +26,11 @@ import ( "strings" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/fileutils" "github.com/matrix-org/dendrite/mediaapi/storage" "github.com/matrix-org/dendrite/mediaapi/thumbnailer" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/mediaapi/storage/postgres/storage.go b/mediaapi/storage/postgres/storage.go index f89501de2..61ad468fe 100644 --- a/mediaapi/storage/postgres/storage.go +++ b/mediaapi/storage/postgres/storage.go @@ -21,9 +21,9 @@ import ( // Import the postgres database driver. _ "github.com/lib/pq" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/mediaapi/storage/sqlite3/storage.go b/mediaapi/storage/sqlite3/storage.go index 9e510fa39..0edfc08e8 100644 --- a/mediaapi/storage/sqlite3/storage.go +++ b/mediaapi/storage/sqlite3/storage.go @@ -20,9 +20,9 @@ import ( "database/sql" // Import the postgres database driver. - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" _ "github.com/mattn/go-sqlite3" ) diff --git a/mediaapi/storage/storage.go b/mediaapi/storage/storage.go index 829d47b36..a976f795b 100644 --- a/mediaapi/storage/storage.go +++ b/mediaapi/storage/storage.go @@ -19,9 +19,9 @@ package storage import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/storage/postgres" "github.com/matrix-org/dendrite/mediaapi/storage/sqlite3" + "github.com/matrix-org/dendrite/setup/config" ) // Open opens a postgres database. diff --git a/mediaapi/storage/storage_wasm.go b/mediaapi/storage/storage_wasm.go index 6b5de681b..a6e997b2a 100644 --- a/mediaapi/storage/storage_wasm.go +++ b/mediaapi/storage/storage_wasm.go @@ -17,8 +17,8 @@ package storage import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/storage/sqlite3" + "github.com/matrix-org/dendrite/setup/config" ) // Open opens a postgres database. diff --git a/mediaapi/thumbnailer/thumbnailer.go b/mediaapi/thumbnailer/thumbnailer.go index 9a58b5bc1..58407ce8b 100644 --- a/mediaapi/thumbnailer/thumbnailer.go +++ b/mediaapi/thumbnailer/thumbnailer.go @@ -22,9 +22,9 @@ import ( "path/filepath" "sync" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/storage" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" log "github.com/sirupsen/logrus" ) diff --git a/mediaapi/thumbnailer/thumbnailer_bimg.go b/mediaapi/thumbnailer/thumbnailer_bimg.go index 915d576e3..087385a76 100644 --- a/mediaapi/thumbnailer/thumbnailer_bimg.go +++ b/mediaapi/thumbnailer/thumbnailer_bimg.go @@ -21,9 +21,9 @@ import ( "os" "time" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/storage" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" log "github.com/sirupsen/logrus" "gopkg.in/h2non/bimg.v1" ) diff --git a/mediaapi/thumbnailer/thumbnailer_nfnt.go b/mediaapi/thumbnailer/thumbnailer_nfnt.go index b48551e4e..aa9faf4c1 100644 --- a/mediaapi/thumbnailer/thumbnailer_nfnt.go +++ b/mediaapi/thumbnailer/thumbnailer_nfnt.go @@ -30,9 +30,9 @@ import ( "os" "time" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/mediaapi/storage" "github.com/matrix-org/dendrite/mediaapi/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/nfnt/resize" log "github.com/sirupsen/logrus" ) diff --git a/mediaapi/types/types.go b/mediaapi/types/types.go index 9fa549509..0ba7010ad 100644 --- a/mediaapi/types/types.go +++ b/mediaapi/types/types.go @@ -17,7 +17,7 @@ package types import ( "sync" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/roomserver/internal/api.go b/roomserver/internal/api.go index 443cc6b38..c825c13d4 100644 --- a/roomserver/internal/api.go +++ b/roomserver/internal/api.go @@ -6,13 +6,13 @@ import ( "github.com/Shopify/sarama" fsAPI "github.com/matrix-org/dendrite/federationsender/api" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/acls" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/internal/input" "github.com/matrix-org/dendrite/roomserver/internal/perform" "github.com/matrix-org/dendrite/roomserver/internal/query" "github.com/matrix-org/dendrite/roomserver/storage" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/roomserver/internal/perform/perform_invite.go b/roomserver/internal/perform/perform_invite.go index 0fb6ddd44..085cb02ed 100644 --- a/roomserver/internal/perform/perform_invite.go +++ b/roomserver/internal/perform/perform_invite.go @@ -19,13 +19,13 @@ import ( "fmt" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/internal/helpers" "github.com/matrix-org/dendrite/roomserver/internal/input" "github.com/matrix-org/dendrite/roomserver/state" "github.com/matrix-org/dendrite/roomserver/storage" "github.com/matrix-org/dendrite/roomserver/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" log "github.com/sirupsen/logrus" ) diff --git a/roomserver/internal/perform/perform_join.go b/roomserver/internal/perform/perform_join.go index f3745a7ff..8eb6b648e 100644 --- a/roomserver/internal/perform/perform_join.go +++ b/roomserver/internal/perform/perform_join.go @@ -22,12 +22,12 @@ import ( "time" fsAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/internal/helpers" "github.com/matrix-org/dendrite/roomserver/internal/input" "github.com/matrix-org/dendrite/roomserver/storage" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/sirupsen/logrus" ) diff --git a/roomserver/internal/perform/perform_leave.go b/roomserver/internal/perform/perform_leave.go index 6aaf1bf3e..9d7c0816d 100644 --- a/roomserver/internal/perform/perform_leave.go +++ b/roomserver/internal/perform/perform_leave.go @@ -20,11 +20,11 @@ import ( "strings" fsAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/internal/helpers" "github.com/matrix-org/dendrite/roomserver/internal/input" "github.com/matrix-org/dendrite/roomserver/storage" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/roomserver/internal/perform/perform_peek.go b/roomserver/internal/perform/perform_peek.go index ab6d17b03..66d1bdb21 100644 --- a/roomserver/internal/perform/perform_peek.go +++ b/roomserver/internal/perform/perform_peek.go @@ -21,10 +21,10 @@ import ( "strings" fsAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/internal/input" "github.com/matrix-org/dendrite/roomserver/storage" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" "github.com/sirupsen/logrus" diff --git a/roomserver/roomserver.go b/roomserver/roomserver.go index b2cc0728c..396a1defa 100644 --- a/roomserver/roomserver.go +++ b/roomserver/roomserver.go @@ -20,11 +20,11 @@ import ( "github.com/matrix-org/dendrite/roomserver/inthttp" "github.com/matrix-org/gomatrixserverlib" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" - "github.com/matrix-org/dendrite/internal/setup/kafka" "github.com/matrix-org/dendrite/roomserver/internal" "github.com/matrix-org/dendrite/roomserver/storage" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/kafka" "github.com/sirupsen/logrus" ) diff --git a/roomserver/roomserver_test.go b/roomserver/roomserver_test.go index 7638f3f3e..5c9540071 100644 --- a/roomserver/roomserver_test.go +++ b/roomserver/roomserver_test.go @@ -13,12 +13,12 @@ import ( "github.com/Shopify/sarama" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup" "github.com/matrix-org/dendrite/internal/test" "github.com/matrix-org/dendrite/roomserver/api" "github.com/matrix-org/dendrite/roomserver/internal" "github.com/matrix-org/dendrite/roomserver/storage" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" "github.com/sirupsen/logrus" ) diff --git a/roomserver/storage/postgres/storage.go b/roomserver/storage/postgres/storage.go index 37aca647c..bb3f841d0 100644 --- a/roomserver/storage/postgres/storage.go +++ b/roomserver/storage/postgres/storage.go @@ -22,10 +22,10 @@ import ( _ "github.com/lib/pq" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" "github.com/matrix-org/dendrite/roomserver/storage/postgres/deltas" "github.com/matrix-org/dendrite/roomserver/storage/shared" + "github.com/matrix-org/dendrite/setup/config" ) // A Database is used to store room events and stream offsets. diff --git a/roomserver/storage/sqlite3/storage.go b/roomserver/storage/sqlite3/storage.go index b36930206..8e608a6db 100644 --- a/roomserver/storage/sqlite3/storage.go +++ b/roomserver/storage/sqlite3/storage.go @@ -22,11 +22,11 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" "github.com/matrix-org/dendrite/roomserver/storage/shared" "github.com/matrix-org/dendrite/roomserver/storage/sqlite3/deltas" "github.com/matrix-org/dendrite/roomserver/types" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/roomserver/storage/storage.go b/roomserver/storage/storage.go index cfbb7b554..9359312db 100644 --- a/roomserver/storage/storage.go +++ b/roomserver/storage/storage.go @@ -20,9 +20,9 @@ import ( "fmt" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/storage/postgres" "github.com/matrix-org/dendrite/roomserver/storage/sqlite3" + "github.com/matrix-org/dendrite/setup/config" ) // Open opens a database connection. diff --git a/roomserver/storage/storage_wasm.go b/roomserver/storage/storage_wasm.go index 28e285461..dfc374e6e 100644 --- a/roomserver/storage/storage_wasm.go +++ b/roomserver/storage/storage_wasm.go @@ -18,8 +18,8 @@ import ( "fmt" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/storage/sqlite3" + "github.com/matrix-org/dendrite/setup/config" ) // NewPublicRoomsServerDatabase opens a database connection. diff --git a/internal/setup/base.go b/setup/base.go similarity index 99% rename from internal/setup/base.go rename to setup/base.go index 1820778ad..acbf2d35f 100644 --- a/internal/setup/base.go +++ b/setup/base.go @@ -41,11 +41,11 @@ import ( eduinthttp "github.com/matrix-org/dendrite/eduserver/inthttp" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" fsinthttp "github.com/matrix-org/dendrite/federationsender/inthttp" - "github.com/matrix-org/dendrite/internal/config" keyserverAPI "github.com/matrix-org/dendrite/keyserver/api" keyinthttp "github.com/matrix-org/dendrite/keyserver/inthttp" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" rsinthttp "github.com/matrix-org/dendrite/roomserver/inthttp" + "github.com/matrix-org/dendrite/setup/config" skapi "github.com/matrix-org/dendrite/signingkeyserver/api" skinthttp "github.com/matrix-org/dendrite/signingkeyserver/inthttp" userapi "github.com/matrix-org/dendrite/userapi/api" diff --git a/internal/config/config.go b/setup/config/config.go similarity index 100% rename from internal/config/config.go rename to setup/config/config.go diff --git a/internal/config/config_appservice.go b/setup/config/config_appservice.go similarity index 100% rename from internal/config/config_appservice.go rename to setup/config/config_appservice.go diff --git a/internal/config/config_clientapi.go b/setup/config/config_clientapi.go similarity index 100% rename from internal/config/config_clientapi.go rename to setup/config/config_clientapi.go diff --git a/internal/config/config_eduserver.go b/setup/config/config_eduserver.go similarity index 100% rename from internal/config/config_eduserver.go rename to setup/config/config_eduserver.go diff --git a/internal/config/config_federationapi.go b/setup/config/config_federationapi.go similarity index 100% rename from internal/config/config_federationapi.go rename to setup/config/config_federationapi.go diff --git a/internal/config/config_federationsender.go b/setup/config/config_federationsender.go similarity index 100% rename from internal/config/config_federationsender.go rename to setup/config/config_federationsender.go diff --git a/internal/config/config_global.go b/setup/config/config_global.go similarity index 100% rename from internal/config/config_global.go rename to setup/config/config_global.go diff --git a/internal/config/config_kafka.go b/setup/config/config_kafka.go similarity index 100% rename from internal/config/config_kafka.go rename to setup/config/config_kafka.go diff --git a/internal/config/config_keyserver.go b/setup/config/config_keyserver.go similarity index 100% rename from internal/config/config_keyserver.go rename to setup/config/config_keyserver.go diff --git a/internal/config/config_mediaapi.go b/setup/config/config_mediaapi.go similarity index 100% rename from internal/config/config_mediaapi.go rename to setup/config/config_mediaapi.go diff --git a/internal/config/config_mscs.go b/setup/config/config_mscs.go similarity index 100% rename from internal/config/config_mscs.go rename to setup/config/config_mscs.go diff --git a/internal/config/config_roomserver.go b/setup/config/config_roomserver.go similarity index 100% rename from internal/config/config_roomserver.go rename to setup/config/config_roomserver.go diff --git a/internal/config/config_signingkeyserver.go b/setup/config/config_signingkeyserver.go similarity index 100% rename from internal/config/config_signingkeyserver.go rename to setup/config/config_signingkeyserver.go diff --git a/internal/config/config_syncapi.go b/setup/config/config_syncapi.go similarity index 100% rename from internal/config/config_syncapi.go rename to setup/config/config_syncapi.go diff --git a/internal/config/config_test.go b/setup/config/config_test.go similarity index 100% rename from internal/config/config_test.go rename to setup/config/config_test.go diff --git a/internal/config/config_userapi.go b/setup/config/config_userapi.go similarity index 100% rename from internal/config/config_userapi.go rename to setup/config/config_userapi.go diff --git a/internal/setup/federation.go b/setup/federation.go similarity index 100% rename from internal/setup/federation.go rename to setup/federation.go diff --git a/internal/setup/flags.go b/setup/flags.go similarity index 96% rename from internal/setup/flags.go rename to setup/flags.go index c6ecb5cd1..281cf3392 100644 --- a/internal/setup/flags.go +++ b/setup/flags.go @@ -20,7 +20,7 @@ import ( "os" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/sirupsen/logrus" ) diff --git a/internal/setup/kafka/kafka.go b/setup/kafka/kafka.go similarity index 97% rename from internal/setup/kafka/kafka.go rename to setup/kafka/kafka.go index 091025ec7..a2902c962 100644 --- a/internal/setup/kafka/kafka.go +++ b/setup/kafka/kafka.go @@ -2,7 +2,7 @@ package kafka import ( "github.com/Shopify/sarama" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/naffka" naffkaStorage "github.com/matrix-org/naffka/storage" "github.com/sirupsen/logrus" diff --git a/internal/setup/monolith.go b/setup/monolith.go similarity index 98% rename from internal/setup/monolith.go rename to setup/monolith.go index 9d3625d2f..2403f57fa 100644 --- a/internal/setup/monolith.go +++ b/setup/monolith.go @@ -22,11 +22,11 @@ import ( eduServerAPI "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/dendrite/federationapi" federationSenderAPI "github.com/matrix-org/dendrite/federationsender/api" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/transactions" keyAPI "github.com/matrix-org/dendrite/keyserver/api" "github.com/matrix-org/dendrite/mediaapi" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" serverKeyAPI "github.com/matrix-org/dendrite/signingkeyserver/api" "github.com/matrix-org/dendrite/syncapi" userapi "github.com/matrix-org/dendrite/userapi/api" diff --git a/internal/mscs/msc2836/msc2836.go b/setup/mscs/msc2836/msc2836.go similarity index 99% rename from internal/mscs/msc2836/msc2836.go rename to setup/mscs/msc2836/msc2836.go index 865bc3111..33a65c8f4 100644 --- a/internal/mscs/msc2836/msc2836.go +++ b/setup/mscs/msc2836/msc2836.go @@ -28,8 +28,8 @@ import ( fs "github.com/matrix-org/dendrite/federationsender/api" "github.com/matrix-org/dendrite/internal/hooks" "github.com/matrix-org/dendrite/internal/httputil" - "github.com/matrix-org/dendrite/internal/setup" roomserver "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/util" diff --git a/internal/mscs/msc2836/msc2836_test.go b/setup/mscs/msc2836/msc2836_test.go similarity index 99% rename from internal/mscs/msc2836/msc2836_test.go rename to setup/mscs/msc2836/msc2836_test.go index 265d6ee67..996cc79f0 100644 --- a/internal/mscs/msc2836/msc2836_test.go +++ b/setup/mscs/msc2836/msc2836_test.go @@ -12,12 +12,12 @@ import ( "time" "github.com/gorilla/mux" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/hooks" "github.com/matrix-org/dendrite/internal/httputil" - "github.com/matrix-org/dendrite/internal/mscs/msc2836" - "github.com/matrix-org/dendrite/internal/setup" roomserver "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/mscs/msc2836" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/internal/mscs/msc2836/storage.go b/setup/mscs/msc2836/storage.go similarity index 99% rename from internal/mscs/msc2836/storage.go rename to setup/mscs/msc2836/storage.go index f524165fa..72ea5195b 100644 --- a/internal/mscs/msc2836/storage.go +++ b/setup/mscs/msc2836/storage.go @@ -5,8 +5,8 @@ import ( "database/sql" "encoding/json" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/internal/mscs/mscs.go b/setup/mscs/mscs.go similarity index 92% rename from internal/mscs/mscs.go rename to setup/mscs/mscs.go index 0a896ab0f..8b0498ced 100644 --- a/internal/mscs/mscs.go +++ b/setup/mscs/mscs.go @@ -18,8 +18,8 @@ package mscs import ( "fmt" - "github.com/matrix-org/dendrite/internal/mscs/msc2836" - "github.com/matrix-org/dendrite/internal/setup" + "github.com/matrix-org/dendrite/setup" + "github.com/matrix-org/dendrite/setup/mscs/msc2836" ) // Enable MSCs - returns an error on unknown MSCs diff --git a/signingkeyserver/internal/api.go b/signingkeyserver/internal/api.go index 4a1dd29e7..f9a04a74f 100644 --- a/signingkeyserver/internal/api.go +++ b/signingkeyserver/internal/api.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/signingkeyserver/api" "github.com/matrix-org/gomatrixserverlib" "github.com/sirupsen/logrus" diff --git a/signingkeyserver/serverkeyapi_test.go b/signingkeyserver/serverkeyapi_test.go index e5578f43c..e59deb4d7 100644 --- a/signingkeyserver/serverkeyapi_test.go +++ b/signingkeyserver/serverkeyapi_test.go @@ -15,7 +15,7 @@ import ( "github.com/matrix-org/dendrite/federationapi/routing" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/signingkeyserver/api" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/signingkeyserver/signingkeyserver.go b/signingkeyserver/signingkeyserver.go index 27b4c7035..2b1d6751f 100644 --- a/signingkeyserver/signingkeyserver.go +++ b/signingkeyserver/signingkeyserver.go @@ -6,7 +6,7 @@ import ( "github.com/gorilla/mux" "github.com/matrix-org/dendrite/internal/caching" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/signingkeyserver/api" "github.com/matrix-org/dendrite/signingkeyserver/internal" "github.com/matrix-org/dendrite/signingkeyserver/inthttp" diff --git a/signingkeyserver/storage/keydb.go b/signingkeyserver/storage/keydb.go index ef1077fc9..aa247f1d8 100644 --- a/signingkeyserver/storage/keydb.go +++ b/signingkeyserver/storage/keydb.go @@ -21,7 +21,7 @@ import ( "golang.org/x/crypto/ed25519" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/signingkeyserver/storage/postgres" "github.com/matrix-org/dendrite/signingkeyserver/storage/sqlite3" "github.com/matrix-org/gomatrixserverlib" diff --git a/signingkeyserver/storage/postgres/keydb.go b/signingkeyserver/storage/postgres/keydb.go index 634440859..1b3032de5 100644 --- a/signingkeyserver/storage/postgres/keydb.go +++ b/signingkeyserver/storage/postgres/keydb.go @@ -20,8 +20,8 @@ import ( "golang.org/x/crypto/ed25519" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/signingkeyserver/storage/sqlite3/keydb.go b/signingkeyserver/storage/sqlite3/keydb.go index 0ee74bc10..8825d6973 100644 --- a/signingkeyserver/storage/sqlite3/keydb.go +++ b/signingkeyserver/storage/sqlite3/keydb.go @@ -20,8 +20,8 @@ import ( "golang.org/x/crypto/ed25519" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/gomatrixserverlib" _ "github.com/mattn/go-sqlite3" diff --git a/syncapi/consumers/clientapi.go b/syncapi/consumers/clientapi.go index d03dd2c46..7070dd320 100644 --- a/syncapi/consumers/clientapi.go +++ b/syncapi/consumers/clientapi.go @@ -20,8 +20,8 @@ import ( "github.com/Shopify/sarama" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/eventutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/sync" "github.com/matrix-org/dendrite/syncapi/types" diff --git a/syncapi/consumers/eduserver_receipts.go b/syncapi/consumers/eduserver_receipts.go index c5d17414a..3361e1347 100644 --- a/syncapi/consumers/eduserver_receipts.go +++ b/syncapi/consumers/eduserver_receipts.go @@ -23,7 +23,7 @@ import ( "github.com/Shopify/sarama" "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/sync" log "github.com/sirupsen/logrus" diff --git a/syncapi/consumers/eduserver_sendtodevice.go b/syncapi/consumers/eduserver_sendtodevice.go index f880f3f20..07324fcd7 100644 --- a/syncapi/consumers/eduserver_sendtodevice.go +++ b/syncapi/consumers/eduserver_sendtodevice.go @@ -21,7 +21,7 @@ import ( "github.com/Shopify/sarama" "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/sync" "github.com/matrix-org/dendrite/syncapi/types" diff --git a/syncapi/consumers/eduserver_typing.go b/syncapi/consumers/eduserver_typing.go index 80d1d000b..bdea606cb 100644 --- a/syncapi/consumers/eduserver_typing.go +++ b/syncapi/consumers/eduserver_typing.go @@ -20,7 +20,7 @@ import ( "github.com/Shopify/sarama" "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/sync" "github.com/matrix-org/dendrite/syncapi/types" diff --git a/syncapi/consumers/roomserver.go b/syncapi/consumers/roomserver.go index 05f32a83a..4d453f133 100644 --- a/syncapi/consumers/roomserver.go +++ b/syncapi/consumers/roomserver.go @@ -21,8 +21,8 @@ import ( "github.com/Shopify/sarama" "github.com/matrix-org/dendrite/internal" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/sync" "github.com/matrix-org/dendrite/syncapi/types" diff --git a/syncapi/internal/keychange_test.go b/syncapi/internal/keychange_test.go index c25011814..adf498d2d 100644 --- a/syncapi/internal/keychange_test.go +++ b/syncapi/internal/keychange_test.go @@ -18,7 +18,7 @@ var ( syncingUser = "@alice:localhost" emptyToken = types.NewStreamToken(0, 0, nil) newestToken = types.NewStreamToken(0, 0, map[string]*types.LogPosition{ - DeviceListLogName: &types.LogPosition{ + DeviceListLogName: { Offset: sarama.OffsetNewest, Partition: 0, }, diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go index 81a7857fc..92f36e23b 100644 --- a/syncapi/routing/messages.go +++ b/syncapi/routing/messages.go @@ -22,8 +22,8 @@ import ( "strconv" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/types" userapi "github.com/matrix-org/dendrite/userapi/api" diff --git a/syncapi/routing/routing.go b/syncapi/routing/routing.go index 141eec799..20152b48f 100644 --- a/syncapi/routing/routing.go +++ b/syncapi/routing/routing.go @@ -18,9 +18,9 @@ import ( "net/http" "github.com/gorilla/mux" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/sync" userapi "github.com/matrix-org/dendrite/userapi/api" diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go index 979e19a0b..a77c0ec08 100644 --- a/syncapi/storage/postgres/syncserver.go +++ b/syncapi/storage/postgres/syncserver.go @@ -21,8 +21,8 @@ import ( // Import the postgres database driver. _ "github.com/lib/pq" "github.com/matrix-org/dendrite/eduserver/cache" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage/shared" ) diff --git a/syncapi/storage/sqlite3/syncserver.go b/syncapi/storage/sqlite3/syncserver.go index 036e2b2e5..7df71b384 100644 --- a/syncapi/storage/sqlite3/syncserver.go +++ b/syncapi/storage/sqlite3/syncserver.go @@ -22,8 +22,8 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/matrix-org/dendrite/eduserver/cache" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage/shared" ) diff --git a/syncapi/storage/storage.go b/syncapi/storage/storage.go index c16dcd810..15386c338 100644 --- a/syncapi/storage/storage.go +++ b/syncapi/storage/storage.go @@ -19,7 +19,7 @@ package storage import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage/postgres" "github.com/matrix-org/dendrite/syncapi/storage/sqlite3" ) diff --git a/syncapi/storage/storage_test.go b/syncapi/storage/storage_test.go index 3930ab6b5..b1b0d2543 100644 --- a/syncapi/storage/storage_test.go +++ b/syncapi/storage/storage_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/storage/sqlite3" "github.com/matrix-org/dendrite/syncapi/types" diff --git a/syncapi/storage/storage_wasm.go b/syncapi/storage/storage_wasm.go index 43b7bbead..f7fef962b 100644 --- a/syncapi/storage/storage_wasm.go +++ b/syncapi/storage/storage_wasm.go @@ -17,7 +17,7 @@ package storage import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/storage/sqlite3" ) diff --git a/syncapi/sync/requestpool.go b/syncapi/sync/requestpool.go index cb84c5bb6..0cb6efe7a 100644 --- a/syncapi/sync/requestpool.go +++ b/syncapi/sync/requestpool.go @@ -26,9 +26,9 @@ import ( "time" "github.com/matrix-org/dendrite/clientapi/jsonerror" - "github.com/matrix-org/dendrite/internal/config" keyapi "github.com/matrix-org/dendrite/keyserver/api" roomserverAPI "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/syncapi/internal" "github.com/matrix-org/dendrite/syncapi/storage" "github.com/matrix-org/dendrite/syncapi/types" diff --git a/syncapi/syncapi.go b/syncapi/syncapi.go index 7e277ba19..0610add53 100644 --- a/syncapi/syncapi.go +++ b/syncapi/syncapi.go @@ -20,10 +20,10 @@ import ( "github.com/gorilla/mux" "github.com/sirupsen/logrus" - "github.com/matrix-org/dendrite/internal/config" - "github.com/matrix-org/dendrite/internal/setup/kafka" keyapi "github.com/matrix-org/dendrite/keyserver/api" "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/dendrite/setup/kafka" userapi "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/gomatrixserverlib" diff --git a/syncapi/types/types_test.go b/syncapi/types/types_test.go index 34c73dc29..62404a606 100644 --- a/syncapi/types/types_test.go +++ b/syncapi/types/types_test.go @@ -10,27 +10,27 @@ import ( func TestNewSyncTokenWithLogs(t *testing.T) { tests := map[string]*StreamingToken{ - "s4_0": &StreamingToken{ + "s4_0": { syncToken: syncToken{Type: "s", Positions: []StreamPosition{4, 0}}, logs: make(map[string]*LogPosition), }, - "s4_0.dl-0-123": &StreamingToken{ + "s4_0.dl-0-123": { syncToken: syncToken{Type: "s", Positions: []StreamPosition{4, 0}}, logs: map[string]*LogPosition{ - "dl": &LogPosition{ + "dl": { Partition: 0, Offset: 123, }, }, }, - "s4_0.ab-1-14419482332.dl-0-123": &StreamingToken{ + "s4_0.ab-1-14419482332.dl-0-123": { syncToken: syncToken{Type: "s", Positions: []StreamPosition{4, 0}}, logs: map[string]*LogPosition{ - "ab": &LogPosition{ + "ab": { Partition: 1, Offset: 14419482332, }, - "dl": &LogPosition{ + "dl": { Partition: 0, Offset: 123, }, diff --git a/userapi/internal/api.go b/userapi/internal/api.go index 3b5f4978a..c1b9bcabf 100644 --- a/userapi/internal/api.go +++ b/userapi/internal/api.go @@ -23,9 +23,9 @@ import ( "github.com/matrix-org/dendrite/appservice/types" "github.com/matrix-org/dendrite/clientapi/userutil" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" keyapi "github.com/matrix-org/dendrite/keyserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts" "github.com/matrix-org/dendrite/userapi/storage/devices" diff --git a/userapi/storage/accounts/postgres/storage.go b/userapi/storage/accounts/postgres/storage.go index 40c4b8ff5..870756d8b 100644 --- a/userapi/storage/accounts/postgres/storage.go +++ b/userapi/storage/accounts/postgres/storage.go @@ -22,8 +22,8 @@ import ( "strconv" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts/postgres/deltas" _ "github.com/matrix-org/dendrite/userapi/storage/accounts/postgres/deltas" diff --git a/userapi/storage/accounts/sqlite3/storage.go b/userapi/storage/accounts/sqlite3/storage.go index 0be7bcbe7..2b621c4ca 100644 --- a/userapi/storage/accounts/sqlite3/storage.go +++ b/userapi/storage/accounts/sqlite3/storage.go @@ -23,8 +23,8 @@ import ( "sync" "github.com/matrix-org/dendrite/clientapi/auth/authtypes" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/accounts/sqlite3/deltas" "github.com/matrix-org/gomatrixserverlib" diff --git a/userapi/storage/accounts/storage.go b/userapi/storage/accounts/storage.go index 57d5f7039..3f69e95f6 100644 --- a/userapi/storage/accounts/storage.go +++ b/userapi/storage/accounts/storage.go @@ -19,7 +19,7 @@ package accounts import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/storage/accounts/postgres" "github.com/matrix-org/dendrite/userapi/storage/accounts/sqlite3" "github.com/matrix-org/gomatrixserverlib" diff --git a/userapi/storage/accounts/storage_wasm.go b/userapi/storage/accounts/storage_wasm.go index ade32b68f..dcaf371a1 100644 --- a/userapi/storage/accounts/storage_wasm.go +++ b/userapi/storage/accounts/storage_wasm.go @@ -17,7 +17,7 @@ package accounts import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/storage/accounts/sqlite3" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/userapi/storage/devices/postgres/storage.go b/userapi/storage/devices/postgres/storage.go index 6dd18b092..485234331 100644 --- a/userapi/storage/devices/postgres/storage.go +++ b/userapi/storage/devices/postgres/storage.go @@ -20,8 +20,8 @@ import ( "database/sql" "encoding/base64" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/devices/postgres/deltas" "github.com/matrix-org/gomatrixserverlib" diff --git a/userapi/storage/devices/sqlite3/storage.go b/userapi/storage/devices/sqlite3/storage.go index 2eefb3f34..8afa9fb46 100644 --- a/userapi/storage/devices/sqlite3/storage.go +++ b/userapi/storage/devices/sqlite3/storage.go @@ -20,8 +20,8 @@ import ( "database/sql" "encoding/base64" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/sqlutil" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/storage/devices/sqlite3/deltas" "github.com/matrix-org/gomatrixserverlib" diff --git a/userapi/storage/devices/storage.go b/userapi/storage/devices/storage.go index 1bd73a9fb..bfce924d9 100644 --- a/userapi/storage/devices/storage.go +++ b/userapi/storage/devices/storage.go @@ -19,7 +19,7 @@ package devices import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/storage/devices/postgres" "github.com/matrix-org/dendrite/userapi/storage/devices/sqlite3" "github.com/matrix-org/gomatrixserverlib" diff --git a/userapi/storage/devices/storage_wasm.go b/userapi/storage/devices/storage_wasm.go index e966c37f3..f360f9857 100644 --- a/userapi/storage/devices/storage_wasm.go +++ b/userapi/storage/devices/storage_wasm.go @@ -17,7 +17,7 @@ package devices import ( "fmt" - "github.com/matrix-org/dendrite/internal/config" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/storage/devices/sqlite3" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/userapi/userapi.go b/userapi/userapi.go index 132491429..b8b826bc8 100644 --- a/userapi/userapi.go +++ b/userapi/userapi.go @@ -16,8 +16,8 @@ package userapi import ( "github.com/gorilla/mux" - "github.com/matrix-org/dendrite/internal/config" keyapi "github.com/matrix-org/dendrite/keyserver/api" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/internal" "github.com/matrix-org/dendrite/userapi/inthttp" diff --git a/userapi/userapi_test.go b/userapi/userapi_test.go index 3fc97d06a..25c262ad1 100644 --- a/userapi/userapi_test.go +++ b/userapi/userapi_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/gorilla/mux" - "github.com/matrix-org/dendrite/internal/config" "github.com/matrix-org/dendrite/internal/httputil" "github.com/matrix-org/dendrite/internal/test" + "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi" "github.com/matrix-org/dendrite/userapi/api" "github.com/matrix-org/dendrite/userapi/inthttp" From 1f3a498601cb70421ee133e336ecb5bfe8affd4b Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 2 Dec 2020 17:46:28 +0000 Subject: [PATCH 04/14] Version 0.3.2 --- CHANGES.md | 12 ++++++++++++ internal/version.go | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index effa5fdd1..f463f29f1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,17 @@ # Changelog +## Dendrite 0.3.2 (2020-12-02) + +### Features + +* Federation can now be disabled with the `global.disable_federation` configuration option + +### Fixes + +* The `"since"` parameter is now checked more thoroughly in the sync API, which led to a bug that could cause forgotten rooms to reappear (contributed by [kaniini](https://github.com/kaniini)) +* The polylith now proxies signing key requests through the federation sender correctly +* The code for checking if remote servers are allowed to see events now no longer wastes CPU time retrieving irrelevant state events + ## Dendrite 0.3.1 (2020-11-20) ### Features diff --git a/internal/version.go b/internal/version.go index f4356b235..bc54163ca 100644 --- a/internal/version.go +++ b/internal/version.go @@ -17,7 +17,7 @@ var build string const ( VersionMajor = 0 VersionMinor = 3 - VersionPatch = 1 + VersionPatch = 2 VersionTag = "" // example: "rc1" ) From ec7a0e42aea91d881eea8be7ca9fdf2cd69eeaef Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 10:55:17 +0000 Subject: [PATCH 05/14] Simplify create-account (#1608) --- cmd/create-account/main.go | 39 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index 6aa1e7281..bba2d55d6 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -20,24 +20,27 @@ import ( "fmt" "os" + "github.com/matrix-org/dendrite/setup" "github.com/matrix-org/dendrite/setup/config" "github.com/matrix-org/dendrite/userapi/storage/accounts" - "github.com/matrix-org/gomatrixserverlib" + "github.com/sirupsen/logrus" ) const usage = `Usage: %s -Generate a new Matrix account for testing purposes. +Creates a new user account on the homeserver. + +Example: + + ./create-account --config dendrite.yaml --username alice --password foobarbaz Arguments: ` var ( - database = flag.String("database", "", "The location of the account database.") - username = flag.String("username", "", "The user ID localpart to register e.g 'alice' in '@alice:localhost'.") - password = flag.String("password", "", "Optional. The password to register with. If not specified, this account will be password-less.") - serverNameStr = flag.String("servername", "localhost", "The Matrix server domain which will form the domain part of the user ID.") + username = flag.String("username", "", "The username of the account to register (specify the localpart only, e.g. 'alice' for '@alice:domain.com')") + password = flag.String("password", "", "The password to associate with the account (optional, account will be password-less if not specified)") ) func main() { @@ -45,36 +48,24 @@ func main() { fmt.Fprintf(os.Stderr, usage, os.Args[0]) flag.PrintDefaults() } - - flag.Parse() + cfg := setup.ParseFlags(true) if *username == "" { flag.Usage() - fmt.Println("Missing --username") os.Exit(1) } - if *database == "" { - flag.Usage() - fmt.Println("Missing --database") - os.Exit(1) - } - - serverName := gomatrixserverlib.ServerName(*serverNameStr) - accountDB, err := accounts.NewDatabase(&config.DatabaseOptions{ - ConnectionString: config.DataSource(*database), - }, serverName) + ConnectionString: cfg.UserAPI.AccountDatabase.ConnectionString, + }, cfg.Global.ServerName) if err != nil { - fmt.Println(err.Error()) - os.Exit(1) + logrus.Fatalln("Failed to connect to the database:", err.Error()) } _, err = accountDB.CreateAccount(context.Background(), *username, *password, "") if err != nil { - fmt.Println(err.Error()) - os.Exit(1) + logrus.Fatalln("Failed to create the account:", err.Error()) } - fmt.Println("Created account") + logrus.Infoln("Created account", *username) } From 2b03d24358aeac14ba7c8c63e35012d6e91c1509 Mon Sep 17 00:00:00 2001 From: alexkursell Date: Thu, 3 Dec 2020 06:01:49 -0500 Subject: [PATCH 06/14] Fix /joined_members API response (#1606) * Fix /joined_members API response * Fix golint issue --- clientapi/routing/memberships.go | 11 +++++++++-- sytest-whitelist | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/clientapi/routing/memberships.go b/clientapi/routing/memberships.go index 457f81cbd..513fcefd7 100644 --- a/clientapi/routing/memberships.go +++ b/clientapi/routing/memberships.go @@ -44,6 +44,13 @@ type joinedMember struct { AvatarURL string `json:"avatar_url"` } +// The database stores 'displayname' without an underscore. +// Deserialize into this and then change to the actual API response +type databaseJoinedMember struct { + DisplayName string `json:"displayname"` + AvatarURL string `json:"avatar_url"` +} + // GetMemberships implements GET /rooms/{roomId}/members func GetMemberships( req *http.Request, device *userapi.Device, roomID string, joinedOnly bool, @@ -72,12 +79,12 @@ func GetMemberships( var res getJoinedMembersResponse res.Joined = make(map[string]joinedMember) for _, ev := range queryRes.JoinEvents { - var content joinedMember + var content databaseJoinedMember if err := json.Unmarshal(ev.Content, &content); err != nil { util.GetLogger(req.Context()).WithError(err).Error("failed to unmarshal event content") return jsonerror.InternalServerError() } - res.Joined[ev.Sender] = content + res.Joined[ev.Sender] = joinedMember(content) } return util.JSONResponse{ Code: http.StatusOK, diff --git a/sytest-whitelist b/sytest-whitelist index ffcb1785a..17027041d 100644 --- a/sytest-whitelist +++ b/sytest-whitelist @@ -503,3 +503,4 @@ Forgetting room does not show up in v2 /sync Can forget room you've been kicked from Can re-join room if re-invited /whois +/joined_members return joined members From be7d8595be0533207f8942b129c16f3844550712 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 11:11:46 +0000 Subject: [PATCH 07/14] Peeking updates (#1607) * Add unpeek * Don't allow peeks into encrypted rooms * Fix send tests * Update consumers --- clientapi/routing/peekroom.go | 25 ++++ clientapi/routing/routing.go | 14 +++ federationapi/routing/send_test.go | 7 ++ roomserver/api/api.go | 6 + roomserver/api/api_trace.go | 9 ++ roomserver/api/output.go | 11 ++ roomserver/api/perform.go | 11 ++ roomserver/internal/api.go | 8 ++ roomserver/internal/perform/perform_peek.go | 10 +- roomserver/internal/perform/perform_unpeek.go | 118 ++++++++++++++++++ roomserver/inthttp/client.go | 18 +++ roomserver/inthttp/server.go | 11 ++ syncapi/consumers/roomserver.go | 22 ++++ syncapi/storage/interface.go | 3 + syncapi/storage/shared/syncserver.go | 17 +++ syncapi/sync/notifier.go | 12 ++ 16 files changed, 300 insertions(+), 2 deletions(-) create mode 100644 roomserver/internal/perform/perform_unpeek.go diff --git a/clientapi/routing/peekroom.go b/clientapi/routing/peekroom.go index d96f91d0f..26aa64ce1 100644 --- a/clientapi/routing/peekroom.go +++ b/clientapi/routing/peekroom.go @@ -77,3 +77,28 @@ func PeekRoomByIDOrAlias( }{peekRes.RoomID}, } } + +func UnpeekRoomByID( + req *http.Request, + device *api.Device, + rsAPI roomserverAPI.RoomserverInternalAPI, + accountDB accounts.Database, + roomID string, +) util.JSONResponse { + unpeekReq := roomserverAPI.PerformUnpeekRequest{ + RoomID: roomID, + UserID: device.UserID, + DeviceID: device.ID, + } + unpeekRes := roomserverAPI.PerformUnpeekResponse{} + + rsAPI.PerformUnpeek(req.Context(), &unpeekReq, &unpeekRes) + if unpeekRes.Error != nil { + return unpeekRes.Error.JSONResponse() + } + + return util.JSONResponse{ + Code: http.StatusOK, + JSON: struct{}{}, + } +} diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index e6315b68f..8dbfc551d 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -106,6 +106,9 @@ func Setup( ).Methods(http.MethodPost, http.MethodOptions) r0mux.Handle("/peek/{roomIDOrAlias}", httputil.MakeAuthAPI(gomatrixserverlib.Peek, userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { + if r := rateLimits.rateLimit(req); r != nil { + return *r + } vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) if err != nil { return util.ErrorResponse(err) @@ -148,6 +151,17 @@ func Setup( ) }), ).Methods(http.MethodPost, http.MethodOptions) + r0mux.Handle("/rooms/{roomID}/unpeek", + httputil.MakeAuthAPI("unpeek", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { + vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) + if err != nil { + return util.ErrorResponse(err) + } + return UnpeekRoomByID( + req, device, rsAPI, accountDB, vars["roomID"], + ) + }), + ).Methods(http.MethodPost, http.MethodOptions) r0mux.Handle("/rooms/{roomID}/ban", httputil.MakeAuthAPI("membership", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) diff --git a/federationapi/routing/send_test.go b/federationapi/routing/send_test.go index 9b9db873b..a9ee78830 100644 --- a/federationapi/routing/send_test.go +++ b/federationapi/routing/send_test.go @@ -131,6 +131,13 @@ func (t *testRoomserverAPI) PerformPeek( ) { } +func (t *testRoomserverAPI) PerformUnpeek( + ctx context.Context, + req *api.PerformUnpeekRequest, + res *api.PerformUnpeekResponse, +) { +} + func (t *testRoomserverAPI) PerformPublish( ctx context.Context, req *api.PerformPublishRequest, diff --git a/roomserver/api/api.go b/roomserver/api/api.go index 2683918a8..bef2bb3fa 100644 --- a/roomserver/api/api.go +++ b/roomserver/api/api.go @@ -42,6 +42,12 @@ type RoomserverInternalAPI interface { res *PerformPeekResponse, ) + PerformUnpeek( + ctx context.Context, + req *PerformUnpeekRequest, + res *PerformUnpeekResponse, + ) + PerformPublish( ctx context.Context, req *PerformPublishRequest, diff --git a/roomserver/api/api_trace.go b/roomserver/api/api_trace.go index e625fb04a..eb2b2e1d4 100644 --- a/roomserver/api/api_trace.go +++ b/roomserver/api/api_trace.go @@ -46,6 +46,15 @@ func (t *RoomserverInternalAPITrace) PerformPeek( util.GetLogger(ctx).Infof("PerformPeek req=%+v res=%+v", js(req), js(res)) } +func (t *RoomserverInternalAPITrace) PerformUnpeek( + ctx context.Context, + req *PerformUnpeekRequest, + res *PerformUnpeekResponse, +) { + t.Impl.PerformUnpeek(ctx, req, res) + util.GetLogger(ctx).Infof("PerformUnpeek req=%+v res=%+v", js(req), js(res)) +} + func (t *RoomserverInternalAPITrace) PerformJoin( ctx context.Context, req *PerformJoinRequest, diff --git a/roomserver/api/output.go b/roomserver/api/output.go index fb512a933..2993813cb 100644 --- a/roomserver/api/output.go +++ b/roomserver/api/output.go @@ -51,6 +51,8 @@ const ( // OutputTypeNewPeek indicates that the kafka event is an OutputNewPeek OutputTypeNewPeek OutputType = "new_peek" + // OutputTypeRetirePeek indicates that the kafka event is an OutputRetirePeek + OutputTypeRetirePeek OutputType = "retire_peek" ) // An OutputEvent is an entry in the roomserver output kafka log. @@ -70,6 +72,8 @@ type OutputEvent struct { RedactedEvent *OutputRedactedEvent `json:"redacted_event,omitempty"` // The content of event with type OutputTypeNewPeek NewPeek *OutputNewPeek `json:"new_peek,omitempty"` + // The content of event with type OutputTypeRetirePeek + RetirePeek *OutputRetirePeek `json:"retire_peek,omitempty"` } // Type of the OutputNewRoomEvent. @@ -240,3 +244,10 @@ type OutputNewPeek struct { UserID string DeviceID string } + +// An OutputRetirePeek is written whenever a user stops peeking into a room. +type OutputRetirePeek struct { + RoomID string + UserID string + DeviceID string +} diff --git a/roomserver/api/perform.go b/roomserver/api/perform.go index ec561f11e..ae2d6d975 100644 --- a/roomserver/api/perform.go +++ b/roomserver/api/perform.go @@ -123,6 +123,17 @@ type PerformPeekResponse struct { Error *PerformError } +type PerformUnpeekRequest struct { + RoomID string `json:"room_id"` + UserID string `json:"user_id"` + DeviceID string `json:"device_id"` +} + +type PerformUnpeekResponse struct { + // If non-nil, the join request failed. Contains more information why it failed. + Error *PerformError +} + // PerformBackfillRequest is a request to PerformBackfill. type PerformBackfillRequest struct { // The room to backfill diff --git a/roomserver/internal/api.go b/roomserver/internal/api.go index c825c13d4..1ad971ecb 100644 --- a/roomserver/internal/api.go +++ b/roomserver/internal/api.go @@ -23,6 +23,7 @@ type RoomserverInternalAPI struct { *perform.Inviter *perform.Joiner *perform.Peeker + *perform.Unpeeker *perform.Leaver *perform.Publisher *perform.Backfiller @@ -94,6 +95,13 @@ func (r *RoomserverInternalAPI) SetFederationSenderAPI(fsAPI fsAPI.FederationSen FSAPI: r.fsAPI, Inputer: r.Inputer, } + r.Unpeeker = &perform.Unpeeker{ + ServerName: r.Cfg.Matrix.ServerName, + Cfg: r.Cfg, + DB: r.DB, + FSAPI: r.fsAPI, + Inputer: r.Inputer, + } r.Leaver = &perform.Leaver{ Cfg: r.Cfg, DB: r.DB, diff --git a/roomserver/internal/perform/perform_peek.go b/roomserver/internal/perform/perform_peek.go index 66d1bdb21..2f4694c86 100644 --- a/roomserver/internal/perform/perform_peek.go +++ b/roomserver/internal/perform/perform_peek.go @@ -163,8 +163,7 @@ func (r *Peeker) performPeekRoomByID( // XXX: we should probably factor out history_visibility checks into a common utility method somewhere // which handles the default value etc. var worldReadable = false - ev, _ := r.DB.GetStateEvent(ctx, roomID, "m.room.history_visibility", "") - if ev != nil { + if ev, _ := r.DB.GetStateEvent(ctx, roomID, "m.room.history_visibility", ""); ev != nil { content := map[string]string{} if err = json.Unmarshal(ev.Content(), &content); err != nil { util.GetLogger(ctx).WithError(err).Error("json.Unmarshal for history visibility failed") @@ -182,6 +181,13 @@ func (r *Peeker) performPeekRoomByID( } } + if ev, _ := r.DB.GetStateEvent(ctx, roomID, "m.room.encryption", ""); ev != nil { + return "", &api.PerformError{ + Code: api.PerformErrorNotAllowed, + Msg: "Cannot peek into an encrypted room", + } + } + // TODO: handle federated peeks err = r.Inputer.WriteOutputEvents(roomID, []api.OutputEvent{ diff --git a/roomserver/internal/perform/perform_unpeek.go b/roomserver/internal/perform/perform_unpeek.go new file mode 100644 index 000000000..f71e0007c --- /dev/null +++ b/roomserver/internal/perform/perform_unpeek.go @@ -0,0 +1,118 @@ +// Copyright 2020 New Vector Ltd +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package perform + +import ( + "context" + "fmt" + "strings" + + fsAPI "github.com/matrix-org/dendrite/federationsender/api" + "github.com/matrix-org/dendrite/roomserver/api" + "github.com/matrix-org/dendrite/roomserver/internal/input" + "github.com/matrix-org/dendrite/roomserver/storage" + "github.com/matrix-org/dendrite/setup/config" + "github.com/matrix-org/gomatrixserverlib" +) + +type Unpeeker struct { + ServerName gomatrixserverlib.ServerName + Cfg *config.RoomServer + FSAPI fsAPI.FederationSenderInternalAPI + DB storage.Database + + Inputer *input.Inputer +} + +// PerformPeek handles peeking into matrix rooms, including over federation by talking to the federationsender. +func (r *Unpeeker) PerformUnpeek( + ctx context.Context, + req *api.PerformUnpeekRequest, + res *api.PerformUnpeekResponse, +) { + if err := r.performUnpeek(ctx, req); err != nil { + perr, ok := err.(*api.PerformError) + if ok { + res.Error = perr + } else { + res.Error = &api.PerformError{ + Msg: err.Error(), + } + } + } +} + +func (r *Unpeeker) performUnpeek( + ctx context.Context, + req *api.PerformUnpeekRequest, +) error { + // FIXME: there's way too much duplication with performJoin + _, domain, err := gomatrixserverlib.SplitID('@', req.UserID) + if err != nil { + return &api.PerformError{ + Code: api.PerformErrorBadRequest, + Msg: fmt.Sprintf("Supplied user ID %q in incorrect format", req.UserID), + } + } + if domain != r.Cfg.Matrix.ServerName { + return &api.PerformError{ + Code: api.PerformErrorBadRequest, + Msg: fmt.Sprintf("User %q does not belong to this homeserver", req.UserID), + } + } + if strings.HasPrefix(req.RoomID, "!") { + return r.performUnpeekRoomByID(ctx, req) + } + return &api.PerformError{ + Code: api.PerformErrorBadRequest, + Msg: fmt.Sprintf("Room ID %q is invalid", req.RoomID), + } +} + +func (r *Unpeeker) performUnpeekRoomByID( + _ context.Context, + req *api.PerformUnpeekRequest, +) (err error) { + // Get the domain part of the room ID. + _, _, err = gomatrixserverlib.SplitID('!', req.RoomID) + if err != nil { + return &api.PerformError{ + Code: api.PerformErrorBadRequest, + Msg: fmt.Sprintf("Room ID %q is invalid: %s", req.RoomID, err), + } + } + + // TODO: handle federated peeks + + err = r.Inputer.WriteOutputEvents(req.RoomID, []api.OutputEvent{ + { + Type: api.OutputTypeRetirePeek, + RetirePeek: &api.OutputRetirePeek{ + RoomID: req.RoomID, + UserID: req.UserID, + DeviceID: req.DeviceID, + }, + }, + }) + if err != nil { + return + } + + // By this point, if req.RoomIDOrAlias contained an alias, then + // it will have been overwritten with a room ID by performPeekRoomByAlias. + // We should now include this in the response so that the CS API can + // return the right room ID. + return nil +} diff --git a/roomserver/inthttp/client.go b/roomserver/inthttp/client.go index f5b66ca6a..e496b81e0 100644 --- a/roomserver/inthttp/client.go +++ b/roomserver/inthttp/client.go @@ -27,6 +27,7 @@ const ( // Perform operations RoomserverPerformInvitePath = "/roomserver/performInvite" RoomserverPerformPeekPath = "/roomserver/performPeek" + RoomserverPerformUnpeekPath = "/roomserver/performUnpeek" RoomserverPerformJoinPath = "/roomserver/performJoin" RoomserverPerformLeavePath = "/roomserver/performLeave" RoomserverPerformBackfillPath = "/roomserver/performBackfill" @@ -209,6 +210,23 @@ func (h *httpRoomserverInternalAPI) PerformPeek( } } +func (h *httpRoomserverInternalAPI) PerformUnpeek( + ctx context.Context, + request *api.PerformUnpeekRequest, + response *api.PerformUnpeekResponse, +) { + span, ctx := opentracing.StartSpanFromContext(ctx, "PerformUnpeek") + defer span.Finish() + + apiURL := h.roomserverURL + RoomserverPerformUnpeekPath + err := httputil.PostJSON(ctx, span, h.httpClient, apiURL, request, response) + if err != nil { + response.Error = &api.PerformError{ + Msg: fmt.Sprintf("failed to communicate with roomserver: %s", err), + } + } +} + func (h *httpRoomserverInternalAPI) PerformLeave( ctx context.Context, request *api.PerformLeaveRequest, diff --git a/roomserver/inthttp/server.go b/roomserver/inthttp/server.go index 2bc8f82df..ac1fc25b6 100644 --- a/roomserver/inthttp/server.go +++ b/roomserver/inthttp/server.go @@ -72,6 +72,17 @@ func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { return util.JSONResponse{Code: http.StatusOK, JSON: &response} }), ) + internalAPIMux.Handle(RoomserverPerformPeekPath, + httputil.MakeInternalAPI("performUnpeek", func(req *http.Request) util.JSONResponse { + var request api.PerformUnpeekRequest + var response api.PerformUnpeekResponse + if err := json.NewDecoder(req.Body).Decode(&request); err != nil { + return util.MessageResponse(http.StatusBadRequest, err.Error()) + } + r.PerformUnpeek(req.Context(), &request, &response) + return util.JSONResponse{Code: http.StatusOK, JSON: &response} + }), + ) internalAPIMux.Handle(RoomserverPerformPublishPath, httputil.MakeInternalAPI("performPublish", func(req *http.Request) util.JSONResponse { var request api.PerformPublishRequest diff --git a/syncapi/consumers/roomserver.go b/syncapi/consumers/roomserver.go index 4d453f133..11d75a683 100644 --- a/syncapi/consumers/roomserver.go +++ b/syncapi/consumers/roomserver.go @@ -105,6 +105,8 @@ func (s *OutputRoomEventConsumer) onMessage(msg *sarama.ConsumerMessage) error { return s.onRetireInviteEvent(context.TODO(), *output.RetireInviteEvent) case api.OutputTypeNewPeek: return s.onNewPeek(context.TODO(), *output.NewPeek) + case api.OutputTypeRetirePeek: + return s.onRetirePeek(context.TODO(), *output.RetirePeek) case api.OutputTypeRedactedEvent: return s.onRedactEvent(context.TODO(), *output.RedactedEvent) default: @@ -309,6 +311,26 @@ func (s *OutputRoomEventConsumer) onNewPeek( return nil } +func (s *OutputRoomEventConsumer) onRetirePeek( + ctx context.Context, msg api.OutputRetirePeek, +) error { + sp, err := s.db.DeletePeek(ctx, msg.RoomID, msg.UserID, msg.DeviceID) + if err != nil { + // panic rather than continue with an inconsistent database + log.WithFields(log.Fields{ + log.ErrorKey: err, + }).Panicf("roomserver output log: write peek failure") + return nil + } + // tell the notifier about the new peek so it knows to wake up new devices + s.notifier.OnRetirePeek(msg.RoomID, msg.UserID, msg.DeviceID) + + // we need to wake up the users who might need to now be peeking into this room, + // so we send in a dummy event to trigger a wakeup + s.notifier.OnNewEvent(nil, msg.RoomID, nil, types.NewStreamToken(sp, 0, nil)) + return nil +} + func (s *OutputRoomEventConsumer) updateStateEvent(event *gomatrixserverlib.HeaderedEvent) (*gomatrixserverlib.HeaderedEvent, error) { if event.StateKey() == nil { return event, nil diff --git a/syncapi/storage/interface.go b/syncapi/storage/interface.go index eaa0f64f3..456ca1b1d 100644 --- a/syncapi/storage/interface.go +++ b/syncapi/storage/interface.go @@ -91,6 +91,9 @@ type Database interface { // AddPeek adds a new peek to our DB for a given room by a given user's device. // Returns an error if there was a problem communicating with the database. AddPeek(ctx context.Context, RoomID, UserID, DeviceID string) (types.StreamPosition, error) + // DeletePeek removes an existing peek from the database for a given room by a user's device. + // Returns an error if there was a problem communicating with the database. + DeletePeek(ctx context.Context, roomID, userID, deviceID string) (sp types.StreamPosition, err error) // DeletePeek deletes all peeks for a given room by a given user // Returns an error if there was a problem communicating with the database. DeletePeeks(ctx context.Context, RoomID, UserID string) (types.StreamPosition, error) diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index fd8ca0412..6c35a7653 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -178,6 +178,23 @@ func (d *Database) AddPeek( return } +// DeletePeeks tracks the fact that a user has stopped peeking from the specified +// device. If the peeks was successfully deleted this returns the stream ID it was +// stored at. Returns an error if there was a problem communicating with the database. +func (d *Database) DeletePeek( + ctx context.Context, roomID, userID, deviceID string, +) (sp types.StreamPosition, err error) { + err = d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error { + sp, err = d.Peeks.DeletePeek(ctx, txn, roomID, userID, deviceID) + return err + }) + if err == sql.ErrNoRows { + sp = 0 + err = nil + } + return +} + // DeletePeeks tracks the fact that a user has stopped peeking from all devices // If the peeks was successfully deleted this returns the stream ID it was stored at. // Returns an error if there was a problem communicating with the database. diff --git a/syncapi/sync/notifier.go b/syncapi/sync/notifier.go index daa3a1d8c..1d8cd624c 100644 --- a/syncapi/sync/notifier.go +++ b/syncapi/sync/notifier.go @@ -137,6 +137,18 @@ func (n *Notifier) OnNewPeek( // by calling OnNewEvent. } +func (n *Notifier) OnRetirePeek( + roomID, userID, deviceID string, +) { + n.streamLock.Lock() + defer n.streamLock.Unlock() + + n.removePeekingDevice(roomID, userID, deviceID) + + // we don't wake up devices here given the roomserver consumer will do this shortly afterwards + // by calling OnRetireEvent. +} + func (n *Notifier) OnNewSendToDevice( userID string, deviceIDs []string, posUpdate types.StreamingToken, From 71327b8efac8d5f35a0fdcf06deb35b6eb1dd474 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 13:22:32 +0000 Subject: [PATCH 08/14] Add FAQ.md --- docs/FAQ.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 docs/FAQ.md diff --git a/docs/FAQ.md b/docs/FAQ.md new file mode 100644 index 000000000..5b1cec981 --- /dev/null +++ b/docs/FAQ.md @@ -0,0 +1,52 @@ +# Frequently Asked Questions + +## Is Dendrite stable? + +Mostly, although there are still bugs and missing features. If you are a confident power user and you are happy to spend some time debugging things when they go wrong, then please try out Dendrite. If you are a community, organisation or business that demands stability and uptime, then Dendrite is not for you yet - please install Synapse instead. + +## Is Dendrite feature-complete? + +No, although a good portion of the Matrix specification has been implemented. Mostly missing are client features - see the readme at the root of the repository for more information. + +## Is there a migration path from Synapse to Dendrite? + +No, not at present. There will be in the future when Dendrite reaches version 1.0. + +## I've installed Dendrite but federation isn't working + +Check the [Federation Tester](https://federationtester.matrix.org). You need at least: + +* A valid DNS name +* A valid TLS certificate for that DNS name +* Either DNS SRV records or well-known files + +## Does Dendrite work with my favourite client? + +It should do, although we are aware of some minor issues: + +* **Element Android**: registration does not work, but logging in with an existing account does +* **Hydrogen**: occasionally sync can fail due to gaps in the `since` parameter, but clearing the cache fixes this + +## Does Dendrite support push notifications? + +No, not yet. This is a planned feature. + +## Does Dendrite support application services/bridges? + +Possibly - Dendrite does have some application service support but it is not well tested. Please let us know by raising a GitHub issue if you try it and run into problems. + +## Dendrite is using a lot of CPU + +Generally speaking, you should expect to see some CPU spikes, particularly if you are joining or participating in large rooms. However, constant/sustained high CPU usage is not expected - if you are experiencing that, please join `#dendrite-dev:matrix.org` and let us know, or file a GitHub issue. + +## Dendrite is using a lot of RAM + +A lot of users report that Dendrite is using a lot of RAM, sometimes even gigabytes of it. This is usually due to Go's allocator behaviour, which tries to hold onto allocated memory until the operating system wants to reclaim it for something else. This can make the memory usage look significantly inflated in tools like `top`/`htop` when actually most of that memory is not really in use at all. + +If you want to prevent this behaviour so that the Go runtime releases memory normally, start Dendrite using the `GODEBUG=madvdontneed=1` environment variable. It is also expected that the allocator behaviour will be changed again in Go 1.16 so that it does not hold onto memory unnecessarily in this way. + +If you are running with `GODEBUG=madvdontneed=1` and still see hugely inflated memory usage then that's quite possibly a bug - please join `#dendrite-dev:matrix.org` and let us know, or file a GitHub issue. + +## Dendrite is running out of PostgreSQL database connections + +You may need to revisit the connection limit of your PostgreSQL server and/or make changes to the `max_connections` lines in your Dendrite configuration. Be aware that each Dendrite component opens its own database connections and has its own connection limit, even in monolith mode! \ No newline at end of file From a4bf9921add5bc33d283e277c31868a6e79f1e89 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 13:27:48 +0000 Subject: [PATCH 09/14] Update FAQ.md --- docs/FAQ.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index 5b1cec981..f69b20266 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -35,6 +35,14 @@ No, not yet. This is a planned feature. Possibly - Dendrite does have some application service support but it is not well tested. Please let us know by raising a GitHub issue if you try it and run into problems. +## Is it possible to prevent communication with the outside world? + +Yes, you can do this by disabling federation - set `disable_federation` to `true` in the `global` section of the Dendrite configuration file. + +## Should I use PostgreSQL or SQLite for my databases? + +Please use PostgreSQL wherever possible, especially if you are planning to run a homeserver that caters to more than a couple of users. + ## Dendrite is using a lot of CPU Generally speaking, you should expect to see some CPU spikes, particularly if you are joining or participating in large rooms. However, constant/sustained high CPU usage is not expected - if you are experiencing that, please join `#dendrite-dev:matrix.org` and let us know, or file a GitHub issue. @@ -49,4 +57,4 @@ If you are running with `GODEBUG=madvdontneed=1` and still see hugely inflated m ## Dendrite is running out of PostgreSQL database connections -You may need to revisit the connection limit of your PostgreSQL server and/or make changes to the `max_connections` lines in your Dendrite configuration. Be aware that each Dendrite component opens its own database connections and has its own connection limit, even in monolith mode! \ No newline at end of file +You may need to revisit the connection limit of your PostgreSQL server and/or make changes to the `max_connections` lines in your Dendrite configuration. Be aware that each Dendrite component opens its own database connections and has its own connection limit, even in monolith mode! From eef8f88092ffbe894dc0bbeee487315a05416577 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 13:28:41 +0000 Subject: [PATCH 10/14] Update FAQ.md --- docs/FAQ.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index f69b20266..9267aed32 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -1,18 +1,18 @@ # Frequently Asked Questions -## Is Dendrite stable? +### Is Dendrite stable? Mostly, although there are still bugs and missing features. If you are a confident power user and you are happy to spend some time debugging things when they go wrong, then please try out Dendrite. If you are a community, organisation or business that demands stability and uptime, then Dendrite is not for you yet - please install Synapse instead. -## Is Dendrite feature-complete? +### Is Dendrite feature-complete? No, although a good portion of the Matrix specification has been implemented. Mostly missing are client features - see the readme at the root of the repository for more information. -## Is there a migration path from Synapse to Dendrite? +### Is there a migration path from Synapse to Dendrite? No, not at present. There will be in the future when Dendrite reaches version 1.0. -## I've installed Dendrite but federation isn't working +### I've installed Dendrite but federation isn't working Check the [Federation Tester](https://federationtester.matrix.org). You need at least: @@ -20,34 +20,34 @@ Check the [Federation Tester](https://federationtester.matrix.org). You need at * A valid TLS certificate for that DNS name * Either DNS SRV records or well-known files -## Does Dendrite work with my favourite client? +### Does Dendrite work with my favourite client? It should do, although we are aware of some minor issues: * **Element Android**: registration does not work, but logging in with an existing account does * **Hydrogen**: occasionally sync can fail due to gaps in the `since` parameter, but clearing the cache fixes this -## Does Dendrite support push notifications? +### Does Dendrite support push notifications? No, not yet. This is a planned feature. -## Does Dendrite support application services/bridges? +### Does Dendrite support application services/bridges? Possibly - Dendrite does have some application service support but it is not well tested. Please let us know by raising a GitHub issue if you try it and run into problems. -## Is it possible to prevent communication with the outside world? +### Is it possible to prevent communication with the outside world? Yes, you can do this by disabling federation - set `disable_federation` to `true` in the `global` section of the Dendrite configuration file. -## Should I use PostgreSQL or SQLite for my databases? +### Should I use PostgreSQL or SQLite for my databases? Please use PostgreSQL wherever possible, especially if you are planning to run a homeserver that caters to more than a couple of users. -## Dendrite is using a lot of CPU +### Dendrite is using a lot of CPU Generally speaking, you should expect to see some CPU spikes, particularly if you are joining or participating in large rooms. However, constant/sustained high CPU usage is not expected - if you are experiencing that, please join `#dendrite-dev:matrix.org` and let us know, or file a GitHub issue. -## Dendrite is using a lot of RAM +### Dendrite is using a lot of RAM A lot of users report that Dendrite is using a lot of RAM, sometimes even gigabytes of it. This is usually due to Go's allocator behaviour, which tries to hold onto allocated memory until the operating system wants to reclaim it for something else. This can make the memory usage look significantly inflated in tools like `top`/`htop` when actually most of that memory is not really in use at all. @@ -55,6 +55,6 @@ If you want to prevent this behaviour so that the Go runtime releases memory nor If you are running with `GODEBUG=madvdontneed=1` and still see hugely inflated memory usage then that's quite possibly a bug - please join `#dendrite-dev:matrix.org` and let us know, or file a GitHub issue. -## Dendrite is running out of PostgreSQL database connections +### Dendrite is running out of PostgreSQL database connections You may need to revisit the connection limit of your PostgreSQL server and/or make changes to the `max_connections` lines in your Dendrite configuration. Be aware that each Dendrite component opens its own database connections and has its own connection limit, even in monolith mode! From 246866a13184bd382eb79e3944511fbe717802d8 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 13:46:56 +0000 Subject: [PATCH 11/14] Add PROFILING.md --- docs/PROFILING.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docs/PROFILING.md diff --git a/docs/PROFILING.md b/docs/PROFILING.md new file mode 100644 index 000000000..9184d1b13 --- /dev/null +++ b/docs/PROFILING.md @@ -0,0 +1,79 @@ +# Profiling Dendrite + +If you are running into problems with Dendrite using excessive resources (e.g. CPU or RAM) then you can use the profiler to work out what is happening. + +Dendrite contains an embedded profiler called `pprof`, which is a part of the standard Go toolchain. + +### Enable the profiler + +To enable the profiler, start Dendrite with the `PPROFLISTEN` environment variable. This variable specifies which address and port to listen on, e.g. + +``` +PPROFLISTEN=localhost:65432 ./bin/dendrite-monolith-server ... +``` + +If pprof has been enabled successfully, a log line at startup will show that pprof is listening: + +``` +WARN[2020-12-03T13:32:33.669405000Z] [/Users/neilalexander/Desktop/dendrite/internal/log.go:87] SetupPprof + Starting pprof on localhost:65432 +``` + +### Profiling CPU usage + +To examine where CPU time is going, you can call the `profile` endpoint: + +``` +http://localhost:65432/debug/pprof/profile?seconds=30 +``` + +The profile will run for the specified number of `seconds` and then will produce a result. + +If you have Go installed and want to explore the profile, you can invoke `go tool pprof` to start the profile directly. The `-http=` parameter will instruct `go tool pprof` to start a web server providing a view of the captured profile: + +``` +go tool pprof -http=localhost:23456 http://localhost:65432/debug/pprof/profile?seconds=30 +``` + +You can then visit `http://localhost:23456` in your web browser to see a visual representation of the profile. Particularly usefully, in the "View" menu, you can select "Flame Graph" to see a proportional interactive graph of CPU usage. + +If you don't have the Go tools installed but just want to capture the profile to send to someone else, you can instead use `curl` to download the profiler results: + +``` +curl -O http://localhost:65432/debug/pprof/profile?seconds=30 +``` + +This will block for the specified number of seconds, capturing information about what Dendrite is doing, and then produces a `profile` file, which you can send onward. + +### Profiling memory usage + +To examine where memory usage is going, you can call the `heap` endpoint: + +``` +http://localhost:65432/debug/pprof/heap +``` + +The profile will return almost instantly. + +If you have Go installed and want to explore the profile, you can invoke `go tool pprof` to start the profile directly. The `-http=` parameter will instruct `go tool pprof` to start a web server providing a view of the captured profile: + +``` +go tool pprof -http=localhost:23456 http://localhost:65432/debug/pprof/heap +``` + +You can then visit `http://localhost:23456` in your web browser to see a visual representation of the profile. The "Sample" menu lets you select between four different memory profiles: + +* `inuse_space`: Shows how much actual heap memory is allocated per function (this is generally the most useful profile when diagnosing high memory usage) +* `inuse_objects`: Shows how many heap objects are allocated per function +* `alloc_space`: Shows how much memory has been allocated per function (although that memory may have since been deallocated) +* `alloc_objects`: Shows how many allocations have been made per function (although that memory may have since been deallocated) + +Also in the "View" menu, you can select "Flame Graph" to see a proportional interactive graph of the memory usage. + +If you don't have the Go tools installed but just want to capture the profile to send to someone else, you can instead use `curl` to download the profiler results: + +``` +curl -O http://localhost:65432/debug/pprof/heap +`` + +This will almost instantly produce a `heap` file, which you can send onward. From 253b05ccde45730a9149626c3af4ee97e8517d9f Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 13:48:02 +0000 Subject: [PATCH 12/14] Update PROFILING.md --- docs/PROFILING.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/PROFILING.md b/docs/PROFILING.md index 9184d1b13..136a757b9 100644 --- a/docs/PROFILING.md +++ b/docs/PROFILING.md @@ -4,7 +4,7 @@ If you are running into problems with Dendrite using excessive resources (e.g. C Dendrite contains an embedded profiler called `pprof`, which is a part of the standard Go toolchain. -### Enable the profiler +## Enable the profiler To enable the profiler, start Dendrite with the `PPROFLISTEN` environment variable. This variable specifies which address and port to listen on, e.g. @@ -19,7 +19,9 @@ WARN[2020-12-03T13:32:33.669405000Z] [/Users/neilalexander/Desktop/dendrite/inte Starting pprof on localhost:65432 ``` -### Profiling CPU usage +All examples from this point forward assume `PPROFLISTEN=localhost:65432` but you may need to adjust as necessary for your setup. + +## Profiling CPU usage To examine where CPU time is going, you can call the `profile` endpoint: @@ -45,7 +47,7 @@ curl -O http://localhost:65432/debug/pprof/profile?seconds=30 This will block for the specified number of seconds, capturing information about what Dendrite is doing, and then produces a `profile` file, which you can send onward. -### Profiling memory usage +## Profiling memory usage To examine where memory usage is going, you can call the `heap` endpoint: @@ -74,6 +76,6 @@ If you don't have the Go tools installed but just want to capture the profile to ``` curl -O http://localhost:65432/debug/pprof/heap -`` +``` This will almost instantly produce a `heap` file, which you can send onward. From 52905ffb82409fca9665ada0c8da40e05b58b8be Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 3 Dec 2020 13:49:34 +0000 Subject: [PATCH 13/14] Update PROFILING.md --- docs/PROFILING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/PROFILING.md b/docs/PROFILING.md index 136a757b9..b026a8aed 100644 --- a/docs/PROFILING.md +++ b/docs/PROFILING.md @@ -31,6 +31,8 @@ http://localhost:65432/debug/pprof/profile?seconds=30 The profile will run for the specified number of `seconds` and then will produce a result. +### Examine a profile using the Go toolchain + If you have Go installed and want to explore the profile, you can invoke `go tool pprof` to start the profile directly. The `-http=` parameter will instruct `go tool pprof` to start a web server providing a view of the captured profile: ``` @@ -39,6 +41,8 @@ go tool pprof -http=localhost:23456 http://localhost:65432/debug/pprof/profile?s You can then visit `http://localhost:23456` in your web browser to see a visual representation of the profile. Particularly usefully, in the "View" menu, you can select "Flame Graph" to see a proportional interactive graph of CPU usage. +### Download a profile to send to someone else + If you don't have the Go tools installed but just want to capture the profile to send to someone else, you can instead use `curl` to download the profiler results: ``` @@ -57,6 +61,8 @@ http://localhost:65432/debug/pprof/heap The profile will return almost instantly. +### Examine a profile using the Go toolchain + If you have Go installed and want to explore the profile, you can invoke `go tool pprof` to start the profile directly. The `-http=` parameter will instruct `go tool pprof` to start a web server providing a view of the captured profile: ``` @@ -72,6 +78,8 @@ You can then visit `http://localhost:23456` in your web browser to see a visual Also in the "View" menu, you can select "Flame Graph" to see a proportional interactive graph of the memory usage. +### Download a profile to send to someone else + If you don't have the Go tools installed but just want to capture the profile to send to someone else, you can instead use `curl` to download the profiler results: ``` From 19b1d40d6479ac73cf4073c23f9ee291e3d5d112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petter=20Jakub=20=C3=98kland?= Date: Thu, 3 Dec 2020 13:52:00 +0000 Subject: [PATCH 14/14] Hiawatha reverse proxy sample for monolith and fixes to polylith sample (#1609) * Created polylith reverse proxy sample for Hiawatha * Create monolith-sample.conf * Added timeout to proxies and binding explanation. * Fixed typo. * Consistency with regards to polylith-sample.conf. --- docs/hiawatha/monolith-sample.conf | 17 +++++++++++++++++ docs/hiawatha/polylith-sample.conf | 22 +++++++++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 docs/hiawatha/monolith-sample.conf diff --git a/docs/hiawatha/monolith-sample.conf b/docs/hiawatha/monolith-sample.conf new file mode 100644 index 000000000..8285c0bd6 --- /dev/null +++ b/docs/hiawatha/monolith-sample.conf @@ -0,0 +1,17 @@ +# Depending on which port is used for federation (.well-known/matrix/server or SRV record), +# ensure there's a binding for that port in the configuration. Replace "FEDPORT" with port +# number, (e.g. "8448"), and "IPV4" with your server's ipv4 address (separate binding for +# each ip address, e.g. if you use both ipv4 and ipv6 addresses). + +Binding { + Port = FEDPORT + Interface = IPV4 + TLScertFile = /path/to/fullchainandprivkey.pem +} + +VirtualHost { + ... + ReverseProxy = /_matrix http://localhost:8008 600 + ... + +} diff --git a/docs/hiawatha/polylith-sample.conf b/docs/hiawatha/polylith-sample.conf index 99730efdb..5ed0cb5ae 100644 --- a/docs/hiawatha/polylith-sample.conf +++ b/docs/hiawatha/polylith-sample.conf @@ -1,3 +1,15 @@ +# Depending on which port is used for federation (.well-known/matrix/server or SRV record), +# ensure there's a binding for that port in the configuration. Replace "FEDPORT" with port +# number, (e.g. "8448"), and "IPV4" with your server's ipv4 address (separate binding for +# each ip address, e.g. if you use both ipv4 and ipv6 addresses). + +Binding { + Port = FEDPORT + Interface = IPV4 + TLScertFile = /path/to/fullchainandprivkey.pem +} + + VirtualHost { ... # route requests to: @@ -7,10 +19,10 @@ VirtualHost { # /_matrix/client/.*/keys/changes # /_matrix/client/.*/rooms/{roomId}/messages # to sync_api - ReverseProxy = /_matrix/client/.*?/(sync|user/.*?/filter/?.*|keys/changes|rooms/.*?/messages) http://localhost:8073 - ReverseProxy = /_matrix/client http://localhost:8071 - ReverseProxy = /_matrix/federation http://localhost:8072 - ReverseProxy = /_matrix/key http://localhost:8072 - ReverseProxy = /_matrix/media http://localhost:8074 + ReverseProxy = /_matrix/client/.*?/(sync|user/.*?/filter/?.*|keys/changes|rooms/.*?/messages) http://localhost:8073 600 + ReverseProxy = /_matrix/client http://localhost:8071 600 + ReverseProxy = /_matrix/federation http://localhost:8072 600 + ReverseProxy = /_matrix/key http://localhost:8072 600 + ReverseProxy = /_matrix/media http://localhost:8074 600 ... }