Skip to content

Commit

Permalink
bashsta.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
dezren39 committed Mar 10, 2024
1 parent b5dc777 commit 6a1dc69
Show file tree
Hide file tree
Showing 14 changed files with 194 additions and 114 deletions.
2 changes: 1 addition & 1 deletion sources/identity/build-libsql.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ try {
if (-not $SkipBuildTempl) {

Install-Templ -Force:$ForceInstallTempl
$goBinPath = Join-Path (go env GOPATH) "bin"
$goBinPath = Join-Path $(go env GOPATH) "bin"
Write-Verbose "goBinPath: $goBinPath"
$templCommand = Join-Path $goBinPath "templ"
Write-Verbose "templCommand: $templCommand"
Expand Down
3 changes: 1 addition & 2 deletions sources/identity/cmd/ssh/configuration/configuration.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package configuration

import (
"github.com/charmbracelet/log"
"github.com/developing-today/code/src/identity/configuration"
"github.com/knadh/koanf"
"github.com/samber/do/v2"
Expand Down Expand Up @@ -31,7 +30,7 @@ func NewConfiguration() *configuration.SshServerConfiguration {
func LoadDefaultConfiguration() *configuration.SshServerConfiguration {
config := NewConfiguration()
config.LoadConfiguration()
log.Info("Loaded config", "config", config.Configuration.Sprint())
// log.Info("Loaded config", "config", config.Configuration.Sprint())
return config
}

Expand Down
22 changes: 11 additions & 11 deletions sources/identity/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,25 @@ func (c *SshServerConfiguration) LoadConfiguration() {
c.Configuration.Set("identity.server.tls.key.client", "./data/tls/client-key.pem")
c.Configuration.Set("identity.server.tls.ca", "./data/tls/ca.pem")

log.Info("Loaded default configuration", "config", c.Configuration.Sprint())
log.Info("Loading embedded file configuration", "config", c.ConfigurationLocations.EmbeddedConfigurationFilePaths)
// log.Info("Loaded default configuration", "config", c.Configuration.Sprint())
// log.Info("Loading embedded file configuration", "config", c.ConfigurationLocations.EmbeddedConfigurationFilePaths)

for _, path := range c.ConfigurationLocations.EmbeddedConfigurationFilePaths {
data, err := c.EmbedFS.ReadFile(path)
if err != nil {
log.Info("Embedded Config not found or error reading", "path", path, "error", err)
// log.Info("Embedded Config not found or error reading", "path", path, "error", err)
continue
}

if err := c.Configuration.Load(rawbytes.Provider(data), kdl.Parser()); err != nil {
log.Error("Failed to load embedded config", "error", err)
} else {
log.Info("Loaded config from embedded file", "path", path)
// log.Info("Loaded config from embedded file", "path", path)
}
}

log.Info("Loaded embedded configuration", "config", c.Configuration.Sprint())
log.Info("Loading environment configuration", "environment_variable_prefix", prefix, "lvl", "WARN")
// log.Info("Loaded embedded configuration", "config", c.Configuration.Sprint())
// log.Info("Loading environment configuration", "environment_variable_prefix", prefix, "lvl", "WARN")

c.Configuration.Load(env.Provider(prefix, ".", func(s string) string {
return strings.Replace(strings.Replace(strings.Replace(strings.ToLower(
Expand All @@ -169,22 +169,22 @@ func (c *SshServerConfiguration) LoadConfiguration() {
" ", "_", -1)
}), nil)

log.Info("Loaded environment configuration", "config", c.Configuration.Sprint())
log.Info("Loading file configuration", "paths", c.ConfigurationLocations.ConfigurationFilePaths)
// log.Info("Loaded environment configuration", "config", c.Configuration.Sprint())
// log.Info("Loading file configuration", "paths", c.ConfigurationLocations.ConfigurationFilePaths)

for _, path := range c.ConfigurationLocations.ConfigurationFilePaths {
if _, err := os.Stat(path); err == nil {
if err := c.Configuration.Load(file.Provider(path), kdl.Parser()); err != nil {
log.Error("Failed to load file config", "error", err)
} else {
log.Info("Loaded config from file", "path", path)
// log.Info("Loaded config from file", "path", path)
}
} else {
log.Info("Config file not found", "path", path)
// log.Info("Config file not found", "path", path)
}
}

log.Info("Loaded file configuration", "config", c.Configuration.Sprint())
// log.Info("Loaded file configuration", "config", c.Configuration.Sprint())
}

func (c *SshServerConfiguration) SetConfiguration(config *SshServerConfiguration) {
Expand Down
12 changes: 6 additions & 6 deletions sources/identity/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ require (
github.com/samber/go-type-to-string v1.2.0
github.com/spf13/cobra v1.8.0
github.com/tursodatabase/libsql-client-go v0.0.0-20240208053015-5d6aa1e2196d
golang.org/x/crypto v0.20.0
golang.org/x/crypto v0.21.0
gopkg.in/go-jose/go-jose.v2 v2.6.2
)

replace github.com/charmbracelet/charm => github.com/developing-today-forks/charm v0.12.7-0.20240225103047-e4778561c8b2
replace github.com/charmbracelet/charm => github.com/developing-today-forks/charm v0.12.7-0.20240310034134-33438f790aed

require (
github.com/FZambia/eagle v0.1.0 // indirect
Expand All @@ -56,6 +56,7 @@ require (
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-jose/go-jose v2.6.2+incompatible // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
Expand Down Expand Up @@ -114,16 +115,15 @@ require (
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.41.0 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/sqlite v1.29.1 // indirect
modernc.org/sqlite v1.29.2 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
nhooyr.io/websocket v1.8.10 // indirect
Expand Down
24 changes: 12 additions & 12 deletions sources/identity/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/developing-today-forks/charm v0.12.7-0.20240225103047-e4778561c8b2 h1:V9VSrMU1Z0yT12ZCkzbZRajTbI7UqfcJ2Q1KfJe9SmM=
github.com/developing-today-forks/charm v0.12.7-0.20240225103047-e4778561c8b2/go.mod h1:AFyEKBZDsnfTvNIg0B3Lxvx8U3uvwk+yzLq8W4VMvug=
github.com/developing-today-forks/charm v0.12.7-0.20240310034134-33438f790aed h1:3aHOds89FjtFlv4o9lbOZ+61ojXxjJi7NXEeqCHp4p8=
github.com/developing-today-forks/charm v0.12.7-0.20240310034134-33438f790aed/go.mod h1:q+Sj5Yn6/CEyH0C2kdVEU7QnBhDKudz3quPut05wXTk=
github.com/dgraph-io/badger/v3 v3.2103.5 h1:ylPa6qzbjYRQMU6jokoj4wzcaweHylt//CH0AKt0akg=
github.com/dgraph-io/badger/v3 v3.2103.5/go.mod h1:4MPiseMeDQ3FNCYwRbbcBOGJLf5jsE0PPFzRiKjtcdw=
github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
Expand All @@ -126,6 +126,8 @@ github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyT
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-chi/chi v1.5.5 h1:vOB/HbEMt9QqBqErz07QehcOKHaWFtuj87tTDVz2qXE=
github.com/go-chi/chi v1.5.5/go.mod h1:C9JqLr3tIYjDOZpzn+BCuxY8z8vmca43EeMgyZt7irw=
github.com/go-jose/go-jose v2.6.2+incompatible h1:X6pNb5PAs58olW3wThjNqIEh3CfyV+21e/cW+wQrwBU=
github.com/go-jose/go-jose v2.6.2+incompatible/go.mod h1:coBhWG9DQz8V/JlBMg3LkUGnarUaxjQlWQUUv9Cv7tw=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
Expand Down Expand Up @@ -499,8 +501,8 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ=
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
Expand Down Expand Up @@ -590,11 +592,11 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand Down Expand Up @@ -660,8 +662,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/go-jose/go-jose.v2 v2.6.2 h1:Rl5+9rA0kG3vsO1qhncMPRT5eHICihAMQYJkD7u/i4M=
gopkg.in/go-jose/go-jose.v2 v2.6.2/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI=
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand All @@ -684,8 +684,8 @@ modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E=
modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E=
modernc.org/sqlite v1.29.1 h1:19GY2qvWB4VPw0HppFlZCPAbmxFU41r+qjKZQdQ1ryA=
modernc.org/sqlite v1.29.1/go.mod h1:hG41jCYxOAOoO6BRK66AdRlmOcDzXf7qnwlwjUIOqa0=
modernc.org/sqlite v1.29.2 h1:xgBSyA3gemwgP31PWFfFjtBorQNYpeypGdoSDjXhrgI=
modernc.org/sqlite v1.29.2/go.mod h1:hG41jCYxOAOoO6BRK66AdRlmOcDzXf7qnwlwjUIOqa0=
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
Expand Down
20 changes: 15 additions & 5 deletions sources/identity/install.template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,22 @@ fi
/boot/dietpi/dietpi-software uninstall 103 104 # ramlog dropbear
/boot/dietpi/dietpi-software install 188 # go (git by dependency)
source /etc/bash.bashrc
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_21.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt update
apt install -y wget libicu72 npm ucspi-tcp unzip
apt install -y wget nodejs npm ucspi-tcp unzip
npm install -g npm@latest
wget https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb
dpkg -i powershell_7.4.1-1.deb_amd64.deb
apt install -f
npm --version
node --version
if command -v snap; then
snap install powershell --classic
else
apt install -y libicu72
wget https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/powershell_7.4.1-1.deb_amd64.deb
dpkg -i powershell_7.4.1-1.deb_amd64.deb
apt install -f
fi
cd ~$USER
if [ ! -d "code" ]; then
git clone https://github.com/developing-today/code
Expand All @@ -36,4 +46,4 @@ fi
./identity charm kv sync
./identity charm kv get dt.identity.init > init
chmod +x init
. ./init
./init
19 changes: 13 additions & 6 deletions sources/identity/provider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fi
./identity charm kv set dt.identity.secret.TURSO_AUTH_TOKEN "$TURSO_AUTH_TOKEN"
./identity charm kv set dt.identity.init <<EOF
#!/usr/bin/env pwsh
cd ~`$USER/code/source/identity
cd ~\$USER/code/source/identity
./identity charm kv sync
TURSO_HOST=$(./identity charm kv get dt.identity.secret.TURSO_HOST)
export TURSO_HOST
Expand All @@ -73,14 +73,21 @@ if [ -z "$TURSO_AUTH_TOKEN" ]; then
echo "TURSO_AUTH_TOKEN not set"
exit 1
fi
./provider.sh $CHARM_DIR $INIT_URL $PORT
./provider.sh "$CHARM_DIR" "$INIT_URL" "$PORT" &
./start-server-all.ps1
EOF

IP=$(hostname -I | awk '{print $1}')
if [ "$(expr substr "$IP" 1 4)" = "172." ]; then
IP=$(hostname -I | awk '{print $2}')
if [ "$(expr substr "$IP" 1 4)" = "172." ]; then
IP="127.0.0.1"
fi
fi
PORT=3333
CHARM_LINK_URL="http://$IP:$PORT/link"
cp -f ./provider/install.template.sh ./provider/static/link
sed -i "s/{{CHARM_DIR}}/$CHARM_DIR/g" ./provider/static/link
sed -i "s/{{CHARM_LINK_URL}}/$CHARM_LINK_URL/g" ./provider/static/link
. ./provider/start.sh
cp -f ./install.template.sh ./provider/static/init
sed -i "s|{{CHARM_DIR}}|$CHARM_DIR|g" ./provider/static/init
sed -i "s|{{CHARM_LINK_URL}}|$CHARM_LINK_URL|g" ./provider/static/init

PORT=$PORT CHARM_DIR=$CHARM_DIR ./provider/start.sh
2 changes: 1 addition & 1 deletion sources/identity/provider/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV DEV false

RUN apt-get update && apt-get install ucspi-tcp

EXPOSE 3000
EXPOSE 3333

COPY . /app

Expand Down
16 changes: 0 additions & 16 deletions sources/identity/provider/pages/count.sh

This file was deleted.

9 changes: 0 additions & 9 deletions sources/identity/provider/pages/index.sh

This file was deleted.

85 changes: 85 additions & 0 deletions sources/identity/provider/pages/link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# if [[ "$REQUEST_METHOD" != "POST" ]]; then
# # only allow POST to this endpoint
# return $(status_code 405)
# fi

# echo "0"
# echo ""
# echo "<br>"

# # The following variables are available in all route handlers:

# # REQUEST_METHOD - the HTTP verb used
# echo "REQUEST_METHOD: $REQUEST_METHOD<br>"
# # REQUEST_PATH - the relative path of the request
# echo "REQUEST_PATH: $REQUEST_PATH<br>"
# # REQUEST_QUERY - the raw (unparsed) query string
# echo "REQUEST_QUERY: $REQUEST_QUERY<br>"

# # The framework will automatically parse the request and populate the following associative arrays:

# # HTTP_HEADERS - The parsed request headers
# echo "HTTP_HEADERS:<br>"
# for key in "${!HTTP_HEADERS[@]}"; do
# echo " $key: ${HTTP_HEADERS[$key]}<br>"
# done

# # QUERY_PARAMS - The parsed query parameter string
# echo "QUERY_PARAMS:<br>"
# for key in "${!QUERY_PARAMS[@]}"; do
# echo " $key: ${QUERY_PARAMS[$key]}<br>"
# done

# # FORM_DATA - The parsed form data (if applicable)
# echo "FORM_DATA:<br>"
# for key in "${!QUERY_PARAMS[@]}"; do
# echo " $key: ${QUERY_PARAMS[$key]}<br>"
# done

random() {
echo $(dd if=/dev/urandom bs=1 count=64 2>/dev/null | xxd -p)
}

for key in "${!FORM_DATA[@]}"; do
if [[ "$key" == "link" ]]; then
echo "CHARM_DIR=$CHARM_DIR/$(random)"
CHARM_DIR=$CHARM_DIR/$(random) ~$USER/code/source/identity/identity charm link ${FORM_DATA[$key]}
if [[ $? -eq 0 ]]; then
respond 200 "OK"
else
respond 405 "Failure."
fi
fi
done

# # PATH_VARS - The parsed variable names for dynamic and catch-all routes
# echo "PATH_VARS:<br>"
# for key in "${!PATH_VARS[@]}"; do
# echo " $key: ${PATH_VARS[$key]}<br>"
# done

# # COOKIES - The parsed cookies from the request headers
# echo "COOKIES:<br>"
# for key in "${!COOKIES[@]}"; do
# echo " $key: ${COOKIES[$key]}<br>"
# done

# # The following are only used if you are writing an upload handler:

# # FILE_UPLOADS - A mapping of input names -> tmp files
# echo "FILE_UPLOADS:<br>"
# for key in "${!FILE_UPLOADS[@]}"; do
# echo " $key: ${FILE_UPLOADS[$key]}<br>"
# done

# # FILE_UPLOAD_TYPES - A mapping of input names -> file upload types (according to the request)
# echo "FILE_UPLOAD_TYPES:<br>"
# for key in "${!FILE_UPLOAD_TYPES[@]}"; do
# echo " $key: ${FILE_UPLOAD_TYPES[$key]}<br>"
# done

# # FILE_UPLOAD_NAMES - A mapping of input names -> original filenames
# echo "FILE_UPLOAD_NAMES:<br>"
# for key in "${!FILE_UPLOAD_NAMES[@]}"; do
# echo " $key: ${FILE_UPLOAD_NAMES[$key]}<br>"
# done
8 changes: 0 additions & 8 deletions sources/identity/provider/pages/reset.sh

This file was deleted.

Loading

0 comments on commit 6a1dc69

Please sign in to comment.