From 8ca344e5fea5e731e94bd3c19346cb7c03259442 Mon Sep 17 00:00:00 2001 From: Serhii Kotov Date: Wed, 15 Aug 2018 15:42:53 +0200 Subject: [PATCH 1/5] Change file permissions for rmt.conf --- package/rmt-server.changes | 5 +++++ package/rmt-server.spec | 3 +++ 2 files changed, 8 insertions(+) diff --git a/package/rmt-server.changes b/package/rmt-server.changes index b48c2074e..746e11864 100644 --- a/package/rmt-server.changes +++ b/package/rmt-server.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 15 13:41:49 UTC 2018 - skotov@suse.com + +- Change file premissions for rmt.conf + ------------------------------------------------------------------- Thu Aug 2 16:19:35 UTC 2018 - fschnizlein@suse.com diff --git a/package/rmt-server.spec b/package/rmt-server.spec index 82df5e98c..74d97cf7b 100644 --- a/package/rmt-server.spec +++ b/package/rmt-server.spec @@ -247,6 +247,9 @@ if [ $1 -eq 2 ]; then fi fi +chmod 640 %{conf_dir}/rmt.conf +chown _rmt %{conf_dir}/rmt.conf + %preun %service_del_preun rmt-server.target rmt-server.service rmt-server-migration.service rmt-server-mirror.service rmt-server-sync.service From 9aa7b22ec54264d6ef8e9fbb06945a6585d4dd3f Mon Sep 17 00:00:00 2001 From: Serhii Kotov Date: Thu, 16 Aug 2018 14:56:42 +0200 Subject: [PATCH 2/5] Bump version to 1.0.7 --- lib/rmt.rb | 2 +- package/rmt-server.changes | 3 ++- package/rmt-server.spec | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rmt.rb b/lib/rmt.rb index 4eec631df..da94b2851 100644 --- a/lib/rmt.rb +++ b/lib/rmt.rb @@ -1,5 +1,5 @@ module RMT - VERSION ||= '1.0.6'.freeze + VERSION ||= '1.0.7'.freeze DEFAULT_USER = '_rmt'.freeze DEFAULT_GROUP = 'nginx'.freeze diff --git a/package/rmt-server.changes b/package/rmt-server.changes index 746e11864..91871a566 100644 --- a/package/rmt-server.changes +++ b/package/rmt-server.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Wed Aug 15 13:41:49 UTC 2018 - skotov@suse.com -- Change file premissions for rmt.conf +- Version 1.0.7 +- Change file permissions for rmt.conf (bsc#1104232) ------------------------------------------------------------------- Thu Aug 2 16:19:35 UTC 2018 - fschnizlein@suse.com diff --git a/package/rmt-server.spec b/package/rmt-server.spec index 74d97cf7b..dd439ffae 100644 --- a/package/rmt-server.spec +++ b/package/rmt-server.spec @@ -26,7 +26,7 @@ %define is_sle_12_family 1 %endif Name: rmt-server -Version: 1.0.6 +Version: 1.0.7 Release: 0 Summary: Repository mirroring tool and registration proxy for SCC License: GPL-2.0-or-later From 9040b6a0778bd45d32078b489b995c16231c8620 Mon Sep 17 00:00:00 2001 From: Serhii Kotov Date: Fri, 17 Aug 2018 13:32:01 +0200 Subject: [PATCH 3/5] Make more clean solution for changing permissions of rmt.conf --- package/rmt-server.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package/rmt-server.spec b/package/rmt-server.spec index dd439ffae..eb7e3335b 100644 --- a/package/rmt-server.spec +++ b/package/rmt-server.spec @@ -193,7 +193,7 @@ find %{buildroot}%{lib_dir}/vendor/bundle/ruby/*/gems/yard*/ -type f -exec chmod %dir %{_sysconfdir}/nginx %dir %{_sysconfdir}/nginx/vhosts.d %dir %{_sharedstatedir}/rmt -%config(noreplace) %{conf_dir}/rmt.conf +%config(noreplace) %attr(0640, %{rmt_user},%{rmt_group}) %{conf_dir}/rmt.conf %config(noreplace) %{_sysconfdir}/nginx/vhosts.d/rmt-server-http.conf %config(noreplace) %{_sysconfdir}/nginx/vhosts.d/rmt-server-https.conf %{_mandir}/man8/rmt-cli.8%{?ext_man} @@ -247,9 +247,6 @@ if [ $1 -eq 2 ]; then fi fi -chmod 640 %{conf_dir}/rmt.conf -chown _rmt %{conf_dir}/rmt.conf - %preun %service_del_preun rmt-server.target rmt-server.service rmt-server-migration.service rmt-server-mirror.service rmt-server-sync.service From 366130d03241c6203ce672062a9d074c1d5ca949 Mon Sep 17 00:00:00 2001 From: Serhii Kotov Date: Fri, 17 Aug 2018 15:15:34 +0200 Subject: [PATCH 4/5] Revert location of rmt.conf --- MANUAL.md | 2 +- README.md | 2 +- lib/rmt/cli/base.rb | 6 +++--- lib/rmt/config.rb | 2 +- package/rmt-server.changes | 1 + package/rmt-server.spec | 8 ++------ spec/lib/rmt/cli/main_spec.rb | 8 ++++---- 7 files changed, 13 insertions(+), 16 deletions(-) diff --git a/MANUAL.md b/MANUAL.md index ec6ce7508..f8fea4e55 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -125,7 +125,7 @@ As described in the [PREREQUISITE][] section, the recommended way to perform ini The YaST RMT module will take care of configuring SCC credentials, setting up the database and creating SSL certificates. However, if you want to reconfigure specific settings manually, this section tells you how. -All available configuration options can be found in the `/etc/rmt/rmt.conf` file. +All available configuration options can be found in the `/etc/rmt.conf` file. **SSL certificates & HTTPS** diff --git a/README.md b/README.md index 5bcbd3147..08ff63484 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ After installation configure your RMT instance: FLUSH PRIVILEGES; EOFF ``` -* See the "Configuration" section for how to configure the options in `/etc/rmt/rmt.conf`. +* See the "Configuration" section for how to configure the options in `/etc/rmt.conf`. * Start RMT by running `systemctl start rmt-server`. This will start the RMT server at http://localhost:4224. * By default, mirrored repositories are saved under `/usr/share/rmt/public`, which is a symlink that points to `/var/lib/rmt/public`. In order to change destination directory, recreate `/usr/share/rmt/public` symlink to point to the diff --git a/lib/rmt/cli/base.rb b/lib/rmt/cli/base.rb index 9eea99d64..59d6b8886 100644 --- a/lib/rmt/cli/base.rb +++ b/lib/rmt/cli/base.rb @@ -45,12 +45,12 @@ def handle_exceptions rescue Mysql2::Error => e if e.message =~ /^Access denied/ raise RMT::CLI::Error.new( - "Cannot connect to database server. Make sure its credentials are configured in '/etc/rmt/rmt.conf'.", + "Cannot connect to database server. Make sure its credentials are configured in '/etc/rmt.conf'.", RMT::CLI::Error::ERROR_DB ) elsif e.message =~ /^Can't connect/ raise RMT::CLI::Error.new( - "Cannot connect to database server. Make sure it is running and its credentials are configured in '/etc/rmt/rmt.conf'.", + "Cannot connect to database server. Make sure it is running and its credentials are configured in '/etc/rmt.conf'.", RMT::CLI::Error::ERROR_DB ) else @@ -64,7 +64,7 @@ def handle_exceptions ) rescue RMT::SCC::CredentialsError, ::SUSE::Connect::Api::InvalidCredentialsError raise RMT::CLI::Error.new( - "The SCC credentials are not configured correctly in '/etc/rmt/rmt.conf'. You can obtain them from https://scc.suse.com/organization", + "The SCC credentials are not configured correctly in '/etc/rmt.conf'. You can obtain them from https://scc.suse.com/organization", RMT::CLI::Error::ERROR_SCC ) rescue RMT::Lockfile::ExecutionLockedError => e diff --git a/lib/rmt/config.rb b/lib/rmt/config.rb index 4a7d1fd85..64a296af4 100644 --- a/lib/rmt/config.rb +++ b/lib/rmt/config.rb @@ -6,7 +6,7 @@ end Config.load_and_set_settings( - '/etc/rmt/rmt.conf', + '/etc/rmt.conf', File.join(__dir__, '../../config/rmt.yml'), File.join(__dir__, '../../config/rmt.local.yml') ) diff --git a/package/rmt-server.changes b/package/rmt-server.changes index 91871a566..424a78392 100644 --- a/package/rmt-server.changes +++ b/package/rmt-server.changes @@ -3,6 +3,7 @@ Wed Aug 15 13:41:49 UTC 2018 - skotov@suse.com - Version 1.0.7 - Change file permissions for rmt.conf (bsc#1104232) +- Revert file path for /etc/rmt.conf ------------------------------------------------------------------- Thu Aug 2 16:19:35 UTC 2018 - fschnizlein@suse.com diff --git a/package/rmt-server.spec b/package/rmt-server.spec index eb7e3335b..21ce98657 100644 --- a/package/rmt-server.spec +++ b/package/rmt-server.spec @@ -141,7 +141,7 @@ ln -fs %{_sbindir}/service %{buildroot}%{_sbindir}/rcrmt-server-mirror ln -fs %{_sbindir}/service %{buildroot}%{_sbindir}/rcrmt-server-sync mkdir -p %{buildroot}%{_sysconfdir} -mv %{_builddir}/rmt.conf %{buildroot}%{conf_dir}/rmt.conf +mv %{_builddir}/rmt.conf %{buildroot}%{_sysconfdir}/rmt.conf # nginx install -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/nginx/vhosts.d/rmt-server-http.conf @@ -193,7 +193,7 @@ find %{buildroot}%{lib_dir}/vendor/bundle/ruby/*/gems/yard*/ -type f -exec chmod %dir %{_sysconfdir}/nginx %dir %{_sysconfdir}/nginx/vhosts.d %dir %{_sharedstatedir}/rmt -%config(noreplace) %attr(0640, %{rmt_user},%{rmt_group}) %{conf_dir}/rmt.conf +%config(noreplace) %attr(0640, %{rmt_user},root) %{_sysconfdir}/rmt.conf %config(noreplace) %{_sysconfdir}/nginx/vhosts.d/rmt-server-http.conf %config(noreplace) %{_sysconfdir}/nginx/vhosts.d/rmt-server-https.conf %{_mandir}/man8/rmt-cli.8%{?ext_man} @@ -237,10 +237,6 @@ if [ $1 -eq 2 ]; then mv %{app_dir}/ssl/* %{conf_dir}/ssl echo "RMT ssl configuration has been moved to a new place. New place is: %{conf_dir}/ssl" fi - if [ -f %{_sysconfdir}/rmt.conf ]; then - mv %{_sysconfdir}/rmt.conf %{conf_dir}/rmt.conf - echo "RMT configuration has been moved to a new place. New place is: %{conf_dir}/rmt.conf" - fi if [ -f %{app_dir}/config/system_uuid ]; then mv %{app_dir}/config/system_uuid %{_sharedstatedir}/rmt/system_uuid diff --git a/spec/lib/rmt/cli/main_spec.rb b/spec/lib/rmt/cli/main_spec.rb index 20e0057ab..3e1ca5f3f 100644 --- a/spec/lib/rmt/cli/main_spec.rb +++ b/spec/lib/rmt/cli/main_spec.rb @@ -116,7 +116,7 @@ it 'outputs custom error message' do expect { command }.to output( - "Cannot connect to database server. Make sure its credentials are configured in '/etc/rmt/rmt.conf'.\n" + "Cannot connect to database server. Make sure its credentials are configured in '/etc/rmt.conf'.\n" ).to_stderr end end @@ -127,7 +127,7 @@ it 'outputs custom error message' do expect { command }.to output( - "Cannot connect to database server. Make sure it is running and its credentials are configured in '/etc/rmt/rmt.conf'.\n" + "Cannot connect to database server. Make sure it is running and its credentials are configured in '/etc/rmt.conf'.\n" ).to_stderr end end @@ -147,7 +147,7 @@ it 'outputs custom error message' do expect { command }.to output( - "The SCC credentials are not configured correctly in '/etc/rmt/rmt.conf'. You can obtain them from https://scc.suse.com/organization\n" + "The SCC credentials are not configured correctly in '/etc/rmt.conf'. You can obtain them from https://scc.suse.com/organization\n" ).to_stderr end end @@ -157,7 +157,7 @@ it 'outputs custom error message' do expect { command }.to output( - "The SCC credentials are not configured correctly in '/etc/rmt/rmt.conf'. You can obtain them from https://scc.suse.com/organization\n" + "The SCC credentials are not configured correctly in '/etc/rmt.conf'. You can obtain them from https://scc.suse.com/organization\n" ).to_stderr end end From 007dc136dae08348b8a9eab1dc7a6647233a7143 Mon Sep 17 00:00:00 2001 From: Serhii Kotov Date: Mon, 20 Aug 2018 13:38:49 +0200 Subject: [PATCH 5/5] Revert version --- lib/rmt.rb | 2 +- package/rmt-server.changes | 8 +------- package/rmt-server.spec | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/rmt.rb b/lib/rmt.rb index da94b2851..4eec631df 100644 --- a/lib/rmt.rb +++ b/lib/rmt.rb @@ -1,5 +1,5 @@ module RMT - VERSION ||= '1.0.7'.freeze + VERSION ||= '1.0.6'.freeze DEFAULT_USER = '_rmt'.freeze DEFAULT_GROUP = 'nginx'.freeze diff --git a/package/rmt-server.changes b/package/rmt-server.changes index 424a78392..a17389ecd 100644 --- a/package/rmt-server.changes +++ b/package/rmt-server.changes @@ -1,16 +1,10 @@ -------------------------------------------------------------------- -Wed Aug 15 13:41:49 UTC 2018 - skotov@suse.com - -- Version 1.0.7 -- Change file permissions for rmt.conf (bsc#1104232) -- Revert file path for /etc/rmt.conf - ------------------------------------------------------------------- Thu Aug 2 16:19:35 UTC 2018 - fschnizlein@suse.com - Version 1.0.6 - Change file paths to new locations to make RMT work with read-only rootfs (bsc#1102198) +- Change file permissions for rmt.conf (bsc#1104232) ------------------------------------------------------------------- Thu Jul 19 12:27:23 UTC 2018 - wstephenson@suse.com diff --git a/package/rmt-server.spec b/package/rmt-server.spec index 21ce98657..9512a34a4 100644 --- a/package/rmt-server.spec +++ b/package/rmt-server.spec @@ -26,7 +26,7 @@ %define is_sle_12_family 1 %endif Name: rmt-server -Version: 1.0.7 +Version: 1.0.6 Release: 0 Summary: Repository mirroring tool and registration proxy for SCC License: GPL-2.0-or-later