Skip to content

Commit

Permalink
Change: HOST -> FINAL_HOST
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Aug 29, 2024
1 parent 4533e42 commit f64166f
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion backend/app/controllers/api/charts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ def update
$discord.post(
webhook,
json: {
content: "#{ENV.fetch("HOST")}/charts/#{chart.name}"
content: "#{ENV.fetch("FINAL_HOST")}/charts/#{chart.name}"
}
)
end
Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/api/discord_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class DiscordController < FrontendController
def redirect_uri
"#{
ENV.fetch(
"HOST",
"FINAL_HOST",
"#{Rails.env.development? ? "http://" : "https://"}#{request.host_with_port}"
)
}/api/discord/callback"
Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/sonolus/asset_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def self.asset_get(type, name)
end
[k, v]
end
.merge({ source: ENV.fetch("HOST", nil), tags: [] })
.merge({ source: ENV.fetch("FINAL_HOST", nil), tags: [] })
end
end
end
2 changes: 1 addition & 1 deletion backend/app/controllers/sonolus_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def authenticate
render json: { error: "Invalid type" }, status: :unauthorized
return
end
if params[:address].exclude?(ENV["HOST"])
if params[:address].exclude?(ENV["FINAL_HOST"])
logger.warn "Invalid address"
render json: { error: "Invalid address" }, status: :unauthorized
return
Expand Down
4 changes: 2 additions & 2 deletions backend/app/models/chart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def to_sonolus
title:,
artists: "#{composer} / #{artist.presence || "-"}",
author: "#{author_name.presence || author.name}##{author.display_handle}",
source: ENV.fetch("HOST", nil),
source: ENV.fetch("FINAL_HOST", nil),
tags: [
{ title: likes_count.to_s, icon: "heart" },
(
Expand Down Expand Up @@ -167,7 +167,7 @@ def to_sonolus_background(resources, version: 3)
name: "chcy-bg-#{name}-v#{version}",
version: 2,
tags: [],
source: ENV.fetch("HOST", nil),
source: ENV.fetch("FINAL_HOST", nil),
title: I18n.t("sonolus.backgrounds.title", name: title, version:),
subtitle: "#{composer}#{artist.presence ? " / #{artist}" : ""}",
author: "#{author_name.presence || author.name}##{author.display_handle}",
Expand Down
2 changes: 1 addition & 1 deletion config.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Configuration template for development environment.

admin_handle: "1073"
host: "http://192.168.1.2:3000"
final_host: "http://192.168.1.2:3000"
# rake secret to generate a new secret key base.
secret_key_base: ""
hosts:
Expand Down
2 changes: 1 addition & 1 deletion config.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

admin_handle: "1073"
final_port: 8080
host: "https://example.com"
final_host: "https://example.com"
# rake secret to generate a new secret key base.
secret_key_base: ""
hosts:
Expand Down
2 changes: 1 addition & 1 deletion config.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ properties:
admin_handle:
type: "string"
description: "Your Sonolus handle."
host:
final_host:
type: "string"
description: "The host that the chart cyanvas will be hosted on."
final_port:
Expand Down
2 changes: 1 addition & 1 deletion config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Configuration template for development environment.

admin_handle: "1073"
host: "http://192.168.1.2:3000"
final_host: "http://192.168.1.2:3000"
secret_key_base: "af8a3d82ff17801024fe1a8a11b552ac501eb4a0acdf14e4bb7c81d16e7130446bd20a907721ad42741196a5cc1e07ffb2017bd3731a9a12d92c40137fca527c"
hosts:
backend: "http://localhost:3000"
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/config.server.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const host = process.env.HOST!;
export const host = process.env.FINAL_HOST!;
export const backendUrl = process.env.HOSTS_BACKEND!;
export const discordEnabled = !!process.env.DISCORD_BOT_TOKEN;

0 comments on commit f64166f

Please sign in to comment.