Resources that can be grouped into the http:server resource must have that prefix. Grouping is basically hierarchical, and without that common prefix, it means we'd have to special-case our grouping algorithm.
38 lines
1.4 KiB
Plaintext
38 lines
1.4 KiB
Plaintext
http:server ":8080" { # by default http uses :80 but using :8080 avoids needing root!
|
|
#address => ":8080", # you can override the name like this
|
|
#timeout => 60, # add a timeout (seconds)
|
|
}
|
|
|
|
# you can add a raw file like this...
|
|
http:server:file "/file1" {
|
|
data => "hello, world, i'm file1 and i don't exist on disk!\n",
|
|
}
|
|
|
|
$version = "38"
|
|
$arch = "x86_64"
|
|
$distroarch_http_prefix = "/tmp/os/"
|
|
|
|
file "${distroarch_http_prefix}" { # root http dir
|
|
state => $const.res.file.state.exists,
|
|
}
|
|
|
|
# this one is backed by the (optional) rsync
|
|
#http:server:file "/fedora/releases/${version}/Everything/${arch}/os/" {
|
|
# path => "${distroarch_http_prefix}",
|
|
#}
|
|
|
|
# wget http://127.0.0.1:8080/fedora/bar/foox.html
|
|
# wget http://127.0.0.1:8080/fedora/releases/38/Everything/x86_64/os/Packages/c/cowsay-3.7.0-7.fc38.noarch.rpm
|
|
# wget https://mirrors.xtom.de/fedora/releases/38/Everything/x86_64/os/Packages/c/cowsay-3.7.0-7.fc38.noarch.rpm
|
|
|
|
http:server:proxy "/fedora/releases/${version}/Everything/${arch}/os/" { # same as the http:server:file path
|
|
|
|
cache => "${distroarch_http_prefix}", # /tmp/os/
|
|
#force => false, # if true, overwrite or change from dir->file if needed
|
|
#ttl => 60, # 60 seconds ttl (longer for most things, -1 for infinite, 0 for just proxy)
|
|
|
|
# https://mirrors.xtom.de/fedora/releases/ => http://127.0.0.1:4280/fedora/
|
|
sub => "/fedora/",
|
|
head => "https://mirrors.xtom.de/fedora/",
|
|
}
|