Skip to content

Commit

Permalink
Content final (#54)
Browse files Browse the repository at this point in the history
* v0.5.0

* fix: correct Dockerfile for pywb

* fix: set singleClick to false for Filebrowser

* fix: pywb not loading head_insert.html file

* fix: minimal and white edt logo for interface

* chore: better white logo

* chore: expose mapeo configs and mbtiles over http

* fix: don't run db:seed on terrastories

* fix: create firstboot file on config dir for syncthing

* fix: persist config directory for syncthing db

* fix: minor fix on syncthing config

* chore: add syncthing fix to demo and local dockerfiles

* chore: update portal to use latest docker image tag

* chore: update portal to use latest docker image tag on demo and local
  • Loading branch information
luandro authored Apr 24, 2023
1 parent 10cdca4 commit 52cbd4d
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion balena.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Earth Defender's Toolkit Offline"
type: "sw.application"
version: 0.4.9
version: 0.5.0
description: "A low-energy device that creates an access-point serving applications, bridging them and exposing curated content offline.
Software stack and content are automatically updated while online, and can be updated offline."
assets:
Expand Down
20 changes: 12 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ version: "2.1"
volumes:
interface_db:
wifi_db:
syncthing:
fdroid:
mapeo:
crawls:
pywb-archive:
installers:
postgres_data:
mbtiles:
bundler:
terrastories-bundler:
terrastories-media:
terrastories-import:
pataka:
Expand Down Expand Up @@ -54,7 +55,7 @@ services:
privileged: true # This can be removed if you do not need the LED connectivity indicator.
# https://hub.docker.com/r/communityfirst/edt-offline-edt-portal
portal:
image: communityfirst/edt-offline-portal:nightly
image: communityfirst/edt-offline-portal:latest
restart: always
ports:
- 8080:3000
Expand Down Expand Up @@ -86,11 +87,12 @@ services:
syncthing:
build: services/syncthing
volumes:
- crawls:/config/websites
- mapeo:/config/mapeo
- fdroid:/config/fdroid
- installers:/config/installers
- mbtiles:/config/mbtiles
- syncthing:/config
- crawls:/data/websites
- mapeo:/data/mapeo
- fdroid:/data/fdroid
- installers:/data/installers
- mbtiles:/data/mbtiles
ports:
- 8082:8384
- 22000:22000/tcp
Expand Down Expand Up @@ -121,7 +123,7 @@ services:
CHOKIDAR_USEPOLLING: 'true'
SECRET_KEY_BASE: "a845b372237fe58988e8fb7698b9a7b61f8cc7581dc685387ff1cb8ec5f250d57b733379d53f5c3e7b816d0bf0fdf5f7b02558c64b932903e5ec3fbe10c4b205"
volumes:
- bundler:/usr/local/bundle
- terrastories-bundler:/usr/local/bundle
- terrastories-media:/media
- terrastories-import:/api/import/media
restart: unless-stopped
Expand Down Expand Up @@ -150,6 +152,8 @@ services:
volumes:
- installers:/usr/local/apache2/htdocs/installers
- fdroid:/usr/local/apache2/htdocs/repo
- mapeo:/usr/local/apache2/htdocs/mapeo
- mbtiles:/usr/local/apache2/htdocs/mbtiles
restart: unless-stopped
# https://hub.docker.com/r/communityfirst/pataka-cli
pataka:
Expand Down
20 changes: 12 additions & 8 deletions docker/demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '2.1'
volumes:
fdroid:
mapeo:
syncthing:
crawls:
pywb-archive:
minio-data:
Expand All @@ -11,13 +12,13 @@ volumes:
# Terrastories
postgres_data:
mbtiles:
bundler:
terrastories-bundler:
terrastories-data:
terrastories-media:
terrastories-import:
services:
portal:
image: communityfirst/edt-offline-portal:nightly
image: communityfirst/edt-offline-portal:latest
restart: always
ports:
- 80:3000
Expand Down Expand Up @@ -73,11 +74,12 @@ services:
SYNC_TILES_ID: ${SYNC_TILES_ID}
SYNC_TILES_NAME: ${SYNC_TILES_NAME}
volumes:
- crawls:/config/websites
- mapeo:/config/mapeo
- fdroid:/config/fdroid
- installers:/config/installers
- mbtiles:/config/mbtiles
- syncthing:/config
- crawls:/data/websites
- mapeo:/data/mapeo
- fdroid:/data/fdroid
- installers:/data/installers
- mbtiles:/data/mbtiles
ports:
- 8082:8384
- 22000:22000/tcp
Expand Down Expand Up @@ -109,6 +111,8 @@ services:
volumes:
- installers:/usr/local/apache2/htdocs/installers
- fdroid:/usr/local/apache2/htdocs/repo
- mapeo:/usr/local/apache2/htdocs/mapeo
- mbtiles:/usr/local/apache2/htdocs/mbtiles
terrastories-db:
image: postgres:11
ports:
Expand Down Expand Up @@ -136,7 +140,7 @@ services:
MAPBOX_ACCESS_TOKEN: ${MAPBOX_ACCESS_TOKEN}
SECRET_KEY_BASE: "a845b372237fe58988e8fb7698b9a7b61f8cc7581dc685387ff1cb8ec5f250d57b733379d53f5c3e7b816d0bf0fdf5f7b02558c64b932903e5ec3fbe10c4b205"
volumes:
- bundler:/usr/local/bundle
- terrastories-bundler:/usr/local/bundle
- terrastories-data:/api
- terrastories-media:/media
- terrastories-import:/api/import/media
Expand Down
20 changes: 12 additions & 8 deletions docker/local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ version: '2.1'
volumes:
fdroid:
mapeo:
syncthing:
crawls:
pywb-archive:
installers:
postgres_data:
mbtiles:
bundler:
terrastories-bundler:
terrastories-media:
terrastories-import:
pataka:
Expand All @@ -25,7 +26,7 @@ services:
PORTAL_SSID: ${PORTAL_SSID}
# https://hub.docker.com/r/communityfirst/edt-offline-edt-portal
portal:
image: communityfirst/edt-offline-portal:nightly
image: communityfirst/edt-offline-portal:latest
restart: always
ports:
- 8080:3000
Expand Down Expand Up @@ -57,11 +58,12 @@ services:
syncthing:
build: ../../services/syncthing
volumes:
- crawls:/config/websites
- mapeo:/config/mapeo
- fdroid:/config/fdroid
- installers:/config/installers
- mbtiles:/config/mbtiles
- syncthing:/config
- crawls:/data/websites
- mapeo:/data/mapeo
- fdroid:/data/fdroid
- installers:/data/installers
- mbtiles:/data/mbtiles
ports:
- 8082:8384
- 22000:22000/tcp
Expand Down Expand Up @@ -92,7 +94,7 @@ services:
CHOKIDAR_USEPOLLING: 'true'
SECRET_KEY_BASE: "a845b372237fe58988e8fb7698b9a7b61f8cc7581dc685387ff1cb8ec5f250d57b733379d53f5c3e7b816d0bf0fdf5f7b02558c64b932903e5ec3fbe10c4b205"
volumes:
- bundler:/usr/local/bundle
- terrastories-bundler:/usr/local/bundle
- terrastories-media:/media
- terrastories-import:/api/import/media
restart: unless-stopped
Expand Down Expand Up @@ -121,6 +123,8 @@ services:
volumes:
- installers:/usr/local/apache2/htdocs/installers
- fdroid:/usr/local/apache2/htdocs/repo
- mapeo:/usr/local/apache2/htdocs/mapeo
- mbtiles:/usr/local/apache2/htdocs/mbtiles
restart: unless-stopped
# https://hub.docker.com/r/communityfirst/pataka-cli
pataka:
Expand Down
2 changes: 1 addition & 1 deletion services/filebrowser/custom/filebrowser.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scope": "./users",
"locale": "#LOCALE",
"viewMode": "list",
"singleClick": true,
"singleClick": false,
"sorting": {
"by": "name",
"asc": false
Expand Down
Binary file modified services/interface/custom/logo_colour.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified services/interface/custom/logo_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion services/pywb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM webrecorder/pywb

COPY start.sh /tmp
ENTRYPOINT ["sh", "/tmp/start.sh"]
COPY config.yaml /webarchive/config.yaml
RUN mkdir -p /webarchive/templates
COPY head_insert.html /webarchive/templates/head_insert.html

ENTRYPOINT ["sh", "/tmp/start.sh"]
4 changes: 3 additions & 1 deletion services/syncthing/cont-init.d/99-custom-files.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

file=firstboot
file=/config/firstboot

if [ ! -e "$file" ]; then
echo "First run!"
Expand All @@ -21,7 +21,9 @@ if [ ! -e "$file" ]; then
sed -i -r "s/#TILES_NAME/$SYNC_TILES_NAME/g" /config/config.xml
echo "=======" "Adding authentication and setting permissions" "====="
syncthing generate --home=/config --gui-user=${ADMIN_LOGIN} --gui-password=${ADMIN_PASSWORD}
mkdir -p /data
chown -R 1000:1000 /config
chown -R 1000:1000 /data
touch "$file"
fi

Expand Down
12 changes: 6 additions & 6 deletions services/syncthing/default-config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<configuration version="36">
<folder id="#TILES_ID" label="#TILES_NAME" path="/config/mbtiles" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<folder id="#TILES_ID" label="#TILES_NAME" path="/data/mbtiles" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<filesystemType>basic</filesystemType>
<device id="#SOURCE_ID" introducedBy="">
<encryptionPassword></encryptionPassword>
Expand Down Expand Up @@ -32,7 +32,7 @@
<caseSensitiveFS>false</caseSensitiveFS>
<junctionsAsDirs>false</junctionsAsDirs>
</folder>
<folder id="#INSTALLERS_ID" label="#INSTALLERS_NAME" path="/config/installers" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<folder id="#INSTALLERS_ID" label="#INSTALLERS_NAME" path="/data/installers" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<filesystemType>basic</filesystemType>
<device id="#SOURCE_ID" introducedBy="">
<encryptionPassword></encryptionPassword>
Expand Down Expand Up @@ -65,7 +65,7 @@
<caseSensitiveFS>false</caseSensitiveFS>
<junctionsAsDirs>false</junctionsAsDirs>
</folder>
<folder id="#MAPEO_ID" label="#MAPEO_NAME" path="/config/mapeo" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<folder id="#MAPEO_ID" label="#MAPEO_NAME" path="/data/mapeo" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<filesystemType>basic</filesystemType>
<device id="#SOURCE_ID" introducedBy="">
<encryptionPassword></encryptionPassword>
Expand Down Expand Up @@ -98,7 +98,7 @@
<caseSensitiveFS>false</caseSensitiveFS>
<junctionsAsDirs>false</junctionsAsDirs>
</folder>
<folder id="#FDROID_ID" label="#FDROID_NAME" path="/config/fdroid" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<folder id="#FDROID_ID" label="#FDROID_NAME" path="/data/fdroid" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<filesystemType>basic</filesystemType>
<device id="#SOURCE_ID" introducedBy="">
<encryptionPassword></encryptionPassword>
Expand Down Expand Up @@ -131,7 +131,7 @@
<caseSensitiveFS>false</caseSensitiveFS>
<junctionsAsDirs>false</junctionsAsDirs>
</folder>
<folder id="#CRAWLS_ID" label="#CRAWLS_NAME" path="/config/websites" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<folder id="#CRAWLS_ID" label="#CRAWLS_NAME" path="/data/websites" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<filesystemType>basic</filesystemType>
<device id="#SOURCE_ID" introducedBy="">
<encryptionPassword></encryptionPassword>
Expand Down Expand Up @@ -226,7 +226,7 @@
<insecureAllowOldTLSVersions>false</insecureAllowOldTLSVersions>
</options>
<defaults>
<folder id="" label="" path="/config/data" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<folder id="" label="" path="/data/data" type="receiveonly" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="true" autoNormalize="true">
<filesystemType>basic</filesystemType>
<minDiskFree unit="%">1</minDiskFree>
<versioning>
Expand Down
2 changes: 1 addition & 1 deletion services/terrastories/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ ! -e "$file" ] ; then
echo "First run!"
echo "================================"
echo "Running migration"
bin/rails db:migrate db:seed
bin/rails db:migrate
touch "$file"
fi

Expand Down

0 comments on commit 52cbd4d

Please sign in to comment.