diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3853d6..6620b80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -168,7 +168,7 @@ jobs: needs: - plan - build-local-artifacts - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json @@ -218,7 +218,7 @@ jobs: if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" outputs: val: ${{ steps.host.outputs.manifest }} steps: @@ -282,7 +282,7 @@ jobs: # still allowing individual publish jobs to skip themselves (for prereleases). # "host" however must run to completion, no skipping allowed! if: ${{ always() && needs.host.result == 'success' }} - runs-on: "ubuntu-20.04" + runs-on: "ubuntu-22.04" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/dist-workspace.toml b/dist-workspace.toml index 20f3152..3e42848 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -10,5 +10,10 @@ ci = "github" # The installers to generate for each app installers = [] # Target platforms to build apps for (Rust target-triple syntax) -# targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"] -targets = ["x86_64-unknown-linux-gnu"] +targets = ["aarch64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] +# Skip checking whether the specified configuration files are up to date +allow-dirty = ["ci"] + +[dist.github-custom-runners] +x86_64-unknown-linux-gnu = "ubuntu-22.04" +x86_64-unknown-linux-musl = "ubuntu-22.04" diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..76a9e7e --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1746232882, + "narHash": "sha256-MHmBH2rS8KkRRdoU/feC/dKbdlMkcNkB5mwkuipVHeQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7a2622e2c0dbad5c4493cb268aba12896e28b008", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index 2761f83..d9c2def 100644 --- a/flake.nix +++ b/flake.nix @@ -1,4 +1,3 @@ -# flake.nix { description = "Minne application flake"; @@ -32,13 +31,12 @@ # Assuming you switched to crates.io headless_chrome cargoLock = { lockFile = ./Cargo.lock; - # outputHashes = { ... }; # Only if other git dependencies still exist }; nativeBuildInputs = [ pkgs.pkg-config pkgs.rustfmt - pkgs.makeWrapper # For the postInstall hook + # pkgs.makeWrapper # For the postInstall hook ]; buildInputs = [ pkgs.openssl @@ -67,27 +65,38 @@ # --- Docker Image Definition (using dockerTools) --- minne-docker-image = pkgs.dockerTools.buildImage { - name = "minne"; # Docker image repository name - tag = minne-pkg.version; # Use the package version as the image tag + name = "minne"; + tag = minne-pkg.version; - # Include the runtime closure of our minne package in the image layers - # Also add bash for easier debugging inside the container - contents = [minne-pkg pkgs.bashInteractive]; + # Create an environment containing our packages + # and copy its contents to the image's root filesystem. + copyToRoot = pkgs.buildEnv { + name = "minne-env"; # Name for the build environment derivation + paths = [ + minne-pkg # Include our compiled Rust application + pkgs.bashInteractive # Include bash for debugging/interaction + pkgs.coreutils # Often useful to have basic utils like ls, cat etc. + pkgs.cacert # Include CA certificates for TLS/SSL + ]; + # Optional: Add postBuild hook for the buildEnv if needed + # postBuild = '' ... ''; + }; # Configure the runtime behavior of the Docker image config = { - # Set the default command to run when the container starts - # Assumes 'main' is your primary entrypoint - Cmd = ["${minne-pkg}/bin/main"]; + # Cmd can now likely refer to the binary directly in /bin + # (buildEnv symlinks the 'main' binary into the profile's bin) + Cmd = ["/bin/main"]; - # Add other Docker config as needed: - # ExposedPorts = { "8080/tcp" = {}; }; # Example port exposure - WorkingDir = "/data"; # Example working directory - # Volumes = { "/data" = {}; }; # Example volume mount point + # ExposedPorts = { "8080/tcp" = {}; }; + WorkingDir = "/data"; + # Volumes = { "/data" = {}; }; + + # PATH might not need explicit setting if things are in /bin, + # but setting explicitly can be safer. buildEnv adds its bin path automatically. Env = [ - # The wrapper should set CHROME_BIN, but you can add other env vars - "PATH=${pkgs.lib.makeBinPath [minne-pkg pkgs.coreutils]}" # Ensure coreutils are in PATH - "SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" # Common requirement + # SSL_CERT_FILE is often essential for HTTPS requests + "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt" ]; }; }; @@ -112,28 +121,13 @@ drv = minne-pkg; name = "worker"; }; + server = flake-utils.lib.mkApp { + drv = minne-pkg; + name = "server"; + }; # Default app for 'nix run .' default = self.apps.${system}.main; }; - - # # Development Shell: Accessible via 'nix develop' - # devShells.default = pkgs.mkShell { - # # Use inputs from the main package derivation - # inputsFrom = [minne-pkg]; - # # Add development tools - # nativeBuildInputs = minne-pkg.nativeBuildInputs; - # buildInputs = - # minne-pkg.buildInputs - # ++ [ - # pkgs.cargo - # pkgs.rustc - # pkgs.clippy # Add other dev tools as needed - # ]; - # # Add shell hooks or env vars if needed - # # shellHook = '' - # # export MY_DEV_VAR="hello" - # # ''; - # }; } ); } diff --git a/todo.md b/todo.md index 9aae3f7..1369cb2 100644 --- a/todo.md +++ b/todo.md @@ -1,22 +1,23 @@ -\[\] change to smoothie dom -\[\] store page title -\[\] rename ingestion instructions to context -\[\] page screenshot? +\[\] allow setting of data storage folder, via envs and config +\[\] archive ingressed webpage, pdf would be easy \[\] full text search -\[\] archive ingressed webpage +\[\] rename ingestion instructions to context \[\] three js graph explorer \[\] three js vector explorer \[x\] add user_id to ingress objects \[x\] admin controls re registration +\[x\] change to smoothie dom \[x\] chat functionality \[x\] chat history \[x\] chat styling overhaul \[x\] configs primarily get envs +\[x\] debug why not automatic retrieval of chrome binary works \[x\] filtering on categories \[x\] fix patch_text_content \[x\] gdpr \[x\] html ingression \[x\] hx-redirect +\[x\] implement migrations \[x\] integrate assets folder in release build \[x\] integrate templates in release build \[x\] ios shortcut generation @@ -28,9 +29,11 @@ \[x\] on updates of knowledgeentity create new embeddings \[x\] openai api key in config \[x\] option to set models, query and processing +\[x\] page screenshot? \[x\] redirects \[x\] restrict retrieval to users own objects \[x\] smoothie_dom test +\[x\] store page title \[x\] template customization? \[x\] templating \[x\] testing core functions