Skip to content

Commit fac02c4

Browse files
authored
feat: mapeo instace and tileserver (#36)
* chore: upping version to 0.4.4 * fix: crawler script modified to run only once * feat: tileserver-gl with starting script and tile download automation * chore: rename volumes, should solve #35 * chore: demo tileserver building customized * fix: add old initialization * fix: change tmp dir for tileserver * fix: try using user 1000 for tileserver * chore: add shared mbtiles volume with syncthing and filebrowser * feat: use own tileserver-gl base image * chore: simplify tileserver dockerfile * fix: add .warc.gz to pywb sources as well * feat: add tiles cloud folder to syncthing default * fix: correct syntax for balena.yml applicationEnvironmentVariables * chore: add mapeo-bridge and mbtiles volumes across services and minor fixes * chore: add crowding translation badge * feat: add documentation for working with balena virtual-machines * chore: add issue template for github * chore: clenaup earthdefendertoolkit collection from pywb, to only use all * chore: remove unused portal service which now draws from docker hub image * fix: tileserver wait for tile sync instead of downloading * fix: working tileserver start script for checking files every 30secs * fix: correct naming of terrastories-db * chore: use nightly portal and code cleanup
1 parent b655a48 commit fac02c4

File tree

21 files changed

+313
-128
lines changed

21 files changed

+313
-128
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Create an issue to inform of a bug
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Device Type:**
27+
Raspberry Pi 4 or Nuc pc
28+
29+
**Additional context**
30+
Add any other context about the problem here.
31+
32+
**Possible Solution**
33+
Can you suggest any possible solution to this issue?
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
![balena-tag-release](https://github.com/digidem/edt-offline/actions/workflows/balena-tag-release.yml/badge.svg)
88

9+
[![Crowdin](https://badges.crowdin.net/edt-offline-portal/localized.svg)](https://crowdin.com/project/edt-offline-portal)
10+
911
**EDT Offline** is a multi-device stack, which can be easily installed on single-board-computers, Nucs, or any recycled marchine. It creates an access point with the [Earth Defender's Toolkit](http://earthdefenderstoolkit.com/) platform running, even without the Internet. It provides applications, documentation, use cases, curated websites, and application bridges.
1012

1113
The software stack and content are automatically updated while online, and there are different strategies to update them while offline.

balena.yml

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "Earth Defender's Toolkit Offline"
22
type: "sw.application"
3-
version: 0.4.3
3+
version: 0.4.4
44
description: "A low-energy device that creates an access-point serving applications, bridging them and exposing curated content offline.
55
Software stack and content are automatically updated while online, and can be updated offline."
66
assets:
@@ -17,44 +17,45 @@ data:
1717
- BALENA_HOST_CONFIG_gpu_mem: 64
1818
applicationEnvironmentVariables:
1919
# BALENA INTERFACE
20-
SET_HOSTNAME: "edt"
21-
UDEV: on # Enables ability to auto mount USB drives in to the container
22-
PORTAL_PORT: 8080
20+
- SET_HOSTNAME: "edt"
21+
- UDEV: on # Enables ability to auto mount USB drives in to the container
22+
- PORTAL_PORT: 8080
2323
# WIFI
24-
PWC_HOTSPOT_SSID: "Earth_Defenders_Toolkit" # Name as it appears in list of WiFi networks
25-
PWC_PORT: 9090
24+
- PWC_HOTSPOT_SSID: "Earth_Defenders_Toolkit" # Name as it appears in list of WiFi networks
25+
- PWC_PORT: 9090
2626
# PWC_HOTSPOT_PASSWORD: "balena01" # Optional. Must be 8 characters or more
2727
# PWC_INTERFACE: "wlan0"
2828
# MAPEO BRIDGE
29-
MAPEO_PROJECT_KEY: af43cbdb6827d3ddc5b39b20df174bf5c3e44d9bbcdccfe034af090440cebf69
30-
MAPEO_STORAGE_PATH: /usr/src/output
31-
MAPEO_TERRASTORIES_TYPE: terrastories
29+
- MAPEO_PROJECT_KEY: af43cbdb6827d3ddc5b39b20df174bf5c3e44d9bbcdccfe034af090440cebf69
30+
- MAPEO_STORAGE_PATH: /usr/src/output
31+
- MAPEO_TERRASTORIES_TYPE: terrastories
3232
# Minio & Filebrowser
33-
ADMIN_LOGIN: admin
34-
ADMIN_PASSWORD: admin123
35-
LOCALE: "en"
33+
- ADMIN_LOGIN: admin
34+
- ADMIN_PASSWORD: admin123
35+
- LOCALE: "en"
3636
# Syncthing & Filebrowser
37-
PUID: 1000
38-
PGID: 1000
39-
TZ: America/Brasil
40-
SYNC_SOURCE_ID: 7MAA2AW-FBC5CFE-F32BALW-LKLZEBE-VSPN6XG-4PYESBH-NAZ42Y5-RQYULAL
41-
SYNC_SOURCE_NAME: EDT-Cloud
42-
SYNC_CRAWLS_ID: 6qegg-xuksh
43-
SYNC_CRAWLS_NAME: Offline-Websites
44-
SYNC_FDROID_ID: zwozu-ajxlu
45-
SYNC_FDROID_NAME: FDROID-edt
46-
SYNC_MAPEO_ID: atzye-79v6o
47-
SYNC_MAPEO_NAME: Mapeo
48-
SYNC_INSTALLERS_ID: gmyij-7gktt
49-
SYNC_INSTALLERS_NAME: INSTALLERS-edt
37+
- PUID: 1000
38+
- PGID: 1000
39+
- TZ: America/Brasil
40+
- SYNC_SOURCE_ID: 7MAA2AW-FBC5CFE-F32BALW-LKLZEBE-VSPN6XG-4PYESBH-NAZ42Y5-RQYULAL
41+
- SYNC_SOURCE_NAME: EDT-Cloud
42+
- SYNC_CRAWLS_ID: 6qegg-xuksh
43+
- SYNC_CRAWLS_NAME: Offline-Websites
44+
- SYNC_FDROID_ID: zwozu-ajxlu
45+
- SYNC_FDROID_NAME: FDROID-edt
46+
- SYNC_MAPEO_ID: atzye-79v6o
47+
- SYNC_MAPEO_NAME: Mapeo
48+
- SYNC_INSTALLERS_ID: gmyij-7gktt
49+
- SYNC_INSTALLERS_NAME: INSTALLERS-edt
50+
- SYNC_TILES_ID: kfgre-slfl7
51+
- SYNC_TILES_NAME: Map-Tiles
5052
# Terrastories
51-
DB_USER_PASSWORD: postgres
52-
RAILS_ENV: offline
53-
RAILS_MASTER_KEY: '7a0c538b904d5919af7c11470f3b7a4b'
54-
HOST_HOSTNAME: edt.local
55-
CHOKIDAR_USEPOLLING: 'true'
56-
USE_LOCAL_MAP_SERVER: 'true'
57-
OFFLINE_MAP_STYLE: /tileserver/styles/terrastories-map/style.json
53+
- DB_USER_PASSWORD: postgres
54+
- RAILS_ENV: offline
55+
- HOST_HOSTNAME: edt.local
56+
- CHOKIDAR_USEPOLLING: 'true'
57+
- USE_LOCAL_MAP_SERVER: 'true'
58+
- OFFLINE_MAP_STYLE: /tileserver/styles/terrastories-map/style.json
5859
defaultDeviceType: "raspberrypi4-64"
5960
supportedDeviceTypes:
6061
- "raspberrypi3-64"

docker-compose.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "2.1"
22

33
volumes:
44
fdroid:
5-
portal:
5+
edt-offline-portal:
66
mapeo:
77
crawls:
88
pywb-archive:
@@ -15,8 +15,8 @@ volumes:
1515
terrastories-data:
1616
terrastories-media:
1717
terrastories-import:
18-
bdi_db:
19-
pwc_db:
18+
interface_db:
19+
wifi_db:
2020
services:
2121
# https://github.com/digidem/starter-interface
2222
balena-interface:
@@ -28,11 +28,12 @@ services:
2828
- "80:80"
2929
- "8079:8079"
3030
volumes:
31-
- "bdi_db:/app/db" # Stores UI database files
31+
- interface_db:/app/db # Stores UI database files
3232
- crawls:/app/storage/websites
3333
- mapeo:/app/storage/mapeo
3434
- fdroid:/app/storage/fdroid
3535
- installers:/app/storage/installers
36+
- mbtiles:/app/storage//mbtiles
3637
- terrastories-import:/app/storage/terrastories/import
3738
- terrastories-media:/app/storage/terrastories/media
3839
privileged: true # This can be removed if not using the USB mounting feature
@@ -48,26 +49,26 @@ services:
4849
network_mode: "host"
4950
restart: on-failure
5051
volumes:
51-
- "pwc_db:/app/db" # Optional if not setting the hotspot ssid and password via the API
52+
- wifi_db:/app/db # Optional if not setting the hotspot ssid and password via the API
5253
labels:
5354
io.balena.features.dbus: "1"
5455
cap_add:
5556
- NET_ADMIN
5657
privileged: true # This can be removed if you do not need the LED connectivity indicator.
57-
# https://hub.docker.com/r/communityfirst/edt-offline-portal
58+
# https://hub.docker.com/r/communityfirst/edt-offline-edt-portal
5859
portal:
59-
image: communityfirst/edt-offline-portal:nightly-full
60+
image: communityfirst/edt-offline-portal:nightly
6061
restart: always
6162
volumes:
62-
- 'portal:/usr/src/nuxt-app'
63+
- edt-offline-portal:/usr/src/nuxt-app
6364
ports:
6465
- 8080:3000
6566
# https://hub.docker.com/r/communityfirst/mapeo-bridge
6667
mapeo-bridge:
6768
image: communityfirst/mapeo-bridge
6869
network_mode: host
6970
volumes:
70-
- "mapeo-bridge:/usr/src/output"
71+
- mapeo-bridge:/usr/src/output
7172
restart: unless-stopped
7273
# https://hub.docker.com/r/filebrowser/filebrowser
7374
filebrowser:
@@ -78,6 +79,8 @@ services:
7879
- mapeo:/srv/mapeo
7980
- fdroid:/srv/fdroid
8081
- installers:/srv/installers
82+
- mbtiles:/srv/mbtiles
83+
- mapeo-bridge:/srv/terrastories-places
8184
- terrastories-import:/srv/terrastories/import
8285
- terrastories-media:/srv/terrastories/media
8386
ports:
@@ -91,34 +94,46 @@ services:
9194
- mapeo:/config/mapeo
9295
- fdroid:/config/fdroid
9396
- installers:/config/installers
97+
- mbtiles:/config/mbtiles
9498
ports:
9599
- 8082:8384
96100
- 22000:22000/tcp
97101
- 22000:22000/udp
98102
- 21027:21027/udp
99103
restart: unless-stopped
100104
# https://hub.docker.com/_/postgres
101-
db:
105+
terrastories-db:
102106
image: postgres:11
103107
ports:
104108
- 5432:5432
109+
environment:
110+
POSTGRES_USER: postgres
111+
POSTGRES_PASSWORD: postgres
112+
POSTGRES_DB: terrastories
105113
volumes:
106114
- "postgres_data:/var/lib/postgresql/data"
107115
# https://hub.docker.com/r/terrastories/terrastories
108116
terrastories:
109-
image: terrastories/terrastories
117+
build: services/terrastories
110118
ports:
111119
- 8083:3000
112120
depends_on:
113-
- db
121+
- terrastories-db
122+
environment:
123+
DATABASE_URL: postgres://postgres:postgres@db:5432/terrastories
124+
RAILS_ENV: offline
125+
CHOKIDAR_USEPOLLING: 'true'
126+
USE_LOCAL_MAP_SERVER: 'true'
127+
OFFLINE_MAP_STYLE: /tileserver/styles/terrastories-map/style.json
128+
HOST_HOSTNAME: 0.0.0.0
114129
volumes:
115130
- bundler:/usr/local/bundle
116131
- terrastories-data:/api
117132
- terrastories-media:/media
118133
- terrastories-import:/api/import/media
119134
# https://hub.docker.com/r/maptiler/tileserver-gl
120-
tile-server:
121-
image: maptiler/tileserver-gl
135+
tileserver:
136+
build: services/tileserver
122137
ports:
123138
- 8085:8080
124139
volumes:

docker/demo/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ SYNC_MAPEO_ID=atzye-79v6o
1919
SYNC_MAPEO_NAME=Mapeo
2020
SYNC_INSTALLERS_ID=gmyij-7gktt
2121
SYNC_INSTALLERS_NAME=INSTALLERS-edt
22+
SYNC_TILES_ID=kfgre-slfl7
23+
SYNC_TILES_NAME=Map-Tiles
2224
# Terrastories ENV
2325
MAPBOX_STYLE=mapbox://styles/mapbox/light-v10
2426
MAPBOX_ACCESS_TOKEN=your pk token here

docker/demo/docker-compose.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ services:
4141
volumes:
4242
- crawls:/srv/websites
4343
- mapeo:/srv/mapeo
44+
- mbtiles:/srv/mbtiles
4445
- fdroid:/srv/fdroid
4546
- installers:/srv/installers
47+
- mapeo-bridge:/srv/terrastories-places
4648
- terrastories-import:/srv/terrastories/import
4749
- terrastories-media:/srv/terrastories/media
4850
environment:
@@ -72,11 +74,14 @@ services:
7274
SYNC_MAPEO_NAME: ${SYNC_MAPEO_NAME}
7375
SYNC_INSTALLERS_ID: ${SYNC_INSTALLERS_ID}
7476
SYNC_INSTALLERS_NAME: ${SYNC_INSTALLERS_NAME}
77+
SYNC_TILES_ID: ${SYNC_TILES_ID}
78+
SYNC_TILES_NAME: ${SYNC_TILES_NAME}
7579
volumes:
7680
- crawls:/config/websites
7781
- mapeo:/config/mapeo
7882
- fdroid:/config/fdroid
7983
- installers:/config/installers
84+
- mbtiles:/config/mbtiles
8085
ports:
8186
- 8082:8384
8287
- 22000:22000/tcp
@@ -92,14 +97,17 @@ services:
9297
- crawls:/source
9398
restart: unless-stopped
9499
# Terrastories
95-
tile-server:
96-
image: maptiler/tileserver-gl
100+
tileserver:
101+
build: ../../services/tileserver
97102
ports:
98103
- 8085:8080
99104
volumes:
100105
- mbtiles:/data
106+
environment:
107+
PUID: 1000
108+
PGID: 1000
101109
restart: unless-stopped
102-
db:
110+
terrastories-db:
103111
image: postgres:11
104112
ports:
105113
- 5432:5432
@@ -115,7 +123,7 @@ services:
115123
ports:
116124
- 8083:3000
117125
depends_on:
118-
- db
126+
- terrastories-db
119127
environment:
120128
DATABASE_URL: postgres://postgres:postgres@db:5432/terrastories
121129
RAILS_ENV: offline

docker/local/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ SYNC_MAPEO_ID=atzye-79v6o
1919
SYNC_MAPEO_NAME=Mapeo
2020
SYNC_INSTALLERS_ID=gmyij-7gktt
2121
SYNC_INSTALLERS_NAME=INSTALLERS-edt
22+
SYNC_TILES_ID=kfgre-slfl7
23+
SYNC_TILES_NAME=Map-Tiles
2224
# Terrastories ENV
2325
MAPBOX_STYLE=mapbox://styles/mapbox/light-v10
2426
MAPBOX_ACCESS_TOKEN=your pk token here
25-
DB_USER_PASSWORD=postgres

docker/local/docker-compose.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ services:
7171
- mapeo:/srv/mapeo
7272
- fdroid:/srv/fdroid
7373
- installers:/srv/installers
74+
- mapeo-bridge:/srv/terrastories-places
7475
- terrastories-import:/srv/terrastories/import
7576
- terrastories-media:/srv/terrastories/media
7677
environment:
@@ -101,6 +102,8 @@ services:
101102
SYNC_MAPEO_NAME: ${SYNC_MAPEO_NAME}
102103
SYNC_INSTALLERS_ID: ${SYNC_INSTALLERS_ID}
103104
SYNC_INSTALLERS_NAME: ${SYNC_INSTALLERS_NAME}
105+
SYNC_TILES_ID: ${SYNC_TILES_ID}
106+
SYNC_TILES_NAME: ${SYNC_TILES_NAME}
104107
volumes:
105108
- crawls:/config/websites
106109
- mapeo:/config/mapeo
@@ -120,14 +123,15 @@ services:
120123
volumes:
121124
- pywb-archive:/webarchive
122125
- crawls:/source
123-
# Terrastories
124-
tile-server:
125-
image: maptiler/tileserver-gl
126+
# https://hub.docker.com/r/maptiler/tileserver-gl
127+
tileserver:
128+
build: ../../services/tileserver
126129
ports:
127-
- 8085:80
130+
- 8085:8080
128131
volumes:
129132
- mbtiles:/data
130-
db:
133+
# Terrastories
134+
terrastories-db:
131135
image: postgres:11
132136
ports:
133137
- 5432:5432
@@ -141,7 +145,7 @@ services:
141145
ports:
142146
- 8083:3000
143147
depends_on:
144-
- db
148+
- terrastories-db
145149
environment:
146150
DB_USER_PASSWORD: ${DB_USER_PASSWORD}
147151
DB_HOST: db

0 commit comments

Comments
 (0)