| 1 | amends "../../config/Service.pkl" |
| 2 | |
| 3 | import "../../config/OpenID.pkl" as sso |
| 4 | import "../../config/site.pkl" as site |
| 5 | |
| 6 | name = "Shale" |
| 7 | requirements { |
| 8 | new sso.Client { |
| 9 | clientId = module.id |
| 10 | name = module.name |
| 11 | redirectUris { "https://\(module.container.http.hostname)/-/callback" } |
| 12 | usernameAliases { ["snow"] = "clover" } |
| 13 | allowGuests = true |
| 14 | usernameRequired = true |
| 15 | } |
| 16 | when (!site.preview) { |
| 17 | new sso.Client { |
| 18 | alias = "dev" |
| 19 | clientId = "\(module.id)-dev" |
| 20 | name = "\(module.name) dev" |
| 21 | redirectUris { "http://git1.localhost/-/callback" } |
| 22 | allowGuests = true |
| 23 | usernameRequired = true |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | prepare = "prepare.py" |
| 28 | |
| 29 | container { |
| 30 | memory = 4096 |
| 31 | image = "docker.io/astheno/shale@sha256:690ff8c43292e49466359271d0f8a92e9dedf01a192e5215859f0510a3eb30cd" |
| 32 | |
| 33 | http { |
| 34 | containerPort = 8000 |
| 35 | subdomain = "shale" |
| 36 | overrideFiles { |
| 37 | ["/-/theme.css"] = "theme.css" |
| 38 | ["/-/repo-icons/"] = "icons" |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | volumes { |
| 43 | ["/data"] {} |
| 44 | ["/repositories_owned"] {} |
| 45 | ["/repositories_mirrors"] {} |
| 46 | ["/etc/crontabs"] {} |
| 47 | ["/etc/shale/theme.css"] { config = "theme.css" } |
| 48 | ["/etc/ssl/certs/ca-certificates.crt"] { |
| 49 | src = "/var/lib/snowglobe/ca-bundle.crt" |
| 50 | readOnly = true |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | env { |
| 55 | ["DOMAIN"] = module.container.http.hostname |
| 56 | ["HOME"] = "/data" |
| 57 | ["SERVER_TITLE"] = "clover's git" |
| 58 | // Concurrent Markdown rendering shares capture state between request workers. |
| 59 | ["NPROC"] = "1" |
| 60 | when (site.preview) { |
| 61 | ["MIRRORS_DISABLE_CLONE"] = "true" |
| 62 | ["MIRRORS_DISABLE_PULL_POLL"] = "true" |
| 63 | } |
| 64 | ["SESSION_SECRET"] = "${secret.own.session_secret}" |
| 65 | ["OAUTH2_CLIENT"] = "oidc,\(sso.hostname)|${secret.oidc.clientId}|${secret.oidc.clientSecret}" |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | secrets { |
| 70 | ["session_secret"] {} |
| 71 | } |