Giter VIP home page Giter VIP logo

trackmyairtag's Introduction

trackmyairtag

  1. Scrapes Find My cache to find the location of your devices & items
  2. Puts the data in Postgres
  3. Displays the data in a web app

The app will not do 1 & 2 unless it detects it is running on a Mac. The app will always do 3.

Usage

Run docker compose up --build. Access the webapp at http://localhost:8080/ (or using a custom port set by environment variable TMA_PORT).

See also

For great projects relating Find My and AirTag, see:

fjxmlzn/FindMyHistory, danthelion/airtag-locator, hatomist/openhaystack-grafana, seemoo-lab/openhaystack, biemster/FindMy,

trackmyairtag's People

Contributors

dhimmel avatar unresolv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

trackmyairtag's Issues

can't access Library/Caches/com.apple.findmy.fmfcore error

I can't stat the Library/Caches/com.apple.findmy.fmipcore folder

sudo ls -l /Users/${USER}/Library/Caches/com.apple.findmy.fmipcore
total 0
ls: /Users/patrick/Library/Caches/com.apple.findmy.fmipcore: Operation not permitted

sudo stat /Users/${USER}/Library/Caches/com.apple.findmy.fmipcore
16777229 3812283 drwxr-xr-x 3 patrick staff 0 96 "Feb  9 08:20:57 2024" "Mar 18 10:29:04 2024" "Mar 18 10:29:04 2024" "Jan  6 10:40:30 2022" 4096 0 0 /Users/patrick/Library/Caches/com.apple.findmy.fmipcore

so i get this error

[+] Building 3.2s (10/10) FINISHED                                                                                                                                                         docker:desktop-linux
 => [web internal] load build definition from Dockerfile                                                                                                                                                   0.0s
 => => transferring dockerfile: 460B                                                                                                                                                                       0.0s
 => [web internal] load .dockerignore                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                            0.0s
 => [web internal] load metadata for docker.io/library/python:3.11-slim                                                                                                                                    1.6s
 => [web 1/5] FROM docker.io/library/python:3.11-slim@sha256:a2eb07f336e4f194358382611b4fea136c632b40baa6314cb27a366deeaf0144                                                                              0.0s
 => [web internal] load build context                                                                                                                                                                      0.4s
 => => transferring context: 17.28MB                                                                                                                                                                       0.3s
 => CACHED [web 2/5] WORKDIR /app                                                                                                                                                                          0.0s
 => CACHED [web 3/5] COPY requirements.txt /app                                                                                                                                                            0.0s
 => CACHED [web 4/5] RUN export PKGS="build-essential libpq-dev gcc" &&     apt-get update && apt-get install -y --no-install-recommends $PKGS &&     rm -rf /var/lib/apt/lists/* &&     pip install --no  0.0s
 => [web 5/5] COPY . /app                                                                                                                                                                                  0.7s
 => [web] exporting to image                                                                                                                                                                               0.4s
 => => exporting layers                                                                                                                                                                                    0.4s
 => => writing image sha256:296b903adae44cbcce513de36fd3dcc77e8c4ae0c741ea7fc450fad5b66a7aad                                                                                                               0.0s
 => => naming to docker.io/library/trackmyairtag-web                                                                                                                                                       0.0s
[+] Running 3/3
 ✔ Network trackmyairtag_default       Created                                                                                                                                                             0.1s 
 ✔ Container trackmyairtag-postgres-1  Created                                                                                                                                                             0.1s 
 ✔ Container trackmyairtag-web-1       Created                                                                                                                                                             0.1s 
Attaching to postgres-1, web-1
Gracefully stopping... (press Ctrl+C again to force)
Error response from daemon: error while creating mount source path '/host_mnt/Users/patrick/Library/Caches/com.apple.findmy.fmipcore': mkdir /host_mnt/Users/patrick/Library/Caches/com.apple.findmy.fmipcore: operation not permitted

Readme getting starting / usage section

I was looking through a bunch of repos for AirTag location history tracking and this one caught my eye! It is an honor to open the first issue.

I was generally curious about how to use this, e.g. what commands to run, whether any configuration is needed, etcetera. Did you have any initial advice, either here or as a usage section in the readme?

Also happy to contribute back any docs as I figure the package out.

Database error

Running with the instructions provided in the README, this is my result:

trackmyairtag-web-1 | ======== Running on http://0.0.0.0:8080 ========
trackmyairtag-web-1 | (Press CTRL+C to quit)
trackmyairtag-postgres-1 | 2023-05-23 17:54:27.127 UTC [69] ERROR: relation "log_id_timestamp" already exists
trackmyairtag-postgres-1 | 2023-05-23 17:54:27.127 UTC [69] STATEMENT:
trackmyairtag-postgres-1 | CREATE TABLE IF NOT EXISTS log (
trackmyairtag-postgres-1 | id TEXT CHECK (id <> ''),
trackmyairtag-postgres-1 | name TEXT CHECK (name <> ''),
trackmyairtag-postgres-1 | address TEXT,
trackmyairtag-postgres-1 | timestamp BIGINT CHECK (timestamp > 0),
trackmyairtag-postgres-1 | latitude FLOAT CHECK (latitude > -90 AND latitude < 90),
trackmyairtag-postgres-1 | longitude FLOAT CHECK (longitude > -180 AND longitude < 180),
trackmyairtag-postgres-1 | altitude FLOAT,
trackmyairtag-postgres-1 | raw JSONB,
trackmyairtag-postgres-1 | UNIQUE (id, latitude, longitude, altitude, timestamp)
trackmyairtag-postgres-1 | );
trackmyairtag-postgres-1 | ALTER TABLE log ADD CONSTRAINT log_id_timestamp UNIQUE (id, timestamp);
trackmyairtag-postgres-1 |
trackmyairtag-web-1 | Error handling request
trackmyairtag-web-1 | Traceback (most recent call last):
trackmyairtag-web-1 | File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
trackmyairtag-web-1 | resp = await request_handler(request)
trackmyairtag-web-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
trackmyairtag-web-1 | File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
trackmyairtag-web-1 | resp = await handler(request)
trackmyairtag-web-1 | ^^^^^^^^^^^^^^^^^^^^^^
trackmyairtag-web-1 | File "/app/app.py", line 39, in api_db_get_latest
trackmyairtag-web-1 | res = await app["db"].get_latest()
trackmyairtag-web-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
trackmyairtag-web-1 | File "/app/utils/db.py", line 22, in get_latest
trackmyairtag-web-1 | await self._connect()
trackmyairtag-web-1 | File "/app/utils/db.py", line 19, in _connect
trackmyairtag-web-1 | await self._initdb()
trackmyairtag-web-1 | File "/app/utils/db.py", line 88, in _initdb
trackmyairtag-web-1 | await conn.execute(
trackmyairtag-web-1 | File "/usr/local/lib/python3.11/site-packages/asyncpg/connection.py", line 317, in execute
trackmyairtag-web-1 | return await self._protocol.query(query, timeout)
trackmyairtag-web-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
trackmyairtag-web-1 | File "asyncpg/protocol/protocol.pyx", line 338, in query
trackmyairtag-web-1 | asyncpg.exceptions.DuplicateTableError: relation "log_id_timestamp" already exists

deployed from scratch - no items listed

I've just deployed this on a macbook M1 running the official docker.app
The container logs show no error and present the db and python app started properly.

http://localhost:8080/ displays an empty map
http://localhost:8080/api/local/items returns a json with proper data by the way it looks.
http://localhost:8080/api/db/latest returns an empty json
http://localhost:8080/api/local/devices returns http 500:

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/app/app.py", line 29, in api_local_get_devices
return web.json_response(await app["devices"].get())
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/utils/find_my.py", line 25, in get
return self._parse_data(data)
^^^^^^^^^^^^^^^^^^^^^^
File "/app/utils/find_my.py", line 43, in _parse_data
row.address = i.address.mapItemFullAddress
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'mapItemFullAddress'

Tracking issue with IOS17 update

I wanted to ask if you all noticed a change in the way IOS17 reports on cloned AirTags? Specially cloned tags that were implemented using the OpenHaystack protocol? I was able to track my tags until I updated my phone to IOS17 and now I am not getting any reports.

Any ideas would be greatly appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.