diff options
| -rw-r--r-- | .github/workflows/build-nightly-container.yml | 13 | ||||
| -rw-r--r-- | .github/workflows/build-stable-container.yml | 13 | ||||
| -rw-r--r-- | config/config.example.yml | 10 | ||||
| -rw-r--r-- | src/invidious/config.cr | 12 |
4 files changed, 14 insertions, 34 deletions
diff --git a/.github/workflows/build-nightly-container.yml b/.github/workflows/build-nightly-container.yml index bee27600..5ff3322f 100644 --- a/.github/workflows/build-nightly-container.yml +++ b/.github/workflows/build-nightly-container.yml @@ -23,19 +23,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install Crystal - uses: crystal-lang/install-crystal@v1.8.2 - with: - crystal: 1.12.2 - - - name: Run lint - run: | - if ! crystal tool format --check; then - crystal tool format - git diff - exit 1 - fi - - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: diff --git a/.github/workflows/build-stable-container.yml b/.github/workflows/build-stable-container.yml index d2d106b6..25571ed6 100644 --- a/.github/workflows/build-stable-container.yml +++ b/.github/workflows/build-stable-container.yml @@ -14,19 +14,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install Crystal - uses: crystal-lang/install-crystal@v1.8.2 - with: - crystal: 1.12.2 - - - name: Run lint - run: | - if ! crystal tool format --check; then - crystal tool format - git diff - exit 1 - fi - - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: diff --git a/config/config.example.yml b/config/config.example.yml index a3a2eeb7..bc2deda5 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -178,11 +178,11 @@ https_only: false ## ## If unset, then no HTTP proxy will be used. ## -http_proxy: - user: - password: - host: - port: +#http_proxy: +# user: +# password: +# host: +# port: ## diff --git a/src/invidious/config.cr b/src/invidious/config.cr index c4ca622f..4b3bdafc 100644 --- a/src/invidious/config.cr +++ b/src/invidious/config.cr @@ -184,6 +184,9 @@ class Config config = Config.from_yaml(config_yaml) # Update config from env vars (upcased and prefixed with "INVIDIOUS_") + # + # Also checks if any top-level config options are set to "CHANGE_ME!!" + # TODO: Support non-top-level config options such as the ones in DBConfig {% for ivar in Config.instance_vars %} {% env_id = "INVIDIOUS_#{ivar.id.upcase}" %} @@ -220,6 +223,12 @@ class Config exit(1) end end + + # Warn when any config attribute is set to "CHANGE_ME!!" + if config.{{ivar.id}} == "CHANGE_ME!!" + puts "Config: The value of '#{ {{ivar.stringify}} }' needs to be changed!!" + exit(1) + end {% end %} # HMAC_key is mandatory @@ -227,9 +236,6 @@ class Config if config.hmac_key.empty? puts "Config: 'hmac_key' is required/can't be empty" exit(1) - elsif config.hmac_key == "CHANGE_ME!!" - puts "Config: The value of 'hmac_key' needs to be changed!!" - exit(1) end # Build database_url from db.* if it's not set directly |
