# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: ToThePast
spec:
    description: A personal photography wall built with Nuxt 4. Auto-scans S3/R2 buckets, extracts EXIF metadata, and displays photos in a masonry layout.
    icon: https://raw.githubusercontent.com/KennKyou/ToThePast/main/public/android-chrome-512x512.png
    readme: ""
    services:
        - name: ToThePast-db
          icon: https://cdn.zeabur.com/marketplace/mongodb.svg
          template: PREBUILT_V2
          spec:
            source:
                image: mongo:8
                command:
                    - sh
                args:
                    - -c
                    - sed -i '10,23d' /usr/local/bin/docker-entrypoint.sh && exec docker-entrypoint.sh mongod
            ports:
                - id: database
                  port: 27017
                  type: TCP
            volumes:
                - id: data
                  dir: /data/db
            instructions:
                - title: Command to connect to your MongoDB
                  content: mongosh "mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}"
                - title: MongoDB connection string
                  content: mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${PORT_FORWARDED_HOSTNAME}:${DATABASE_PORT_FORWARDED_PORT}
                - title: MongoDB username
                  content: ${MONGO_USERNAME}
                - title: MongoDB password
                  content: ${MONGO_PASSWORD}
                - title: MongoDB host
                  content: ${PORT_FORWARDED_HOSTNAME}
                - title: MongoDB port
                  content: ${DATABASE_PORT_FORWARDED_PORT}
            env:
                MONGO_CONNECTION_STRING:
                    default: mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@${MONGO_HOST}:${MONGO_PORT}
                    expose: true
                MONGO_HOST:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                MONGO_INITDB_ROOT_PASSWORD:
                    default: ${PASSWORD}
                    expose: false
                MONGO_INITDB_ROOT_USERNAME:
                    default: mongo
                    expose: false
                MONGO_PASSWORD:
                    default: ${MONGO_INITDB_ROOT_PASSWORD}
                    expose: true
                MONGO_PORT:
                    default: ${DATABASE_PORT}
                    expose: true
                MONGO_URI:
                    default: ${MONGO_CONNECTION_STRING}
                    expose: true
                MONGO_USERNAME:
                    default: ${MONGO_INITDB_ROOT_USERNAME}
                    expose: true
            configs: []
            portForwarding:
                enabled: true
        - name: ToThePast
          icon: https://raw.githubusercontent.com/KennKyou/ToThePast/main/public/android-chrome-512x512.png
          template: PREBUILT_V2
          spec:
            source:
                source: GITHUB
                repo: 1201071284
                branch: main
                rootDirectory: /
            ports:
                - id: web
                  port: 8080
                  type: HTTP
            env:
                NUXT_ADMIN_EMAIL:
                    default: ""
                    expose: false
                NUXT_MONGODB_URI:
                    default: ${MONGO_CONNECTION_STRING}
                    expose: false
                NUXT_OAUTH_GOOGLE_CLIENT_ID:
                    default: ""
                    expose: false
                NUXT_OAUTH_GOOGLE_CLIENT_SECRET:
                    default: ""
                    expose: false
                NUXT_S3_ACCESS_KEY_ID:
                    default: ""
                    expose: false
                NUXT_S3_BUCKET:
                    default: ""
                    expose: false
                NUXT_S3_ENDPOINT:
                    default: ""
                    expose: false
                NUXT_S3_PUBLIC_URL:
                    default: ""
                    expose: false
                NUXT_S3_REGION:
                    default: auto
                    expose: false
                NUXT_S3_SECRET_ACCESS_KEY:
                    default: ""
                    expose: false
                NUXT_SESSION_PASSWORD:
                    default: ${PASSWORD}
                    expose: false
                PORT:
                    default: ${WEB_PORT}
                    expose: false
            configs: []
            portForwarding:
                enabled: false
