diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..669943e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,23 @@ +name: Deploy + +on: + push: + branches: + - master + - main + +jobs: + ci: + name: Deploy to Buckets + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Deploy to all environments + run: deploy.sh + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ AWS_SECRET_ACCESS_KEY }} + diff --git a/README.md b/README.md index 168d172..8fdff8c 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,31 @@ # Maintenance NAU site -This repository has the maintenance site. +This repository has the maintenance site of [NAU](https://nau.edu.pt). -The html, css and images are copied to a ceph bucket an showned to client if there is some error on NAU applications. +This page is shown if there is an application error. -## Update site for environment +This page is hosted on Ceph S3 Bucket that the applications use when they need to show an error to the user. -#### remove existing site +Because the maintenance page is something different and out of scope of the applications (Open edX and NAU Richie) that make up [NAU](https://nau.edu.pt), then this repository was created. -``` -AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXX AWS_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY s3cmd --host 10.0.12.62 --host-bucket nau-dev-shared --no-ssl rm "s3://nau-dev-shared/maintenance-site" --recursive +## Update site +Simply run the `deploy.sh` file, that updates the maintenance page for all environments. +```bash +AWS_ACCESS_KEY_ID=XXXX AWS_SECRET_ACCESS_KEY=YYYY deploy.sh ``` -#### put site +Or alternatively, for each environment (DEV, STAGE and PROD), replace the access key and secret and the correct bucket name, and run: ``` -AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXX AWS_SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY s3cmd --host 10.0.12.62 --host-bucket nau-dev-shared --no-ssl put site/* "s3://nau-dev-shared/maintenance-site/" --recursive --acl-public --no-mime-magic +AWS_ACCESS_KEY_ID=XXXX AWS_SECRET_ACCESS_KEY=YYYY s3cmd --host rgw.nau.fccn.pt --host-bucket nau-dev-shared put maintenance-site/index.html "s3://nau-dev-shared/maintenance-site/index.html" --acl-public ``` -#### Verify site -To check if it was putted ok use: -https://shared.static.dev.nau.fccn.pt/maintenance-site/index.html +After a push to master branch the Github Action will update automatically the maintenance page on each environment. -### Stage environment -For stage environment use previous commands but replace 'dev' keyword with 'stage'. +## Verify site +To check the current maintenance page open: -### Prod environment -For stage environment use previous commands but replace 'dev' keyword with 'prod'. +| Environment | Proxy Link | Bucket Link | +| ----------- | ---------- | ------------------ | +| DEV | https://shared.static.dev.nau.fccn.pt/maintenance-site/index.html | https://rgw.nau.fccn.pt/nau-dev-shared/maintenance-site/index.html | +| STAGE | https://shared.static.stage.nau.fccn.pt/maintenance-site/index.html | https://rgw.nau.fccn.pt/nau-stage-shared/maintenance-site/index.html | +| PROD | https://shared.static.prod.nau.fccn.pt/maintenance-site/index.html | https://rgw.nau.fccn.pt/nau-prod-shared/maintenance-site/index.html | diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..abec360 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,10 @@ +#!/bin/bash -xe +# Example to run: +# AWS_ACCESS_KEY_ID=XXXX AWS_SECRET_ACCESS_KEY=YYYY ./deploy.sh + +declare -a environments=("nau-dev-shared" "nau-stage-shared" "nau-prod-shared") + +for environment in "${environments[@]}" +do + AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} s3cmd --host rgw.nau.fccn.pt --host-bucket $environment put maintenance-site/index.html s3://$environment/maintenance-site/index.html +done diff --git a/site/index.html b/maintenance-site/index.html similarity index 92% rename from site/index.html rename to maintenance-site/index.html index 1681df4..250f2bf 100644 --- a/site/index.html +++ b/maintenance-site/index.html @@ -16,26 +16,30 @@ let currentLanguage = null; // feature toggle. shows or hides the operation details - const showOpDetails = true; + const showOpDetails = false; const intlTranslations = { en: { - title: 'Under maintenance', - shortmessage: 'We are updating the NAU platform.
We promise it will be quick!', - esttime: 'Estimated time', - message: 'For additional information, please check out our user knowledge base at', - langchangemessage: 'Mudar língua para Português' + title: "Under maintenance", + // shortmessage: 'We are updating the NAU platform.
We promise it will be quick!', + shortmessage: "Please come back later, we'll try to be brief!", + esttime: "Estimated time", + message: "For additional information, please check out our user knowledge base at", + langchangemessage: "Mudar língua para Português", + technicalinfo: "Informação técnica do estado da NAU", }, pt: { title: 'Em manutenção', - shortmessage: 'Estamos a atualizar a plataforma NAU.
Prometemos que será rápido!', - esttime: 'Tempo estimado', - message: 'Para informações adicionais por favor o site de ajuda ao utilizador em', - langchangemessage: 'Change language to English' + // shortmessage: 'Estamos a atualizar a plataforma NAU.
Prometemos que será rápido!', + shortmessage: "Por favor volte mais tarde, tentaremos ser breves.", + esttime: "Tempo estimado", + message: "Para informações adicionais por favor o site de ajuda ao utilizador em", + langchangemessage: "Change language to English", + technicalinfo: "Technical information on the state of the NAU", } }; - const intlElements = ['maintenance-title', 'maintenance-shortmessage', 'maintenance-esttime', 'maintenance-message']; + const intlElements = ['maintenance-title', 'maintenance-shortmessage', 'maintenance-esttime', 'maintenance-message', 'maintenance-technicalinfo']; function getNavigatorLanguage() { return navigator.language.split('-')[0] == 'pt' ? 'pt' : 'en'; @@ -187,7 +191,19 @@ color: var(--email-color); } - .email a:hover { + .email, + .status { + font-size: 1.15rem; + color: var(--email-color); + } + + .email a, + .status a { + color: var(--email-color); + } + + .email a:hover, + .status a:hover { color: #ffce35; text-decoration-color: #ffce35; } @@ -315,6 +331,9 @@

+

+ Informação técnica do estado da NAU +