aboutsummaryrefslogtreecommitdiffstats
path: root/www/inks/patches
diff options
context:
space:
mode:
Diffstat (limited to 'www/inks/patches')
-rw-r--r--www/inks/patches/patch-inks_go44
-rw-r--r--www/inks/patches/patch-inks_go.orig62
-rw-r--r--www/inks/patches/patch-util_go12
3 files changed, 118 insertions, 0 deletions
diff --git a/www/inks/patches/patch-inks_go b/www/inks/patches/patch-inks_go
new file mode 100644
index 0000000..216ed18
--- /dev/null
+++ b/www/inks/patches/patch-inks_go
@@ -0,0 +1,44 @@
+Index: inks.go
+--- inks.go.orig
++++ inks.go
+@@ -44,7 +44,7 @@ var tagName = "inks,2019"
+
+ func getInfo(r *http.Request) map[string]interface{} {
+ templinfo := make(map[string]interface{})
+- templinfo["StyleParam"] = getstyleparam("views/style.css")
++ templinfo["StyleParam"] = getstyleparam("${TRUEPREFIX}/share/${PKGSTEM}/views/style.css")
+ templinfo["UserInfo"] = login.GetUserInfo(r)
+ templinfo["LogoutCSRF"] = login.GetCSRF("logout", r)
+ templinfo["ServerName"] = serverName
+@@ -474,7 +474,7 @@ func showrandomrss(w http.ResponseWriter, r *http.Requ
+
+ func servecss(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Cache-Control", "max-age=7776000")
+- http.ServeFile(w, r, "views"+r.URL.Path)
++ http.ServeFile(w, r, "${TRUEPREFIX}/share/${PKGSTEM}/views"+r.URL.Path)
+ }
+ func servehtml(w http.ResponseWriter, r *http.Request) {
+ templinfo := getInfo(r)
+@@ -569,15 +569,15 @@ func serve() {
+ getconfig("debug", &debug)
+
+ readviews = templates.Load(debug,
+- "views/header.html",
+- "views/inks.html",
+- "views/tags.html",
+- "views/addlink.html",
+- "views/sources.html",
+- "views/login.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/header.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/inks.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/tags.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/addlink.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/sources.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/login.html",
+ )
+ if !debug {
+- s := "views/style.css"
++ s := "${TRUEPREFIX}/share/${PKGSTEM}/views/style.css"
+ savedstyleparams[s] = getstyleparam(s)
+
+ }
diff --git a/www/inks/patches/patch-inks_go.orig b/www/inks/patches/patch-inks_go.orig
new file mode 100644
index 0000000..2fe69ee
--- /dev/null
+++ b/www/inks/patches/patch-inks_go.orig
@@ -0,0 +1,62 @@
+Index: inks.go
+--- inks.go.orig
++++ inks.go
+@@ -44,7 +44,7 @@ var tagName = "inks,2019"
+
+ func getInfo(r *http.Request) map[string]interface{} {
+ templinfo := make(map[string]interface{})
+- templinfo["StyleParam"] = getstyleparam("views/style.css")
++ templinfo["StyleParam"] = getstyleparam("${TRUEPREFIX}/share/${PKGSTEM}/views/style.css")
+ templinfo["UserInfo"] = login.GetUserInfo(r)
+ templinfo["LogoutCSRF"] = login.GetCSRF("logout", r)
+ templinfo["ServerName"] = serverName
+@@ -323,7 +323,7 @@ func showtags(w http.ResponseWriter, r *http.Request)
+ w.Header().Set("Cache-Control", "max-age=300")
+ }
+
+- err := readviews.Execute(w, "tags.html", templinfo)
++ err := readviews.Execute(w, "$tags.html", templinfo)
+ if err != nil {
+ log.Printf("error templating inks: %s", err)
+ }
+@@ -381,7 +381,7 @@ func showsources(w http.ResponseWriter, r *http.Reques
+ templinfo := getInfo(r)
+ templinfo["SaveCSRF"] = login.GetCSRF("savesource", r)
+ templinfo["Sources"] = getsources()
+- err := readviews.Execute(w, "sources.html", templinfo)
++ err := readviews.Execute(w, "$sources.html", templinfo)
+ if err != nil {
+ log.Print(err)
+ }
+@@ -474,7 +474,7 @@ func showrandomrss(w http.ResponseWriter, r *http.Requ
+
+ func servecss(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Cache-Control", "max-age=7776000")
+- http.ServeFile(w, r, "views"+r.URL.Path)
++ http.ServeFile(w, r, "${are/${PKGSTEM}/views"+r.URL.Path)
+ }
+ func servehtml(w http.ResponseWriter, r *http.Request) {
+ templinfo := getInfo(r)
+@@ -569,15 +569,15 @@ func serve() {
+ getconfig("debug", &debug)
+
+ readviews = templates.Load(debug,
+- "views/header.html",
+- "views/inks.html",
+- "views/tags.html",
+- "views/addlink.html",
+- "views/sources.html",
+- "views/login.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/header.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/inks.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/tags.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/addlink.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/sources.html",
++ "${TRUEPREFIX}/share/${PKGSTEM}/views/login.html",
+ )
+ if !debug {
+- s := "views/style.css"
++ s := "${TRUEPREFIX}/share/${PKGSTEM}/views/style.css"
+ savedstyleparams[s] = getstyleparam(s)
+
+ }
diff --git a/www/inks/patches/patch-util_go b/www/inks/patches/patch-util_go
new file mode 100644
index 0000000..b3cd374
--- /dev/null
+++ b/www/inks/patches/patch-util_go
@@ -0,0 +1,12 @@
+Index: util.go
+--- util.go.orig
++++ util.go
+@@ -74,7 +74,7 @@ var dbname = "inks.db"
+ var stmtConfig *sql.Stmt
+
+ func initdb() {
+- schema, err := ioutil.ReadFile("schema.sql")
++ schema, err := ioutil.ReadFile("${TRUEPREFIX}/share/${PKGSTEM}/schema.sql")
+ if err != nil {
+ log.Fatal(err)
+ }