fix cast, use ENABLE_CAST env var to enable, #331
This commit is contained in:
parent
3b4969dcea
commit
f45a3095cb
|
@ -25,6 +25,11 @@ if [[ -n "$TA_UWSGI_PORT" ]]; then
|
||||||
sed -i "s/8080/$TA_UWSGI_PORT/g" /app/uwsgi.ini
|
sed -i "s/8080/$TA_UWSGI_PORT/g" /app/uwsgi.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# disable auth on static files for cast support
|
||||||
|
if [[ -n "$ENABLE_CAST" ]]; then
|
||||||
|
sed -i "/auth_request/d" /etc/nginx/sites-available/default
|
||||||
|
fi
|
||||||
|
|
||||||
# wait for elasticsearch
|
# wait for elasticsearch
|
||||||
counter=0
|
counter=0
|
||||||
until curl -u "$ELASTIC_USER":"$ELASTIC_PASSWORD" "$ES_URL" -fs; do
|
until curl -u "$ELASTIC_USER":"$ELASTIC_PASSWORD" "$ES_URL" -fs; do
|
||||||
|
|
|
@ -68,12 +68,6 @@ class ApplicationSettingsForm(forms.Form):
|
||||||
("1", "enable sponsorblock integration"),
|
("1", "enable sponsorblock integration"),
|
||||||
]
|
]
|
||||||
|
|
||||||
CAST_CHOICES = [
|
|
||||||
("", "-- change Cast integration --"),
|
|
||||||
("0", "disable Cast"),
|
|
||||||
("1", "enable Cast"),
|
|
||||||
]
|
|
||||||
|
|
||||||
SNAPSHOT_CHOICES = [
|
SNAPSHOT_CHOICES = [
|
||||||
("", "-- change snapshot settings --"),
|
("", "-- change snapshot settings --"),
|
||||||
("0", "disable system snapshots"),
|
("0", "disable system snapshots"),
|
||||||
|
@ -139,9 +133,6 @@ class ApplicationSettingsForm(forms.Form):
|
||||||
downloads_integrate_sponsorblock = forms.ChoiceField(
|
downloads_integrate_sponsorblock = forms.ChoiceField(
|
||||||
widget=forms.Select, choices=SP_CHOICES, required=False
|
widget=forms.Select, choices=SP_CHOICES, required=False
|
||||||
)
|
)
|
||||||
application_enable_cast = forms.ChoiceField(
|
|
||||||
widget=forms.Select, choices=CAST_CHOICES, required=False
|
|
||||||
)
|
|
||||||
application_enable_snapshot = forms.ChoiceField(
|
application_enable_snapshot = forms.ChoiceField(
|
||||||
widget=forms.Select, choices=SNAPSHOT_CHOICES, required=False
|
widget=forms.Select, choices=SNAPSHOT_CHOICES, required=False
|
||||||
)
|
)
|
||||||
|
|
|
@ -47,18 +47,6 @@ class AppConfig:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_config_env():
|
def get_config_env():
|
||||||
"""read environment application variables"""
|
"""read environment application variables"""
|
||||||
host_uid_env = os.environ.get("HOST_UID")
|
|
||||||
if host_uid_env:
|
|
||||||
host_uid = int(host_uid_env)
|
|
||||||
else:
|
|
||||||
host_uid = False
|
|
||||||
|
|
||||||
host_gid_env = os.environ.get("HOST_GID")
|
|
||||||
if host_gid_env:
|
|
||||||
host_gid = int(host_gid_env)
|
|
||||||
else:
|
|
||||||
host_gid = False
|
|
||||||
|
|
||||||
es_pass = os.environ.get("ELASTIC_PASSWORD")
|
es_pass = os.environ.get("ELASTIC_PASSWORD")
|
||||||
es_user = os.environ.get("ELASTIC_USER", default="elastic")
|
es_user = os.environ.get("ELASTIC_USER", default="elastic")
|
||||||
|
|
||||||
|
@ -66,8 +54,9 @@ class AppConfig:
|
||||||
"REDIS_HOST": os.environ.get("REDIS_HOST"),
|
"REDIS_HOST": os.environ.get("REDIS_HOST"),
|
||||||
"es_url": os.environ.get("ES_URL"),
|
"es_url": os.environ.get("ES_URL"),
|
||||||
"es_auth": (es_user, es_pass),
|
"es_auth": (es_user, es_pass),
|
||||||
"HOST_UID": host_uid,
|
"HOST_UID": int(os.environ.get("HOST_UID", False)),
|
||||||
"HOST_GID": host_gid,
|
"HOST_GID": int(os.environ.get("HOST_GID", False)),
|
||||||
|
"enable_cast": bool(os.environ.get("ENABLE_CAST")),
|
||||||
}
|
}
|
||||||
|
|
||||||
return application
|
return application
|
||||||
|
|
|
@ -165,11 +165,6 @@
|
||||||
<i>Before activating that, make sure you have a scraping sleep interval of at least 3 secs set to avoid ratelimiting issues.</i><br>
|
<i>Before activating that, make sure you have a scraping sleep interval of at least 3 secs set to avoid ratelimiting issues.</i><br>
|
||||||
{{ app_form.downloads_integrate_sponsorblock }}
|
{{ app_form.downloads_integrate_sponsorblock }}
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-item">
|
|
||||||
<p>Current Cast integration: <span class="settings-current">{{ config.application.enable_cast }}</span></p>
|
|
||||||
<i>Enabling Cast will load an additional JS library from Google. HTTPS and a supported browser are required for this integration.</i><br>
|
|
||||||
{{ app_form.application_enable_cast }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="settings-group">
|
<div class="settings-group">
|
||||||
<h2 id="snapshots">Snapshots</h2>
|
<h2 id="snapshots">Snapshots</h2>
|
||||||
|
|
Loading…
Reference in New Issue