From fea01028d97dd8a11673912fd0c6f1453c34adad Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Wed, 24 Nov 2021 19:45:29 +0800 Subject: Clean up repo structure This makes the repo easily deployable. --- bookmarks/giveback.bookmark | 1 + bookmarks/takeaway.bookmark | 1 + config.toml | 40 ++++++++++++++++++++++++++++++++++++++++ db/umbrellas.csv | 20 ++++++++++++++++++++ db/users.csv | 1 + jimbrella.db.csv | 20 -------------------- logs/admin.log | 0 logs/app.log | 0 8 files changed, 63 insertions(+), 20 deletions(-) create mode 100644 bookmarks/giveback.bookmark create mode 100644 bookmarks/takeaway.bookmark create mode 100644 config.toml create mode 100644 db/umbrellas.csv create mode 100644 db/users.csv delete mode 100644 jimbrella.db.csv create mode 100644 logs/admin.log create mode 100644 logs/app.log diff --git a/bookmarks/giveback.bookmark b/bookmarks/giveback.bookmark new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/bookmarks/giveback.bookmark @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/bookmarks/takeaway.bookmark b/bookmarks/takeaway.bookmark new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/bookmarks/takeaway.bookmark @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..b38abdc --- /dev/null +++ b/config.toml @@ -0,0 +1,40 @@ +jimbrella_dir = "/opt/jimbrella" + +[flask] +# For Flask sessions. Will be used to encrypt and decrypt user's cookies. +# It is VERY important that this be long, random, and unique. +# Learn how to generate one: https://flask.palletsprojects.com/en/2.0.x/config/#SECRET_KEY +secret_key = "" + +# Where Flask should find your template (HTML) and static files +template_dir = "jimbrella/templates" +static_dir = "jimbrella/static" + +[user] +# Whether or not users can create new accounts +accept_new_users = false + +[jform] +# URLs to jForm's JSON API (no authentication, one URL per questionnaire) +takeaway_url = "https://wj.sjtu.edu.cn/api/v1/public/export/0123456789abcdef0123456789abcdef/json" +giveback_url = "https://wj.sjtu.edu.cn/api/v1/public/export/fedcba9876543210fedcba9876543210/json" + +# The directory under which JImbrella stores and reads "bookmarks" +# (IDs of the lastest read jForm answer sheet) +bookmark_dir = "bookmarks" + +[db] +# JImbrella Databases +db_path = "db/umbrellas.csv" +users_path = "db/users.csv" + +[rules] +# How many hours a tenant can keep an umbrella +due_hours = 72 + +[logging] +# JImbrella app log: Flask, Werkzeug, etc. Not read by JImbrella. +log_path = "logs/app.log" +# JImbrella admin log: events useful for an admin. +# Read by JImbrella per admin's requirement on web interface. +admin_log_path = "logs/admin.log" diff --git a/db/umbrellas.csv b/db/umbrellas.csv new file mode 100644 index 0000000..7e0b2a3 --- /dev/null +++ b/db/umbrellas.csv @@ -0,0 +1,20 @@ +1,,available,,,,, +2,,available,,,,, +3,,available,,,,, +4,,available,,,,, +5,,available,,,,, +6,,available,,,,, +7,,available,,,,, +8,,available,,,,, +9,,available,,,,, +10,,available,,,,, +11,,available,,,,, +12,,available,,,,, +13,,available,,,,, +14,,available,,,,, +15,,available,,,,, +16,,available,,,,, +17,,available,,,,, +18,,available,,,,, +19,,available,,,,, +20,,available,,,,, diff --git a/db/users.csv b/db/users.csv new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/db/users.csv @@ -0,0 +1 @@ + diff --git a/jimbrella.db.csv b/jimbrella.db.csv deleted file mode 100644 index a57790a..0000000 --- a/jimbrella.db.csv +++ /dev/null @@ -1,20 +0,0 @@ -1,,available,,,,, -2,,lent,Jim Brella,1337,10086,,2021-10-19T09:35:30 -3,,available,,,,, -4,,overdue,Big Chungus,420,10001,,1970-01-01T00:00:01 -5,,available,,,,, -6,,available,,,,, -7,,available,,,,, -8,,available,,,,, -9,,available,,,,, -10,,available,,,,, -11,,available,,,,, -12,,available,,,,, -13,,available,,,,, -14,,available,,,,, -15,,available,,,,, -16,,available,,,,, -17,,available,,,,, -18,,available,,,,, -19,,available,,,,, -20,,available,,,,, diff --git a/logs/admin.log b/logs/admin.log new file mode 100644 index 0000000..e69de29 diff --git a/logs/app.log b/logs/app.log new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3