From cb7f94fd5c3b9e2443ba885475ece80756726f14 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Sun, 8 Mar 2026 16:14:52 -0400 Subject: [PATCH] chore(env): add example environment configuration files for backend and frontend --- README.md | 2 +- backend.env.example | 21 +++++++++++++++++++++ frontend.env.example | 5 +++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 backend.env.example create mode 100644 frontend.env.example diff --git a/README.md b/README.md index ce953b8..a569e24 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ You can configure Sharpbin using environment variables or `appsettings.json`. Wh #### Frontend (SharpbinV3.Client) - `VITE_API_URL`: The URL of the backend API (e.g., `http://localhost:8080`). -- `VITE_ALLOWED_HOSTS`: A comma separated list of allowed hosts (e.g., `localhost,sharpbin.whoswhip.dev`) +- `VITE_ALLOWED_HOSTS`: A comma separated list of allowed hosts (e.g., `localhost,sharpbin.cc`) - `VIEW_INTERNAL_API_KEY`: Enforces views to be counted/recorded only by the frontend, if set it needs to be the same for both backend and frontend. The frontend will be accessible at http://localhost:5173. diff --git a/backend.env.example b/backend.env.example new file mode 100644 index 0000000..887aac5 --- /dev/null +++ b/backend.env.example @@ -0,0 +1,21 @@ +# Required Misc. Variables +Domain=example.com +Https=true +JwtSettings__Secret=totally_random_and_secure_string + +# Auth Settings +AuthSettings__CF_Turnstile_SecretKey=1x0000000000000000000000000000000AA +AuthSettings__CF_Turnstile_SiteKey=3x00000000000000000000FF +AuthSettings__Registration_Enabled=true +AuthSettings__Admins_Require_2FA=true +AuthSettings__API_Key_HMAC_Secret=another_random_and_secure_string + +# Paste Settings +PasteSettings__MaxTitleLength=500 +PasteSettings__MaxPasteSizeInBytes=1048576 +PasteSettings__EnablePasteCompression=true +PasteSettings__RequiresVerification=true +PasteSettings__View_HMAC_Secret=random_minimum_32_char_string +# Used so that views are only counted from the frontend +# Must be the same on both the frontend and backend environment +PasteSettings__View_Internal_API_Key=another_random_minimum_32_char_string \ No newline at end of file diff --git a/frontend.env.example b/frontend.env.example new file mode 100644 index 0000000..85a8206 --- /dev/null +++ b/frontend.env.example @@ -0,0 +1,5 @@ +VITE_ALLOWED_HOSTS=localhost,example.com +# Used so that views are only counted from the frontend +# Must be the same on both the frontend and backend environment +# The frontend will also try to parse 'PasteSettings__View_Internal_API_Key' +VIEW_INTERNAL_API_KEY=another_random_minimum_32_char_string \ No newline at end of file