diff --git a/db-pg/scripts/backup-prod.sh b/db-pg/scripts/backup-prod.sh index fe66f51f07..ec613063a6 100755 --- a/db-pg/scripts/backup-prod.sh +++ b/db-pg/scripts/backup-prod.sh @@ -5,5 +5,5 @@ export $(xargs < secrets/sausage-prod-db.env) echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USERNAME}:${DB_PASSWORD}" > ~/.pgpass chmod 600 ~/.pgpass -prod_db_dump_file="dumps/digitalocean_db-a_${DB_SCHEMA}_${now}.dump" +prod_db_dump_file="dumps/aws-db_${DB_SCHEMA}_${now}.dump" pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA $DB_NAME > $prod_db_dump_file \ No newline at end of file diff --git a/db-pg/scripts/electoral_boundaries/replace-electoral-boundaries.sh b/db-pg/scripts/electoral_boundaries/replace-electoral-boundaries.sh index 1cf2b611eb..af06525d70 100644 --- a/db-pg/scripts/electoral_boundaries/replace-electoral-boundaries.sh +++ b/db-pg/scripts/electoral_boundaries/replace-electoral-boundaries.sh @@ -25,7 +25,7 @@ if [[ -f $dev_db_dump_file && -s $dev_db_dump_file ]]; then echo "Backup electoral boundaries table from production (host=$DB_HOST)" - prod_db_dump_file="digitalocean_db-a_electoralboundaries_${DB_SCHEMA}_${now}.dump" + prod_db_dump_file="aws-db_electoralboundaries_${DB_SCHEMA}_${now}.dump" table_name="app_electoralboundaries" pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA --table $DB_SCHEMA.$table_name --verbose $DB_NAME > $prod_db_dump_file diff --git a/db-pg/scripts/replace-dev-with-prod.sh b/db-pg/scripts/replace-dev-with-prod.sh index f0fb92734d..50286589e2 100755 --- a/db-pg/scripts/replace-dev-with-prod.sh +++ b/db-pg/scripts/replace-dev-with-prod.sh @@ -5,7 +5,7 @@ export $(xargs < secrets/sausage-prod-db.env) echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USERNAME}:${DB_PASSWORD}" > ~/.pgpass chmod 600 ~/.pgpass -prod_db_dump_file="dumps/digitalocean_db-a_${DB_SCHEMA}_${now}.dump" +prod_db_dump_file="dumps/aws-db_${DB_SCHEMA}_${now}.dump" pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA $DB_NAME > $prod_db_dump_file DB_HOST= diff --git a/db-pg/scripts/replace-staging-with-prod.sh b/db-pg/scripts/replace-staging-with-prod.sh index d205aa46ae..d0f64cdce8 100755 --- a/db-pg/scripts/replace-staging-with-prod.sh +++ b/db-pg/scripts/replace-staging-with-prod.sh @@ -5,7 +5,7 @@ export $(xargs < secrets/sausage-prod-db.env) echo "${DB_HOST}:${DB_PORT}:${DB_NAME}:${DB_USERNAME}:${DB_PASSWORD}" > ~/.pgpass chmod 600 ~/.pgpass -prod_db_dump_file="dumps/digitalocean_db-a_${DB_SCHEMA}_${now}.dump" +prod_db_dump_file="dumps/aws-db_${DB_SCHEMA}_${now}.dump" pg_dump --host=$DB_HOST --username=$DB_USERNAME --format=custom --schema=$DB_SCHEMA $DB_NAME > $prod_db_dump_file DB_HOST= diff --git a/django/demsausage/app/webdriver.py b/django/demsausage/app/webdriver.py index ddf548e634..7649454c2e 100644 --- a/django/demsausage/app/webdriver.py +++ b/django/demsausage/app/webdriver.py @@ -20,6 +20,7 @@ def get_map_screenshot(election): # firefox_options.add_argument("--start-fullscreen") # firefox_options.add_argument("--start-maximized") firefox_options.binary_location = '/usr/lib/firefox-esr/firefox-esr' + firefox_options.set_preference("general.useragent.override", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/109.0; Demsausage-Webdriver-Screenshot-Service") if os.path.isfile('/app/logs/webdriver/geckodriver.log') is False: Path('/app/logs/webdriver/').mkdir(parents=True, exist_ok=True) diff --git a/public-redesign/src/features/embedBuilder/embedBuilderHelpers.ts b/public-redesign/src/features/embedBuilder/embedBuilderHelpers.ts index 679d047883..86461ad708 100644 --- a/public-redesign/src/features/embedBuilder/embedBuilderHelpers.ts +++ b/public-redesign/src/features/embedBuilder/embedBuilderHelpers.ts @@ -1,6 +1,8 @@ import { Election } from '../../app/services/elections'; import { getAPIBaseURL, getBaseURL } from '../../app/utils'; +export const isEmbedModeActive = () => navigator.userAgent.includes('Demsausage-Webdriver-Screenshot-Service'); + export const getEmbedStaticMapImageURL = (election: Election) => `${getAPIBaseURL()}/0.1/map_image/${election.id}/`; // export const embedPrecannedMapBboxes = [ diff --git a/public-redesign/src/features/map/map.tsx b/public-redesign/src/features/map/map.tsx index d6267578b7..86167e6a3e 100644 --- a/public-redesign/src/features/map/map.tsx +++ b/public-redesign/src/features/map/map.tsx @@ -21,6 +21,7 @@ import { getAPIBaseURL, getBaseURL } from '../../app/utils'; import { selectMapFilterSettings, setPollingPlaces } from '../app/appSlice'; import { getDefaultElection, getViewForElection } from '../elections/electionHelpers'; import { selectAllElections, selectElectionById } from '../elections/electionsSlice'; +import { isEmbedModeActive } from '../embedBuilder/embedBuilderHelpers'; import { getPollingPlaceIdsFromFeatures } from '../pollingPlaces/pollingPlaceHelpers'; import SearchBarCosmeticNonFunctional from '../search/searchByAddressOrGPS/searchBar/searchBarCosmeticNonFunctional'; import AddStallButton from './addStallButton/addStallButton'; @@ -265,7 +266,7 @@ function Map(props: Props) { - + {isEmbedModeActive() === false && } theme.zIndex.drawer + 1 }} open={isMapDataLoading}> diff --git a/scrapers/nsw_lg_2024/scraper.py b/scrapers/nsw_lg_2024/scraper.py index 77aa55de5e..f465bbc183 100755 --- a/scrapers/nsw_lg_2024/scraper.py +++ b/scrapers/nsw_lg_2024/scraper.py @@ -14,7 +14,7 @@ from selenium.webdriver.firefox.service import Service from webdriver_manager.firefox import GeckoDriverManager -USE_CACHE = True +USE_CACHE = False OUTPUT_FILE = f'nsw-{datetime.date.today().isoformat()}.csv' INDEX_PAGE = 'https://elections.nsw.gov.au/elections/find-my-electorate'