Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 74ef4ec

Browse files
committed
infra: update starter and don't fixup precache
1 parent c2de30f commit 74ef4ec

File tree

2 files changed

+98
-110
lines changed

2 files changed

+98
-110
lines changed

infra/handler/src/DeckGo/Handler.hs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import Data.Aeson ((.=), (.:), (.!=), (.:?))
3838
import Data.Bifunctor
3939
import Data.Char
4040
import Data.Int
41-
import Data.List (find, isPrefixOf, isSuffixOf)
41+
import Data.List (find)
4242
import Data.List (foldl')
4343
import Data.Maybe
4444
import Data.Proxy
@@ -1251,20 +1251,12 @@ withPresentationFiles uname psname presentationInfo act = do
12511251
-- service-worker.js.
12521252

12531253
oldIndexMd5 <- fileETag $ dir </> "index.html"
1254-
precacheFile <- findPrecache dir >>= \case
1255-
Nothing -> error "No precache manifest!"
1256-
Just n -> pure n
1257-
oldPrecacheMd5 <- fileETag $ dir </> precacheFile
1254+
let serviceWorkerFile = dir </> "service-worker.js"
12581255
mapFile processIndex $ dir </> "index.html"
12591256
newIndexMd5 <- fileETag $ dir </> "index.html"
12601257
putStrLn $ "Changing index.html MD5 from " <>
12611258
show oldIndexMd5 <> " to " <> show newIndexMd5
1262-
mapFile (T.replace oldIndexMd5 newIndexMd5) $ dir </> precacheFile
1263-
newPrecacheMd5 <- fileETag $ dir </> precacheFile
1264-
let newPrecacheFile = ("precache-manifest." <> T.unpack newPrecacheMd5 <> ".js")
1265-
putStrLn $ "replacing " <> precacheFile <> " with " <> newPrecacheFile
1266-
Dir.renameFile (dir </> precacheFile) $ dir </> newPrecacheFile
1267-
mapFile (T.replace oldPrecacheMd5 newPrecacheMd5) $ dir </> "service-worker.js"
1259+
mapFile (T.replace oldIndexMd5 newIndexMd5) $ dir </> serviceWorkerFile
12681260

12691261
mapFile interpol $ dir </> "manifest.json"
12701262
putStrLn "Listing files..."
@@ -1298,10 +1290,6 @@ withPresentationFiles uname psname presentationInfo act = do
12981290
("/" <> unPresentationPrefix (presentationPrefix uname psname)) .
12991291
T.replace "{{DECKDECKGO_HEAD_EXTRA}}"
13001292
(fromMaybe "" (presentationHeadExtra presentationInfo))
1301-
findPrecache dir = find isPrecache <$> Dir.listDirectory dir
1302-
isPrecache n =
1303-
"precache-manifest." `isPrefixOf` n &&
1304-
".js" `isSuffixOf` n
13051293

13061294
sha256digest :: T.Text -> T.Text
13071295
sha256digest =

infra/nix/sources.json

Lines changed: 95 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,97 @@
11
{
2-
"deckdeckgo-starter": {
3-
"branch": "studio",
4-
"description": "The Progressive Web App alternative for simple presentations",
5-
"homepage": "https://deckdeckgo.com",
6-
"owner": "deckgo",
7-
"repo": "deckdeckgo-starter",
8-
"rev": "097275e0d46ed6294300c9e9b45cfe415ed26dee",
9-
"sha256": "1j08vr4z1f1zyg7rz7xsi4829j68x0c39bmizkzc31i1lk7xv2n6",
10-
"type": "tarball",
11-
"url": "https://github.com/deckgo/deckdeckgo-starter/archive/097275e0d46ed6294300c9e9b45cfe415ed26dee.tar.gz",
12-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13-
},
14-
"elasticmq": {
15-
"sha256": "1cp2pmkc6gx7gr6109jlcphlky5rr6s1wj528r6hyhzdc01sjhhz",
16-
"type": "file",
17-
"url": "https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.14.6.jar",
18-
"url_template": "https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.14.6.jar"
19-
},
20-
"hs-jose": {
21-
"branch": "master",
22-
"description": "Haskell JOSE and JWT library",
23-
"homepage": "http://hackage.haskell.org/package/jose",
24-
"owner": "frasertweedale",
25-
"repo": "hs-jose",
26-
"rev": "71274bf64c0600c1d877152173a08a5bff7adf4d",
27-
"sha256": "0ah189vika1s0jk8f17mn77gilkw24vbs6xlggxw1qj926i6c4pk",
28-
"type": "tarball",
29-
"url": "https://github.com/frasertweedale/hs-jose/archive/71274bf64c0600c1d877152173a08a5bff7adf4d.tar.gz",
30-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
31-
},
32-
"napalm": {
33-
"branch": "master",
34-
"description": "Support for building npm packages in Nix and lightweight npm registry",
35-
"homepage": "",
36-
"owner": "nmattia",
37-
"repo": "napalm",
38-
"rev": "0331a5b586a186c966f816d434bd5c1ecfa16089",
39-
"sha256": "14nlqmmv3xx4cf3r9kcw2xbfgpddppw27ygp8s3r0bbccgwcp9gi",
40-
"type": "tarball",
41-
"url": "https://github.com/nmattia/napalm/archive/0331a5b586a186c966f816d434bd5c1ecfa16089.tar.gz",
42-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
43-
},
44-
"niv": {
45-
"branch": "master",
46-
"description": "Easy dependency management for Nix projects",
47-
"homepage": "https://github.com/nmattia/niv",
48-
"owner": "nmattia",
49-
"repo": "niv",
50-
"rev": "c2698b0780b783880e0b1a520723948fe3b5c26a",
51-
"sha256": "0v68x0h9si6kjqg5fcjrgsbsf4x18m32a786yvjmrdkrki9qwmcq",
52-
"type": "tarball",
53-
"url": "https://github.com/nmattia/niv/archive/c2698b0780b783880e0b1a520723948fe3b5c26a.tar.gz",
54-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
55-
},
56-
"nixpkgs": {
57-
"branch": "master",
58-
"description": "Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels",
59-
"homepage": null,
60-
"owner": "nh2",
61-
"repo": "nixpkgs",
62-
"rev": "a2d7e9b875e8ba7fd15b989cf2d80be4e183dc72",
63-
"sha256": "1hnmp637r99qd6g0sbx4w3za564gbzwl5c4z0x7fvn7kfi2jp1hx",
64-
"type": "tarball",
65-
"url": "https://github.com/nh2/nixpkgs/archive/a2d7e9b875e8ba7fd15b989cf2d80be4e183dc72.tar.gz",
66-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
67-
},
68-
"port-utils": {
69-
"sha256": "1vfmm8mmkmfffgza64h6qz4ibniibqdr8mj452ikp1xmvv6m8qm9",
70-
"type": "tarball",
71-
"url": "http://hackage.haskell.org/package/port-utils-0.2.1.0/port-utils-0.2.1.0.tar.gz",
72-
"url_template": "http://hackage.haskell.org/package/port-utils-0.2.1.0/port-utils-0.2.1.0.tar.gz"
73-
},
74-
"static-haskell-nix": {
75-
"branch": "master",
76-
"description": "easily build most Haskell programs into fully static Linux executables",
77-
"homepage": "",
78-
"owner": "nh2",
79-
"repo": "static-haskell-nix",
80-
"rev": "8d004d7ced9da947c785b93b4011f39367442339",
81-
"sha256": "0nw4g23c5rs0cvaar2phpr60zim9r0qycznpifi8d8k85y4r3bdd",
82-
"type": "tarball",
83-
"url": "https://github.com/nh2/static-haskell-nix/archive/8d004d7ced9da947c785b93b4011f39367442339.tar.gz",
84-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
85-
},
86-
"wai-lambda": {
87-
"branch": "master",
88-
"description": "Haskell Webapps on AWS Lambda",
89-
"owner": "deckgo",
90-
"repo": "wai-lambda",
91-
"rev": "7f139047addff89e9d30e55b7eebb07c0e846456",
92-
"sha256": "0qqi6wlg8v35dkh6gh9mrj0kb9kpzrz2pc7k0dykk2ahcj6m22k6",
93-
"type": "tarball",
94-
"url": "https://github.com/deckgo/wai-lambda/archive/7f139047addff89e9d30e55b7eebb07c0e846456.tar.gz",
95-
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
96-
}
2+
"deckdeckgo-starter": {
3+
"branch": "studio",
4+
"description": "The Progressive Web App alternative for simple presentations",
5+
"homepage": "https://deckdeckgo.com",
6+
"owner": "deckgo",
7+
"repo": "deckdeckgo-starter",
8+
"rev": "5698b9d2bd8e05ccb8715bdab7d6113ff5e76e76",
9+
"sha256": "1w88yjjwj87fk3bawn9b437wz7523qq2b1gp45dw055wclfpyxa7",
10+
"type": "tarball",
11+
"url": "https://github.com/deckgo/deckdeckgo-starter/archive/5698b9d2bd8e05ccb8715bdab7d6113ff5e76e76.tar.gz",
12+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13+
},
14+
"elasticmq": {
15+
"sha256": "1cp2pmkc6gx7gr6109jlcphlky5rr6s1wj528r6hyhzdc01sjhhz",
16+
"type": "file",
17+
"url": "https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.14.6.jar",
18+
"url_template": "https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.14.6.jar"
19+
},
20+
"hs-jose": {
21+
"branch": "master",
22+
"description": "Haskell JOSE and JWT library",
23+
"homepage": "http://hackage.haskell.org/package/jose",
24+
"owner": "frasertweedale",
25+
"repo": "hs-jose",
26+
"rev": "71274bf64c0600c1d877152173a08a5bff7adf4d",
27+
"sha256": "0ah189vika1s0jk8f17mn77gilkw24vbs6xlggxw1qj926i6c4pk",
28+
"type": "tarball",
29+
"url": "https://github.com/frasertweedale/hs-jose/archive/71274bf64c0600c1d877152173a08a5bff7adf4d.tar.gz",
30+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
31+
},
32+
"napalm": {
33+
"branch": "master",
34+
"description": "Support for building npm packages in Nix and lightweight npm registry",
35+
"homepage": "",
36+
"owner": "nmattia",
37+
"repo": "napalm",
38+
"rev": "0331a5b586a186c966f816d434bd5c1ecfa16089",
39+
"sha256": "14nlqmmv3xx4cf3r9kcw2xbfgpddppw27ygp8s3r0bbccgwcp9gi",
40+
"type": "tarball",
41+
"url": "https://github.com/nmattia/napalm/archive/0331a5b586a186c966f816d434bd5c1ecfa16089.tar.gz",
42+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
43+
},
44+
"niv": {
45+
"branch": "master",
46+
"description": "Easy dependency management for Nix projects",
47+
"homepage": "https://github.com/nmattia/niv",
48+
"owner": "nmattia",
49+
"repo": "niv",
50+
"rev": "c2698b0780b783880e0b1a520723948fe3b5c26a",
51+
"sha256": "0v68x0h9si6kjqg5fcjrgsbsf4x18m32a786yvjmrdkrki9qwmcq",
52+
"type": "tarball",
53+
"url": "https://github.com/nmattia/niv/archive/c2698b0780b783880e0b1a520723948fe3b5c26a.tar.gz",
54+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
55+
},
56+
"nixpkgs": {
57+
"branch": "master",
58+
"description": "Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels",
59+
"homepage": null,
60+
"owner": "nh2",
61+
"repo": "nixpkgs",
62+
"rev": "a2d7e9b875e8ba7fd15b989cf2d80be4e183dc72",
63+
"sha256": "1hnmp637r99qd6g0sbx4w3za564gbzwl5c4z0x7fvn7kfi2jp1hx",
64+
"type": "tarball",
65+
"url": "https://github.com/nh2/nixpkgs/archive/a2d7e9b875e8ba7fd15b989cf2d80be4e183dc72.tar.gz",
66+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
67+
},
68+
"port-utils": {
69+
"sha256": "1vfmm8mmkmfffgza64h6qz4ibniibqdr8mj452ikp1xmvv6m8qm9",
70+
"type": "tarball",
71+
"url": "http://hackage.haskell.org/package/port-utils-0.2.1.0/port-utils-0.2.1.0.tar.gz",
72+
"url_template": "http://hackage.haskell.org/package/port-utils-0.2.1.0/port-utils-0.2.1.0.tar.gz"
73+
},
74+
"static-haskell-nix": {
75+
"branch": "master",
76+
"description": "easily build most Haskell programs into fully static Linux executables",
77+
"homepage": "",
78+
"owner": "nh2",
79+
"repo": "static-haskell-nix",
80+
"rev": "8d004d7ced9da947c785b93b4011f39367442339",
81+
"sha256": "0nw4g23c5rs0cvaar2phpr60zim9r0qycznpifi8d8k85y4r3bdd",
82+
"type": "tarball",
83+
"url": "https://github.com/nh2/static-haskell-nix/archive/8d004d7ced9da947c785b93b4011f39367442339.tar.gz",
84+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
85+
},
86+
"wai-lambda": {
87+
"branch": "master",
88+
"description": "Haskell Webapps on AWS Lambda",
89+
"owner": "deckgo",
90+
"repo": "wai-lambda",
91+
"rev": "7f139047addff89e9d30e55b7eebb07c0e846456",
92+
"sha256": "0qqi6wlg8v35dkh6gh9mrj0kb9kpzrz2pc7k0dykk2ahcj6m22k6",
93+
"type": "tarball",
94+
"url": "https://github.com/deckgo/wai-lambda/archive/7f139047addff89e9d30e55b7eebb07c0e846456.tar.gz",
95+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
96+
}
9797
}

0 commit comments

Comments
 (0)