Skip to content

Commit

Permalink
Merge branch 'revert-1061-revert-1056-detect-repo-type' into refactor…
Browse files Browse the repository at this point in the history
…_mirror_action
  • Loading branch information
felixsch committed Jan 4, 2024
2 parents b69bd0a + 9a3288a commit e0a0eec
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 71 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ dist: clean man

@rm -rf $(NAME)-$(VERSION)/config/rmt.yml
@rm -rf $(NAME)-$(VERSION)/config/rmt.local.yml
@rm -rf $(NAME)-$(VERSION)/config/secrets.yml.*
@rm -rf $(NAME)-$(VERSION)/config/system_uuid

# don't package test tasks (fails to load because of rspec dependency)
Expand Down
11 changes: 11 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,16 @@ class Application < Rails::Application
g.test_framework :rspec
end

# Rails initialization process requires a secret key base present in either:
# - SECRET_KEY_BASE env
# - credentials.secret_key_base
# - secrets.secret_key_base
#
# Else the boot process will be halted. RMT does not use any of those
# facilities. Hardcoding it here keeps rails happy and allows the boot
# process to continue.
config.require_master_key = false
config.read_encrypted_secrets = false
config.secret_key_base = 'rmt-does-not-use-this'
end
end
5 changes: 0 additions & 5 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
config.read_encrypted_secrets = true

# Disable serving static files from the `/public` folder by default since
# Apache or NGINX already handles this.
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
Expand Down
32 changes: 0 additions & 32 deletions config/secrets.yml

This file was deleted.

18 changes: 0 additions & 18 deletions lib/tasks/encrypted_key.rake

This file was deleted.

11 changes: 2 additions & 9 deletions package/files/update_rmt_app_dir_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ fi
# Change secrets encrypted and key files to nginx readable
secret_key_files=('config/secrets.yml.key' 'config/secrets.yml.enc')

for secretFile in $secret_key_files; do
file_path="$app_dir/$secretFile"
if [[ -e $file_path ]]; then
if [[ "$(stat -c "%U %G" $file_path)" == "root root" ]]; then
chmod 0640 $file_path
chown -h root:nginx $file_path
fi
fi

for secretFile in ${secret_key_files[@]}; do
rm -f "$app_dir/$secretFile"
done
4 changes: 3 additions & 1 deletion package/obs/rmt-server.changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Wed Oct 04 13:23:00 UTC 2023 - Felix Schnizlein <[email protected]>
- Version 2.15:
* Moving system hardware information to systems database table to
allow transmitting system information dynamically. (jsc#PED-3734)
* Fix secrets access for server user (bsc#1215176)
* Dropping Rails Secrets facilities and related config files (bsc#1215176)
* rmt-client-setup-res script: fix for CentOS8 clients (bsc#1214709)
* Updated supportconfig script (bsc#1216389)

-------------------------------------------------------------------
Thu Jun 06 15:44:00 UTC 2023 - Luís Caparroz <[email protected]>

Expand Down
5 changes: 0 additions & 5 deletions package/obs/rmt-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,6 @@ getent passwd %{rmt_user} >/dev/null || \
%post
%service_add_post rmt-server.target rmt-server.service rmt-server-migration.service rmt-server-mirror.service rmt-server-sync.service rmt-server-systems-scc-sync.service

# Rails by default creates `secrets.yml.key` with `0600` file mode, see here
# https://github.com/rails/rails/blob/6-0-stable/railties/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb
cd %{_datadir}/rmt && runuser -u root -g %{rmt_group} -- bin/rails rmt:secrets:create_encryption_key >/dev/null RAILS_ENV=production && \
cd %{_datadir}/rmt && runuser -u root -g %{rmt_group} -- bin/rails rmt:secrets:create_secret_key_base >/dev/null RAILS_ENV=production && \

# Run only on install
if [ $1 -eq 1 ]; then
echo "Please run the YaST RMT module (or 'yast2 rmt' from the command line) to complete the configuration of your RMT" >> /dev/stdout
Expand Down

0 comments on commit e0a0eec

Please sign in to comment.