You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* one config to rule them all
* Have fletchling load all active nests from DB and that's it. no
filtering. Reserve mucking around with what you want to be active
for external tools or API calls.
* fix missing db rows.Close()s. Oops.
* add refresh=1 query param to /api/config/reload to compute spawnpoint
counts if any are unknown and re-run filters before reloading
nests. this can run for a long time if there are a lot nests in the DB
as it will also filter overlapping nests according to max overlap percent.
* add spawnpoints=all query param to /api/config/reload to re-compute
spawnpoints for ALL nests. This also re-runs all filters before
reloading nests.
* add concurrency=# query param to /api/config/reload to change
amount of concurrency if refreshing. defaults to 4.
* have the importer error if migrations need to be run. fletchling
should be restarted to run them first before using the importer tool.
* require go 1.22
* keep track of area parents and use that as part of area_name. This
allows configuring the webhooks exactly like Golbat
* Add publish workflow, update docker image, README, etc.
If you are using pm2, I would leave 'addr' in fletchling.toml as the default. Use '127.0.0.1' for your fletchling hostname in the above.
25
+
Replace 'FLETCHLING-HOSTNAME' with your host that is running Fletchling. If you are using pm2 and not using
26
+
docker, this should likely be '127.0.0.1'. If you are using docker, your fletchling hostname will likely be
27
+
'fletchling'.
25
28
26
-
If you are using the included docker-compose.yml, golbat is also running under docker, and everything is attached to the same docker network, your fletchling hostname will be 'fletchling'.
29
+
After adding the config to Golbat, restart Golbat to have it take effect.
30
+
31
+
3. If you plan to use docker-compose, copy docker-compose.yml.example to docker-compose.yml and edit.
27
32
28
33
# Running
29
34
30
35
## docker
31
36
32
37
1. There is an included docker-compose.yml.example file. Copy it to docker-compose.yml and edit it, if needed.
33
-
2.`docker-compose build`
34
-
3.`docker-compose up -d`
38
+
2.`docker-compose up -d`
35
39
36
40
## pm2
37
41
@@ -40,90 +44,31 @@ If you are using the included docker-compose.yml, golbat is also running under d
40
44
41
45
# Verifying it is working
42
46
43
-
1. curl http://localhost:9042/api/config -- this should give you the current processor configuration
44
-
2.The logfile is configurable in configs/fletchling.toml but defaults to logs/fletchling.log. Check it for errors.
45
-
3. Every minute, a log message will appear saying how many pokemon were processed. If this is 0, it means that Fletchling is not getting any webhooks. Check your Golbat webhooks configuration. Check the address Fletchling is listening on (http section in config).
47
+
1.`curl http://localhost:9042/api/config` -- this should give you the current processor configuration
48
+
2.Check the logs in logs/ (or the log_dir that you configured in fletchling.toml) for errors.
49
+
* Every minute, a log message will appear saying how many pokemon were processed. If this is 0, it means that Fletchling is not getting any webhooks. Check your Golbat webhooks configuration. Check the address Fletchling is listening on (http section in config).
46
50
47
51
# Migrating from other nest processors
48
52
49
-
## nestcollector to Fletching with database as authortative source (SIMPLEST)
53
+
## nestcollector to Fletching using existing Golbat DB for nests (SIMPLEST)
50
54
1. Gather your Golbat DB info.
51
-
2. Create `configs/fletchling.toml`from the existing example config.
52
-
* configure your existing golbat db in configs/fletchling.toml in both 'nests_db' and 'golbat_db' sections.
55
+
2. Create `configs/fletchling.toml`as per 'Configuration' instructions above.
56
+
* configure your existing golbat db in configs/fletchling.toml in BOTH 'nests_db' and 'golbat_db' sections.
53
57
* fix the listen address in 'http' section, if necessary.
54
-
4. nuke your cronjob.
55
-
5. start up fletchling
56
-
57
-
## nestcollector to Fletchling with Koji as authorative source
58
-
59
-
This will be available soon.
58
+
3. nuke your cronjob.
59
+
4. start up fletchling per 'Running' section above.
60
60
61
61
## Others
62
62
63
63
I would just start over, personally. :)
64
64
65
65
# Importing OSM data
66
66
67
-
Overpass API can be queried to find parks, etc, to import into your nests db (or Koji soon).
68
-
69
-
The fences/areas that are searched can come from either a poracle-style json file, or a geojson FeatureCollection file, or Koji(soon).
70
-
71
-
1. If you want to find nests for your areas that are in Koji, make sure you have a project which exports your areas.
72
-
2. If you want to find nests for your areas that are in a file, make note of its location.
73
-
3. Gather your nests DB info/credentials. If you are currently using the Golbat DB, use this. Otherwise, if you are starting from scratch, use golbat or make a new database.
74
-
4. (Optional): Gather your golbat DB info/credentials (might be same as Step 3.). min_spawnpoints filtering will only work with this configured.
75
-
5. Create `configs/fletchling-osm-importer.toml` from the existing example config. The comments in the file should explain.
76
-
6.`./make`
77
-
7.`./fletchling-osm-importer 'AreaName'` to import a single area first, if you wish.
78
-
8.`./fletchling-osm-importer -all-areas` to import all areas.
67
+
Importing docs can be found [here.](./docs/IMPORTING.md)
79
68
80
69
# API
81
70
82
-
## Get config
83
-
`curl http://localhost:9042/api/config`
84
-
85
-
## Reload configuration
86
-
`curl http://localhost:9042/api/config/reload`
87
-
(Also supports PUT. You can also send a SIGHUP signal to the process)
88
-
89
-
## Get all nests
90
-
`curl http://localhost:9042/api/nests`
91
-
92
-
## Get single nest
93
-
`curl http://localhost:9042/api/nests/:nest_id`
94
-
95
-
## Get all nests and full stats history
96
-
`curl http://localhost:9042/api/nests/_/stats`
97
-
98
-
## Get single nest and its stats history
99
-
`curl http://localhost:9042/api/nests/_/:nest_id`
100
-
101
-
Untested:
102
-
103
-
## Purge all stats
104
-
`curl -X PUT http://localhost:9042/api/stats/purge/all`
105
-
106
-
This ditches all stats history including the current time period. This starts the stats with a clean slate, but like startup.
107
-
108
-
## Purge some duration of oldest stats
109
-
`curl -X PUT http://localhost:9042/api/stats/purge/oldest -d '{ "duration_minutes": xx }'`
110
-
111
-
Purges the specified duration of the stats starting from the oldest. This will never remove the current unfinished time period. This can be used to nuke everything but the current time period by specifying a very high number of minutes.
Purges the specified amount of minutes of stats starting from the newest. 'include_current' specifies whether it should start with the current time period that is not done, or if it should start at the last period.
117
-
118
-
## Ensure only a certain duration of stats exists
119
-
`curl -X PUT http://localhost:9042/api/stats/purge/keep -d '{ "duration_minutes": xx }'
120
-
121
-
This is another way to purge oldest stats. But with this one, you specify the duration to keep, not the duration to purge.
122
-
123
-
124
-
# Known issues
125
-
126
-
The importer can import nests that are fully contained by other nests. For example, if a large park has a number of baseball fields, it is possible that nests for both the park and the fields will be imported. This will be fixed soon.
0 commit comments