diff --git a/.run/Python tests in wrolpi.run.xml b/.run/Python WROLPi & Modules Tests.run.xml
similarity index 54%
rename from .run/Python tests in wrolpi.run.xml
rename to .run/Python WROLPi & Modules Tests.run.xml
index c351983c..0f599f56 100644
--- a/.run/Python tests in wrolpi.run.xml
+++ b/.run/Python WROLPi & Modules Tests.run.xml
@@ -1,17 +1,17 @@
You can view the media directory by navigating to /media
+The API may be available by navigating to port 8081
+The map may be available by navigating to port 8084
+Kiwix may be available by navigating to port 8085
+ diff --git a/app/public/epub.js b/app/public/epub/epub.js similarity index 100% rename from app/public/epub.js rename to app/public/epub/epub.js diff --git a/app/public/jszip.min.js b/app/public/epub/jszip.min.js similarity index 100% rename from app/public/jszip.min.js rename to app/public/epub/jszip.min.js diff --git a/app/public/favicon-16x16.png b/app/public/favicon-16x16.png new file mode 100644 index 00000000..4c8f59a6 Binary files /dev/null and b/app/public/favicon-16x16.png differ diff --git a/app/public/favicon-32x32.png b/app/public/favicon-32x32.png new file mode 100644 index 00000000..3a233755 Binary files /dev/null and b/app/public/favicon-32x32.png differ diff --git a/app/public/favicon.ico b/app/public/favicon.ico index 18e0acb7..4ab26079 100644 Binary files a/app/public/favicon.ico and b/app/public/favicon.ico differ diff --git a/app/public/index.html b/app/public/index.html index d9fd92a0..3a15d035 100644 --- a/app/public/index.html +++ b/app/public/index.html @@ -2,14 +2,17 @@ - - + + + + +diff --git a/README.md b/README.md index 9bd9ca23..f9b0e79b 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,12 @@ Install WROLPi onto a fresh Raspberry Pi. # Charter +## Guiding Principals + +1. Storage is cheaper than power. +2. Two is one, one is none. +3. In WROL mode, run silently. + ## Physical properties 1. A WROLPi instance should be capable of running with a minimal of hardware: @@ -129,7 +135,7 @@ Install WROLPi onto a fresh Raspberry Pi. * SD card * External USB hard drive * Power supply and cables - * WiFi USER device such as a phone, tablet, or laptop. + * Wi-Fi USER device such as a phone, tablet, or laptop. 2. A WROLPi instance should consume a minimal amount of electricity during WROL event. It is expected power will be scarce when WROLPi is needed most. diff --git a/alembic/versions/3b6918aeca4b_file_group.py b/alembic/versions/3b6918aeca4b_file_group.py index 70470f18..2364325f 100644 --- a/alembic/versions/3b6918aeca4b_file_group.py +++ b/alembic/versions/3b6918aeca4b_file_group.py @@ -76,9 +76,12 @@ def upgrade(): ) STORED )''') - session.execute('ALTER TABLE video ADD COLUMN file_group_id BIGINT REFERENCES file_group(id) ON DELETE CASCADE NOT NULL UNIQUE') - session.execute('ALTER TABLE ebook ADD COLUMN file_group_id BIGINT REFERENCES file_group(id) ON DELETE CASCADE NOT NULL UNIQUE') - session.execute('ALTER TABLE archive ADD COLUMN file_group_id BIGINT REFERENCES file_group(id) ON DELETE CASCADE NOT NULL UNIQUE') + session.execute( + 'ALTER TABLE video ADD COLUMN file_group_id BIGINT REFERENCES file_group(id) ON DELETE CASCADE NOT NULL UNIQUE') + session.execute( + 'ALTER TABLE ebook ADD COLUMN file_group_id BIGINT REFERENCES file_group(id) ON DELETE CASCADE NOT NULL UNIQUE') + session.execute( + 'ALTER TABLE archive ADD COLUMN file_group_id BIGINT REFERENCES file_group(id) ON DELETE CASCADE NOT NULL UNIQUE') session.execute(''' CREATE TABLE tag ( diff --git a/alembic/versions/751aecf46b88_zim.py b/alembic/versions/751aecf46b88_zim.py new file mode 100644 index 00000000..cc23d1f9 --- /dev/null +++ b/alembic/versions/751aecf46b88_zim.py @@ -0,0 +1,67 @@ +"""Zim + +Revision ID: 751aecf46b88 +Revises: 75d34a2b442d +Create Date: 2023-06-04 19:48:41.305111 + +""" +import os + +from alembic import op +from sqlalchemy.orm import Session + +# revision identifiers, used by Alembic. +revision = '751aecf46b88' +down_revision = '75d34a2b442d' +branch_labels = None +depends_on = None + +DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False + + +def upgrade(): + bind = op.get_bind() + session = Session(bind=bind) + + session.execute(''' + CREATE TABLE zim ( + id SERIAL PRIMARY KEY, + path TEXT NOT NULL UNIQUE, + file_group_id BIGINT REFERENCES file_group(id) ON DELETE CASCADE NOT NULL + )''') + + session.execute(''' + CREATE TABLE tag_zim ( + tag_id INTEGER REFERENCES tag(id), + zim_id INTEGER REFERENCES zim(id) ON DELETE CASCADE, + zim_entry TEXT NOT NULL, + created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP, + UNIQUE (tag_id, zim_id, zim_entry) + )''') + + session.execute(''' + CREATE TABLE zim_subscription ( + id SERIAL PRIMARY KEY, + name TEXT NOT NULL UNIQUE, + language TEXT NOT NULL, + download_id INTEGER NOT NULL REFERENCES download(id) ON DELETE CASCADE + ) + ''') + + # We want to index all Zim files using `zim_modeler` + session.execute("UPDATE file_group SET indexed=false WHERE primary_path ILIKE '%.zim'") + + if not DOCKERIZED: + session.execute('ALTER TABLE public.zim OWNER TO wrolpi') + session.execute('ALTER TABLE public.tag_zim OWNER TO wrolpi') + session.execute('ALTER TABLE public.zim_subscription OWNER TO wrolpi') + + +def downgrade(): + bind = op.get_bind() + session = Session(bind=bind) + + session.execute('DROP TABLE IF EXISTS zim_subscription') + session.execute('DROP TABLE IF EXISTS tag_zim') + session.execute('DROP TABLE IF EXISTS zim') + session.execute("UPDATE file_group SET indexed=false WHERE primary_path ILIKE '%.zim'") diff --git a/alembic/versions/84b6993a6091_drop_channel_next_download.py b/alembic/versions/84b6993a6091_drop_channel_next_download.py index 77b4c215..f9cdea37 100644 --- a/alembic/versions/84b6993a6091_drop_channel_next_download.py +++ b/alembic/versions/84b6993a6091_drop_channel_next_download.py @@ -6,10 +6,10 @@ Create Date: 2021-12-27 16:42:32.099796 """ import os + from alembic import op from sqlalchemy.orm import Session - # revision identifiers, used by Alembic. revision = '84b6993a6091' down_revision = '8df411232c17' diff --git a/alembic/versions/aac864072193_increase_file_size_column.py b/alembic/versions/aac864072193_increase_file_size_column.py index 6f9aa453..5cb30287 100644 --- a/alembic/versions/aac864072193_increase_file_size_column.py +++ b/alembic/versions/aac864072193_increase_file_size_column.py @@ -6,10 +6,10 @@ Create Date: 2022-06-22 17:34:33.635528 """ import os + from alembic import op from sqlalchemy.orm import Session - # revision identifiers, used by Alembic. revision = 'aac864072193' down_revision = '467235201c70' diff --git a/alembic/versions/b97c1313f986_video_modification_datetime.py b/alembic/versions/b97c1313f986_video_modification_datetime.py index 4939cdd7..c5b478da 100644 --- a/alembic/versions/b97c1313f986_video_modification_datetime.py +++ b/alembic/versions/b97c1313f986_video_modification_datetime.py @@ -6,10 +6,10 @@ Create Date: 2022-01-25 08:00:26.944183 """ import os + from alembic import op from sqlalchemy.orm import Session - # revision identifiers, used by Alembic. revision = 'b97c1313f986' down_revision = '3c33b1dae069' diff --git a/alembic/versions/bf704baa185d_zim_flag.py b/alembic/versions/bf704baa185d_zim_flag.py new file mode 100644 index 00000000..d30f1303 --- /dev/null +++ b/alembic/versions/bf704baa185d_zim_flag.py @@ -0,0 +1,33 @@ +"""Zim flag + +Revision ID: bf704baa185d +Revises: 751aecf46b88 +Create Date: 2023-07-01 20:00:35.601752 + +""" +import os + +from alembic import op +from sqlalchemy.orm import Session + +# revision identifiers, used by Alembic. +revision = 'bf704baa185d' +down_revision = '751aecf46b88' +branch_labels = None +depends_on = None + +DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False + + +def upgrade(): + bind = op.get_bind() + session = Session(bind=bind) + + session.execute('ALTER TABLE wrolpi_flag ADD COLUMN outdated_zims BOOLEAN DEFAULT FALSE') + + +def downgrade(): + bind = op.get_bind() + session = Session(bind=bind) + + session.execute('ALTER TABLE wrolpi_flag DROP COLUMN outdated_zims') diff --git a/alembic/versions/d2eace02f5b9_file_path_on_cascade.py b/alembic/versions/d2eace02f5b9_file_path_on_cascade.py index a57cb35c..1af5cd62 100644 --- a/alembic/versions/d2eace02f5b9_file_path_on_cascade.py +++ b/alembic/versions/d2eace02f5b9_file_path_on_cascade.py @@ -6,10 +6,10 @@ Create Date: 2022-09-28 15:14:43.306819 """ import os + from alembic import op from sqlalchemy.orm import Session - # revision identifiers, used by Alembic. revision = 'd2eace02f5b9' down_revision = '70db5ba8763d' diff --git a/alembic/versions/f2c6326cad29_video_source_id_index.py b/alembic/versions/f2c6326cad29_video_source_id_index.py index a49a75ab..b02eb2c5 100644 --- a/alembic/versions/f2c6326cad29_video_source_id_index.py +++ b/alembic/versions/f2c6326cad29_video_source_id_index.py @@ -6,10 +6,10 @@ Create Date: 2022-01-10 08:27:39.082067 """ import os + from alembic import op from sqlalchemy.orm import Session - # revision identifiers, used by Alembic. revision = 'f2c6326cad29' down_revision = 'f8c65e7e6802' diff --git a/alembic/versions/f8c65e7e6802_channel_refresh.py b/alembic/versions/f8c65e7e6802_channel_refresh.py index 8a34aedd..f7a19838 100644 --- a/alembic/versions/f8c65e7e6802_channel_refresh.py +++ b/alembic/versions/f8c65e7e6802_channel_refresh.py @@ -6,10 +6,10 @@ Create Date: 2022-01-07 14:28:21.787842 """ import os + from alembic import op from sqlalchemy.orm import Session - # revision identifiers, used by Alembic. revision = 'f8c65e7e6802' down_revision = '62acddc55091' diff --git a/alembic/versions/f9928a3b6bc5_file_directories.py b/alembic/versions/f9928a3b6bc5_file_directories.py index 9437ee8c..5c627d60 100644 --- a/alembic/versions/f9928a3b6bc5_file_directories.py +++ b/alembic/versions/f9928a3b6bc5_file_directories.py @@ -6,6 +6,7 @@ Create Date: 2023-04-18 16:58:40.043115 """ import os + from alembic import op from sqlalchemy.orm import Session diff --git a/app/public/android-chrome-192x192.png b/app/public/android-chrome-192x192.png new file mode 100644 index 00000000..b6d7604d Binary files /dev/null and b/app/public/android-chrome-192x192.png differ diff --git a/app/public/android-chrome-512x512.png b/app/public/android-chrome-512x512.png new file mode 100644 index 00000000..17e14181 Binary files /dev/null and b/app/public/android-chrome-512x512.png differ diff --git a/app/public/apple-touch-icon.png b/app/public/apple-touch-icon.png new file mode 100644 index 00000000..ff79d390 Binary files /dev/null and b/app/public/apple-touch-icon.png differ diff --git a/app/public/epub.html b/app/public/epub/epub.html similarity index 98% rename from app/public/epub.html rename to app/public/epub/epub.html index 39daa08f..b9c6011d 100644 --- a/app/public/epub.html +++ b/app/public/epub/epub.html @@ -30,8 +30,8 @@ either expressed or implied, of the FreeBSD Project. -->
- - + +