Update configuration template and setup
This commit is contained in:
parent
2cdf798b98
commit
e419978af8
17 changed files with 151 additions and 35 deletions
63
.env.sample
Normal file
63
.env.sample
Normal file
|
@ -0,0 +1,63 @@
|
|||
# Server Information
|
||||
SERVER_ADMIN="Company LLC"
|
||||
SERVER_LOCATION="France"
|
||||
SERVER_PROTOCOL="https"
|
||||
SERVER_DOMAIN="https://example.org"
|
||||
|
||||
# Default Instances and Options
|
||||
## Set the instances you want to use.
|
||||
## Can be overriden by the user in their preferences.
|
||||
DEFAULT_MEDIA_PROXY="https://yt.sudovanilla.org" # Invidious (YouTube)
|
||||
DEFAULT_MEDIA_DATA_PROXY="https://yt.sudovanilla.org" # Invidious (YouTube)
|
||||
DEFAULT_STREAM_PROXY="https://twitch-backend.sudovanilla.org" # SafeTwitch (Twitch)
|
||||
DEFAULT_STREAM_DATA_PROXY="https://twitch-backend.sudovanilla.org" # SafeTwitch (Twitch)
|
||||
DEFAULT_IMAGE_PROXY="https://ipx.sudovanilla.org"
|
||||
DEFAULT_PLAYER="Zorn"
|
||||
|
||||
# Important Information
|
||||
## If you've modified the source code, please publish
|
||||
## your changes and list the repo here.
|
||||
MODIFIED="false"
|
||||
CUSTOM_SOURCE_CODE=""
|
||||
|
||||
# UI Customization
|
||||
META_COLOR=""
|
||||
COLOR=""
|
||||
THEME=""
|
||||
THEME_TOGGLE_ENABLED=""
|
||||
THEME_TOGGLE_STYLE=""
|
||||
FOOTER_VERSION=""
|
||||
REVERT_LAYOUT=""
|
||||
SIDEBAR_CATEGORIES="true"
|
||||
SIDEBAR_DISCOVER="false"
|
||||
|
||||
# Platform Support
|
||||
PLATFORM_YOUTUBE="true"
|
||||
PLATFORM_TWITCH="true" # Planned
|
||||
|
||||
# Analytics
|
||||
ANALYTICS="false"
|
||||
|
||||
MATOMO_ID=""
|
||||
MATOMO_SRC=""
|
||||
|
||||
PLAUSIBLE_DOMAIN=""
|
||||
PLAUSIBLE_SRC=""
|
||||
|
||||
UMAMI_ID=""
|
||||
UMAMI_SRC=""
|
||||
|
||||
AMPLITUDE_APIKEY=""
|
||||
|
||||
METRICAL_APP=""
|
||||
|
||||
FATHOM_SITE=""
|
||||
FATHOM_SRC=""
|
||||
|
||||
MINIAML_ID=""
|
||||
|
||||
SWETRIX_SRC=""
|
||||
SWETRIX_API=""
|
||||
SWETRIX_PROJECT_ID=""
|
||||
|
||||
SIMPLEANALYTICS_DOMAIN=""
|
22
config.json
22
config.json
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"SERVER_DOMAIN": "https://example.org",
|
||||
"SERVER_ADMIN": "Company LLC",
|
||||
"SERVER_LOCATION": "Undisclosed",
|
||||
|
||||
"STATISTICS": false,
|
||||
"ANALYLICS_TOOL": "",
|
||||
"ANALYLICS_ID": "",
|
||||
"SCRIPT_SRC": "",
|
||||
"DOMAIN": "example.org",
|
||||
|
||||
"DEFAULT_VIDEO_PROXY": "https://yt.sudovanilla.org",
|
||||
"DEFAULT_DATA_PROXY": "https://yt.sudovanilla.org",
|
||||
"DEFAULT_IMAGE_PROXY": "https://ipx.sudovanilla.org",
|
||||
"DEFAULT_PLAYER": "Zorn",
|
||||
|
||||
"SIDEBAR_CATEGORIES": true,
|
||||
"SIDEBAR_DISCOVER": false,
|
||||
|
||||
"MODIFIED": false,
|
||||
"CUSTOM_SOURCE_CODE": ""
|
||||
}
|
|
@ -13,7 +13,7 @@ const {
|
|||
import {
|
||||
DEFAULT_DATA_PROXY,
|
||||
DEFAULT_IMAGE_PROXY
|
||||
} from '../../config.json'
|
||||
} from '@utils/GetConfig'
|
||||
|
||||
// i18n
|
||||
import i18next, { t } from "i18next";
|
||||
|
|
|
@ -13,7 +13,7 @@ const {
|
|||
import {
|
||||
DEFAULT_DATA_PROXY,
|
||||
DEFAULT_IMAGE_PROXY
|
||||
} from '../../config.json'
|
||||
} from '@utils/GetConfig'
|
||||
|
||||
// i18n
|
||||
import i18next, { t } from "i18next";
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Configuration
|
||||
import {
|
||||
DEFAULT_PLAYER
|
||||
} from '../../../config.json'
|
||||
} from '@utils/GetConfig'
|
||||
---
|
||||
|
||||
{
|
||||
|
|
|
@ -1,4 +1,21 @@
|
|||
---
|
||||
// i18n
|
||||
import i18next, { t } from "i18next";
|
||||
import { Trans, HeadHrefLangs } from "astro-i18next/components";
|
||||
|
||||
// Cookies
|
||||
/// Language
|
||||
//// If the user is new to the site, set English as default
|
||||
if (Astro.cookies.get("Language") === undefined) {
|
||||
Astro.cookies.set("Language", "EN", {path: "/",sameSite: 'strict'})
|
||||
}
|
||||
|
||||
//// Check what language the user has set it to and switch to it
|
||||
var UserLanguage = Astro.cookies.get("Language").value
|
||||
if (UserLanguage === "JP") {i18next.changeLanguage("jp")}
|
||||
else if (UserLanguage === "EN") {i18next.changeLanguage("en")}
|
||||
|
||||
// Properties
|
||||
const {
|
||||
Title,
|
||||
Description,
|
||||
|
@ -16,9 +33,12 @@ import {
|
|||
SCRIPT_SRC,
|
||||
DOMAIN,
|
||||
SERVER_DOMAIN
|
||||
} from '../../../config.json'
|
||||
} from '@utils/GetConfig'
|
||||
|
||||
// Icons
|
||||
import { Donate, Download, ShareIos, ThumbsUp } from '@iconoir/vue'
|
||||
|
||||
// Embed
|
||||
const SWV = Astro.url.href.split("embed/").pop();
|
||||
|
||||
if (Astro.url.href.match('watch')) {
|
||||
|
@ -39,7 +59,7 @@ if (Astro.url.href.match('watch')) {
|
|||
<!-- Properties -->
|
||||
<meta charset="UTF-8">
|
||||
<meta name="theme-color" content="#111">
|
||||
<meta name="viewport" content="width=device-1200px, initial-scale=1.0, shrink-to-fit=yes, viewport-fit=cover">
|
||||
<meta name="viewport" content="width=device-1200px, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=yes, viewport-fit=cover, width=device-width, height=device-height, target-densitydpi=device-dpi">
|
||||
<meta http-equiv="content-language" content="en-us">
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<script is:inline src="/service-worker.js"></script>
|
||||
|
|
|
@ -15,7 +15,7 @@ import Video from '@components/VideoItem.astro'
|
|||
import {
|
||||
DEFAULT_DATA_PROXY,
|
||||
DEFAULT_VIDEO_PROXY
|
||||
} from '../../config.json'
|
||||
} from '@utils/GetConfig'
|
||||
|
||||
|
||||
// Fetch
|
||||
|
|
8
src/pages/api/language/en.astro
Normal file
8
src/pages/api/language/en.astro
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
Astro.cookies.set("Language", "EN", {
|
||||
path: "/",
|
||||
sameSite: "strict"
|
||||
});
|
||||
return Astro.redirect("/");
|
||||
---
|
||||
<style is:global>body {background: black}</style>
|
8
src/pages/api/language/jp.astro
Normal file
8
src/pages/api/language/jp.astro
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
Astro.cookies.set("Language", "JP", {
|
||||
path: "/",
|
||||
sameSite: "strict"
|
||||
});
|
||||
return Astro.redirect("/");
|
||||
---
|
||||
<style is:global>body {background: black}</style>
|
|
@ -6,7 +6,7 @@ import i18next, { t, changeLanguage } from "i18next";
|
|||
changeLanguage("en");
|
||||
|
||||
// Configuration
|
||||
import { DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from "../../../config.json";
|
||||
import { DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from '@utils/GetConfig'
|
||||
import { BrightStar, Donate, Download, ShareIos, ThumbsUp } from "@iconoir/vue";
|
||||
|
||||
// Components
|
||||
|
|
|
@ -7,7 +7,7 @@ const { FetchData, CategoryName, CategoryDescription } = Astro.props;
|
|||
// Use on top of Default Layout
|
||||
import Base from "@layouts/Default.astro";
|
||||
// Configuration
|
||||
import { DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY } from "../../../config.json";
|
||||
import { DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY } from '@utils/GetConfig'
|
||||
// Discover Data
|
||||
import Discover from "../../data/discover.json";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { t, changeLanguage } from "i18next";
|
|||
import Embed from "@layouts/Embed.astro";
|
||||
import "@styles/video.scss";
|
||||
// Configuration
|
||||
import { DEFAULT_VIDEO_PROXY, DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from "../../../config.json";
|
||||
import { DEFAULT_VIDEO_PROXY, DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from '@utils/GetConfig'
|
||||
|
||||
// Fetch
|
||||
const SWV = Astro.url.href.split("embed/").pop();
|
||||
|
|
|
@ -10,7 +10,7 @@ changeLanguage("en");
|
|||
import {
|
||||
DEFAULT_DATA_PROXY,
|
||||
DEFAULT_IMAGE_PROXY
|
||||
} from '../../config.json'
|
||||
} from '@utils/GetConfig'
|
||||
import { FireFlame, Frame, Gamepad, GraphUp, Movie, MusicDoubleNote } from "@iconoir/vue";
|
||||
|
||||
// Fetch
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
MODIFIED,
|
||||
CUSTOM_SOURCE_CODE,
|
||||
STATISTICS
|
||||
} from '../../config.json'
|
||||
} from '@utils/GetConfig'
|
||||
import { FireFlame, Frame, Gamepad, GraphUp, Movie, MusicDoubleNote } from "@iconoir/vue";
|
||||
---
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { t, changeLanguage } from "i18next"
|
|||
import Base from "@layouts/Default.astro"
|
||||
|
||||
// Configuration
|
||||
import { DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY } from "../../config.json"
|
||||
import { DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY } from '@utils/GetConfig'
|
||||
|
||||
changeLanguage("en")
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { t, changeLanguage } from "i18next";
|
|||
import Base from "@layouts/Default.astro";
|
||||
import "@styles/video.scss";
|
||||
// Configuration
|
||||
import { DEFAULT_VIDEO_PROXY, DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from "../../config.json";
|
||||
import { DEFAULT_VIDEO_PROXY, DEFAULT_DATA_PROXY, DEFAULT_IMAGE_PROXY, SERVER_DOMAIN } from '@utils/GetConfig'
|
||||
import { Donate, Download, ShareIos, ThumbsUp, MediaVideo } from "@iconoir/vue";
|
||||
|
||||
// Components
|
||||
|
|
39
src/utilities/GetConfig.js
Normal file
39
src/utilities/GetConfig.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
export var SERVER_ADMIN = import.meta.env.SERVER_ADMIN
|
||||
export var SERVER_LOCATION = import.meta.env.SERVER_LOCATION
|
||||
export var SERVER_PROTOCOL = import.meta.env.SERVER_PROTOCOL
|
||||
export var SERVER_DOMAIN = import.meta.env.SERVER_DOMAIN
|
||||
export var SERVER_BASE = import.meta.env.SERVER_BASE
|
||||
export var DEFAULT_VIDEO_PROXY = import.meta.env.DEFAULT_VIDEO_PROXY
|
||||
export var DEFAULT_DATA_PROXY = import.meta.env.DEFAULT_DATA_PROXY
|
||||
export var DEFAULT_IMAGE_PROXY = import.meta.env.DEFAULT_IMAGE_PROXY
|
||||
export var DEFAULT_PLAYER = import.meta.env.DEFAULT_PLAYER
|
||||
export var SIDEBAR_CATEGORIES = import.meta.env.SIDEBAR_CATEGORIES
|
||||
export var SIDEBAR_DISCOVER = import.meta.env.SIDEBAR_DISCOVER
|
||||
export var MODIFIED = import.meta.env.MODIFIED
|
||||
export var CUSTOM_SOURCE_CODE = import.meta.env.CUSTOM_SOURCE_CODE
|
||||
export var META_COLOR = import.meta.env.META_COLOR
|
||||
export var COLOR = import.meta.env.COLOR
|
||||
export var THEME = import.meta.env.THEME
|
||||
export var SIDEBAR_SIZE = import.meta.env.SIDEBAR_SIZE
|
||||
export var SIDEBAR_ICONS = import.meta.env.SIDEBAR_ICONS
|
||||
export var THEME_TOGGLE_ENABLED = import.meta.env.THEME_TOGGLE_ENABLED
|
||||
export var THEME_TOGGLE_STYLE = import.meta.env.THEME_TOGGLE_STYLE
|
||||
export var WHITELABEL = import.meta.env.WHITELABEL
|
||||
export var FOOTER_VERSION = import.meta.env.FOOTER_VERSION
|
||||
export var REVERT_LAYOUT = import.meta.env.REVERT_LAYOUT
|
||||
export var ANALYTICS = import.meta.env.ANALYTICS
|
||||
export var MATOMO_ID = import.meta.env.MATOMO_ID
|
||||
export var MATOMO_SRC = import.meta.env.MATOMO_SRC
|
||||
export var PLAUSIBLE_DOMAIN = import.meta.env.PLAUSIBLE_DOMAIN
|
||||
export var PLAUSIBLE_SRC = import.meta.env.PLAUSIBLE_SRC
|
||||
export var UMAMI_ID = import.meta.env.UMAMI_ID
|
||||
export var UMAMI_SRC = import.meta.env.UMAMI_SRC
|
||||
export var AMPLITUDE_APIKEY = import.meta.env.AMPLITUDE_APIKEY
|
||||
export var METRICAL_APP = import.meta.env.METRICAL_APP
|
||||
export var FATHOM_SITE = import.meta.env.FATHOM_SITE
|
||||
export var FATHOM_SRC = import.meta.env.FATHOM_SRC
|
||||
export var MINIAML_ID = import.meta.env.MINIAML_ID
|
||||
export var SWETRIX_SRC = import.meta.env.SWETRIX_SRC
|
||||
export var SWETRIX_API = import.meta.env.SWETRIX_API
|
||||
export var SWETRIX_PROJECT_ID = import.meta.env.SWETRIX_PROJECT_ID
|
||||
export var SIMPLEANALYTICS_DOMAIN = import.meta.env.SIMPLEANALYTICS_DOMAIN
|
Reference in a new issue