Skip to content

Commit

Permalink
Add documentation for cloud setup token (FusionAuth#3128)
Browse files Browse the repository at this point in the history
* Cleanup fa-screenshot.sh
* Add setup token docs with new screenshots
* Wording
* Update screenshot
* Shrink images
* Removed compression instructions from doc
  • Loading branch information
mmanes authored Jun 24, 2024
1 parent 03d0368 commit aab8429
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 43 deletions.
4 changes: 2 additions & 2 deletions DocsDevREADME.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,16 @@ end tell
- Highlights should be red rectangle with line weight 5
- To size and compress images without losing too much quality, follow these steps:
1. Resize to width of 1600 in Preview.app ( or you can use `sips --resampleWidth 1600 *.png` from the command line)
2. Use https://tinypng.com/ to compress the image
2. Crop the image vertically to only display the necessary content.
- Use https://local.fusionauth.io and use the correct kickstart to add the Silicon Valley characters ( https://github.com/FusionAuth/fusionauth-example-kickstart/blob/main/fusionauth/kickstart-development.json )
- Make sure that the same character is used for every screenshot on a page (unless you are demonstrating a view from the admin and also user perspective)
- The shrink-images GitHub Action will call https://tinypng.com/ to compress the images that you commit.
### Shell script for capturing sceenshots
fa-screenshot.sh is located under `fusionauth-site/src/`. With this script you can automate following tasks:
- Sizing and moving the Safari window
- Capturing the screenshot
- Resizing the screenshot image
- Compressing the image using either pngquant or Tiny PNG
- Moving the image to an appropriate folder
```bash
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion astro/src/content/docs/get-started/run-in-the-cloud/cloud.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,15 @@ When the deployment is ready, the link to your deployment will be live and the <

### Accessing the FusionAuth UI

Log in to the deployment's administrative user interface by clicking on the deployment's URL, such as `https://piedpiper-dev-ha-may.fusionauth.io`.
In order to ensure that only authorized users can setup your new deployment, a setup token is required to access the deployment's
administrative user interface. If you navigate directly to the deployment URL, such as `https://piedpiper-dev-ha-may.fusionauth.io`,
you will be prompted to enter an 8-character setup token. This token is available under the Setup status section on the
deployment management screen.

If you access the deployment by clicking on provided URL link, the setup token will be automatically submitted and the Setup
Token screen will be bypassed.

<img src="/img/docs/get-started/run-in-the-cloud/setup-token-entry.png" alt="Deployment tab when the provisioning finished." width="1200" role="bottom-cropped" />

At that point the [Setup Wizard](/docs/get-started/run-in-the-cloud/setup-wizard) will begin.
You can configure FusionAuth by creating API keys, adding additional users, setting up applications for your users to log in to, or any other task.
Expand Down
56 changes: 16 additions & 40 deletions src/fa-screenshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@ function printFileAttribs() {
printOut "Current size of the screenshot is : "`echo ${attributes} | cut -d' ' -f7`
}

function compressUsingTinyPNG() {
echo "-- Using TinyPNG for compression"

API_KEY=`printenv | grep TINYPNG_API_KEY | awk -F '=' '{print $2}'`
if [ "${API_KEY}" == "" ]; then
echo "Error : TinyPNG API key not found in environment. Not continuing. Please set TINYPNG_API_KEY".
exit 1
else
compressedFile=`curl -s --user api:${API_KEY} --data-binary @${absFile} -i https://api.tinify.com/shrink | grep -i location | awk '{print $2}' | sed 's/.$//'`
printOut "-- Downloading from TinyPNG : ${compressedFile}"
curl -s -X GET "${compressedFile}" --output ${absFile}
fi
}

function printOut() {
if [ ${verbose} == "yes" ]; then
echo
Expand All @@ -53,19 +39,15 @@ HELP_USAGE
}

verbose="no"
useTP="no"
filename=`date +'%y%m%d-%H%M%S'`
destination=""
xAxis=640
url=""
while getopts ":stx:f:u:d:h" options; do
while getopts ":vx:f:u:d:h" options; do
case "${options}" in
v)
verbose="yes"
;;
t)
useTP="yes"
;;
x)
xAxis=${OPTARG}
;;
Expand Down Expand Up @@ -95,7 +77,7 @@ shift $((OPTIND-1))

printOut "-- checking if imagemagick is installed..."

which -s convert
which -s magick
status=$?
if [ $status -eq 1 ]; then
echo "Installing imagemagick..."
Expand All @@ -104,21 +86,12 @@ else
printOut "imagemagick is installed"
fi

printOut "-- Checking whether pngquant is installed"
which -s pngquant
status=$?
if [ $status -eq 1 ]; then
echo "Installing pngquant"
brew install pngquant
else
printOut "pngquant is installed"
fi

if [ `defaults read "Apple Global Domain" AppleReduceDesktopTinting` == "0" ]; then
echo "Window will not have a gray background."
echo "Go to System Setting -> Appearance"
echo "And disable 'Allow wallpaper tinting in windows'"
exit 1;
if [ $(defaults read "Apple Global Domain" AppleReduceDesktopTinting 2>/dev/null || echo -n 0) == "0" ]; then
echo "Disabling wallpaper tinting in windows to get a consistent gray background."
echo "To revert this change, execute 'defaults write \"Apple Global Domain\" AppleReduceDesktopTinting 0'"
echo "or go to System Settings -> Appearance and enable 'Allow wallpaper tinting in windows'."
defaults write "Apple Global Domain" AppleReduceDesktopTinting 1
fi


Expand Down Expand Up @@ -163,6 +136,14 @@ tell application theApp
end tell
EOD

osaret=$?

if [ $osaret != 0 ]; then
echo "osascript failed. Check permissions under System Settings -> Privacy & Security for both Accessibility and Automation."
exit 1
fi


if [ "x$url" != "x" ]; then
osascript<<EOD
tell application "Safari" to set the URL of the front document to "$url"
Expand Down Expand Up @@ -190,14 +171,9 @@ printOut "-- Checking image properties"
printFileAttribs

printOut "-- Resizing screenshot"
convert=`which convert`
$convert -geometry 1600x ${absFile} ${absFile}

printOut "-- Compressing png"
compressUsingTinyPNG
magick ${absFile} -geometry 1600x ${absFile}

# move to destination folder
if [ "${destination}" != "" ]; then
mv ${absFile} ${destination}/${filename}
fi

0 comments on commit aab8429

Please sign in to comment.