Permalink
Browse files

free up arc filename for better uses

Also replace all the literal uses of "arc/" with the global constant
provided for this purpose.
  • Loading branch information...
akkartik committed Jun 26, 2014
1 parent 976b4b6 commit 510419a58439ee01771eca8cf3e86d3610d21c34
Showing with 15 additions and 15 deletions.
  1. +5 −5 lib/app.arc
  2. +1 −1 lib/blog.arc
  3. +5 −5 lib/news.arc
  4. +1 −1 lib/prompt.arc
  5. +3 −3 lib/srv.arc
View
@@ -6,11 +6,11 @@
; A user is simply a string: "pg". Use /whoami to test user cookie.
(= hpwfile* "arc/hpw"
emailfile* "arc/emails"
oidfile* "arc/openids"
adminfile* "arc/admins"
cookfile* "arc/cooks")
(= hpwfile* (+ srvdir* "hpw")
emailfile* (+ srvdir* "emails")
oidfile* (+ srvdir* "openids")
adminfile* (+ srvdir* "admins")
cookfile* (+ srvdir* "cooks"))
(def asv ((o port 8080))
(load-userinfo)
View
@@ -5,7 +5,7 @@
; arc> (bsv)
; go to http://localhost:8080/blog
(= postdir* "arc/posts/" maxid* 0 posts* (table))
(= postdir* (+ srvdir* "posts/") maxid* 0 posts* (table))
(= blogtitle* "A Blog")
View
@@ -70,17 +70,17 @@
; Load and Save
(= newsdir* "arc/news/"
storydir* "arc/news/story/"
profdir* "arc/news/profile/"
votedir* "arc/news/vote/")
(= newsdir* (+ srvdir* "news/")
storydir* (+ srvdir* "news/story/")
profdir* (+ srvdir* "news/profile/")
votedir* (+ srvdir* "news/vote/"))
(= votes* (table) profs* (table))
(= initload-users* nil)
(def nsv ((o port 8080))
(map ensure-dir (list arcdir* newsdir* storydir* votedir* profdir*))
(map ensure-dir (list srvdir* newsdir* storydir* votedir* profdir*))
(unless stories* (load-items))
(if (and initload-users* (empty profs*)) (load-users))
(asv port))
View
@@ -1,6 +1,6 @@
; Prompt: Web-based programming application. 4 Aug 06.
(= appdir* "arc/apps/")
(= appdir* (+ srvdir* "apps/"))
(defop prompt req
(let user (get-user req)
View
@@ -5,7 +5,7 @@
; http requests currently capped to upload-limit* bytes
; see socket-accept
(= arcdir* "arc/" logdir* "arc/logs/" staticdir* "static/")
(= srvdir* "www/" logdir* (+ srvdir* "logs/") staticdir* "static/")
(= quitsrv* nil breaksrv* nil)
@@ -26,7 +26,7 @@
(w/socket s port (serve-socket s t)))
(def ensure-srvdirs ()
(map ensure-dir (list arcdir* logdir* staticdir*)))
(map ensure-dir (list srvdir* logdir* staticdir*)))
(def serve-socket (s breaksrv)
(if breaksrv
@@ -236,7 +236,7 @@
;; basic auth for private websites
; to enable, provide a single common user:pass in the clear for all users in this file:
(= private-credentials* (errsafe:string:fromfile (+ arcdir* "/private-credentials") (read)))
(= private-credentials* (errsafe:string:fromfile (+ srvdir* "/private-credentials") (read)))
(def authorized? (req)
(or no.private-credentials*

0 comments on commit 510419a

Please sign in to comment.