Projects
home:rottame:vhosts-ng
rubygem-nginx-controller
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 13
View file
rubygem-nginx-controller.changes
Changed
@@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Oct 31 14:26:58 UTC 2025 - Angelo Grossini <angelo@intercom.it> + +- feat(service): Refactor access rules parsing for improved structure + - Change access_rules method to use a hash for rules organization + - Simplify parsing logic by separating keys for location, rule, allow, deny, and auth + - Update Nginx template to conditionally handle access rules based on rule type + +------------------------------------------------------------------- Fri Oct 31 07:53:29 UTC 2025 - Angelo Grossini <angelo@intercom.it> - feat(service): Enhance Nginx configuration with access control and logging
View file
rubygem-nginx-controller.spec
Changed
@@ -1,7 +1,7 @@ %define mod_name nginx-controller %define mod_full_name %{mod_name}-%{version} Name: rubygem-nginx-controller -Version: 2.1.0 +Version: 2.1.1 Release: 0 Summary: vhng nginx controller License: Apache-2.0
View file
nginx-controller-2.1.0.gem/checksums.yaml.gz -> nginx-controller-2.1.1.gem/checksums.yaml.gz
Changed
@@ -1,7 +1,7 @@ --- SHA256: - metadata.gz: 3cc6fb3509f1ad64d347a48bb24f31cd8d58b88b6db2786046268086609f2998 - data.tar.gz: 8fdfb3f606b712f3c897ec23b8f8a57b1e73112fb75e17d6238451a50e0307c3 + metadata.gz: 82e2a9e3bbbcb7326efeb8da68e75ea38276f355fa8ef413b3bd55cf63871d3b + data.tar.gz: 2d88e504574fd331a8c5608aca65eb755064e645dad6d80604d0fb78e43a6183 SHA512: - metadata.gz: 99835d331f2a1c2eeadf86088443eff61d35925e59abfc5930ddc3fc4340dd8b900495e1351a546b032d539fadfebb3709cfa7a6851bf719dfd8bb674a100df0 - data.tar.gz: a93827cc17e03024ed3414e42dd240362c16ddea37dabe24f2383d0187360f87cfa750d54b894239c68a212abc2f184e9b0eaf6a5f4370578f33b8eb45040bcd + metadata.gz: 718e6b340ad503f25df24f6867792fd4613ce7ec4d1a939282661c5a94d7ea16cd4cc7e90733988fa64028ac1b4e9b8c2b84cc7ba6cfb3239b325ffe7bc5b20e + data.tar.gz: cbd28b9a727e606c27939f50a69913a7be1202d9526fd831586180393133f8c48aca83f0227934b4466c25777cec281fa4cba59ca7e2a0744ba2873c6cc71e8d
View file
nginx-controller-2.1.0.gem/data/lib/nginx_controller/docker/service.rb -> nginx-controller-2.1.1.gem/data/lib/nginx_controller/docker/service.rb
Changed
@@ -202,33 +202,34 @@ def access_rules @access_rules ||= begin - pairs = labels.select { |k, _| k =~ /\Avhosts-ng\/http\/access-rules/ }.map { |_, v| - begin - raw = Base64.strict_decode64(v) - data = JSON.parse(raw, symbolize_names: true) - loc = data:location.to_s.strip - - # normalize leading and trailing slashes - unless loc.blank? - loc = "/#{loc}" unless loc.start_with?('/') - loc = loc.chomp('/') if loc.length > 1 && loc.end_with?('/') - end - - next if loc.blank? - next unless data:allow || data:deny || data:auth - - rule = { - location: loc, - allow: data:allow ? Array(data:allow) : nil, - deny: !data:allow && data:deny ? Array(data:deny) : nil, - auth: data:auth ? Array(data:auth) : nil, - } - loc, rule - rescue - nil + rules = {} + pairs = labels.select { |k, _| k =~ /\Avhosts-ng\/http\/access-rules/ }.map { |key, v| + key = key.gsub(/\Avhosts-ng\/http\/access-rules\//, '') + ridx, k, idx = key.split('/') + case k + when 'location' then + rulesridx ||= {} + rulesridx:location = v + when 'rule' then + rulesridx ||= {} + rulesridx:rule = v + when 'allow' then + rulesridx ||= {} + rulesridx:allow ||= + rulesridx:allow << v + when 'deny' then + rulesridx ||= {} + rulesridx:deny ||= + rulesridx:deny << v + when 'auth' then + rulesridx ||= {} + rulesridx:auth ||= + rulesridx:auth << v + else + puts "unknown access rule key \"#{i}\"" end }.compact - Hashpairs + Hashrules.values.map{|r| r:location, r} end end
View file
nginx-controller-2.1.0.gem/data/lib/nginx_controller/templates/nginx-common.erb -> nginx-controller-2.1.1.gem/data/lib/nginx_controller/templates/nginx-common.erb
Changed
@@ -27,12 +27,12 @@ auth_basic "Restricted area"; auth_basic_user_file <%= access:passwd %>; <% end -%> -<% if access:allow -%> +<% if access:rule == 'deny_all' -%> <% access:allow.each do |ip| %> allow <%= ip %>; <% end -%> deny all; -<% elsif access:deny -%> +<% elsif access:rule == 'allow_all' -%> <% access:deny.each do |ip| -%> deny <%= ip -%>; <% end -%>
View file
nginx-controller-2.1.0.gem/metadata.gz -> nginx-controller-2.1.1.gem/metadata.gz
Changed
@@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: nginx-controller version: !ruby/object:Gem::Version - version: 2.1.0 + version: 2.1.1 platform: ruby authors: - Angelo Grossini
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.