From a805f3ccc5e05e1bcdce45dcaff6c1ee37a10d44 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sun, 20 Sep 2020 14:24:57 +0100 Subject: [PATCH] Getting the database back to life (dodgy, will probably revert) --- README.md | 3 +-- env/dev/clj/user.clj | 2 +- resources/public/img/map-pins/basic_map_pin.png | Bin 333 -> 0 bytes src/clj/youyesyet/db/core.clj | 3 ++- src/clj/youyesyet/middleware.clj | 2 ++ src/clj/youyesyet/routes/home.clj | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 resources/public/img/map-pins/basic_map_pin.png diff --git a/README.md b/README.md index 714542e..68bf64b 100644 --- a/README.md +++ b/README.md @@ -187,5 +187,4 @@ Copyright © 2016 Simon Brooke for the Radical Independence Campaign. Licensed under the GNU General Public License, version 2.0 or (at your option) any later version. **NOTE THAT** files which are directly created by the Luminus template do not currently have a GPL header -at the top; files which are new in this project or which have been substantially modified for this project -do have a GPL header at the top. +at the top; files which are new in this project or which have been substantially modified for this project should have a GPL header at the top. diff --git a/env/dev/clj/user.clj b/env/dev/clj/user.clj index 97cb362..33da5ed 100644 --- a/env/dev/clj/user.clj +++ b/env/dev/clj/user.clj @@ -30,6 +30,6 @@ (.bind "java:comp/env/jdbc/testdb" (doto (org.postgresql.ds.PGSimpleDataSource.) (.setServerName "localhost") - (.setDatabaseName "youyesyet_dev") + (.setDatabaseName "loriner") ;; "youyesyet_dev") (.setUser "youyesyet") (.setPassword "thisisnotsecure")))) diff --git a/resources/public/img/map-pins/basic_map_pin.png b/resources/public/img/map-pins/basic_map_pin.png deleted file mode 100644 index c14e0be0f54cafc0a1cc8fe4a7e8c753b8f86e52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 333 zcmeAS@N?(olHy`uVBq!ia0vp^3P7yI!3HERJ&c?Lq*#ibJVQ8upoSx*1IXtr@Q5sC zU|_rf!i>LSmK6a7B}-f*N`mv#O3D+9QW?t2%k?tzvWt@w3sUv+i_&MmvylQSk_9OW z$t=l9WpGL?&P-M)$jnnn%P&$0PEO5B^++vBU1m8?8mLehq|mXnBqP6wAviNPKTpA_ zC_g_twJ)*rCQ#ZEB<+$~oLrPyP?DLS$H2wO2{AAwH7&6;r$iw)u>fQ^P+TP_wJft3 zsK`peP|rv~g^N?>!s+8cL&QLaI2WZRf=o~d$;?eEaj? q(falvBO{R4r0{=zo`(a7$*@OSREvReO3jarAfBhIpUXO@geCxOh+q%^ diff --git a/src/clj/youyesyet/db/core.clj b/src/clj/youyesyet/db/core.clj index cb5980b..f28b3fe 100644 --- a/src/clj/youyesyet/db/core.clj +++ b/src/clj/youyesyet/db/core.clj @@ -22,7 +22,8 @@ "Primary connection to the main database. TODO: this does not yet enable sharding." :start (conman/connect! {:jdbc-url-env (env :database-url) - :jdbc-url "jdbc:postgresql://127.0.0.1/youyesyet_dev?user=youyesyet&password=thisisnotsecure" + ;; :jdbc-url "jdbc:postgresql://127.0.0.1/youyesyet_dev?user=youyesyet&password=thisisnotsecure" + :jdbc-url "jdbc:postgresql://127.0.0.1/loriner?user=youyesyet&password=thisisnotsecure" :driver-class-name "org.postgresql.Driver"}) :stop (conman/disconnect! *db*)) diff --git a/src/clj/youyesyet/middleware.clj b/src/clj/youyesyet/middleware.clj index 763dea3..4101ab1 100644 --- a/src/clj/youyesyet/middleware.clj +++ b/src/clj/youyesyet/middleware.clj @@ -2,6 +2,7 @@ youyesyet.middleware (:require [clojure.tools.logging :as log] [ring.middleware.anti-forgery :refer [wrap-anti-forgery]] + [ring.middleware.content-type :refer [wrap-content-type]] [ring.middleware.defaults :refer [site-defaults wrap-defaults]] [ring.middleware.format :refer [wrap-restful-format]] [ring.middleware.webjars :refer [wrap-webjars]] @@ -83,5 +84,6 @@ (assoc-in [:security :anti-forgery] false) (assoc-in [:session :store] (ttl-memory-store (* 60 30))))) wrap-context + wrap-content-type wrap-internal-error)) diff --git a/src/clj/youyesyet/routes/home.clj b/src/clj/youyesyet/routes/home.clj index 2f37538..251b7fe 100644 --- a/src/clj/youyesyet/routes/home.clj +++ b/src/clj/youyesyet/routes/home.clj @@ -112,7 +112,7 @@ :redirect-to redirect-to :warnings ["Your user name was not recognised or your password did not match"]}) ;; if we've no username, just invite the user to log in - true + :else (layout/render "login.html" {:title "Please log in"