1 |
commit: 3e6f81303185dde8d59a9696b978b12f4196af40 |
2 |
Author: Aaron Bauman <bman <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 24 22:33:53 2020 +0000 |
4 |
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 24 22:33:53 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e6f8130 |
7 |
|
8 |
net-misc/gns3-gui: bump to version 2.2.8 |
9 |
|
10 |
* Fix all the crazy dep changes |
11 |
* Add upstream patch to remove dev-python/raven dep |
12 |
* Takeover maintainership |
13 |
* Only support py3.7 and py3.8 to minimize conditionals |
14 |
|
15 |
Closes: https://bugs.gentoo.org/688016 |
16 |
Closes: https://bugs.gentoo.org/712964 |
17 |
Closes: https://bugs.gentoo.org/714840 |
18 |
Closes: https://bugs.gentoo.org/718444 |
19 |
|
20 |
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org> |
21 |
|
22 |
net-misc/gns3-server/Manifest | 1 + |
23 |
.../gns3-server/files/gns3-server-rmraven.patch | 194 +++++++++++++++++++++ |
24 |
net-misc/gns3-server/gns3-server-2.2.8.ebuild | 71 ++++++++ |
25 |
net-misc/gns3-server/metadata.xml | 8 +- |
26 |
4 files changed, 268 insertions(+), 6 deletions(-) |
27 |
|
28 |
diff --git a/net-misc/gns3-server/Manifest b/net-misc/gns3-server/Manifest |
29 |
index cd72eb35b74..0ce776a9a16 100644 |
30 |
--- a/net-misc/gns3-server/Manifest |
31 |
+++ b/net-misc/gns3-server/Manifest |
32 |
@@ -1 +1,2 @@ |
33 |
DIST gns3-server-2.1.21.tar.gz 1713993 BLAKE2B 719306e05fd86b22b7413a60eb6fccc0d16a25cc3a34850344124433d0871bce5e85b195386615c1eaebf083295775de4031eee93c477bb8bd07078b839b2ee1 SHA512 3aeb7609f0fad3cf239a4de24affb124b5bed4a3af78c6a6e287a1b771e206c476849a04cf4ab731ce4923ca072d66928068fec5720bc0eb81d6819ed63f71c8 |
34 |
+DIST gns3-server-2.2.8.tar.gz 11248484 BLAKE2B 14843a86c0348b92e9c54af5c966f46249f72ef9aa74fc8cda27f3209d00d2e129df98c75f301d8fe2046fb1c04f3e24e163adbead787fed2c1d364c50228902 SHA512 3394d368c986ce8378739bdbc15359c46bdf787a38e18bae9035653dd6dc6683973bf1b7952137189f57fd83074f3d5ea6040f5d7a1d0503f6cf21d2835cd693 |
35 |
|
36 |
diff --git a/net-misc/gns3-server/files/gns3-server-rmraven.patch b/net-misc/gns3-server/files/gns3-server-rmraven.patch |
37 |
new file mode 100644 |
38 |
index 00000000000..612a16aecae |
39 |
--- /dev/null |
40 |
+++ b/net-misc/gns3-server/files/gns3-server-rmraven.patch |
41 |
@@ -0,0 +1,194 @@ |
42 |
+From c63aad8eca00bca2ec48fcb667bbdfd80a22a7ab Mon Sep 17 00:00:00 2001 |
43 |
+From: grossmj <grossmj@××××.net> |
44 |
+Date: Tue, 19 May 2020 15:48:53 +0930 |
45 |
+Subject: [PATCH] Replace Raven by Sentry SDK. Fixes |
46 |
+ https://github.com/GNS3/gns3-server/issues/1758 |
47 |
+ |
48 |
+--- |
49 |
+ gns3server/crash_report.py | 93 ++++++++++++++++++++------------------ |
50 |
+ gns3server/web/route.py | 2 +- |
51 |
+ requirements.txt | 3 +- |
52 |
+ 3 files changed, 53 insertions(+), 45 deletions(-) |
53 |
+ |
54 |
+diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py |
55 |
+index 87e22a213..7f92d38e6 100644 |
56 |
+--- a/gns3server/crash_report.py |
57 |
++++ b/gns3server/crash_report.py |
58 |
+@@ -15,22 +15,21 @@ |
59 |
+ # You should have received a copy of the GNU General Public License |
60 |
+ # along with this program. If not, see <http://www.gnu.org/licenses/>. |
61 |
+ |
62 |
++try: |
63 |
++ import sentry_sdk |
64 |
++ from sentry_sdk.integrations.aiohttp import AioHttpIntegration |
65 |
++ SENTRY_SDK_AVAILABLE = True |
66 |
++except ImportError: |
67 |
++ # Sentry SDK is not installed with deb package in order to simplify packaging |
68 |
++ SENTRY_SDK_AVAILABLE = False |
69 |
++ |
70 |
+ import os |
71 |
+ import sys |
72 |
+ import struct |
73 |
+-import aiohttp |
74 |
+ import platform |
75 |
+ import locale |
76 |
+ import distro |
77 |
+ |
78 |
+-try: |
79 |
+- import raven |
80 |
+- from raven.transport.http import HTTPTransport |
81 |
+- RAVEN_AVAILABLE = True |
82 |
+-except ImportError: |
83 |
+- # raven is not installed with deb package in order to simplify packaging |
84 |
+- RAVEN_AVAILABLE = False |
85 |
+- |
86 |
+ from .version import __version__, __version_info__ |
87 |
+ from .config import Config |
88 |
+ from .utils.get_resource import get_resource |
89 |
+@@ -59,48 +58,45 @@ class CrashReport: |
90 |
+ """ |
91 |
+ |
92 |
+ DSN = "https://dbfb677c73304b1286aef33dfbb749c6:93b9a937d4884426a1b15f37536fcd94@××××××××××××××××××××.io/38482" |
93 |
+- if hasattr(sys, "frozen"): |
94 |
+- cacert = get_resource("cacert.pem") |
95 |
+- if cacert is not None and os.path.isfile(cacert): |
96 |
+- DSN += "?ca_certs={}".format(cacert) |
97 |
+- else: |
98 |
+- log.warning("The SSL certificate bundle file '{}' could not be found".format(cacert)) |
99 |
+ _instance = None |
100 |
+ |
101 |
+ def __init__(self): |
102 |
+- self._client = None |
103 |
+ |
104 |
+- # We don't want sentry making noise if an error is catched when you don't have internet |
105 |
++ # We don't want sentry making noise if an error is caught when you don't have internet |
106 |
+ sentry_errors = logging.getLogger('sentry.errors') |
107 |
+ sentry_errors.disabled = True |
108 |
+ |
109 |
+ sentry_uncaught = logging.getLogger('sentry.errors.uncaught') |
110 |
+ sentry_uncaught.disabled = True |
111 |
+ |
112 |
+- def capture_exception(self, request=None): |
113 |
+- if not RAVEN_AVAILABLE: |
114 |
+- return |
115 |
+- if os.path.exists(".git"): |
116 |
+- log.warning("A .git directory exist crash report is turn off for developers") |
117 |
+- return |
118 |
+- server_config = Config.instance().get_section_config("Server") |
119 |
+- if server_config.getboolean("report_errors"): |
120 |
+- if self._client is None: |
121 |
+- self._client = raven.Client(CrashReport.DSN, release=__version__, raise_send_errors=True, transport=HTTPTransport) |
122 |
+- if request is not None: |
123 |
+- self._client.http_context({ |
124 |
+- "method": request.method, |
125 |
+- "url": request.path, |
126 |
+- "data": request.json, |
127 |
+- }) |
128 |
+- |
129 |
+- context = { |
130 |
++ if SENTRY_SDK_AVAILABLE: |
131 |
++ cacert = None |
132 |
++ if hasattr(sys, "frozen"): |
133 |
++ cacert_resource = get_resource("cacert.pem") |
134 |
++ if cacert_resource is not None and os.path.isfile(cacert_resource): |
135 |
++ cacert = cacert_resource |
136 |
++ else: |
137 |
++ log.error("The SSL certificate bundle file '{}' could not be found".format(cacert_resource)) |
138 |
++ |
139 |
++ sentry_sdk.init(dsn=CrashReport.DSN, |
140 |
++ release=__version__, |
141 |
++ ca_certs=cacert, |
142 |
++ integrations=[AioHttpIntegration()]) |
143 |
++ |
144 |
++ tags = { |
145 |
+ "os:name": platform.system(), |
146 |
+ "os:release": platform.release(), |
147 |
+ "os:win_32": " ".join(platform.win32_ver()), |
148 |
+ "os:mac": "{} {}".format(platform.mac_ver()[0], platform.mac_ver()[2]), |
149 |
+ "os:linux": " ".join(distro.linux_distribution()), |
150 |
+- "aiohttp:version": aiohttp.__version__, |
151 |
++ |
152 |
++ } |
153 |
++ |
154 |
++ with sentry_sdk.configure_scope() as scope: |
155 |
++ for key, value in tags.items(): |
156 |
++ scope.set_tag(key, value) |
157 |
++ |
158 |
++ extra_context = { |
159 |
+ "python:version": "{}.{}.{}".format(sys.version_info[0], |
160 |
+ sys.version_info[1], |
161 |
+ sys.version_info[2]), |
162 |
+@@ -113,8 +109,8 @@ def capture_exception(self, request=None): |
163 |
+ # add locale information |
164 |
+ try: |
165 |
+ language, encoding = locale.getlocale() |
166 |
+- context["locale:language"] = language |
167 |
+- context["locale:encoding"] = encoding |
168 |
++ extra_context["locale:language"] = language |
169 |
++ extra_context["locale:encoding"] = encoding |
170 |
+ except ValueError: |
171 |
+ pass |
172 |
+ |
173 |
+@@ -124,17 +120,28 @@ def capture_exception(self, request=None): |
174 |
+ if os.path.isfile(gns3vm_version): |
175 |
+ try: |
176 |
+ with open(gns3vm_version) as fd: |
177 |
+- context["gns3vm:version"] = fd.readline().strip() |
178 |
++ extra_context["gns3vm:version"] = fd.readline().strip() |
179 |
+ except OSError: |
180 |
+ pass |
181 |
+ |
182 |
+- self._client.tags_context(context) |
183 |
++ with sentry_sdk.configure_scope() as scope: |
184 |
++ for key, value in extra_context.items(): |
185 |
++ scope.set_extra(key, value) |
186 |
++ |
187 |
++ def capture_exception(self): |
188 |
++ if not SENTRY_SDK_AVAILABLE: |
189 |
++ return |
190 |
++ if os.path.exists(".git"): |
191 |
++ log.warning(".git directory detected, crash reporting is turned off for developers.") |
192 |
++ return |
193 |
++ server_config = Config.instance().get_section_config("Server") |
194 |
++ if server_config.getboolean("report_errors"): |
195 |
++ |
196 |
+ try: |
197 |
+- report = self._client.captureException() |
198 |
++ sentry_sdk.capture_exception() |
199 |
++ log.info("Crash report sent with event ID: {}".format(sentry_sdk.last_event_id())) |
200 |
+ except Exception as e: |
201 |
+ log.error("Can't send crash report to Sentry: {}".format(e)) |
202 |
+- return |
203 |
+- log.info("Crash report sent with event ID: {}".format(self._client.get_ident(report))) |
204 |
+ |
205 |
+ @classmethod |
206 |
+ def instance(cls): |
207 |
+diff --git a/gns3server/web/route.py b/gns3server/web/route.py |
208 |
+index d1275250d..c70dbbc3a 100644 |
209 |
+--- a/gns3server/web/route.py |
210 |
++++ b/gns3server/web/route.py |
211 |
+@@ -242,7 +242,7 @@ async def control_schema(request): |
212 |
+ log.error("Uncaught exception detected: {type}".format(type=type(e)), exc_info=1) |
213 |
+ response = Response(request=request, route=route) |
214 |
+ response.set_status(500) |
215 |
+- CrashReport.instance().capture_exception(request) |
216 |
++ CrashReport.instance().capture_exception() |
217 |
+ exc_type, exc_value, exc_tb = sys.exc_info() |
218 |
+ lines = traceback.format_exception(exc_type, exc_value, exc_tb) |
219 |
+ if api_version is not None: |
220 |
+diff --git a/requirements.txt b/requirements.txt |
221 |
+index 57fbb7938..0af9e0d68 100644 |
222 |
+--- a/requirements.txt |
223 |
++++ b/requirements.txt |
224 |
+@@ -4,9 +4,10 @@ jsonschema==2.6.0; python_version < '3.8' # pyup: ignore |
225 |
+ aiohttp==3.6.2 |
226 |
+ aiohttp-cors==0.7.0 |
227 |
+ aiofiles==0.4.0 |
228 |
++aiocontextvars==0.2.2 |
229 |
+ async_generator>=1.10 |
230 |
+ Jinja2>=2.7.3 |
231 |
+-raven>=5.23.0 |
232 |
++sentry-sdk>=0.14.4 |
233 |
+ psutil==5.6.6 |
234 |
+ async-timeout==3.0.1 |
235 |
+ distro>=1.3.0 |
236 |
|
237 |
diff --git a/net-misc/gns3-server/gns3-server-2.2.8.ebuild b/net-misc/gns3-server/gns3-server-2.2.8.ebuild |
238 |
new file mode 100644 |
239 |
index 00000000000..ed01d69a265 |
240 |
--- /dev/null |
241 |
+++ b/net-misc/gns3-server/gns3-server-2.2.8.ebuild |
242 |
@@ -0,0 +1,71 @@ |
243 |
+# Copyright 1999-2020 Gentoo Authors |
244 |
+# Distributed under the terms of the GNU General Public License v2 |
245 |
+ |
246 |
+EAPI=7 |
247 |
+PYTHON_COMPAT=( python3_{7,8} ) |
248 |
+ |
249 |
+inherit distutils-r1 |
250 |
+ |
251 |
+DESCRIPTION="GNS3 server to asynchronously manage emulators" |
252 |
+HOMEPAGE="https://www.gns3.net/" |
253 |
+SRC_URI="https://github.com/GNS3/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
254 |
+ |
255 |
+LICENSE="GPL-3+" |
256 |
+SLOT="0" |
257 |
+KEYWORDS="~amd64 ~x86" |
258 |
+ |
259 |
+RDEPEND=" |
260 |
+ >=app-emulation/dynamips-0.2.18 |
261 |
+ >=dev-python/aiofiles-0.4.0[${PYTHON_USEDEP}] |
262 |
+ >=dev-python/aiohttp-3.6.2[${PYTHON_USEDEP}] |
263 |
+ >=dev-python/aiohttp-cors-0.7.0-r1[${PYTHON_USEDEP}] |
264 |
+ >=dev-python/async_generator-1.10[${PYTHON_USEDEP}] |
265 |
+ >=dev-python/async_timeout-3.0.1[${PYTHON_USEDEP}] |
266 |
+ >=dev-python/jinja-2.7.3[${PYTHON_USEDEP}] |
267 |
+ $(python_gen_cond_dep '>=dev-python/jsonschema-3.2.0:=[${PYTHON_USEDEP}]' 'python3_8') |
268 |
+ $(python_gen_cond_dep '<=dev-python/jsonschema-2.6.0:=[${PYTHON_USEDEP}]' 'python3_7') |
269 |
+ >=dev-python/psutil-5.7.0[${PYTHON_USEDEP}] |
270 |
+ dev-python/py-cpuinfo[${PYTHON_USEDEP}] |
271 |
+ >=dev-python/sentry-sdk-0.14.4[${PYTHON_USEDEP}] |
272 |
+ >=dev-python/yarl-1.4.2[${PYTHON_USEDEP}] |
273 |
+ >=net-misc/ubridge-0.9.14 |
274 |
+" |
275 |
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]" |
276 |
+ |
277 |
+PATCHES=( "${FILESDIR}/gns3-server-rmraven.patch" ) |
278 |
+ |
279 |
+src_prepare() { |
280 |
+ default |
281 |
+ |
282 |
+ # newer psutils is fine |
283 |
+ sed -i -e '/psutil==5.6.6/d' requirements.txt || die "fixing requirements failed" |
284 |
+ |
285 |
+ # We don't support <py3.7 |
286 |
+ sed -i -e '/aiocontextvars==0.2.2/d' requirements.txt || die "fixing requirements failed" |
287 |
+ sed -i -e '/yarl==1.3.0/d' requirements.txt || die "fixing requirements failed 2" |
288 |
+ |
289 |
+ #Remove Pre-built busybox binary |
290 |
+ rm gns3server/compute/docker/resources/bin/busybox || die |
291 |
+ |
292 |
+ # Package installs 'tests' package which is forbidden |
293 |
+ rm -rf tests || die |
294 |
+ eapply_user |
295 |
+} |
296 |
+ |
297 |
+python_install() { |
298 |
+ distutils-r1_python_install |
299 |
+ |
300 |
+ mkdir -p "${D}$(python_get_sitedir)/gns3server/compute/docker/resources/bin" || die |
301 |
+ ln -s /bin/busybox "${D}$(python_get_sitedir)/gns3server/compute/docker/resources/bin/busybox" || die |
302 |
+} |
303 |
+ |
304 |
+pkg_postinst() { |
305 |
+ elog "net-misc/gns3-server has several optional packages that must be merged manually for additional functionality." |
306 |
+ elog "" |
307 |
+ elog "The following is a list of packages that can be added:" |
308 |
+ elog "app-emulation/qemu, app-emulation/virtualbox" |
309 |
+ elog "app-emulation/docker and net-analyzer/wireshark" |
310 |
+ elog "" |
311 |
+ elog "The following packages are currently unsupported:" |
312 |
+ elog "iouyap and vpcs" |
313 |
+} |
314 |
|
315 |
diff --git a/net-misc/gns3-server/metadata.xml b/net-misc/gns3-server/metadata.xml |
316 |
index e4aa7df0de5..09439c8762b 100644 |
317 |
--- a/net-misc/gns3-server/metadata.xml |
318 |
+++ b/net-misc/gns3-server/metadata.xml |
319 |
@@ -2,12 +2,8 @@ |
320 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
321 |
<pkgmetadata> |
322 |
<maintainer type="person"> |
323 |
- <email>onigino@××××××××××.com</email> |
324 |
- <name>Gino McCarty</name> |
325 |
- </maintainer> |
326 |
- <maintainer type="project"> |
327 |
- <email>proxy-maint@g.o</email> |
328 |
- <name>Proxy Maintainers</name> |
329 |
+ <email>bman@g.o</email> |
330 |
+ <name>Aaron Bauman</name> |
331 |
</maintainer> |
332 |
<upstream> |
333 |
<remote-id type="sourceforge">gns-3</remote-id> |