captainVersion: 4
services:
    $$cap_appname:
        image: ghcr.io/linuxserver/jellyfin:$$cap_jf_version
        environment:
            PUID: $$cap_puid
            PGID: $$cap_pgid
            TZ: $$cap_tz
            JELLYFIN_PublishedServerUrl: '$$cap_appname.$$cap_root_domain'
        volumes:
            - $$cap_appname-config:/config
        caproverExtra:
            containerHttpPort: '8096'
caproverOneClickApp:
    variables:
        - id: $$cap_jf_version
          label: Jellyfin Version
          defaultValue: '10.7.7'
          description: Check out their Docker page for the valid tags https://hub.docker.com/r/linuxserver/jellyfin/tags
          validRegex: /^([^\s^\/])+$/
        - id: '$$cap_puid'
          label: Jellyfin UserID
          defaultValue: 1000
          description: UserID used by JellyFin to avoid permission problems, please refer to docs- https://github.com/linuxserver/docker-jellyfin#Parameters
          validRegex: /[0-9]/
        - id: '$$cap_pgid'
          label: Jellyfin GroupID
          defaultValue: 1000
          description: GroupID used by JellyFin to avoid permission problems, please refer to docs- https://github.com/linuxserver/docker-jellyfin#Parameters
          validRegex: /[0-9]/
        - id: '$$cap_tz'
          label: Time Zone
          defaultValue: Asia/Kolkata
          description: Get yours from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
          validRegex: /.{1,}/
    instructions:
        start: |-
            Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media.
            It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps.

            For more details visit- https://github.com/jellyfin/jellyfin

            PS. It might not work with RPi, or atleast, you wont be able to use OpenMax or V4L2 because Caprover ignores 'devices' parameters of docker-compose
        end: |-
            Jellyfin has been successfully deployed! Please wait atleast 2-4 mins before trying to connect. 
            To enable HTTPS, enable it inside app config from caprover dashboard. 'Enable HTTPS' setting inside of Jellyfin might not work.


            Make sure to add volume mapping for your movies and videos after installation finishes.

            You can also optionally map 7359 and 1900 for auto discovery.
    displayName: Jellyfin
    isOfficial: false
    description: A free media streaming alternative to Plex. Also supports group sync.
    documentation: See https://github.com/linuxserver/docker-jellyfin
