# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: ServerPackCreator
spec:
    description: creates a server pack from any given Forge, Fabric, Quilt, LegacyFabric and NeoForge modpack.
    icon: https://raw.githubusercontent.com/Griefed/ServerPackCreator/refs/heads/main/img/app_128x128.png
    variables:
        - key: ServerPackCreator_DOMAIN
          type: DOMAIN
          name: ServerPackCreator Domain
          description: The domain name of ServerPackCreator.
    readme: |
        # ServerPackCreator
        **ServerPackCreator creates a server pack from any given Forge, Fabric, Quilt, LegacyFabric and NeoForge modpack.**
        **Whenever you are working on an update to your modpack, you simply run ServerPackCreator and BAM! You've got yourself a server pack for your new modpack version.**

        **Disclaimer:**
        * ServerPackCreator is not a guarantee for working server packs. It helps you create them, but you **must still test them**!
        * You are still expected to be knowledgeable about your modpack, server packs in general, server administration and managing your Java installations. ServerPackCreator is not intended to take all the work off your shoulders!

        ## Screenshots
        WebUI
        ![web](https://raw.githubusercontent.com/Griefed/ServerPackCreator/refs/heads/main/img/web.png)
    services:
        - name: PostgreSQL
          icon: https://raw.githubusercontent.com/zeabur/service-icons/main/marketplace/postgresql.svg
          template: PREBUILT
          spec:
            id: postgresql
            source:
                image: postgres:16
                command:
                    - docker-entrypoint.sh
                    - -c
                    - config_file=/etc/postgresql/postgresql.conf
            ports:
                - id: database
                  port: 5432
                  type: TCP
            volumes:
                - id: data
                  dir: /var/lib/postgresql/data
            instructions:
                - title: Connection String
                  content: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}
                - title: PostgreSQL Connect Command
                  content: psql "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}/${POSTGRES_DATABASE}"
                - title: PostgreSQL username
                  content: ${POSTGRES_USERNAME}
                - title: PostgresSQL password
                  content: ${POSTGRES_PASSWORD}
                - title: PostgresSQL database
                  content: ${POSTGRES_DATABASE}
                - title: PostgreSQL host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: PostgreSQL port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                PGDATA:
                    default: /var/lib/postgresql/data/pgdata
                POSTGRES_CONNECTION_STRING:
                    default: postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DATABASE}
                    expose: true
                POSTGRES_DATABASE:
                    default: ${POSTGRES_DB}
                    expose: true
                POSTGRES_DB:
                    default: zeabur
                POSTGRES_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                POSTGRES_PASSWORD:
                    default: ${PASSWORD}
                    expose: true
                POSTGRES_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                POSTGRES_URI:
                    default: ${POSTGRES_CONNECTION_STRING}
                    expose: true
                POSTGRES_USER:
                    default: root
                POSTGRES_USERNAME:
                    default: ${POSTGRES_USER}
                    expose: true
            configs:
                - path: /etc/postgresql/postgresql.conf
                  template: |
                    # https://github.com/postgres/postgres/blob/master/src/backend/utils/misc/postgresql.conf.sample
                    listen_addresses = '*'
                    max_connections = 100
                    shared_buffers = 128MB
                    dynamic_shared_memory_type = posix
                    max_wal_size = 1GB
                    min_wal_size = 80MB
                    log_timezone = 'Etc/UTC'
                    datestyle = 'iso, mdy'
                    timezone = 'Etc/UTC'
                    lc_messages = 'en_US.utf8'
                    lc_monetary = 'en_US.utf8'
                    lc_numeric = 'en_US.utf8'
                    lc_time = 'en_US.utf8'
                    default_text_search_config = 'pg_catalog.english'
                  permission: null
                  envsubst: null
        - name: ServerPackCreator
          icon: https://raw.githubusercontent.com/Griefed/ServerPackCreator/refs/heads/main/img/app_128x128.png
          template: PREBUILT_V2
          spec:
            id: serverpackcreator
            source:
                image: docker.io/griefed/serverpackcreator:latest
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            volumes:
                - id: modpacks
                  dir: /app/serverpackcreator/modpacks
                - id: server-packs
                  dir: /app/serverpackcreator/server-packs
                - id: logs
                  dir: /app/serverpackcreator/logs
            env:
                PGID:
                    default: "1000"
                PUID:
                    default: "1000"
                SPC_DATABASE_DB:
                    default: ${POSTGRES_DATABASE}
                SPC_DATABASE_HOST:
                    default: ${POSTGRES_HOST}
                SPC_DATABASE_PASSWORD:
                    default: ${POSTGRES_PASSWORD}
                SPC_DATABASE_PORT:
                    default: ${POSTGRES_PORT}
                SPC_DATABASE_USERNAME:
                    default: ${POSTGRES_USERNAME}
          domainKey: ServerPackCreator_DOMAIN
localization:
    zh-CN:
        description: 从任何给定的Forge、Fabric、Quilt、LegacyFabric和NeoForge模组包中创建服务器包。
        readme: |
            # ServerPackCreator
            **ServerPackCreator 从任何给定的 Forge、Fabric、Quilt、LegacyFabric 和 NeoForge 模组包中创建服务器包。**
            **每当您在更新您的模组包时，只需运行 ServerPackCreator，BAM！您就为您的新模组包版本获得了一个服务器包。**

            **免责声明：**
            * ServerPackCreator 并不能保证服务器包的正常工作。它帮助您创建它们，但您**必须仍然测试它们**！
            * 您仍然需要了解您的模组包、一般的服务器包、服务器管理以及管理您的 Java 安装。ServerPackCreator 并不打算替您完成所有工作！

            ## 示例图片
            WebUI
            ![web](https://raw.githubusercontent.com/Griefed/ServerPackCreator/refs/heads/main/img/web.png)
    zh-TW:
        description: 從任何給定的Forge、Fabric、Quilt、LegacyFabric和NeoForge模組包中創建伺服器包。
        readme: |-
            # ServerPackCreator
            **ServerPackCreator 從任何給定的 Forge、Fabric、Quilt、LegacyFabric 和 NeoForge 模組包中創建伺服器包。**
            **每當您在更新您的模組包時，只需運行 ServerPackCreator，BAM！您就為您的新模組包版本獲得了一個伺服器包。**

            **免責聲明：**
            * ServerPackCreator 並不能保證伺服器包的正常工作。它幫助您創建它們，但您**必須仍然測試它們**！
            * 您仍然需要了解您的模組包、一般的伺服器包、伺服器管理以及管理您的 Java 安裝。ServerPackCreator 並不打算替您完成所有工作！

            ## 範例圖片
            WebUI
            ![web](https://raw.githubusercontent.com/Griefed/ServerPackCreator/refs/heads/main/img/web.png)
