| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
This directory contains example scripts demonstrating how to use the Lore Python SDK.
Both examples run the same basic workflow: create a repository, write a couple of files, stage them, and commit a revision. In online mode they additionally push the revision and clone the repository back.
Each example accepts an optional remote URL as the first command-line argument.
# Offline run
python3 examples/example.py
# Online run against a local server
python3 examples/example.py lore://localhost
# Same for the native variant
python3 examples/example-native.py
python3 examples/example-native.py lore://localhostThese examples do not perform authentication. If the remote requires it, run lore auth from the CLI before invoking the example.
To exercise the online mode of these examples, you can run a Lore server locally. The steps below build the server from source and configure it for local development:
Clone the Lore repository and build the server in release mode:
git clone https://github.com/EpicGames/lore.git
cd lore
cargo build --releaseCreate a local config file by copying the example:
cp lore-server/config/local.toml.example lore-server/config/local.tomlGenerate a random secret and set it as presigned_url_hmac_key in lore-server/config/local.toml:
openssl rand -hex 32Generate a self-signed TLS certificate (run from the directory where the server expects cert.pem and key.pem):
openssl req \
-subj '/CN=localhost:8443/O=Self signed/C=CH' \
-new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 \
-keyout key.pem -out cert.pemStart the server:
RUST_LOG=info ./target/release/loreserver 2>&1 | tee /tmp/lore.logThe server is now reachable as lore://localhost, which you can pass to the examples as the first argument.
| Back | FazBrowse Home | New Git URL |