This commit is contained in:
2024-12-25 12:27:58 +01:00
parent 29fa39955e
commit 4614c12819
21 changed files with 28 additions and 75 deletions

View File

@@ -1,6 +1,6 @@
# herolib # herolib
a smaller version of crystallib with only the items we need for hero a smaller version of herolib with only the items we need for hero
> [documentation here](https://freeflowuniverse.github.io/herolib/) > [documentation here](https://freeflowuniverse.github.io/herolib/)

View File

@@ -30,7 +30,7 @@ if additional_args.len > 0 {
} }
// Change to the hero directory // Change to the hero directory
hero_dir := os.join_path(os.home_dir(), 'code/github/freeflowuniverse/crystallib/cli/hero') hero_dir := os.join_path(os.home_dir(), 'code/github/freeflowuniverse/herolib/cli/hero')
os.chdir(hero_dir) or { panic('Failed to change directory to ${hero_dir}: ${err}') } os.chdir(hero_dir) or { panic('Failed to change directory to ${hero_dir}: ${err}') }
// Set HEROPATH based on OS // Set HEROPATH based on OS

View File

@@ -1,47 +0,0 @@
function s3_configure {
SECRET_FILE="/${HOME}/code/git.ourworld.tf/despiegk/hero_secrets/mysecrets.sh"
if [ -f "$SECRET_FILE" ]; then
echo get secrets
source "$SECRET_FILE"
fi
# Check if environment variables are set
if [ -z "$S3KEYID" ] || [ -z "$S3APPID" ]; then
echo "Error: S3KEYID or S3APPID is not set"
exit 1
fi
# Create rclone config file
mkdir -p "${HOME}/.config/rclone"
cat > "${HOME}/.config/rclone/rclone.conf" <<EOL
[b2]
type = b2
account = $S3KEYID
key = $S3APPID
hard_delete = true
EOL
echo "made S3 config on: ${HOME}/.config/rclone/rclone.conf"
cat ${HOME}/.config/rclone/rclone.conf
}
function hero_upload {
set -e
hero_path=$(which hero 2>/dev/null)
if [ -z "$hero_path" ]; then
echo "Error: 'hero' command not found in PATH" >&2
exit 1
fi
set -x
s3_configure
# rclone_config=$(get_rclone_config) || { echo "$rclone_config"; exit 1; }
rclone --config="${HOME}/.config/rclone/rclone.conf" lsl b2:threefold/$MYPLATFORMID/
rclone --config="${HOME}/.config/rclone/rclone.conf" copy "$hero_path" b2:threefold/$MYPLATFORMID/
}

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.base import freeflowuniverse.herolib.core.base
pub struct MyClient[T] { pub struct MyClient[T] {
base.BaseConfig[T] base.BaseConfig[T]

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.pathlib import freeflowuniverse.herolib.core.pathlib
import freeflowuniverse.crystallib.core.base import freeflowuniverse.herolib.core.base
pub struct MyClient[T] { pub struct MyClient[T] {
base.BaseConfig[T] base.BaseConfig[T]

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.base import freeflowuniverse.herolib.core.base
import freeflowuniverse.crystallib.develop.gittools import freeflowuniverse.herolib.develop.gittools
pub struct MyClass { pub struct MyClass {
base.Base base.Base

View File

@@ -1,8 +1,8 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import os import os
import freeflowuniverse.crystallib.core.codeparser import freeflowuniverse.herolib.core.codeparser
import freeflowuniverse.crystallib.core.codemodel { Struct } import freeflowuniverse.herolib.core.codemodel { Struct }
code_path := '${os.dir(@FILE)}/embedding.v' code_path := '${os.dir(@FILE)}/embedding.v'

View File

@@ -1,9 +1,9 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import time import time
import freeflowuniverse.crystallib.core.smartid import freeflowuniverse.herolib.core.smartid
import freeflowuniverse.crystallib.data.ourtime import freeflowuniverse.herolib.data.ourtime
import freeflowuniverse.crystallib.core.db import freeflowuniverse.herolib.core.db
pub struct MyStruct { pub struct MyStruct {
db.Base db.Base

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.data.dbfs import freeflowuniverse.herolib.data.dbfs
import time import time
import os import os

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.generator.installer import freeflowuniverse.herolib.core.generator.installer
installer.scan('~/code/github/freeflowuniverse/crystallib/crystallib')! installer.scan('~/code/github/freeflowuniverse/herolib/herolib')!

View File

@@ -1,7 +1,7 @@
module dagu module dagu
// import os // import os
import freeflowuniverse.crystallib.clients.httpconnection import freeflowuniverse.herolib.clients.httpconnection
import os import os
struct GiteaClient[T] { struct GiteaClient[T] {

View File

@@ -2,7 +2,7 @@
import os import os
import json import json
import freeflowuniverse.crystallib.core.openapi.gen import freeflowuniverse.herolib.core.openapi.gen
const spec_path = '${os.dir(@FILE)}/openapi.json' const spec_path = '${os.dir(@FILE)}/openapi.json'

View File

@@ -1,6 +1,6 @@
module openrpc_client module openrpc_client
import freeflowuniverse.crystallib.data.jsonrpc { JsonRpcRequest } import freeflowuniverse.herolib.data.jsonrpc { JsonRpcRequest }
import net.websocket import net.websocket
struct Client { struct Client {

View File

@@ -1,6 +1,6 @@
module petstore_client module petstore_client
import freeflowuniverse.crystallib.data.jsonrpc { JsonRpcRequest } import freeflowuniverse.herolib.data.jsonrpc { JsonRpcRequest }
import net.websocket import net.websocket
struct Client { struct Client {

View File

@@ -1,6 +1,6 @@
module petstore_client module petstore_client
import freeflowuniverse.crystallib.data.jsonrpc import freeflowuniverse.herolib.data.jsonrpc
// get_pets finds pets in the system that the user has access to by tags and within a limit // get_pets finds pets in the system that the user has access to by tags and within a limit
// - tags: tags to filter by // - tags: tags to filter by

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.pathlib import freeflowuniverse.herolib.core.pathlib
import os import os
const testpath3 = os.dir(@FILE) + '/../../..' const testpath3 = os.dir(@FILE) + '/../../..'

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.pathlib import freeflowuniverse.herolib.core.pathlib
import os import os
const testpath4 = os.dir(@FILE) + '../../' const testpath4 = os.dir(@FILE) + '../../'

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.pathlib import freeflowuniverse.herolib.core.pathlib
import freeflowuniverse.crystallib.data.paramsparser import freeflowuniverse.herolib.data.paramsparser
import os import os
const testpath3 = os.dir(@FILE) + '/../..' const testpath3 = os.dir(@FILE) + '/../..'

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.core.pathlib import freeflowuniverse.herolib.core.pathlib
import os import os
const testpath4 = os.dir(@FILE) + '/paths_sha256.vsh' const testpath4 = os.dir(@FILE) + '/paths_sha256.vsh'

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run #!/usr/bin/env -S v -gc none -no-retry-compilation -cc tcc -d use_openssl -enable-globals run
import freeflowuniverse.crystallib.crypt.secrets import freeflowuniverse.herolib.crypt.secrets
secrets.delete_passwd()! secrets.delete_passwd()!
r := secrets.encrypt('aaa')! r := secrets.encrypt('aaa')!

View File

@@ -4,7 +4,7 @@ is a python tool to help us to get .md files into our manual
copies all readme.md files from the different lib directors to copies all readme.md files from the different lib directors to
- e.g. $crystallib/manual/libreadme/installers_sysadmintools_actrunner.md - e.g. $herolib/manual/libreadme/installers_sysadmintools_actrunner.md
- note the name has the location inside of where info came from - note the name has the location inside of where info came from
this allows us to make manual and to copy information from the readme's which are in library this allows us to make manual and to copy information from the readme's which are in library
@@ -12,6 +12,6 @@ this allows us to make manual and to copy information from the readme's which ar
to run to run
```bash ```bash
~/code/github/freeflowuniverse/crystallib/tools/doc_extractor/extractor.sh ~/code/github/freeflowuniverse/herolib/tools/doc_extractor/extractor.sh
``` ```