mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Provide proxy ips locally vs through DNS system
This commit is contained in:
parent
bdbc4b44cd
commit
c5fbf1f0e5
2 changed files with 8 additions and 6 deletions
|
@ -17,6 +17,9 @@ development:
|
||||||
paypal_api_signature: tonz
|
paypal_api_signature: tonz
|
||||||
letsencrypt_key: ./tests/files/letsencrypt.key
|
letsencrypt_key: ./tests/files/letsencrypt.key
|
||||||
letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/
|
letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/
|
||||||
|
proxy_ips:
|
||||||
|
- 10.0.0.1
|
||||||
|
- 10.0.0.2
|
||||||
test:
|
test:
|
||||||
database: 'postgres://localhost/neocities_test'
|
database: 'postgres://localhost/neocities_test'
|
||||||
database_pool: 1
|
database_pool: 1
|
||||||
|
@ -35,3 +38,6 @@ test:
|
||||||
paypal_api_signature: tonz
|
paypal_api_signature: tonz
|
||||||
letsencrypt_key: ./tests/files/letsencrypt.key
|
letsencrypt_key: ./tests/files/letsencrypt.key
|
||||||
letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/
|
letsencrypt_endpoint: https://acme-staging.api.letsencrypt.org/
|
||||||
|
proxy_ips:
|
||||||
|
- 10.0.0.1
|
||||||
|
- 10.0.0.2
|
||||||
|
|
|
@ -8,12 +8,8 @@ class PurgeCacheOrderWorker
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform(username, path)
|
def perform(username, path)
|
||||||
if ENV['RACK_ENV'] == 'test'
|
proxy_ips = $config['proxy_ips']
|
||||||
proxy_ips = ['10.0.0.1', '10.0.0.2']
|
#proxy_ips = Resolv.getaddresses($config['cache_purge_ips_uri']).keep_if {|r| !r.match(/:/)}
|
||||||
else
|
|
||||||
#proxy_ips = Resolv.getaddresses($config['cache_purge_ips_uri'])
|
|
||||||
proxy_ips = Resolv.getaddresses($config['cache_purge_ips_uri']).keep_if {|r| !r.match(/:/)}
|
|
||||||
end
|
|
||||||
|
|
||||||
proxy_ips.each do |proxy_ip|
|
proxy_ips.each do |proxy_ip|
|
||||||
PurgeCacheWorker.perform_async proxy_ip, username, path
|
PurgeCacheWorker.perform_async proxy_ip, username, path
|
||||||
|
|
Loading…
Add table
Reference in a new issue