Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ FROM nginx:alpine
EXPOSE 80

ENV BASE_URL=""
ENV BASE_URL_SEERR=""

COPY build/web /usr/share/nginx/html

RUN echo '{"baseUrl": "${BASE_URL}"}' > /usr/share/nginx/html/assets/config/config.json
RUN echo '{"baseUrl": "${BASE_URL}", "baseUrlSeerr": "${BASE_URL_SEERR}"}' > /usr/share/nginx/html/assets/config/config.json

CMD /bin/sh -c 'sed -i "s|\${BASE_URL}|${BASE_URL}|g" /usr/share/nginx/html/assets/config/config.json && nginx -g "daemon off;"'
CMD /bin/sh -c 'sed -i "s|\${BASE_URL}|${BASE_URL}|g" /usr/share/nginx/html/assets/config/config.json && sed -i "s|\${BASE_URL_SEERR}|${BASE_URL_SEERR}|g" /usr/share/nginx/html/assets/config/config.json && nginx -g "daemon off;"'
5 changes: 3 additions & 2 deletions Dockerfile-rootless
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ FROM ghcr.io/nginxinc/nginx-unprivileged:stable-alpine-slim
EXPOSE 8080

ENV BASE_URL=""
ENV BASE_URL_SEERR=""

USER root
COPY build/web /usr/share/nginx/html
RUN chown -R nginx:nginx /usr/share/nginx/html

USER nginx
RUN mkdir -p /usr/share/nginx/html/assets/config && \
echo '{"baseUrl": "${BASE_URL}"}' > /usr/share/nginx/html/assets/config/config.json
echo '{"baseUrl": "${BASE_URL}", "baseUrlSeerr": "${BASE_URL_SEERR}"}' > /usr/share/nginx/html/assets/config/config.json

USER root
CMD /bin/sh -c 'sed -i "s|\${BASE_URL}|${BASE_URL}|g" /usr/share/nginx/html/assets/config/config.json && nginx -g "daemon off;"'
CMD /bin/sh -c 'sed -i "s|\${BASE_URL}|${BASE_URL}|g" /usr/share/nginx/html/assets/config/config.json && sed -i "s|\${BASE_URL_SEERR}|${BASE_URL_SEERR}|g" /usr/share/nginx/html/assets/config/config.json && nginx -g "daemon off;"'
3 changes: 3 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ Run `docker-compose up -d` to start the container. It will be available on `http
> [!TIP]
> We recommend changing the `BASE_URL` environment variable to the URL you use to access Jellyfin, as this will skip entering it when you load the web UI.

> [!TIP]
> You can set the `BASE_URL_SEERR` environment variable to pre-fill the Jellyseerr server URL on the login page.

## Web

You can also manually copy the web .zip build to any static file server such as Nginx, Caddy, or Apache
Expand Down
5 changes: 3 additions & 2 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"baseUrl": null
}
"baseUrl": null,
"baseUrlSeerr": null
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ services:
- 80:80
environment:
- BASE_URL=https://server-url #OPTIONAL: Locks the Fladder front-end to a certain jellyfin server
- BASE_URL_SEERR= #OPTIONAL: Pre-fills the Jellyseerr server URL on the login page
3 changes: 3 additions & 0 deletions lib/providers/auth_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class AuthNotifier extends StateNotifier<LoginScreenModel> {
await setServer(url);
}
}
if (FladderConfig.baseUrlSeerr != null) {
setTempSeerrUrl(FladderConfig.baseUrlSeerr);
}
state = state.copyWith(
accounts: currentAccounts,
screen: currentAccounts.isEmpty ? LoginScreenType.login : LoginScreenType.users,
Expand Down
6 changes: 6 additions & 0 deletions lib/util/fladder_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ class FladderConfig {
static set baseUrl(String? value) => _instance._baseUrl = value;
String? _baseUrl;

static String? get baseUrlSeerr => _instance._baseUrlSeerr;
static set baseUrlSeerr(String? value) => _instance._baseUrlSeerr = value;
String? _baseUrlSeerr;

static void fromJson(Map<String, dynamic> json) => _instance = FladderConfig._fromJson(json);

factory FladderConfig._fromJson(Map<String, dynamic> json) {
final config = FladderConfig._();
final newUrl = json['baseUrl'] as String?;
config._baseUrl = newUrl?.isEmpty == true ? null : newUrl;
final newSeerrBaseUrl = json['baseUrlSeerr'] as String?;
config._baseUrlSeerr = newSeerrBaseUrl?.isEmpty == true ? null : newSeerrBaseUrl;
return config;
}
}