Skip to content

Commit

Permalink
Merge pull request iv-org#4008 from syeopite/remove_lsquic
Browse files Browse the repository at this point in the history
  • Loading branch information
unixfox authored Aug 4, 2023
2 parents d956b18 + a8ba020 commit 701f03d
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 246 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/container-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build and push Docker AMD64 image without QUIC for Push Event
- name: Build and push Docker AMD64 image for Push Event
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
Expand All @@ -64,9 +64,8 @@ jobs:
tags: quay.io/invidious/invidious:${{ github.sha }},quay.io/invidious/invidious:latest
build-args: |
"release=1"
"disable_quic=1"
- name: Build and push Docker ARM64 image without QUIC for Push Event
- name: Build and push Docker ARM64 image for Push Event
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
Expand All @@ -78,28 +77,4 @@ jobs:
tags: quay.io/invidious/invidious:${{ github.sha }}-arm64,quay.io/invidious/invidious:latest-arm64
build-args: |
"release=1"
"disable_quic=1"
- name: Build and push Docker AMD64 image with QUIC for Push Event
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
labels: quay.expires-after=12w
push: true
tags: quay.io/invidious/invidious:${{ github.sha }}-quic,quay.io/invidious/invidious:latest-quic
build-args: release=1

- name: Build and push Docker ARM64 image with QUIC for Push Event
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.arm64
platforms: linux/arm64/v8
labels: quay.expires-after=12w
push: true
tags: quay.io/invidious/invidious:${{ github.sha }}-arm64-quic,quay.io/invidious/invidious:latest-arm64-quic
build-args: release=1
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
RELEASE := 1
STATIC := 0

DISABLE_QUIC := 1
NO_DBG_SYMBOLS := 0


Expand All @@ -27,10 +26,6 @@ else
FLAGS += --debug
endif

ifeq ($(DISABLE_QUIC), 1)
FLAGS += -Ddisable_quic
endif

ifeq ($(API_ONLY), 1)
FLAGS += -Dapi_only
endif
Expand Down Expand Up @@ -115,7 +110,6 @@ help:
@echo " STATIC Link libraries statically (Default: 0)"
@echo ""
@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)"


Expand Down
21 changes: 0 additions & 21 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,27 +140,6 @@ https_only: false
##
#pool_size: 100

##
## Enable/Disable the use of QUIC (HTTP/3) when connecting
## to the youtube API and websites ('youtube.com', 'ytimg.com').
## QUIC's main advantages are its lower latency and lower bandwidth
## use, compared to its predecessors. However, the current version
## of QUIC used in invidious is still based on the IETF draft 31,
## meaning that the underlying library may still not be fully
## optimized. You can read more about QUIC at the link below:
## https://datatracker.ietf.org/doc/html/draft-ietf-quic-transport-31
##
## Note: you should try both options and see what is the best for your
## instance. In general QUIC is recommended for public instances. Your
## mileage may vary.
##
## Note 2: Using QUIC prevents some captcha challenges from appearing.
## See: https://github.com/iv-org/invidious/issues/957#issuecomment-576424042
##
## Accepted values: true, false
## Default: false
##
#use_quic: false

##
## Additional cookies to be sent when requesting the youtube API.
Expand Down
11 changes: 1 addition & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ FROM crystallang/crystal:1.4.1-alpine AS builder
RUN apk add --no-cache sqlite-static yaml-static

ARG release
ARG disable_quic

WORKDIR /invidious
COPY ./shard.yml ./shard.yml
COPY ./shard.lock ./shard.lock
RUN shards install --production

COPY --from=quay.io/invidious/lsquic-compiled /root/liblsquic.a ./lib/lsquic/src/lsquic/ext/liblsquic.a

COPY ./src/ ./src/
# TODO: .git folder is required for building – this is destructive.
# See definition of CURRENT_BRANCH, CURRENT_COMMIT and CURRENT_VERSION.
Expand All @@ -24,13 +21,7 @@ COPY ./videojs-dependencies.yml ./videojs-dependencies.yml
RUN crystal spec --warnings all \
--link-flags "-lxml2 -llzma"

RUN if [[ "${release}" == 1 && "${disable_quic}" == 1 ]] ; then \
crystal build ./src/invidious.cr \
--release \
-Ddisable_quic \
--static --warnings all \
--link-flags "-lxml2 -llzma"; \
elif [[ "${release}" == 1 ]] ; then \
RUN if [[ "${release}" == 1 ]] ; then \
crystal build ./src/invidious.cr \
--release \
--static --warnings all \
Expand Down
11 changes: 1 addition & 10 deletions docker/Dockerfile.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ FROM alpine:3.16 AS builder
RUN apk add --no-cache 'crystal=1.4.1-r0' shards sqlite-static yaml-static yaml-dev libxml2-dev zlib-static openssl-libs-static openssl-dev musl-dev

ARG release
ARG disable_quic

WORKDIR /invidious
COPY ./shard.yml ./shard.yml
COPY ./shard.lock ./shard.lock
RUN shards install --production

COPY --from=quay.io/invidious/lsquic-compiled /root/liblsquic.a ./lib/lsquic/src/lsquic/ext/liblsquic.a

COPY ./src/ ./src/
# TODO: .git folder is required for building – this is destructive.
# See definition of CURRENT_BRANCH, CURRENT_COMMIT and CURRENT_VERSION.
Expand All @@ -24,13 +21,7 @@ COPY ./videojs-dependencies.yml ./videojs-dependencies.yml
RUN crystal spec --warnings all \
--link-flags "-lxml2 -llzma"

RUN if [[ "${release}" == 1 && "${disable_quic}" == 1 ]] ; then \
crystal build ./src/invidious.cr \
--release \
-Ddisable_quic \
--static --warnings all \
--link-flags "-lxml2 -llzma"; \
elif [[ "${release}" == 1 ]] ; then \
RUN if [[ "${release}" == 1 ]] ; then \
crystal build ./src/invidious.cr \
--release \
--static --warnings all \
Expand Down
4 changes: 0 additions & 4 deletions shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ shards:
git: https://github.com/jeromegn/kilt.git
version: 0.6.1

lsquic:
git: https://github.com/iv-org/lsquic.cr.git
version: 2.18.1-2

pg:
git: https://github.com/will/crystal-pg.git
version: 0.24.0
Expand Down
3 changes: 0 additions & 3 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ dependencies:
protodec:
github: iv-org/protodec
version: ~> 0.1.5
lsquic:
github: iv-org/lsquic.cr
version: ~> 2.18.1-2
athena-negotiation:
github: athena-framework/negotiation
version: ~> 0.1.1
Expand Down
2 changes: 1 addition & 1 deletion src/invidious.cr
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ SOFTWARE = {
"branch" => "#{CURRENT_BRANCH}",
}

YT_POOL = YoutubeConnectionPool.new(YT_URL, capacity: CONFIG.pool_size, use_quic: CONFIG.use_quic)
YT_POOL = YoutubeConnectionPool.new(YT_URL, capacity: CONFIG.pool_size)

# CLI
Kemal.config.extra_options do |parser|
Expand Down
2 changes: 0 additions & 2 deletions src/invidious/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ class Config
property host_binding : String = "0.0.0.0"
# Pool size for HTTP requests to youtube.com and ytimg.com (each domain has a separate pool of `pool_size`)
property pool_size : Int32 = 100
# Use quic transport for youtube api
property use_quic : Bool = false

# Saved cookies in "name1=value1; name2=value2..." format
@[YAML::Field(converter: Preferences::StringToCookies)]
Expand Down
Loading

0 comments on commit 701f03d

Please sign in to comment.