Comments (6)
hi,
Is it possible to have such configuration where there is no need to expose cobalt-api?
you will always need to expose it in some way, as the "web" part is just a frontend that does not handle any downloading logic. one way of exposing it while keeping cors=0
could be to put it on the same (sub)domain as cobalt-web, but on a subpath.
for example, suppose that you want to use the subdomain cobalt.example.com
for your instance. You could do:
version: '3.7'
services:
cobalt-api:
image: ghcr.io/wukko/cobalt:7
restart: unless-stopped
container_name: cobalt-api
init: true
ports:
- 127.0.0.1:9000:9000/tcp
environment:
- cors=0
- apiURL=https://cobalt.example.com/
- apiName=cobalt-api
cobalt-web:
image: ghcr.io/wukko/cobalt:7
restart: unless-stopped
container_name: cobalt-web
init: true
ports:
- 127.0.0.1:9001:9001/tcp
environment:
- webURL=https://cobalt.example.com/
- apiURL=https://cobalt.example.com/
and then configure your webserver to proxy the requests accordingly.
i don't know what web server you use, but here is a minimal example of how such configuration could look in nginx (sans additional SSL configuration):
# /etc/nginx/conf.d/cobalt.conf
upstream cobalt-api {
server 127.0.0.1:9000 max_fails=0;
}
upstream cobalt-web {
server 127.0.0.1:9001 max_fails=0;
}
server {
listen 80;
server_name cobalt.example.com;
location / {
proxy_pass http://cobalt-web;
}
location /api {
proxy_pass http://cobalt-api/api;
}
}
from cobalt.
Can you confirm, that there is no straightforward way to setup authentication in front of cobalt, while having frontend and backend on two different domains, because of the CORS issue? (e.g.: cobalt.domain.tld & cobalt-api.domain.tld)
The problem is not so much CORS in this case (that can be taken care of by setting the webURL env for the API if cors=0
is set) as that you will need to make sure that when you authenticate against cobalt.domain.tld
with whatever authentication mechanism you put there, that this session will also apply to cobalt-api.domain.tld
- for example, when using cookies, your authentication mechanism would need to set a cookie for .domain.tld
(which basically means it applies for *.domain.tld
) and not cobalt.domain.tld
, because then you would obviously not be authenticated against the API subdomain (and you have no real way of authenticating against it anyways).
from cobalt.
actually, reviewing the source code, yes, you are right in that you are unable to set the CORS origin due to how cobalt determines whether it should run in API or web mode -- this is most likely an oversight, and so i will try to think of a way to fix this in the future
from cobalt.
Thanks both of you. Managed to successfully configure it as suggested.
from cobalt.
@dumbmoron I am using almost the exact setup of reverse proxy that you provided, but via Traefik. It took me (literally) the entire day to figure that out.
Can you confirm, that there is no straightforward way to setup authentication in front of cobalt, while having frontend and backend on two different domains, because of the CORS issue? (e.g.: cobalt.domain.tld & cobalt-api.domain.tld)
from cobalt.
you are right in that you are unable to set the CORS origin due to how cobalt determines whether it should run in API or web mode
fixed in 7.10.3, webURL
was replaced with CORS_URL
, just like in wip 8.0 :D
from cobalt.
Related Issues (20)
- Unable to download videos from instagram if the post has a photo attached too. HOT 1
- spotify song downloaders? HOT 1
- Error extracting Instagram Reel audio on βbestβ setting
- couldn't get this youtube video because it requires an account to view. HOT 8
- add support for [service name] HOT 2
- add support for newgrounds
- Getting Youtube oAuth token rate limited every 15 mins HOT 3
- youtube doesn't work on main instance HOT 12
- add opensearch support to new frontend HOT 3
- My instance hosting cannot download YouTube videos HOT 6
- youtube videos corrupted (kinda) HOT 2
- [short feature request description] HOT 2
- How to download at least 180 minutes of a too-long video HOT 2
- "Save As" Option HOT 3
- Download TikTok slideshow as video with audio HOT 4
- "Save As" Toggle Feature HOT 1
- a specific link does not work on multiple devices HOT 3
- add support for tiktok ad
- How do i deploy this on Shared Hosting? HOT 1
- Force IPv6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cobalt.