Skip to content

Commit

Permalink
Add: Add rake secret
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Apr 17, 2024
1 parent f269491 commit 2dead86
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ task "format" do
sh "cd sub-chart && pnpm run lint:fix"
sh "cd sub-image && cargo fmt"
end

task "secret" do
require "securerandom"
secret = SecureRandom.hex(64)
puts %(secret_key_base: "#{secret}")
end
3 changes: 2 additions & 1 deletion config.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

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

admin_handle: "1073"
host: "https://example.com"
secret_key_base: "e381a4e3818fe38288e381bfe381a1e38283e38293e381afe3818be3828fe38184e38184"
# rake secret to generate a new secret key base.
secret_key_base: ""
hosts:
backend: "http://backend:3000"
frontend: "http://frontend:3100"
Expand Down
5 changes: 1 addition & 4 deletions frontend/i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ liked:
upload:
title: "Post chart"
titleEdit: "Edit chart: {{title}}"
description: |
Read <0>Guideline</0> before posting a chart.
You can upload files by dragging and dropping them here.
description: Read <0>Guideline</0> before posting a chart. You can upload files by dragging and dropping them here.
discordInfo:
description: You need to link your Discord account to post a chart.
status:
Expand Down
8 changes: 4 additions & 4 deletions frontend/pages/charts/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -603,15 +603,15 @@ const UploadChart: NextPage<
}
}, [])

const canUpload = !isDiscordEnabled() || !!session.discord
const canPost = !isDiscordEnabled() || !!session.discord

return (
<div
className="flex flex-col gap-2"
onDragOver={(e) => e.preventDefault()}
onDrop={onDrop}
>
<fieldset disabled={isSubmitting || !canUpload}>
<fieldset disabled={isSubmitting || !canPost}>
<Head>
<title>{t("title") + " | " + rootT("name")}</title>
</Head>
Expand Down Expand Up @@ -772,7 +772,7 @@ const UploadChart: NextPage<
t("title")
)}
</h1>
<p className="mb-4">
<p className="mb-4 whitespace-pre">
<Trans
i18nKey="upload:description"
components={[
Expand Down Expand Up @@ -814,7 +814,7 @@ const UploadChart: NextPage<
)}
</p>
<div className="relative">
{!canUpload && (
{!session.discord && (
<div className="absolute z-10 top-0 left-0 w-full h-full bg-white bg-opacity-50 cursor-not-allowed" />
)}
<div className="grid xl:grid-cols-3 gap-4">
Expand Down

0 comments on commit 2dead86

Please sign in to comment.