1. Setup CLaaT locally following the below steps.
  1. Download the CLaaT binary from https://github.com/googlecodelabs/tools/releases/tag/v1.0.4
  2. Rename the downloaded file to claat for ease of use.
  3. Add executable permission to the file using the command

sudo chmod +X <PathToDownload>/claat

  1. [Optional] Add the path to this executable to your PATH variable using the command.

export PATH=$PATH:<Path to claat binary>

  1. Once CLaaT is setup you can export documents using the DocId's with the below command. This command creates the static CLaaT HTML folders.

claat export <DocID>

Note: If you have done step 1.d you can use claat from any location on the terminal, if not you would need to change directory into the location where you have the claat executable.

  1. After exporting all required docs you can zip them as a tar.gz and scp into the server where docs.qusandbox.com is hosted using the below command.

sudo scp -i <.pem> <PathToTar> ubuntu@<DocsIP>:/home/ec2-user/work/claat

  1. After scp is complete ssh into the server to untar the file and delete the tar file
  2. If claat server is up you should see the document on docs.qusandbox.com

Note: This assumes the server has claat setup with the given service account.

  1. Share (give read permissions only) all the documents that you want to put onto docs.qusandbox.com with

admin-731@docaccess-209114.iam.gserviceaccount.com

  1. SSH into the docs server.
  2. Change directory to /home/ec2-user/work/claat
  3. Use the below command to generate the claat pages for all the docs.

./claat export <DocID>

Note: This assumes claat is set up in the path and either CLaaT has been setup with an auth code or an auth code is setup as an environment variable "CLAAT_AUTH_CODE"

  1. Create a csv file with all DocID's.
  2. Create a shell file and copy this script.
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
        if [ ${#CLAAT_AUTH_CODE} = 0 ]
        then
                echo "Using system CLAAT_AUTH_CODE"
                claat export "$line"
        else
                echo "Using user defined CLAAT_AUTH_CODE"
                claat export -auth $CLAAT_AUTH_CODE "$line"
        fi
    echo "Exported: $line"
done < "$1"
  1. Run the file created above and pass the csv file as command argument.

Note: Make sure to remove bower-components and elements before doing this. Also make sure to export all documents afresh otherwise the command might be appended multiple times.

  1. Create a shell script with the following content, remove the rm rf commands if you do not have bower_components and elements folders.
#!bin/bash
sudo rm -rf bower-components/
sudo rm -rf elements/
a="<script>document.addEventListener('DOMContentLoaded', function() { const lab = document.querySelector('google-codelab'); lab._goToHome = function() {        console.log('Doing Nothing'); }});</script>"
b=$(find . -name "index.html")
for filename in $b; do
        echo $a >> $filename
done
  1. Run this shell script to remove the redirect to home link.
  1. CLaaT Server should run on port 9090.
  2. Use screen -r to resume to a screen which had claat running or use screen to launch a new screen if claat was never run.
  3. Use command claat serve to start the server. [use screen to run the server as it is a non exiting process]