Remove all user specific data into the config
This commit is contained in:
parent
1877d81ac7
commit
c663ef6d2a
7 changed files with 34 additions and 8 deletions
5
env/dev/resources/config.edn
vendored
5
env/dev/resources/config.edn
vendored
|
@ -6,4 +6,9 @@
|
||||||
:nrepl-port 7000
|
:nrepl-port 7000
|
||||||
|
|
||||||
:database-url "jdbc:sqlite:yenu_dev.db"
|
:database-url "jdbc:sqlite:yenu_dev.db"
|
||||||
|
|
||||||
|
:basepath "http://localhost"
|
||||||
|
:authors ["Aaron Fischer"]
|
||||||
|
|
||||||
|
:images_per_page 25
|
||||||
}
|
}
|
||||||
|
|
5
env/prod/resources/config.edn
vendored
5
env/prod/resources/config.edn
vendored
|
@ -4,4 +4,9 @@
|
||||||
:port 3000
|
:port 3000
|
||||||
|
|
||||||
:database-url "jdbc:sqlite:yenu.db"
|
:database-url "jdbc:sqlite:yenu.db"
|
||||||
|
|
||||||
|
:basepath "http://localhost"
|
||||||
|
:authors ["Aaron Fischer"]
|
||||||
|
|
||||||
|
:images_per_page 25
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,15 @@ UPDATE images
|
||||||
SET hash = :hash
|
SET hash = :hash
|
||||||
WHERE id = :id
|
WHERE id = :id
|
||||||
|
|
||||||
|
-- :name get-first-year :? :1
|
||||||
|
SELECT created_at FROM images
|
||||||
|
ORDER BY created_at ASC
|
||||||
|
LIMIT 1
|
||||||
|
|
||||||
|
-- :name get-recent-year :? :1
|
||||||
|
SELECT created_at FROM images
|
||||||
|
ORDER BY created_at DESC
|
||||||
|
LIMIT 1
|
||||||
|
|
||||||
-- :name create-tag! :i!
|
-- :name create-tag! :i!
|
||||||
INSERT OR IGNORE INTO tags (tagname)
|
INSERT OR IGNORE INTO tags (tagname)
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
<div class="col-md-12 text-right mt-4 mb-1 text-muted">
|
<div class="col-md-12 text-right mt-4 mb-1 text-muted">
|
||||||
<hr>
|
<hr>
|
||||||
<p>© 2013 - {% now yyyy %} Aaron & Beatrice Fischer</p>
|
<p>{{ footer }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% style "/assets/bootstrap/css/bootstrap.min.css" %}
|
{% style "/assets/bootstrap/css/bootstrap.min.css" %}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
[ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
|
[ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
|
||||||
[clj-time.format :as time-format]
|
[clj-time.format :as time-format]
|
||||||
[yenu.config :refer [env]]
|
[yenu.config :refer [env]]
|
||||||
|
[yenu.db.core :as db]
|
||||||
[digest :as digest]
|
[digest :as digest]
|
||||||
[clj-time.core :as time])
|
[clj-time.core :as time])
|
||||||
(:use [markdown.core]))
|
(:use [markdown.core]))
|
||||||
|
@ -20,6 +21,12 @@
|
||||||
(filter/add-filter! :markdown-to-html md-to-html-string)
|
(filter/add-filter! :markdown-to-html md-to-html-string)
|
||||||
(filter/add-filter! :parse-date #(time/to-time-zone (time-format/parse %) (time/default-time-zone)))
|
(filter/add-filter! :parse-date #(time/to-time-zone (time-format/parse %) (time/default-time-zone)))
|
||||||
|
|
||||||
|
(defn footer []
|
||||||
|
(let [first-year (subs (:created_at (db/get-first-year)) 0 4)
|
||||||
|
recent-year (subs (:created_at (db/get-recent-year)) 0 4)
|
||||||
|
copy (if (= first-year recent-year) first-year (str first-year " - " recent-year))]
|
||||||
|
(str "© " copy " " (clojure.string/join ", " (:authors env)))))
|
||||||
|
|
||||||
(defn render-file [template & [params]]
|
(defn render-file [template & [params]]
|
||||||
(content-type
|
(content-type
|
||||||
(ok
|
(ok
|
||||||
|
@ -27,6 +34,7 @@
|
||||||
template
|
template
|
||||||
(assoc params
|
(assoc params
|
||||||
:page template
|
:page template
|
||||||
|
:footer (footer)
|
||||||
:csrf-token *anti-forgery-token*
|
:csrf-token *anti-forgery-token*
|
||||||
:servlet-context *app-context*
|
:servlet-context *app-context*
|
||||||
:passwordhash (digest/md5 (:user-password env))
|
:passwordhash (digest/md5 (:user-password env))
|
||||||
|
|
|
@ -15,16 +15,15 @@
|
||||||
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
|
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
|
||||||
(h/html
|
(h/html
|
||||||
[:feed {:xmlns "http://www.w3.org/2005/Atom"}
|
[:feed {:xmlns "http://www.w3.org/2005/Atom"}
|
||||||
[:author [:name "Aaron Fischer"]]
|
(for [a (:authors env)] [:author [:name a]])
|
||||||
[:author [:name "Beatrice Fischer"]]
|
|
||||||
[:title "yenu -- the image sharing tool for friends"]
|
[:title "yenu -- the image sharing tool for friends"]
|
||||||
[:id (str "https://yenu.de/")]
|
[:id (str (:basepath env))]
|
||||||
[:updated (with-ts (:created_at (first entries)))]
|
[:updated (with-ts (:created_at (first entries)))]
|
||||||
(for [e entries]
|
(for [e entries]
|
||||||
[:entry
|
[:entry
|
||||||
[:title (h/h (:title e))]
|
[:title (h/h (:title e))]
|
||||||
[:link {:href (str "https://yenu.de/show/" (:id e)) :rel "alternate"}]
|
[:link {:href (str (:basepath env) "/show/" (:id e)) :rel "alternate"}]
|
||||||
[:id (str "https://yenu.de/show/" (:id e))]
|
[:id (str (:basepath env) "/show/" (:id e))]
|
||||||
[:updated (with-ts (:created_at e))]
|
[:updated (with-ts (:created_at e))]
|
||||||
[:summary (h/h (:title e))]
|
[:summary (h/h (:title e))]
|
||||||
[:content {:type "xhtml"}
|
[:content {:type "xhtml"}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
domain=localhost
|
basepath=http://localhost
|
||||||
port=3000
|
port=3000
|
||||||
|
|
||||||
# Passwords
|
# Passwords
|
||||||
|
@ -7,4 +7,4 @@ creator-password=creator
|
||||||
|
|
||||||
# Content stuff
|
# Content stuff
|
||||||
images_per_page=25
|
images_per_page=25
|
||||||
footer=© 2013 - 2017 Aaron & Beatrice Fischer
|
authors=Aaron Fischer,Beatrice Fischer
|
||||||
|
|
Loading…
Reference in a new issue