<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pierre Beucher on Medium]]></title>
        <description><![CDATA[Stories by Pierre Beucher on Medium]]></description>
        <link>https://medium.com/@pierre_49652?source=rss-af8f89eb4ca9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*t3PYCxeze96p9gCuGwJTrw.png</url>
            <title>Stories by Pierre Beucher on Medium</title>
            <link>https://medium.com/@pierre_49652?source=rss-af8f89eb4ca9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:17:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pierre_49652/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Documenting my journey from Open Source to SaaS]]></title>
            <link>https://medium.com/@pierre_49652/documenting-my-journey-from-open-source-to-saas-2f57672309df?source=rss-af8f89eb4ca9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f57672309df</guid>
            <category><![CDATA[journey]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Pierre Beucher]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 09:40:21 GMT</pubDate>
            <atom:updated>2025-01-17T09:40:21.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*PQycmcWLKrU3AAwaaOlUTQ.png" /></figure><p>I’m a engineer specialized in IT and Cloud with a few startup and product creation experiences. I actively maintain a few Open Source products and decided to make a SaaS offering, someone advised me to join this sub so I’m gonna tell here about my “Journey to Open Source SaaS product” !</p><p>I hope to trigger discussions and maybe inspire some people following a similar path — if not just helping myself by talking about it :)</p><h3>The Product</h3><p>Starting as a coding hobby, I made a tool to setup a <em>remote gaming machine in the Cloud</em>. What’s that ? In short, to play video games you need to have a powerful computer — say a big 50kg tower sitting in your room. In recent years appeared the notion a <em>“Cloud gaming”</em>: instead of having such powerful computer at home, you can rent one for a few bucks a month and use your tiny potato workstation to play demanding games — much like you’d watch a YouTube video, you could “connect” to your game via a browser. There you have it: you’re playing video games remotely. Instead of a YouTube video being sent from YouTube’s website to your computer, the video game <em>“runs in the Cloud”</em> and is being sent to you.</p><p>There’s also the alternative of playing on directly on TV from your couch while your powerful computer goes <em>brrrr</em> in the basement.</p><p><a href="https://cloudypad.gg/">Cloudy Pad</a> is a tool to setup such a service in a <em>Do It Yourself</em> way. Not going too much into technical details here, the idea is to:</p><ul><li>Offer a free version with main features allowing people to have a good experience but requires a few technical skills</li><li>Provide a SaaS offering with easier setup and advanced features</li></ul><h3>Why ?</h3><p>There’s a <a href="https://www.grandviewresearch.com/industry-analysis/cloud-gaming-market">growing</a> <a href="https://www.fortunebusinessinsights.com/cloud-gaming-market-102495">market</a> and such SaaS services already exist like Nvidia GeForce Now, Blacknut (and now defunct Google’s Stadia) along with a few small players.</p><p>The idea is not to clone these offerings, rather to provide services where they fall short. These mainstream services have typically some limitations: game availability, limiting the number of hours played, losing access to game once subscription stops, limited customizations, etc.</p><p>I believe a few people are left out:</p><ul><li>People only playing a few hours / month and not willing to play 30$+ for less than 20h of gameplay — or the opposite, hardcode gamer willing to pay very premium offer than 100h+ / month</li><li>People with specific needs (certain high-range or low-range machines, some locations, etc.)</li><li>Tech-savy people who wants to be able to customize their machines</li><li>“Home” cloud gamers who wants to play on their TV using their own computers but don’t have technical skills required to setup everything</li></ul><p>Whether a SaaS offering is possible on this segment remains to be proven though !</p><h3>Challenges</h3><p>A few challenges lay ahead, here’s what I have in my scope:</p><ul><li>Technical and engineering: that’s my job, not too much of an issue here.</li><li>Infrastructure: as you may know resources required to play video games are scarce and expensive (for some part because AI uses the same kind of resources). Delivering a product with sane pricing will require fine infrastructure management.</li><li>Interest in the product: are people willing to pay for such services? Will they prefer Cloudy Pad over existing big players? That’s (partly) what Open Source is for.</li><li>Finding the good fit: as big players tend to provide relatively cheap offers I’ll have to be careful with features and target to avoid being irrelevant.</li></ul><p>Of course there are lots of things I don’t see yet ! Do you see something missing ?</p><h3>Roadmap</h3><p>For now I have a working product (see on <a href="https://github.com/PierreBeucher/cloudypad">CloudyPad GitHub page</a>), albeit too technical for most people to use. Here’s what I’m gonna donna do next:</p><ul><li>Allow access to non-technical users — Right now Cloudy Pad is a bit technical to say the least. Setting up instance requires knowledge in development and Cloud. Allowing non-technical people to use it easily is a must ! Roughly, goal is to improve User Experience (UX). SaaS offering will help a lot there.</li><li>Collect Metrics and Analytics ethically — These metrics are important: How many people are using my tool? Which features are most used ? Are there issues ? Of course it also requires user consent which they may not give, so this is a partial information.</li><li>Setup a minimal Communication and branding process — I’m an engineer. Posting on social network and setting up ads isn’t really my cup of tea 😅 That’s why all of this is generated with ChatGPT… kidding of course. I’m leaving my confort zone to put that out there and will define a “process” to be active on social network and find ways to improvie my presence online (nice landing page, social network accounts, etc.). “Engaging with users” is actually fun, more than “blindly posting stuff on social network”, so that’s the scope I’m gonna see that through.</li></ul><h3>Next steps</h3><p>I’m actively working on these 3 roadmap items: UX improvement and metrics/analysis on the Open Source project. I already gather a few metrics and see ~50 unique users / week 🥳</p><p>Next step will probably be to setup a SaaS MVP and do a “closed beta” with a few interested people. I’m thinking of providing 20h or 30h free hours to 5 or 10 people to get useful feedback.</p><p>I’ll happily hear your thoughts about all this !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f57672309df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flox + Novops: development packages, secrets and multi-environment management all-in-one !]]></title>
            <link>https://medium.com/@pierre_49652/flox-novops-development-packages-secrets-and-multi-environment-management-all-in-one-b9973920ed36?source=rss-af8f89eb4ca9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9973920ed36</guid>
            <category><![CDATA[development-environment]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[nix]]></category>
            <dc:creator><![CDATA[Pierre Beucher]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 14:01:40 GMT</pubDate>
            <atom:updated>2025-01-16T13:50:18.532Z</atom:updated>
            <content:encoded><![CDATA[<h3>Flox + Novops: development packages, secrets and multi-environment management all-in-one !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*yhDSECKMqTq6YOUAXSfYYQ.png" /></figure><p>Setting up development environment often turns into a developer horror story. Bring secrets, environment variables, authentication and consistency between each developer’s machines and CI pipelines and it becomes a nightmare. Thankfully, modern tools like <a href="https://novops.dev/">Novops</a> and <a href="https://flox.dev/">Flox</a> can help streamline most of this boilerplate.</p><h3>Flox: reproducible and shareable development environment</h3><p><a href="https://flox.dev/">Flox</a> automates creation of development environment with all required dependencies. Developers can quickly get started on a project without having to install a bunch of tools — and it ensures everyone’s on the same page !</p><p>Suppose you’re working on this NodeJS project, with a bit of Python on the side and a few other packages. Sure you have npm to install Node dependencies, but what about Node itself and other non-Node packages ?</p><p>Using Flox you can define all of your dependencies via a manifest.toml such as:</p><pre>[install]<br># Core project dependencies<br># Node and Python deps can be installed using their respective package managers<br>nodejs.pkg-path = &quot;nodejs&quot;<br>python3.pkg-path = &quot;python3&quot;<br><br># A few more tools useful for development<br>just.pkg-path = &quot;just&quot;                      # Task runner<br>jq.pkg-path = &quot;jq&quot;                          # JSON processor<br>podman.pkg-path = &quot;podman&quot;                  # Container engine for local development with containers<br>podman-compose.pkg-path = &quot;podman-compose&quot;  # </pre><p>Running our development environment is a breeze:</p><pre>$ flox activate<br>✅ You are now using the environment &#39;super-app&#39;.<br>To stop using this environment, type &#39;exit&#39;<br><br>flox [super-app] $ node --version<br>22.10.0<br>flox [super-app] $ python --version<br>Python 3.10.9<br>flox [super-app] $ just --version<br>just 1.9.0<br># ...</pre><p>In short, <strong>Flox is a universal virtual environment manager</strong> working with any technology out of the box. You can combine it with language-specific package manager like Node’s npm and package.json or Python pip.</p><p>We could go further and automatically run npm install on startup by adding a hook in our manifest.toml:</p><pre>[hook]<br>on-activate = &quot;&quot;&quot;<br>    npm install<br>&quot;&quot;&quot;</pre><p>But what about things like <strong>secrets, environment variables and managing multiple environments</strong> (Staging, Preprod, Prod…) ?</p><h3>Novops: universal secret and configuration manager</h3><p><a href="https://novops.dev/">Novops</a> is a universal secret and configuration manager for development, applications and CI. It can load secrets from various sources (Hashicorp Vault, AWS / Azure / GCP Secret Manager, password managers like BitWarden…) — and also manage multi-environments contexts.</p><p>Considering our NodeJS application, let’s say we need to provide <strong>easy access to our developer to a development and staging environment</strong> deployed on <strong>AWS</strong> with secrets stored in <strong>Hashicorp Vault</strong>. Setting up required config is generally cumbersome: <strong>installing required tools (AWS, Kubernetes and Vault CLI), logging-in, escalating to related IAM Roles, etc.</strong> — all of that by switching between environments. <strong>A Developer Hell 😨</strong></p><p>With Novops, all of this becomes easy. We can create a .novops.yml such as:</p><pre># <br># .novops.yml content<br>#<br>environments:<br><br>  # Dev environment configs<br>  # Environment variables and secrets<br>  dev:<br>    variables:<br>      #<br>      # Plain variables specific to our environment<br>      # <br><br>      # Name of current environment<br>      - name: SUPER_APP_ENVIRONMENT<br>        value: dev<br><br>      # AWS region to use<br>      - name: AWS_DEFAULT_REGION<br>        value: eu-central-1<br><br>      #<br>      # Fetch and generate secrets from Hashicorp Vault<br>      # <br><br>      # Database password in Hashicorp Vault<br>      # Fetch value &quot;password&quot; from secret &quot;superapp/dev/database&quot;<br>      # And save it as environment variable SUPER_APP_DB_PASSWORD<br>      - name: SUPER_APP_DB_PASSWORD<br>        value:<br>          hvault_kv2:<br>            path: superapp/dev/database<br>            key: password<br>      - name: SUPER_APP_DB_USER<br>        value:<br>          hvault_kv2:<br>            path: superapp/dev/database<br>            key: user<br><br>    # Load secret files directly in memory<br>    files:<br>      - variable: SUPER_APP_TOKEN<br>        content:<br>          hvault_kv2:<br>            path:  superapp/dev/api<br>            key: token<br><br>    # Generate AWS credentials (impersonate an IAM role &quot;dev_role&quot;)<br>    # Will set 3 AWS built-in environment variables:<br>    # AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN<br>    hashivault:<br>      aws:<br>        name: dev_role<br>        role_arn: arn:aws:iam::111122223333:role/dev_role<br><br>  # Staging environment config<br>  staging:<br>    variables:<br>    # [...]<br><br># Setup Vault address to use globally<br>config:<br>  hashivault:<br>    address: https://vault.supercompany.org:8200</pre><p>On load Novops will:</p><ul><li>Fetch database user/password from Vault and set SUPER_APP_DB_PASSWORD and SUPER_APP_DB_USER environment variables</li><li>Generate temporary AWS credentials using Vault AWS Secret Engine</li><li>Setup a few environment variables specific to our environment</li></ul><p>Run source &lt;(novops load) to load environment. All secrets are <strong>stored securely in memory and discarded when the session ends</strong>:</p><pre>$ source &lt;(novops load)<br>? Select environment<br>❯ dev<br>  staging<br><br>$ echo $SUPER_APP_DB_PASSWORD<br>Super!p3sSw0rd<br><br>$ aws sts get-caller-identity<br>{<br>    &quot;UserId&quot;: &quot;AROAEXAMPLEID123:xxx&quot;,<br>    &quot;Account&quot;: &quot;111122223333&quot;,<br>    &quot;Arn&quot;: &quot;arn:aws:sts::111122223333:assumed-role/dev_role/xxx&quot;<br>}<br><br>$ exit # Secret environment variables are discarded as they were stored in shell&#39;s session<br>$ echo SUPER_APP_DB_PASSWORD<br># &lt;nothing&gt;<br>$ aws sts get-caller-identity<br># &lt;not logged in&gt;</pre><h3>Novops and Flox: greater together !</h3><p>Putting both Flox and Novops together, we can use the above .novops.yml with a Flox hook to automatically setup our environment:</p><pre>#<br># manifest.toml content<br>#<br>[install]<br># [...] Other app packages<br># Add our packages<br>awscli2.pkg-path = &quot;awscli2&quot; # AWS CLI<br>kubectl.pkg-path = &quot;kubectl&quot; # Kubernetes CLI<br>vault.pkg-path = &quot;vault&quot;     # Hashicorp Vault CLI<br># Alternatively, run:<br># <br>#     flox install awscli2 kubectl vault<br># <br><br># Setup hook to login to Vault and <br># load Novops automatically on startup<br>[hook]<br>on-activate = &quot;&quot;&quot;<br>    # [ ... ]<br><br>    # Let user login to vault via web UI.<br>    # Will set environment variable VAULT_TOKEN<br>    # used by Novops to authenticate with Vault.<br>    # <br>    # Novops can also authenticate with Vault directly<br>    # See https://novops.dev/config/hashicorp-vault.html<br>    #<br>    export VAULT_TOKEN=$(vault login -method=oidc -path=oidc -token-only role=&quot;default&quot; 2&gt; /dev/null)<br><br>    # Load secrets and variables with Novops<br>    source &lt;(novops load)<br><br>    echo &quot;Environment $SUPER_APP_ENVIRONMENT ready!&quot;<br>&quot;&quot;&quot;</pre><p>Let’s run it!</p><pre>$ flox activate<br># ✅ You are now using the environment &#39;flox-novops-demo&#39;.<br># To stop using this environment, type &#39;exit&#39;<br># ? Select environment<br># ❯ dev<br>#   staging<br><br># Environment dev ready!<br><br>flox [super-app] $ echo $SUPER_APP_DB_PASSWORD<br># Super!p3sSw0rd<br><br>flox [super-app] $ aws sts get-caller-identity<br># {<br>#     &quot;UserId&quot;: &quot;AROAEXAMPLEID123:xxx&quot;,<br>#     &quot;Account&quot;: &quot;111122223333&quot;,<br>#     &quot;Arn&quot;: &quot;arn:aws:sts::111122223333:assumed-role/dev_role/xxx&quot;<br># }<br><br>flox [super-app] $ exit<br><br>$ echo $SUPER_APP_DB_PASSWORD<br># &lt;nothing&gt;<br>$ aws sts get-caller-identity<br># &lt;not logged in&gt;</pre><h3>Consistency between developers’ environments, CI pipelines and automated script</h3><p>Using Flox and Novops, we can now ensure consistency between developer’s environments: Flox uses a .lock file and is backed by <a href="https://nixos.org/">Nix</a>, a powerful package manager, ensuring that all sessions use the exact same versions of our packages.</p><p>Even better: we can integrate all of this into our CI pipelines and automated scripts! Simply configure your CI pipeline to run commands such as:</p><pre>flox activate -- echo &#39;Running my command with $SUPER_APP_ENVIRONMENT&#39;</pre><p>Passing -- [COMMAND] to flox activate will start the environment and run a one-off command, allowing usage in scripts and CI pipelines.</p><h3>Transform development environment setup into a painless experience</h3><p>Using both Novops and Flox allow for seamless development, putting all together packages, environment variables, secrets and multi-environment management. To get started install Flox and Novops:</p><p>Enjoyed this article? Feel free to give <a href="https://github.com/PierreBeucher/novops">Novops</a> and <a href="https://github.com/flox/flox">Flox</a> a ⭐ on GitHub!</p><p><em>Originally published at </em><a href="https://blog.crafteo.io/2025/01/10/flox-novops-development-packages-secrets-and-multi-environment-management-all-in-one/"><em>https://blog.crafteo.io</em></a><em> on January 10, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9973920ed36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flox: better alternative to Dev Containers]]></title>
            <link>https://medium.com/@pierre_49652/flox-better-alternative-to-dev-containers-d02e1a2ec423?source=rss-af8f89eb4ca9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d02e1a2ec423</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[devtools]]></category>
            <category><![CDATA[devops-tool]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Pierre Beucher]]></dc:creator>
            <pubDate>Fri, 25 Oct 2024 07:26:07 GMT</pubDate>
            <atom:updated>2024-10-27T08:04:49.767Z</atom:updated>
            <content:encoded><![CDATA[<p>On paper, Dev Containers are great to define and share development environments easily. Actually using them is not that great: lack of reproducibility, integrating host files in containers, difference in implementations between various tools…</p><p>While Dev Containers do provide value for dev environment automation, on usage I thought <em>“There’s probably a better way to automate development environment setup, is there ?” — </em>and then I started using <a href="https://flox.dev/">Flox</a>.</p><h3>What’s Flox ?</h3><p><a href="https://flox.dev/">Flox</a> lets you create development environments from a manifest.toml. Not much of a difference between Dev Container’s devcontainer.json at first, but there are a few key differences:</p><ul><li><strong>Flox runs directly on host — </strong>you’ll have access to all your files and configs without relying on complex bind mount or other boilerploite parameters (often different between individual context). Your SSH keys and your shell aliases ? No problem, they’re right here !</li><li><strong>Reproducibility — </strong>While it’s hard to get deterministic and reproducible container image build, <strong>Flox reproducibility is built-in</strong>: you have strong guarantees that everyone will run the same version of all your packages and tools.</li><li><strong>Packages from the Nix ecosystem — </strong>Dev Container uses collections, but it’s hard to find exactly what you need so you’ll often reinvent the wheel and rewrite your own Containerfile or Dockerfile. Flox leverages <a href="https://github.com/NixOS/nixpkgs">Nix nixpkgs</a>, a collection of reproducible packages widely used and production hardened. With access to thousands of packages easily, adding yours with Flox is easy.</li></ul><h3>Example setup: NodeJS application</h3><p><a href="https://flox.dev/docs/install-flox/">Flox installation is a breeze</a> on any Linux, MacOS or Windows. Once installed, run flox init in your project:</p><pre>$ flox init<br>Flox detected a package.json<br><br>Flox can add the following to your environment:<br>* nodejs 20.17.0 with npm bundled<br>* An npm installation hook<br><br># ...<br><br>✨ Created environment &#39;my-app&#39; (x86_64-linux)<br>✅ &#39;nodejs&#39; installed to environment &#39;my-app&#39;</pre><p>Flox detects we’re using NodeJS and automatically add relevant packages. Of course we’ll want to add our own packages — it’s just a command away.</p><p>Let’s add pnpm and jq to make them available in our development environment. We’ll first search for relevant package name to add them.</p><pre>$ flox search pnpm<br>pnpm                      Fast, disk space efficient package manager for JavaScript<br>pnpm_9                    Fast, disk space efficient package manager for JavaScript<br>pnpm_8                    Fast, disk space efficient package manager for JavaScript<br># ...<br><br>$ flox search jq<br>jq                   Lightweight and flexible command-line JSON processor<br># ...<br><br>$ flox install pnpm jq<br>✅ &#39;pnpm&#39; installed to environment &#39;my-app&#39;<br>✅ &#39;jq&#39; installed to environment &#39;my-app&#39;</pre><p>It’s also possible to lookup packages directly from <a href="https://search.nixos.org/packages">NixOS search page</a>.</p><p>Out Flox config is ready, let’s start our development environment and check if our packages are available:</p><pre>$ flox activate<br><br>✅ You are now using the environment &#39;my-app&#39;.<br>To stop using this environment, type &#39;exit&#39;<br><br>up to date, audited 1 package in 163ms<br><br>found 0 vulnerabilities<br><br>flox [my-app] $ pnpm --version<br>9.12.1<br><br>flox [my-app] $ jq --version<br>jq-1.7.1</pre><p>We now just have to push .flox/ into our project’s repository to share our development environment with our team. We won’t even need to have node installed locally, Flox will install the right version for us on activation ✨</p><h3>Flox and CI pipelines</h3><p>We can use the same environment both locally and on our CI pipelines. For example on GitLab CI:</p><pre>test:<br>  stage: test<br>  image: some-custom-image-with-flox<br>  script:<br>    # run command under the same Flox dev environment you used locally<br>    - flox activate -- npm run build</pre><p>Flox <a href="https://flox.dev/docs/tutorials/ci-cd/">documents usage for various contexts</a>: GitHub, GitLab, CircleCI…</p><h3>Bring configs, env vars and secrets to Flox</h3><p>We now have packages and tools, how about configurations such as <strong>environment variables</strong> and <strong>secrets</strong>?</p><p>Flox provides a way to set environment variables via manifest.toml, though it may be limited:</p><pre># manifest.toml<br>[vars]<br>MYAPP_LOGIN = &quot;localuser&quot;<br>MYAPP_PASSWORD = &quot;devPassword123!&quot;</pre><p>We can bring our own tooling we’ll run on Flox shell startup using a <strong>shell hook. </strong>There’s plenty to choose from<strong> </strong>such as:</p><ul><li><a href="https://github.com/PierreBeucher/novops"><strong>novops</strong> </a>— Bring your secrets and configs securely from various sources (Hashicorp Vault, AWS, Azure, GCP…) into your shell as environment variables or files. Support multiple environments to easily switch context.</li><li><a href="https://github.com/getsops/sops"><strong>sops</strong></a> — Simple and flexible tool for managing secrets. Encrypt your secrets into your Git repository for easy and secure access.</li><li><a href="https://github.com/99designs/aws-vault"><strong>aws-vault</strong></a><strong> </strong>— Store and access your AWS credentials in development environments.</li></ul><p>For example with Novops you can update manifest.toml to load secret on shell startup:</p><pre># Scripts defined in the `[profile]` section are sourced by your shell<br>[profile]<br>common = &quot;&quot;&quot;<br>  # will prompt for environment to use (dev, preprod...) and load secrets from source<br>  source &lt;(novops load) <br>&quot;&quot;&quot;</pre><h3>Bonus: Nice Flox features</h3><p>Flox comes with great features out-of-the-box</p><h4>Shell hooks</h4><p>You can add Shell hooks to run commands or script automatically on Flox shell startup. For example by adding into our manifest.toml:</p><pre>[hook]<br>on-activate = &quot;&quot;&quot;<br>    # install npm deps<br>    npm install<br>    <br>    # setup some variables<br>    export MYAPP_HOST=127.0.0.1<br>    export MYAPP_SKIP_TLS=true<br>...</pre><p>A nice way to customize your development environment behavior, such as setting custom environment variables, running package manager installation or start a local database.</p><p>See <a href="https://flox.dev/docs/tutorials/customizing-environments/">shell hook doc for details</a></p><h4>Defining services</h4><p>You can define services with Flox to help you run software your project might depend on.</p><p>For example to start a local Postgres update manifest.toml :</p><pre>[services.database]<br>command = &quot;postgres start&quot;<br>vars.PGUSER = &quot;myuser&quot;<br>vars.PGPASSWORD = &quot;super-secret&quot;<br>vars.PGDATABASE = &quot;mydb&quot;<br>vars.PGPORT = &quot;9001&quot;</pre><p>Though this may be accomplished with a good old docker-compose.yml , it’s worth looking into.</p><p>See <a href="https://flox.dev/docs/concepts/services/">Flox services doc</a> for details.</p><h3>Conclusion</h3><p>Easier to use and providing less friction than Dev Containers, Flox is a great tool to easily setup your development environment. It’s more deterministic and provides better reproducibility than containers.</p><p>Having used this tool across quite a few projects — lots of them previously using Dev Containers — <strong>developer and user feedback is of no appeal: they all prefer Flox.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d02e1a2ec423" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Rust cross compilation journey]]></title>
            <link>https://medium.com/@pierre_49652/a-rust-cross-compilation-journey-5bbf302169ad?source=rss-af8f89eb4ca9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bbf302169ad</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[cross-compile]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Pierre Beucher]]></dc:creator>
            <pubDate>Thu, 29 Feb 2024 22:10:24 GMT</pubDate>
            <atom:updated>2024-03-01T10:13:06.121Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*5EdfZ8DUAucGVYF5BTntHg.png" /></figure><p>I recently had to configure cross-compilation for <a href="https://github.com/PierreBeucher/novops">one of my Rust project</a>, and, oh boy… What a journey ⛵</p><h3>Manual test on target platform</h3><p>I wanted to be able to compile on <em>Linux / macOS / Windows</em> and _x86 <em>64 / aarch64</em>.</p><p>Before adding the layer of complexity required by cross-compilation, I wanted to test on “plain” Windows and macOS systems. It would remove a subsequent layer of complexity: confident that the <em>code</em> itself works on the target platform I would be able to focus on cross-compilation itself — which would bring its own layer of difficulties and bugs. One step at a time!</p><p><a href="https://github.com/quickemu-project/quickemu">quickemu</a> allowed me to run a Windows and macOS machine without too much hassle. Installing Rust and cloning my repository allowed me to solve platform-specific issues before diving into cross compilation. This was especially practical for macOS which is hard and/or expansive to run otherwise.</p><h3>Platform specific code</h3><p>Obviously my code relied on a few platform-specific libraries — such as <a href="https://doc.rust-lang.org/std/os/linux">std::os::linux</a> to get files metadata:</p><pre>// Linux only <br>use std::os::linux::fs::MetadataExt; <br><br>// ... <br><br>let attr = fs::symlink_metadata(lnk)?; <br>let uid = attr.st_uid(); // st_uid() is linux-specific</pre><p>I had to use instead (Mac and Linux compatible)</p><pre>// Any Unix system (Linux, Mac...) <br>std::os::unix::fs::MetadataExt <br><br>// ... <br>let attr = fs::symlink_metadata(lnk)?; <br>let uid = attr.uid(); // now code is valid for any Unix system</pre><p>Another method could have been to rely on <a href="https://doc.rust-lang.org/reference/conditional-compilation.html">conditional compilation</a>, which I will probably have to do in order to support Windows. Something along the line of:</p><pre>#[cfg(target_os=&quot;windows&quot;)]<br>fn check_file_permission(){<br>    // ...<br>}</pre><p>Alternatively, I could have used a Rust crate working transparently for all platforms which would hide way a <a href="https://doc.rust-lang.org/reference/conditional-compilation.html">conditional compilation</a>. It would make the code more generic and improve maintainability.</p><h3>The right cross compilation tool</h3><p>Rust cross compilation is officially supported, but <a href="https://rust-lang.github.io/rustup/cross-compilation.html">documentation is somewhat scarce on the subject</a>. Searching for Rust cross compilation tool quickly yields , a <em>“Zero setup” cross compilation</em> tool.</p><p>cross builds from containers (Docker or Podman) so it does not require anything much apart <a href="https://github.com/cross-rs/cross?tab=readme-ov-file#dependencies">a few dependencies</a> and a container engine (Docker or Podman) - except to target macOS which is another hell of a story I&#39;m getting to below.</p><p>In short I had to install and configure cross. For configuration, <a href="https://github.com/cross-rs/cross?tab=readme-ov-file#option-2-configuring-cross-via-a-crosstoml-file">amongst other options</a>, I created a Cross.toml file with specific instructions for each platforms such as</p><pre># Cross.toml<br><br>#<br># Linux<br>#<br># Install specific dependencies required to build application<br># Here libssl-dev is required to build openssl crate<br>#<br>[target.aarch64-unknown-linux-musl]<br>pre-build = [<br>    &quot;dpkg --add-architecture arm64&quot;,<br>    &quot;apt-get update &amp;&amp; apt-get install --assume-yes libssl-dev:arm64&quot;<br>]<br><br>[target.x86_64-unknown-linux-musl]<br>pre-build = [<br>    &quot;dpkg --add-architecture amd64&quot;,<br>    &quot;apt-get update &amp;&amp; apt-get install --assume-yes libssl-dev:amd64&quot;<br>]<br><br>#<br># macOS<br>#<br># Use a custom image as Cross does not provide image out-of-the-box<br># See https://github.com/cross-rs/cross-toolchains?tab=readme-ov-file#apple-targets<br>#<br>[target.x86_64-apple-darwin]<br>image = &quot;x86_64-apple-darwin-cross:local&quot;<br><br>[target.aarch64-apple-darwin]<br>image = &quot;aarch64-apple-darwin-cross:local&quot;</pre><p>It worked (almost) magically as advertised on both Linux target…</p><pre>cross build --target aarch64-unknown-linux-musl<br>cross build --target x86_64-unknown-linux-musl</pre><p>… except for a tiny issue with openssl which <a href="https://github.com/sfackler/rust-openssl/issues/1627">wouldn&#39;t compile with Linux musl unless </a><a href="https://github.com/sfackler/rust-openssl/issues/1627">vendored Cargo feature is used</a>. Updating Cargo.toml solved the issue:</p><pre># Cargo.toml<br><br># See https://github.com/sfackler/rust-openssl/issues/1627<br># and https://docs.rs/openssl/latest/openssl/#vendored<br>[target.x86_64-unknown-linux-musl.dependencies]<br>openssl = { version = &quot;0.10.62&quot;, features = [&quot;vendored&quot;] }<br><br>[target.aarch64-unknown-linux-musl.dependencies]<br>openssl = { version = &quot;0.10.62&quot;, features = [&quot;vendored&quot;] }</pre><p>As for *-apple-darwin targets I had to (ominous voice) <em>package the macOS SDK locally</em> 😨</p><h3>Targetting macOS / Darwin</h3><p>cross supports <a href="https://github.com/cross-rs/cross?tab=readme-ov-file#supported-targets">quite a few targets</a> but redirects to <a href="https://github.com/cross-rs/cross-toolchains">cross-toolchains</a> for Apple / Darwin. Apple target images are not provided due to <a href="https://github.com/cross-rs/cross-toolchains?tab=readme-ov-file#apple-targets">apparent licensing issues</a> - instructions are given to package macOS SDK through in order to build a custom container image.</p><p>Well. I knew <a href="https://users.rust-lang.org/t/is-cross-compile-from-linux-to-mac-supported/95105/2">macOS cross-compilation</a> <a href="https://users.rust-lang.org/t/cross-compile-macos-and-ms-windows/38323/6">was difficult</a>, but what the actual **** ! It was unbelievably hard to achieve. Apple seems committed to make it impossible to do anything Mac-related without natively using their platform. Well done, Apple, well done, now I’m committed to just do it for the sake of fighting this stance.</p><p>Anyway, here’s the short how-to version:</p><ul><li>Create a developer account on <a href="https://developer.apple.com/">developer.apple.com</a> to download Xcode</li><li>Of course for some reason account creation didn’t work from my Linux machine. I had to go through the macOS box I created earlier with Quickemu for registration process to work.</li><li><a href="https://xcodereleases.com/">xcodereleases.com</a> provides a handy list of Xcode release (though you’ll still need an account)</li><li>Package the SDK following <a href="https://github.com/tpoechtrager/osxcross?tab=readme-ov-file#packaging-the-sdk">oscrossx instructions</a></li><li>Build *-apple-darwin-cross container images locally following <a href="https://github.com/cross-rs/cross-toolchains?tab=readme-ov-file#cross-toolchains">cross-toolchains instructions</a>. Something along the line of:</li></ul><pre># Clone repo and submodules<br>git clone https://github.com/cross-rs/cross<br>cd cross<br>git submodule update --init --remote<br><br># Copy SDK to have it available in build context<br>cd docker<br>mkdir ./macos-sdk<br>cp path/to/sdk/MacOSX13.0.sdk.tar.xz ./macos-sdk/MacOSX13.0.sdk.tar.xz<br><br># Build images<br>docker build -f ./cross-toolchains/docker/Dockerfile.x86_64-apple-darwin-cross \<br>    --build-arg MACOS_SDK_DIR=./macos-sdk \<br>    --build-arg MACOS_SDK_FILE=&quot;MacOSX13.0.sdk.tar.xz&quot; \<br>    -t x86_64-apple-darwin-cross:local .<br><br>docker build -f ./cross-toolchains/docker/Dockerfile.aarch64-apple-darwin-cross \<br>    --build-arg MACOS_SDK_DIR=./macos-sdk \<br>    --build-arg MACOS_SDK_FILE=&quot;MacOSX13.0.sdk.tar.xz&quot; \<br>    -t aarch64-apple-darwin-cross:local <br>    .</pre><ul><li>Run build to leverage locally available *-apple-darwin-cross:local images for cross-compilation</li></ul><pre>  cross build --target x86_64-apple-darwin</pre><p>Et voilà ! A working macOS binary built with Rust from Linux 🥳</p><pre>$ file novops novops: Mach-O 64-bit x86_64 executable, flags:&lt;NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS&gt;</pre><p>Here’s <a href="https://github.com/PierreBeucher/novops/pull/94/">the PR I finally crafted for </a><a href="https://github.com/PierreBeucher/novops/pull/94/">novops cross-compilation</a>.</p><h3>Wrapping-up</h3><p>So cross-compiling Rust is no easy feat, especially targetting macOS / Darwin — but the journey alone with all its lessons and learning is worth it !</p><p>Of course I could also simply spin-up <a href="https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs">GitHub Actions matrix jobs</a> with the OS I want to target, but that wouldn’t be fun, would it?</p><p><em>Originally published at </em><a href="https://blog.crafteo.io/2024/02/29/my-rust-cross-compilation-journey/"><em>https://blog.crafteo.io</em></a><em> on February 29, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bbf302169ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop spreading Secrets and Configs across CI and local environments]]></title>
            <link>https://medium.com/@pierre_49652/stop-spreading-secrets-and-configs-across-ci-and-local-environments-a7af43fd14d6?source=rss-af8f89eb4ca9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7af43fd14d6</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[secrets]]></category>
            <category><![CDATA[devops-tool]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Pierre Beucher]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 08:10:01 GMT</pubDate>
            <atom:updated>2024-01-09T08:11:06.939Z</atom:updated>
            <content:encoded><![CDATA[<p>Managing secrets and configs for project is a pain. Usually done via environment variables and/or files, most team end-up with secrets and configs spread around their CI servers and git-ignored .env files. Not only insecure, it causes poor developer experience, frustration and time loss where a bit of tooling and best practice can drastically improve the situation.</p><h3>Secrets and Configs ?</h3><p>Secrets and Configs are the magic environment variables and files setup on CI and locally — such as NodeJS NPM_TOKEN or Ansible ANSIBLE_VAULT_PASSWORD_FILE.</p><p>Working on a project will require you to configure a non-negligible amount of secrets and configs locally or on CI pipelines. Most CI servers provide means of managing and exposing these as environment variables or files (eg. <a href="https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions">GitHub Action secrets</a> or <a href="https://docs.gitlab.com/ee/ci/variables/#cicd-variable-security">GitLab CI variables</a>), but it’s hard to reproduce locally and you CI config becomes yet-another copy/paste from Vault.</p><p>Developers usually rely on secrets in git-ignored or encrypted files, desperately trying to minimize diff between their setup, CI config and their colleague’s own local setup.</p><p>This is the de-facto approach for most teams today, but it’s both inefficient and insecure. Secrets end-up unencrypted on-disk in often insecure directories, while it’s difficult to be efficient with the increasingly complex setup as project grows. It gets even worse for Infra as Code and other DevOps related projects in multi-environment contexts, often requiring dozen if not hundreds of such configs and secrets ! Ideally, secrets management should follow <a href="https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html">OWASP best practices</a> and their setup 100% automated with minimal manual action.</p><h3>But I already have Hashicorp Vault (or equivalent), isn’t that enough?</h3><p>A Secret Manager like Hashicorp Vault will help you manage secrets efficiently: secure access, rotation, dynamic secrets, audit… But won’t necessarily help with the above issue. You need additional tooling like Kubernetes’ <a href="https://external-secrets.io/latest/">External Secrets Operator</a> to manage secret usage workflow.</p><p>In most situations for CI and development, secrets are being copy/pasted from Vault into whatever means available and forgotten about — until it causes a bug of failure somewhere.</p><p>Tired of this situation, I developed <a href="https://github.com/PierreBeucher/novops">Novops</a>, a secret manager for CI and development environments.</p><h3><strong>Novops: Secret &amp; Configuration manager for CI, Development and DevOps</strong></h3><p><a href="https://github.com/PierreBeucher/novops">Novops</a> is a FOSS Secret and Config manager for CI, Development and DevOps. It <strong>fetches secrets directly from source</strong> (Hashicorp Vault, AWS/Azure/GCP, SOPS…) and load them <strong>securely in-memory</strong> as files and environment variables.</p><ul><li>Secrets are kept temporary and securely in-memory</li><li>Secrets can be passed directly to process with novops run, preventing secrets from ever touching disk or being persisted</li><li>Integrate seamlessly with well-known tools like Ansible, Terraform, Pulumi, etc.</li><li>Manage multiple environments (eg. dev, preprod, prod…)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVx8gUS13jn_ipvOYEzJIw.jpeg" /></figure><p>Novops uses a .novops.yml file you can safely commit in Git and share with your team and project, allowing developers and CI to reproduce secrets and configs setup via a single novops command.</p><p>In short, <a href="https://github.com/PierreBeucher/novops">Novops</a> brings <strong>reproducibility</strong> and <strong>security</strong> to your project’s CI and local setup configs and secrets.</p><h3>Conclusion</h3><p>Improve developer experience and avoid spreading secrets and configs across your CI and development environment with Novops. It will help secure and manage your project’s secrets &amp; configs with your teams and CI pipelines!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7af43fd14d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>