diff --git a/.env.example b/.env.example index f082c83..b27d76e 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -VITE_INVIDIOUS_URL= \ No newline at end of file +INVIDIOUS_URL= \ No newline at end of file diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index bfd260c..ace7e2c 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -7,7 +7,6 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - VITE_INVIDIOUS_URL: ${{ secrets.VITE_INVIDIOUS_URL }} jobs: build-and-publish: diff --git a/README.md b/README.md index 85abf9c..c4ce706 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ FreeTunes is an app to listen to background music from youtub and download it as ## Requirements To run this project on your environment you will need one thing -- A publicly accesible [Invidious](https://invidious.io/) instance. To provide this you can use the `VITE_INVIDIOUS_URL` env var. If this environment variable is not detected the app will refuse to start. +- A publicly accesible [Invidious](https://invidious.io/) instance. To provide this you can use the `INVIDIOUS_URL` env var. If this environment variable is not detected the app will refuse to start. ## Running from docker image A docker image is published to ghcr.io with every commit of this repository. You can give this project a try with a `docker run --rm` command like this: ```sh -docker run --rm -e VITE_INVIDIOUS_URL=htps://your.invidious.instance.url.here -p 3000:3000 ghcr.io/juandjara/freetunes +docker run --rm -e INVIDIOUS_URL=htps://your.invidious.instance.url.here -p 3000:3000 ghcr.io/juandjara/freetunes ``` You can now access the running service on https://localhost:300 @@ -27,7 +27,7 @@ services: image: ghcr.io/juandjara/freetunes container_name: freetunes environment: - - VITE_INVIDIOUS_URL=htps://your.invidious.instance.url.here # note this variable will be used by both frontend and backend, so it must publicly accesible + - INVIDIOUS_URL=htps://your.invidious.instance.url.here # note this variable will be used by both frontend and backend, so it must publicly accesible ports: - '3000:3000' ``` @@ -35,7 +35,7 @@ services: ## Running locally with node You can also run this project locally from source using `node`. To do so, follow these steps: 1. Install dependencies with `npm install` or the package manager you use (yarn, pnpm, etc) -2. Copy the file `.env.example` to a new file called `.env` and fill in the `VITE_INVIDIOUS_URL` variable there. +2. Copy the file `.env.example` to a new file called `.env` and fill in the `INVIDIOUS_URL` variable there. 3. Run the command `npm run dev`. This will bring up the dev server with HMR 4. Now you can access the app on http://localhost:3000 diff --git a/api/lib/config.ts b/api/lib/config.ts index 65ce985..ddf4fbd 100644 --- a/api/lib/config.ts +++ b/api/lib/config.ts @@ -1,7 +1,7 @@ -const invidiousURL = import.meta.env.VITE_INVIDIOUS_URL +const invidiousURL = process.env.INVIDIOUS_URL if (!invidiousURL) { - throw new Error('VITE_INVIDIOUS_URL environment variable is not set') + throw new Error('INVIDIOUS_URL environment variable is not set') } export default { diff --git a/src/config.ts b/src/config.ts index 1c64c3c..24281f2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,2 +1 @@ -export const INVIDIOUS_URL = import.meta.env.VITE_INVIDIOUS_URL as string export const API_URL = '/api'