diff --git a/Writerside/topics/configuration-backend.md b/Writerside/topics/configuration-backend.md index 49fdc3a..4683878 100644 --- a/Writerside/topics/configuration-backend.md +++ b/Writerside/topics/configuration-backend.md @@ -8,7 +8,11 @@ centralized in this TOML file instead of environment variables. - `frontend_url` The URL the frontend will be accessed from. This is a required field and must include the trailing slash. The default -path is `http://localhost:8000/web/`. +path is `http://localhost:8000`. + +E.g. if you are accessing MediaManager at `http://example.com/media` where `/media` is the base path, set this to: `http://example.com/media`. + +If you are accessing MediaManager at the root of a domain, e.g. `https://mediamanager.example.com`, set this to `https://mediamanager.example.com`. Make sure to change this to the URL you will use to access the application in your browser. diff --git a/config.dev.toml b/config.dev.toml index eebda7b..9a5f85c 100644 --- a/config.dev.toml +++ b/config.dev.toml @@ -7,7 +7,7 @@ [misc] # it's very likely that you need to change this for MediaManager to work -frontend_url = "http://localhost:5173/" # note the trailing slash +frontend_url = "http://localhost:5173" # note the lack of a trailing slash cors_urls = ["http://localhost:8000", "http://localhost:5173", "http://mediamanager:8000"] # note the lack of a trailing slash image_directory = "/data/images" diff --git a/config.example.toml b/config.example.toml index 4498289..8dacbb4 100644 --- a/config.example.toml +++ b/config.example.toml @@ -7,7 +7,7 @@ [misc] # it's very likely that you need to change this for MediaManager to work -frontend_url = "http://localhost:8000/web/" # note the trailing slash +frontend_url = "http://localhost:8000" # note the lack of a trailing slash cors_urls = ["http://localhost:8000"] # note the lack of a trailing slash image_directory = "/data/images" diff --git a/media_manager/auth/users.py b/media_manager/auth/users.py index 41ddcfe..e9a023e 100644 --- a/media_manager/auth/users.py +++ b/media_manager/auth/users.py @@ -66,7 +66,7 @@ class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]): async def on_after_forgot_password( self, user: User, token: str, request: Optional[Request] = None ): - link = f"{AllEncompassingConfig().misc.frontend_url}login/reset-password?token={token}" + link = f"{AllEncompassingConfig().misc.frontend_url}/web/login/reset-password?token={token}" log.info(f"User {user.id} has forgot their password. Reset Link: {link}") if not config.email_password_resets: @@ -184,7 +184,7 @@ def get_jwt_strategy() -> JWTStrategy[models.UP, models.ID]: class RedirectingCookieTransport(CookieTransport): async def get_login_response(self, token: str) -> Response: response = RedirectResponse( - str(AllEncompassingConfig().misc.frontend_url) + "dashboard", + str(AllEncompassingConfig().misc.frontend_url) + "/web/dashboard", status_code=status.HTTP_302_FOUND, ) return self._set_login_cookie(response, token) diff --git a/media_manager/config.py b/media_manager/config.py index f1f6d44..c0b9024 100644 --- a/media_manager/config.py +++ b/media_manager/config.py @@ -41,7 +41,7 @@ class BasicConfig(BaseSettings): movie_directory: Path = Path(__file__).parent.parent / "data" / "movies" torrent_directory: Path = Path(__file__).parent.parent / "data" / "torrents" - frontend_url: AnyHttpUrl = "http://localhost:3000/web/" + frontend_url: AnyHttpUrl = "http://localhost:3000" cors_urls: list[str] = [] development: bool = False