bingo: serve bingo.asxp.io too, credit asxp.io in footer
datacenterbingo.xyz is not in the .xyz zone yet, while bingo.asxp.io already resolves. Serve the card on both (BINGO_ALT_HOST) so it is reachable now; canonical and hreflang links keep pointing at the .xyz domain. Footer gets a copyright line linking back to asxp.io. Assisted-by: Claude:opus-5
This commit is contained in:
parent
90e1bbc9c5
commit
cd04b01e57
7 changed files with 22 additions and 9 deletions
|
|
@ -20,3 +20,5 @@ MAIL_TO=ie@asxp.io
|
|||
|
||||
# Datacenter bingo hostname (same process, routed by Host). Unset = bingo off.
|
||||
# BINGO_HOST=bingo.localhost
|
||||
# Optional second hostname serving the same card.
|
||||
# BINGO_ALT_HOST=bingo2.localhost
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ jobs:
|
|||
LTC_ADDRESS=${LTC_ADDRESS}
|
||||
CRYPTO_ADDRESSES=${CRYPTO_ADDRESSES}
|
||||
BINGO_HOST=datacenterbingo.xyz
|
||||
BINGO_ALT_HOST=bingo.asxp.io
|
||||
EOF
|
||||
chmod 600 /opt/asxpio/.env
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,15 @@
|
|||
# AsxpioWeb (config.ru dispatches by Host). Read-only: no session, no CSRF.
|
||||
# Content is managed from asxp.io/admin/bingo (lib/bingo_admin.rb).
|
||||
class BingoWeb < Sinatra::Base
|
||||
HOSTS = [ENV['BINGO_HOST'], ENV['BINGO_ALT_HOST']].compact.reject(&:empty?).freeze
|
||||
|
||||
configure do
|
||||
set :root, $root
|
||||
set :views, File.join($root, 'views', 'bingo')
|
||||
set :erb, layout: :layout, escape_html: true
|
||||
set :show_exceptions, $env == 'development'
|
||||
set :host_authorization,
|
||||
{ permitted_hosts: $env == 'production' && ENV['BINGO_HOST'] ? [ENV['BINGO_HOST']] : [] }
|
||||
{ permitted_hosts: $env == 'production' ? HOSTS : [] }
|
||||
end
|
||||
|
||||
helpers do
|
||||
|
|
|
|||
13
config.ru
13
config.ru
|
|
@ -2,16 +2,19 @@ require 'sinatra/base'
|
|||
require './asxpio.rb'
|
||||
require './bingo_web.rb'
|
||||
|
||||
# One process, two sites: BINGO_HOST gets the bingo, everything else asxp.io.
|
||||
asxpio = AsxpioWeb.new
|
||||
bingo = BingoWeb.new
|
||||
bingo_host = ENV['BINGO_HOST']
|
||||
# One process, two sites: the bingo hosts get BingoWeb, everything else
|
||||
# asxp.io. BINGO_HOST is canonical (www. redirects to it); BINGO_ALT_HOST
|
||||
# serves the same card, e.g. while the canonical domain's DNS settles.
|
||||
asxpio = AsxpioWeb.new
|
||||
bingo = BingoWeb.new
|
||||
bingo_host = ENV['BINGO_HOST']
|
||||
bingo_hosts = BingoWeb::HOSTS
|
||||
|
||||
run lambda { |env|
|
||||
req = Rack::Request.new(env)
|
||||
if bingo_host && req.host == "www.#{bingo_host}"
|
||||
[301, { 'location' => "https://#{bingo_host}#{req.fullpath}" }, []]
|
||||
else
|
||||
(bingo_host && req.host == bingo_host ? bingo : asxpio).call(env)
|
||||
(bingo_hosts.include?(req.host) ? bingo : asxpio).call(env)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,9 @@ services:
|
|||
- "traefik.http.routers.asxpio.service=asxpio"
|
||||
- "traefik.http.services.asxpio.loadbalancer.server.port=3000"
|
||||
# Datacenter bingo: same container, routed by Host in config.ru.
|
||||
# BINGO_HOST is interpolated from /opt/asxpio/.env (written by deploy).
|
||||
- "traefik.http.routers.asxpio-bingo.rule=Host(`${BINGO_HOST}`) || Host(`www.${BINGO_HOST}`)"
|
||||
# BINGO_HOST / BINGO_ALT_HOST are interpolated from /opt/asxpio/.env
|
||||
# (written by deploy).
|
||||
- "traefik.http.routers.asxpio-bingo.rule=Host(`${BINGO_HOST}`) || Host(`www.${BINGO_HOST}`) || Host(`${BINGO_ALT_HOST}`)"
|
||||
- "traefik.http.routers.asxpio-bingo.entrypoints=websecure"
|
||||
- "traefik.http.routers.asxpio-bingo.tls=true"
|
||||
- "traefik.http.routers.asxpio-bingo.tls.certresolver=letsencrypt"
|
||||
|
|
|
|||
|
|
@ -62,7 +62,10 @@
|
|||
</ul>
|
||||
</section>
|
||||
|
||||
<footer><%= t(:footer) %></footer>
|
||||
<footer>
|
||||
<p><%= t(:footer) %></p>
|
||||
<p>© <%= Date.today.year %> <a href="https://asxp.io">asxp.io</a></p>
|
||||
</footer>
|
||||
</main>
|
||||
|
||||
<% b.cells.each do |dc| %>
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@
|
|||
dialog ul { padding-left: 18px; }
|
||||
dialog button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
|
||||
footer { margin-top: 32px; color: var(--muted); font-size: 13px; }
|
||||
footer p { margin: 0 0 4px; }
|
||||
@media (max-width: 560px) {
|
||||
.cell { padding: 5px; border-radius: 6px; }
|
||||
.cell .sub, .cell .n, .cell .tag { display: none; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue