summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/auto-close-duplicate.yaml37
-rw-r--r--Makefile13
-rw-r--r--src/invidious.cr9
-rw-r--r--src/invidious/views/template.ecr8
4 files changed, 61 insertions, 6 deletions
diff --git a/.github/workflows/auto-close-duplicate.yaml b/.github/workflows/auto-close-duplicate.yaml
new file mode 100644
index 00000000..2eea099e
--- /dev/null
+++ b/.github/workflows/auto-close-duplicate.yaml
@@ -0,0 +1,37 @@
+name: Close duplicates
+on:
+ issues:
+ types: [opened]
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ permissions: write-all
+ steps:
+ - uses: iv-org/close-potential-duplicates@v1
+ with:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # Issue title filter work with anymatch https://www.npmjs.com/package/anymatch.
+ # Any matched issue will stop detection immediately.
+ # You can specify multi filters in each line.
+ filter: ''
+ # Exclude keywords in title before detecting.
+ exclude: ''
+ # Label to set, when potential duplicates are detected.
+ label: duplicate
+ # Get issues with state to compare. Supported state: 'all', 'closed', 'open'.
+ state: open
+ # If similarity is higher than this threshold([0,1]), issue will be marked as duplicate.
+ threshold: 0.9
+ # Reactions to be add to comment when potential duplicates are detected.
+ # Available reactions: "-1", "+1", "confused", "laugh", "heart", "hooray", "rocket", "eyes"
+ reactions: ''
+ close: true
+ # Comment to post when potential duplicates are detected.
+ comment: |
+ Hello, your issue is a duplicate of this/these issue(s): {{#issues}}
+ - #{{ number }} [accuracy: {{ accuracy }}%]
+ {{/issues}}
+
+ If this is a mistake please explain why and ping @\unixfox, @\SamantazFox and @\TheFrenchGhosty.
+
+ Please refrain from opening new issues, it won't help in solving your problem.
diff --git a/Makefile b/Makefile
index 29be727c..929b11e1 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,10 @@ ifeq ($(DISABLE_QUIC), 1)
FLAGS += -Ddisable_quic
endif
+ifeq ($(API_ONLY), 1)
+ FLAGS += -Dapi_only
+endif
+
# -----------------------
# Main
@@ -106,11 +110,12 @@ help:
@echo ""
@echo "Build options available for this Makefile:"
@echo ""
- @echo " RELEASE Make a release build (Default: 1)"
- @echo " STATIC Link libraries statically (Default: 0)"
+ @echo " RELEASE Make a release build (Default: 1)"
+ @echo " STATIC Link libraries statically (Default: 0)"
@echo ""
- @echo " DISABLE_QUIC Disable support for QUIC (Default: 0)"
- @echo " NO_DBG_SYMBOLS Strip debug symbols (Default: 0)"
+ @echo " API_ONLY Build invidious without a GUI (Default: 0)"
+ @echo " DISABLE_QUIC Disable support for QUIC (Default: 0)"
+ @echo " NO_DBG_SYMBOLS Strip debug symbols (Default: 0)"
diff --git a/src/invidious.cr b/src/invidious.cr
index b5abd5c7..27c4775e 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -57,8 +57,9 @@ end
# Simple alias to make code easier to read
alias IV = Invidious
-CONFIG = Config.load
-HMAC_KEY = CONFIG.hmac_key || Random::Secure.hex(32)
+CONFIG = Config.load
+HMAC_KEY_CONFIGURED = CONFIG.hmac_key != nil
+HMAC_KEY = CONFIG.hmac_key || Random::Secure.hex(32)
PG_DB = DB.open CONFIG.database_url
ARCHIVE_URL = URI.parse("https://archive.org")
@@ -230,6 +231,10 @@ Kemal.config.host_binding = Kemal.config.host_binding != "0.0.0.0" ? Kemal.confi
Kemal.config.port = Kemal.config.port != 3000 ? Kemal.config.port : CONFIG.port
Kemal.config.app_name = "Invidious"
+if !HMAC_KEY_CONFIGURED
+ LOGGER.warn("Please configure hmac_key by July 1st, see more here: https://github.com/iv-org/invidious/issues/3854")
+end
+
# Use in kemal's production mode.
# Users can also set the KEMAL_ENV environmental variable for this to be set automatically.
{% if flag?(:release) || flag?(:production) %}
diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr
index 77265679..aa0fc15f 100644
--- a/src/invidious/views/template.ecr
+++ b/src/invidious/views/template.ecr
@@ -111,6 +111,14 @@
</div>
<% end %>
+ <% if env.get? "user" %>
+ <% if !HMAC_KEY_CONFIGURED && CONFIG.admins.includes? env.get("user").as(Invidious::User).email %>
+ <div class="h-box">
+ <h3><p>Message for admin: please configure hmac_key, <a href="https://github.com/iv-org/invidious/issues/3854">see more here</a>.</p></h3>
+ </div>
+ <% end %>
+ <% end %>
+
<%= content %>
<footer>