Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f61c18dab1
11 changed files with 134 additions and 109 deletions
|
@ -23,4 +23,4 @@ host/laptop/postmates-macbook
|
|||
host/laptop/uber-macbook
|
||||
host/laptop/val-macbook
|
||||
host/layer/personal
|
||||
host/layer/nginx-user-public
|
||||
host/layer/public-webserver
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
</body>
|
|
@ -1,62 +0,0 @@
|
|||
<!doctype html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<style>
|
||||
*, *::before, *::after {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'IosevkaLyte';
|
||||
font-display: swap;
|
||||
font-weight: 400;
|
||||
font-stretch: normal;
|
||||
font-style: normal;
|
||||
src: url('https://files.lyte.dev/iosevkalyte/iosevkalyteweb-regular.subset.woff2') format('woff2');
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
color: #fff;
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0af;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #faf;
|
||||
}
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: IosevkaLyte;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
padding: 0.15em 0;
|
||||
}
|
||||
|
||||
hr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1, pre, p {
|
||||
display: block;
|
||||
max-width: 800px;
|
||||
margin: 0.5em auto;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
|
@ -1,19 +0,0 @@
|
|||
#!/usr/bin/env fish
|
||||
set me (status -f)
|
||||
set dfp $argv[1]
|
||||
set h $argv[2]
|
||||
set c $argv[3]
|
||||
|
||||
pushd (dirname $me)
|
||||
function _cp
|
||||
sudo rm -f "$argv[2]"
|
||||
echo "Copying $argv[1] to $argv[2]"
|
||||
sudo cp "$argv[1]" "$argv[2]"
|
||||
end
|
||||
|
||||
_cp (pwd)/user-public-http.conf /etc/nginx/user-public-http.conf
|
||||
_cp (pwd)/user-public-server.conf /etc/nginx/user-public-server.conf
|
||||
_cp (pwd)/.nginx-autoindex-before.html /usr/share/nginx/html/.nginx-autoindex-before.html
|
||||
_cp (pwd)/.nginx-autoindex-after.html /usr/share/nginx/html/.nginx-autoindex-after.html
|
||||
|
||||
echo 'Don\'t forget to include the nginx files in your config inside their respective blocks!'
|
|
@ -1,13 +0,0 @@
|
|||
disable_symlinks off;
|
||||
|
||||
# for wasm games
|
||||
types {
|
||||
application/octet-stream clr;
|
||||
application/octet-stream pdb;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_min_length 10240;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml application/wasm;
|
||||
gzip_disable msie6;
|
|
@ -1,13 +0,0 @@
|
|||
# need CORS?
|
||||
# location ~* \.(eot|ttf|woff|woff2)$ {
|
||||
# add_header Access-Control-Allow-Origin *;
|
||||
# }
|
||||
|
||||
location ~ ^/~(.+?)(/.*)?$ {
|
||||
disable_symlinks off;
|
||||
alias /home/$1/public$2;
|
||||
index index.html index.htm;
|
||||
autoindex on;
|
||||
add_before_body "/.nginx-autoindex-before.html";
|
||||
add_after_body "/.nginx-autoindex-after.html";
|
||||
}
|
11
host/layer/public-webserver/caddy/Caddyfile
Executable file
11
host/layer/public-webserver/caddy/Caddyfile
Executable file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
admin "unix//run/caddy/admin.socket"
|
||||
}
|
||||
|
||||
// http://127.0.0.1 http://0.0.0.0 http://{system.hostname} {
|
||||
root * /srv/http
|
||||
file_server {
|
||||
browse /etc/caddy/browse_template.html
|
||||
hide \.*
|
||||
}
|
||||
}
|
95
host/layer/public-webserver/caddy/browse_template.html
Normal file
95
host/layer/public-webserver/caddy/browse_template.html
Normal file
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{html .Name}}</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="https://lyte.dev/styles.css" />
|
||||
</head>
|
||||
<style>
|
||||
body > header { margin-bottom: 0; justify-content: space-between; }
|
||||
body > header > section > span {
|
||||
text-decoration: none;
|
||||
line-height: 1.5em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: .25em .5em;
|
||||
}
|
||||
table { width: 100%; }
|
||||
div.meta { margin-bottom: 0.5em; }
|
||||
thead { background-color: var(--header-bg); margin-bottom: 0.5em; }
|
||||
tr.spacer { height: 0.5em; }
|
||||
th { text-align: left; font-weight: normal; padding: 0.5em 0.8em; margin-bottom: 0.5em; }
|
||||
td { padding: 0 0.8em; }
|
||||
svg { stroke: var(--fg); fill: var(--fg); }
|
||||
</style>
|
||||
<body>
|
||||
<header>
|
||||
<section>
|
||||
{{range $i, $crumb := .Breadcrumbs}}<a href="{{html $crumb.Link}}">{{html $crumb.Text}}</a>{{if ne $i 0}}<a href="./">/</a>{{end}}{{end}}
|
||||
</section>
|
||||
<section>
|
||||
<span class="meta-item">{{.NumDirs}} director{{if eq 1 .NumDirs}}y{{else}}ies{{end}}</span>
|
||||
<span class="meta-item">{{.NumFiles}} file{{if ne 1 .NumFiles}}s{{end}}</span>
|
||||
{{- if ne 0 .Limit}}
|
||||
<span class="meta-item">(of which only <b>{{.Limit}}</b> are displayed)</span>
|
||||
{{- end}}
|
||||
</section>
|
||||
</header>
|
||||
<main>
|
||||
<div class="listing">
|
||||
<table aria-describedby="summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Size
|
||||
</th>
|
||||
<th class="hideable">
|
||||
Modified
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="spacer"></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{- range .Items}}
|
||||
<tr class="file">
|
||||
<td>
|
||||
<a href="{{html .URL}}">
|
||||
<span class="name">{{html .Name}}</span>
|
||||
</a>
|
||||
</td>
|
||||
{{- if .IsDir}}
|
||||
<td data-order="-1">—</td>
|
||||
{{- else}}
|
||||
<td data-order="{{.Size}}">{{.HumanSize}}</td>
|
||||
{{- end}}
|
||||
<td class="hideable"><time datetime="{{.HumanModTime "2006-01-02T15:04:05Z"}}">{{.HumanModTime "01/02/2006 03:04:05 PM -07:00"}}</time></td>
|
||||
</tr>
|
||||
{{- end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
function localizeDatetime(e, index, ar) {
|
||||
if (e.textContent === undefined) {
|
||||
return;
|
||||
}
|
||||
var d = new Date(e.getAttribute('datetime'));
|
||||
if (isNaN(d)) {
|
||||
d = new Date(e.textContent);
|
||||
if (isNaN(d)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
e.textContent = d.toLocaleString([], {day: "2-digit", month: "2-digit", year: "numeric", hour: "2-digit", minute: "2-digit", second: "2-digit"});
|
||||
}
|
||||
var timeList = Array.prototype.slice.call(document.getElementsByTagName("time"));
|
||||
timeList.forEach(localizeDatetime);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
18
host/layer/public-webserver/dotfiles-setup.d.fish
Normal file
18
host/layer/public-webserver/dotfiles-setup.d.fish
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
pushd (dirname (status -f))
|
||||
set dfp $argv[1]
|
||||
set homedir $argv[2]
|
||||
set xdgconfdir $argv[3]
|
||||
set layerdir (pwd)
|
||||
|
||||
function _p
|
||||
set source $argv[1]
|
||||
set dest $argv[2]
|
||||
sudo rm -rf "$dest"
|
||||
echo "Copying $source to $dest"
|
||||
sudo cp -r "$source" "$dest"
|
||||
end
|
||||
|
||||
_p $layerdir/caddy /etc/caddy
|
||||
_p $layerdir/webserver-root /srv/http
|
6
host/layer/public-webserver/webserver-root/index.html
Normal file
6
host/layer/public-webserver/webserver-root/index.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<head>
|
||||
<title>Public Web lyte.dev Machine</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="./public-files/">Public Files</a>
|
||||
</body>
|
3
host/layer/public-webserver/webserver-root/public-files/.gitignore
vendored
Normal file
3
host/layer/public-webserver/webserver-root/public-files/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
*
|
||||
.*
|
||||
!.gitignore
|
Reference in a new issue