diff --git a/README.md b/README.md index 74d142a..7b7b47c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ ![](.github/banner.png) +## Official Instance + +There is an official instance of PAIKKA running at **https://geo.dedicatedcode.com** that you can use for free. + +**Important notes about this instance:** +- There are **no usage limits or restrictions** – feel free to integrate it into your projects. +- However, there are **no guarantees about availability or SLA** (Service Level Agreement). The service is provided on a best-effort basis. +- The instance is shared among all users. **Please do not abuse it** – excessive or abusive usage will affect everyone else. + +Be nice to each other and use the service responsibly. + PAIKKA is a specialized reverse geocoding service designed to provide high-performance location resolution for [Reitti](https://github.com/dedicatedcode/reitti). The name comes from the Finnish word for "place" and is pronounced [ˈpɑi̯kːɑ]. ## Overview @@ -485,4 +496,4 @@ This project is licensed under the GNU Affero General Public License v3 (AGPLv3) ## About -PAIKKA is developed as part of the Reitti ecosystem by (https://github.com/dedicatedcode). It provides the geocoding infrastructure that powers location-based features in Reitti. \ No newline at end of file +PAIKKA is developed as part of the Reitti ecosystem by (https://github.com/dedicatedcode). It provides the geocoding infrastructure that powers location-based features in Reitti. diff --git a/scripts/update.sh b/scripts/update.sh index 031e036..0f79d3f 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -177,8 +177,37 @@ remote_deploy_and_verify() { [ -n "\$OLD_RELEASE_DIR" ] && ln -sfn "\$OLD_RELEASE_DIR" "\$LIVE_DATA_SYMLINK" exit 1 fi - - # ... [Verification logic remains the same] ... + # --- 2. Verify --- + echo_remote "Verifying new data..." + VERIFICATION_FAILED=0 + for query in "\${!TESTS[@]}"; do + ACTUAL_ID=\$(curl -s "\$TEST_URL_BASE?\$query" | jq -r '.[0].id // "not_found"') + if [ "\$ACTUAL_ID" != "\${TESTS[\$query]}" ]; then + echo_remote " --> FAILED: For \$query, expected '\${TESTS[\$query]}', got '\$ACTUAL_ID'" + VERIFICATION_FAILED=1 + else + echo_remote " --> SUCCESS: Verified query for \$query" + fi + done + + # --- 3. Finalize or Rollback --- + if [ \$VERIFICATION_FAILED -eq 1 ]; then + echo_remote "VERIFICATION FAILED. Rolling back and re-refreshing." + if [ -n "\$OLD_RELEASE_DIR" ] && [ -d "\$OLD_RELEASE_DIR" ]; then + ln -sfn "\$OLD_RELEASE_DIR" "\$LIVE_DATA_SYMLINK" + curl -s -o /dev/null -X POST -H "Authorization: Bearer \$API_TOKEN" "\$ADMIN_URL" + echo_remote "Rollback to \$OLD_RELEASE_DIR complete. Faulty data in \$NEW_RELEASE_DIR is kept for inspection." + exit 1 + else + echo_remote "ERROR: Verification failed, but no previous version to roll back to!" + exit 1 + fi + else + echo_remote "VERIFICATION SUCCEEDED. Cleaning up old release and archive." + [ -n "\$OLD_RELEASE_DIR" ] && [ -d "\$OLD_RELEASE_DIR" ] && rm -rf "\$OLD_RELEASE_DIR" + rm "\$ZIP_FILENAME" + echo_remote "Deployment successful." + fi if [ \$VERIFICATION_FAILED -eq 0 ]; then echo "Success. Cleaning up old release..."