ソースを参照

remove home files

Pi 1 ヶ月 前
コミット
498b1bec5e

+ 0 - 5
Dockerfile

@@ -1,5 +0,0 @@
-FROM nginx:alpine
-COPY nginx.conf /etc/nginx/nginx.conf
-COPY prayer-generator/license /usr/share/nginx/html/license
-COPY css /usr/share/nginx/html/css
-COPY robots.txt /usr/share/nginx/html

+ 0 - 7
Dockerfile-auth

@@ -1,7 +0,0 @@
-FROM python:3-slim
-WORKDIR /usr/src/app
-COPY requirements-auth.txt ./
-RUN python3 -m pip install --upgrade pip && \
-    python3 -m pip install --no-cache-dir -r requirements-auth.txt
-COPY forward_auth.py ./
-CMD [ "python", "forward_auth.py" ]

+ 0 - 6
activities/sqlpage/migrations/001_activities.sql

@@ -1,6 +0,0 @@
-DROP TABLE IF EXISTS activities;
-CREATE TABLE activities (
-  user TEXT,
-  ts TIMESTAMP,
-  activity TEXT
-);

+ 0 - 5
activities/sqlpage/sqlpage.json

@@ -1,5 +0,0 @@
-{
-  "database_url": "sqlite://./activities.db",
-  "site_prefix": "/activity",
-  "max_database_pool_connections": 16
-}

+ 0 - 114
activities/www/chart.sql

@@ -1,114 +0,0 @@
-SET ":user" = COALESCE(:user, $user, '');
-SET ":date" = COALESCE(:date, $date, CURRENT_TIMESTAMP);
-SET ":start_of_day" = (SELECT datetime(datetime(:date, 'localtime'), 'start of day'));
-SET ":end_of_day" = (SELECT datetime(:start_of_day, '+1 days'));
-
-SET ":total_time" = (WITH delta AS (SELECT julianday(COALESCE((
-  SELECT min(lag.ts, datetime(:end_of_day, 'utc'))
-  FROM activities lag
-  WHERE lag.ts > a.ts AND lag.activity <> a.activity
-  ORDER BY lag.ts ASC
-  LIMIT 1
-), min(CURRENT_TIMESTAMP, datetime(:end_of_day, 'utc')))) - julianday(a.ts) AS delta
-, activity
-FROM activities a
-WHERE user = :user
-AND datetime(datetime(ts, 'localtime'), 'start of day') = :start_of_day)
-SELECT printf("%.0f", sum(delta)*60*24) AS minutes --, activity
-FROM delta
-WHERE activity = 'Eating'
-GROUP BY delta.activity);
-
-SELECT 'chart' AS component
---, '' AS title
-, :total_time || ' min.' AS title
-, TRUE AS time
-, 'area' AS type
-, 1 AS ymax
-, 0 AS ymin
-, 1 AS ystep
-, '100' AS height
--- TODO: fix color to series
---
---  SELECT DISTINCT color(activity) FROM activities ORDER BY activity;
-, 'azure' AS color
-, 'green' AS color
-, 'red' AS color
-;
-SET ":any" = EXISTS (SELECT * FROM activities
-    WHERE user = :user
-    AND datetime(ts, 'localtime')
-    BETWEEN :start_of_day AND :end_of_day
-    LIMIT 1
-);
-SELECT NULL AS x, NULL AS y, 'Unknown' AS series WHERE :any;
-SELECT NULL AS x, NULL AS y, 'Eating' AS series WHERE :any;
-SELECT NULL AS x, NULL AS y, 'Not eating' AS series WHERE :any;
-SET ":morning_offset" = '08:00:00.000';
-SET ":evening_offset" = '03:00:00.000';
-WITH plot AS (
-    SELECT ROW_NUMBER() OVER (ORDER BY ts) AS row
-    , ts
-    , activity
-    FROM (
-        SELECT ts, activity FROM activities
-        WHERE user = :user
-        AND datetime(ts, 'localtime') BETWEEN :start_of_day AND :end_of_day
-        UNION
-        SELECT datetime(:start_of_day, 'utc'), (
-            SELECT activity FROM activities
-            WHERE user = :user AND datetime(ts, 'localtime') <= :start_of_day
-            AND :any
-            ORDER BY ts DESC
-            LIMIT 1
-        )
-        UNION
-        SELECT datetime(:end_of_day, 'utc'), (
-            SELECT activity FROM activities
-            WHERE user = :user AND datetime(ts, 'localtime') <= :end_of_day
-            AND :any
-            ORDER BY ts DESC
-            LIMIT 1
-        )
-    )
-)
-SELECT datetime(:start_of_day, '+'||:morning_offset) AS x, 1 AS y, (
-    SELECT activity FROM activities
-    WHERE user = :user AND datetime(ts, 'localtime') <= datetime(:start_of_day, '+'||:morning_offset)
-    AND :any
-    ORDER BY ts DESC
-    LIMIT 1
-) AS series
-UNION
-SELECT datetime(:end_of_day, '-'||:evening_offset) AS x, 1 AS y, (
-    SELECT activity FROM activities
-    WHERE user = :user AND datetime(ts, 'localtime') <= datetime(:end_of_day, '-'||:evening_offset)
-    AND :any
-    ORDER BY ts DESC
-    LIMIT 1
-) AS series
-UNION
-SELECT datetime(x, 'localtime') AS x, CASE value WHEN 0 THEN NULL ELSE value END AS y, series FROM (
-    SELECT datetime(next.ts, '-00:00:01.000') AS x, 0 AS value, next.activity AS series
-    FROM plot, plot next
-    WHERE plot.row = next.row - 1
-    AND plot.activity <> next.activity
-    UNION
-    SELECT ts AS x, 1 AS value, activity AS series
-    FROM plot
-    UNION
-    SELECT datetime(next.ts, '-00:00:01.000') AS x, 1 AS value, plot.activity AS series
-    FROM plot, plot next
-    WHERE plot.row = next.row - 1
-    AND plot.activity <> next.activity
-    UNION
-    SELECT next.ts AS x, 0 AS value, plot.activity AS series
-    FROM plot, plot next
-    WHERE plot.row = next.row - 1
-    AND plot.activity <> next.activity
-) q
-WHERE
-    datetime(datetime(x, 'localtime'), '-'||:morning_offset) >= :start_of_day
-AND
-    datetime(datetime(x, 'localtime'), '+'||:evening_offset) <= :end_of_day
-;

+ 0 - 93
activities/www/index.sql

@@ -1,93 +0,0 @@
-SET ":user" = 'shannon';
-INSERT INTO activities(user, activity, ts)
-SELECT :user, :activity, COALESCE(CASE COALESCE(:ts, '')
-  WHEN '' THEN NULL
-  ELSE datetime(:ts, 'utc')
-END, CURRENT_TIMESTAMP)
-WHERE COALESCE(:activity, '') <> ''
-RETURNING 'redirect' AS component, '/activity' AS link
-;
-
-SET ":title" = 'Activities';
-SELECT 'shell' AS component
-, 'dark' AS theme
-, :title AS title
-, 'fluid' AS layout
-, '/activity' AS link
-;
-
-SELECT 'text' AS component
-, '<style>
-.card > .card-body:has(.card-body > .d-flex + .chart) {
-    margin-top: 0 !important;
-    padding: 0;
-}
-.card > .card-body:has(.card-body > .d-flex + .chart) > .card-title {
-    position: absolute;
-    z-index: 99;
-    margin: 0;
-    padding: 0 10px;
-}
-.card > .card-body:has(> .d-flex + .chart) {
-    padding: 0;
-}
-.card > .card-body > .d-flex {
-    font-size: 0.3em;
-    padding: 0 120px;
-}
-.card > .card-body > .d-flex {
-    height: 0;
-}
-.col:has(+ .col .apexcharts-legend-text) .card > .card-body:has(> .d-flex + .chart) {
-    max-height: 80px;
-}
-.apexcharts-yaxis {
-    display: none;
-}
-.col:has(+ .col .apexcharts-legend-text) .apexcharts-legend {
-    /* height: 0; // modifying the height alters the chart size */
-    visibility: hidden;
-}
-</style>' AS html
-;
-
-SELECT 'form' AS component
-, '/activity/index.sql' AS action
-;
-SELECT 'select' AS type
-, 'Activity' AS label
-, 'activity' AS name
-, TRUE AS create_new
-, TRUE AS dropdown
-, (SELECT json_group_array(json_object(
-    'label', activity,
-    'value', activity,
-    'selected', activity = 'Unknown'
-  )) FROM activities WHERE user = :user
-) AS options
-, 7 AS width
-;
-SELECT 'datetime-local' AS type
-, 'ts' AS name
-, 'Date and Time' AS label
-, '' AS value
-, 4 AS width
-;
-
-SELECT 'button' AS component
-SELECT 'Week' AS title
-, 1 AS width
-, '/activity?week=week' AS link
-;
-
-SELECT 'card' AS component
-, 1 AS columns
-;
-
-SELECT date(datetime(CURRENT_TIMESTAMP, '-'|| value ||'  days'), 'localtime') AS title
-, '/activity/chart.sql'||
-'?user='||:user||
-'&date='|| REPLACE(datetime(CURRENT_TIMESTAMP, '-'|| value ||'  days'), ' ', '+') ||
-'&_sqlpage_embed' AS embed
-FROM json_each(json(CASE $week WHEN 'week' THEN '[0, 1, 2, 3, 4, 5, 6, 7]' ELSE '[0, 1]' END))
-;

+ 0 - 14
css/clip.css

@@ -1,14 +0,0 @@
-body .pure-g {
-    text-align: center
-}
-details svg, details img {
-    background-color: white
-}
-textarea.form-control {
-  font-family: FreeMono, monospace;
-}
-textarea.form-control[disabled] {
-  background-color: var(--tblr-bg-forms);
-  color: var(--tblr-body-color);
-  border-color: #2fb344;
-}

+ 0 - 20
css/code.css

@@ -1,20 +0,0 @@
-body .pure-g {
-    text-align: center
-}
-details svg, details img {
-    background-color: white
-}
-.row-cols-lg-2:has(.bg-azure) {
-  justify-content: center;
-}
-.card-img-top {
-    width: 90%;
-    margin: 5%;
-}
-table td, table th {
-   padding-left: 5px;
-   padding-right: 5px;
-   padding-top: 2px;
-   padding-bottom: 2px;
-   border-width: 1px;
-}

+ 0 - 9
css/goto.css

@@ -1,9 +0,0 @@
-body .pure-g {
-    text-align: center
-}
-details svg, details img {
-    background-color: white
-}
-.row-cols-lg-2:has(.bg-google) {
-  justify-content: center;
-}

+ 0 - 470
css/grids-responsive-min.css

@@ -1,470 +0,0 @@
-/* !
-Pure v2.1.0
-Copyright 2013 Yahoo!
-Licensed under the BSD License.
-https://github.com/pure-css/pure/blob/master/LICENSE */
-@media screen and (min-width:35.5em){
-.pure-u-sm-1,.pure-u-sm-1-1,.pure-u-sm-1-12,.pure-u-sm-1-2,.pure-u-sm-1-24,.pure-u-sm-1-3,.pure-u-sm-1-4,.pure-u-sm-1-5,.pure-u-sm-1-6,.pure-u-sm-1-8,.pure-u-sm-10-24,.pure-u-sm-11-12,.pure-u-sm-11-24,.pure-u-sm-12-24,.pure-u-sm-13-24,.pure-u-sm-14-24,.pure-u-sm-15-24,.pure-u-sm-16-24,.pure-u-sm-17-24,.pure-u-sm-18-24,.pure-u-sm-19-24,.pure-u-sm-2-24,.pure-u-sm-2-3,.pure-u-sm-2-5,.pure-u-sm-20-24,.pure-u-sm-21-24,.pure-u-sm-22-24,.pure-u-sm-23-24,.pure-u-sm-24-24,.pure-u-sm-3-24,.pure-u-sm-3-4,.pure-u-sm-3-5,.pure-u-sm-3-8,.pure-u-sm-4-24,.pure-u-sm-4-5,.pure-u-sm-5-12,.pure-u-sm-5-24,.pure-u-sm-5-5,.pure-u-sm-5-6,.pure-u-sm-5-8,.pure-u-sm-6-24,.pure-u-sm-7-12,.pure-u-sm-7-24,.pure-u-sm-7-8,.pure-u-sm-8-24,.pure-u-sm-9-24{
-display:inline-block;
-letter-spacing:normal;
-word-spacing:normal;
-vertical-align:top;
-text-rendering:auto;
-}
-.pure-u-sm-1-24{
-width:4.1667%;
-}
-.pure-u-sm-1-12,.pure-u-sm-2-24{
-width:8.3333%;
-}
-.pure-u-sm-1-8,.pure-u-sm-3-24{
-width:12.5%;
-}
-.pure-u-sm-1-6,.pure-u-sm-4-24{
-width:16.6667%;
-}
-.pure-u-sm-1-5{
-width:20%;
-}
-.pure-u-sm-5-24{
-width:20.8333%;
-}
-.pure-u-sm-1-4,.pure-u-sm-6-24{
-width:25%;
-}
-.pure-u-sm-7-24{
-width:29.1667%;
-}
-.pure-u-sm-1-3,.pure-u-sm-8-24{
-width:33.3333%;
-}
-.pure-u-sm-3-8,.pure-u-sm-9-24{
-width:37.5%;
-}
-.pure-u-sm-2-5{
-width:40%;
-}
-.pure-u-sm-10-24,.pure-u-sm-5-12{
-width:41.6667%;
-}
-.pure-u-sm-11-24{
-width:45.8333%;
-}
-.pure-u-sm-1-2,.pure-u-sm-12-24{
-width:50%;
-}
-.pure-u-sm-13-24{
-width:54.1667%;
-}
-.pure-u-sm-14-24,.pure-u-sm-7-12{
-width:58.3333%;
-}
-.pure-u-sm-3-5{
-width:60%;
-}
-.pure-u-sm-15-24,.pure-u-sm-5-8{
-width:62.5%;
-}
-.pure-u-sm-16-24,.pure-u-sm-2-3{
-width:66.6667%;
-}
-.pure-u-sm-17-24{
-width:70.8333%;
-}
-.pure-u-sm-18-24,.pure-u-sm-3-4{
-width:75%;
-}
-.pure-u-sm-19-24{
-width:79.1667%;
-}
-.pure-u-sm-4-5{
-width:80%;
-}
-.pure-u-sm-20-24,.pure-u-sm-5-6{
-width:83.3333%;
-}
-.pure-u-sm-21-24,.pure-u-sm-7-8{
-width:87.5%;
-}
-.pure-u-sm-11-12,.pure-u-sm-22-24{
-width:91.6667%;
-}
-.pure-u-sm-23-24{
-width:95.8333%;
-}
-.pure-u-sm-1,.pure-u-sm-1-1,.pure-u-sm-24-24,.pure-u-sm-5-5{
-width:100%;
-}
-}
-@media screen and (min-width:40em){
-.pure-u-md-1,.pure-u-md-1-1,.pure-u-md-1-12,.pure-u-md-1-2,.pure-u-md-1-24,.pure-u-md-1-3,.pure-u-md-1-4,.pure-u-md-1-5,.pure-u-md-1-6,.pure-u-md-1-8,.pure-u-md-10-24,.pure-u-md-11-12,.pure-u-md-11-24,.pure-u-md-12-24,.pure-u-md-13-24,.pure-u-md-14-24,.pure-u-md-15-24,.pure-u-md-16-24,.pure-u-md-17-24,.pure-u-md-18-24,.pure-u-md-19-24,.pure-u-md-2-24,.pure-u-md-2-3,.pure-u-md-2-5,.pure-u-md-20-24,.pure-u-md-21-24,.pure-u-md-22-24,.pure-u-md-23-24,.pure-u-md-24-24,.pure-u-md-3-24,.pure-u-md-3-4,.pure-u-md-3-5,.pure-u-md-3-8,.pure-u-md-4-24,.pure-u-md-4-5,.pure-u-md-5-12,.pure-u-md-5-24,.pure-u-md-5-5,.pure-u-md-5-6,.pure-u-md-5-8,.pure-u-md-6-24,.pure-u-md-7-12,.pure-u-md-7-24,.pure-u-md-7-8,.pure-u-md-8-24,.pure-u-md-9-24{
-display:inline-block;
-letter-spacing:normal;
-word-spacing:normal;
-vertical-align:top;
-text-rendering:auto;
-}
-.pure-u-md-1-24{
-width:4.1667%;
-}
-.pure-u-md-1-12,.pure-u-md-2-24{
-width:8.3333%;
-}
-.pure-u-md-1-8,.pure-u-md-3-24{
-width:12.5%;
-}
-.pure-u-md-1-6,.pure-u-md-4-24{
-width:16.6667%;
-}
-.pure-u-md-1-5{
-width:20%;
-}
-.pure-u-md-5-24{
-width:20.8333%;
-}
-.pure-u-md-1-4,.pure-u-md-6-24{
-width:25%;
-}
-.pure-u-md-7-24{
-width:29.1667%;
-}
-.pure-u-md-1-3,.pure-u-md-8-24{
-width:33.3333%;
-}
-.pure-u-md-3-8,.pure-u-md-9-24{
-width:37.5%;
-}
-.pure-u-md-2-5{
-width:40%;
-}
-.pure-u-md-10-24,.pure-u-md-5-12{
-width:41.6667%;
-}
-.pure-u-md-11-24{
-width:45.8333%;
-}
-.pure-u-md-1-2,.pure-u-md-12-24{
-width:50%;
-}
-.pure-u-md-13-24{
-width:54.1667%;
-}
-.pure-u-md-14-24,.pure-u-md-7-12{
-width:58.3333%;
-}
-.pure-u-md-3-5{
-width:60%;
-}
-.pure-u-md-15-24,.pure-u-md-5-8{
-width:62.5%;
-}
-.pure-u-md-16-24,.pure-u-md-2-3{
-width:66.6667%;
-}
-.pure-u-md-17-24{
-width:70.8333%;
-}
-.pure-u-md-18-24,.pure-u-md-3-4{
-width:75%;
-}
-.pure-u-md-19-24{
-width:79.1667%;
-}
-.pure-u-md-4-5{
-width:80%;
-}
-.pure-u-md-20-24,.pure-u-md-5-6{
-width:83.3333%;
-}
-.pure-u-md-21-24,.pure-u-md-7-8{
-width:87.5%;
-}
-.pure-u-md-11-12,.pure-u-md-22-24{
-width:91.6667%;
-}
-.pure-u-md-23-24{
-width:95.8333%;
-}
-.pure-u-md-1,.pure-u-md-1-1,.pure-u-md-24-24,.pure-u-md-5-5{
-width:100%;
-}
-}
-@media screen and (min-width:64em){
-.pure-u-lg-1,.pure-u-lg-1-1,.pure-u-lg-1-12,.pure-u-lg-1-2,.pure-u-lg-1-24,.pure-u-lg-1-3,.pure-u-lg-1-4,.pure-u-lg-1-5,.pure-u-lg-1-6,.pure-u-lg-1-8,.pure-u-lg-10-24,.pure-u-lg-11-12,.pure-u-lg-11-24,.pure-u-lg-12-24,.pure-u-lg-13-24,.pure-u-lg-14-24,.pure-u-lg-15-24,.pure-u-lg-16-24,.pure-u-lg-17-24,.pure-u-lg-18-24,.pure-u-lg-19-24,.pure-u-lg-2-24,.pure-u-lg-2-3,.pure-u-lg-2-5,.pure-u-lg-20-24,.pure-u-lg-21-24,.pure-u-lg-22-24,.pure-u-lg-23-24,.pure-u-lg-24-24,.pure-u-lg-3-24,.pure-u-lg-3-4,.pure-u-lg-3-5,.pure-u-lg-3-8,.pure-u-lg-4-24,.pure-u-lg-4-5,.pure-u-lg-5-12,.pure-u-lg-5-24,.pure-u-lg-5-5,.pure-u-lg-5-6,.pure-u-lg-5-8,.pure-u-lg-6-24,.pure-u-lg-7-12,.pure-u-lg-7-24,.pure-u-lg-7-8,.pure-u-lg-8-24,.pure-u-lg-9-24{
-display:inline-block;
-letter-spacing:normal;
-word-spacing:normal;
-vertical-align:top;
-text-rendering:auto;
-}
-.pure-u-lg-1-24{
-width:4.1667%;
-}
-.pure-u-lg-1-12,.pure-u-lg-2-24{
-width:8.3333%;
-}
-.pure-u-lg-1-8,.pure-u-lg-3-24{
-width:12.5%;
-}
-.pure-u-lg-1-6,.pure-u-lg-4-24{
-width:16.6667%;
-}
-.pure-u-lg-1-5{
-width:20%;
-}
-.pure-u-lg-5-24{
-width:20.8333%;
-}
-.pure-u-lg-1-4,.pure-u-lg-6-24{
-width:25%;
-}
-.pure-u-lg-7-24{
-width:29.1667%;
-}
-.pure-u-lg-1-3,.pure-u-lg-8-24{
-width:33.3333%;
-}
-.pure-u-lg-3-8,.pure-u-lg-9-24{
-width:37.5%;
-}
-.pure-u-lg-2-5{
-width:40%;
-}
-.pure-u-lg-10-24,.pure-u-lg-5-12{
-width:41.6667%;
-}
-.pure-u-lg-11-24{
-width:45.8333%;
-}
-.pure-u-lg-1-2,.pure-u-lg-12-24{
-width:50%;
-}
-.pure-u-lg-13-24{
-width:54.1667%;
-}
-.pure-u-lg-14-24,.pure-u-lg-7-12{
-width:58.3333%;
-}
-.pure-u-lg-3-5{
-width:60%;
-}
-.pure-u-lg-15-24,.pure-u-lg-5-8{
-width:62.5%;
-}
-.pure-u-lg-16-24,.pure-u-lg-2-3{
-width:66.6667%;
-}
-.pure-u-lg-17-24{
-width:70.8333%;
-}
-.pure-u-lg-18-24,.pure-u-lg-3-4{
-width:75%;
-}
-.pure-u-lg-19-24{
-width:79.1667%;
-}
-.pure-u-lg-4-5{
-width:80%;
-}
-.pure-u-lg-20-24,.pure-u-lg-5-6{
-width:83.3333%;
-}
-.pure-u-lg-21-24,.pure-u-lg-7-8{
-width:87.5%;
-}
-.pure-u-lg-11-12,.pure-u-lg-22-24{
-width:91.6667%;
-}
-.pure-u-lg-23-24{
-width:95.8333%;
-}
-.pure-u-lg-1,.pure-u-lg-1-1,.pure-u-lg-24-24,.pure-u-lg-5-5{
-width:100%;
-}
-}
-@media screen and (min-width:80em){
-.pure-u-xl-1,.pure-u-xl-1-1,.pure-u-xl-1-12,.pure-u-xl-1-2,.pure-u-xl-1-24,.pure-u-xl-1-3,.pure-u-xl-1-4,.pure-u-xl-1-5,.pure-u-xl-1-6,.pure-u-xl-1-8,.pure-u-xl-10-24,.pure-u-xl-11-12,.pure-u-xl-11-24,.pure-u-xl-12-24,.pure-u-xl-13-24,.pure-u-xl-14-24,.pure-u-xl-15-24,.pure-u-xl-16-24,.pure-u-xl-17-24,.pure-u-xl-18-24,.pure-u-xl-19-24,.pure-u-xl-2-24,.pure-u-xl-2-3,.pure-u-xl-2-5,.pure-u-xl-20-24,.pure-u-xl-21-24,.pure-u-xl-22-24,.pure-u-xl-23-24,.pure-u-xl-24-24,.pure-u-xl-3-24,.pure-u-xl-3-4,.pure-u-xl-3-5,.pure-u-xl-3-8,.pure-u-xl-4-24,.pure-u-xl-4-5,.pure-u-xl-5-12,.pure-u-xl-5-24,.pure-u-xl-5-5,.pure-u-xl-5-6,.pure-u-xl-5-8,.pure-u-xl-6-24,.pure-u-xl-7-12,.pure-u-xl-7-24,.pure-u-xl-7-8,.pure-u-xl-8-24,.pure-u-xl-9-24{
-display:inline-block;
-letter-spacing:normal;
-word-spacing:normal;
-vertical-align:top;
-text-rendering:auto;
-}
-.pure-u-xl-1-24{
-width:4.1667%;
-}
-.pure-u-xl-1-12,.pure-u-xl-2-24{
-width:8.3333%;
-}
-.pure-u-xl-1-8,.pure-u-xl-3-24{
-width:12.5%;
-}
-.pure-u-xl-1-6,.pure-u-xl-4-24{
-width:16.6667%;
-}
-.pure-u-xl-1-5{
-width:20%;
-}
-.pure-u-xl-5-24{
-width:20.8333%;
-}
-.pure-u-xl-1-4,.pure-u-xl-6-24{
-width:25%;
-}
-.pure-u-xl-7-24{
-width:29.1667%;
-}
-.pure-u-xl-1-3,.pure-u-xl-8-24{
-width:33.3333%;
-}
-.pure-u-xl-3-8,.pure-u-xl-9-24{
-width:37.5%;
-}
-.pure-u-xl-2-5{
-width:40%;
-}
-.pure-u-xl-10-24,.pure-u-xl-5-12{
-width:41.6667%;
-}
-.pure-u-xl-11-24{
-width:45.8333%;
-}
-.pure-u-xl-1-2,.pure-u-xl-12-24{
-width:50%;
-}
-.pure-u-xl-13-24{
-width:54.1667%;
-}
-.pure-u-xl-14-24,.pure-u-xl-7-12{
-width:58.3333%;
-}
-.pure-u-xl-3-5{
-width:60%;
-}
-.pure-u-xl-15-24,.pure-u-xl-5-8{
-width:62.5%;
-}
-.pure-u-xl-16-24,.pure-u-xl-2-3{
-width:66.6667%;
-}
-.pure-u-xl-17-24{
-width:70.8333%;
-}
-.pure-u-xl-18-24,.pure-u-xl-3-4{
-width:75%;
-}
-.pure-u-xl-19-24{
-width:79.1667%;
-}
-.pure-u-xl-4-5{
-width:80%;
-}
-.pure-u-xl-20-24,.pure-u-xl-5-6{
-width:83.3333%;
-}
-.pure-u-xl-21-24,.pure-u-xl-7-8{
-width:87.5%;
-}
-.pure-u-xl-11-12,.pure-u-xl-22-24{
-width:91.6667%;
-}
-.pure-u-xl-23-24{
-width:95.8333%;
-}
-.pure-u-xl-1,.pure-u-xl-1-1,.pure-u-xl-24-24,.pure-u-xl-5-5{
-width:100%;
-}
-}
-@media screen and (min-width:120em){
-.pure-u-xxl-1,.pure-u-xxl-1-1,.pure-u-xxl-1-12,.pure-u-xxl-1-2,.pure-u-xxl-1-24,.pure-u-xxl-1-3,.pure-u-xxl-1-4,.pure-u-xxl-1-5,.pure-u-xxl-1-6,.pure-u-xxl-1-8,.pure-u-xxl-10-24,.pure-u-xxl-11-12,.pure-u-xxl-11-24,.pure-u-xxl-12-24,.pure-u-xxl-13-24,.pure-u-xxl-14-24,.pure-u-xxl-15-24,.pure-u-xxl-16-24,.pure-u-xxl-17-24,.pure-u-xxl-18-24,.pure-u-xxl-19-24,.pure-u-xxl-2-24,.pure-u-xxl-2-3,.pure-u-xxl-2-5,.pure-u-xxl-20-24,.pure-u-xxl-21-24,.pure-u-xxl-22-24,.pure-u-xxl-23-24,.pure-u-xxl-24-24,.pure-u-xxl-3-24,.pure-u-xxl-3-4,.pure-u-xxl-3-5,.pure-u-xxl-3-8,.pure-u-xxl-4-24,.pure-u-xxl-4-5,.pure-u-xxl-5-12,.pure-u-xxl-5-24,.pure-u-xxl-5-5,.pure-u-xxl-5-6,.pure-u-xxl-5-8,.pure-u-xxl-6-24,.pure-u-xxl-7-12,.pure-u-xxl-7-24,.pure-u-xxl-7-8,.pure-u-xxl-8-24,.pure-u-xxl-9-24{
-display:inline-block;
-letter-spacing:normal;
-word-spacing:normal;
-vertical-align:top;
-text-rendering:auto;
-}
-.pure-u-xxl-1-24{
-width:4.1667%;
-}
-.pure-u-xxl-1-12,.pure-u-xxl-2-24{
-width:8.3333%;
-}
-.pure-u-xxl-1-8,.pure-u-xxl-3-24{
-width:12.5%;
-}
-.pure-u-xxl-1-6,.pure-u-xxl-4-24{
-width:16.6667%;
-}
-.pure-u-xxl-1-5{
-width:20%;
-}
-.pure-u-xxl-5-24{
-width:20.8333%;
-}
-.pure-u-xxl-1-4,.pure-u-xxl-6-24{
-width:25%;
-}
-.pure-u-xxl-7-24{
-width:29.1667%;
-}
-.pure-u-xxl-1-3,.pure-u-xxl-8-24{
-width:33.3333%;
-}
-.pure-u-xxl-3-8,.pure-u-xxl-9-24{
-width:37.5%;
-}
-.pure-u-xxl-2-5{
-width:40%;
-}
-.pure-u-xxl-10-24,.pure-u-xxl-5-12{
-width:41.6667%;
-}
-.pure-u-xxl-11-24{
-width:45.8333%;
-}
-.pure-u-xxl-1-2,.pure-u-xxl-12-24{
-width:50%;
-}
-.pure-u-xxl-13-24{
-width:54.1667%;
-}
-.pure-u-xxl-14-24,.pure-u-xxl-7-12{
-width:58.3333%;
-}
-.pure-u-xxl-3-5{
-width:60%;
-}
-.pure-u-xxl-15-24,.pure-u-xxl-5-8{
-width:62.5%;
-}
-.pure-u-xxl-16-24,.pure-u-xxl-2-3{
-width:66.6667%;
-}
-.pure-u-xxl-17-24{
-width:70.8333%;
-}
-.pure-u-xxl-18-24,.pure-u-xxl-3-4{
-width:75%;
-}
-.pure-u-xxl-19-24{
-width:79.1667%;
-}
-.pure-u-xxl-4-5{
-width:80%;
-}
-.pure-u-xxl-20-24,.pure-u-xxl-5-6{
-width:83.3333%;
-}
-.pure-u-xxl-21-24,.pure-u-xxl-7-8{
-width:87.5%;
-}
-.pure-u-xxl-11-12,.pure-u-xxl-22-24{
-width:91.6667%;
-}
-.pure-u-xxl-23-24{
-width:95.8333%;
-}
-.pure-u-xxl-1,.pure-u-xxl-1-1,.pure-u-xxl-24-24,.pure-u-xxl-5-5{
-width:100%;
-}
-}

+ 0 - 17
css/responsive-visibility-collapse.css

@@ -1,17 +0,0 @@
-.opt-md,.opt-lg,.opt-xl,.opt-xxl { display: none; }
-.opt-all,.opt-sm { display: table-cell; }
-@media screen and (min-width:35.5em){
-    .opt-all,.opt-sm { display: table-cell; }
-}
-@media screen and (min-width:40em){
-    .opt-all,.opt-sm,.opt-md { display: table-cell; }
-}
-@media screen and (min-width:64em){
-    .opt-all,.opt-sm,.opt-md,.opt-lg { display: table-cell; }
-}
-@media screen and (min-width:80em){
-    .opt-all,.opt-sm,.opt-md,.opt-lg,.opt-xl { display: table-cell; }
-}
-@media screen and (min-width:120em){
-    .opt-all,.opt-sm,.opt-md,.opt-lg,.opt-xl,.opt-xxl { display: table-cell; }
-}

+ 0 - 17
css/responsive-visibility.css

@@ -1,17 +0,0 @@
-.opt-md,.opt-lg,.opt-xl,.opt-xxl { display: none; }
-.opt-all,.opt-sm { display: block; }
-@media screen and (min-width:35.5em){
-    .opt-all,.opt-sm { display: block; }
-}
-@media screen and (min-width:40em){
-    .opt-all,.opt-sm,.opt-md { display: block; }
-}
-@media screen and (min-width:64em){
-    .opt-all,.opt-sm,.opt-md,.opt-lg { display: block; }
-}
-@media screen and (min-width:80em){
-    .opt-all,.opt-sm,.opt-md,.opt-lg,.opt-xl { display: block; }
-}
-@media screen and (min-width:120em){
-    .opt-all,.opt-sm,.opt-md,.opt-lg,.opt-xl,.opt-xxl { display: block; }
-}

+ 0 - 9
css/upload.css

@@ -1,9 +0,0 @@
-body .pure-g {
-    text-align: center
-}
-details svg, details img {
-    background-color: white
-}
-.row-cols-lg-2:has(.bg-yellow) {
-  justify-content: center;
-}

+ 0 - 68
forward_auth.py

@@ -1,68 +0,0 @@
-import cherrypy
-from bottle import (
-  default_app,
-  auth_basic,
-  HTTPError,
-  HTTPResponse,
-  route,
-  request,
-)
-from passlib.hash import bcrypt
-from hashes import users
-
-def basic_auth(user, password, realm=None):
-  return bcrypt.verify(password, users[realm][user])
-
-def verify_cert(pem):
-    return True
-
-def auth_client_cert(check):
-    def decorator(func):
-        def wrapper(*a, **ka):
-            if 'X-Forwarded-Tls-Client-Cert' in request.headers:
-                cert = request.headers['X-Forwarded-Tls-Client-Cert']
-            else:
-                cert = None
-            if cert and verify_cert(cert):
-                return HTTPResponse(status=200)
-            return func(*a, **ka)
-        return wrapper
-    return decorator
-
-def auth_basic(check, text="Access denied"):
-    ''' Callback decorator to require HTTP auth (basic).
-        TODO: Add route(check_auth=...) parameter. '''
-    def decorator(func):
-        def wrapper(*a, **ka):
-            realm = '.'.join(request.headers['X-Forwarded-Host'].split('.')[:-2])
-            user, password = request.auth or (None, None)
-            if realm in users and user in users[realm]:
-                if user is None or not check(user, password, realm=realm):
-                    err = HTTPError(401, text)
-                    err.add_header('WWW-Authenticate', 'Basic realm="%s"' % realm)
-                    return err
-            else:
-                err = HTTPError(401, f"User not found {realm}\{user}")
-                err.add_header('WWW-Authenticate', 'Basic realm="%s"' % realm)
-                return err
-            return func(*a, **ka)
-        return wrapper
-    return decorator
-
-@route('/authenticate')
-@auth_client_cert(verify_cert)
-@auth_basic(basic_auth)
-def auth():
-    return HTTPResponse(status=200)
-
-cherrypy.server.ssl_certificate = '/etc/private-ca/server-cert.pem'
-cherrypy.server.ssl_private_key = '/etc/private-ca/server-key.pem'
-
-cherrypy.config.update({
-    'server.socket_host': "0.0.0.0",
-    'server.socket_port': 1234,
-})
-
-cherrypy.tree.graft(default_app(), "/")
-cherrypy.engine.start()
-cherrypy.engine.block()

+ 0 - 5
home-sqlpage.json

@@ -1,5 +0,0 @@
-{
-  "max_database_pool_connections": 16,
-  "database_url": "sqlite://:memory:",
-  "compress_responses": false
-}

+ 0 - 94
home-sqlpage/index.sql

@@ -1,94 +0,0 @@
-SELECT 'shell' AS component
-, 'dark' AS theme
-, 'Portal' AS title
-, '/static/shandanone-small.png' AS favicon
-, '/static/shandanone2.png' AS image
-, (SELECT json_object(
-    'title', 'Utilities',
-    'icon', 'calculator',
-    'submenu', json_group_array(json_object(
-      'title', title,
-      'icon', icon,
-      'link', link
-    ))
-  )
-  FROM sqlpage_cards
-  WHERE grouping = 2) AS menu_item
-, (SELECT json_object(
-    'title', 'Apps',
-    'icon', 'apps',
-    'submenu', json_group_array(json_object(
-      'title', title,
-      'icon', icon,
-      'link', link
-    ))
-  )
-  FROM sqlpage_cards
-  WHERE grouping = 3) AS menu_item
-, (SELECT json_object(
-    'title', 'RSS',
-    'icon', 'rss',
-    'submenu', json_group_array(json_object(
-      'title', title,
-      'icon', 'file-rss',
-      'link', link
-    ))
-  )
-  FROM sqlpage_cards
-  WHERE grouping = 4) AS menu_item
-;
-
-SELECT 'text' AS component
-, '<style>
-.card-img-top:has(+ .bg-rss) {
-    width: 40%;
-    margin: 10% 50% 10% 10%;
-}
-.card-img-top {
-    width: 40%;
-    margin: 10% 30% 10% 30%;
-}
-/* make row-cols-sm-2 behave like row-cols-2 */
-@media (max-width: 500px) {
-  .row-cols-sm-2>* {
-    flex: 0 0 auto;
-    width: 50%
-  }
-}
-</style>' AS html
-;
-SELECT 'card' AS component
-, 4 AS columns
-;
-SELECT title
-, link
-, top_image
-, description_md
-, color
-FROM sqlpage_cards
-WHERE grouping = 2
-;
-SELECT 'divider' AS component;
-SELECT 'card' AS component
-, 4 AS columns
-;
-SELECT title
-, link
-, top_image
-, description_md
-, color
-FROM sqlpage_cards
-WHERE grouping = 3
-;
-SELECT 'divider' AS component;
-SELECT 'card' AS component
-, 4 AS columns
-;
-SELECT title
-, link
-, 'https://upload.wikimedia.org/wikipedia/en/thumb/4/43/Feed-icon.svg/128px-Feed-icon.svg.png' AS top_image
-, description_md
-, 'rss' AS color
-FROM sqlpage_cards
-WHERE grouping = 4
-;

+ 0 - 211
home-sqlpage/sqlpage/migrations/000_index.sql

@@ -1,211 +0,0 @@
-DROP TABLE IF EXISTS sqlpage_cards;
-CREATE TABLE IF NOT EXISTS sqlpage_cards (
-	link text,
-	title text,
-	top_image text,
-	description_md text,
-	color text,
-	grouping int,
-	icon text
-);
-INSERT INTO sqlpage_cards
-VALUES
-(
-	'/feed/news/rss.html',
-	'News Feed',
-	NULL,
-	'Notable events but not weather or sports',
-	NULL,
-	4,
-	NULL
-),
-(
-	'/feed/discovery/rss.html',
-	'Discovery Feed',
-	NULL,
-	'Cool and inspirational articles',
-	NULL,
-	4,
-	NULL
-),
-(
-	'/feed/humour/rss.html',
-	'Humour Feed',
-	NULL,
-	'Humourous articles, memes or anything funny',
-	NULL,
-	4,
-	NULL
-),
-(
-	'/clip?',
-	'Clipboard',
-	'https://shandan.one/static/clip/clip-favicon_square.svg',
-	'Paste snippets to share via tiny URL',
-	'green',
-	2,
-	'clipboard'
-),
-(
-	'/goto?',
-	'Short URL',
-	'https://shandan.one/static/goto/chain-link2fr-3-2.svg',
-	'Make long URLs shorter and easy to type and say',
-	'pinterest',
-	2,
-	'link'
-),
-(
-	'/upload?',
-	'Share a File',
-	'https://shandan.one/static/upload/upload-favicon_square.svg',
-	'Upload a file and generate a short URL to share easily',
-	'yellow',
-	2,
-	'cloud-share'
-),
-(
-	'/code?',
-	'Track Vouchers',
-	'https://shandan.one/static/code/qr.svg',
-	'Save scanned voucher codes to keep them handy and not forgotten',
-	'azure',
-	2,
-	'barcode'
-),
-(
-	'https://mealie.shandan.one/g/das',
-	'Recipes',
-	'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" class="v-icon__svg" style="font-size: 100px; height: 100px; width: 100px; fill: rgb(229, 131, 37)"><path d="M8.1,13.34L3.91,9.16C2.35,7.59 2.35,5.06 3.91,3.5L10.93,10.5L8.1,13.34M13.41,13L20.29,19.88L18.88,21.29L12,14.41L5.12,21.29L3.71,19.88L13.36,10.22L13.16,10C12.38,9.23 12.38,7.97 13.16,7.19L17.5,2.82L18.43,3.74L15.19,7L16.15,7.94L19.39,4.69L20.31,5.61L17.06,8.85L18,9.81L21.26,6.56L22.18,7.5L17.81,11.84C17.03,12.62 15.77,12.62 15,11.84L14.78,11.64L13.41,13Z"></path></svg>',
-	'Share recipes and meal plans',
-	'yellow',
-	3,
-	'tools-kitchen-2'
-),
-(
-	'https://shandan.one/grocery/internal/apply.sql?groups[]=Fish,%20Meat,%20Eggs&apply=Apply&title=Trend',
-	'Trending Prices',
-	'https://shandan.one/grocery/favicon_square.svg',
-	'Plot charts showing historic price data',
-	'youtube',
-	3,
-	'shopping-cart'
-),
-(
-	'https://cropswap.shandan.one/',
-	'Taupiri Crop Swap',
-	'https://cropswap.shandan.one/user/themes/quark/images/favicon.png',
-	'Local crop sharing community',
-	'lime',
-	3,
-	'plant'
-),
-(
-	'https://mail.cropswap.shandan.one/',
-	'Crop Swap Mail',
-	'https://www.mhonarc.org/MHonArc/logo/xmhastampw_t.png.pagespeed.ic.JEPpZUA3TZ.webp',
-	'Member mailing list',
-	'github',
-	3,
-	'mail'
-),
-(
-	NULL, --'https://wol.shandan.one?location=outside',
-	'Wake a Device',
-	'data:image/svg+xml,<svg  xmlns="http://www.w3.org/2000/svg"  width="24"  height="24"  viewBox="0 0 24 24"  fill="none"  stroke="rgb(205,57,57)"  stroke-width="2"  stroke-linecap="round"  stroke-linejoin="round"  class="icon icon-tabler icons-tabler-outline icon-tabler-power"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 6a7.75 7.75 0 1 0 10 0" /><path d="M12 4l0 8" /></svg>',
-	'Wake a device from [home](https://wol.shandan.one?location=home) or [outside](https://wol.shandan.one?location=outside)',
-	'red',
-	3,
-	'power'
-),
-(
-	'https://shandan.one/pgadmin4',
-	'pgAdmin',
-	'https://raw.githubusercontent.com/postgres/pgadmin4/c1ba645dceed5c9551a5f408e37a14d1041ee598/web/pgadmin/static/favicon.ico',
-	'Manage And access postgresql databases',
-	'azure',
-	3,
-	'database'
-),
-(
-	'https://shandan.one/guacamole',
-	'Guacamole',
-	'https://raw.githubusercontent.com/apache/guacamole-website/main/images/logos/guac-classic-logo.svg',
-	'Remote desktop',
-	'teal',
-	3,
-	'avocado'
-),
-(
-	'https://gogs.shandan.one',
-	'Gogs',
-	'https://gogs.shandan.one/img/favicon.png',
-	'Manage and access git repositories',
-	'yellow',
-	3,
-	'brand-git'
-),
-(
-	'https://syncthing.shandan.one',
-	'Syncthing',
-	'https://syncthing.net/img/logo-horizontal.svg',
-	'Monitor and configure file shares',
-	'blue',
-	3,
-	'topology-complex'
-),
-(
-	'https://shandan.one/wekan',
-	'WeKan',
-	'https://raw.githubusercontent.com/wekan/wekan/master/public/logo-header.png',
-	'Kanban board
-
-Manage projects and tasks',
-	'teal',
-	3,
-	'layout-kanban'
-),
-(
-	'https://mouse.shandan.one/#remote-mouse',
-	'Remote Touchpad',
-	'https://raw.githubusercontent.com/Unrud/remote-touchpad/master/webdata/icon.png',
-	'Use device as touchpad
-
-Turn your device''s touchscreen into a remote touchpad',
-	'github',
-	3,
-	'pointer'
-),
-(
-	'https://gateway.shandan.one',
-	'Gateway',
-	'https://gateway.shandan.one/favicon.ico?t=6dcc8b66',
-	'Access the gateway
-
-Manage local LAN and internet connection settings',
-	'cyan',
-	3,
-	'router'
-),
-(
-	'https://listgarden.shandan.one',
-	'ListGarden',
-	'https://www.wikicalc.org/images/listgardenlogo48.gif',
-	'Manage RSS Feeds
-
-Publish news items and create new feeds',
-	'green',
-	3,
-	'seeding'
-),
-(
-	'https://shandan.one/pyapi/random',
-	'Prayer Generator',
-	'',
-	'Generate a template prayer following the form of the model prayer outlined in Matthew&nbsp;6:9‑13 and Luke&nbsp;11:2‑4',
-	'orange',
-	3,
-	'pray'
-)
-;
-

+ 0 - 26
nginx.conf

@@ -1,26 +0,0 @@
-events {
-}
-http {
-  server {
-    root /usr/share/nginx/html;
-    location / {
-    }
-    location /feed/ {
-      autoindex on;
-    }
-    location /mail-archive/ {
-      autoindex on;
-    }
-    location /css/ {
-        types { } default_type "text/css; charset=utf-8";
-    }
-    location /media/ {
-    }
-    location /license/ {
-      charset UTF-8;
-      autoindex on;
-    }
-    location /.well-known/ {
-    }
-  }
-}

+ 0 - 3
requirements-auth.txt

@@ -1,3 +0,0 @@
-bottle
-cherrypy
-passlib

+ 0 - 25
robots.txt

@@ -1,25 +0,0 @@
-User-agent: *
-Disallow: /gogsadmin/*/commits/
-Disallow: /gogsadmin/*/src/
-Disallow: /.github/
-Disallow: /.phan/
-Disallow: /assets/
-Disallow: /backup/
-Disallow: /bin/
-Disallow: /cache/
-Disallow: /logs/
-Disallow: /system/
-Disallow: /tests/
-Disallow: /tmp/
-Disallow: /user/
-Disallow: /vendor/
-Disallow: /webserver-configs/
-Allow: /user/pages/
-Allow: /user/themes/
-Allow: /user/images/
-Allow: /
-Allow: /gogsadmin/
-Allow: /feed/
-Allow: *.css$
-Allow: *.js$
-Allow: /system/*.js$