Bug 1491492 - Review Request: coturn - TURN/STUN & ICE Server
Summary: Review Request: coturn - TURN/STUN & ICE Server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-14 00:46 UTC by Christian Glombek
Modified: 2019-03-10 18:23 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-10 18:23:12 UTC
Type: ---
Embargoed:
zebob.m: fedora-review+


Attachments (Terms of Use)

Comment 1 Robert-André Mauchin 🐧 2017-09-14 18:12:37 UTC
You don't seem to be a member of the Packager Group. Please read https://fedoraproject.org/wiki/Join_the_package_collection_maintainers on how to becoming a member. You'll need a sponsor (FE-NEEDSPONSOR), introduce yourself on the fedora-devel mailing list and do informal package reviews to show a potential sponsor that you understand the Packaging Guidelines.


Regarding the package itself:

 - That's not how you package a systemd service file. Check https://fedoraproject.org/wiki/Packaging:Scriptlets?rd=Packaging:ScriptletSnippets#Systemd


%post
/bin/systemctl --system daemon-reload

%preun
if [ $1 = 0 ]; then
  /bin/systemctl stop turnserver.service
  /bin/systemctl disable turnserver.service 2> /dev/null
fi

%postun
/bin/systemctl --system daemon-reload

   should be:

%post
%systemd_user_post turnserver.service

%preun
%systemd_user_preun turnserver.service


  with a special BR:

%{?systemd_requires}
BuildRequires: systemd


 - That's not how to add a group and user:

%pre
%{_sbindir}/groupadd -r turnserver 2> /dev/null || :
%{_sbindir}/useradd -r -g turnserver -s /bin/false -c "TURN Server daemon" -d \
%{_datadir}/%{name} turnserver 2> /dev/null || :

  See: https://fedoraproject.org/wiki/Packaging:UsersAndGroups

  You need:

Requires(pre): shadow-utils

  Then:

%pre
getent group GROUPNAME >/dev/null || groupadd -r turnserver
getent passwd USERNAME >/dev/null || \
    useradd -r -g turnserver -d %{_datadir}/%{name} -s /sbin/nologin \
    -c "TURN Server daemon" turnserver
exit 0


 - %defattr(-,root,root) is not needed in %files

 - You can use * in %files instead of listead each file one by one.

Comment 2 Christian Glombek 2017-09-16 16:01:49 UTC
Thanks for the review! I've adresse the issues and updated the spec.

I'll be writing a proper self-introduction soon :)

Comment 4 Robert-André Mauchin 🐧 2018-02-19 23:26:42 UTC
 - Simplify your %files.
coturn-turnserver.service is not a config file and should rot be marked as %config.
Don't mark the manpages as %doc
Don't add the .gz extension for man pages, use .* instead because the compression could change in the future.


%files
%license %{_docdir}/%{name}/LICENSE
%{_bindir}/turnserver
%{_bindir}/turnadmin
%attr(0750,coturn,coturn) %{_localstatedir}/run/%{name}
%attr(0640,coturn,coturn) %{_localstatedir}/db/turndb
%{_unitdir}/coturn-turnserver.service
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%config %{_sysconfdir}/sysusers.d/coturn.conf
%config %{_tmpfilesdir}/coturn.conf
%dir %attr(-,coturn,coturn) %{_sysconfdir}/%{name}
%config(noreplace) %attr(0644,coturn,coturn) %{_sysconfdir}/%{name}/turnserver.conf
%doc %{_docdir}/%{name}
%exclude %doc %{_docdir}/%{name}/README.turnutils
%exclude %doc %{_docdir}/%{name}/LICENSE
%{_mandir}/man1/coturn.1.*
%{_mandir}/man1/turnserver.1.*
%{_mandir}/man1/turnadmin.1.*
%{_datadir}/%{name}

%files utils
%{_bindir}/turnutils_peer
%{_bindir}/turnutils_stunclient
%{_bindir}/turnutils_uclient
%{_bindir}/turnutils_oauth
%{_bindir}/turnutils_natdiscovery
%{_datadir}/%{name}/etc/turn_client_cert.pem
%{_datadir}/%{name}/etc/turn_client_pkey.pem
%{_mandir}/man1/turnutils.1.*
%{_mandir}/man1/turnutils_*.1.*
%doc %{_docdir}/%{name}/README.turnutils


%files client-libs
%license %{_docdir}/%{name}/LICENSE
%{_libdir}/libturnclient.a


%files client-devel
%{_includedir}/turn

Comment 5 Robert-André Mauchin 🐧 2018-02-20 01:57:18 UTC
 - Shouldn't be marked as %config:

%config %{_tmpfilesdir}/coturn.conf

 - Manpages are wrongly marked as executables, remove the executable bits and notify upstream:

coturn.x86_64: W: spurious-executable-perm /usr/share/man/man1/coturn.1.gz
coturn.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnadmin.1.gz
coturn.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnserver.1.gz
coturn-utils.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnutils.1.gz
coturn-utils.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnutils_natdiscovery.1.gz
coturn-utils.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnutils_oauth.1.gz
coturn-utils.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnutils_peer.1.gz
coturn-utils.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnutils_stunclient.1.gz
coturn-utils.x86_64: W: spurious-executable-perm /usr/share/man/man1/turnutils_uclient.1.gz

 - Remove Rpath:

coturn.x86_64: E: binary-or-shlib-defines-rpath /usr/bin/turnadmin ['/usr/lib/', '/usr/local/lib/', '/usr/lib64/', '/usr/local/lib64/', '/usr/lib64/pgsql', '/usr/local/lib']
coturn.x86_64: E: binary-or-shlib-defines-rpath /usr/bin/turnserver ['/usr/lib/', '/usr/local/lib/', '/usr/lib64/', '/usr/local/lib64/', '/usr/lib64/pgsql', '/usr/local/lib']
coturn-utils.x86_64: E: binary-or-shlib-defines-rpath /usr/bin/turnutils_natdiscovery ['/usr/lib/', '/usr/local/lib/', '/usr/lib64/', '/usr/local/lib64/', '/usr/lib64/pgsql', '/usr/local/lib']
coturn-utils.x86_64: E: binary-or-shlib-defines-rpath /usr/bin/turnutils_oauth ['/usr/lib/', '/usr/local/lib/', '/usr/lib64/', '/usr/local/lib64/', '/usr/lib64/pgsql', '/usr/local/lib']
coturn-utils.x86_64: E: binary-or-shlib-defines-rpath /usr/bin/turnutils_peer ['/usr/lib/', '/usr/local/lib/', '/usr/lib64/', '/usr/local/lib64/', '/usr/lib64/pgsql', '/usr/local/lib']
coturn-utils.x86_64: E: binary-or-shlib-defines-rpath /usr/bin/turnutils_stunclient ['/usr/lib/', '/usr/local/lib/', '/usr/lib64/', '/usr/local/lib64/', '/usr/lib64/pgsql', '/usr/local/lib']
coturn-utils.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/turnutils_uclient SSL_CTX_set_cipher_list
coturn-utils.x86_64: E: binary-or-shlib-defines-rpath /usr/bin/turnutils_uclient ['/usr/lib/', '/usr/local/lib/', '/usr/lib64/', '/usr/local/lib64/', '/usr/lib64/pgsql', '/usr/local/lib']

%configure --confdir=%{_sysconfdir}/%{name} \
    --examplesdir=%{_datadir}/%{name} \
    --schemadir=%{_datadir}/%{name} \
    --manprefix=%{_datadir} \
    --docdir=%{_docdir}/%{name} \
    --disable-rpath

 - I find curious to install the examples in %{_datadir}/%{name} They generally are included in %doc.

 - Read this bit about shipping static library and act accordingly: https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Packaging_Static_Libraries_2

 - Should not be executable either:

coturn-client-libs.x86_64: W: spurious-executable-perm /usr/lib64/libturnclient.a

 - Rpmlint gives more error which I don't really know how to solve, might ask some help on -devel:

missing-call-to-setgroups-before-setuid:
This executable is calling setuid and setgid without secoturn.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/turnadmin SSL_CTX_set_cipher_list
coturn.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/turnserver SSL_CTX_set_cipher_list
coturn-utils.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/turnutils_uclient SSL_CTX_set_cipher_listtgroups or initgroups.
There is a high probability this means it didn't relinquish all groups, and
this would be a potential security issue to be fixed. Seek POS36-C on the web
for details about the problem.

coturn.x86_64: E: missing-call-to-setgroups-before-setuid /usr/bin/turnadmin
coturn.x86_64: E: missing-call-to-setgroups-before-setuid /usr/bin/turnserver

  - Another error

crypto-policy-non-compliance-openssl:
This application package calls a function to explicitly set crypto ciphers for
SSL/TLS. That may cause the application not to use the system-wide set
cryptographic policy and should be modified in accordance to:
https://fedoraproject.org/wiki/Packaging:CryptoPolicies


coturn.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/turnadmin SSL_CTX_set_cipher_list
coturn.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/turnserver SSL_CTX_set_cipher_list
coturn-utils.x86_64: W: crypto-policy-non-compliance-openssl /usr/bin/turnutils_uclient SSL_CTX_set_cipher_list

Comment 6 Patrick Uiterwijk 2018-02-21 16:38:24 UTC
I'll do a full review later today, and if accepted sponsor the author.

Comment 7 Christian Glombek 2018-02-25 19:23:30 UTC
Thanks Robert-André and Patrick!
I made a new build addressing all but one issues.

There are some build warnings:
-Wimplicit-fallthrough and
-Wformat-truncation
These and the missing-call-to-setgroups-before-setuid error need to be fixed in the upstream code, right? If true, I will create issues for them upstream.

All remaining errors and warnings (that I could find) are noted here: https://github.com/LorbusChris/coturn-rpm/issues/3

Spec URL: https://copr-be.cloud.fedoraproject.org/results/lorbus/coturn/fedora-27-x86_64/00720940-coturn/coturn.spec

SRPM URL: https://copr-be.cloud.fedoraproject.org/results/lorbus/coturn/fedora-27-x86_64/00720940-coturn/coturn-4.5.0.7-1.fc27.src.rpm

Comment 8 Christian Glombek 2018-02-26 17:39:07 UTC
And another one: I added a systemd preset to disable the service by default (as well as some other little fixes)

Spec URL: https://copr-be.cloud.fedoraproject.org/results/lorbus/coturn/fedora-27-x86_64/00721250-coturn/coturn.spec

SRPM URL: https://copr-be.cloud.fedoraproject.org/results/lorbus/coturn/fedora-27-x86_64/00721250-coturn/coturn-4.5.0.7-1.fc27.src.rpm

Comment 9 Christian Glombek 2018-02-26 20:41:22 UTC
Had to change back the way the group and user are added. Added notes in the spec where this needs to change once a sysusers.d macro is available.

Spec URL: https://copr-be.cloud.fedoraproject.org/results/lorbus/coturn/fedora-27-x86_64/00721332-coturn/coturn.spec

SRPM URL: https://copr-be.cloud.fedoraproject.org/results/lorbus/coturn/fedora-27-x86_64/00721332-coturn/coturn-4.5.0.7-1.fc27.src.rpm

Comment 12 Robert-André Mauchin 🐧 2019-02-16 15:54:05 UTC
 - Package can't install:

DEBUG util.py:490:  BUILDSTDERR: Error: 
DEBUG util.py:490:  BUILDSTDERR:  Problem: conflicting requests
DEBUG util.py:490:  BUILDSTDERR:   - nothing provides coturn-database = 4.5.1.0-1.fc30 needed by coturn-4.5.1.0-1.fc30.x86_64


 - Typo in dist tag:

Release:        1%{?dist}


 - Use a more appropriate name for your archive:

Source0:        https://github.com/coturn/coturn/archive/%{version}/%{name}-%{version}.tar.gz


 - Don't use %attr(0755,-,-) %attr(0644,-,-) everywhere, ef there is truly permission issues, chmod them in install or better, patch the install script

 - Here GROUPNAME and USERNAME should be replaced weth the correct group and user:

# NOTE: Use the sysusers.d macro when available
getent group GROUPNAME >/dev/null || groupadd -r coturn
getent passwd USERNAME >/dev/null || \
    useradd -r -g coturn -d %{_datadir}/%{name} -s /sbin/nologin \
    -c "TURN Server daemon" coturn
exit 0


 - You did not apply the patch0 you added

 - Fix the changelog entry Version-Release info




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

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


Issues:
=======
- Package installs properly.
  Note: Installation errors (see attachment)
  See: https://fedoraproject.org/wiki/Packaging:Guidelines
- Dist tag is present.


===== 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]: 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]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "BSD 3-clause "New" or "Revised" License", "Expat License",
     "Unknown or generated", "*No copyright* BSD (unspecified)". 103 files
     have unknown license. Detailed output of licensecheck in
     /home/bob/packaging/review/coturn/review-coturn/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[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.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 235520 bytes in 53 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]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[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]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[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 coturn
[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).
[-]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in coturn-
     client-devel , coturn-utils , coturn-debuginfo , coturn-debugsource
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[/]: 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]: 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]: Spec use %global instead of %define unless justified.

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

Generic:
[!]: Rpmlint is run on all installed packages.
     Note: Mock build failed
     See: http://fedoraproject.org/wiki/Packaging/Guidelines#rpmlint
[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: coturn-4.5.1.0-1.fc30.x86_64.rpm
          coturn-client-devel-4.5.1.0-1.fc30.x86_64.rpm
          coturn-utils-4.5.1.0-1.fc30.x86_64.rpm
          coturn-debuginfo-4.5.1.0-1.fc30.x86_64.rpm
          coturn-debugsource-4.5.1.0-1.fc30.x86_64.rpm
          coturn-4.5.1.0-1.fc30.src.rpm
coturn.x86_64: W: spelling-error %description -l en_US balancer -> balance, balances, balanced
coturn.x86_64: W: incoherent-version-in-changelog 4.5.0.7-1 ['4.5.1.0-1.fc30', '4.5.1.0-1']
coturn.x86_64: E: missing-call-to-setgroups-before-setuid /usr/bin/turnadmin
coturn.x86_64: E: missing-call-to-setgroups-before-setuid /usr/bin/turnserver
coturn.x86_64: W: non-standard-uid /etc/coturn coturn
coturn.x86_64: W: non-standard-gid /etc/coturn coturn
coturn.x86_64: W: non-standard-uid /etc/coturn/turnserver.conf coturn
coturn.x86_64: W: non-standard-gid /etc/coturn/turnserver.conf coturn
coturn-client-devel.x86_64: W: no-documentation
coturn.src: W: spelling-error %description -l en_US balancer -> balance, balances, balanced
coturn.src: W: patch-not-applied Patch0: coturn-4.5.0.7-ssl_cipher_lists.patch
6 packages and 0 specfiles checked; 2 errors, 9 warnings.

Comment 14 Robert-André Mauchin 🐧 2019-02-17 17:25:19 UTC
Your changelog entry still has the wrong Version Release info:

Version:        4.5.1.0
Release: 1%{?dist}


* Sun Feb 17 2019 Christian Glombek <lorbus> - 4.5.1.0-1
- Update to 4.5.1.0


Please address this before import. Package approved.

Comment 15 Christian Glombek 2019-02-17 22:05:06 UTC
There still might be some kinks to work out with the init service.
I'll be awaiting feedback on https://github.com/coturn/coturn/issues/171 and request a repo once that is resolved.

Bob, a thousand thanks to you for setting time aside on the weekend to do the review!

Comment 16 Gwyn Ciesla 2019-02-19 14:20:45 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/coturn

Comment 17 Fedora Update System 2019-02-24 12:28:59 UTC
coturn-4.5.1.0-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-07647c1897

Comment 18 Fedora Update System 2019-02-24 12:31:24 UTC
coturn-4.5.1.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-3a8b1c1df5

Comment 19 Fedora Update System 2019-02-25 01:20:08 UTC
coturn-4.5.1.0-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-3a8b1c1df5

Comment 20 Fedora Update System 2019-02-25 03:15:14 UTC
coturn-4.5.1.0-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-07647c1897

Comment 21 Fedora Update System 2019-03-10 17:35:56 UTC
coturn-4.5.1.0-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 22 Fedora Update System 2019-03-10 18:23:12 UTC
coturn-4.5.1.0-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.