mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
mapping for sandboxed sites
This commit is contained in:
parent
3a6b0479ba
commit
7ef47038a8
1 changed files with 4 additions and 3 deletions
7
Rakefile
7
Rakefile
|
@ -86,6 +86,7 @@ end
|
||||||
desc 'Compile nginx mapfiles'
|
desc 'Compile nginx mapfiles'
|
||||||
task :compile_nginx_mapfiles => [:environment] do
|
task :compile_nginx_mapfiles => [:environment] do
|
||||||
FileUtils.mkdir_p './files/maps'
|
FileUtils.mkdir_p './files/maps'
|
||||||
|
|
||||||
File.open('./files/maps/domains.txt', 'w') do |file|
|
File.open('./files/maps/domains.txt', 'w') do |file|
|
||||||
Site.exclude(domain: nil).exclude(domain: '').select(:username,:domain).all.each do |site|
|
Site.exclude(domain: nil).exclude(domain: '').select(:username,:domain).all.each do |site|
|
||||||
file.write ".#{site.values[:domain]} #{site.username};\n"
|
file.write ".#{site.values[:domain]} #{site.username};\n"
|
||||||
|
@ -104,9 +105,9 @@ task :compile_nginx_mapfiles => [:environment] do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Legacy for existing system
|
File.open('./files/maps/sandboxed.txt', 'w') do |file|
|
||||||
FileUtils.cp './files/maps/domains.txt', './files/map.txt'
|
usernames = DB["select username from sites where created_at > ? and (plan_type is null or plan_type='free')", 1.week.ago].all.collect {|s| s[:username]}.each {|username| file.write "#{username}\n"}
|
||||||
FileUtils.cp './files/maps/supporters.txt', './files/supporter-map.txt'
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Produce SSL config package for proxy'
|
desc 'Produce SSL config package for proxy'
|
||||||
|
|
Loading…
Add table
Reference in a new issue