apiVersion: batch/v1
kind: Job
metadata:
  name: aquatone-BBS_PROJECT_CODE
  labels:
    app: aquatone-BBS_PROJECT_CODE
spec:
  ttlSecondsAfterFinished: 100
  template:
    metadata:
      labels:
        app: aquatone-BBS_PROJECT_CODE
    spec:
      volumes:
      - name: data-volume
        hostPath: 
          path: /mnt/volume_lon1_01
          type: Directory
      containers:
      - name: aquatone-BBS_PROJECT_CODE
        image: smokingcaterpillar/bbs-osintel-gau-subs
        volumeMounts:
        - name: data-volume
          mountPath: /optdata
        command: 
        - /bin/bash
        - -c
        - |
          echo aquatone v1
          echo Code: BBS_PROJECT_CODE
          echo Id: BBS_PROJECT_ID
          echo List: BBS_PROJECT_LIST
          apt update
          apt install unzip -y
          
          ## BBRF SETUP ##
          echo setting up BBRF...
          cp /optdata/BBS/output/private/bbrs-config.json /root/.bbrf/config.json
          bbrf use BBS_PROJECT_CODE
          ## BBRF SETUP ##
          
          
          cd /optdata/BBS
          
          
          mkdir -p output/project-data/BBS_PROJECT_CODE/data/scanner/aquatone/
          cd output/project-data/BBS_PROJECT_CODE/data/scanner/aquatone/
          wget -O aquatone.zip https://github.com/michenriksen/aquatone/releases/download/v1.7.0/aquatone_linux_amd64_1.7.0.zip
          unzip aquatone.zip
          chmod +x aquatone
          ls -la
          
          apt install chromium  -y 
          
          cat /optdata/BBS/output/project-data/BBS_PROJECT_CODE/BBS_PROJECT_LIST | ./aquatone
          
          cat aquatone_urls.txt | bbrf url add - -t "added_by:aquatone"
          
          
                    
          echo all done
      restartPolicy: Never

