Bug 1846175

Summary: Review Request: trojan - an unidentifiable proxy software
Product: [Fedora] Fedora Reporter: Qiyu Yan <yanqiyu01>
Component: Package ReviewAssignee: Jerry James <loganjerry>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: dan.cermak, loganjerry, package-review, robinlee.sysu, yanqiyu01
Target Milestone: ---Flags: loganjerry: fedora-review+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-20 08:49:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Qiyu Yan 2020-06-11 00:30:13 UTC
SPEC file: https://raw.githubusercontent.com/karuboniru/trojan-rpmbuild/master/trojan.spec

SRPM file: https://kojipkgs.fedoraproject.org//work/tasks/3105/45683105/trojan-1.16.0-4.fc32.src.rpm

koji scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=45683104

fedora-review results can be found here: https://github.com/karuboniru/trojan-rpmbuild/issues/2

Description: An unidentifiable mechanism that helps you bypass GFW.

Fedora Account System Username: yanqiyu

Comment 1 Qiyu Yan 2020-06-11 00:31:30 UTC
Requesting sponsor for this. Have introduced myself on the devel mailing list and this is my first package submitted for review.

Comment 4 Qiyu Yan 2020-06-13 04:02:53 UTC
(In reply to yanqiyu01 from comment #3)
> Ran fedora-review my self and fix the SPEC file to meet the guideline:
> 
> SPEC URL (link unchanged):
> https://copr.fedorainfracloud.org/coprs/yanqiyu/trojan/build/1446213/
> 
> new COPR build:
> https://copr.fedorainfracloud.org/coprs/yanqiyu/trojan/build/1446847/
> 
> new koji scratch build:
> https://koji.fedoraproject.org/koji/taskinfo?taskID=45640323
> 
> new SRPM URL:
> https://download.copr.fedorainfracloud.org/results/yanqiyu/trojan/fedora-
> rawhide-x86_64/01446847-trojan/trojan-1.16.0-2.fc33.src.rpm
> 
> And a fedora-review result:
> https://github.com/karuboniru/trojan-rpmbuild/issues/1
> 
> I hope this can make reviewing easier.

fix typo 
SPEC URL (link unchanged):https://raw.githubusercontent.com/karuboniru/trojan-rpmbuild/master/trojan.spec

Comment 5 Dan Čermák 2020-06-13 14:25:39 UTC
This is mostly ok, a few things should be addressed though:

- Upstream's license is not a vanilla GPLv3+, you should check with legal how to proceed in this case.
- your BuildRequires are lacking version numbers (e.g. BuildRequires: boost-devel >= 1.66)
- use %autosetup -p1 instead of %setup and %patch
- use %make_build and %make_install instead of make %{?_smp_mflags}
- don't glob the files in %_bindir and %_unitdir, as this is just 1 file each, simply write: %{_bindir}/%{name}
- your package should own %{_sysconfdir}/trojan via: %dir %{_sysconfdir}/trojan
- add the note in the patch (why it exists) to the spec file
- upstream provides gpg signatures, please use %gpgverify to check the sources for consistency as described here: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_source_file_verification
- upstream has a test suite, but it is not run in %check, is that intentional?

Comment 6 Qiyu Yan 2020-06-13 16:24:09 UTC
Thank you for your review!

(In reply to dan.cermak from comment #5)
> This is mostly ok, a few things should be addressed though:
> 
> - Upstream's license is not a vanilla GPLv3+, you should check with legal
> how to proceed in this case.
Upstream license is https://github.com/trojan-gfw/trojan/blob/master/LICENSE, isn't that a GPLv3+, I can see some file without a license, which are mostly documents and test cases. Really I don't know the difference. After all, how do I contact legal team?

> - your BuildRequires are lacking version numbers (e.g. BuildRequires:
> boost-devel >= 1.66)
> - use %autosetup -p1 instead of %setup and %patch
> - use %make_build and %make_install instead of make %{?_smp_mflags}
> - don't glob the files in %_bindir and %_unitdir, as this is just 1 file
> each, simply write: %{_bindir}/%{name}
I will fix those then.

> - your package should own %{_sysconfdir}/trojan via: %dir
> %{_sysconfdir}/trojan
This has been fixed in the latest source. Which you can see in the modified comment 0

> - add the note in the patch (why it exists) to the spec file
This patch was removed, instead I modified the shipped configuration files, I will comment this in spec file.

> - upstream provides gpg signatures, please use %gpgverify to check the
> sources for consistency as described here:
> https://docs.fedoraproject.org/en-US/packaging-guidelines/
> #_source_file_verification
I will fix this.

> - upstream has a test suite, but it is not run in %check, is that
> intentional?
Yes, those tests won't run in a mock build environment. Maybe something related to network, in this test, it will open an instance to listen on certain port and another will try to connect. But this fails inside the container. Those will pass when build with rpmbuild without mock (same srpm file)

Comment 7 Qiyu Yan 2020-06-13 16:46:08 UTC
I see, the difference in license with vanilla GPLv3 is a exception to link this code against openssl. Should I set a blocker for FE-Legal or send a mail to legal.org?

Comment 8 Qiyu Yan 2020-06-13 17:03:26 UTC
For the test, maybe I lost some build dependencies, I will check tomorrow.

Comment 9 Qiyu Yan 2020-06-14 02:33:46 UTC
Since I have already dropped the patch, I am still using %setup, will that be fine?

And the legal problem, I posted that on legal mailing list[1]. One reply says that:
> This appears to be identical to the OpenSSL linking exception appended
> to the GPLv2 license file in cryptsetup
> (https://gitlab.com/cryptsetup/cryptsetup/-/blob/master/COPYING). It's
> one of a number of OpenSSL linking exceptions that have been in use by
> GPL projects.
I am doing further check if this can be a problem. 

For all other SPEC file problem, they all have been fixed:

new SPEC file: https://raw.githubusercontent.com/karuboniru/trojan-rpmbuild/master/trojan.spec

new SRPM file: https://kojipkgs.fedoraproject.org//work/tasks/3105/45683105/trojan-1.16.0-4.fc32.src.rpm

new koji scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=45683104

fedora-review results can be found here: https://github.com/karuboniru/trojan-rpmbuild/issues/2

* since COPR is down now, I can't build on COPR

* for the crypto-policy-non-compliance-openssl warning, the shipped configuration will set "cipher": "PROFILE=SYSTEM", so that is no violence with the guideline, I think

* for the invalid-url URL in my fedora-review result, that is because my network situation here

[1] https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/MJUOORX66O65W73JMO4UN64KSNHOPQCI/

Comment 10 Qiyu Yan 2020-06-19 08:48:09 UTC
Update: 
Richard Fontana <rfontana> replied that:
> It seems to me it could be used with either GPLv2 or GPLv3 (though
> it's worded like a pre-GPLv2 "exception").

So the legal problem is solved. Will anyone continue this?

Comment 11 Jerry James 2020-06-19 16:18:02 UTC
I will take this review.  Do you still need a sponsor?

Comment 12 Jerry James 2020-06-19 16:51:19 UTC
This looks good.  If you still need a sponsor, send email to me at loganjerry so we can discuss the matter.

Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated

===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
[x]: License file installed when any subpackage combination is installed.
[x]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/lib/systemd,
     /usr/lib/systemd/system

     This is normal for simple systemd services.

[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 40960 bytes in 11 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: %config files are marked noreplace or the reason is justified.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: No %config files under /usr.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: systemd_post is invoked in %post, systemd_preun in %preun, and
     systemd_postun in %postun for Systemd service files.
     Note: Systemd service file(s) in trojan
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Fully versioned dependency in subpackages if applicable.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: No rpmlint messages.
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.

Rpmlint
-------
Checking: trojan-1.16.0-4.fc33.x86_64.rpm
          trojan-debuginfo-1.16.0-4.fc33.x86_64.rpm
          trojan-debugsource-1.16.0-4.fc33.x86_64.rpm
          trojan-1.16.0-4.fc33.src.rpm
trojan.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/trojan SSL_CTX_set_cipher_list
trojan.src: W: invalid-url Source2: https://pgp.key-server.io/0xA1DDD486533B0112 HTTP Error 502: Bad Gateway
4 packages and 0 specfiles checked; 0 errors, 2 warnings.

Rpmlint (debuginfo)
-------------------
Checking: trojan-debuginfo-1.16.0-4.fc33.x86_64.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.

Rpmlint (installed packages)
----------------------------
trojan.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/trojan SSL_CTX_set_cipher_list
3 packages and 0 specfiles checked; 0 errors, 1 warnings.

- The crypto-policy-non-compliance-openssl complaint is not an issue, because
  the packaged config file contains this:

  "cipher": "PROFILE=SYSTEM",
  "cipher_tls13": "PROFILE=SYSTEM",

Source checksums
----------------
https://pgp.key-server.io/0xA1DDD486533B0112 :
  CHECKSUM(SHA256) this package     : c8d4357bf02b6d4dcd2e595c957ce51186e34191be3a212c88dc3640d362d514
  CHECKSUM(SHA256) upstream package : c8d4357bf02b6d4dcd2e595c957ce51186e34191be3a212c88dc3640d362d514
https://github.com/trojan-gfw/trojan/releases/download/v1.16.0/trojan-1.16.0.tar.gz.asc :
  CHECKSUM(SHA256) this package     : a8bf500051427345b537bc98698f16e0a43c3b1e4e9218561a4575c510c3605c
  CHECKSUM(SHA256) upstream package : a8bf500051427345b537bc98698f16e0a43c3b1e4e9218561a4575c510c3605c
https://github.com/trojan-gfw/trojan/archive/v1.16.0.tar.gz#/trojan-1.16.0.tar.gz :
  CHECKSUM(SHA256) this package     : 86cdb2685bb03a63b62ce06545c41189952f1ec4a0cd9147450312ed70956cbc
  CHECKSUM(SHA256) upstream package : 86cdb2685bb03a63b62ce06545c41189952f1ec4a0cd9147450312ed70956cbc

Requires
--------
trojan (rpmlib, GLIBC filtered):
    /bin/sh
    config(trojan)
    libboost_program_options.so.1.73.0()(64bit)
    libc.so.6()(64bit)
    libcrypto.so.1.1()(64bit)
    libcrypto.so.1.1(OPENSSL_1_1_0)(64bit)
    libgcc_s.so.1()(64bit)
    libgcc_s.so.1(GCC_3.0)(64bit)
    libmariadb.so.3()(64bit)
    libmariadb.so.3(libmysqlclient_18)(64bit)
    libpthread.so.0()(64bit)
    libssl.so.1.1()(64bit)
    libssl.so.1.1(OPENSSL_1_1_0)(64bit)
    libssl.so.1.1(OPENSSL_1_1_1)(64bit)
    libstdc++.so.6()(64bit)
    libstdc++.so.6(CXXABI_1.3)(64bit)
    rtld(GNU_HASH)

trojan-debuginfo (rpmlib, GLIBC filtered):

trojan-debugsource (rpmlib, GLIBC filtered):

Provides
--------
trojan:
    config(trojan)
    trojan
    trojan(x86-64)

trojan-debuginfo:
    debuginfo(build-id)
    trojan-debuginfo
    trojan-debuginfo(x86-64)

trojan-debugsource:
    trojan-debugsource
    trojan-debugsource(x86-64)

Generated by fedora-review 0.7.5 (5fa5b7e) last change: 2020-02-16
Command line :/usr/bin/fedora-review -b 1846175 -m fedora-rawhide-x86_64
Buildroot used: fedora-rawhide-x86_64
Active plugins: Shell-api, Generic, C/C++
Disabled plugins: Haskell, R, Ocaml, Ruby, fonts, Perl, SugarActivity, Python, Java, PHP
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 13 Jerry James 2020-06-19 20:10:28 UTC
This package is APPROVED.  I have sponsored yanqiyu into the packager group.

Comment 14 Gwyn Ciesla 2020-06-20 04:16:52 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/trojan

Comment 15 Fedora Update System 2020-06-21 00:11:31 UTC
FEDORA-2020-f2a359582a has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-f2a359582a

Comment 16 Fedora Update System 2020-06-21 00:19:43 UTC
FEDORA-2020-d0339317fe has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-d0339317fe

Comment 17 Fedora Update System 2020-06-23 01:04:00 UTC
FEDORA-2020-f2a359582a has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2020-f2a359582a \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-f2a359582a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2020-06-23 01:53:54 UTC
FEDORA-2020-d0339317fe has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2020-d0339317fe \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-d0339317fe

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Fedora Update System 2020-07-01 01:35:47 UTC
FEDORA-2020-d0339317fe has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 20 Fedora Update System 2020-07-01 01:49:15 UTC
FEDORA-2020-f2a359582a has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.