Skip to content

Add activity logging for registrations, logins, and predictions with admin page#6

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-logging-for-registrations
Draft

Add activity logging for registrations, logins, and predictions with admin page#6
Copilot wants to merge 4 commits intomainfrom
copilot/add-logging-for-registrations

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 4, 2025

Adds activity logging to track user registrations, logins, and wine predictions, with an admin page to view the log.

Changes

  • Database: New activity_log table with timestamp, activity_type, username, and details columns
  • Logging: Added log_activity() helper called on:
    • Successful/failed logins
    • New user registrations
    • Wine predictions
  • Admin page: New /admin route and template displaying activity log (requires login)
  • Navigation: Added Admin link to wine.html and profile.html nav bars

Usage

# Activities are logged automatically, e.g.:
log_activity('login', username, 'Successful login')
log_activity('registration', username, 'New user registered with email: ' + email)
log_activity('prediction', username, 'Predicted wine variety #{}'.format(prediction))

Screenshot

Admin Page

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4003 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.PupC7I --subproc-heap-profiling --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14147795062571986356,13029113596044864938,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
    • Triggering command: /opt/google/chrome/chrome /bin/google-chrome --allow-file-access-from-files --allow-insecure-localhost --allow-pre-commit-input --allow-running-insecure-content --ash-no-nudges --deny-permission-prompts --disable-3d-apis --disable-autofill-keyboard-accessory-view[8] --disable-REDACTED-networking --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-domain-reliability --disable-features=IgnoreDuplicateNavs,Prewarm,OptimizationHints,OptimizationHintsFetching,Translate,OptimizationTargetPrediction,OptimizationGuideModelDownloading,DownloadBubble,DownloadBubbleV2,InsecureDownloadWarnings,InterestFeedContentSuggestions,Pri (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4168 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.8Co9HK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4923708407940963738,15930798876223241602,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
  • cdn.jsdelivr.net
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4003 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.PupC7I --subproc-heap-profiling --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14147795062571986356,13029113596044864938,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
    • Triggering command: /opt/google/chrome/chrome /bin/google-chrome --allow-file-access-from-files --allow-insecure-localhost --allow-pre-commit-input --allow-running-insecure-content --ash-no-nudges --deny-permission-prompts --disable-3d-apis --disable-autofill-keyboard-accessory-view[8] --disable-REDACTED-networking --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-domain-reliability --disable-features=IgnoreDuplicateNavs,Prewarm,OptimizationHints,OptimizationHintsFetching,Translate,OptimizationTargetPrediction,OptimizationGuideModelDownloading,DownloadBubble,DownloadBubbleV2,InsecureDownloadWarnings,InterestFeedContentSuggestions,Pri (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4168 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.8Co9HK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4923708407940963738,15930798876223241602,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4003 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.PupC7I --subproc-heap-profiling --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14147795062571986356,13029113596044864938,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
    • Triggering command: /opt/google/chrome/chrome /bin/google-chrome --allow-file-access-from-files --allow-insecure-localhost --allow-pre-commit-input --allow-running-insecure-content --ash-no-nudges --deny-permission-prompts --disable-3d-apis --disable-autofill-keyboard-accessory-view[8] --disable-REDACTED-networking --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-domain-reliability --disable-features=IgnoreDuplicateNavs,Prewarm,OptimizationHints,OptimizationHintsFetching,Translate,OptimizationTargetPrediction,OptimizationGuideModelDownloading,DownloadBubble,DownloadBubbleV2,InsecureDownloadWarnings,InterestFeedContentSuggestions,Pri (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4168 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.8Co9HK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4923708407940963738,15930798876223241602,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
  • content-autofill.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4003 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.PupC7I --subproc-heap-profiling --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14147795062571986356,13029113596044864938,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
    • Triggering command: /opt/google/chrome/chrome /bin/google-chrome --allow-file-access-from-files --allow-insecure-localhost --allow-pre-commit-input --allow-running-insecure-content --ash-no-nudges --deny-permission-prompts --disable-3d-apis --disable-autofill-keyboard-accessory-view[8] --disable-REDACTED-networking --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-domain-reliability --disable-features=IgnoreDuplicateNavs,Prewarm,OptimizationHints,OptimizationHintsFetching,Translate,OptimizationTargetPrediction,OptimizationGuideModelDownloading,DownloadBubble,DownloadBubbleV2,InsecureDownloadWarnings,InterestFeedContentSuggestions,Pri (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4168 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.8Co9HK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4923708407940963738,15930798876223241602,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
  • googlechromelabs.github.io
    • Triggering command: /home/REDACTED/.local/bin/pytest pytest tests/test_admin.py -v --headless (dns block)
    • Triggering command: /home/REDACTED/.local/bin/pytest pytest tests/test_login.py tests/test_register.py -v --headless (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4003 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.PupC7I --subproc-heap-profiling --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,14147795062571986356,13029113596044864938,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)
    • Triggering command: /opt/google/chrome/chrome /bin/google-chrome --allow-file-access-from-files --allow-insecure-localhost --allow-pre-commit-input --allow-running-insecure-content --ash-no-nudges --deny-permission-prompts --disable-3d-apis --disable-autofill-keyboard-accessory-view[8] --disable-REDACTED-networking --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-domain-reliability --disable-features=IgnoreDuplicateNavs,Prewarm,OptimizationHints,OptimizationHintsFetching,Translate,OptimizationTargetPrediction,OptimizationGuideModelDownloading,DownloadBubble,DownloadBubbleV2,InsecureDownloadWarnings,InterestFeedContentSuggestions,Pri (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --ignore-certificate-errors --use-angle=swiftshader-webgl --ignore-certificate-errors --crashpad-handler-pid=4168 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/.org.chromium.Chromium.scoped_dir.8Co9HK --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,4923708407940963738,15930798876223241602,262144 --disable-features=DisableLoadExtensionCommandLineSwitch,DownloadBubble,DownloadBubbleV2,IgnoreDuplicateNavs,InsecureDownloadWarnings,InterestFeedContentSuggestions,OptimizationGuideModelDownloading,OptimizationHints,OptimizationHintsFetching,Optimization (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Please add logging information for registrations, logins, and predictions. Create an admin page to view this info</issue_title>
<issue_description>See above</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes Coveros/AIForTesters#5

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 4, 2025 20:45
…admin page

Co-authored-by: jefferyepayne <50836441+jefferyepayne@users.noreply.github.com>
Co-authored-by: jefferyepayne <50836441+jefferyepayne@users.noreply.github.com>
…admin page

Co-authored-by: jefferyepayne <50836441+jefferyepayne@users.noreply.github.com>
Copilot AI changed the title [WIP] Add logging for registrations, logins, and predictions Add activity logging for registrations, logins, and predictions with admin page Dec 4, 2025
Copilot AI requested a review from jefferyepayne December 4, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants