Skip to content

Commit

Permalink
Merge pull request #1118 from museofficial/develop
Browse files Browse the repository at this point in the history
* Feat: allow users to change dotenv file with env var

This facilitates the usage of docker secrets for the keys/tokens.

* Feat: default ENV_FILE to /config in dockerfile

* Doc: document the existance and usage of ENV_FILe env var.

* Fix: legacy env key in dockerfile

* Dependency upgrade (for the past few missed dependabot updates) (#1117)

* Bump dotenv from 16.0.0 to 16.4.5

Bumps [dotenv](https://github.com/motdotla/dotenv) from 16.0.0 to 16.4.5.
- [Changelog](https://github.com/motdotla/dotenv/blob/master/CHANGELOG.md)
- [Commits](motdotla/dotenv@v16.0.0...v16.4.5)

---
updated-dependencies:
- dependency-name: dotenv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump p-retry from 4.6.2 to 6.2.0

Bumps [p-retry](https://github.com/sindresorhus/p-retry) from 4.6.2 to 6.2.0.
- [Release notes](https://github.com/sindresorhus/p-retry/releases)
- [Commits](sindresorhus/p-retry@v4.6.2...v6.2.0)

---
updated-dependencies:
- dependency-name: p-retry
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump ora from 6.1.0 to 8.1.0

Bumps [ora](https://github.com/sindresorhus/ora) from 6.1.0 to 8.1.0.
- [Release notes](https://github.com/sindresorhus/ora/releases)
- [Commits](sindresorhus/ora@v6.1.0...v8.1.0)

---
updated-dependencies:
- dependency-name: ora
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump @types/validator from 13.7.2 to 13.12.2

Bumps [@types/validator](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/validator) from 13.7.2 to 13.12.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/validator)

---
updated-dependencies:
- dependency-name: "@types/validator"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump prisma from 4.16.0 to 5.21.1

Bumps [prisma](https://github.com/prisma/prisma/tree/HEAD/packages/cli) from 4.16.0 to 5.21.1.
- [Release notes](https://github.com/prisma/prisma/releases)
- [Commits](https://github.com/prisma/prisma/commits/5.21.1/packages/cli)

---
updated-dependencies:
- dependency-name: prisma
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: JoaoCostaIFG <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 29, 2024
2 parents 534d8fa + e23f897 commit c0a8796
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 107 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@ ENV DATA_DIR=/data
ENV NODE_ENV=production
ENV COMMIT_HASH=$COMMIT_HASH
ENV BUILD_DATE=$BUILD_DATE
ENV ENV_FILE=/config

CMD ["tini", "--", "node", "--enable-source-maps", "dist/scripts/migrate-and-start.js"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='' -e SPOTIFY_CLIENT_ID='

This starts Muse and creates a data directory in your current directory.

You can also store your tokens in an environment file and make it available to your container. By default, the container will look for a `/config` environment file. You can customize this path with the `ENV_FILE` environment variable to use with, for example, [docker secrets](https://docs.docker.com/engine/swarm/secrets/).

**Docker Compose**:

```yaml
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@types/node": "^17.0.0",
"@types/node-emoji": "^1.8.1",
"@types/spotify-web-api-node": "^5.0.2",
"@types/validator": "^13.1.4",
"@types/validator": "^13.12.2",
"@types/ws": "8.5.4",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
Expand All @@ -50,7 +50,7 @@
"eslint-config-xo-typescript": "^0.44.0",
"eslint-plugin-import": "2.29.1",
"husky": "^4.3.8",
"prisma": "4.16.0",
"prisma": "5.21.1",
"release-it": "^14.11.8",
"type-fest": "^2.12.0",
"typescript": "^4.6.4"
Expand Down Expand Up @@ -98,7 +98,7 @@
"delay": "^5.0.0",
"discord-api-types": "0.32.1",
"discord.js": "14.11.0",
"dotenv": "^16.0.0",
"dotenv": "^16.4.5",
"execa": "^6.1.0",
"fluent-ffmpeg": "^2.1.2",
"fs-capacitor": "^7.0.1",
Expand All @@ -111,11 +111,11 @@
"make-dir": "^3.1.0",
"node-emoji": "^1.10.0",
"nodesplash": "^0.1.1",
"ora": "^6.1.0",
"ora": "^8.1.0",
"p-event": "^5.0.1",
"p-limit": "^4.0.0",
"p-queue": "^7.2.0",
"p-retry": "4.6.2",
"p-retry": "6.2.0",
"pagination.djs": "^4.0.10",
"parse-duration": "1.0.2",
"patch-package": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/services/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path';
import xbytes from 'xbytes';
import {ConditionalKeys} from 'type-fest';
import {ActivityType, PresenceStatusData} from 'discord.js';
dotenv.config();
dotenv.config({path: process.env.ENV_FILE ?? path.resolve(process.cwd(), '.env')});

export const DATA_DIR = path.resolve(process.env.DATA_DIR ? process.env.DATA_DIR : './data');

Expand Down
Loading

0 comments on commit c0a8796

Please sign in to comment.