Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
dezren39 committed Mar 12, 2024
1 parent f8d3046 commit cb00f56
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
CHARM_DIR="/mnt/c/Users/drewr/code/source/identity/data/charms/a1f88a4bb72f92dcf61546ecad235d6aa69135ed968d2338d02e25ef0873
/mnt/c/Users/drewr/code/sources/identity/provider/e2c1ecb06855c73be5d4caff283830bff53d9ded9853cb4dc5f16d942fdc
/mnt/c/Users/drewr/code/sources/identity/provider/1a49f078/714abdbbb40c14a8a45cd16e6c3d4d5be03c8d5eca7d8ebc9a63db25975cd713" ~/code/src/identity/identity charm link -d -o "/mnt/c/Users/drewr/code/source/identity/data/charms/a1f88a4bb72f92dcf61546ecad235d6aa69135ed968d2338d02e25ef0873
/mnt/c/Users/drewr/code/sources/identity/provider/e2c1ecb06855c73be5d4caff283830bff53d9ded9853cb4dc5f16d942fdc
/mnt/c/Users/drewr/code/sources/identity/provider/1a49f078/714abdbbb40c14a8a45cd16e6c3d4d5be03c8d5eca7d8ebc9a63db25975cd713/.link" -k "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIByQfvwjrZj1k3QKZgayCc2ESn3iYO1RLM2Dv07ySqS8,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcB2drOfxskb9DPYUUSHFTeC/ZOBkCaUfOQlgN0ksJW,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICVuZZlEpHfQADiUoofkUI2dQKbgRnlnODlCefwBOPIi,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDrsT5Eest3+VnbXZmXidY5CZFscxe7wDYsnHs/Muc/x,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE6z33ZduBR8BvZA9GUTz14TrvEebgMG8nTxXy76ZCcd,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEzWRyTB2o5V2GsChvTUYCd1Vcr0okj4KdWD9Qz3tY8G,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFdz0QkZImiBwH6XVdH79T8oAkDhuNFoytqjcKweNHrt,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILM2XPD+Wsn+Ziwemd3TB1mU1u4OR2H8Gk82x1BSRFsP,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILt3T+gVAJsbYfEDbUfhVxkeBpyCd2XGK8WJDXZkCaBY,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMFQBfv63aVT4g4zU4ysYCNsvuWELe/0mAMkzh7Xz/iQ,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINo8of8l94GaN9GnpaObO7h/J7v5Nl8uHiLoMsmEfg7q"
CHARM_DIR="/mnt/c/Users/drewr/code/source/identity/data/charms/83cc8ff5897465a7f9cfd2c46344bec239053e893197cf22cb0053ceffd1
/mnt/c/Users/drewr/code/sources/identity/provider/711eedd9ce0c4d055703c48fb83acee67066022c8f1541e3644b33317c61
/mnt/c/Users/drewr/code/sources/identity/provider/352973fd/320d02abaa86a7ff48760153414869830bd5516bf51b404c5f2d5fe2f39fc0cf" ~/code/src/identity/identity charm link -d -o "/mnt/c/Users/drewr/code/source/identity/data/charms/83cc8ff5897465a7f9cfd2c46344bec239053e893197cf22cb0053ceffd1
/mnt/c/Users/drewr/code/sources/identity/provider/711eedd9ce0c4d055703c48fb83acee67066022c8f1541e3644b33317c61
/mnt/c/Users/drewr/code/sources/identity/provider/352973fd/320d02abaa86a7ff48760153414869830bd5516bf51b404c5f2d5fe2f39fc0cf/.link" -k "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIByQfvwjrZj1k3QKZgayCc2ESn3iYO1RLM2Dv07ySqS8,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICcB2drOfxskb9DPYUUSHFTeC/ZOBkCaUfOQlgN0ksJW,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICVuZZlEpHfQADiUoofkUI2dQKbgRnlnODlCefwBOPIi,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDrsT5Eest3+VnbXZmXidY5CZFscxe7wDYsnHs/Muc/x,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE6z33ZduBR8BvZA9GUTz14TrvEebgMG8nTxXy76ZCcd,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEzWRyTB2o5V2GsChvTUYCd1Vcr0okj4KdWD9Qz3tY8G,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFdz0QkZImiBwH6XVdH79T8oAkDhuNFoytqjcKweNHrt,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILM2XPD+Wsn+Ziwemd3TB1mU1u4OR2H8Gk82x1BSRFsP,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILt3T+gVAJsbYfEDbUfhVxkeBpyCd2XGK8WJDXZkCaBY,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMFQBfv63aVT4g4zU4ysYCNsvuWELe/0mAMkzh7Xz/iQ,ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINo8of8l94GaN9GnpaObO7h/J7v5Nl8uHiLoMsmEfg7q"
3 changes: 1 addition & 2 deletions sources/identity/provider/background.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash

cd "${0%/*}"

[[ -f 'config.sh' ]] && source config.sh
Expand Down Expand Up @@ -29,4 +28,4 @@ monitor_files() {
}
mkdir -p "$BACKGROUND_JOB_EXECUTING_DIR" "$BACKGROUND_JOB_COMPLETE_DIR" "$BACKGROUND_JOB_FAILED_DIR"
mv "$BACKGROUND_JOB_EXECUTING_DIR"/* "$BACKGROUND_JOB_FAILED_DIR/" 2>/dev/null
monitor_files &
monitor_files
4 changes: 3 additions & 1 deletion sources/identity/provider/config.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
PROJECT_NAME=provider
PROJECT_DIR="$(pwd)"

if [[ -z "$BACKGROUND_JOB_DIR" ]]; then
BACKGROUND_JOB_DIR="$(realpath "${0%/*}")/.."
BACKGROUND_JOB_DIR="$PROJECT_DIR/background"
fi
if [[ -z "$BACKGROUND_JOB_EXECUTING_DIR" ]]; then
BACKGROUND_JOB_EXECUTING_DIR="$BACKGROUND_JOB_DIR/executing"
Expand Down
12 changes: 8 additions & 4 deletions sources/identity/provider/pages/link.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ done
if [[ -z "$KEYS" ]]; then
return $(status_code 405)
fi
CHARM_DIR=$(realpath $CHARM_DIR)"/$(random)"
RANDOM_ID=$(random 32)
IDENTITY_DIR="$(realpath ~)/code/src/identity"
CHARM_DIR="$IDENTITY_DIR/data/charm/link/$RANDOM_ID"
mkdir -p "$CHARM_DIR"
LINK_CODE_PATH=$CHARM_DIR/.link
rm -rf "$LINK_CODE_PATH"
mkdir -p "$(dirname "$LINK_CODE_PATH")"
cat << EOF > "$BACKGROUND_JOB_DIR/$(basename "$(dirname "$CHARM_DIR")").sh"
BACKGROUND_JOB_PATH="$BACKGROUND_JOB_DIR/$RANDOM_ID.sh"
cat << EOF > "$BACKGROUND_JOB_PATH"
#!/usr/bin/env bash
CHARM_DIR="$CHARM_DIR" ~/code/src/identity/identity charm link -d -o "$LINK_CODE_PATH" -k "${FORM_DATA[$key]}"
CHARM_DIR="$CHARM_DIR" $IDENTITY_DIR/identity charm link -d -o "$LINK_CODE_PATH" -k "${FORM_DATA[$key]}"
EOF
echo "Created background job: $BACKGROUND_JOB_DIR/$(basename "$(dirname "$CHARM_DIR")").sh" >&2
echo "background job path: $BACKGROUND_JOB_PATH" >&2
echo "link code path: $LINK_CODE_PATH" >&2
max_wait=60 # seconds
wait_interval=1 # seconds
elapsed_time=0
Expand Down

0 comments on commit cb00f56

Please sign in to comment.