Compare commits

..

187 Commits

Author SHA1 Message Date
github-actions[bot]
81b304a715 release(dashboard): 2.38.0 (#3503)
Co-authored-by: robertkasza <robertkasza@users.noreply.github.com>
2025-09-29 13:44:58 +02:00
robertkasza
ac9956bcdb feat(dashboard): datatable column header redesign (#3500) 2025-09-29 13:34:38 +02:00
David Barroso
7d2bc4c06e chore(ci): minor improvements to the ci (#3527) 2025-09-29 12:02:04 +02:00
David Barroso
48ef43202c feat(docs): added links to react-apollo and react-query guides (#3528) 2025-09-29 10:28:45 +02:00
David BM
e6ae494336 feat(dashboard): add remote schemas (#3299)
Co-authored-by: David Barroso Murcia <davidbm@air-m4.local>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2025-09-26 16:14:34 +02:00
David Barroso
092e98358f chore(ci): implement storage releases (#3525) 2025-09-26 15:03:29 +02:00
dependabot[bot]
dd945daa1a chore(ci): bump nixbuild/nix-quick-install-action from 26 to 34 (#3524) 2025-09-26 13:52:23 +02:00
dependabot[bot]
0fe38e206b chore(ci): bump github/codeql-action from 2 to 3 (#3523) 2025-09-26 13:52:14 +02:00
dependabot[bot]
373657339c chore(ci): bump actions/checkout from 4 to 5 (#3521) 2025-09-26 13:52:02 +02:00
dependabot[bot]
3833158107 chore(ci): bump peter-evans/create-pull-request from 6 to 7 (#3520) 2025-09-26 13:51:55 +02:00
David Barroso
4c93094e4d chore(ci): enable dependabot for github actions (#3519) 2025-09-26 13:35:03 +02:00
David Barroso
2ba53e4fef chore(ci): minor improvements (#3518) 2025-09-26 13:28:01 +02:00
David Barroso
23bd2f8d4f chore(storage): integrate storage code into nhost/nhost (#3515) 2025-09-26 12:46:35 +02:00
robertkasza
a14d1e4f22 chore(dashboard): fix defects in basetable form and add comment to columns (#3475) 2025-09-26 11:28:33 +02:00
David Barroso
7509bd8a96 Merge branch 'storage' 2025-09-26 09:31:47 +02:00
David Barroso
0c820d4173 feat(cli): import nhost/cli into ./cli/ (#3506)
Co-authored-by: nhost-build <98952681+nhost-build@users.noreply.github.com>
Co-authored-by: szilarddoro <szilarddoro@users.noreply.github.com>
Co-authored-by: nunopato <nunopato@users.noreply.github.com>
Co-authored-by: Nuno Pato <nunopato@gmail.com>
Co-authored-by: Szilárd Dóró <doroszilard@gmail.com>
Co-authored-by: Alex Duval <alexduval71@gmail.com>
Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
Co-authored-by: constance-seedstash <123984067+constance-seedstash@users.noreply.github.com>
Co-authored-by: onehassan <onehassan@users.noreply.github.com>
Co-authored-by: Ibrahim Ahmed <abeahmed2@gmail.com>
Co-authored-by: Nestor Manrique <nes.manrique@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Siddhant <94226898+S1D007@users.noreply.github.com>
Co-authored-by: dbm03 <dbm03@users.noreply.github.com>
Co-authored-by: Rene Cruces <52537668+renecruces@users.noreply.github.com>
Co-authored-by: David BM <correodelnino@gmail.com>
Co-authored-by: Nikhil Iyer <iyer.h.nikhil@gmail.com>
2025-09-26 08:37:28 +02:00
David BM
72401ae1a7 chore(ci): add e2e remote schema name repository variable to CI workflow (#3502) 2025-09-25 19:36:16 +02:00
David Barroso
0b560dcb52 feat(storage): import nhost/hasura-storage into ./services/storage/ 2025-09-25 16:56:32 +02:00
David Barroso
51619dbf87 feat: generate server boilerplate from openapi schema (#245) 2025-09-25 16:33:50 +02:00
David Barroso
73b60a14e5 fix(ci): check for tag using the correct format (#3495)
### **PR Type**
Bug fix


___

### **Description**
- Declare `TAG_NAME` from make release-tag-name

- Use `TAG_NAME` in git tag existence check

- Update echo messages to reference correct tag


___

### Diagram Walkthrough


```mermaid
flowchart LR
  A["Compute TAG_NAME"] --> B["Compute VERSION"]
  B --> C["Check if tag exists"]
  C -->|exists| D["Skip release preparation"]
  C -->|not exists| E["Proceed with release"]
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>ci_update_changelog.yaml</strong><dd><code>Use TAG_NAME
for tag existence check</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/ci_update_changelog.yaml

<ul><li>Declare <code>TAG_NAME</code> variable using make
release-tag-name<br> <li> Replace <code>${{ matrix.project }}</code>
with <code>TAG_NAME</code> in grep<br> <li> Update echo commands to
reference <code>TAG_NAME</code> correctly</ul>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3495/files#diff-399add8ac39ae1cd7ae2f4f8ceb89290f6f43e25b7b2c499da61dd68a5cf2f16">+3/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-09-24 17:09:16 +02:00
David Barroso
f4ce851abe fix(ci): fixed ci_create_release.yaml (#3493)
### **PR Type**
Bug fix


___

### **Description**
- Add `cd $PROJECT` before make in CI workflow

- Ensure `make release-tag-name` runs in correct directory


___

### Diagram Walkthrough


```mermaid
flowchart LR
  A["Extract VERSION"] --> B["Change to project directory"]
  B --> C["Run make release-tag-name"]
  C --> D["Set project_name output"]
```



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>ci_create_release.yaml</strong><dd><code>Change to
project directory before make</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/ci_create_release.yaml

<ul><li>Insert <code>cd $PROJECT</code> before <code>make
release-tag-name</code><br> <li> Ensure <code>make</code> runs in the
repository subdirectory</ul>


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3493/files#diff-9f32bd5671fcb04c5f1b35ea33677c4704302536e0c4ff9e06b514dc9b3d4f0c">+2/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-09-24 16:55:35 +02:00
dependabot[bot]
40707e534e chore: bump nixbuild/nix-quick-install-action from 31 to 32 (#244)
### **User description**
Bumps
[nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action)
from 31 to 32.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/releases">nixbuild/nix-quick-install-action's
releases</a>.</em></p>
<blockquote>
<h2>nixbuild/nix-quick-install-action@v32</h2>
<h2>Changes</h2>
<ul>
<li>
<p>Bump minor Nix versions: 2.24.14 -&gt; 2.24.15, 2.26.3 -&gt; 2.26.4,
2.28.3 -&gt; 2.28.4, 2.29.1 -&gt; 2.29.1. This fixes the security
vulnerabilities
reported in <a
href="https://discourse.nixos.org/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/">https://discourse.nixos.org/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/</a>.</p>
</li>
<li>
<p>Bump default Nix version: 2.29.0 -&gt; 2.29.1</p>
</li>
</ul>
<h2>Supported Nix Versions on x86_64-linux runners</h2>
<ul>
<li>2.29.1</li>
<li>2.28.4</li>
<li>2.26.4</li>
<li>2.24.15</li>
<li>2.3.18</li>
</ul>
<h2>Supported Nix Versions on aarch64-linux runners</h2>
<ul>
<li>2.29.1</li>
<li>2.28.4</li>
<li>2.26.4</li>
<li>2.24.15</li>
</ul>
<h2>Supported Nix Versions on x86_64-darwin runners</h2>
<ul>
<li>2.29.1</li>
<li>2.28.4</li>
<li>2.26.4</li>
<li>2.24.15</li>
<li>2.3.18</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE">nixbuild/nix-quick-install-action's
changelog</a>.</em></p>
<blockquote>
<p>v32</p>
<h2>Changes</h2>
<ul>
<li>
<p>Bump minor Nix versions: 2.24.14 -&gt; 2.24.15, 2.26.3 -&gt; 2.26.4,
2.28.3 -&gt; 2.28.4, 2.29.1 -&gt; 2.29.1. This fixes the security
vulnerabilities
reported in <a
href="https://discourse.nixos.org/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/">https://discourse.nixos.org/t/security-advisory-privilege-escalations-in-nix-lix-and-guix/</a>.</p>
</li>
<li>
<p>Bump default Nix version: 2.29.0 -&gt; 2.29.1</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="63ca48f939"><code>63ca48f</code></a>
Release v32</li>
<li><a
href="561f57d8ff"><code>561f57d</code></a>
Fix Nix versions</li>
<li><a
href="fb259be9d0"><code>fb259be</code></a>
Fix Nix versions</li>
<li><a
href="78439c724d"><code>78439c7</code></a>
Update Nix versions (<a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/69">#69</a>)</li>
<li><a
href="b0bad79cb8"><code>b0bad79</code></a>
Fix version</li>
<li><a
href="c3bd2b7f38"><code>c3bd2b7</code></a>
Update README and workflows for v31</li>
<li>See full diff in <a
href="https://github.com/nixbuild/nix-quick-install-action/compare/v31...v32">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nixbuild/nix-quick-install-action&package-manager=github_actions&previous-version=31&new-version=32)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>


___

### **PR Type**
dependencies


___

### **Description**
- Bump `nixbuild/nix-quick-install-action` from v31 to v32 in workflow

- Updates CI to use latest Nix installer action version

- No application or logic changes, CI/dependency update only


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Dependencies</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>gen_schedule_update_deps.yaml</strong><dd><code>Update
Nix installer action to v32 in workflow</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/gen_schedule_update_deps.yaml

<li>Updated GitHub Actions workflow to use
<br><code>nixbuild/nix-quick-install-action@v32</code> instead of
v31<br> <li> Ensures CI uses the latest version of the Nix installer
action


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/244/files#diff-ae003e22c1e5cbf186e1749d77dec35965e521d2583ba8cf45fcb1c8f300e177">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-26 10:31:23 +02:00
dependabot[bot]
75a508afe8 chore: bump nixbuild/nix-quick-install-action from 30 to 31 (#242)
### **User description**
Bumps
[nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action)
from 30 to 31.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/releases">nixbuild/nix-quick-install-action's
releases</a>.</em></p>
<blockquote>
<h2>nixbuild/nix-quick-install-action@v31</h2>
<h2>Changes</h2>
<ul>
<li>
<p>Remove Nix versions: 2.25.5</p>
</li>
<li>
<p>Bump minor Nix versions: 2.24.12 -&gt; 2.24.14, 2.26.1 -&gt; 2.26.3
2.21.0 -&gt; 2.21.4.</p>
</li>
<li>
<p>Add Nix versions: 2.28.3, 2.29.0</p>
</li>
<li>
<p>Bump default Nix version: 2.24.12 -&gt; 2.29.0</p>
</li>
<li>
<p>Fix issue with 'experimental-features' setting getting overwritten
(<a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/66">#66</a>).</p>
</li>
</ul>
<h2>Supported Nix Versions on x86_64-linux runners</h2>
<ul>
<li>2.29.0</li>
<li>2.28.3</li>
<li>2.26.3</li>
<li>2.24.14</li>
<li>2.3.18</li>
</ul>
<h2>Supported Nix Versions on aarch64-linux runners</h2>
<ul>
<li>2.29.0</li>
<li>2.28.3</li>
<li>2.26.3</li>
<li>2.24.14</li>
</ul>
<h2>Supported Nix Versions on x86_64-darwin runners</h2>
<ul>
<li>2.29.0</li>
<li>2.28.3</li>
<li>2.26.3</li>
<li>2.24.14</li>
<li>2.3.18</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE">nixbuild/nix-quick-install-action's
changelog</a>.</em></p>
<blockquote>
<p>v31</p>
<h2>Changes</h2>
<ul>
<li>
<p>Remove Nix versions: 2.25.5</p>
</li>
<li>
<p>Bump minor Nix versions: 2.24.12 -&gt; 2.24.14, 2.26.1 -&gt; 2.26.3
2.21.0 -&gt; 2.21.4.</p>
</li>
<li>
<p>Add Nix versions: 2.28.3, 2.29.0</p>
</li>
<li>
<p>Bump default Nix version: 2.24.12 -&gt; 2.29.0</p>
</li>
<li>
<p>Fix issue with 'experimental-features' setting getting overwritten
(<a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/66">#66</a>).</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="889f3180bb"><code>889f318</code></a>
Release v31</li>
<li><a
href="09d596a493"><code>09d596a</code></a>
Fix workflow</li>
<li><a
href="ce8e5b9320"><code>ce8e5b9</code></a>
Document <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/45">#45</a></li>
<li><a
href="d9bcabc69f"><code>d9bcabc</code></a>
Avoid overwriting user-supplied experimental-feature setting. Fixes <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/66">#66</a>.</li>
<li><a
href="9eb57d6652"><code>9eb57d6</code></a>
Remove unused file</li>
<li><a
href="b6ab472bc4"><code>b6ab472</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/67">#67</a>
from nixbuild/nix_2_29</li>
<li><a
href="255feab0a1"><code>255feab</code></a>
Add Nix 2.29. Remove deprecated version 2.25.</li>
<li><a
href="8505cd40ae"><code>8505cd4</code></a>
Update README and workflows for v30</li>
<li>See full diff in <a
href="https://github.com/nixbuild/nix-quick-install-action/compare/v30...v31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nixbuild/nix-quick-install-action&package-manager=github_actions&previous-version=30&new-version=31)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>


___

### **PR Type**
Other


___

### **Description**
- Bump nixbuild/nix-quick-install-action from v30 to v31

- Updates GitHub Actions dependency for Nix installation

- Includes newer Nix versions and bug fixes


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Dependencies</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>gen_schedule_update_deps.yaml</strong><dd><code>Update
Nix installation action version</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/gen_schedule_update_deps.yaml

- Update nixbuild/nix-quick-install-action version from v30 to v31


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/242/files#diff-ae003e22c1e5cbf186e1749d77dec35965e521d2583ba8cf45fcb1c8f300e177">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 08:44:24 +02:00
dependabot[bot]
a7353a83fd chore: bump Codium-ai/pr-agent from 0.29 to 0.30 (#243)
### **User description**
Bumps [Codium-ai/pr-agent](https://github.com/codium-ai/pr-agent) from
0.29 to 0.30.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/codium-ai/pr-agent/releases">Codium-ai/pr-agent's
releases</a>.</em></p>
<blockquote>
<h2>v0.30</h2>
<p>codiumai/pr-agent:0.30
codiumai/pr-agent:0.30-github_app
codiumai/pr-agent:0.30-bitbucket-app
codiumai/pr-agent:0.30-gitlab_webhook
codiumai/pr-agent:0.30-github_action
codiumai/pr-agent:0.30-azure_devops_webhook
codiumai/pr-agent:0.30-gitea-app</p>
<h2>What's Changed</h2>
<ul>
<li>Adding num_max_findings configuration parameter by <a
href="https://github.com/GuBee33"><code>@​GuBee33</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1797">qodo-ai/pr-agent#1797</a></li>
<li>docs: document how to auto-trigger /add_docs via pr_commands by <a
href="https://github.com/jmsb02"><code>@​jmsb02</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1795">qodo-ai/pr-agent#1795</a></li>
<li>Revise the review effort label text in the review document by <a
href="https://github.com/seohyun-lee"><code>@​seohyun-lee</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1799">qodo-ai/pr-agent#1799</a></li>
<li>Add incremental update to documentation by <a
href="https://github.com/sharoneyal"><code>@​sharoneyal</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1796">qodo-ai/pr-agent#1796</a></li>
<li><a
href="https://redirect.github.com/codium-ai/pr-agent/issues/1657">#1657</a>
add gitea/forgejo support by <a
href="https://github.com/nicholasgribanov"><code>@​nicholasgribanov</code></a>
in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1787">qodo-ai/pr-agent#1787</a></li>
<li>Correct typos in documentation and log messages by <a
href="https://github.com/seohyun-lee"><code>@​seohyun-lee</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1798">qodo-ai/pr-agent#1798</a></li>
<li>fix: reorder exception handling in
<code>LiteLLMAIHandler.chat_completion()</code> by <a
href="https://github.com/KangmoonSeo"><code>@​KangmoonSeo</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1803">qodo-ai/pr-agent#1803</a></li>
<li>Update LICENSE by <a
href="https://github.com/mrT23"><code>@​mrT23</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1809">qodo-ai/pr-agent#1809</a></li>
<li>docs: include [aws] in .secrets.template by <a
href="https://github.com/darkdread"><code>@​darkdread</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1801">qodo-ai/pr-agent#1801</a></li>
<li>fix: exclude RateLimitError from <code>@retry</code> in
<code>AIHandler.chat_completion()</code> by <a
href="https://github.com/KangmoonSeo"><code>@​KangmoonSeo</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1808">qodo-ai/pr-agent#1808</a></li>
<li>Add unit tests for try_fix_yaml function by <a
href="https://github.com/jwsong98"><code>@​jwsong98</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1812">qodo-ai/pr-agent#1812</a></li>
<li>feat: add support for Claude 4 family by <a
href="https://github.com/hirobf10"><code>@​hirobf10</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1814">qodo-ai/pr-agent#1814</a></li>
<li>Add Grok-3 non-beta model IDs by <a
href="https://github.com/PeterDaveHello"><code>@​PeterDaveHello</code></a>
in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1817">qodo-ai/pr-agent#1817</a></li>
<li>Add Unit Tests and Improve Documentation for utils.py clip_tokens
Function by <a
href="https://github.com/TaskerJang"><code>@​TaskerJang</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1816">qodo-ai/pr-agent#1816</a></li>
<li>Refactor count_tokens method structure in token_handler.py for
better extensibility by <a
href="https://github.com/Kkan9ma"><code>@​Kkan9ma</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1805">qodo-ai/pr-agent#1805</a></li>
<li>Improve/describe tool documentation and make add_diagram feature
opt-in by default by <a
href="https://github.com/ssunbear"><code>@​ssunbear</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1824">qodo-ai/pr-agent#1824</a></li>
<li>fix: ensure proper formatting of changes_diagram in PR description
ou… by <a href="https://github.com/mrT23"><code>@​mrT23</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1827">qodo-ai/pr-agent#1827</a></li>
<li>fix(test_language_handler): Add edge case for files with unknown
extensions by <a
href="https://github.com/wonggamggik"><code>@​wonggamggik</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1818">qodo-ai/pr-agent#1818</a></li>
<li>Feature/test get max tokens by <a
href="https://github.com/wonggamggik"><code>@​wonggamggik</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1819">qodo-ai/pr-agent#1819</a></li>
<li>Complete Gemini 2.5 Flash model info by <a
href="https://github.com/PeterDaveHello"><code>@​PeterDaveHello</code></a>
in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1822">qodo-ai/pr-agent#1822</a></li>
<li>Add unit tests for fix_json_escape_char function by <a
href="https://github.com/idealHyun"><code>@​idealHyun</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1825">qodo-ai/pr-agent#1825</a></li>
<li>test: add tests for converting to markdown by <a
href="https://github.com/dst03106"><code>@​dst03106</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1829">qodo-ai/pr-agent#1829</a></li>
<li>docs: correct parameter name typo and update description by <a
href="https://github.com/isExample"><code>@​isExample</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1831">qodo-ai/pr-agent#1831</a></li>
<li>Refactor: Enhance AI Handler Robustness, Interface Compliance, and
Asynchronous Operations (Resolves <a
href="https://redirect.github.com/codium-ai/pr-agent/issues/1784">#1784</a>)
by <a href="https://github.com/Akileox"><code>@​Akileox</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1828">qodo-ai/pr-agent#1828</a></li>
<li>[Feature] - Gitea implement by <a
href="https://github.com/pinyoothotaboot"><code>@​pinyoothotaboot</code></a>
in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1811">qodo-ai/pr-agent#1811</a></li>
<li>docs: add dedicated &quot;Chat on code suggestions&quot; core
ability by <a
href="https://github.com/ofir-frd"><code>@​ofir-frd</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1835">qodo-ai/pr-agent#1835</a></li>
<li>docs: enhance review.md with ticket compliance labels and merge
block… by <a href="https://github.com/mrT23"><code>@​mrT23</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1837">qodo-ai/pr-agent#1837</a></li>
<li>docs: add Linear integration to ticket context fetching
documentation by <a
href="https://github.com/hussam789"><code>@​hussam789</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1838">qodo-ai/pr-agent#1838</a></li>
<li>Reorganize and Enhance Tools Documentation with Improved Navigation
and Consistency
by <a href="https://github.com/ofir-frd"><code>@​ofir-frd</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1840">qodo-ai/pr-agent#1840</a></li>
<li>feat: add AWS Secrets Manager Integration for Lambda deployments by
<a href="https://github.com/yamoyamoto"><code>@​yamoyamoto</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1839">qodo-ai/pr-agent#1839</a></li>
<li>docs: update trial usage information to reflect new quota-based
model by <a href="https://github.com/mrT23"><code>@​mrT23</code></a> in
<a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1832">qodo-ai/pr-agent#1832</a></li>
<li>docs: add global hierarchical best practices system by <a
href="https://github.com/ofir-frd"><code>@​ofir-frd</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1844">qodo-ai/pr-agent#1844</a></li>
<li>Hl/multi jira server docs by <a
href="https://github.com/hussam789"><code>@​hussam789</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1845">qodo-ai/pr-agent#1845</a></li>
<li>Update atlassian-connect.json by <a
href="https://github.com/hussam789"><code>@​hussam789</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1850">qodo-ai/pr-agent#1850</a></li>
<li>Add Google Gemini 2.5 Pro Preview 06-05 by <a
href="https://github.com/PeterDaveHello"><code>@​PeterDaveHello</code></a>
in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1853">qodo-ai/pr-agent#1853</a></li>
<li>Fix gitea get file content error by <a
href="https://github.com/SCREEN88"><code>@​SCREEN88</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1852">qodo-ai/pr-agent#1852</a></li>
<li>chore: add APAC region endpoints for Bedrock Anthropic Claude models
by <a href="https://github.com/kebhr"><code>@​kebhr</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1851">qodo-ai/pr-agent#1851</a></li>
<li>docs: update PR benchmark to ranking-based methodology with expanded
… by <a href="https://github.com/mrT23"><code>@​mrT23</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1866">qodo-ai/pr-agent#1866</a></li>
<li>Add GitLab support for CHANGELOG.md by <a
href="https://github.com/cesdperez"><code>@​cesdperez</code></a> in <a
href="https://redirect.github.com/qodo-ai/pr-agent/pull/1856">qodo-ai/pr-agent#1856</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="eb4cdbb115"><code>eb4cdbb</code></a>
fix: remove branch parameter from get_content_of_file call in bitbucket
serve...</li>
<li><a
href="7f54b14b4d"><code>7f54b14</code></a>
Merge pull request <a
href="https://redirect.github.com/codium-ai/pr-agent/issues/1874">#1874</a>
from yoohya/feat/support-gitlab-lambda-webhooks</li>
<li><a
href="938ab9a139"><code>938ab9a</code></a>
fix: remove redundant word 'possible' from security concerns field
description</li>
<li><a
href="75bde39b03"><code>75bde39</code></a>
Merge pull request <a
href="https://redirect.github.com/codium-ai/pr-agent/issues/1888">#1888</a>
from qodo-ai/tr/simplify_toDo</li>
<li><a
href="ee36c0208c"><code>ee36c02</code></a>
Update pr_agent/settings/pr_reviewer_prompts.toml</li>
<li><a
href="7c02678ba5"><code>7c02678</code></a>
refactor: extract TODO formatting functions and simplify data
structure</li>
<li><a
href="235df737d0"><code>235df73</code></a>
docs: update Docker image tags</li>
<li><a
href="37ef4bad8f"><code>37ef4ba</code></a>
docs: add bullet point formatting instruction to PR description
prompts</li>
<li><a
href="ab7e0d9141"><code>ab7e0d9</code></a>
refactor: split serverless handlers into dedicated GitHub and GitLab
Lambda e...</li>
<li><a
href="7db4d97fc2"><code>7db4d97</code></a>
Merge pull request <a
href="https://redirect.github.com/codium-ai/pr-agent/issues/1880">#1880</a>
from alessio-locatelli/fix_yes_no</li>
<li>Additional commits viewable in <a
href="https://github.com/codium-ai/pr-agent/compare/v0.29...v0.30">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Codium-ai/pr-agent&package-manager=github_actions&previous-version=0.29&new-version=0.30)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>


___

### **PR Type**
Other


___

### **Description**
- Bump Codium-ai/pr-agent GitHub Action from v0.29 to v0.30

- Update dependency version in workflow configuration

- Maintain existing workflow functionality and permissions


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Dependencies</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>gen_ai_review.yaml</strong><dd><code>Update pr-agent
action version</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

.github/workflows/gen_ai_review.yaml

- Updated Codium-ai/pr-agent action version from v0.29 to v0.30


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/243/files#diff-d1e4c772e0acb5ce4891df2dd94ba58ffaf6393e8f75493ec7e10cbce1c4992c">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 08:38:18 +02:00
David Barroso
c2b5a499af chore: update CI (#240)
### **PR Type**
Enhancement


___

### **Description**
• Enhanced CI security with permission checks and safe_to_test label
• Added AI-powered PR review workflow with Claude integration
• Migrated to Blacksmith runners and S3-based Nix cache
• Improved AWS integration with OIDC and ECR authentication


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>checks.yaml</strong><dd><code>Enhanced security with
permission checks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

.github/workflows/checks.yaml

• Changed trigger from <code>pull_request</code> to
<code>pull_request_target</code> for <br>security<br> • Added permission
check job requiring <code>safe_to_test</code> label or <br>trusted
user<br> • Added secrets for AWS account, Nix cache keys<br> • Added
<br>job to automatically remove <code>safe_to_test</code> label after
use


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/240/files#diff-4af11422a4987e947e5a47adead7a30d32cdb2db82e2d3fe36f8e6cbe84d5ac5">+36/-2</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>gen_ai_review.yaml</strong><dd><code>Added AI review
workflow</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/gen_ai_review.yaml

• New workflow for AI-powered PR reviews using Claude Sonnet model<br> •
<br>Triggers on PR events and issue comments<br> • Configured with
OpenAI and <br>Anthropic API keys<br> • Ignores generated files and
vendor directories


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/240/files#diff-d1e4c772e0acb5ce4891df2dd94ba58ffaf6393e8f75493ec7e10cbce1c4992c">+27/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>wf_build_artifacts.yaml</strong><dd><code>Migrated to
Blacksmith runners and S3 cache</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

.github/workflows/wf_build_artifacts.yaml

• Migrated from Ubuntu runners to Blacksmith ARM/x64 runners<br> •
<br>Replaced Magic Nix Cache with S3-based cache using AWS
credentials<br> • <br>Added AWS OIDC configuration and ECR
integration<br> • Improved <br>architecture detection and artifact
naming


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/240/files#diff-63d6f3e2e5894df4d88cf2c82b3d0c90e7b0b7c8ca9da25a3d46f35f15270fb0">+28/-22</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>wf_check.yaml</strong><dd><code>Enhanced checks with
AWS integration</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/wf_check.yaml

• Migrated to Blacksmith ARM runner with reduced timeout<br> • Added AWS
<br>OIDC and ECR login configuration<br> • Replaced Magic Nix Cache with
<br>S3-based cache<br> • Enhanced build verification for both Go and
Node <br>components


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/240/files#diff-c2ecea6736037ba6304681d744d612d44d7681788d2fbc58ce223cf52ecefa43">+47/-25</a>&nbsp;
</td>

</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>release.yaml</strong><dd><code>Updated release workflow
secrets</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/release.yaml

• Added secrets for AWS account and Nix cache keys<br> • Removed
<code>DOCKER</code> <br>input parameter from build artifacts call


</details>


  </td>
<td><a
href="https://github.com/nhost/hasura-storage/pull/240/files#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05ada">+9/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-05-30 11:39:15 +02:00
David Barroso
b0a2ceb368 chore: update dependencies (#238) 2025-05-06 11:44:25 +02:00
dependabot[bot]
a957f4051a chore: bump cachix/install-nix-action from 30 to 31 (#236)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from 30 to 31.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/install-nix-action/releases">cachix/install-nix-action's
releases</a>.</em></p>
<blockquote>
<h2>v31</h2>
<h2>What's Changed</h2>
<ul>
<li>nix: 2.24.9 -&gt; 2.25.2 by <a
href="https://github.com/Mic92"><code>@​Mic92</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/218">cachix/install-nix-action#218</a></li>
<li>ci: fix latest installer tests by <a
href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/220">cachix/install-nix-action#220</a></li>
<li>ci: add ubuntu-24.04-arm to matrix by <a
href="https://github.com/msgilligan"><code>@​msgilligan</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/221">cachix/install-nix-action#221</a></li>
<li>nix: 2.25.2 -&gt; 2.26.2 by <a
href="https://github.com/Mic92"><code>@​Mic92</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/226">cachix/install-nix-action#226</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/msgilligan"><code>@​msgilligan</code></a> made
their first contribution in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/221">cachix/install-nix-action#221</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cachix/install-nix-action/compare/v30...v31">https://github.com/cachix/install-nix-action/compare/v30...v31</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="91a0719595"><code>91a0719</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/226">#226</a>
from Mic92/nix-update</li>
<li><a
href="d81eadf041"><code>d81eadf</code></a>
nix: 2.25.2 -&gt; 2.26.2</li>
<li><a
href="3d69a1d4d2"><code>3d69a1d</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/221">#221</a>
from msgilligan/msgilligan/github-test-aarch64-linux</li>
<li><a
href="265a04a520"><code>265a04a</code></a>
GitHub test.yml: add ubuntu-24.04-arm to matrix</li>
<li><a
href="89fd1e98db"><code>89fd1e9</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/220">#220</a>
from cachix/fix-master-tests</li>
<li><a
href="a76df16350"><code>a76df16</code></a>
ci: bump nixpkgs channel</li>
<li><a
href="a49b703498"><code>a49b703</code></a>
ci: fix act test</li>
<li><a
href="f3f544c44b"><code>f3f544c</code></a>
ci: fix latest installer tests</li>
<li><a
href="14344b39ca"><code>14344b3</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/218">#218</a>
from Mic92/nix-upgrade</li>
<li><a
href="b1deb06f62"><code>b1deb06</code></a>
nix: 2.24.9 -&gt; 2.25.2</li>
<li>See full diff in <a
href="https://github.com/cachix/install-nix-action/compare/v30...v31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/install-nix-action&package-manager=github_actions&previous-version=30&new-version=31)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-11 10:34:33 +01:00
David Barroso
47bd415a97 chore: update minio (#235) 2025-03-05 15:40:10 +01:00
dependabot[bot]
730948f07b chore: bump nixbuild/nix-quick-install-action from 29 to 30 (#234)
Bumps
[nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action)
from 29 to 30.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/releases">nixbuild/nix-quick-install-action's
releases</a>.</em></p>
<blockquote>
<h2>nixbuild/nix-quick-install-action@v30</h2>
<h2>Changes</h2>
<ul>
<li>
<p>Remove Nix versions: 2.18.8, 2.19.6, 2.20.8, 2.21.4, 2.23.3</p>
</li>
<li>
<p>Bump minor Nix versions: 2.24.9 -&gt; 2.24.12
2.21.0 -&gt; 2.21.4.</p>
</li>
<li>
<p>Add Nix versions: 2.25.5, 2.26.1</p>
</li>
<li>
<p>Bump default Nix version: 2.24.9 -&gt; 2.24.12</p>
</li>
<li>
<p>Add support for <code>ubuntu-24.04-arm</code> (aarch64-linux)
runners.</p>
</li>
<li>
<p>Enable support for KVM in builds. Can be turned off with the new
<code>enable_kvm</code>
configuration option.</p>
</li>
</ul>
<h2>Supported Nix Versions on x86_64-linux runners</h2>
<ul>
<li>2.26.1</li>
<li>2.25.5</li>
<li>2.24.12</li>
<li>2.3.18</li>
</ul>
<h2>Supported Nix Versions on aarch64-linux runners</h2>
<ul>
<li>2.26.1</li>
<li>2.25.5</li>
<li>2.24.12</li>
</ul>
<h2>Supported Nix Versions on x86_64-darwin runners</h2>
<ul>
<li>2.26.1</li>
<li>2.25.5</li>
<li>2.24.12</li>
<li>2.3.18</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE">nixbuild/nix-quick-install-action's
changelog</a>.</em></p>
<blockquote>
<p>v30</p>
<h2>Changes</h2>
<ul>
<li>
<p>Remove Nix versions: 2.18.8, 2.19.6, 2.20.8, 2.21.4, 2.23.3</p>
</li>
<li>
<p>Bump minor Nix versions: 2.24.9 -&gt; 2.24.12
2.21.0 -&gt; 2.21.4.</p>
</li>
<li>
<p>Add Nix versions: 2.25.5, 2.26.1</p>
</li>
<li>
<p>Bump default Nix version: 2.24.9 -&gt; 2.24.12</p>
</li>
<li>
<p>Add support for <code>ubuntu-24.04-arm</code> (aarch64-linux)
runners.</p>
</li>
<li>
<p>Enable support for KVM in builds. Can be turned off with the new
<code>enable_kvm</code>
configuration option.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5bb6a3b3ab"><code>5bb6a3b</code></a>
Release v30</li>
<li><a
href="607b4cf724"><code>607b4cf</code></a>
Remove outdated documentation (fixes <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/57">#57</a>)</li>
<li><a
href="5f5c23a20a"><code>5f5c23a</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/52">#52</a>
from azuwis/macos-volume</li>
<li><a
href="9f331f3772"><code>9f331f3</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/59">#59</a>
from nixbuild/readd_nix_2_3</li>
<li><a
href="904096fd8f"><code>904096f</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/56">#56</a>
from Smona/enable-kvm-on-linux</li>
<li><a
href="acdadbc3a6"><code>acdadbc</code></a>
Nix 2.3 doesn't work on aarch64-linux for some reason</li>
<li><a
href="0006832f24"><code>0006832</code></a>
ci: Fix syntax</li>
<li><a
href="450f0c1fe7"><code>450f0c1</code></a>
ci: Exclude Nix 2.3 on aarch64-linux</li>
<li><a
href="900859c11a"><code>900859c</code></a>
Add back Nix 2.3</li>
<li><a
href="73e45e62a2"><code>73e45e6</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/58">#58</a>
from deemp/master</li>
<li>Additional commits viewable in <a
href="https://github.com/nixbuild/nix-quick-install-action/compare/v29...v30">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nixbuild/nix-quick-install-action&package-manager=github_actions&previous-version=29&new-version=30)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 14:48:43 +01:00
Jason Overmier
818654f8ef feat: Reduce AVIF Transform CPU Load by Lowering Effort Level (#233)
## Problem
The default AVIF encoding effort level was set to 5, which resulted in
high CPU usage during image transformations. This could make the storage
service resource-intensive and less suitable for lightweight or
small-server deployments.

## Solution
Set the AVIF effort level to 0 (fastest) instead of the default 5. This
change significantly reduces CPU load during image transformation,
making the storage service more efficient and lightweight.

## Notes
Lower effort levels trade off some compression efficiency for reduced
CPU usage.
This adjustment helps optimize performance on small-scale servers while
still maintaining acceptable image quality.
2025-02-28 12:04:16 +01:00
David Barroso
6790c7d08f feat: added support for avif and "format" query arg to transform output format (#232)
Fixes https://github.com/nhost/nhost/issues/2508 and
https://github.com/nhost/nhost/issues/3212
2025-02-21 07:16:03 +01:00
David Barroso
5f1a23960a chore: update dependencies (#231) 2025-02-03 16:14:47 +01:00
dependabot[bot]
e4da899d59 chore: bump DeterminateSystems/magic-nix-cache-action from 8 to 9 (#230)
Bumps
[DeterminateSystems/magic-nix-cache-action](https://github.com/determinatesystems/magic-nix-cache-action)
from 8 to 9.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/determinatesystems/magic-nix-cache-action/releases">DeterminateSystems/magic-nix-cache-action's
releases</a>.</em></p>
<blockquote>
<h2>v9</h2>
<h2>What's Changed</h2>
<ul>
<li>ci workflow: don't check initial substituter list by <a
href="https://github.com/colemickens"><code>@​colemickens</code></a> in
<a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/90">DeterminateSystems/magic-nix-cache-action#90</a></li>
<li>Matrix by <a
href="https://github.com/grahamc"><code>@​grahamc</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/96">DeterminateSystems/magic-nix-cache-action#96</a></li>
<li>Update <code>detsys-ts</code>: Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/69">#69</a>
from DeterminateSystems/update-deps by <a
href="https://github.com/detsys-pr-bot"><code>@​detsys-pr-bot</code></a>
in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/99">DeterminateSystems/magic-nix-cache-action#99</a></li>
<li>Fixup diagnostic URL handling by <a
href="https://github.com/grahamc"><code>@​grahamc</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/100">DeterminateSystems/magic-nix-cache-action#100</a></li>
<li>Diagnostics by <a
href="https://github.com/grahamc"><code>@​grahamc</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/101">DeterminateSystems/magic-nix-cache-action#101</a></li>
<li>Warn on mnc usage by <a
href="https://github.com/grahamc"><code>@​grahamc</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/102">DeterminateSystems/magic-nix-cache-action#102</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/DeterminateSystems/magic-nix-cache-action/compare/v8...v9">https://github.com/DeterminateSystems/magic-nix-cache-action/compare/v8...v9</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6221693898"><code>6221693</code></a>
Warn on mnc usage (<a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/102">#102</a>)</li>
<li><a
href="f7eb5b510a"><code>f7eb5b5</code></a>
Diagnostics (<a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/101">#101</a>)</li>
<li><a
href="fe89a484fe"><code>fe89a48</code></a>
Fixup diagnostic URL handling (<a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/100">#100</a>)</li>
<li><a
href="13dabe8ccc"><code>13dabe8</code></a>
Update <code>detsys-ts</code> for: `Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/69">#69</a>
from DeterminateSystems/updat...</li>
<li><a
href="9ab3ce70d6"><code>9ab3ce7</code></a>
Matrix (<a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/96">#96</a>)</li>
<li><a
href="a76a83091c"><code>a76a830</code></a>
ci workflow: don't check initial substituter list (<a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/90">#90</a>)</li>
<li>See full diff in <a
href="https://github.com/determinatesystems/magic-nix-cache-action/compare/v8...v9">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=DeterminateSystems/magic-nix-cache-action&package-manager=github_actions&previous-version=8&new-version=9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 10:00:05 +01:00
dependabot[bot]
b2dc2dd8f9 chore: bump nixbuild/nix-quick-install-action from 28 to 29 (#229)
Bumps
[nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action)
from 28 to 29.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/releases">nixbuild/nix-quick-install-action's
releases</a>.</em></p>
<blockquote>
<h2>nixbuild/nix-quick-install-action@v29</h2>
<h2>Changes</h2>
<ul>
<li>
<p>Bump minor Nix versions: 2.18.2 -&gt; 2.18.8, 2.19.3 -&gt; 2.19.6,
2.20.5 -&gt; 2.20.8,
2.21.0 -&gt; 2.21.4.</p>
</li>
<li>
<p>Add Nix versions: 2.22.3, 2.23.3, 2.24.9</p>
</li>
<li>
<p>Bump default Nix version: 2.21.0 -&gt; 2.24.9</p>
</li>
<li>
<p>Add support for <code>macos-14</code> (ARM64) runners, and remove
support for deprecated
runners. The supported runners are now <code>ubuntu-22.04</code>,
<code>macos-13</code> and
<code>macos-14</code>. Other runners might work, but are not tested by
the
<code>nix-quick-install-action</code> CI.</p>
</li>
</ul>
<h2>Supported Nix Versions on Linux Runners</h2>
<ul>
<li>2.24.9</li>
<li>2.23.3</li>
<li>2.22.3</li>
<li>2.21.4</li>
<li>2.20.8</li>
<li>2.19.6</li>
<li>2.18.8</li>
<li>2.3.18</li>
</ul>
<h2>Supported Nix Versions on MacOS Runners</h2>
<ul>
<li>2.24.9</li>
<li>2.23.3</li>
<li>2.22.3</li>
<li>2.21.4</li>
<li>2.20.8</li>
<li>2.19.6</li>
<li>2.18.8</li>
<li>2.3.18</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE">nixbuild/nix-quick-install-action's
changelog</a>.</em></p>
<blockquote>
<p>v29</p>
<h2>Changes</h2>
<ul>
<li>
<p>Bump minor Nix versions: 2.18.2 -&gt; 2.18.8, 2.19.3 -&gt; 2.19.6,
2.20.5 -&gt; 2.20.8,
2.21.0 -&gt; 2.21.4.</p>
</li>
<li>
<p>Add Nix versions: 2.22.3, 2.23.3, 2.24.9</p>
</li>
<li>
<p>Bump default Nix version: 2.21.0 -&gt; 2.24.9</p>
</li>
<li>
<p>Add support for <code>macos-14</code> (ARM64) runners, and remove
support for deprecated
runners. The supported runners are now <code>ubuntu-22.04</code>,
<code>macos-13</code> and
<code>macos-14</code>. Other runners might work, but are not tested by
the
<code>nix-quick-install-action</code> CI.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="25aff27c25"><code>25aff27</code></a>
Release v29</li>
<li><a
href="e2067cf49b"><code>e2067cf</code></a>
flake: Remove unused system</li>
<li><a
href="4ed3e0f5c8"><code>4ed3e0f</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/51">#51</a>
from nixbuild/update-actions</li>
<li><a
href="1e71a36371"><code>1e71a36</code></a>
ci: Add arch to artifact names</li>
<li><a
href="da4598eac4"><code>da4598e</code></a>
ci: Update actions</li>
<li><a
href="1a459e021e"><code>1a459e0</code></a>
Work around MacOS Arm64 bootstrap problem</li>
<li><a
href="55b85d501e"><code>55b85d5</code></a>
ci: Also build with macos-14 so MacOS Arm64 artifacts are produced</li>
<li><a
href="843aed6c2a"><code>843aed6</code></a>
Fix incorrect env var in install script</li>
<li><a
href="4f426bb427"><code>4f426bb</code></a>
Remove obsolete comment in install script</li>
<li><a
href="eb8469b4e1"><code>eb8469b</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/47">#47</a>
from dbarrosop/master</li>
<li>Additional commits viewable in <a
href="https://github.com/nixbuild/nix-quick-install-action/compare/v28...v29">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nixbuild/nix-quick-install-action&package-manager=github_actions&previous-version=28&new-version=29)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-06 08:55:46 +01:00
github-actions[bot]
c21d1d4547 chore: modify update dependencies schedule (#228)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-11-01 09:53:33 +01:00
dependabot[bot]
e0c0709d1e chore: bump cachix/install-nix-action from 29 to 30 (#226)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from 29 to 30.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/install-nix-action/releases">cachix/install-nix-action's
releases</a>.</em></p>
<blockquote>
<h2>v30</h2>
<ul>
<li>Nix: 2.24.7 -&gt; 2.24.9, fixing <a
href="https://github.com/NixOS/nix/security/advisories/GHSA-6fjr-mq49-mm2c">GHSA-6fjr-mq49-mm2c</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="08dcb3a5e6"><code>08dcb3a</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/217">#217</a>
from Enzime/bump</li>
<li><a
href="4204e15198"><code>4204e15</code></a>
nix: 2.24.8 -&gt; 2.24.9</li>
<li><a
href="6a10e2e9fd"><code>6a10e2e</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/216">#216</a>
from Mic92/nix-bump</li>
<li><a
href="2bb614e91a"><code>2bb614e</code></a>
Nix: 2.24.7 -&gt; 2.24.8</li>
<li>See full diff in <a
href="https://github.com/cachix/install-nix-action/compare/v29...v30">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/install-nix-action&package-manager=github_actions&previous-version=29&new-version=30)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-04 09:42:07 +02:00
github-actions[bot]
449f1c58cf [Scheduled] Update dependencies (#225)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

---------

Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-10-01 09:26:15 +02:00
dependabot[bot]
97eb40b2a2 chore: bump cachix/install-nix-action from V28 to 29 (#224)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from V28 to 29. This release includes the previously tagged commit.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/install-nix-action/releases">cachix/install-nix-action's
releases</a>.</em></p>
<blockquote>
<h2>v29</h2>
<p>Bumps Nix to 2.24.8 to fix CVE-2024-47174</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="9f70348d77"><code>9f70348</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/215">#215</a>
from Mic92/nix-bump</li>
<li><a
href="4f91dc2b65"><code>4f91dc2</code></a>
Nix: 2.24.6 -&gt; 2.24.7</li>
<li>See full diff in <a
href="https://github.com/cachix/install-nix-action/compare/V28...v29">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-27 12:07:53 +02:00
dependabot[bot]
d2e05005ed chore: bump cachix/install-nix-action from 27 to 28 (#222)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from 27 to 28.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/install-nix-action/releases">cachix/install-nix-action's
releases</a>.</em></p>
<blockquote>
<h2>v28</h2>
<p>Nix 2.24.6 - <a
href="https://github.com/NixOS/nix/security/advisories/GHSA-h4vv-h3jq-v493">https://github.com/NixOS/nix/security/advisories/GHSA-h4vv-h3jq-v493</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3715ab1a11"><code>3715ab1</code></a>
bump channel</li>
<li><a
href="1872f1ff9d"><code>1872f1f</code></a>
Nix: 2.22.1 -&gt; 2.24.6</li>
<li><a
href="e268b7aa05"><code>e268b7a</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/213">#213</a>
from phaer/patch-1</li>
<li><a
href="5b8c65d4d7"><code>5b8c65d</code></a>
Update README: hardware accel is available now...</li>
<li><a
href="ba01fffc51"><code>ba01fff</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/210">#210</a>
from guoard/patch-1</li>
<li><a
href="474f0a77aa"><code>474f0a7</code></a>
docs(readme): update checkout action version</li>
<li><a
href="725982224c"><code>7259822</code></a>
readme: V27</li>
<li>See full diff in <a
href="https://github.com/cachix/install-nix-action/compare/v27...V28">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/install-nix-action&package-manager=github_actions&previous-version=27&new-version=28)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 08:08:59 +02:00
dependabot[bot]
168c433729 chore: bump DeterminateSystems/magic-nix-cache-action from 7 to 8 (#221)
Bumps
[DeterminateSystems/magic-nix-cache-action](https://github.com/determinatesystems/magic-nix-cache-action)
from 7 to 8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/determinatesystems/magic-nix-cache-action/releases">DeterminateSystems/magic-nix-cache-action's
releases</a>.</em></p>
<blockquote>
<h2>v8</h2>
<h2>What's Changed</h2>
<ul>
<li>RUST_LOG default to tracing our stuff, only debug for everything
else by <a
href="https://github.com/colemickens"><code>@​colemickens</code></a> in
<a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/63">DeterminateSystems/magic-nix-cache-action#63</a></li>
<li>Remove package-lock.json by <a
href="https://github.com/lucperkins"><code>@​lucperkins</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/64">DeterminateSystems/magic-nix-cache-action#64</a></li>
<li>Prevent the Action from failing with strict mode disabled by <a
href="https://github.com/lucperkins"><code>@​lucperkins</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/62">DeterminateSystems/magic-nix-cache-action#62</a></li>
<li>Fix nullish coalescing by <a
href="https://github.com/lucperkins"><code>@​lucperkins</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/65">DeterminateSystems/magic-nix-cache-action#65</a></li>
<li>Update detsys-ts by <a
href="https://github.com/lucperkins"><code>@​lucperkins</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/66">DeterminateSystems/magic-nix-cache-action#66</a></li>
<li>Provide info output for potential missing permissions block by <a
href="https://github.com/lucperkins"><code>@​lucperkins</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/73">DeterminateSystems/magic-nix-cache-action#73</a></li>
<li>Bump fast-xml-parser from 4.4.0 to 4.4.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/75">DeterminateSystems/magic-nix-cache-action#75</a></li>
<li>Update fast-xml-parser by <a
href="https://github.com/lucperkins"><code>@​lucperkins</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/78">DeterminateSystems/magic-nix-cache-action#78</a></li>
<li>Don't run the &quot;trusted&quot; checks if we're in a PR by <a
href="https://github.com/grahamc"><code>@​grahamc</code></a> in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/85">DeterminateSystems/magic-nix-cache-action#85</a></li>
<li>Update <code>detsys-ts</code>: Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/63">#63</a>
from DeterminateSystems/retry-streams by <a
href="https://github.com/detsys-pr-bot"><code>@​detsys-pr-bot</code></a>
in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/84">DeterminateSystems/magic-nix-cache-action#84</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/colemickens"><code>@​colemickens</code></a>
made their first contribution in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/63">DeterminateSystems/magic-nix-cache-action#63</a></li>
<li><a
href="https://github.com/dependabot"><code>@​dependabot</code></a> made
their first contribution in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/75">DeterminateSystems/magic-nix-cache-action#75</a></li>
<li><a
href="https://github.com/detsys-pr-bot"><code>@​detsys-pr-bot</code></a>
made their first contribution in <a
href="https://redirect.github.com/DeterminateSystems/magic-nix-cache-action/pull/84">DeterminateSystems/magic-nix-cache-action#84</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/DeterminateSystems/magic-nix-cache-action/compare/v7...v8">https://github.com/DeterminateSystems/magic-nix-cache-action/compare/v7...v8</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="87b14cf437"><code>87b14cf</code></a>
Update <code>detsys-ts</code> for: `Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/63">#63</a>
from DeterminateSystems/retry...</li>
<li><a
href="538f0296e2"><code>538f029</code></a>
Don't run the &quot;trusted&quot; checks if we're in a PR (<a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/85">#85</a>)</li>
<li><a
href="9d627e84ff"><code>9d627e8</code></a>
Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/78">#78</a>
from DeterminateSystems/update-fast-xml-parser</li>
<li><a
href="9d32f14410"><code>9d32f14</code></a>
Update fast-xml-parser</li>
<li><a
href="6181dd9ee2"><code>6181dd9</code></a>
Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/75">#75</a>
from DeterminateSystems/dependabot/npm_and_yarn/fast-x...</li>
<li><a
href="768ebc3208"><code>768ebc3</code></a>
Update built package</li>
<li><a
href="1929664175"><code>1929664</code></a>
Bump fast-xml-parser from 4.4.0 to 4.4.1</li>
<li><a
href="56ad6029ca"><code>56ad602</code></a>
Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/73">#73</a>
from DeterminateSystems/clarify-log-message</li>
<li><a
href="45d13621c5"><code>45d1362</code></a>
Provide info output for potential missing permissions block</li>
<li><a
href="7f56db3553"><code>7f56db3</code></a>
Merge pull request <a
href="https://redirect.github.com/determinatesystems/magic-nix-cache-action/issues/66">#66</a>
from DeterminateSystems/update-detsys-ts</li>
<li>Additional commits viewable in <a
href="https://github.com/determinatesystems/magic-nix-cache-action/compare/v7...v8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=DeterminateSystems/magic-nix-cache-action&package-manager=github_actions&previous-version=7&new-version=8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 08:35:22 +02:00
dependabot[bot]
066bc1df6d chore: bump peter-evans/create-pull-request from 6 to 7 (#220)
Bumps
[peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request)
from 6 to 7.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/peter-evans/create-pull-request/releases">peter-evans/create-pull-request's
releases</a>.</em></p>
<blockquote>
<h2>Create Pull Request v7.0.0</h2>
<p> Now supports commit signing with bot-generated tokens! See
&quot;What's new&quot; below. ✍️🤖</p>
<h3>Behaviour changes</h3>
<ul>
<li>Action input <code>git-token</code> has been renamed
<code>branch-token</code>, to be more clear about its purpose. The
<code>branch-token</code> is the token that the action will use to
create and update the branch.</li>
<li>The action now handles requests that have been rate-limited by
GitHub. Requests hitting a primary rate limit will retry twice, for a
total of three attempts. Requests hitting a secondary rate limit will
not be retried.</li>
<li>The <code>pull-request-operation</code> output now returns
<code>none</code> when no operation was executed.</li>
<li>Removed deprecated output environment variable
<code>PULL_REQUEST_NUMBER</code>. Please use the
<code>pull-request-number</code> action output instead.</li>
</ul>
<h3>What's new</h3>
<ul>
<li>The action can now sign commits as <code>github-actions[bot]</code>
when using <code>GITHUB_TOKEN</code>, or your own bot when using <a
href="https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens">GitHub
App tokens</a>. See <a
href="https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#commit-signature-verification-for-bots">commit
signing</a> for details.</li>
<li>Action input <code>draft</code> now accepts a new value
<code>always-true</code>. This will set the pull request to draft status
when the pull request is updated, as well as on creation.</li>
<li>A new action input <code>maintainer-can-modify</code> indicates
whether <a
href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork">maintainers
can modify</a> the pull request. The default is <code>true</code>, which
retains the existing behaviour of the action.</li>
<li>A new output <code>pull-request-commits-verified</code> returns
<code>true</code> or <code>false</code>, indicating whether GitHub
considers the signature of the branch's commits to be verified.</li>
</ul>
<h2>What's Changed</h2>
<ul>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.36 to
18.19.39 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3000">peter-evans/create-pull-request#3000</a></li>
<li>build(deps-dev): bump ts-jest from 29.1.5 to 29.2.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3008">peter-evans/create-pull-request#3008</a></li>
<li>build(deps-dev): bump prettier from 3.3.2 to 3.3.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3018">peter-evans/create-pull-request#3018</a></li>
<li>build(deps-dev): bump ts-jest from 29.2.0 to 29.2.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3019">peter-evans/create-pull-request#3019</a></li>
<li>build(deps-dev): bump eslint-plugin-prettier from 5.1.3 to 5.2.1 by
<a href="https://github.com/dependabot"><code>@​dependabot</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3035">peter-evans/create-pull-request#3035</a></li>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.39 to
18.19.41 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3037">peter-evans/create-pull-request#3037</a></li>
<li>build(deps): bump undici from 6.19.2 to 6.19.4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3036">peter-evans/create-pull-request#3036</a></li>
<li>build(deps-dev): bump ts-jest from 29.2.2 to 29.2.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3038">peter-evans/create-pull-request#3038</a></li>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.41 to
18.19.42 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3070">peter-evans/create-pull-request#3070</a></li>
<li>build(deps): bump undici from 6.19.4 to 6.19.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3086">peter-evans/create-pull-request#3086</a></li>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.42 to
18.19.43 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3087">peter-evans/create-pull-request#3087</a></li>
<li>build(deps-dev): bump ts-jest from 29.2.3 to 29.2.4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3088">peter-evans/create-pull-request#3088</a></li>
<li>build(deps): bump undici from 6.19.5 to 6.19.7 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3145">peter-evans/create-pull-request#3145</a></li>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.43 to
18.19.44 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3144">peter-evans/create-pull-request#3144</a></li>
<li>Update distribution by <a
href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3154">peter-evans/create-pull-request#3154</a></li>
<li>build(deps): bump undici from 6.19.7 to 6.19.8 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3213">peter-evans/create-pull-request#3213</a></li>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.44 to
18.19.45 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3214">peter-evans/create-pull-request#3214</a></li>
<li>Update distribution by <a
href="https://github.com/actions-bot"><code>@​actions-bot</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3221">peter-evans/create-pull-request#3221</a></li>
<li>build(deps-dev): bump eslint-import-resolver-typescript from 3.6.1
to 3.6.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3255">peter-evans/create-pull-request#3255</a></li>
<li>build(deps-dev): bump <code>@​types/node</code> from 18.19.45 to
18.19.46 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3254">peter-evans/create-pull-request#3254</a></li>
<li>build(deps-dev): bump ts-jest from 29.2.4 to 29.2.5 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3256">peter-evans/create-pull-request#3256</a></li>
<li>v7 - signed commits by <a
href="https://github.com/peter-evans"><code>@​peter-evans</code></a> in
<a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3057">peter-evans/create-pull-request#3057</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/rustycl0ck"><code>@​rustycl0ck</code></a> made
their first contribution in <a
href="https://redirect.github.com/peter-evans/create-pull-request/pull/3057">peter-evans/create-pull-request#3057</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/peter-evans/create-pull-request/compare/v6.1.0...v7.0.0">https://github.com/peter-evans/create-pull-request/compare/v6.1.0...v7.0.0</a></p>
<h2>Create Pull Request v6.1.0</h2>
<p> Adds <code>pull-request-branch</code> as an action output.</p>
<h2>What's Changed</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4320041ed3"><code>4320041</code></a>
feat: signed commits (v7) (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3057">#3057</a>)</li>
<li><a
href="0c2a66fe4a"><code>0c2a66f</code></a>
build(deps-dev): bump ts-jest from 29.2.4 to 29.2.5 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3256">#3256</a>)</li>
<li><a
href="17121bc5b5"><code>17121bc</code></a>
build(deps-dev): bump <code>@​types/node</code> from 18.19.45 to
18.19.46 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3254">#3254</a>)</li>
<li><a
href="87b5d6d564"><code>87b5d6d</code></a>
build(deps-dev): bump eslint-import-resolver-typescript (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3255">#3255</a>)</li>
<li><a
href="00897e0bc2"><code>00897e0</code></a>
build: update distribution (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3221">#3221</a>)</li>
<li><a
href="4cfc1fc717"><code>4cfc1fc</code></a>
build(deps-dev): bump <code>@​types/node</code> from 18.19.44 to
18.19.45 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3214">#3214</a>)</li>
<li><a
href="cb4ed6491a"><code>cb4ed64</code></a>
build(deps): bump undici from 6.19.7 to 6.19.8 (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3213">#3213</a>)</li>
<li><a
href="4eb90b7bc7"><code>4eb90b7</code></a>
ci: separate test suite commands in pr comment</li>
<li><a
href="5308ecb864"><code>5308ecb</code></a>
ci: add sign-commits flag to test suite comment</li>
<li><a
href="ba864ad40c"><code>ba864ad</code></a>
build: update distribution (<a
href="https://redirect.github.com/peter-evans/create-pull-request/issues/3154">#3154</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/peter-evans/create-pull-request/compare/v6...v7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=peter-evans/create-pull-request&package-manager=github_actions&previous-version=6&new-version=7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 08:25:33 +02:00
github-actions[bot]
f1bc6f8e5c [Scheduled] Update dependencies (#218)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
2024-09-01 09:42:46 +02:00
David Barroso
32bec88d4c ci: hotfix for release 2024-08-29 16:55:25 +02:00
David Barroso
aa51d402bd chore: ci: standardize (#217) 2024-08-29 16:31:42 +02:00
github-actions[bot]
218a310641 [Scheduled] Update dependencies (#215)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

---------

Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-08-03 14:21:34 +02:00
github-actions[bot]
c2c86d5b43 [Scheduled] Update dependencies (#212)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

---------

Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-06-02 22:44:37 +02:00
dependabot[bot]
1417ea7209 chore: bump cachix/cachix-action from 14 to 15 (#211)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action)
from 14 to 15.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/cachix-action/releases">cachix/cachix-action's
releases</a>.</em></p>
<blockquote>
<h2>cachix-action-v15</h2>
<h2>What's Changed</h2>
<ul>
<li>Pass <code>cachixArgs</code> to the daemon by <a
href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/cachix-action/pull/177">cachix/cachix-action#177</a></li>
<li>Support path filtering when using the daemon by <a
href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/cachix-action/pull/182">cachix/cachix-action#182</a></li>
<li>Skip prep steps if using <code>pathsToPush</code> by <a
href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/cachix-action/pull/180">cachix/cachix-action#180</a></li>
<li>store-scan: improve error handling when listing the store fails by
<a href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/cachix-action/pull/183">cachix/cachix-action#183</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cachix/cachix-action/compare/v14...v15">https://github.com/cachix/cachix-action/compare/v14...v15</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ad2ddac53f"><code>ad2ddac</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/184">#184</a>
from cachix/dependabot/github_actions/cachix/install-...</li>
<li><a
href="403a1b5dad"><code>403a1b5</code></a>
chore(deps): bump cachix/install-nix-action from 26 to 27</li>
<li><a
href="132bc971f5"><code>132bc97</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/183">#183</a>
from cachix/fix-179</li>
<li><a
href="662a8831be"><code>662a883</code></a>
store-scan: use runner or os temp dirs</li>
<li><a
href="08dcf70a39"><code>08dcf70</code></a>
store-scan: improve error handling when store listing fails</li>
<li><a
href="991af99d4b"><code>991af99</code></a>
Skip prep steps if using <code>pathsToPush</code> (<a
href="https://redirect.github.com/cachix/cachix-action/issues/180">#180</a>)</li>
<li><a
href="74587ee920"><code>74587ee</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/182">#182</a>
from cachix/support-daemon-push-filter</li>
<li><a
href="5ee8857e76"><code>5ee8857</code></a>
Fix syntax</li>
<li><a
href="7431d10aca"><code>7431d10</code></a>
Use bash in post-build hook</li>
<li><a
href="ad440c0fec"><code>ad440c0</code></a>
Make <code>pushFilter</code> filter out just the positive matches</li>
<li>Additional commits viewable in <a
href="https://github.com/cachix/cachix-action/compare/v14...v15">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/cachix-action&package-manager=github_actions&previous-version=14&new-version=15)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 09:51:33 +02:00
David Barroso
92b3d6662a chore: update GO version due to CVE (#210) 2024-05-14 15:24:25 +02:00
David Barroso
279714c790 chore: fix CI 2024-05-03 07:57:18 +02:00
dependabot[bot]
2cc8616288 chore: bump nixbuild/nix-quick-install-action from 27 to 28 (#206)
Bumps
[nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action)
from 27 to 28.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/releases">nixbuild/nix-quick-install-action's
releases</a>.</em></p>
<blockquote>
<h2>nixbuild/nix-quick-install-action@v28</h2>
<h2>Changes</h2>
<ul>
<li>
<p>Remove all Nix versions that are vulnerable to <a
href="https://www.cve.org/CVERecord?id=CVE-2024-27297">CVE-2024-27297</a>.</p>
</li>
<li>
<p>Bump minor Nix versions: 2.18.1 -&gt; 2.18.2</p>
</li>
<li>
<p>Add Nix versions: 2.20.5, 2.21.0</p>
</li>
<li>
<p>Bump default Nix version: 2.19.3 -&gt; 2.21.0</p>
</li>
</ul>
<h2>Supported Nix Versions on Linux Runners</h2>
<ul>
<li>2.21.0</li>
<li>2.20.5</li>
<li>2.19.3</li>
<li>2.18.2</li>
<li>2.3.17</li>
</ul>
<h2>Supported Nix Versions on MacOS Runners</h2>
<ul>
<li>2.21.0</li>
<li>2.20.5</li>
<li>2.19.3</li>
<li>2.18.2</li>
<li>2.3.17</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE">nixbuild/nix-quick-install-action's
changelog</a>.</em></p>
<blockquote>
<p>v28</p>
<h2>Changes</h2>
<ul>
<li>
<p>Remove all Nix versions that are vulnerable to <a
href="https://www.cve.org/CVERecord?id=CVE-2024-27297">CVE-2024-27297</a>.</p>
</li>
<li>
<p>Bump minor Nix versions: 2.18.1 -&gt; 2.18.2</p>
</li>
<li>
<p>Add Nix versions: 2.20.5, 2.21.0</p>
</li>
<li>
<p>Bump default Nix version: 2.19.3 -&gt; 2.21.0</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="60e9c39264"><code>60e9c39</code></a>
Release v28</li>
<li><a
href="2eeac83915"><code>2eeac83</code></a>
Downgrade nixpkgs because of MacOS build error</li>
<li><a
href="0ff55bf498"><code>0ff55bf</code></a>
Remove Nix 2.22 temporarily</li>
<li><a
href="49704930ae"><code>4970493</code></a>
Bump Nix versions</li>
<li><a
href="f188189575"><code>f188189</code></a>
cicd: Fix Nix version</li>
<li><a
href="ac5ac3025c"><code>ac5ac30</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/42">#42</a>
from nixbuild/nix_2_2x</li>
<li><a
href="de77414845"><code>de77414</code></a>
cicd: Try fix test that fails on MacOS 11/nix 2.21.0</li>
<li><a
href="b657bdb7f8"><code>b657bdb</code></a>
Add Nix 2.20.5 and 2.21.0</li>
<li><a
href="3e26077f8d"><code>3e26077</code></a>
Update README and workflows for v27</li>
<li>See full diff in <a
href="https://github.com/nixbuild/nix-quick-install-action/compare/v27...v28">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nixbuild/nix-quick-install-action&package-manager=github_actions&previous-version=27&new-version=28)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-03 07:47:12 +02:00
github-actions[bot]
cd872682db [Scheduled] Update dependencies (#205)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
2024-05-01 19:25:16 +02:00
github-actions[bot]
e23a069a43 [Scheduled] Update dependencies (#203)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
2024-04-02 11:00:03 +02:00
dependabot[bot]
5024de8ecb chore: bump nixbuild/nix-quick-install-action from 26 to 27 (#201)
Bumps
[nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action)
from 26 to 27.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/releases">nixbuild/nix-quick-install-action's
releases</a>.</em></p>
<blockquote>
<h2>nixbuild/nix-quick-install-action@v27</h2>
<h2>Security Notice</h2>
<p>This release (and previous releases) includes Nix versions that are
vulnerable to <a
href="https://www.cve.org/CVERecord?id=CVE-2024-27297">CVE-2024-27297</a>.
The current default Nix version, 2.19.3, is not vulnerable. If you
select another Nix version you should use your own judgement to decide
if CVE-2024-27297 is applicable to your usage of Nix in your GitHub
Actions workflow.</p>
<p>The following Nix versions that are packaged with this action are
<strong>not</strong> vulnerable:</p>
<ul>
<li>2.19.3 (the default version)</li>
<li>2.18.1</li>
<li>2.3.17</li>
</ul>
<p>The above versions have been explicitly patched by the
<code>nixpkgs</code> maintainers.</p>
<p>The rest of the Nix versions provided by this action <strong>are
vulnerable</strong> to CVE-2024-27297.</p>
<p>In the next release of this action (v28), all vulnerable Nix versions
will be removed.</p>
<h2>Changes</h2>
<ul>
<li>
<p>Bump minor Nix versions: 2.3.16 -&gt; 2.3.17</p>
</li>
<li>
<p>Add Nix versions: 2.17.1, 2.18.1, 2.19.3</p>
</li>
<li>
<p>Bump default Nix version: 2.16.2 -&gt; 2.19.3</p>
</li>
</ul>
<h2>Supported Nix Versions on Linux Runners</h2>
<ul>
<li>2.19.3</li>
<li>2.18.1</li>
<li>2.17.1</li>
<li>2.16.2</li>
<li>2.15.3</li>
<li>2.14.1</li>
<li>2.13.6</li>
<li>2.12.1</li>
<li>2.11.1</li>
<li>2.10.3</li>
<li>2.9.2</li>
<li>2.8.1</li>
<li>2.7.0</li>
<li>2.6.1</li>
<li>2.5.1</li>
<li>2.4</li>
<li>2.3.17</li>
<li>2.2.2</li>
<li>2.1.3</li>
<li>2.0.4</li>
</ul>
<h2>Supported Nix Versions on MacOS Runners</h2>
<ul>
<li>2.19.3</li>
<li>2.18.1</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE">nixbuild/nix-quick-install-action's
changelog</a>.</em></p>
<blockquote>
<p>v27</p>
<h2>Security Notice</h2>
<p>This release (and previous releases) includes Nix versions that are
vulnerable to <a
href="https://www.cve.org/CVERecord?id=CVE-2024-27297">CVE-2024-27297</a>.
The current default Nix version, 2.19.3, is not vulnerable. If you
select another Nix version you should use your own judgement to decide
if CVE-2024-27297 is applicable to your usage of Nix in your GitHub
Actions workflow.</p>
<p>The following Nix versions that are packaged with this action are
<strong>not</strong> vulnerable:</p>
<ul>
<li>2.19.3 (the default version)</li>
<li>2.18.1</li>
<li>2.3.17</li>
</ul>
<p>The above versions have been explicitly patched by the
<code>nixpkgs</code> maintainers.</p>
<p>The rest of the Nix versions provided by this action <strong>are
vulnerable</strong> to CVE-2024-27297.</p>
<p>In the next release of this action (v28), all vulnerable Nix versions
will be removed.</p>
<h2>Changes</h2>
<ul>
<li>
<p>Bump minor Nix versions: 2.3.16 -&gt; 2.3.17</p>
</li>
<li>
<p>Add Nix versions: 2.17.1, 2.18.1, 2.19.3</p>
</li>
<li>
<p>Bump default Nix version: 2.16.2 -&gt; 2.19.3</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d02dd28b62"><code>d02dd28</code></a>
Release v27</li>
<li><a
href="123ee16a4d"><code>123ee16</code></a>
Fix variable name</li>
<li><a
href="b35ae20573"><code>b35ae20</code></a>
Retry if db registration fails</li>
<li><a
href="483e6ef9a6"><code>483e6ef</code></a>
Bump nixpkgs revisions to get patches for CVE-2024-27297</li>
<li><a
href="eac9523d35"><code>eac9523</code></a>
Bump default Nix version from 2.16.2 to 2.19.3</li>
<li><a
href="e6c40657c4"><code>e6c4065</code></a>
Revert &quot;Add Nix 2.20.5 and 2.21.0&quot;</li>
<li><a
href="b83db0f5c0"><code>b83db0f</code></a>
Add Nix 2.20.5 and 2.21.0</li>
<li><a
href="896e4387e1"><code>896e438</code></a>
Merge pull request <a
href="https://redirect.github.com/nixbuild/nix-quick-install-action/issues/41">#41</a>
from deemp/master</li>
<li><a
href="0e337bef97"><code>0e337be</code></a>
fix(cicd): bump nix version</li>
<li><a
href="a17089ebbc"><code>a17089e</code></a>
chore: update nix versions</li>
<li>Additional commits viewable in <a
href="https://github.com/nixbuild/nix-quick-install-action/compare/v26...v27">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=nixbuild/nix-quick-install-action&package-manager=github_actions&previous-version=26&new-version=27)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-03-18 11:16:48 +01:00
David Barroso
c8a7bcee75 chore: fix role to assume in gen update dependencies (#199)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
2024-03-01 14:02:35 +01:00
David Barroso
843ea6b321 Create SECURITY.md 2024-02-06 10:15:16 +01:00
dependabot[bot]
0d5f5ed0e1 chore: bump release-drafter/release-drafter from 5 to 6 (#198)
Bumps
[release-drafter/release-drafter](https://github.com/release-drafter/release-drafter)
from 5 to 6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/release-drafter/release-drafter/releases">release-drafter/release-drafter's
releases</a>.</em></p>
<blockquote>
<h2>v6.0.0</h2>
<h1>What's Changed</h1>
<ul>
<li>Update Node.js to 20 (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1379">#1379</a>)
<a href="https://github.com/massongit"><code>@​massongit</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/release-drafter/release-drafter/compare/v5.25.0...v6.0.0">https://github.com/release-drafter/release-drafter/compare/v5.25.0...v6.0.0</a></p>
<h2>v6.0.0-beta.1</h2>
<p>Prerelease of v6, first release of the CLI, feel free to provide
feedback in the pull request: <a
href="https://redirect.github.com/release-drafter/release-drafter/pull/1204">release-drafter/release-drafter#1204</a></p>
<h2>v5.25.0</h2>
<h1>What's Changed</h1>
<h2>New</h2>
<ul>
<li>add prerelease increment behavior (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1303">#1303</a>)
<a href="https://github.com/neilime"><code>@​neilime</code></a></li>
<li>add latest input (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1348">#1348</a>)
<a href="https://github.com/o-mago"><code>@​o-mago</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/release-drafter/release-drafter/compare/v5.24.0...v5.25.0">https://github.com/release-drafter/release-drafter/compare/v5.24.0...v5.25.0</a></p>
<h2>v5.24.0</h2>
<h1>What's Changed</h1>
<h2>New</h2>
<ul>
<li>Add release version to github action output (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1300">#1300</a>)
<a
href="https://github.com/mehdihadeli"><code>@​mehdihadeli</code></a></li>
</ul>
<h2>Bug Fixes</h2>
<ul>
<li>fix(release): strip prefix before comparing version (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1255">#1255</a>)
<a href="https://github.com/neilime"><code>@​neilime</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/release-drafter/release-drafter/compare/v5.23.0...v5.24.0">https://github.com/release-drafter/release-drafter/compare/v5.23.0...v5.24.0</a></p>
<h2>v5.23.0</h2>
<h1>What's Changed</h1>
<h2>New</h2>
<ul>
<li>Add <code>include-pre-releases</code> configuration option (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1302">#1302</a>)
<a
href="https://github.com/robbinjanssen"><code>@​robbinjanssen</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/release-drafter/release-drafter/compare/v5.22.0...v5.23.0">https://github.com/release-drafter/release-drafter/compare/v5.22.0...v5.23.0</a></p>
<h2>v5.22.0</h2>
<h1>What's Changed</h1>
<h2>New</h2>
<ul>
<li>Only use last full release when drafting (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1240">#1240</a>)
<a href="https://github.com/ssbarnea"><code>@​ssbarnea</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3f0f87098b"><code>3f0f870</code></a>
v6.0.0</li>
<li><a
href="80296b4fba"><code>80296b4</code></a>
Update Node.js to 20 (<a
href="https://redirect.github.com/release-drafter/release-drafter/issues/1379">#1379</a>)</li>
<li>See full diff in <a
href="https://github.com/release-drafter/release-drafter/compare/v5...v6">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=release-drafter/release-drafter&package-manager=github_actions&previous-version=5&new-version=6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 08:47:54 +01:00
David Barroso
43644e8062 chore: update dependencies (#197) 2024-02-01 17:07:57 +01:00
David Barroso
c5c23f14fd feat: replace custom C code with govips (#196)
We initially wrote our own C code because our benchmarking showed govips
used too much memory but now it seems to be the opposite. Their library
is also better than our custom code and it should fix #194 and #180
2024-01-26 13:58:14 +01:00
dependabot[bot]
e8e78dd422 chore: bump cachix/cachix-action from 13 to 14 (#192)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action)
from 13 to 14.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/cachix-action/releases">cachix/cachix-action's
releases</a>.</em></p>
<blockquote>
<h2>cachix-action-v14</h2>
<p><a
href="https://blog.cachix.org/posts/2024-01-12-cachix-v1-7/">https://blog.cachix.org/posts/2024-01-12-cachix-v1-7/</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="18cf96c7c9"><code>18cf96c</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/166">#166</a>
from cachix/feature/daemon</li>
<li><a
href="467b7ad67e"><code>467b7ad</code></a>
daemon: fix support check in post run</li>
<li><a
href="c9fc59c798"><code>c9fc59c</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/161">#161</a>
from cachix/feature/daemon</li>
<li><a
href="e54c44ceb8"><code>e54c44c</code></a>
daemon: drop latest daemon installer</li>
<li><a
href="3a94faeceb"><code>3a94fae</code></a>
daemon: update tests</li>
<li><a
href="a7c8acb335"><code>a7c8acb</code></a>
daemon: add even more logging to trusted user logic</li>
<li><a
href="11a95a781d"><code>11a95a7</code></a>
daemon: resolve promise</li>
<li><a
href="608ce1e442"><code>608ce1e</code></a>
daemon: add debugging logs to trusted user logic</li>
<li><a
href="711a732439"><code>711a732</code></a>
daemon: fix reading trusted-users</li>
<li><a
href="8426524a2b"><code>8426524</code></a>
daemon: check for credentials early</li>
<li>Additional commits viewable in <a
href="https://github.com/cachix/cachix-action/compare/v13...v14">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/cachix-action&package-manager=github_actions&previous-version=13&new-version=14)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-26 13:02:03 +01:00
dependabot[bot]
5c4068dd74 chore: bump actions/cache from 3 to 4 (#195)
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/cache/releases">actions/cache's
releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update action to node20 by <a
href="https://github.com/takost"><code>@​takost</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1284">actions/cache#1284</a></li>
<li>feat: save-always flag by <a
href="https://github.com/to-s"><code>@​to-s</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1242">actions/cache#1242</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/takost"><code>@​takost</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1284">actions/cache#1284</a></li>
<li><a href="https://github.com/to-s"><code>@​to-s</code></a> made their
first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1242">actions/cache#1242</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v3...v4.0.0">https://github.com/actions/cache/compare/v3...v4.0.0</a></p>
<h2>v3.3.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Cache v3.3.3 by <a
href="https://github.com/robherley"><code>@​robherley</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1302">actions/cache#1302</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/robherley"><code>@​robherley</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1302">actions/cache#1302</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v3...v3.3.3">https://github.com/actions/cache/compare/v3...v3.3.3</a></p>
<h2>v3.3.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Fixed readme with new segment timeout values by <a
href="https://github.com/kotewar"><code>@​kotewar</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1133">actions/cache#1133</a></li>
<li>Readme fixes by <a
href="https://github.com/kotewar"><code>@​kotewar</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1134">actions/cache#1134</a></li>
<li>Updated description of the lookup-only input for main action by <a
href="https://github.com/kotewar"><code>@​kotewar</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1130">actions/cache#1130</a></li>
<li>Change two new actions mention as quoted text by <a
href="https://github.com/bishal-pdMSFT"><code>@​bishal-pdMSFT</code></a>
in <a
href="https://redirect.github.com/actions/cache/pull/1131">actions/cache#1131</a></li>
<li>Update Cross-OS Caching tips by <a
href="https://github.com/pdotl"><code>@​pdotl</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1122">actions/cache#1122</a></li>
<li>Bazel example (Take <a
href="https://redirect.github.com/actions/cache/issues/2">#2</a>️⃣) by
<a href="https://github.com/vorburger"><code>@​vorburger</code></a> in
<a
href="https://redirect.github.com/actions/cache/pull/1132">actions/cache#1132</a></li>
<li>Remove actions to add new PRs and issues to a project board by <a
href="https://github.com/jorendorff"><code>@​jorendorff</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1187">actions/cache#1187</a></li>
<li>Consume latest toolkit and fix dangling promise bug by <a
href="https://github.com/chkimes"><code>@​chkimes</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1217">actions/cache#1217</a></li>
<li>Bump action version to 3.3.2 by <a
href="https://github.com/bethanyj28"><code>@​bethanyj28</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1236">actions/cache#1236</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/vorburger"><code>@​vorburger</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1132">actions/cache#1132</a></li>
<li><a
href="https://github.com/jorendorff"><code>@​jorendorff</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1187">actions/cache#1187</a></li>
<li><a href="https://github.com/chkimes"><code>@​chkimes</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1217">actions/cache#1217</a></li>
<li><a
href="https://github.com/bethanyj28"><code>@​bethanyj28</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/cache/pull/1236">actions/cache#1236</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v3...v3.3.2">https://github.com/actions/cache/compare/v3...v3.3.2</a></p>
<h2>v3.3.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Reduced download segment size to 128 MB and timeout to 10 minutes by
<a href="https://github.com/kotewar"><code>@​kotewar</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1129">actions/cache#1129</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/cache/compare/v3...v3.3.1">https://github.com/actions/cache/compare/v3...v3.3.1</a></p>
<h2>v3.3.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Bug: Permission is missing in cache delete example by <a
href="https://github.com/kotokaze"><code>@​kotokaze</code></a> in <a
href="https://redirect.github.com/actions/cache/pull/1123">actions/cache#1123</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/cache/blob/main/RELEASES.md">actions/cache's
changelog</a>.</em></p>
<blockquote>
<h1>Releases</h1>
<h3>3.0.0</h3>
<ul>
<li>Updated minimum runner version support from node 12 -&gt; node
16</li>
</ul>
<h3>3.0.1</h3>
<ul>
<li>Added support for caching from GHES 3.5.</li>
<li>Fixed download issue for files &gt; 2GB during restore.</li>
</ul>
<h3>3.0.2</h3>
<ul>
<li>Added support for dynamic cache size cap on GHES.</li>
</ul>
<h3>3.0.3</h3>
<ul>
<li>Fixed avoiding empty cache save when no files are available for
caching. (<a
href="https://redirect.github.com/actions/cache/issues/624">issue</a>)</li>
</ul>
<h3>3.0.4</h3>
<ul>
<li>Fixed tar creation error while trying to create tar with path as
<code>~/</code> home folder on <code>ubuntu-latest</code>. (<a
href="https://redirect.github.com/actions/cache/issues/689">issue</a>)</li>
</ul>
<h3>3.0.5</h3>
<ul>
<li>Removed error handling by consuming actions/cache 3.0 toolkit, Now
cache server error handling will be done by toolkit. (<a
href="https://redirect.github.com/actions/cache/pull/834">PR</a>)</li>
</ul>
<h3>3.0.6</h3>
<ul>
<li>Fixed <a
href="https://redirect.github.com/actions/cache/issues/809">#809</a> -
zstd -d: no such file or directory error</li>
<li>Fixed <a
href="https://redirect.github.com/actions/cache/issues/833">#833</a> -
cache doesn't work with github workspace directory</li>
</ul>
<h3>3.0.7</h3>
<ul>
<li>Fixed <a
href="https://redirect.github.com/actions/cache/issues/810">#810</a> -
download stuck issue. A new timeout is introduced in the download
process to abort the download if it gets stuck and doesn't finish within
an hour.</li>
</ul>
<h3>3.0.8</h3>
<ul>
<li>Fix zstd not working for windows on gnu tar in issues <a
href="https://redirect.github.com/actions/cache/issues/888">#888</a> and
<a
href="https://redirect.github.com/actions/cache/issues/891">#891</a>.</li>
<li>Allowing users to provide a custom timeout as input for aborting
download of a cache segment using an environment variable
<code>SEGMENT_DOWNLOAD_TIMEOUT_MINS</code>. Default is 60 minutes.</li>
</ul>
<h3>3.0.9</h3>
<ul>
<li>Enhanced the warning message for cache unavailablity in case of
GHES.</li>
</ul>
<h3>3.0.10</h3>
<ul>
<li>Fix a bug with sorting inputs.</li>
<li>Update definition for restore-keys in README.md</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="13aacd865c"><code>13aacd8</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/cache/issues/1242">#1242</a>
from to-s/main</li>
<li><a
href="53b35c5439"><code>53b35c5</code></a>
Merge branch 'main' into main</li>
<li><a
href="65b8989fab"><code>65b8989</code></a>
Merge pull request <a
href="https://redirect.github.com/actions/cache/issues/1284">#1284</a>
from takost/update-to-node-20</li>
<li><a
href="d0be34d544"><code>d0be34d</code></a>
Fix dist</li>
<li><a
href="66cf064d47"><code>66cf064</code></a>
Merge branch 'main' into update-to-node-20</li>
<li><a
href="1326563738"><code>1326563</code></a>
Merge branch 'main' into main</li>
<li><a
href="e71876755e"><code>e718767</code></a>
Fix format</li>
<li><a
href="01229828ff"><code>0122982</code></a>
Apply workaround for earlyExit</li>
<li><a
href="3185ecfd61"><code>3185ecf</code></a>
Update &quot;only-&quot; actions to node20</li>
<li><a
href="25618a0a67"><code>25618a0</code></a>
Bump version</li>
<li>Additional commits viewable in <a
href="https://github.com/actions/cache/compare/v3...v4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/cache&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-18 12:02:00 +01:00
David Barroso
95eaac8e39 chore: replace nix code with standardized nixops (#193)
Only changes are to the .nix files, changes to `.go` files were
performed by the linter `golines -w --base-formatter=gofumpt .`
2024-01-15 11:13:12 +01:00
David Barroso
9304c39b97 chore: update deps (#191) 2024-01-11 19:13:17 +01:00
dependabot[bot]
19d678ce26 chore: bump cachix/cachix-action from 12 to 13 (#189)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action)
from 12 to 13.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/cachix-action/releases">cachix/cachix-action's
releases</a>.</em></p>
<blockquote>
<h2>cachix-action-v13</h2>
<ul>
<li>run on node20</li>
<li>add <code>skipAddingSubstituter</code> to skip running <code>cachix
use</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="6a2e08b5eb"><code>6a2e08b</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/158">#158</a>
from cachix/bump-node</li>
<li><a
href="e98f643462"><code>e98f643</code></a>
Commit dist</li>
<li><a
href="2025bdaff1"><code>2025bda</code></a>
Bump node in devenv</li>
<li><a
href="6d013b15ef"><code>6d013b1</code></a>
Bump dependencies</li>
<li><a
href="33393dc192"><code>33393dc</code></a>
Update tsconfig</li>
<li><a
href="1ad072581d"><code>1ad0725</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/156">#156</a>
from cachix/dependabot/github_actions/cachix/install-...</li>
<li><a
href="70d2b7fe3d"><code>70d2b7f</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/157">#157</a>
from cachix/dependabot/github_actions/actions/checkout-4</li>
<li><a
href="d0ac1486c5"><code>d0ac148</code></a>
Run on node20</li>
<li><a
href="fe4b2e9abc"><code>fe4b2e9</code></a>
chore(deps): bump actions/checkout from 3 to 4</li>
<li><a
href="8d53462873"><code>8d53462</code></a>
chore(deps): bump cachix/install-nix-action from 22 to 23</li>
<li>Additional commits viewable in <a
href="https://github.com/cachix/cachix-action/compare/v12...v13">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/cachix-action&package-manager=github_actions&previous-version=12&new-version=13)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-29 08:29:40 +01:00
Guillermo Enrique Bernal Moreira
51ccc70282 feat: migrate to aws-sdk-go-v2 (#186) 2023-11-22 09:39:59 +01:00
David Barroso
3bdbf46a3e chore: bump go to 1.21.4 due to CVE (#187) 2023-11-09 10:57:10 +01:00
ChrisSG
4d226c5b83 adds a flag for specifying the db name for migrations (#185)
## Problem
Currently, it seems that the name of the target database for migrations
is fixed to "default." This produces the following error when there is
no database named "default":
```
problem applying Hasura metadata: problem adding metadata for the buckets table: status_code: 400\nresponse: {"error":"source with name \"default\" does not exist","path":"$.args","code":"not-exists"}
```
(see
https://github.com/nhost/hasura-storage/issues/184#issue-1972012220)

## Solution
To address this issue and provide more flexibility in configuring the
target database for migrations, we propose the following solution:

- **Environment Variable**: Introduce a new environment variable named
`HASURA_DB_NAME` to allow users to specify the target database name for
migrations.

- **Configuration Update**: Modify the code in
`hasura-storage/migrations/hasura.go` to use the value of
`HASURA_DB_NAME` as the target database name. This ensures that users
can configure the target database dynamically.

- **Fallback to "default"**: If `HASURA_DB_NAME` is not set, the code
should default to "default" to maintain backward compatibility.

## Notes
- Users can set the `HASURA_DB_NAME` environment variable to configure
the target database for migrations to their desired database name.

- This change enhances the flexibility of the migration process,
especially in cases where the database name is not "default."

- Reviewers are encouraged to verify that the documentation has been
updated to reflect the new configuration option.

With this solution, users can customize the target database for
migrations by setting the `HASURA_DB_NAME` environment variable, which
eliminates the error associated with the fixed "default" database name.
2023-11-03 07:58:30 +01:00
dependabot[bot]
97a03dcfce chore: update dependencies (#181)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2023-10-25 11:23:53 +02:00
dependabot[bot]
26572176d3 chore: Bump aws-actions/amazon-ecr-login from 1 to 2 (#179)
Bumps
[aws-actions/amazon-ecr-login](https://github.com/aws-actions/amazon-ecr-login)
from 1 to 2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/aws-actions/amazon-ecr-login/releases">aws-actions/amazon-ecr-login's
releases</a>.</em></p>
<blockquote>
<h2>v2</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v2.0.0</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.7.0</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.6.2</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.6.1</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.6.0</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.5.3</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.5.2</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.5.1</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.5.0</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.4.0</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.3.3</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.3.2</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.3.1</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.3.0</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.2.2</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v1.2.1</h2>
<p>See the <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/HEAD/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/aws-actions/amazon-ecr-login/blob/main/CHANGELOG.md">aws-actions/amazon-ecr-login's
changelog</a>.</em></p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="062b18b96a"><code>062b18b</code></a>
chore(release): 2.0.1</li>
<li><a
href="9238dd443b"><code>9238dd4</code></a>
Merge pull request <a
href="https://redirect.github.com/aws-actions/amazon-ecr-login/issues/532">#532</a>
from aws-actions/node_upgrade</li>
<li><a
href="e618bbed74"><code>e618bbe</code></a>
chore: upgrade to node20</li>
<li><a
href="33f92af657"><code>33f92af</code></a>
chore(release): 2.0.0</li>
<li><a
href="5de13da834"><code>5de13da</code></a>
Merge pull request <a
href="https://redirect.github.com/aws-actions/amazon-ecr-login/issues/530">#530</a>
from aws-actions/dist2</li>
<li><a
href="d6ae50c722"><code>d6ae50c</code></a>
chore: update dist</li>
<li><a
href="537f0fb431"><code>537f0fb</code></a>
Merge pull request <a
href="https://redirect.github.com/aws-actions/amazon-ecr-login/issues/529">#529</a>
from aws-actions/dist</li>
<li><a
href="8ccdcdca26"><code>8ccdcdc</code></a>
chore: update dist</li>
<li><a
href="d71acafb87"><code>d71acaf</code></a>
feat: release v2 (<a
href="https://redirect.github.com/aws-actions/amazon-ecr-login/issues/520">#520</a>)</li>
<li><a
href="3542211ff6"><code>3542211</code></a>
chore: Bump <code>@​aws-sdk/client-ecr-public</code> from 3.414.0 to
3.418.0 (<a
href="https://redirect.github.com/aws-actions/amazon-ecr-login/issues/525">#525</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/aws-actions/amazon-ecr-login/compare/v1...v2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aws-actions/amazon-ecr-login&package-manager=github_actions&previous-version=1&new-version=2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 10:08:29 +02:00
David Barroso
07d48bc121 chore: docs: added antivirus documentation (#178) 2023-09-28 07:26:12 +02:00
dependabot[bot]
e18f4e0be0 chore: Bump docker/setup-qemu-action from 2 to 3 (#177)
Bumps
[docker/setup-qemu-action](https://github.com/docker/setup-qemu-action)
from 2 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/docker/setup-qemu-action/releases">docker/setup-qemu-action's
releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<ul>
<li>Node 20 as default runtime (requires <a
href="https://github.com/actions/runner/releases/tag/v2.308.0">Actions
Runner v2.308.0</a> or later) by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/setup-qemu-action/pull/102">docker/setup-qemu-action#102</a></li>
<li>Bump <code>@​actions/core</code> from 1.10.0 to 1.10.1 in <a
href="https://redirect.github.com/docker/setup-qemu-action/pull/103">docker/setup-qemu-action#103</a></li>
<li>Bump semver from 6.3.0 to 6.3.1 in <a
href="https://redirect.github.com/docker/setup-qemu-action/pull/89">docker/setup-qemu-action#89</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/setup-qemu-action/compare/v2.2.0...v3.0.0">https://github.com/docker/setup-qemu-action/compare/v2.2.0...v3.0.0</a></p>
<h2>v2.2.0</h2>
<ul>
<li>Trim off spaces in <code>platforms</code> input by <a
href="https://github.com/Chocobo1"><code>@​Chocobo1</code></a> in <a
href="https://redirect.github.com/docker/setup-qemu-action/pull/64">docker/setup-qemu-action#64</a></li>
<li>Switch to actions-toolkit implementation by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/setup-qemu-action/pull/70">docker/setup-qemu-action#70</a>
<a
href="https://redirect.github.com/docker/setup-qemu-action/pull/80">docker/setup-qemu-action#80</a>
<a
href="https://redirect.github.com/docker/setup-qemu-action/pull/83">docker/setup-qemu-action#83</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/setup-qemu-action/compare/v2.1.0...v2.2.0">https://github.com/docker/setup-qemu-action/compare/v2.1.0...v2.2.0</a></p>
<h2>v2.1.0</h2>
<ul>
<li>Use context for inputs by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a
href="https://redirect.github.com/docker/setup-qemu-action/issues/62">#62</a>)</li>
<li>Use built-in <code>getExecOutput</code> by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a
href="https://redirect.github.com/docker/setup-qemu-action/issues/61">#61</a>)</li>
<li>Remove workaround for <code>setOutput</code> by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a
href="https://redirect.github.com/docker/setup-qemu-action/issues/63">#63</a>)</li>
<li>Bump <code>@​actions/core</code> from 1.6.0 to 1.10.0 (<a
href="https://redirect.github.com/docker/setup-qemu-action/issues/54">#54</a>
<a
href="https://redirect.github.com/docker/setup-qemu-action/issues/58">#58</a>
<a
href="https://redirect.github.com/docker/setup-qemu-action/issues/59">#59</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/setup-qemu-action/compare/v2.0.0...v2.1.0">https://github.com/docker/setup-qemu-action/compare/v2.0.0...v2.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="68827325e0"><code>6882732</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-qemu-action/issues/103">#103</a>
from docker/dependabot/npm_and_yarn/actions/core-1.10.1</li>
<li><a
href="183f4af504"><code>183f4af</code></a>
chore: update generated content</li>
<li><a
href="f17493529e"><code>f174935</code></a>
build(deps): bump <code>@​actions/core</code> from 1.10.0 to 1.10.1</li>
<li><a
href="2e423eb500"><code>2e423eb</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-qemu-action/issues/89">#89</a>
from docker/dependabot/npm_and_yarn/semver-6.3.1</li>
<li><a
href="ecc406afa7"><code>ecc406a</code></a>
Bump semver from 6.3.0 to 6.3.1</li>
<li><a
href="12dec5e201"><code>12dec5e</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/setup-qemu-action/issues/102">#102</a>
from crazy-max/update-node20</li>
<li><a
href="c29b312130"><code>c29b312</code></a>
chore: node 20 as default runtime</li>
<li><a
href="34ae628c8f"><code>34ae628</code></a>
chore: update generated content</li>
<li><a
href="1f3d2e1ac0"><code>1f3d2e1</code></a>
chore: fix author in package.json</li>
<li><a
href="277dbe8c9c"><code>277dbe8</code></a>
vendor: bump <code>@​docker/actions-toolkit</code> from 0.3.0 to
0.12.0</li>
<li>Additional commits viewable in <a
href="https://github.com/docker/setup-qemu-action/compare/v2...v3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/setup-qemu-action&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 08:24:21 +02:00
dependabot[bot]
d88ba6b17a chore: Bump docker/login-action from 2 to 3 (#176)
Bumps [docker/login-action](https://github.com/docker/login-action) from
2 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/docker/login-action/releases">docker/login-action's
releases</a>.</em></p>
<blockquote>
<h2>v3.0.0</h2>
<ul>
<li>Node 20 as default runtime (requires <a
href="https://github.com/actions/runner/releases/tag/v2.308.0">Actions
Runner v2.308.0</a> or later) by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/login-action/pull/593">docker/login-action#593</a></li>
<li>Bump <code>@​actions/core</code> from 1.10.0 to 1.10.1 in <a
href="https://redirect.github.com/docker/login-action/pull/598">docker/login-action#598</a></li>
<li>Bump <code>@​aws-sdk/client-ecr</code> and
<code>@​aws-sdk/client-ecr-public</code> to 3.410.0 in <a
href="https://redirect.github.com/docker/login-action/pull/555">docker/login-action#555</a>
<a
href="https://redirect.github.com/docker/login-action/pull/560">docker/login-action#560</a>
<a
href="https://redirect.github.com/docker/login-action/pull/582">docker/login-action#582</a>
<a
href="https://redirect.github.com/docker/login-action/pull/599">docker/login-action#599</a></li>
<li>Bump semver from 6.3.0 to 6.3.1 in <a
href="https://redirect.github.com/docker/login-action/pull/556">docker/login-action#556</a></li>
<li>Bump https-proxy-agent to 7.0.2 <a
href="https://redirect.github.com/docker/login-action/pull/561">docker/login-action#561</a>
<a
href="https://redirect.github.com/docker/login-action/pull/588">docker/login-action#588</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/login-action/compare/v2.2.0...v3.0.0">https://github.com/docker/login-action/compare/v2.2.0...v3.0.0</a></p>
<h2>v2.2.0</h2>
<ul>
<li>Switch to actions-toolkit implementation by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> in <a
href="https://redirect.github.com/docker/login-action/pull/409">docker/login-action#409</a>
<a
href="https://redirect.github.com/docker/login-action/pull/470">docker/login-action#470</a>
<a
href="https://redirect.github.com/docker/login-action/pull/476">docker/login-action#476</a></li>
<li>Bump <code>@​aws-sdk/client-ecr</code> and
<code>@​aws-sdk/client-ecr-public</code> to 3.347.1 in <a
href="https://redirect.github.com/docker/login-action/pull/524">docker/login-action#524</a>
<a
href="https://redirect.github.com/docker/login-action/pull/364">docker/login-action#364</a>
<a
href="https://redirect.github.com/docker/login-action/pull/363">docker/login-action#363</a></li>
<li>Bump minimatch from 3.0.4 to 3.1.2 in <a
href="https://redirect.github.com/docker/login-action/pull/354">docker/login-action#354</a></li>
<li>Bump json5 from 2.2.0 to 2.2.3 in <a
href="https://redirect.github.com/docker/login-action/pull/378">docker/login-action#378</a></li>
<li>Bump http-proxy-agent from 5.0.0 to 7.0.0 in <a
href="https://redirect.github.com/docker/login-action/pull/509">docker/login-action#509</a></li>
<li>Bump https-proxy-agent from 5.0.1 to 7.0.0 in <a
href="https://redirect.github.com/docker/login-action/pull/508">docker/login-action#508</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/login-action/compare/v2.1.0...v2.2.0">https://github.com/docker/login-action/compare/v2.1.0...v2.2.0</a></p>
<h2>v2.1.0</h2>
<ul>
<li>Ensure AWS temp credentials are redacted in workflow logs by <a
href="https://github.com/crazy-max"><code>@​crazy-max</code></a> (<a
href="https://redirect.github.com/docker/login-action/issues/275">#275</a>)</li>
<li>Bump <code>@​actions/core</code> from 1.6.0 to 1.10.0 (<a
href="https://redirect.github.com/docker/login-action/issues/252">#252</a>
<a
href="https://redirect.github.com/docker/login-action/issues/292">#292</a>)</li>
<li>Bump <code>@​aws-sdk/client-ecr</code> from 3.53.0 to 3.186.0 (<a
href="https://redirect.github.com/docker/login-action/issues/298">#298</a>)</li>
<li>Bump <code>@​aws-sdk/client-ecr-public</code> from 3.53.0 to 3.186.0
(<a
href="https://redirect.github.com/docker/login-action/issues/299">#299</a>)</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/docker/login-action/compare/v2.0.0...v2.1.0">https://github.com/docker/login-action/compare/v2.0.0...v2.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="343f7c4344"><code>343f7c4</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/login-action/issues/599">#599</a>
from docker/dependabot/npm_and_yarn/aws-sdk-dependenc...</li>
<li><a
href="aad0f974f2"><code>aad0f97</code></a>
chore: update generated content</li>
<li><a
href="2e0cd39144"><code>2e0cd39</code></a>
build(deps): bump the aws-sdk-dependencies group with 2 updates</li>
<li><a
href="203bc9c4ef"><code>203bc9c</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/login-action/issues/588">#588</a>
from docker/dependabot/npm_and_yarn/proxy-agent-depen...</li>
<li><a
href="2199648fc8"><code>2199648</code></a>
chore: update generated content</li>
<li><a
href="b489376173"><code>b489376</code></a>
build(deps): bump the proxy-agent-dependencies group with 1 update</li>
<li><a
href="7c309e74e6"><code>7c309e7</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/login-action/issues/598">#598</a>
from docker/dependabot/npm_and_yarn/actions/core-1.10.1</li>
<li><a
href="0ccf222961"><code>0ccf222</code></a>
chore: update generated content</li>
<li><a
href="56d703e106"><code>56d703e</code></a>
Merge pull request <a
href="https://redirect.github.com/docker/login-action/issues/597">#597</a>
from docker/dependabot/github_actions/aws-actions/con...</li>
<li><a
href="24d3b3519e"><code>24d3b35</code></a>
build(deps): bump <code>@​actions/core</code> from 1.10.0 to 1.10.1</li>
<li>Additional commits viewable in <a
href="https://github.com/docker/login-action/compare/v2...v3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/login-action&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 08:24:04 +02:00
dependabot[bot]
3de9a2d09b chore: Bump aws-actions/configure-aws-credentials from 3 to 4 (#175)
Bumps
[aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials)
from 3 to 4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/aws-actions/configure-aws-credentials/releases">aws-actions/configure-aws-credentials's
releases</a>.</em></p>
<blockquote>
<h2>v4</h2>
<p>This tag tracks the latest v4.x.x release</p>
<h2>v4.0.0</h2>
<p>See the <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.0/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v3.0.2</h2>
<p>See the <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/v3.0.2/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v3.0.1</h2>
<p>See the <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/v3.0.1/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md">aws-actions/configure-aws-credentials's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v3.0.0...v3.0.1">3.0.1</a>
(2023-08-24)</h2>
<h3>Features</h3>
<ul>
<li>Can configure <code>special-characters-workaround</code> to keep
retrying credentials if the returned
credentials have special characters (Fixes <a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/599">#599</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Fixes <a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/792">#792</a>:
Action fails when intending to use existing credentials</li>
<li>Minor typo fix from <a
href="https://github.com/ubaid-ansari21"><code>@​ubaid-ansari21</code></a></li>
</ul>
<h3>Changes to existing functionality</h3>
<ul>
<li>Special characters are now allowed in returned credential variables
unless you configure the
<code>special-characters-workaround</code> option</li>
</ul>
<h2><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v2.2.0...v3.0.0">3.0.0</a>
(2023-08-21)</h2>
<h3>Features</h3>
<ul>
<li>Can configure <code>max-retries</code> and
<code>disable-retry</code> to modify retry functionality when the assume
role call fails</li>
<li>Set returned credentials as step outputs with
<code>output-credentials</code></li>
<li>Clear AWS related environment variables at the start of the action
with <code>unset-current-credentials</code></li>
<li>Unique role identifier is now printed in the workflow logs</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Can't use credentials if they contain a special character</li>
<li>Retry functionality added when generating the JWT fails</li>
<li>Can now use <code>webIdentityTokenFile</code> option</li>
<li>Branch name validation too strict</li>
<li>JS SDK v2 deprecation warning in workflow logs</li>
</ul>
<h3>Changes to existing functionality</h3>
<ul>
<li>Default session duration is now 1 hour in all cases (from 6 hours in
some cases)</li>
<li>Account ID will not be masked by default in logs</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8c3f20df09"><code>8c3f20d</code></a>
chore: release v4 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/840">#840</a>)</li>
<li>See full diff in <a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v3...v4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aws-actions/configure-aws-credentials&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 10:31:12 +02:00
David Barroso
074d1e1eaf chore: avoid issues with av notification (#174)
There is no need to notify clamav as the `SelfCheck` option is enabled
by default. We are making this explicit in the clamav configuration to
avoid future confusions.
2023-09-11 16:12:38 +02:00
dependabot[bot]
cf652fc168 chore: Bump actions/checkout from 3 to 4 (#173)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to
4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/releases">actions/checkout's
releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update default runtime to node20 by <a
href="https://github.com/takost"><code>@​takost</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1436">actions/checkout#1436</a></li>
<li>Support fetching without the --progress option by <a
href="https://github.com/simonbaird"><code>@​simonbaird</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1067">actions/checkout#1067</a></li>
<li>Release 4.0.0 by <a
href="https://github.com/takost"><code>@​takost</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1447">actions/checkout#1447</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/takost"><code>@​takost</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1436">actions/checkout#1436</a></li>
<li><a
href="https://github.com/simonbaird"><code>@​simonbaird</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1067">actions/checkout#1067</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v3...v4.0.0">https://github.com/actions/checkout/compare/v3...v4.0.0</a></p>
<h2>v3.6.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Mark test scripts with Bash'isms to be run via Bash by <a
href="https://github.com/dscho"><code>@​dscho</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1377">actions/checkout#1377</a></li>
<li>Add option to fetch tags even if fetch-depth &gt; 0 by <a
href="https://github.com/RobertWieczoreck"><code>@​RobertWieczoreck</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/579">actions/checkout#579</a></li>
<li>Release 3.6.0 by <a
href="https://github.com/luketomlinson"><code>@​luketomlinson</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1437">actions/checkout#1437</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/RobertWieczoreck"><code>@​RobertWieczoreck</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/579">actions/checkout#579</a></li>
<li><a
href="https://github.com/luketomlinson"><code>@​luketomlinson</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1437">actions/checkout#1437</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v3.5.3...v3.6.0">https://github.com/actions/checkout/compare/v3.5.3...v3.6.0</a></p>
<h2>v3.5.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix: Checkout Issue in self hosted runner due to faulty submodule
check-ins by <a
href="https://github.com/megamanics"><code>@​megamanics</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1196">actions/checkout#1196</a></li>
<li>Fix typos found by codespell by <a
href="https://github.com/DimitriPapadopoulos"><code>@​DimitriPapadopoulos</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1287">actions/checkout#1287</a></li>
<li>Add support for sparse checkouts by <a
href="https://github.com/dscho"><code>@​dscho</code></a> and <a
href="https://github.com/dfdez"><code>@​dfdez</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1369">actions/checkout#1369</a></li>
<li>Release v3.5.3 by <a
href="https://github.com/TingluoHuang"><code>@​TingluoHuang</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1376">actions/checkout#1376</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/megamanics"><code>@​megamanics</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1196">actions/checkout#1196</a></li>
<li><a
href="https://github.com/DimitriPapadopoulos"><code>@​DimitriPapadopoulos</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1287">actions/checkout#1287</a></li>
<li><a href="https://github.com/dfdez"><code>@​dfdez</code></a> made
their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1369">actions/checkout#1369</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v3...v3.5.3">https://github.com/actions/checkout/compare/v3...v3.5.3</a></p>
<h2>v3.5.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix: Use correct API url / endpoint in GHES by <a
href="https://github.com/fhammerl"><code>@​fhammerl</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1289">actions/checkout#1289</a>
based on <a
href="https://redirect.github.com/actions/checkout/issues/1286">#1286</a>
by <a href="https://github.com/1newsr"><code>@​1newsr</code></a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v3.5.1...v3.5.2">https://github.com/actions/checkout/compare/v3.5.1...v3.5.2</a></p>
<h2>v3.5.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Improve checkout performance on Windows runners by upgrading
<code>@​actions/github</code> dependency by <a
href="https://github.com/BrettDong"><code>@​BrettDong</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1246">actions/checkout#1246</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/BrettDong"><code>@​BrettDong</code></a>
made their first contribution in <a
href="https://redirect.github.com/actions/checkout/pull/1246">actions/checkout#1246</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>v4.0.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1067">Support
fetching without the --progress option</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1436">Update to
node20</a></li>
</ul>
<h2>v3.6.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1377">Fix: Mark
test scripts with Bash'isms to be run via Bash</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/579">Add
option to fetch tags even if fetch-depth &gt; 0</a></li>
</ul>
<h2>v3.5.3</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1196">Fix:
Checkout fail in self-hosted runners when faulty submodule are
checked-in</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/1287">Fix
typos found by codespell</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/1369">Add
support for sparse checkouts</a></li>
</ul>
<h2>v3.5.2</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/1289">Fix
api endpoint for GHES</a></li>
</ul>
<h2>v3.5.1</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/1246">Fix
slow checkout on Windows</a></li>
</ul>
<h2>v3.5.0</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/1237">Add
new public key for known_hosts</a></li>
</ul>
<h2>v3.4.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1209">Upgrade
codeql actions to v2</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1210">Upgrade
dependencies</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1225">Upgrade
<code>@​actions/io</code></a></li>
</ul>
<h2>v3.3.0</h2>
<ul>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1045">Implement
branch list using callbacks from exec function</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/1050">Add
in explicit reference to private checkout options</a></li>
<li>[Fix comment typos (that got added in <a
href="https://redirect.github.com/actions/checkout/issues/770">#770</a>)](<a
href="https://redirect.github.com/actions/checkout/pull/1057">actions/checkout#1057</a>)</li>
</ul>
<h2>v3.2.0</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/942">Add
GitHub Action to perform release</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/967">Fix
status badge</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1002">Replace
datadog/squid with ubuntu/squid Docker image</a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/964">Wrap
pipeline commands for submoduleForeach in quotes</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1029">Update
<code>@​actions/io</code> to 1.1.2</a></li>
<li><a
href="https://redirect.github.com/actions/checkout/pull/1039">Upgrading
version to 3.2.0</a></li>
</ul>
<h2>v3.1.0</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/939">Use
<code>@​actions/core</code> <code>saveState</code> and
<code>getState</code></a></li>
<li><a href="https://redirect.github.com/actions/checkout/pull/922">Add
<code>github-server-url</code> input</a></li>
</ul>
<h2>v3.0.2</h2>
<ul>
<li><a href="https://redirect.github.com/actions/checkout/pull/770">Add
input <code>set-safe-directory</code></a></li>
</ul>
<h2>v3.0.1</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3df4ab11eb"><code>3df4ab1</code></a>
Release 4.0.0 (<a
href="https://redirect.github.com/actions/checkout/issues/1447">#1447</a>)</li>
<li><a
href="8b5e8b7687"><code>8b5e8b7</code></a>
Support fetching without the --progress option (<a
href="https://redirect.github.com/actions/checkout/issues/1067">#1067</a>)</li>
<li><a
href="97a652b800"><code>97a652b</code></a>
Update default runtime to node20 (<a
href="https://redirect.github.com/actions/checkout/issues/1436">#1436</a>)</li>
<li>See full diff in <a
href="https://github.com/actions/checkout/compare/v3...v4">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 08:33:01 +02:00
dependabot[bot]
4c2318e9d4 chore: bump aws-actions/configure-aws-credentials from 2 to 3 (#172)
Bumps
[aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials)
from 2 to 3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/aws-actions/configure-aws-credentials/releases">aws-actions/configure-aws-credentials's
releases</a>.</em></p>
<blockquote>
<h2>v3</h2>
<p>This tag tracks the latest v3.x.x release</p>
<h2>v3.0.0</h2>
<p>See the <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/v3.0.0/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v2.2.0</h2>
<p>See the <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/v2.2.0/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
<h2>v2.1.0</h2>
<p>See the <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/v2.1.0/CHANGELOG.md">changelog</a>
for details about the changes included in this release.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md">aws-actions/configure-aws-credentials's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v2.2.0...v3.0.0">3.0.0</a>
(2023-08-21)</h2>
<h3>Features</h3>
<ul>
<li>Can configure <code>max-retries</code> and
<code>disable-retry</code> to modify retry functionality when the assume
role call fails</li>
<li>Set returned credentials as step outputs with
<code>output-credentials</code></li>
<li>Clear AWS related environment variables at the start of the action
with <code>unset-current-credentials</code></li>
<li>Unique role identifier is now printed in the workflow logs</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>Can't use credentials if they contain a special character</li>
<li>Retry functionality added when generating the JWT fails</li>
<li>Can now use <code>webIdentityTokenFile</code> option</li>
<li>Branch name validation too strict</li>
<li>JS SDK v2 deprecation warning in workflow logs</li>
</ul>
<h3>Changes to existing functionality</h3>
<ul>
<li>Default session duration is now 1 hour in all cases (from 6 hours in
some cases)</li>
<li>Account ID will not be masked by default in logs</li>
</ul>
<h2><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v2.1.0...v2.2.0">2.2.0</a>
(2023-05-31)</h2>
<h3>Features</h3>
<ul>
<li><code>inline-session-policy</code> prop enables assuming a role with
inline session policies (<a
href="d00f6c6f41">d00f6c6</a>)</li>
<li><code>managed-session-policies</code> prop enables assuming a role
with managed policy arns (<a
href="d00f6c6f41">d00f6c6</a>)</li>
</ul>
<h2><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v2.0.0...v2.1.0">2.1.0</a>
(2023-05-31)</h2>
<h3>Features</h3>
<ul>
<li><code>role-chaining</code> prop enables role chaining use case (<a
href="6fbd316fd1">6fbd316</a>)</li>
</ul>
<h2><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v1.7.0...v2.0.0">2.0.0</a>
(2023-03-06)</h2>
<h3>Features</h3>
<ul>
<li>Version bump to use Node 16 by default.</li>
</ul>
<h2><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v1.6.1...v1.7.0">1.7.0</a>
(2022-08-03)</h2>
<h3>Features</h3>
<ul>
<li>Allow audience to be explicitly specified (<a
href="2f8dfd0ed4">2f8dfd0</a>)</li>
</ul>
<h3><a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v1.6.0...v1.6.1">1.6.1</a>
(2022-01-18)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>OIDC Parallel Requests error (<a
href="133757e9b8">133757e</a>)</li>
<li>Strict Mode Deprecation (<a
href="4c5e1c60cc">4c5e1c6</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ef93a73b13"><code>ef93a73</code></a>
V3 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/791">#791</a>)</li>
<li><a
href="131c7b6fd1"><code>131c7b6</code></a>
chore: Bump jest from 29.6.2 to 29.6.3 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/786">#786</a>)</li>
<li><a
href="6334b403eb"><code>6334b40</code></a>
chore: Bump aws-sdk from 2.1436.0 to 2.1441.0 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/787">#787</a>)</li>
<li><a
href="360ea313a7"><code>360ea31</code></a>
chore: Bump aws-sdk from 2.1431.0 to 2.1436.0 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/783">#783</a>)</li>
<li><a
href="de93b00c9f"><code>de93b00</code></a>
chore: Bump eslint from 8.46.0 to 8.47.0 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/784">#784</a>)</li>
<li><a
href="746d33e7c1"><code>746d33e</code></a>
chore: Bump aws-sdk from 2.1426.0 to 2.1431.0 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/782">#782</a>)</li>
<li><a
href="706fc9ae3d"><code>706fc9a</code></a>
chore: Bump eslint from 8.45.0 to 8.46.0 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/780">#780</a>)</li>
<li><a
href="9918371ad5"><code>9918371</code></a>
chore: Bump aws-sdk from 2.1421.0 to 2.1426.0 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/781">#781</a>)</li>
<li><a
href="345462ab9e"><code>345462a</code></a>
chore: Bump jest from 29.6.1 to 29.6.2 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/779">#779</a>)</li>
<li><a
href="80a7a6c2a2"><code>80a7a6c</code></a>
chore: Bump aws-sdk from 2.1416.0 to 2.1421.0 (<a
href="https://redirect.github.com/aws-actions/configure-aws-credentials/issues/778">#778</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/aws-actions/configure-aws-credentials/compare/v2...v3">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=aws-actions/configure-aws-credentials&package-manager=github_actions&previous-version=2&new-version=3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-24 08:47:36 +02:00
David Barroso
8feb508ea1 feat: added antivirus integration (#171) 2023-08-22 12:05:54 +02:00
David Barroso
996c8c2dff feat: added metadata column to files (#170)
Fixes #134 and #160

This basically introduces a new column `metadata` to the `files` table
of type `jsonb`. The user can populate this with any data it wants by
adding a `metadata` object to the `metadata[]` field in the
multipart-form (`metadata` field when updating files). For instance:

``` shell
curl http://localhost:8080/v1/files \
  -H "Content-Type: multipart/form-data" \
  -H "$AUTH" \
  -F "file[]=@client/testdata/alphabet.txt" \
  -F "metadata[]={\"metadata\":{\"num\":123,\"list\":[1,2,3]}};type=application/json"
```

In addition, we are moving away from the graphql client
`github.com/hasura/go-graphql-client` to `github.com/Yamashou/gqlgenc`
as I was running into some troubles dealing with jsonb objects. This has
the side-effect the graphql code is much cleaner and easier to
understand (this was long overdue to be honest).
2023-08-16 12:53:21 +02:00
David Barroso
e7dc5b3cee chore: update dependencies (#169) 2023-08-15 13:21:18 +02:00
David Barroso
f9bc7fa5c3 chore: udpate dependencies (#168) 2023-07-28 10:47:49 +02:00
Matteo Mazzoni
752c725750 Finetuning openapi doc for better swagger testing (#167) 2023-07-17 13:02:23 +02:00
David Barroso
c89b48d851 fix typo 2023-07-07 09:19:07 +02:00
dependabot[bot]
c5f688fb65 chore: bump nixbuild/nix-quick-install-action from 24 to 25 (#166)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 24 to 25.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v24...v25)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-04 13:56:38 +02:00
José Henrique Leão
f32b7846d1 feat: allow configuration of cors domains and credentials (#159) 2023-06-27 20:06:21 +02:00
dependabot[bot]
a8e9c1d32a chore: bump nixbuild/nix-quick-install-action from 23 to 24 (#164)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 23 to 24.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v23...v24)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-26 08:44:33 +02:00
dependabot[bot]
b7e3151702 chore: bump nixbuild/nix-quick-install-action from 22 to 23 (#163)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 22 to 23.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v22...v23)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-23 08:11:58 +02:00
Tuan (Tony) T
78447dd391 fix: url-safe filename (#162) 2023-06-21 11:10:31 +02:00
David Barroso
5bd777d6c2 fix: pass quality to image transformer (#158) 2023-05-22 15:33:38 +02:00
Szilárd Dóró
3235e38b20 chore: add probot-stale (#156)
* chore: add probot

* chore: remove trailing empty line
2023-05-11 10:58:01 +02:00
David Barroso
b1ce4703d0 feat: allow manipulation on presigned urls (#152) 2023-03-17 12:33:39 +01:00
dependabot[bot]
771dca1064 chore: bump nixbuild/nix-quick-install-action from 21 to 22 (#151)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 21 to 22.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v21...v22)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-15 07:46:06 +01:00
dependabot[bot]
2f5c47ec84 chore: bump aws-actions/configure-aws-credentials from 1 to 2 (#150)
Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 1 to 2.
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/v1...v2)

---
updated-dependencies:
- dependency-name: aws-actions/configure-aws-credentials
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-07 14:10:16 +01:00
David Barroso
759e6a53c6 chore: clean pipeline (#147) 2023-01-13 11:24:42 +01:00
David Barroso
b9aebcb47c feat: respect specified content-type if specified and is other than application/octet-stream (#139) 2023-01-04 10:15:09 +01:00
dependabot[bot]
be5e5f123f chore: bump nixbuild/nix-quick-install-action from 20 to 21 (#144)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 20 to 21.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v20...v21)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-02 11:13:41 +01:00
dependabot[bot]
4b801e5b95 chore: bump nixbuild/nix-quick-install-action from 19 to 20 (#143)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 19 to 20.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v19...v20)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-23 08:23:14 +01:00
Kevin Rodríguez
f0c3768f62 fix: fixes file too small error message (#142) 2022-12-21 11:03:16 +01:00
David Barroso
8e342e4520 chore: update deps (#140) 2022-12-19 09:45:06 +01:00
David Barroso
315e90dd5c feat: lower cache size to 1MB (#137) 2022-11-24 08:45:17 +01:00
David Barroso
fe1de57395 fix: set a sane value for MaxMultipartMemory (#133) 2022-11-15 08:31:46 +01:00
David Barroso
7381b3c72d fix: detect check constraint errors properly (#131) 2022-11-11 13:04:55 +01:00
David Barroso
4282ea68ca feat: insert more metadata when initializing files on upload (#130) 2022-11-11 11:58:08 +01:00
David Barroso
6ff55c24b6 fix: compare IDs correctly when dealing with broken-metadata and orphan files (#129) 2022-11-11 11:56:40 +01:00
David Barroso
744d7394e0 Update openapi.yaml (#127) 2022-11-04 09:10:28 +01:00
David Barroso
9349d30889 fix: allow updating files that aren't uploaded (#126) 2022-11-04 09:08:11 +01:00
dependabot[bot]
5b8ac94b82 chore: bump nixbuild/nix-quick-install-action from 18 to 19 (#125)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 18 to 19.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v18...v19)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-02 08:19:05 +01:00
David Barroso
656d563ca4 chore: update deps (#123) 2022-10-28 10:44:42 +02:00
David Barroso
097abb4617 fix: protect ops endpoints requiring admin (#122)
* fix: protect ops endpoints requiring admin
2022-10-28 10:40:51 +02:00
dependabot[bot]
da8215a1c2 chore: bump cachix/cachix-action from 11 to 12 (#121)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 11 to 12.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v11...v12)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-28 10:36:10 +02:00
Sean Radigan
9da2e8c4e1 added x-hasura-role to allowed headers in CORS (#120)
Co-authored-by: Sean Radigan <seanbreaksthings@tuta.io>
2022-10-25 10:16:04 +02:00
Jeff Loiselle
7dbdc85ec0 Update README.md (#117) 2022-10-21 09:56:20 +02:00
dependabot[bot]
1b6fcb1573 chore: bump cachix/cachix-action from 10 to 11 (#116)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 10 to 11.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v10...v11)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 10:05:23 +02:00
dependabot[bot]
a9f6b098a0 chore: bump nixbuild/nix-quick-install-action from 17 to 18 (#115)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 17 to 18.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v17...v18)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-11 14:48:24 +02:00
David Barroso
2eb2eb7d81 chore: update dependencies (#112) 2022-10-03 13:28:48 +02:00
David Barroso
7500dd4d61 fix: read config flag correctly (#111) 2022-10-03 13:28:40 +02:00
David Barroso
85989f47ba feat: allow configuring apiRootPrefix (#109)
* feat: allow configuring apiRootPrefix

* asd
2022-08-29 15:28:30 +02:00
Johan Eliasson
0f597c1c0c latest hasura version (#108) 2022-08-23 17:05:51 +02:00
Johan Eliasson
fd6bba889f copy update 2022-08-23 07:28:46 +02:00
dependabot[bot]
c6151c9638 chore: bump nixbuild/nix-quick-install-action from 16 to 17 (#107)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 16 to 17.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v16...v17)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 07:56:57 +02:00
David Barroso
70c0cc53bb fix: download file completely from s3 if Range+image manip opts are specified (#101) 2022-07-13 12:09:04 +02:00
David Barroso
f32a0b1a1d fix: fastly middleware: dont set surrogate control header for presigned urls (#103) 2022-07-13 12:05:37 +02:00
Siarhei Lipchyk
0ea78379af Fix the error message (#100) 2022-07-10 11:40:49 +02:00
dependabot[bot]
1323f5c73b chore: bump nixbuild/nix-quick-install-action from 15 to 16 (#94)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 15 to 16.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v15...v16)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-17 09:46:50 +02:00
David Barroso
0520dcbbbc chore: update deps (#86) 2022-06-10 09:29:52 +02:00
dependabot[bot]
6f9bcf4564 chore: bump nixbuild/nix-quick-install-action from 14 to 15 (#92)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 14 to 15.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v14...v15)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-10 09:16:12 +02:00
David Barroso
425946137c fix: this was wrongly misinterpreted as minutes (#91) 2022-06-10 09:16:01 +02:00
David Barroso
91d9e4d41a chore: pin minio to make tests more reliable (#90) 2022-06-02 13:14:47 +02:00
dependabot[bot]
56c641f6e7 chore: bump nixbuild/nix-quick-install-action from 13 to 14 (#88)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 13 to 14.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v13...v14)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-02 08:34:23 +02:00
David Barroso
789f4a2e91 fix: dont require select:bucket permissions to delete files (#87) 2022-05-27 16:45:00 +02:00
David Barroso
1b3cfeff4e fix: set content-range accordingly if range requested with image manipulation (#85) 2022-05-27 11:44:53 +02:00
David Barroso
d17dc3ed80 fix: allow inserting files without requiring select permissions (#84) 2022-05-27 11:37:01 +02:00
David Barroso
b4b4fb4eea fix: remove /storage from the path (#83) 2022-05-24 16:54:39 +02:00
David Barroso
de48ecdc28 feat: added integration with CDN Fastly (#77) 2022-05-24 09:53:17 +02:00
David Barroso
d8e68e59e7 chore: remove code duplication (#80) 2022-05-19 14:44:05 +02:00
David Barroso
2251e3a598 calculate presignedurls max-age using info in the signature to make sure they expire at the right time (#79) 2022-05-19 14:30:57 +02:00
David Barroso
de06fca938 feat: support downloading a range (#76) 2022-05-19 13:41:07 +02:00
David Barroso
72bc77de7f fix: treat conditional requests to s3 correctly when using presigned urls (#78) 2022-05-19 13:27:21 +02:00
David Barroso
88c5b49f00 chore: fix vips tests (#75) 2022-05-19 12:25:52 +02:00
dependabot[bot]
52fbd758cb chore: bump docker/setup-qemu-action from 1 to 2 (#71)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](https://github.com/docker/setup-qemu-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-10 10:56:09 +02:00
dependabot[bot]
e013c3b09e chore: bump docker/login-action from 1 to 2 (#72)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-10 10:56:00 +02:00
David Barroso
7ce5fdf39e replace govips with own bindings (#73) 2022-05-10 10:55:46 +02:00
dependabot[bot]
c89df28521 chore: bump nixbuild/nix-quick-install-action from 12 to 13 (#65)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 12 to 13.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v12...v13)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-27 09:06:13 +02:00
David Barroso
8c8b2d7c6d chore: documentation (#64) 2022-04-26 16:24:25 +02:00
dependabot[bot]
f230ee75cb chore: bump github/codeql-action from 1 to 2 (#63)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-26 09:13:24 +02:00
David Barroso
a04e154bf5 fix: make flags more consumable (#61) 2022-04-25 14:43:24 +02:00
David Barroso
344870319c fix: replace imagemagick with libvips to increase performance (#60) 2022-04-25 12:44:09 +02:00
David Barroso
c96d4cdcbe fix: remove dependency between storage and auth (#59) 2022-04-22 14:38:06 +02:00
David Barroso
383920d593 fix: don't require permissions to see bucket information when retrieving files (#58) 2022-04-21 14:43:42 +02:00
David Barroso
e1ea387598 fix: use admin secret to update metadata when uploading files (#54) 2022-04-11 10:18:12 +02:00
David Barroso
e5857bc131 added constraint to allow setting only valid range for presignedURL expiration time (#55) 2022-04-11 09:49:27 +02:00
David Barroso
8d061f712c connect to the schema when applying migrations so the schema_migrations table is created there too (#53) 2022-04-07 11:20:02 +02:00
David Barroso
dd7bdccf24 fix: presigned urls (#51) 2022-04-06 09:52:28 +02:00
David Barroso
de2a54c519 use same path as old storage (#50) 2022-03-31 09:14:41 +02:00
David Barroso
b0777bd423 use admin secret when reading bucket information as users dont need access to it (#48) 2022-03-31 09:14:30 +02:00
David Barroso
92313744ce add missing headers to CORS (#49) 2022-03-30 14:39:24 +02:00
David Barroso
925fa51886 chore: update go version to 1.18 2022-03-23 12:15:33 +00:00
dependabot[bot]
9db23f87d7 chore: bump actions/cache from 2 to 3 (#46) 2022-03-22 10:01:01 +00:00
David Barroso
38fe19b482 fix: change resize behavior to be inline with previous storage (#45)
* change resize behavior to be inline with previous storage

* asd
2022-03-16 15:13:23 +01:00
David Barroso
03cabdbe86 fix: minor compatibility adjustments (#42) 2022-03-15 14:17:13 +01:00
David Barroso
d3fab91585 fixed cors (#43) 2022-03-15 13:44:32 +01:00
David Barroso
3ccd04f102 added cacerts to docker image (#44) 2022-03-15 13:15:04 +01:00
dependabot[bot]
cd4fcb1aa0 chore: bump nixbuild/nix-quick-install-action from 10 to 12 (#37)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 10 to 12.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v10...v12)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-10 07:45:40 +01:00
David Barroso
06183bcab5 feat: added backwards compatibility with former storage (#32) 2022-03-07 12:14:53 +01:00
dependabot[bot]
8579baed75 chore: bump nixbuild/nix-quick-install-action from 9 to 10 (#29)
Bumps [nixbuild/nix-quick-install-action](https://github.com/nixbuild/nix-quick-install-action) from 9 to 10.
- [Release notes](https://github.com/nixbuild/nix-quick-install-action/releases)
- [Changelog](https://github.com/nixbuild/nix-quick-install-action/blob/master/RELEASE)
- [Commits](https://github.com/nixbuild/nix-quick-install-action/compare/v9...v10)

---
updated-dependencies:
- dependency-name: nixbuild/nix-quick-install-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-04 12:22:46 +01:00
dependabot[bot]
56615c1341 chore: bump actions/checkout from 2 to 3 (#30)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-04 10:26:24 +01:00
David Barroso
eeba558231 update dependencies (#31) 2022-03-04 10:26:11 +01:00
David Barroso
d08699f283 chore: added dependabot, release drafter, and PR template (#27) 2022-03-04 10:19:28 +01:00
David Barroso
86a41734d9 Create codeql-analysis.yml (#28) 2022-03-04 10:08:03 +01:00
Nuno Pato
195cee0572 replace "create or replace" with "drop/create" for triggers (#26) 2022-02-15 11:00:38 -01:00
Nuno Pato
787fa0a069 Chore: consistent naming (#24)
* Make naming more consistent

* update hasura to v2.2.0

* Fix typo

* use /v1 instead of /v1/graphql

* asd

* asd

* asd

* Add /graphql

* small fix
2022-02-14 17:38:11 -01:00
David Barroso
678dd96238 added nix wrapper in case nix isn't available (#23) 2022-02-04 17:37:17 +01:00
David Barroso
3c1d3528db Create LICENSE 2022-02-04 16:02:33 +01:00
David Barroso
8327869801 set up OPTIONS for CORS (#22) 2022-02-04 15:03:49 +01:00
David Barroso
37245a0d5d update dependencies (#21) 2022-02-04 14:05:09 +01:00
David Barroso
a7e10b5b9a added endpoint to get presigned URLs (#20) 2022-02-04 13:04:51 +01:00
David Barroso
c0a37bf1ce change prefix for endpoints to match current pattern (#18) 2022-02-03 20:20:54 +01:00
David Barroso
da427a37c9 fix release (#17) 2022-02-03 17:10:06 +01:00
David Barroso
7e2c14f147 migrate cli to cobra (#16) 2022-02-02 14:24:47 +01:00
David Barroso
e565498a6d implement image manipulation features (#15) 2022-02-01 19:50:01 +01:00
David Barroso
603f6dae48 migrate build and development environment to nix (#14)
* added vendor folder
* make tests more resillient
* migrate to nix
2022-01-27 16:50:12 +01:00
David Barroso
5771d2252c added golang client and implemented integration tests (#11) 2022-01-21 19:21:03 +01:00
David Barroso
ef3d382f2b manage migrations for postgres/hasura on startup (#9) 2022-01-21 17:08:17 +01:00
David Barroso
f46599d675 added several RPCs to perform various operations (#3) 2022-01-21 15:25:42 +01:00
David Barroso
0302644cf8 allow specifying a root folder for s3 storage (#7) 2022-01-17 10:33:49 +01:00
David Barroso
9acf2b1f89 Implemented DELETE /file/:id (#2) 2022-01-13 18:47:23 +01:00
David Barroso
4a9ad0f082 implemented PUT /files/:id (#1) 2022-01-13 13:24:57 +01:00
David Barroso
c61ea9bef6 first poc 2022-01-04 10:53:06 +01:00
David Barroso
fcc44652f2 added README.md 2021-12-13 13:17:58 +01:00
8003 changed files with 2809920 additions and 2021 deletions

View File

@@ -23,13 +23,16 @@ Where `TYPE` is:
Where `PKG` is:
- `ci`: For general changes to the build and/or CI/CD pipeline
- `cli`: For changes to the Nhost CLI
- `codegen`: For changes to the code generator
- `dashboard`: For changes to the Nhost Dashboard
- `deps`: For changes to dependencies
- `docs`: For changes to the documentation
- `examples`: For changes to the examples
- `mintlify-openapi`: For changes to the Mintlify OpenAPI tool
- `nhost-js`: For changes to the Nhost JavaScript SDK
- `nixops`: For changes to the NixOps
- `storage`: For changes to the Nhost Storage
Where `SUMMARY` is a short description of what the PR does.

15
.github/actions/cache-nix/action.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: 'Cache Nix to S3'
description: 'Copy Nix store to S3-backed cache'
inputs:
NIX_CACHE_PRIV_KEY:
description: 'Nix cache private key'
required: true
runs:
using: 'composite'
steps:
- name: "Cache build"
shell: bash
run: |
nix store sign --key-file <(echo "${{ inputs.NIX_CACHE_PRIV_KEY }}") --all
nix copy --to 's3://nhost-nix-cache?region=eu-central-1' --substitute-on-destination --all

51
.github/actions/setup-nix/action.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: 'Setup Nix'
description: 'Install Nix and setup caching for Nhost projects'
inputs:
NAME:
description: 'Project name for cache key'
required: true
NIX_CACHE_PUB_KEY:
description: 'Nix cache public key'
required: true
GITHUB_TOKEN:
description: 'GitHub token for Nix access'
required: true
runs:
using: 'composite'
steps:
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ inputs.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ inputs.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-${{ inputs.NAME }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
# - name: "Verify if nixops is pre-built"
# id: verify-nixops-build
# run: |
# export drvPath=$(make build-nixops-dry-run)
# echo "Derivation path: $drvPath"
# nix path-info --store s3://nhost-nix-cache\?region=eu-central-1 $drvPath \
# || (echo "Wait until nixops is already built and cached and run again" && exit 1)
# if: ${{ inputs.NAME != 'nixops' }}

14
.github/dependabot.yaml vendored Normal file
View File

@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "github-actions"
open-pull-requests-limit: 10
directory: "/"
schedule:
interval: "daily"
time: "04:00"
commit-message:
prefix: "chore(ci)"
labels:
- "dependencies"
- "github_actions"
- "chore"

View File

@@ -24,30 +24,12 @@ jobs:
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v31
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-cliff-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-cliff-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-cliff-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Extract project and version from PR title"
id: extract
@@ -66,6 +48,8 @@ jobs:
exit 1
fi
cd $PROJECT
PROJECT_NAME=$(make release-tag-name)
echo "project=$PROJECT" >> $GITHUB_OUTPUT

View File

@@ -33,12 +33,26 @@ jobs:
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Extracted project: $PROJECT, version: $VERSION"
cli:
needs: extract-project
if: needs.extract-project.outputs.project == 'cli'
uses: ./.github/workflows/cli_wf_release.yaml
with:
GIT_REF: ${{ github.sha }}
VERSION: ${{ needs.extract-project.outputs.version }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
GH_PAT: ${{ secrets.GH_PAT }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
dashboard:
needs: extract-project
if: needs.extract-project.outputs.project == '@nhost/dashboard'
uses: ./.github/workflows/dashboard_release.yaml
uses: ./.github/workflows/dashboard_wf_release.yaml
with:
NAME: dashboard
GIT_REF: ${{ github.sha }}
VERSION: ${{ needs.extract-project.outputs.version }}
secrets:
@@ -67,3 +81,17 @@ jobs:
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_PRODUCTION }}
storage:
needs: extract-project
if: needs.extract-project.outputs.project == 'storage'
uses: ./.github/workflows/storage_wf_release.yaml
with:
GIT_REF: ${{ github.sha }}
VERSION: ${{ needs.extract-project.outputs.version }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

View File

@@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
project: [dashboard, packages/nhost-js]
project: [cli, dashboard, packages/nhost-js, services/storage]
permissions:
id-token: write
@@ -27,40 +27,23 @@ jobs:
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v31
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-cliff-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-cliff-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-cliff-${{ runner.os }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Get next version"
id: version
run: |
cd ${{ matrix.project }}
TAG_NAME=$(make release-tag-name)
VERSION=$(nix develop .\#cliff -c make changelog-next-version)
if git tag | grep -q "${{ matrix.project }}@$VERSION"; then
echo "Tag ${{ matrix.project }}/$VERSION already exists, skipping release preparation"
if git tag | grep -q "$TAG_NAME@$VERSION"; then
echo "Tag $TAG_NAME@$VERSION already exists, skipping release preparation"
else
echo "Tag does not exist, proceeding with release preparation"
echo "Tag $TAG_NAME@$VERSION does not exist, proceeding with release preparation"
echo "version=$VERSION" >> $GITHUB_OUTPUT
fi

101
.github/workflows/cli_checks.yaml vendored Normal file
View File

@@ -0,0 +1,101 @@
---
name: "cli: check and build"
on:
# pull_request_target:
pull_request:
paths:
- '.github/workflows/cli_checks.yaml'
- '.github/workflows/wf_check.yaml'
- '.github/workflows/wf_build_artifacts.yaml'
- '.github/workflows/cli_test_new_project.yaml'
# common build
- 'flake.nix'
- 'flake.lock'
- 'nixops/**'
- 'build/**'
# common go
- '.golangci.yaml'
- 'go.mod'
- 'go.sum'
- 'vendor/**'
# cli
- 'cli/**'
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest
steps:
- run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.pull_request.author_association: ${{ github.event.pull_request.author_association }}"
- name: "This task will run and fail if user has no permissions and label safe_to_test isn't present"
if: "github.event_name == 'pull_request_target' && ! ( contains(github.event.pull_request.labels.*.name, 'safe_to_test') || contains(fromJson('[\"OWNER\", \"MEMBER\", \"COLLABORATOR\"]'), github.event.pull_request.author_association) )"
run: |
exit 1
tests:
uses: ./.github/workflows/wf_check.yaml
needs:
- check-permissions
with:
NAME: cli
PATH: cli
GIT_REF: ${{ github.sha }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
NHOST_PAT: ${{ secrets.NHOST_PAT }}
build_artifacts:
uses: ./.github/workflows/wf_build_artifacts.yaml
needs:
- check-permissions
with:
NAME: cli
PATH: cli
GIT_REF: ${{ github.sha }}
VERSION: 0.0.0-dev # we use a fixed version here to avoid unnecessary rebuilds
DOCKER: true
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
test_cli_build:
uses: ./.github/workflows/cli_wf_test_new_project.yaml
needs:
- check-permissions
- build_artifacts
with:
NAME: cli
PATH: cli
GIT_REF: ${{ github.sha }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
NHOST_PAT: ${{ secrets.NHOST_PAT }}
remove_label:
runs-on: ubuntu-latest
needs:
- check-permissions
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: |
safe_to_test
if: contains(github.event.pull_request.labels.*.name, 'safe_to_test')

122
.github/workflows/cli_wf_release.yaml vendored Normal file
View File

@@ -0,0 +1,122 @@
---
name: "cli: release"
on:
workflow_call:
inputs:
GIT_REF:
required: true
type: string
VERSION:
required: true
type: string
secrets:
AWS_ACCOUNT_ID:
required: true
NIX_CACHE_PUB_KEY:
required: true
NIX_CACHE_PRIV_KEY:
required: true
GH_PAT:
required: true
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
jobs:
build_artifacts:
uses: ./.github/workflows/wf_build_artifacts.yaml
with:
NAME: cli
PATH: cli
GIT_REF: ${{ inputs.GIT_REF }}
VERSION: ${{ inputs.VERSION }}
DOCKER: true
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
push-docker:
uses: ./.github/workflows/wf_docker_push_image.yaml
needs:
- build_artifacts
with:
NAME: cli
PATH: cli
VERSION: ${{ inputs.VERSION }}
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
build-multiplatform:
permissions:
id-token: write
contents: write
defaults:
run:
working-directory: cli
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 180
steps:
- name: "Check out repository"
uses: actions/checkout@v5
with:
ref: ${{ inputs.GIT_REF }}
- name: Configure aws
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
NAME: cli
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Compute common env vars
id: vars
run: |
echo "VERSION=$(make get-version VER=${{ inputs.VERSION }})" >> $GITHUB_OUTPUT
ARCH=$([ "${{ runner.arch }}" == "X64" ] && echo "x86_64" || echo "aarch64")
echo "ARCH=${ARCH}" >> $GITHUB_OUTPUT
- name: "Build artifact"
run: |
make build-multiplatform
- name: "Upload assets"
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
run: |
export VERSION=${{ steps.vars.outputs.VERSION }}
mkdir upload
tar cvzf upload/cli-$VERSION-darwin-amd64.tar.gz -C result/darwin/amd64 cli
tar cvzf upload/cli-$VERSION-darwin-arm64.tar.gz -C result/darwin/arm64 cli
tar cvzf upload/cli-$VERSION-linux-amd64.tar.gz -C result/linux/amd64 cli
tar cvzf upload/cli-$VERSION-linux-arm64.tar.gz -C result/linux/arm64 cli
cd upload
find . -type f -exec sha256sum {} + > ../checksums.txt
cd ..
cat checksums.txt
gh release upload \
--clobber "${{ github.ref_name }}" \
./upload/* checksums.txt
- name: "Store Nix cache"
uses: ./.github/actions/cache-nix
with:
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
if: always()

View File

@@ -0,0 +1,97 @@
---
on:
workflow_call:
inputs:
NAME:
type: string
required: true
PATH:
type: string
required: true
GIT_REF:
type: string
required: false
secrets:
AWS_ACCOUNT_ID:
required: true
NIX_CACHE_PUB_KEY:
required: true
NIX_CACHE_PRIV_KEY:
required: true
NHOST_PAT:
required: true
jobs:
tests:
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 30
defaults:
run:
working-directory: ${{ inputs.PATH }}
env:
NHOST_PAT: ${{ secrets.NHOST_PAT }}
permissions:
id-token: write
contents: write
actions: read
steps:
- name: "Check out repository"
uses: actions/checkout@v5
with:
ref: ${{ inputs.GIT_REF }}
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
with:
comment_on_pr: false
- name: Configure aws
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Get artifacts"
uses: actions/download-artifact@v5
with:
path: ~/artifacts
- name: "Inspect artifacts"
run: find ~/artifacts
- name: Load docker image
run: |
skopeo copy --insecure-policy \
dir:/home/runner/artifacts/cli-docker-image-x86_64-0.0.0-dev \
docker-daemon:cli:0.0.0-dev
- name: "Create a new project"
run: |
export NHOST_DOMAIN=staging.nhost.run
export NHOST_CONFIGSERVER_IMAGE=cli:0.0.0-dev
unzip /home/runner/artifacts/cli-artifact-x86_64-0.0.0-dev/result.zip
mkdir new-project
cd new-project
/home/runner/_work/nhost/nhost/cli/result/bin/cli login --pat ${{ secrets.NHOST_PAT }}
/home/runner/_work/nhost/nhost/cli/result/bin/cli init
/home/runner/_work/nhost/nhost/cli/result/bin/cli up --down-on-error
/home/runner/_work/nhost/nhost/cli/result/bin/cli down --volumes
- name: "Store Nix cache"
uses: ./.github/actions/cache-nix
with:
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
if: always()

View File

@@ -25,6 +25,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest

View File

@@ -32,6 +32,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest
@@ -59,6 +63,7 @@ jobs:
VERCEL_TEAM_ID: ${{ secrets.DASHBOARD_VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.DASHBOARD_STAGING_VERCEL_PROJECT_ID }}
VERCEL_DEPLOY_TOKEN: ${{ secrets.DASHBOARD_VERCEL_DEPLOY_TOKEN }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
build_artifacts:
@@ -71,6 +76,7 @@ jobs:
GIT_REF: ${{ github.sha }}
VERSION: 0.0.0-dev # we use a fixed version here to avoid unnecessary rebuilds
DOCKER: true
OS_MATRIX: '["blacksmith-2vcpu-ubuntu-2404"]'
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
@@ -93,7 +99,7 @@ jobs:
e2e_staging:
uses: ./.github/workflows/wf_dashboard_e2e_staging.yaml
uses: ./.github/workflows/dashboard_wf_e2e_staging.yaml
needs:
- check-permissions
- deploy-vercel
@@ -108,6 +114,7 @@ jobs:
NHOST_TEST_ORGANIZATION_SLUG: ${{ vars.NHOST_TEST_ORGANIZATION_SLUG }}
NHOST_TEST_PERSONAL_ORG_SLUG: ${{ vars.NHOST_TEST_PERSONAL_ORG_SLUG }}
NHOST_TEST_PROJECT_SUBDOMAIN: ${{ vars.NHOST_TEST_PROJECT_SUBDOMAIN }}
NHOST_TEST_PROJECT_REMOTE_SCHEMA_NAME: ${{ vars.NHOST_TEST_PROJECT_REMOTE_SCHEMA_NAME }}
NHOST_PRO_TEST_PROJECT_NAME: ${{ vars.NHOST_PRO_TEST_PROJECT_NAME }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}

View File

@@ -4,6 +4,32 @@ on:
push:
branches:
- main
paths:
- '.github/workflows/wf_build_artifacts.yaml'
- '.github/workflows/wf_check.yaml'
- '.github/workflows/dashboard_checks.yaml'
# common build
- 'flake.nix'
- 'flake.lock'
- 'nixops/**'
- 'build/**'
# common javascript
- ".npmrc"
- ".prettierignore"
- ".prettierrc.js"
- "audit-ci.jsonc"
- "package.json"
- "pnpm-workspace.yaml"
- "pnpm-lock.yaml"
- "turbo.json"
# dashboard
- "dashboard/**"
# nhost-js
- packages/nhost-js/**
jobs:
deploy-vercel:
@@ -19,4 +45,5 @@ jobs:
VERCEL_TEAM_ID: ${{ secrets.DASHBOARD_VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.DASHBOARD_STAGING_VERCEL_PROJECT_ID }}
VERCEL_DEPLOY_TOKEN: ${{ secrets.DASHBOARD_VERCEL_DEPLOY_TOKEN }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_STAGING }}

View File

@@ -29,6 +29,9 @@ on:
NHOST_TEST_PROJECT_SUBDOMAIN:
type: string
required: true
NHOST_TEST_PROJECT_REMOTE_SCHEMA_NAME:
type: string
required: true
NHOST_PRO_TEST_PROJECT_NAME:
type: string
required: true
@@ -56,6 +59,10 @@ on:
PLAYWRIGHT_REPORT_ENCRYPTION_KEY:
required: true
concurrency:
group: dashboard-e2e-staging
cancel-in-progress: false
env:
NEXT_PUBLIC_ENV: dev
NEXT_TELEMETRY_DISABLED: 1
@@ -65,6 +72,7 @@ env:
NHOST_TEST_ORGANIZATION_SLUG: ${{ inputs.NHOST_TEST_ORGANIZATION_SLUG }}
NHOST_TEST_PERSONAL_ORG_SLUG: ${{ inputs.NHOST_TEST_PERSONAL_ORG_SLUG }}
NHOST_TEST_PROJECT_SUBDOMAIN: ${{ inputs.NHOST_TEST_PROJECT_SUBDOMAIN }}
NHOST_TEST_PROJECT_REMOTE_SCHEMA_NAME: ${{ inputs.NHOST_TEST_PROJECT_REMOTE_SCHEMA_NAME }}
NHOST_PRO_TEST_PROJECT_NAME: ${{ inputs.NHOST_PRO_TEST_PROJECT_NAME }}
NHOST_TEST_USER_EMAIL: ${{ secrets.NHOST_TEST_USER_EMAIL }}
NHOST_TEST_USER_PASSWORD: ${{ secrets.NHOST_TEST_USER_PASSWORD }}
@@ -102,30 +110,12 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- uses: cachix/install-nix-action@v31
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-${{ inputs.NAME }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Start CLI
run: |
@@ -158,8 +148,8 @@ jobs:
path: dashboard/playwright-report.tar.gz.enc
retention-days: 1
- name: "Cache build"
run: |
nix store sign --key-file <(echo "${{ secrets.NIX_CACHE_PRIV_KEY }}") --all
find /nix/store -maxdepth 1 -name "*-*" -type d | xargs -n 25 nix copy --to s3://nhost-nix-cache\?region=eu-central-1
- name: "Store Nix cache"
uses: ./.github/actions/cache-nix
with:
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
if: always()

View File

@@ -4,9 +4,6 @@ name: 'dashboard: release'
on:
workflow_call:
inputs:
NAME:
required: true
type: string
GIT_REF:
required: true
type: string
@@ -49,6 +46,7 @@ jobs:
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_DEPLOY_TOKEN: ${{ secrets.VERCEL_DEPLOY_TOKEN }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
build_artifacts:
@@ -83,20 +81,19 @@ jobs:
- push-docker
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
repository: nhost/cli
token: ${{ secrets.GH_PAT }}
- name: Bump version in source code
run: |
find . -type f -exec sed -i 's/"nhost\/dashboard:[^"]*"/"nhost\/dashboard:${{ inputs.VERSION }}"/g' {} +
find cli -type f -exec sed -i 's/"nhost\/dashboard:[^"]*"/"nhost\/dashboard:${{ inputs.VERSION }}"/g' {} +
- name: "Create Pull Request"
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GH_PAT }}
title: "chore: bump nhost/dashboard to ${{ inputs.VERSION }}"
title: "chore(cli): bump nhost/dashboard to ${{ inputs.VERSION }}"
commit-message: "chore: bump nhost/dashboard to ${{ inputs.VERSION }}"
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>

View File

@@ -31,6 +31,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest

View File

@@ -41,6 +41,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest
@@ -77,6 +81,7 @@ jobs:
GIT_REF: ${{ github.sha }}
VERSION: 0.0.0-dev # we use a fixed version here to avoid unnecessary rebuilds
DOCKER: false
OS_MATRIX: '["blacksmith-2vcpu-ubuntu-2404"]'
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}

View File

@@ -41,6 +41,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest
@@ -77,6 +81,7 @@ jobs:
GIT_REF: ${{ github.sha }}
VERSION: 0.0.0-dev # we use a fixed version here to avoid unnecessary rebuilds
DOCKER: false
OS_MATRIX: '["blacksmith-2vcpu-ubuntu-2404"]'
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}

View File

@@ -41,6 +41,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest
@@ -77,6 +81,7 @@ jobs:
GIT_REF: ${{ github.sha }}
VERSION: 0.0.0-dev # we use a fixed version here to avoid unnecessary rebuilds
DOCKER: false
OS_MATRIX: '["blacksmith-2vcpu-ubuntu-2404"]'
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}

View File

@@ -7,7 +7,7 @@ on:
jobs:
pr_agent_job:
if: ${{ github.event.sender.type != 'Bot' }}
runs-on: ubuntu-latest
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 10
permissions:
issues: write
@@ -16,12 +16,11 @@ jobs:
steps:
- name: PR Agent action step
id: pragent
uses: Codium-ai/pr-agent@v0.26
uses: Codium-ai/pr-agent@v0.30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_KEY: ${{ secrets.OPENAI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
config.max_model_tokens: 100000
config.model: "anthropic/claude-3-5-sonnet-20240620"
config.model_turbo: "anthropic/claude-3-5-sonnet-20240620"
ignore.glob: "['pnpm-lock.yaml','**/pnpm-lock.yaml']"
config.model: "anthropic/claude-sonnet-4-20250514"
config.model_turbo: "anthropic/claude-sonnet-4-20250514"
ignore.glob: "['pnpm-lock.yaml','**/pnpm-lock.yaml', 'vendor/**','**/client_gen.go','**/models_gen.go','**/generated.go','**/*.gen.go']"

View File

@@ -1,8 +1,6 @@
name: "CodeQL"
on:
push: {}
pull_request: {}
schedule:
- cron: '20 23 * * 3'
@@ -18,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: [ 'javascript', 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support
@@ -28,7 +26,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -39,7 +37,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -53,4 +51,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

View File

@@ -23,7 +23,7 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- uses: nixbuild/nix-quick-install-action@v26
- uses: nixbuild/nix-quick-install-action@v34
with:
nix_version: 2.16.2
nix_conf: |
@@ -51,7 +51,7 @@ jobs:
"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update dependencies

View File

@@ -38,6 +38,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest

View File

@@ -17,6 +17,10 @@ on:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest

84
.github/workflows/storage_checks.yaml vendored Normal file
View File

@@ -0,0 +1,84 @@
---
name: "storage: check and build"
on:
# pull_request_target:
pull_request:
paths:
- '.github/workflows/storage_checks.yaml'
- '.github/workflows/wf_check.yaml'
- '.github/workflows/wf_build_artifacts.yaml'
# common build
- 'flake.nix'
- 'flake.lock'
- 'nixops/**'
- 'build/**'
# common go
- '.golangci.yaml'
- 'go.mod'
- 'go.sum'
- 'vendor/**'
# storage
- 'storage/**'
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('push-{0}', github.sha) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check-permissions:
runs-on: ubuntu-latest
steps:
- run: |
echo "github.event_name: ${{ github.event_name }}"
echo "github.event.pull_request.author_association: ${{ github.event.pull_request.author_association }}"
- name: "This task will run and fail if user has no permissions and label safe_to_test isn't present"
if: "github.event_name == 'pull_request_target' && ! ( contains(github.event.pull_request.labels.*.name, 'safe_to_test') || contains(fromJson('[\"OWNER\", \"MEMBER\", \"COLLABORATOR\"]'), github.event.pull_request.author_association) )"
run: |
exit 1
tests:
uses: ./.github/workflows/wf_check.yaml
needs:
- check-permissions
with:
NAME: storage
PATH: services/storage
GIT_REF: ${{ github.sha }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
NHOST_PAT: ${{ secrets.NHOST_PAT }}
build_artifacts:
uses: ./.github/workflows/wf_build_artifacts.yaml
needs:
- check-permissions
with:
NAME: storage
PATH: services/storage
GIT_REF: ${{ github.sha }}
VERSION: 0.0.0-dev # we use a fixed version here to avoid unnecessary rebuilds
DOCKER: true
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_PRODUCTION_CORE_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
remove_label:
runs-on: ubuntu-latest
needs:
- check-permissions
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: |
safe_to_test
if: contains(github.event.pull_request.labels.*.name, 'safe_to_test')

View File

@@ -0,0 +1,60 @@
---
name: "storage: release"
on:
workflow_call:
inputs:
GIT_REF:
required: true
type: string
VERSION:
required: true
type: string
secrets:
AWS_ACCOUNT_ID:
required: true
NIX_CACHE_PUB_KEY:
required: true
NIX_CACHE_PRIV_KEY:
required: true
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
jobs:
build_artifacts:
uses: ./.github/workflows/wf_build_artifacts.yaml
with:
NAME: storage
PATH: services/storage
GIT_REF: ${{ inputs.GIT_REF }}
VERSION: ${{ inputs.VERSION }}
DOCKER: true
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
push-docker-hub:
uses: ./.github/workflows/wf_docker_push_image.yaml
needs:
- build_artifacts
with:
NAME: storage
PATH: services/storage
VERSION: ${{ inputs.VERSION }}
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
push-docker-ecr:
uses: ./.github/workflows/wf_docker_push_image_ecr.yaml
needs:
- build_artifacts
with:
NAME: storage
PATH: services/storage
VERSION: ${{ inputs.VERSION }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
CONTAINER_REGISTRY: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com

View File

@@ -17,6 +17,10 @@ on:
DOCKER:
type: boolean
required: true
OS_MATRIX:
type: string
required: false
default: '["blacksmith-4vcpu-ubuntu-2404-arm", "blacksmith-2vcpu-ubuntu-2404"]'
secrets:
AWS_ACCOUNT_ID:
required: true
@@ -37,7 +41,7 @@ jobs:
strategy:
matrix:
os: [blacksmith-4vcpu-ubuntu-2404-arm, blacksmith-2vcpu-ubuntu-2404]
os: ${{ fromJSON(inputs.OS_MATRIX) }}
fail-fast: true
runs-on: ${{ matrix.os }}
@@ -55,39 +59,12 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- uses: cachix/install-nix-action@v31
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-${{ inputs.NAME }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
# - name: "Verify if nixops is pre-built"
# id: verify-nixops-build
# run: |
# export drvPath=$(make build-nixops-dry-run)
# echo "Derivation path: $drvPath"
# nix path-info --store s3://nhost-nix-cache\?region=eu-central-1 $drvPath \
# || (echo "Wait until nixops is already built and cached and run again" && exit 1)
# if: ${{ inputs.NAME != 'nixops' }}
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Compute common env vars
id: vars
@@ -124,8 +101,8 @@ jobs:
retention-days: 7
if: ${{ ( inputs.DOCKER ) }}
- name: "Cache build"
run: |
nix store sign --key-file <(echo "${{ secrets.NIX_CACHE_PRIV_KEY }}") --all
find /nix/store -maxdepth 1 -name "*-*" -type d | xargs -n 25 nix copy --to s3://nhost-nix-cache\?region=eu-central-1
- name: "Store Nix cache"
uses: ./.github/actions/cache-nix
with:
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
if: always()

View File

@@ -18,6 +18,8 @@ on:
required: true
NIX_CACHE_PRIV_KEY:
required: true
NHOST_PAT:
required: false
jobs:
tests:
@@ -28,6 +30,9 @@ jobs:
run:
working-directory: ${{ inputs.PATH }}
env:
NHOST_PAT: ${{ secrets.NHOST_PAT }}
permissions:
id-token: write
contents: write
@@ -50,39 +55,12 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- uses: cachix/install-nix-action@v31
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-${{ inputs.NAME }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
# - name: "Verify if nixops is pre-built"
# id: verify-nixops-build
# run: |
# export drvPath=$(make build-nixops-dry-run)
# echo "Derivation path: $drvPath"
# nix path-info --store s3://nhost-nix-cache\?region=eu-central-1 $drvPath \
# || (echo "Wait until nixops is already built and cached and run again" && exit 1)
# if: ${{ inputs.NAME != 'nixops' }}
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Verify if we need to build"
id: verify-build
@@ -104,8 +82,8 @@ jobs:
run: make check
if: ${{ steps.verify-build.outputs.BUILD_NEEDED == 'yes' }}
- name: "Cache build"
run: |
nix store sign --key-file <(echo "${{ secrets.NIX_CACHE_PRIV_KEY }}") --all
find /nix/store -maxdepth 1 -name "*-*" -type d | xargs -n 25 nix copy --to s3://nhost-nix-cache\?region=eu-central-1
- name: "Store Nix cache"
uses: ./.github/actions/cache-nix
with:
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }}
if: always()

View File

@@ -27,6 +27,8 @@ on:
required: true
DISCORD_WEBHOOK:
required: false
TURBO_TOKEN:
required: true
outputs:
preview-url:
@@ -57,36 +59,20 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- uses: cachix/install-nix-action@v31
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-${{ inputs.NAME }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger Vercel deployment
id: deploy
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: nhost
run: |
TARGET_OPTS="--target=${{ inputs.ENVIRONMENT }}"
echo "Deploying to: ${{ inputs.ENVIRONMENT }}..."

View File

@@ -33,7 +33,7 @@ jobs:
steps:
- name: "Check out repository"
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true

View File

@@ -0,0 +1,84 @@
---
on:
workflow_call:
inputs:
NAME:
type: string
required: true
PATH:
type: string
required: true
VERSION:
type: string
required: true
secrets:
AWS_ACCOUNT_ID:
required: true
CONTAINER_REGISTRY:
required: true
jobs:
push-to-registry:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
contents: write
defaults:
run:
working-directory: ${{ inputs.PATH }}
steps:
- name: "Check out repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Configure aws
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- name: "Login to Amazon ECR"
uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: 'true'
- name: "Compute common env vars"
id: vars
run: |
echo "VERSION=$(make get-version VER=${{ inputs.VERSION }})" >> $GITHUB_OUTPUT
- name: "Get artifacts"
uses: actions/download-artifact@v5
with:
path: ~/artifacts
- name: "Inspect artifacts"
run: find ~/artifacts
- name: "Push docker image to docker hub"
run: |
export NAME=${{ inputs.NAME }}
export VERSION=${{ steps.vars.outputs.VERSION }}
export CONTAINER_REGISTRY=${{ secrets.CONTAINER_REGISTRY }}
export CONTAINER_NAME=$CONTAINER_REGISTRY/$NAME
for ARCH in "x86_64" "aarch64"; do
skopeo copy --insecure-policy \
dir:/home/runner/artifacts/${{ inputs.NAME }}-docker-image-$ARCH-$VERSION \
docker-daemon:$CONTAINER_NAME:$VERSION-$ARCH
docker push $CONTAINER_NAME:$VERSION-$ARCH
done
docker manifest create \
$CONTAINER_NAME:$VERSION \
--amend $CONTAINER_NAME:$VERSION-x86_64 \
--amend $CONTAINER_NAME:$VERSION-aarch64
docker manifest push $CONTAINER_NAME:$VERSION

View File

@@ -47,30 +47,12 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions-nhost-${{ github.event.repository.name }}
aws-region: eu-central-1
- uses: cachix/install-nix-action@v31
- name: Setup Nix with Cache
uses: ./.github/actions/setup-nix
with:
install_url: "https://releases.nixos.org/nix/nix-2.28.4/install"
install_options: "--no-daemon"
extra_nix_config: |
experimental-features = nix-command flakes
sandbox = false
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
substituters = https://cache.nixos.org/?priority=40 s3://nhost-nix-cache?region=eu-central-1&priority=50
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ${{ secrets.NIX_CACHE_PUB_KEY }}
keep-env-derivations = true
keep-outputs = true
- name: Restore and save Nix store
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
restore-prefixes-first-match: nix-${{ inputs.NAME }}-${{ runner.os }}-${{ runner.arch }}}-
gc-max-store-size-linux: 2G
purge: true
purge-prefixes: nix-${{ inputs.NAME }}-
purge-created: 0
purge-last-accessed: 0
purge-primary-key: never
NAME: ${{ inputs.NAME }}
NIX_CACHE_PUB_KEY: ${{ secrets.NIX_CACHE_PUB_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Build package"
run: make build

2
.gitignore vendored
View File

@@ -71,3 +71,5 @@ result
.vitest
.claude
letsencrypt/*

View File

@@ -26,6 +26,7 @@ linters:
- legacy
- std-error-handling
rules:
# general rules
- linters:
- funlen
- ireturn
@@ -40,10 +41,26 @@ linters:
- ireturn
- lll
path: schema\.resolvers\.go
# storage service specific rules
- linters:
- gochecknoglobals
- gochecknoinits
path: services/storage/cmd/
- linters:
- gochecknoglobals
path: services/storage/cmd/controller/version.go
- linters:
- funlen
- ireturn
- exhaustruct
path: services/storage/.*_test\.go
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt

View File

@@ -98,64 +98,3 @@ You can run the e2e tests with the following command from the repository root:
```sh
$ pnpm e2e
```
## Changesets
If you've made changes to the packages, you must describe those changes so that they can be reflected in the next release.
We use [changesets](https://github.com/changesets/changesets) to support our versioning and release workflows. When you submit a pull request, a bot checks if changesets are present, and if not, it asks you to add them.
To create a changeset, run the following command from the repository root:
```sh
$ pnpm changeset
```
This command will guide you through the process of creating a changeset. It will create a file in the `.changeset` directory.
You can take a look at the changeset documentation: [How to add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).
### Selecting the Version
When you create a changeset, you will be asked to select the version of the package that you are bumping. The versioning scheme is as follows:
- **major**
- For breaking changes (e.g: changing the function signature, etc.)
- Should be avoided as much as possible as it will require users to update their code. Instead, consider supporting both the old and the new API simultaneously for a while.
- For example: `v1.5.8` -> `v2.0.0`
- **minor**
- For new features (e.g: adding a new page to the dashboard, etc.)
- For example: `v1.5.8` -> `v1.6.0`
- **patch**
- For bug fixes (e.g: fixing a typo, etc.)
- For example: `v1.5.8` -> `v1.5.9`
### Writing Good Changesets
A concise summary that describes the changes should be added to each PR. This summary will be used as the changeset description.
The following structure is used for describing changes:
- **The type of the change**:
- fix
- feat
- chore
- docs
- **The scope of the change** (_broader scopes (e.g: dashboard, hasura-storage-js, etc.) are not recommended as GitHub Releases already contain which project is being bumped_):
- projects
- deployments
- deps
- etc.
- **A short summary of the changes that were made**
**Examples:**
- `fix(deployments): use correct timestamp for deployment details`
- `chore(deps): bump @types/react to v18.2.8`
- `feat(secrets): enable secrets`
- etc.
You can always take a look at examples of changesets in the [GitHub Releases section](https://github.com/nhost/nhost/releases).

View File

@@ -54,8 +54,12 @@ get-version: ## Return version
@echo $(VERSION)
.PHONY: _check-pre
_check-pre: ## Pre-checks before running nix flake check
.PHONY: check
check: ## Run nix flake check
check: _check-pre ## Run nix flake check
nix build \
--print-build-logs \
.\#checks.$(ARCH)-$(OS).$(NAME)

View File

@@ -8,7 +8,7 @@ changelog-init: ## Initialize changelog using git-cliff
.PHONY: changelog-next-version
changelog-next-version: ## Get next version using git-cliff
@git cliff -u --bumped-version --tag-pattern $(TAG_PATTERN) $(CLIFF_OPTS) | awk -F\@ '{print $$2}'
@git cliff -u --bumped-version --tag-pattern $(TAG_PATTERN) $(CLIFF_OPTS) | sed 's/.*@//'
.PHONY: changelog-get-released
changelog-get-released: ## Get changelog for the latest release using git-cliff

29
cli/Makefile Normal file
View File

@@ -0,0 +1,29 @@
ROOT_DIR?=$(abspath ../)
include $(ROOT_DIR)/build/makefiles/general.makefile
.PHONY: _check-pre
_check-pre:
@sed -i 's/$$NHOST_PAT/$(NHOST_PAT)/' get_access_token.sh
.PHONY: _dev-env-up
_dev-env-up:
@echo "Nothing to do"
.PHONY: _dev-env-down
_dev-env-down:
@echo "Nothing to do"
.PHONY: _dev-env-build
_dev-env-build:
@echo "Nothing to do"
.PHONY: build-multiplatform
build-multiplatform: ## Build cli for all supported platforms
nix build \
--print-build-logs \
.\#packages.$(ARCH)-$(OS).cli-multiplatform

82
cli/README.md Normal file
View File

@@ -0,0 +1,82 @@
<div align="center">
<h1 style="font-size: 3em; font-weight: bold;">Nhost CLI</h1>
</div>
[Nhost](http://nhost.io) is an open-source Firebase alternative with GraphQL.
The Nhost CLI is used to set up a local development environment. This environment will automatically track database migrations and Hasura metadata.
It's recommended to use the Nhost CLI and the [Nhost GitHub Integration](https://docs.nhost.io/platform/github-integration) to develop locally and automatically deploy changes to production with a git-based workflow (similar to Netlify & Vercel).
## Services
- [Nhost Dashboard](https://github.com/nhost/nhost/tree/main/dashboard)
- [Postgres Database](https://www.postgresql.org/)
- [Hasura's GraphQL Engine](https://github.com/hasura/graphql-engine)
- [Hasura Auth](https://github.com/nhost/hasura-auth)
- [Hasura Storage](https://github.com/nhost/hasura-storage)
- [Nhost Serverless Functions](https://github.com/nhost/functions)
- [Minio S3](https://github.com/minio/minio)
- [Mailhog](https://github.com/mailhog/MailHog)
## Get Started
### Install the Nhost CLI
```bash
sudo curl -L https://raw.githubusercontent.com/nhost/nhost/main/cli/get.sh | bash
```
### Initialize a project
```bash
nhost init
```
### Initialize a project with a remote project as a starting point
```bash
nhost init --remote
```
### Start the development environment
```bash
nhost up
```
### Use the Nhost Dashboard
```bash
nhost up --ui nhost
```
## Documentation
- [Get started with Nhost CLI (longer version)](https://docs.nhost.io/platform/overview/get-started-with-nhost-cli)
- [Nhost CLI](https://docs.nhost.io/platform/cli)
- [Reference](https://docs.nhost.io/reference/cli)
## Build from Source
Make sure you have [Go](https://golang.org/doc/install) 1.18 or later installed.
The source code includes a self-signed certificate for testing purposes. Nhost workers with configured access to AWS may use the `cert.sh` script to generate a real certificate from Let's Encrypt.
```bash
go build -o /usr/local/bin/nhost
```
This will build the binary available as the `nhost` command in the terminal.
## Dependencies
- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [curl](https://curl.se/)
- [Git](https://git-scm.com/downloads)
## Supported Platforms
- MacOS
- Linux
- Windows WSL2

49
cli/cert.sh Executable file
View File

@@ -0,0 +1,49 @@
#!/bin/sh
set -euo pipefail
certbot certonly \
-v \
--dns-route53 \
-d local.auth.nhost.run \
-d local.dashboard.nhost.run \
-d local.db.nhost.run \
-d local.functions.nhost.run \
-d local.graphql.nhost.run \
-d local.hasura.nhost.run \
-d local.mailhog.nhost.run \
-d local.storage.nhost.run \
-m 'admin@nhost.io' \
--non-interactive \
--agree-tos \
--server https://acme-v02.api.letsencrypt.org/directory \
--logs-dir letsencrypt \
--config-dir letsencrypt \
--work-dir letsencrypt
cp letsencrypt/live/local.auth.nhost.run/fullchain.pem ssl/.ssl/local-fullchain.pem
cp letsencrypt/live/local.auth.nhost.run/privkey.pem ssl/.ssl/local-privkey.pem
certbot certonly \
-v \
--manual \
--preferred-challenges dns \
-d *.auth.local.nhost.run \
-d *.dashboard.local.nhost.run \
-d *.db.local.nhost.run \
-d *.functions.local.nhost.run \
-d *.graphql.local.nhost.run \
-d *.hasura.local.nhost.run \
-d *.mailhog.local.nhost.run \
-d *.storage.local.nhost.run \
-m 'admin@nhost.io' \
--agree-tos \
--server https://acme-v02.api.letsencrypt.org/directory \
--logs-dir letsencrypt \
--config-dir letsencrypt \
--work-dir letsencrypt
cp letsencrypt/live/auth.local.nhost.run/fullchain.pem ssl/.ssl/sub-fullchain.pem
cp letsencrypt/live/auth.local.nhost.run/privkey.pem ssl/.ssl/sub-privkey.pem
rm -rf letsencrypt

126
cli/clienv/clienv.go Normal file
View File

@@ -0,0 +1,126 @@
package clienv
import (
"context"
"fmt"
"io"
"os"
"regexp"
"strings"
"github.com/nhost/nhost/cli/nhostclient"
"github.com/nhost/nhost/cli/nhostclient/graphql"
"github.com/urfave/cli/v2"
)
func sanitizeName(name string) string {
re := regexp.MustCompile(`[^a-zA-Z0-9_-]`)
return strings.ToLower(re.ReplaceAllString(name, ""))
}
type CliEnv struct {
stdout io.Writer
stderr io.Writer
Path *PathStructure
authURL string
graphqlURL string
branch string
nhclient *nhostclient.Client
nhpublicclient *nhostclient.Client
projectName string
localSubdomain string
}
func New(
stdout io.Writer,
stderr io.Writer,
path *PathStructure,
authURL string,
graphqlURL string,
branch string,
projectName string,
localSubdomain string,
) *CliEnv {
return &CliEnv{
stdout: stdout,
stderr: stderr,
Path: path,
authURL: authURL,
graphqlURL: graphqlURL,
branch: branch,
nhclient: nil,
nhpublicclient: nil,
projectName: projectName,
localSubdomain: localSubdomain,
}
}
func FromCLI(cCtx *cli.Context) *CliEnv {
cwd, err := os.Getwd()
if err != nil {
panic(err)
}
return &CliEnv{
stdout: cCtx.App.Writer,
stderr: cCtx.App.ErrWriter,
Path: NewPathStructure(
cwd,
cCtx.String(flagRootFolder),
cCtx.String(flagDotNhostFolder),
cCtx.String(flagNhostFolder),
),
authURL: cCtx.String(flagAuthURL),
graphqlURL: cCtx.String(flagGraphqlURL),
branch: cCtx.String(flagBranch),
projectName: sanitizeName(cCtx.String(flagProjectName)),
nhclient: nil,
nhpublicclient: nil,
localSubdomain: cCtx.String(flagLocalSubdomain),
}
}
func (ce *CliEnv) ProjectName() string {
return ce.projectName
}
func (ce *CliEnv) LocalSubdomain() string {
return ce.localSubdomain
}
func (ce *CliEnv) AuthURL() string {
return ce.authURL
}
func (ce *CliEnv) GraphqlURL() string {
return ce.graphqlURL
}
func (ce *CliEnv) Branch() string {
return ce.branch
}
func (ce *CliEnv) GetNhostClient(ctx context.Context) (*nhostclient.Client, error) {
if ce.nhclient == nil {
session, err := ce.LoadSession(ctx)
if err != nil {
return nil, fmt.Errorf("failed to load session: %w", err)
}
ce.nhclient = nhostclient.New(
ce.authURL,
ce.graphqlURL,
graphql.WithAccessToken(session.Session.AccessToken),
)
}
return ce.nhclient, nil
}
func (ce *CliEnv) GetNhostPublicClient() (*nhostclient.Client, error) {
if ce.nhpublicclient == nil {
ce.nhpublicclient = nhostclient.New(ce.authURL, ce.graphqlURL)
}
return ce.nhpublicclient, nil
}

101
cli/clienv/filesystem.go Normal file
View File

@@ -0,0 +1,101 @@
package clienv
import (
"os"
"path/filepath"
)
type PathStructure struct {
workingDir string
root string
dotNhostFolder string
nhostFolder string
}
func NewPathStructure(
workingDir, root, dotNhostFolder, nhostFolder string,
) *PathStructure {
return &PathStructure{
workingDir: workingDir,
root: root,
dotNhostFolder: dotNhostFolder,
nhostFolder: nhostFolder,
}
}
func (p PathStructure) WorkingDir() string {
return p.workingDir
}
func (p PathStructure) Root() string {
return p.root
}
func (p PathStructure) DotNhostFolder() string {
return p.dotNhostFolder
}
func (p PathStructure) NhostFolder() string {
return p.nhostFolder
}
func (p PathStructure) AuthFile() string {
return filepath.Join(PathStateHome(), "auth.json")
}
func (p PathStructure) NhostToml() string {
return filepath.Join(p.nhostFolder, "nhost.toml")
}
func (p PathStructure) OverlaysFolder() string {
return filepath.Join(p.nhostFolder, "overlays")
}
func (p PathStructure) Overlay(subdomain string) string {
return filepath.Join(p.OverlaysFolder(), subdomain+".json")
}
func (p PathStructure) Secrets() string {
return filepath.Join(p.root, ".secrets")
}
func (p PathStructure) HasuraConfig() string {
return filepath.Join(p.nhostFolder, "config.yaml")
}
func (p PathStructure) ProjectFile() string {
return filepath.Join(p.dotNhostFolder, "project.json")
}
func (p PathStructure) DockerCompose() string {
return filepath.Join(p.dotNhostFolder, "docker-compose.yaml")
}
func (p PathStructure) Functions() string {
return filepath.Join(p.root, "functions")
}
func PathExists(path string) bool {
_, err := os.Stat(path)
return !os.IsNotExist(err)
}
func PathStateHome() string {
var path string
if os.Getenv("XDG_STATE_HOME") != "" {
path = filepath.Join(os.Getenv("XDG_STATE_HOME"), "nhost")
} else {
path = filepath.Join(os.Getenv("HOME"), ".nhost", "state")
}
return path
}
func (p PathStructure) RunServiceOverlaysFolder(configPath string) string {
base := filepath.Dir(configPath)
return filepath.Join(base, "nhost", "overlays")
}
func (p PathStructure) RunServiceOverlay(configPath, subdomain string) string {
return filepath.Join(p.RunServiceOverlaysFolder(configPath), "run-"+subdomain+".json")
}

108
cli/clienv/flags.go Normal file
View File

@@ -0,0 +1,108 @@
package clienv
import (
"fmt"
"os"
"path/filepath"
"github.com/go-git/go-git/v5"
"github.com/urfave/cli/v2"
)
const (
flagAuthURL = "auth-url"
flagGraphqlURL = "graphql-url"
flagBranch = "branch"
flagProjectName = "project-name"
flagRootFolder = "root-folder"
flagNhostFolder = "nhost-folder"
flagDotNhostFolder = "dot-nhost-folder"
flagLocalSubdomain = "local-subdomain"
)
func getGitBranchName() string {
repo, err := git.PlainOpenWithOptions(".", &git.PlainOpenOptions{
DetectDotGit: true,
EnableDotGitCommonDir: false,
})
if err != nil {
return "nogit"
}
head, err := repo.Head()
if err != nil {
return "nogit"
}
return head.Name().Short()
}
func Flags() ([]cli.Flag, error) {
fullWorkingDir, err := os.Getwd()
if err != nil {
return nil, fmt.Errorf("failed to get working directory: %w", err)
}
branch := getGitBranchName()
workingDir := "."
dotNhostFolder := filepath.Join(workingDir, ".nhost")
nhostFolder := filepath.Join(workingDir, "nhost")
return []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagAuthURL,
Usage: "Nhost auth URL",
EnvVars: []string{"NHOST_CLI_AUTH_URL"},
Value: "https://otsispdzcwxyqzbfntmj.auth.eu-central-1.nhost.run/v1",
Hidden: true,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagGraphqlURL,
Usage: "Nhost GraphQL URL",
EnvVars: []string{"NHOST_CLI_GRAPHQL_URL"},
Value: "https://otsispdzcwxyqzbfntmj.graphql.eu-central-1.nhost.run/v1",
Hidden: true,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagBranch,
Usage: "Git branch name. If not set, it will be detected from the current git repository. This flag is used to dynamically create docker volumes for each branch. If you want to have a static volume name or if you are not using git, set this flag to a static value.", //nolint:lll
EnvVars: []string{"BRANCH"},
Value: branch,
Hidden: false,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagRootFolder,
Usage: "Root folder of project\n\t",
EnvVars: []string{"NHOST_ROOT_FOLDER"},
Value: workingDir,
Category: "Project structure",
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagDotNhostFolder,
Usage: "Path to .nhost folder\n\t",
EnvVars: []string{"NHOST_DOT_NHOST_FOLDER"},
Value: dotNhostFolder,
Category: "Project structure",
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagNhostFolder,
Usage: "Path to nhost folder\n\t",
EnvVars: []string{"NHOST_NHOST_FOLDER"},
Value: nhostFolder,
Category: "Project structure",
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagProjectName,
Usage: "Project name",
Value: filepath.Base(fullWorkingDir),
EnvVars: []string{"NHOST_PROJECT_NAME"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagLocalSubdomain,
Usage: "Local subdomain to reach the development environment",
Value: "local",
EnvVars: []string{"NHOST_LOCAL_SUBDOMAIN"},
},
}, nil
}

91
cli/clienv/style.go Normal file
View File

@@ -0,0 +1,91 @@
//nolint:gochecknoglobals
package clienv
import (
"bufio"
"fmt"
"os"
"strings"
"syscall"
"github.com/charmbracelet/lipgloss"
"golang.org/x/term"
)
const (
ANSIColorWhite = lipgloss.Color("15")
ANSIColorCyan = lipgloss.Color("14")
ANSIColorPurple = lipgloss.Color("13")
ANSIColorBlue = lipgloss.Color("12")
ANSIColorYellow = lipgloss.Color("11")
ANSIColorGreen = lipgloss.Color("10")
ANSIColorRed = lipgloss.Color("9")
ANSIColorGray = lipgloss.Color("8")
)
const (
IconInfo = ""
IconWarn = "⚠"
)
var info = lipgloss.NewStyle().
Foreground(ANSIColorCyan).
Render
var warn = lipgloss.NewStyle().
Foreground(ANSIColorYellow).
Render
var promptMessage = lipgloss.NewStyle().
Foreground(ANSIColorCyan).
Bold(true).
Render
func (ce *CliEnv) Println(msg string, a ...any) {
if _, err := fmt.Fprintln(ce.stdout, fmt.Sprintf(msg, a...)); err != nil {
panic(err)
}
}
func (ce *CliEnv) Infoln(msg string, a ...any) {
if _, err := fmt.Fprintln(ce.stdout, info(fmt.Sprintf(msg, a...))); err != nil {
panic(err)
}
}
func (ce *CliEnv) Warnln(msg string, a ...any) {
if _, err := fmt.Fprintln(ce.stdout, warn(fmt.Sprintf(msg, a...))); err != nil {
panic(err)
}
}
func (ce *CliEnv) PromptMessage(msg string, a ...any) {
if _, err := fmt.Fprint(ce.stdout, promptMessage("- "+fmt.Sprintf(msg, a...))); err != nil {
panic(err)
}
}
func (ce *CliEnv) PromptInput(hide bool) (string, error) {
reader := bufio.NewReader(os.Stdin)
var (
response string
err error
)
if !hide {
response, err = reader.ReadString('\n')
if err != nil {
return "", fmt.Errorf("failed to read input: %w", err)
}
} else {
output, err := term.ReadPassword(syscall.Stdin)
if err != nil {
return "", fmt.Errorf("failed to read input: %w", err)
}
response = string(output)
}
return strings.TrimSpace(response), err
}

44
cli/clienv/table.go Normal file
View File

@@ -0,0 +1,44 @@
package clienv
import "github.com/charmbracelet/lipgloss"
type Column struct {
Header string
Rows []string
}
func Table(columns ...Column) string {
list := lipgloss.NewStyle().
Border(lipgloss.NormalBorder(), false, true, false, false).
BorderForeground(ANSIColorGray).
Padding(1)
// Width(30 + 1) //nolint:mnd
listHeader := lipgloss.NewStyle().
Foreground(ANSIColorPurple).
Render
listItem := lipgloss.NewStyle().Render
strs := make([]string, len(columns))
for i, col := range columns {
c := make([]string, len(col.Rows)+1)
c[0] = listHeader(col.Header)
for i, row := range col.Rows {
c[i+1] = listItem(row)
}
strs[i] = list.Render(
lipgloss.JoinVertical(
lipgloss.Left,
c...,
),
)
}
return lipgloss.JoinHorizontal(
lipgloss.Top,
strs...,
)
}

73
cli/clienv/wf_app_info.go Normal file
View File

@@ -0,0 +1,73 @@
package clienv
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"github.com/nhost/nhost/cli/nhostclient/graphql"
)
func getRemoteAppInfo(
ctx context.Context,
ce *CliEnv,
subdomain string,
) (*graphql.AppSummaryFragment, error) {
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get nhost client: %w", err)
}
resp, err := cl.GetOrganizationsAndWorkspacesApps(
ctx,
)
if err != nil {
return nil, fmt.Errorf("failed to get workspaces: %w", err)
}
for _, workspace := range resp.Workspaces {
for _, app := range workspace.Apps {
if app.Subdomain == subdomain {
return app, nil
}
}
}
for _, organization := range resp.Organizations {
for _, app := range organization.Apps {
if app.Subdomain == subdomain {
return app, nil
}
}
}
return nil, fmt.Errorf("failed to find app with subdomain: %s", subdomain) //nolint:err113
}
func (ce *CliEnv) GetAppInfo(
ctx context.Context,
subdomain string,
) (*graphql.AppSummaryFragment, error) {
if subdomain != "" {
return getRemoteAppInfo(ctx, ce, subdomain)
}
var project *graphql.AppSummaryFragment
if err := UnmarshalFile(ce.Path.ProjectFile(), &project, json.Unmarshal); err != nil {
if errors.Is(err, os.ErrNotExist) {
project, err = ce.Link(ctx)
if err != nil {
return nil, err
}
} else {
ce.Warnln("Failed to find linked project: %v", err)
ce.Infoln("Please run `nhost link` to link a project first")
return nil, err
}
}
return project, nil
}

173
cli/clienv/wf_link.go Normal file
View File

@@ -0,0 +1,173 @@
package clienv
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"strconv"
"github.com/nhost/nhost/cli/nhostclient/graphql"
)
func Printlist(ce *CliEnv, orgs *graphql.GetOrganizationsAndWorkspacesApps) error {
if len(orgs.GetWorkspaces())+len(orgs.GetOrganizations()) == 0 {
return errors.New("no apps found") //nolint:err113
}
num := Column{
Header: "#",
Rows: make([]string, 0),
}
subdomain := Column{
Header: "Subdomain",
Rows: make([]string, 0),
}
project := Column{
Header: "Project",
Rows: make([]string, 0),
}
organization := Column{
Header: "Organization/Workspace",
Rows: make([]string, 0),
}
region := Column{
Header: "Region",
Rows: make([]string, 0),
}
for _, org := range orgs.GetOrganizations() {
for _, app := range org.Apps {
num.Rows = append(num.Rows, strconv.Itoa(len(num.Rows)+1))
subdomain.Rows = append(subdomain.Rows, app.Subdomain)
project.Rows = append(project.Rows, app.Name)
organization.Rows = append(organization.Rows, org.Name)
region.Rows = append(region.Rows, app.Region.Name)
}
}
for _, ws := range orgs.GetWorkspaces() {
for _, app := range ws.Apps {
num.Rows = append(num.Rows, strconv.Itoa(len(num.Rows)+1))
subdomain.Rows = append(subdomain.Rows, app.Subdomain)
project.Rows = append(project.Rows, app.Name)
organization.Rows = append(organization.Rows, ws.Name+"*")
region.Rows = append(region.Rows, app.Region.Name)
}
}
ce.Println("%s", Table(num, subdomain, project, organization, region))
ce.Println("* Legacy Workspace")
return nil
}
func confirmApp(ce *CliEnv, app *graphql.AppSummaryFragment) error {
ce.PromptMessage("Enter project subdomain to confirm: ")
confirm, err := ce.PromptInput(false)
if err != nil {
return fmt.Errorf("failed to read input: %w", err)
}
if confirm != app.Subdomain {
return errors.New("input doesn't match the subdomain") //nolint:err113
}
return nil
}
func getApp(
orgs *graphql.GetOrganizationsAndWorkspacesApps,
idx string,
) (*graphql.AppSummaryFragment, error) {
x := 1
var app *graphql.AppSummaryFragment
OUTER:
for _, orgs := range orgs.GetOrganizations() {
for _, a := range orgs.GetApps() {
if strconv.Itoa(x) == idx {
a := a
app = a
break OUTER
}
x++
}
}
if app != nil {
return app, nil
}
OUTER2:
for _, ws := range orgs.GetWorkspaces() {
for _, a := range ws.GetApps() {
if strconv.Itoa(x) == idx {
a := a
app = a
break OUTER2
}
x++
}
}
if app == nil {
return nil, errors.New("invalid input") //nolint:err113
}
return app, nil
}
func (ce *CliEnv) Link(ctx context.Context) (*graphql.AppSummaryFragment, error) {
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get nhost client: %w", err)
}
orgs, err := cl.GetOrganizationsAndWorkspacesApps(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get workspaces: %w", err)
}
if len(orgs.GetWorkspaces())+len(orgs.GetOrganizations()) == 0 {
return nil, errors.New("no apps found") //nolint:err113
}
if err := Printlist(ce, orgs); err != nil {
return nil, err
}
ce.PromptMessage("Select the workspace # to link: ")
idx, err := ce.PromptInput(false)
if err != nil {
return nil, fmt.Errorf("failed to read workspace: %w", err)
}
app, err := getApp(orgs, idx)
if err != nil {
return nil, err
}
if err := confirmApp(ce, app); err != nil {
return nil, err
}
if err := os.MkdirAll(ce.Path.DotNhostFolder(), 0o755); err != nil { //nolint:mnd
return nil, fmt.Errorf("failed to create .nhost folder: %w", err)
}
if err := MarshalFile(app, ce.Path.ProjectFile(), json.Marshal); err != nil {
return nil, fmt.Errorf("failed to marshal project information: %w", err)
}
return app, nil
}

296
cli/clienv/wf_login.go Normal file
View File

@@ -0,0 +1,296 @@
package clienv
import (
"context"
"crypto"
"crypto/tls"
"crypto/x509"
"encoding/json"
"encoding/pem"
"errors"
"fmt"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
"runtime"
"time"
"github.com/nhost/nhost/cli/nhostclient"
"github.com/nhost/nhost/cli/nhostclient/credentials"
"github.com/nhost/nhost/cli/ssl"
)
func savePAT(
ce *CliEnv,
session credentials.Credentials,
) error {
dir := filepath.Dir(ce.Path.AuthFile())
if !PathExists(dir) {
if err := os.MkdirAll(dir, 0o755); err != nil { //nolint:mnd
return fmt.Errorf("failed to create dir: %w", err)
}
}
if err := MarshalFile(session, ce.Path.AuthFile(), json.Marshal); err != nil {
return fmt.Errorf("failed to write PAT to file: %w", err)
}
return nil
}
func signinHandler(ch chan<- string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
ch <- r.URL.Query().Get("refreshToken")
fmt.Fprintf(w, "You may now close this window.")
}
}
func openBrowser(ctx context.Context, url string) error {
var (
cmd string
args []string
)
switch runtime.GOOS {
case "darwin":
cmd = "open"
default: // "linux", "freebsd", "openbsd", "netbsd"
cmd = "xdg-open"
}
args = append(args, url)
if err := exec.CommandContext(ctx, cmd, args...).Start(); err != nil {
return fmt.Errorf("failed to open browser: %w", err)
}
return nil
}
func getTLSServer() (*http.Server, error) {
block, _ := pem.Decode(ssl.LocalKeyFile)
// Parse the PEM data to obtain the private key
privateKey, err := x509.ParsePKCS8PrivateKey(block.Bytes)
if err != nil {
return nil, fmt.Errorf("failed to parse private key: %w", err)
}
// Type assert the private key to crypto.PrivateKey
pk, ok := privateKey.(crypto.PrivateKey)
if !ok {
return nil, errors.New( //nolint:err113
"failed to type assert private key to crypto.PrivateKey",
)
}
block, _ = pem.Decode(ssl.LocalCertFile)
certificate, err := x509.ParseCertificate(block.Bytes)
if err != nil {
return nil, fmt.Errorf("failed to parse certificate: %w", err)
}
tlsConfig := &tls.Config{ //nolint:exhaustruct
MinVersion: tls.VersionTLS12,
CipherSuites: nil,
Certificates: []tls.Certificate{
{ //nolint:exhaustruct
Certificate: [][]byte{certificate.Raw},
PrivateKey: pk,
},
},
}
return &http.Server{ //nolint:exhaustruct
Addr: ":8099",
TLSConfig: tlsConfig,
ReadHeaderTimeout: time.Second * 10, //nolint:mnd
}, nil
}
func (ce *CliEnv) loginPAT(pat string) credentials.Credentials {
session := credentials.Credentials{
ID: "",
PersonalAccessToken: pat,
}
return session
}
func (ce *CliEnv) loginEmailPassword(
ctx context.Context,
email string,
password string,
) (credentials.Credentials, error) {
cl := nhostclient.New(ce.AuthURL(), ce.GraphqlURL())
var err error
if email == "" {
ce.PromptMessage("email: ")
email, err = ce.PromptInput(false)
if err != nil {
return credentials.Credentials{}, fmt.Errorf("failed to read email: %w", err)
}
}
if password == "" {
ce.PromptMessage("password: ")
password, err = ce.PromptInput(true)
ce.Println("")
if err != nil {
return credentials.Credentials{}, fmt.Errorf("failed to read password: %w", err)
}
}
ce.Infoln("Authenticating")
loginResp, err := cl.Login(ctx, email, password)
if err != nil {
return credentials.Credentials{}, fmt.Errorf("failed to login: %w", err)
}
session, err := cl.CreatePAT(ctx, loginResp.Session.AccessToken)
if err != nil {
return credentials.Credentials{}, fmt.Errorf("failed to create PAT: %w", err)
}
ce.Infoln("Successfully logged in")
return session, nil
}
func (ce *CliEnv) loginGithub(ctx context.Context) (credentials.Credentials, error) {
refreshToken := make(chan string)
http.HandleFunc("/signin", signinHandler(refreshToken))
go func() {
server, err := getTLSServer()
if err != nil {
log.Fatal(err)
}
if err := server.ListenAndServeTLS("", ""); err != nil {
log.Fatal(err)
}
}()
signinPage := ce.AuthURL() + "/signin/provider/github/?redirectTo=https://local.dashboard.local.nhost.run:8099/signin"
ce.Infoln("Opening browser to sign-in")
if err := openBrowser(ctx, signinPage); err != nil {
return credentials.Credentials{}, err
}
ce.Infoln("Waiting for sign-in to complete")
refreshTokenValue := <-refreshToken
cl := nhostclient.New(ce.AuthURL(), ce.GraphqlURL())
refreshTokenResp, err := cl.RefreshToken(ctx, refreshTokenValue)
if err != nil {
return credentials.Credentials{}, fmt.Errorf("failed to get access token: %w", err)
}
session, err := cl.CreatePAT(ctx, refreshTokenResp.AccessToken)
if err != nil {
return credentials.Credentials{}, fmt.Errorf("failed to create PAT: %w", err)
}
ce.Infoln("Successfully logged in")
return session, nil
}
func (ce *CliEnv) loginMethod(ctx context.Context) (credentials.Credentials, error) {
ce.Infoln("Select authentication method:\n1. PAT\n2. Email/Password\n3. Github")
ce.PromptMessage("method: ")
method, err := ce.PromptInput(false)
if err != nil {
return credentials.Credentials{}, fmt.Errorf(
"failed to read authentication method: %w",
err,
)
}
var session credentials.Credentials
switch method {
case "1":
ce.PromptMessage("PAT: ")
pat, err := ce.PromptInput(true)
if err != nil {
return credentials.Credentials{}, fmt.Errorf("failed to read PAT: %w", err)
}
session = ce.loginPAT(pat)
case "2":
session, err = ce.loginEmailPassword(ctx, "", "")
case "3":
session, err = ce.loginGithub(ctx)
default:
return ce.loginMethod(ctx)
}
return session, err
}
func (ce *CliEnv) verifyEmail(
ctx context.Context,
email string,
) error {
ce.Infoln("Your email address is not verified")
cl := nhostclient.New(ce.AuthURL(), ce.GraphqlURL())
if err := cl.VerifyEmail(ctx, email); err != nil {
return fmt.Errorf("failed to send verification email: %w", err)
}
ce.Infoln("A verification email has been sent to %s", email)
ce.Infoln("Please verify your email address and try again")
return nil
}
func (ce *CliEnv) Login(
ctx context.Context,
pat string,
email string,
password string,
) (credentials.Credentials, error) {
var (
session credentials.Credentials
err error
)
switch {
case pat != "":
session = ce.loginPAT(pat)
case email != "" || password != "":
session, err = ce.loginEmailPassword(ctx, email, password)
default:
session, err = ce.loginMethod(ctx)
}
var reqErr *nhostclient.RequestError
if errors.As(err, &reqErr) && reqErr.ErrorCode == "unverified-user" {
return credentials.Credentials{}, ce.verifyEmail(ctx, email)
}
if err != nil {
return session, err
}
if err := savePAT(ce, session); err != nil {
return credentials.Credentials{}, err
}
return session, nil
}

52
cli/clienv/wf_marshal.go Normal file
View File

@@ -0,0 +1,52 @@
package clienv
import (
"errors"
"fmt"
"io"
"os"
)
var ErrNoContent = errors.New("no content")
func UnmarshalFile(filepath string, v any, f func([]byte, any) error) error {
r, err := os.OpenFile(filepath, os.O_RDONLY, 0o600) //nolint:mnd
if err != nil {
return fmt.Errorf("failed to open file: %w", err)
}
defer r.Close()
b, err := io.ReadAll(r)
if err != nil {
return fmt.Errorf("failed to read contents of reader: %w", err)
}
if len(b) == 0 {
return ErrNoContent
}
if err := f(b, v); err != nil {
return fmt.Errorf("failed to unmarshal object: %w", err)
}
return nil
}
func MarshalFile(v any, filepath string, fn func(any) ([]byte, error)) error {
f, err := os.OpenFile(filepath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600) //nolint:mnd
if err != nil {
return fmt.Errorf("failed to open file: %w", err)
}
defer f.Close()
b, err := fn(v)
if err != nil {
return fmt.Errorf("error marshalling object: %w", err)
}
if _, err := f.Write(b); err != nil {
return fmt.Errorf("error writing marshalled object: %w", err)
}
return nil
}

31
cli/clienv/wf_session.go Normal file
View File

@@ -0,0 +1,31 @@
package clienv
import (
"context"
"encoding/json"
"fmt"
"github.com/nhost/nhost/cli/nhostclient"
"github.com/nhost/nhost/cli/nhostclient/credentials"
)
func (ce *CliEnv) LoadSession(
ctx context.Context,
) (credentials.Session, error) {
var creds credentials.Credentials
if err := UnmarshalFile(ce.Path.AuthFile(), &creds, json.Unmarshal); err != nil {
creds, err = ce.Login(ctx, "", "", "")
if err != nil {
return credentials.Session{}, fmt.Errorf("failed to login: %w", err)
}
}
cl := nhostclient.New(ce.AuthURL(), ce.GraphqlURL())
session, err := cl.LoginPAT(ctx, creds.PersonalAccessToken)
if err != nil {
return credentials.Session{}, fmt.Errorf("failed to login: %w", err)
}
return session, nil
}

102
cli/cmd/config/apply.go Normal file
View File

@@ -0,0 +1,102 @@
package config
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/urfave/cli/v2"
)
func CommandApply() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "apply",
Aliases: []string{},
Usage: "Apply configuration to cloud project",
Action: commandApply,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagSubdomain,
Usage: "Subdomain of the Nhost project to apply configuration to. Defaults to linked project",
Required: true,
EnvVars: []string{"NHOST_SUBDOMAIN"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagYes,
Usage: "Skip confirmation",
EnvVars: []string{"NHOST_YES"},
},
},
}
}
func commandApply(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
proj, err := ce.GetAppInfo(cCtx.Context, cCtx.String(flagSubdomain))
if err != nil {
return fmt.Errorf("failed to get app info: %w", err)
}
ce.Infoln("Validating configuration...")
cfg, _, err := ValidateRemote(
cCtx.Context,
ce,
proj.GetSubdomain(),
proj.GetID(),
)
if err != nil {
return err
}
return Apply(cCtx.Context, ce, proj.ID, cfg, cCtx.Bool(flagYes))
}
func Apply(
ctx context.Context,
ce *clienv.CliEnv,
appID string,
cfg *model.ConfigConfig,
skipConfirmation bool,
) error {
if !skipConfirmation {
ce.PromptMessage(
"We are going to overwrite the project's configuration. Do you want to proceed? [y/N] ",
)
resp, err := ce.PromptInput(false)
if err != nil {
return fmt.Errorf("failed to read input: %w", err)
}
if resp != "y" && resp != "Y" {
return errors.New("aborting") //nolint:err113
}
}
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
b, err := json.Marshal(cfg)
if err != nil {
return fmt.Errorf("failed to marshal config: %w", err)
}
if _, err := cl.ReplaceConfigRawJSON(
ctx,
appID,
string(b),
); err != nil {
return fmt.Errorf("failed to apply config: %w", err)
}
ce.Infoln("Configuration applied successfully!")
return nil
}

22
cli/cmd/config/config.go Normal file
View File

@@ -0,0 +1,22 @@
package config
import "github.com/urfave/cli/v2"
const flagSubdomain = "subdomain"
func Command() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config",
Aliases: []string{},
Usage: "Perform config operations",
Subcommands: []*cli.Command{
CommandDefault(),
CommandExample(),
CommandApply(),
CommandPull(),
CommandShow(),
CommandValidate(),
CommandEdit(),
},
}
}

58
cli/cmd/config/default.go Normal file
View File

@@ -0,0 +1,58 @@
package config
import (
"fmt"
"os"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/project"
"github.com/nhost/nhost/cli/project/env"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
func CommandDefault() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "default",
Aliases: []string{},
Usage: "Create default configuration and secrets",
Action: commandDefault,
Flags: []cli.Flag{},
}
}
func commandDefault(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
if err := os.MkdirAll(ce.Path.NhostFolder(), 0o755); err != nil { //nolint:mnd
return fmt.Errorf("failed to create nhost folder: %w", err)
}
ce.Infoln("Initializing Nhost project")
if err := InitConfigAndSecrets(ce); err != nil {
return fmt.Errorf("failed to initialize project: %w", err)
}
ce.Infoln("Successfully generated default configuration and secrets")
return nil
}
func InitConfigAndSecrets(ce *clienv.CliEnv) error {
config, err := project.DefaultConfig()
if err != nil {
return fmt.Errorf("failed to create default config: %w", err)
}
if err := clienv.MarshalFile(config, ce.Path.NhostToml(), toml.Marshal); err != nil {
return fmt.Errorf("failed to save config: %w", err)
}
secrets := project.DefaultSecrets()
if err := clienv.MarshalFile(secrets, ce.Path.Secrets(), env.Marshal); err != nil {
return fmt.Errorf("failed to save secrets: %w", err)
}
return nil
}

182
cli/cmd/config/edit.go Normal file
View File

@@ -0,0 +1,182 @@
package config
import (
"context"
"encoding/json"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"sort"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
"github.com/wI2L/jsondiff"
)
const (
flagEditor = "editor"
)
func CommandEdit() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "edit",
Aliases: []string{},
Usage: "Edit base configuration or an overlay",
Action: edit,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagSubdomain,
Usage: "If specified, edit this subdomain's overlay, otherwise edit base configuation",
EnvVars: []string{"NHOST_SUBDOMAIN"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagEditor,
Usage: "Editor to use",
Value: "vim",
EnvVars: []string{"EDITOR"},
},
},
}
}
func EditFile(ctx context.Context, editor, filepath string) error {
cmd := exec.CommandContext(
ctx,
editor,
filepath,
)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
return fmt.Errorf("failed to open editor: %w", err)
}
return nil
}
func CopyConfig[T any](src, dst, overlayPath string) error {
var cfg *T
if err := clienv.UnmarshalFile(src, &cfg, toml.Unmarshal); err != nil {
return fmt.Errorf("failed to parse config: %w", err)
}
var err error
if clienv.PathExists(overlayPath) {
cfg, err = ApplyJSONPatches(*cfg, overlayPath)
if err != nil {
return fmt.Errorf("failed to apply json patches: %w", err)
}
}
if err := clienv.MarshalFile(cfg, dst, toml.Marshal); err != nil {
return fmt.Errorf("failed to save temporary file: %w", err)
}
return nil
}
func readFile(filepath string) (any, error) {
f, err := os.Open(filepath)
if err != nil {
return nil, fmt.Errorf("failed to open file: %w", err)
}
defer f.Close()
b, err := io.ReadAll(f)
if err != nil {
return nil, fmt.Errorf("failed to read file: %w", err)
}
var v any
if err := toml.Unmarshal(b, &v); err != nil {
return nil, fmt.Errorf("failed to unmarshal toml: %w", err)
}
return v, nil
}
func GenerateJSONPatch(origfilepath, newfilepath, dst string) error {
origo, err := readFile(origfilepath)
if err != nil {
return fmt.Errorf("failed to convert original toml to json: %w", err)
}
newo, err := readFile(newfilepath)
if err != nil {
return fmt.Errorf("failed to convert new toml to json: %w", err)
}
patches, err := jsondiff.Compare(origo, newo)
if err != nil {
return fmt.Errorf("failed to generate json patch: %w", err)
}
dstf, err := os.OpenFile(dst, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0o644) //nolint:mnd
if err != nil {
return fmt.Errorf("failed to open destination file: %w", err)
}
defer dstf.Close()
sort.Slice(patches, func(i, j int) bool {
return patches[i].Path < patches[j].Path
})
dstb, err := json.MarshalIndent(patches, "", " ")
if err != nil {
return fmt.Errorf("failed to prettify json: %w", err)
}
if _, err := dstf.Write(dstb); err != nil {
return fmt.Errorf("failed to write to destination file: %w", err)
}
return nil
}
func edit(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
if cCtx.String(flagSubdomain) == "" {
if err := EditFile(cCtx.Context, cCtx.String(flagEditor), ce.Path.NhostToml()); err != nil {
return fmt.Errorf("failed to edit config: %w", err)
}
return nil
}
if err := os.MkdirAll(ce.Path.OverlaysFolder(), 0o755); err != nil { //nolint:mnd
return fmt.Errorf("failed to create json patches directory: %w", err)
}
tmpdir, err := os.MkdirTemp(os.TempDir(), "nhost-jsonpatch")
if err != nil {
return fmt.Errorf("failed to create temporary directory: %w", err)
}
defer os.RemoveAll(tmpdir)
tmpfileName := filepath.Join(tmpdir, "nhost.toml")
if err := CopyConfig[model.ConfigConfig](
ce.Path.NhostToml(), tmpfileName, ce.Path.Overlay(cCtx.String(flagSubdomain)),
); err != nil {
return fmt.Errorf("failed to copy config: %w", err)
}
if err := EditFile(cCtx.Context, cCtx.String(flagEditor), tmpfileName); err != nil {
return fmt.Errorf("failed to edit config: %w", err)
}
if err := GenerateJSONPatch(
ce.Path.NhostToml(), tmpfileName, ce.Path.Overlay(cCtx.String(flagSubdomain)),
); err != nil {
return fmt.Errorf("failed to generate json patch: %w", err)
}
return nil
}

554
cli/cmd/config/example.go Normal file
View File

@@ -0,0 +1,554 @@
package config
import (
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/be/services/mimir/schema"
"github.com/nhost/nhost/cli/clienv"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
func CommandExample() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "example",
Aliases: []string{},
Usage: "Shows an example config file",
Action: commandExample,
Flags: []cli.Flag{},
}
}
func ptr[T any](v T) *T { return &v }
func commandExample(cCtx *cli.Context) error { //nolint:funlen,maintidx
ce := clienv.FromCLI(cCtx)
//nolint:mnd
cfg := model.ConfigConfig{
Global: &model.ConfigGlobal{
Environment: []*model.ConfigGlobalEnvironmentVariable{
{
Name: "NAME",
Value: "value",
},
},
},
Ai: &model.ConfigAI{
Version: ptr("0.3.0"),
Resources: &model.ConfigAIResources{
Compute: &model.ConfigComputeResources{
Cpu: 256,
Memory: 512,
},
},
Openai: &model.ConfigAIOpenai{
Organization: ptr("org-id"),
ApiKey: "opeanai-api-key",
},
AutoEmbeddings: &model.ConfigAIAutoEmbeddings{
SynchPeriodMinutes: ptr(uint32(10)),
},
WebhookSecret: "this-is-a-webhook-secret",
},
Graphql: &model.ConfigGraphql{
Security: &model.ConfigGraphqlSecurity{
ForbidAminSecret: ptr(true),
MaxDepthQueries: ptr(uint(4)),
},
},
Hasura: &model.ConfigHasura{
Version: new(string),
JwtSecrets: []*model.ConfigJWTSecret{
{
Type: ptr("HS256"),
Key: ptr("secret"),
},
},
AdminSecret: "adminsecret",
WebhookSecret: "webhooksecret",
Settings: &model.ConfigHasuraSettings{
CorsDomain: []string{"*"},
DevMode: ptr(false),
EnableAllowList: ptr(true),
EnableConsole: ptr(true),
EnableRemoteSchemaPermissions: ptr(true),
EnabledAPIs: []string{
"metadata",
},
InferFunctionPermissions: ptr(true),
LiveQueriesMultiplexedRefetchInterval: ptr(uint32(1000)),
StringifyNumericTypes: ptr(false),
},
AuthHook: &model.ConfigHasuraAuthHook{
Url: "https://customauth.example.com/hook",
Mode: ptr("POST"),
SendRequestBody: ptr(true),
},
Logs: &model.ConfigHasuraLogs{
Level: ptr("warn"),
},
Events: &model.ConfigHasuraEvents{
HttpPoolSize: ptr(uint32(10)),
},
Resources: &model.ConfigResources{
Compute: &model.ConfigResourcesCompute{
Cpu: 500,
Memory: 1024,
},
Replicas: ptr(uint8(1)),
Networking: &model.ConfigNetworking{
Ingresses: []*model.ConfigIngress{
{
Fqdn: []string{"hasura.example.com"},
Tls: &model.ConfigIngressTls{
ClientCA: ptr(
"---BEGIN CERTIFICATE---\n...\n---END CERTIFICATE---",
),
},
},
},
},
Autoscaler: nil,
},
RateLimit: &model.ConfigRateLimit{
Limit: 100,
Interval: "15m",
},
},
Functions: &model.ConfigFunctions{
Node: &model.ConfigFunctionsNode{
Version: ptr(int(22)),
},
Resources: &model.ConfigFunctionsResources{
Networking: &model.ConfigNetworking{
Ingresses: []*model.ConfigIngress{
{
Fqdn: []string{"hasura.example.com"},
Tls: &model.ConfigIngressTls{
ClientCA: ptr(
"---BEGIN CERTIFICATE---\n...\n---END CERTIFICATE---",
),
},
},
},
},
},
RateLimit: &model.ConfigRateLimit{
Limit: 100,
Interval: "15m",
},
},
Auth: &model.ConfigAuth{
Version: ptr("0.25.0"),
Misc: &model.ConfigAuthMisc{
ConcealErrors: ptr(false),
},
ElevatedPrivileges: &model.ConfigAuthElevatedPrivileges{
Mode: ptr("required"),
},
Resources: &model.ConfigResources{
Compute: &model.ConfigResourcesCompute{
Cpu: 250,
Memory: 512,
},
Replicas: ptr(uint8(1)),
Networking: &model.ConfigNetworking{
Ingresses: []*model.ConfigIngress{
{
Fqdn: []string{"auth.example.com"},
Tls: &model.ConfigIngressTls{
ClientCA: ptr(
"---BEGIN CERTIFICATE---\n...\n---END CERTIFICATE---",
),
},
},
},
},
Autoscaler: nil,
},
Redirections: &model.ConfigAuthRedirections{
ClientUrl: ptr("https://example.com"),
AllowedUrls: []string{
"https://example.com",
},
},
SignUp: &model.ConfigAuthSignUp{
Enabled: ptr(true),
DisableNewUsers: ptr(false),
Turnstile: &model.ConfigAuthSignUpTurnstile{
SecretKey: "turnstileSecretKey",
},
},
User: &model.ConfigAuthUser{
Roles: &model.ConfigAuthUserRoles{
Default: ptr("user"),
Allowed: []string{"user", "me"},
},
Locale: &model.ConfigAuthUserLocale{
Default: ptr("en"),
Allowed: []string{"en"},
},
Gravatar: &model.ConfigAuthUserGravatar{
Enabled: ptr(true),
Default: ptr("identicon"),
Rating: ptr("g"),
},
Email: &model.ConfigAuthUserEmail{
Allowed: []string{"asd@example.org"},
Blocked: []string{"asd@example.com"},
},
EmailDomains: &model.ConfigAuthUserEmailDomains{
Allowed: []string{"example.com"},
Blocked: []string{"example.org"},
},
},
Session: &model.ConfigAuthSession{
AccessToken: &model.ConfigAuthSessionAccessToken{
ExpiresIn: ptr(uint32(3600)),
CustomClaims: []*model.ConfigAuthsessionaccessTokenCustomClaims{
{
Key: "key",
Value: "value",
Default: ptr("default-value"),
},
},
},
RefreshToken: &model.ConfigAuthSessionRefreshToken{
ExpiresIn: ptr(uint32(3600)),
},
},
Method: &model.ConfigAuthMethod{
Anonymous: &model.ConfigAuthMethodAnonymous{
Enabled: ptr(false),
},
Otp: &model.ConfigAuthMethodOtp{
Email: &model.ConfigAuthMethodOtpEmail{
Enabled: ptr(true),
},
},
EmailPasswordless: &model.ConfigAuthMethodEmailPasswordless{
Enabled: ptr(true),
},
EmailPassword: &model.ConfigAuthMethodEmailPassword{
HibpEnabled: ptr(true),
EmailVerificationRequired: ptr(true),
PasswordMinLength: ptr(uint8(12)),
},
SmsPasswordless: &model.ConfigAuthMethodSmsPasswordless{
Enabled: ptr(true),
},
Oauth: &model.ConfigAuthMethodOauth{
Apple: &model.ConfigAuthMethodOauthApple{
Enabled: ptr(true),
ClientId: ptr("clientid"),
KeyId: ptr("keyid"),
TeamId: ptr("teamid"),
Scope: []string{"scope"},
PrivateKey: ptr("privatekey"),
Audience: ptr("audience"),
},
Azuread: &model.ConfigAuthMethodOauthAzuread{
Tenant: ptr("tenant"),
Enabled: ptr(true),
ClientId: ptr("clientid"),
ClientSecret: ptr("clientsecret"),
},
Bitbucket: &model.ConfigStandardOauthProvider{
Enabled: ptr(true),
ClientId: ptr("clientid"),
ClientSecret: ptr("clientsecret"),
},
Discord: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Entraid: &model.ConfigAuthMethodOauthEntraid{
ClientId: ptr("entraidClientId"),
ClientSecret: ptr("entraidClientSecret"),
Enabled: ptr(true),
Tenant: ptr("entraidTenant"),
},
Facebook: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Github: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Gitlab: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Google: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Linkedin: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Spotify: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Strava: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Twitch: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Twitter: &model.ConfigAuthMethodOauthTwitter{
Enabled: ptr(true),
ConsumerKey: ptr("consumerkey"),
ConsumerSecret: ptr("consumersecret"),
},
Windowslive: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(true),
ClientId: ptr("clientid"),
Scope: []string{"scope"},
ClientSecret: ptr("clientsecret"),
Audience: ptr("audience"),
},
Workos: &model.ConfigAuthMethodOauthWorkos{
Connection: ptr("connection"),
Enabled: ptr(true),
ClientId: ptr("clientid"),
Organization: ptr("organization"),
ClientSecret: ptr("clientsecret"),
},
},
Webauthn: &model.ConfigAuthMethodWebauthn{
Enabled: ptr(true),
RelyingParty: &model.ConfigAuthMethodWebauthnRelyingParty{
Id: ptr("example.com"),
Name: ptr("name"),
Origins: []string{
"https://example.com",
},
},
Attestation: &model.ConfigAuthMethodWebauthnAttestation{
Timeout: ptr(uint32(60000)),
},
},
},
Totp: &model.ConfigAuthTotp{
Enabled: ptr(true),
Issuer: ptr("issuer"),
},
RateLimit: &model.ConfigAuthRateLimit{
Emails: &model.ConfigRateLimit{
Limit: 10,
Interval: "5m",
},
Sms: &model.ConfigRateLimit{
Limit: 10,
Interval: "5m",
},
BruteForce: &model.ConfigRateLimit{
Limit: 10,
Interval: "5m",
},
Signups: &model.ConfigRateLimit{
Limit: 10,
Interval: "5m",
},
Global: &model.ConfigRateLimit{
Limit: 100,
Interval: "15m",
},
},
},
Postgres: &model.ConfigPostgres{
Version: ptr("14-20230312-1"),
Resources: &model.ConfigPostgresResources{
Compute: &model.ConfigResourcesCompute{
Cpu: 2000,
Memory: 4096,
},
EnablePublicAccess: ptr(true),
Storage: &model.ConfigPostgresResourcesStorage{
Capacity: 20,
},
Replicas: nil,
},
Settings: &model.ConfigPostgresSettings{
Jit: ptr("off"),
MaxConnections: ptr(int32(100)),
SharedBuffers: ptr("128MB"),
EffectiveCacheSize: ptr("4GB"),
MaintenanceWorkMem: ptr("64MB"),
CheckpointCompletionTarget: ptr(float64(0.9)),
WalBuffers: ptr("-1"),
DefaultStatisticsTarget: ptr(int32(100)),
RandomPageCost: ptr(float64(4)),
EffectiveIOConcurrency: ptr(int32(1)),
WorkMem: ptr("4MB"),
HugePages: ptr("try"),
MinWalSize: ptr("80MB"),
MaxWalSize: ptr("1GB"),
MaxWorkerProcesses: ptr(int32(8)),
MaxParallelWorkersPerGather: ptr(int32(2)),
MaxParallelWorkers: ptr(int32(8)),
MaxParallelMaintenanceWorkers: ptr(int32(2)),
WalLevel: ptr("replica"),
MaxWalSenders: ptr(int32(10)),
MaxReplicationSlots: ptr(int32(10)),
ArchiveTimeout: ptr(int32(300)),
TrackIoTiming: ptr("off"),
},
Pitr: &model.ConfigPostgresPitr{
Retention: ptr(uint8(7)),
},
},
Provider: &model.ConfigProvider{
Smtp: &model.ConfigSmtp{
User: "smtpUser",
Password: "smtpPassword",
Sender: "smtpSender",
Host: "smtpHost",
Port: 587, //nolint:mnd
Secure: true,
Method: "LOGIN",
},
Sms: &model.ConfigSms{
Provider: ptr("twilio"),
AccountSid: "twilioAccountSid",
AuthToken: "twilioAuthToken",
MessagingServiceId: "twilioMessagingServiceId",
},
},
Storage: &model.ConfigStorage{
Version: ptr("0.3.5"),
Antivirus: &model.ConfigStorageAntivirus{
Server: ptr("tcp://run-clamav:3310"),
},
Resources: &model.ConfigResources{
Compute: &model.ConfigResourcesCompute{
Cpu: 500,
Memory: 1024,
},
Networking: nil,
Replicas: ptr(uint8(1)),
Autoscaler: nil,
},
RateLimit: &model.ConfigRateLimit{
Limit: 100,
Interval: "15m",
},
},
Observability: &model.ConfigObservability{
Grafana: &model.ConfigGrafana{
AdminPassword: "grafanaAdminPassword",
Smtp: &model.ConfigGrafanaSmtp{
Host: "localhost",
Port: 25,
Sender: "admin@localhost",
User: "smtpUser",
Password: "smtpPassword",
},
Alerting: &model.ConfigGrafanaAlerting{
Enabled: ptr(true),
},
Contacts: &model.ConfigGrafanaContacts{
Emails: []string{
"engineering@acme.com",
},
Pagerduty: []*model.ConfigGrafanacontactsPagerduty{
{
IntegrationKey: "integration-key",
Severity: "critical",
Class: "infra",
Component: "backend",
Group: "group",
},
},
Discord: []*model.ConfigGrafanacontactsDiscord{
{
Url: "https://discord.com/api/webhooks/...",
AvatarUrl: "https://discord.com/api/avatar/...",
},
},
Slack: []*model.ConfigGrafanacontactsSlack{
{
Recipient: "recipient",
Token: "token",
Username: "username",
IconEmoji: "danger",
IconURL: "https://...",
MentionUsers: []string{
"user1", "user2",
},
MentionGroups: []string{
"group1", "group2",
},
MentionChannel: "channel",
Url: "https://slack.com/api/webhooks/...",
EndpointURL: "https://slack.com/api/endpoint/...",
},
},
Webhook: []*model.ConfigGrafanacontactsWebhook{
{
Url: "https://webhook.example.com",
HttpMethod: "POST",
Username: "user",
Password: "password",
AuthorizationScheme: "Bearer",
AuthorizationCredentials: "token",
MaxAlerts: 10,
},
},
},
},
},
}
b, err := toml.Marshal(cfg)
if err != nil {
return fmt.Errorf("failed to marshal config: %w", err)
}
sch, err := schema.New()
if err != nil {
return fmt.Errorf("failed to create schema: %w", err)
}
if err := sch.ValidateConfig(cfg); err != nil {
return fmt.Errorf("failed to validate config: %w", err)
}
ce.Println("%s", b)
return nil
}

205
cli/cmd/config/pull.go Normal file
View File

@@ -0,0 +1,205 @@
package config
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/nhostclient/graphql"
"github.com/nhost/nhost/cli/project/env"
"github.com/nhost/nhost/cli/system"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
const (
DefaultHasuraGraphqlAdminSecret = "nhost-admin-secret" //nolint:gosec
DefaultGraphqlJWTSecret = "0f987876650b4a085e64594fae9219e7781b17506bec02489ad061fba8cb22db"
DefaultNhostWebhookSecret = "nhost-webhook-secret" //nolint:gosec
)
const (
flagYes = "yes"
)
func CommandPull() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "pull",
Aliases: []string{},
Usage: "Get cloud configuration",
Action: commandPull,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagSubdomain,
Usage: "Pull this subdomain's configuration. Defaults to linked project",
EnvVars: []string{"NHOST_SUBDOMAIN"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagYes,
Usage: "Skip confirmation",
EnvVars: []string{"NHOST_YES"},
},
},
}
}
func commandPull(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
skipConfirmation := cCtx.Bool(flagYes)
if !skipConfirmation {
if err := verifyFile(ce, ce.Path.NhostToml()); err != nil {
return err
}
}
writeSecrets := true
if !skipConfirmation {
if err := verifyFile(ce, ce.Path.Secrets()); err != nil {
writeSecrets = false
}
}
proj, err := ce.GetAppInfo(cCtx.Context, cCtx.String(flagSubdomain))
if err != nil {
return fmt.Errorf("failed to get app info: %w", err)
}
_, err = Pull(cCtx.Context, ce, proj, writeSecrets)
return err
}
func verifyFile(ce *clienv.CliEnv, name string) error {
if clienv.PathExists(name) {
ce.PromptMessage("%s",
name+" already exists. Do you want to overwrite it? [y/N] ",
)
resp, err := ce.PromptInput(false)
if err != nil {
return fmt.Errorf("failed to read input: %w", err)
}
if resp != "y" && resp != "Y" {
return errors.New("aborting") //nolint:err113
}
}
return nil
}
func respToSecrets(env []*graphql.GetSecrets_AppSecrets, anonymize bool) model.Secrets {
secrets := make(model.Secrets, len(env))
for i, s := range env {
if anonymize {
switch s.Name {
case "HASURA_GRAPHQL_ADMIN_SECRET":
s.Value = DefaultHasuraGraphqlAdminSecret
case "HASURA_GRAPHQL_JWT_SECRET":
s.Value = DefaultGraphqlJWTSecret
case "NHOST_WEBHOOK_SECRET":
s.Value = DefaultNhostWebhookSecret
default:
s.Value = "FIXME"
}
}
secrets[i] = &model.ConfigEnvironmentVariable{
Name: s.Name,
Value: s.Value,
}
}
return secrets
}
func pullSecrets(
ctx context.Context,
ce *clienv.CliEnv,
proj *graphql.AppSummaryFragment,
) error {
ce.Infoln("Getting secrets list from Nhost...")
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
resp, err := cl.GetSecrets(
ctx,
proj.ID,
)
if err != nil {
return fmt.Errorf("failed to get secrets: %w", err)
}
secrets := respToSecrets(resp.GetAppSecrets(), true)
if err := clienv.MarshalFile(&secrets, ce.Path.Secrets(), env.Marshal); err != nil {
return fmt.Errorf("failed to save nhost.toml: %w", err)
}
ce.Infoln("Adding .secrets to .gitignore...")
if err := system.AddToGitignore("\n.secrets\n"); err != nil {
return fmt.Errorf("failed to add .secrets to .gitignore: %w", err)
}
return nil
}
func Pull(
ctx context.Context,
ce *clienv.CliEnv,
proj *graphql.AppSummaryFragment,
writeSecrts bool,
) (*model.ConfigConfig, error) {
ce.Infoln("Pulling config from Nhost...")
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get nhost client: %w", err)
}
cfg, err := cl.GetConfigRawJSON(
ctx,
proj.ID,
)
if err != nil {
return nil, fmt.Errorf("failed to get config: %w", err)
}
var v model.ConfigConfig
if err := json.Unmarshal([]byte(cfg.ConfigRawJSON), &v); err != nil {
return nil, fmt.Errorf("failed to unmarshal config: %w", err)
}
if err := os.MkdirAll(ce.Path.NhostFolder(), 0o755); err != nil { //nolint:mnd
return nil, fmt.Errorf("failed to create nhost directory: %w", err)
}
if err := clienv.MarshalFile(v, ce.Path.NhostToml(), toml.Marshal); err != nil {
return nil, fmt.Errorf("failed to save nhost.toml: %w", err)
}
if writeSecrts {
if err := pullSecrets(ctx, ce, proj); err != nil {
return nil, err
}
}
ce.Infoln("Success!")
ce.Warnln(
"- Review `nhost/nhost.toml` and make sure there are no secrets before you commit it to git.",
)
ce.Warnln("- Review `.secrets` file and set your development secrets")
ce.Warnln("- Review `.secrets` was added to .gitignore")
return &v, nil
}

54
cli/cmd/config/show.go Normal file
View File

@@ -0,0 +1,54 @@
package config
import (
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/project/env"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
func CommandShow() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "show",
Aliases: []string{},
Usage: "Shows configuration after resolving secrets",
Description: "Note that this command will always use the local secrets, even if you specify subdomain",
Action: commandShow,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagSubdomain,
Usage: "Show this subdomain's rendered configuration. Defaults to base configuration",
EnvVars: []string{"NHOST_SUBDOMAIN"},
},
},
}
}
func commandShow(c *cli.Context) error {
ce := clienv.FromCLI(c)
var secrets model.Secrets
if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
return fmt.Errorf(
"failed to parse secrets, make sure secret values are between quotes: %w",
err,
)
}
cfg, err := Validate(ce, c.String(flagSubdomain), secrets)
if err != nil {
return err
}
b, err := toml.Marshal(cfg)
if err != nil {
return fmt.Errorf("error marshalling config: %w", err)
}
ce.Println("%s", b)
return nil
}

View File

@@ -0,0 +1,8 @@
HASURA_GRAPHQL_ADMIN_SECRET='nhost-admin-secret'
HASURA_GRAPHQL_JWT_SECRET='0f987876650b4a085e64594fae9219e7781b17506bec02489ad061fba8cb22db'
NHOST_WEBHOOK_SECRET='nhost-webhook-secret'
GRAFANA_ADMIN_PASSWORD='grafana-admin-password'
APPLE_CLIENT_ID='clientID'
APPLE_KEY_ID='keyID'
APPLE_TEAM_ID='teamID'
APPLE_PRIVATE_KEY='privateKey'

View File

@@ -0,0 +1,155 @@
[global]
[[global.environment]]
name = 'ENVIRONMENT'
value = 'production'
[hasura]
version = 'v2.24.1-ce'
adminSecret = '{{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}'
webhookSecret = '{{ secrets.NHOST_WEBHOOK_SECRET }}'
[[hasura.jwtSecrets]]
type = 'HS256'
key = '{{ secrets.HASURA_GRAPHQL_JWT_SECRET }}'
[hasura.settings]
corsDomain = ['*']
devMode = true
enableAllowList = false
enableConsole = true
enableRemoteSchemaPermissions = false
enabledAPIs = ['metadata', 'graphql', 'pgdump', 'config']
[hasura.logs]
level = 'warn'
[hasura.events]
httpPoolSize = 100
[functions]
[functions.node]
version = 22
[auth]
version = '0.20.0'
[auth.redirections]
clientUrl = 'https://my.app.com'
[auth.signUp]
enabled = true
[auth.user]
[auth.user.roles]
default = 'user'
allowed = ['user', 'me']
[auth.user.locale]
default = 'en'
allowed = ['en']
[auth.user.gravatar]
enabled = true
default = 'blank'
rating = 'g'
[auth.user.email]
[auth.user.emailDomains]
[auth.session]
[auth.session.accessToken]
expiresIn = 900
[auth.session.refreshToken]
expiresIn = 2592000
[auth.method]
[auth.method.anonymous]
enabled = false
[auth.method.emailPasswordless]
enabled = false
[auth.method.emailPassword]
hibpEnabled = false
emailVerificationRequired = true
passwordMinLength = 9
[auth.method.smsPasswordless]
enabled = false
[auth.method.oauth]
[auth.method.oauth.apple]
enabled = true
clientId = '{{ secrets.APPLE_CLIENT_ID }}'
keyId = '{{ secrets.APPLE_KEY_ID }}'
teamId = '{{ secrets.APPLE_TEAM_ID }}'
privateKey = '{{ secrets.APPLE_PRIVATE_KEY }}'
[auth.method.oauth.azuread]
tenant = 'common'
enabled = false
[auth.method.oauth.bitbucket]
enabled = false
[auth.method.oauth.discord]
enabled = false
[auth.method.oauth.facebook]
enabled = false
[auth.method.oauth.github]
enabled = false
[auth.method.oauth.gitlab]
enabled = false
[auth.method.oauth.google]
enabled = false
[auth.method.oauth.linkedin]
enabled = false
[auth.method.oauth.spotify]
enabled = false
[auth.method.oauth.strava]
enabled = false
[auth.method.oauth.twitch]
enabled = false
[auth.method.oauth.twitter]
enabled = false
[auth.method.oauth.windowslive]
enabled = false
[auth.method.oauth.workos]
enabled = false
[auth.method.webauthn]
enabled = false
[auth.method.webauthn.attestation]
timeout = 60000
[auth.totp]
enabled = false
[postgres]
version = '14.6-20230406-2'
[postgres.resources.storage]
capacity = 1
[provider]
[storage]
version = '0.3.4'
[observability]
[observability.grafana]
adminPassword = '{{ secrets.GRAFANA_ADMIN_PASSWORD }}'

View File

@@ -0,0 +1,32 @@
[
{
"op": "replace",
"path": "/hasura/version",
"value": "v2.25.0-ce"
},
{
"op": "replace",
"path": "/global/environment/0",
"value": {
"name": "ENVIRONMENT",
"value": "development"
}
},
{
"op": "add",
"path": "/global/environment/-",
"value": {
"name": "FUNCTION_LOG_LEVEL",
"value": "debug"
}
},
{
"op": "replace",
"path": "/auth/redirections/clientUrl",
"value": "http://localhost:3000"
},
{
"op": "remove",
"path": "/auth/method/oauth/apple"
}
]

200
cli/cmd/config/validate.go Normal file
View File

@@ -0,0 +1,200 @@
package config
import (
"context"
"encoding/json"
"fmt"
"io"
"os"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/be/services/mimir/schema"
"github.com/nhost/be/services/mimir/schema/appconfig"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/project/env"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
jsonpatch "gopkg.in/evanphx/json-patch.v5"
)
func CommandValidate() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "validate",
Aliases: []string{},
Usage: "Validate configuration",
Action: commandValidate,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagSubdomain,
Usage: "Validate this subdomain's configuration. Defaults to linked project",
EnvVars: []string{"NHOST_SUBDOMAIN"},
},
},
}
}
func commandValidate(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
subdomain := cCtx.String(flagSubdomain)
if subdomain != "" && subdomain != "local" {
proj, err := ce.GetAppInfo(cCtx.Context, cCtx.String(flagSubdomain))
if err != nil {
return fmt.Errorf("failed to get app info: %w", err)
}
_, _, err = ValidateRemote(
cCtx.Context,
ce,
proj.GetSubdomain(),
proj.GetID(),
)
return err
}
var secrets model.Secrets
if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
return fmt.Errorf(
"failed to parse secrets, make sure secret values are between quotes: %w",
err,
)
}
ce.Infoln("Verifying configuration...")
if _, err := Validate(ce, "local", secrets); err != nil {
return err
}
ce.Infoln("Configuration is valid!")
return nil
}
func ApplyJSONPatches[T any](
cfg T,
overlayPath string,
) (*T, error) {
f, err := os.Open(overlayPath)
if err != nil {
return nil, fmt.Errorf("failed to open json patches file: %w", err)
}
defer f.Close()
patchesb, err := io.ReadAll(f)
if err != nil {
return nil, fmt.Errorf("failed to read json patches file: %w", err)
}
cfgb, err := json.Marshal(cfg)
if err != nil {
return nil, fmt.Errorf("failed to marshal config: %w", err)
}
patch, err := jsonpatch.DecodePatch(patchesb)
if err != nil {
return nil, fmt.Errorf("failed to apply json patches: %w", err)
}
cfgb, err = patch.Apply(cfgb)
if err != nil {
return nil, fmt.Errorf("failed to apply json patches: %w", err)
}
var r T
if err := json.Unmarshal(cfgb, &r); err != nil {
return nil, fmt.Errorf("failed to unmarshal config: %w", err)
}
return &r, nil
}
func Validate(
ce *clienv.CliEnv,
subdomain string,
secrets model.Secrets,
) (*model.ConfigConfig, error) {
cfg := &model.ConfigConfig{} //nolint:exhaustruct
if err := clienv.UnmarshalFile(ce.Path.NhostToml(), cfg, toml.Unmarshal); err != nil {
return nil, fmt.Errorf("failed to parse config: %w", err)
}
if clienv.PathExists(ce.Path.Overlay(subdomain)) {
var err error
cfg, err = ApplyJSONPatches(*cfg, ce.Path.Overlay(subdomain))
if err != nil {
return nil, fmt.Errorf("failed to apply json patches: %w", err)
}
}
schema, err := schema.New()
if err != nil {
return nil, fmt.Errorf("failed to create schema: %w", err)
}
cfg, err = appconfig.SecretsResolver(cfg, secrets, schema.Fill)
if err != nil {
return nil, fmt.Errorf("failed to validate config: %w", err)
}
return cfg, nil
}
// ValidateRemote validates the configuration of a remote project by fetching
// the secrets and applying them to the configuration. It also applies any
// JSON patches from the overlay directory if it exists.
// It returns the original configuration with the applied patches (without being filled
// and without secrets resolved) and another configuration filled and with secrets resolved.
func ValidateRemote(
ctx context.Context,
ce *clienv.CliEnv,
subdomain string,
appID string,
) (*model.ConfigConfig, *model.ConfigConfig, error) {
cfg := &model.ConfigConfig{} //nolint:exhaustruct
if err := clienv.UnmarshalFile(ce.Path.NhostToml(), cfg, toml.Unmarshal); err != nil {
return nil, nil, fmt.Errorf("failed to parse config: %w", err)
}
if clienv.PathExists(ce.Path.Overlay(subdomain)) {
var err error
cfg, err = ApplyJSONPatches(*cfg, ce.Path.Overlay(subdomain))
if err != nil {
return nil, nil, fmt.Errorf("failed to apply json patches: %w", err)
}
}
schema, err := schema.New()
if err != nil {
return nil, nil, fmt.Errorf("failed to create schema: %w", err)
}
ce.Infoln("Getting secrets...")
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return nil, nil, fmt.Errorf("failed to get nhost client: %w", err)
}
secretsResp, err := cl.GetSecrets(
ctx,
appID,
)
if err != nil {
return nil, nil, fmt.Errorf("failed to get secrets: %w", err)
}
secrets := respToSecrets(secretsResp.GetAppSecrets(), false)
cfgSecrets, err := appconfig.SecretsResolver(cfg, secrets, schema.Fill)
if err != nil {
return nil, nil, fmt.Errorf("failed to validate config: %w", err)
}
ce.Infoln("Config is valid!")
return cfg, cfgSecrets, nil
}

View File

@@ -0,0 +1,288 @@
package config_test
import (
"os"
"path/filepath"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/cmd/config"
"github.com/nhost/nhost/cli/project/env"
)
func ptr[T any](t T) *T {
return &t
}
func expectedConfig() *model.ConfigConfig {
//nolint:exhaustruct
return &model.ConfigConfig{
Global: &model.ConfigGlobal{
Environment: []*model.ConfigGlobalEnvironmentVariable{
{Name: "ENVIRONMENT", Value: "development"},
{Name: "FUNCTION_LOG_LEVEL", Value: "debug"},
},
},
Hasura: &model.ConfigHasura{
Version: ptr("v2.25.0-ce"),
JwtSecrets: []*model.ConfigJWTSecret{
{
Type: ptr("HS256"),
Key: ptr("0f987876650b4a085e64594fae9219e7781b17506bec02489ad061fba8cb22db"),
},
},
AdminSecret: "nhost-admin-secret",
WebhookSecret: "nhost-webhook-secret",
Settings: &model.ConfigHasuraSettings{
CorsDomain: []string{"*"},
DevMode: ptr(true),
EnableAllowList: ptr(false),
EnableConsole: ptr(true),
EnableRemoteSchemaPermissions: new(bool),
EnabledAPIs: []string{
"metadata",
"graphql",
"pgdump",
"config",
},
InferFunctionPermissions: ptr(true),
LiveQueriesMultiplexedRefetchInterval: ptr(uint32(1000)),
StringifyNumericTypes: ptr(false),
},
Logs: &model.ConfigHasuraLogs{Level: ptr("warn")},
Events: &model.ConfigHasuraEvents{HttpPoolSize: ptr(uint32(100))},
},
Functions: &model.ConfigFunctions{Node: &model.ConfigFunctionsNode{Version: ptr(22)}},
Auth: &model.ConfigAuth{
Version: ptr("0.20.0"),
Misc: &model.ConfigAuthMisc{
ConcealErrors: ptr(false),
},
ElevatedPrivileges: &model.ConfigAuthElevatedPrivileges{
Mode: ptr("disabled"),
},
Redirections: &model.ConfigAuthRedirections{
ClientUrl: ptr("http://localhost:3000"),
AllowedUrls: []string{},
},
SignUp: &model.ConfigAuthSignUp{
Enabled: ptr(true),
DisableNewUsers: ptr(false),
},
User: &model.ConfigAuthUser{
Roles: &model.ConfigAuthUserRoles{
Default: ptr("user"),
Allowed: []string{"user", "me"},
},
Locale: &model.ConfigAuthUserLocale{
Default: ptr("en"),
Allowed: []string{"en"},
},
Gravatar: &model.ConfigAuthUserGravatar{
Enabled: ptr(true),
Default: ptr("blank"),
Rating: ptr("g"),
},
Email: &model.ConfigAuthUserEmail{
Allowed: []string{},
Blocked: []string{},
},
EmailDomains: &model.ConfigAuthUserEmailDomains{
Allowed: []string{},
Blocked: []string{},
},
},
Session: &model.ConfigAuthSession{
AccessToken: &model.ConfigAuthSessionAccessToken{
ExpiresIn: ptr(uint32(900)),
CustomClaims: []*model.ConfigAuthsessionaccessTokenCustomClaims{},
},
RefreshToken: &model.ConfigAuthSessionRefreshToken{
ExpiresIn: ptr(uint32(2592000)),
},
},
Method: &model.ConfigAuthMethod{
Anonymous: &model.ConfigAuthMethodAnonymous{
Enabled: ptr(false),
},
Otp: &model.ConfigAuthMethodOtp{
Email: &model.ConfigAuthMethodOtpEmail{
Enabled: ptr(false),
},
},
EmailPasswordless: &model.ConfigAuthMethodEmailPasswordless{
Enabled: ptr(false),
},
EmailPassword: &model.ConfigAuthMethodEmailPassword{
HibpEnabled: ptr(false),
EmailVerificationRequired: ptr(true),
PasswordMinLength: ptr(uint8(9)),
},
SmsPasswordless: &model.ConfigAuthMethodSmsPasswordless{
Enabled: ptr(false),
},
Oauth: &model.ConfigAuthMethodOauth{
Apple: &model.ConfigAuthMethodOauthApple{
Enabled: ptr(false),
},
Azuread: &model.ConfigAuthMethodOauthAzuread{
Enabled: ptr(false),
Tenant: ptr("common"),
},
Bitbucket: &model.ConfigStandardOauthProvider{
Enabled: ptr(false),
},
Discord: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Entraid: &model.ConfigAuthMethodOauthEntraid{
Enabled: ptr(false),
Tenant: ptr("common"),
},
Facebook: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Github: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Gitlab: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Google: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Linkedin: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Spotify: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Strava: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Twitch: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Twitter: &model.ConfigAuthMethodOauthTwitter{
Enabled: ptr(false),
},
Windowslive: &model.ConfigStandardOauthProviderWithScope{
Enabled: ptr(false),
},
Workos: &model.ConfigAuthMethodOauthWorkos{
Enabled: ptr(false),
},
},
Webauthn: &model.ConfigAuthMethodWebauthn{
Enabled: ptr(false),
RelyingParty: nil,
Attestation: &model.ConfigAuthMethodWebauthnAttestation{
Timeout: ptr(uint32(60000)),
},
},
},
Totp: &model.ConfigAuthTotp{Enabled: ptr(false)},
RateLimit: &model.ConfigAuthRateLimit{
Emails: &model.ConfigRateLimit{
Limit: 10,
Interval: "1h",
},
Sms: &model.ConfigRateLimit{
Limit: 10,
Interval: "1h",
},
BruteForce: &model.ConfigRateLimit{
Limit: 10,
Interval: "5m",
},
Signups: &model.ConfigRateLimit{
Limit: 10,
Interval: "5m",
},
Global: &model.ConfigRateLimit{
Limit: 100,
Interval: "1m",
},
},
},
Postgres: &model.ConfigPostgres{
Version: ptr("14.6-20230406-2"),
Resources: &model.ConfigPostgresResources{
Storage: &model.ConfigPostgresResourcesStorage{
Capacity: 1,
},
},
},
Provider: &model.ConfigProvider{},
Storage: &model.ConfigStorage{Version: ptr("0.3.4")},
Observability: &model.ConfigObservability{
Grafana: &model.ConfigGrafana{
AdminPassword: "grafana-admin-password",
Smtp: nil,
Alerting: &model.ConfigGrafanaAlerting{
Enabled: ptr(false),
},
Contacts: &model.ConfigGrafanaContacts{},
},
},
}
}
func TestValidate(t *testing.T) {
t.Parallel()
cases := []struct {
name string
path string
expected func() *model.ConfigConfig
applyPatches bool
}{
{
name: "applypatches",
path: "success",
expected: expectedConfig,
applyPatches: true,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
ce := clienv.New(
os.Stdout,
os.Stderr,
clienv.NewPathStructure(
".",
filepath.Join("testdata", "validate", tc.path),
filepath.Join("testdata", "validate", tc.path, ".nhost"),
filepath.Join("testdata", "validate", tc.path, "nhost"),
),
"fakeauthurl",
"fakegraphqlurl",
"fakebranch",
"",
"local",
)
var secrets model.Secrets
if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
t.Fatalf(
"failed to parse secrets, make sure secret values are between quotes: %s",
err,
)
}
cfg, err := config.Validate(ce, "local", secrets)
if err != nil {
t.Fatal(err)
}
if diff := cmp.Diff(tc.expected(), cfg); diff != "" {
t.Errorf("%s", diff)
}
})
}
}

View File

@@ -0,0 +1,145 @@
package configserver
import (
"context"
"fmt"
"github.com/99designs/gqlgen/graphql"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"github.com/nhost/be/services/mimir/graph"
cors "github.com/rs/cors/wrapper/gin"
"github.com/urfave/cli/v2"
)
const (
bindFlag = "bind"
debugFlag = "debug"
logFormatJSONFlag = "log-format-json"
enablePlaygroundFlag = "enable-playground"
storageLocalConfigPath = "storage-local-config-path"
storageLocalSecretsPath = "storage-local-secrets-path"
storageLocalRunServicesPath = "storage-local-run-services-path"
)
func Command() *cli.Command {
return &cli.Command{ //nolint: exhaustruct
Name: "configserver",
Usage: "serve the application",
Hidden: true,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint: exhaustruct
Name: bindFlag,
Usage: "bind address",
Value: ":8088",
Category: "server",
},
&cli.BoolFlag{ //nolint: exhaustruct
Name: debugFlag,
Usage: "enable debug logging",
Category: "general",
},
&cli.BoolFlag{ //nolint: exhaustruct
Name: logFormatJSONFlag,
Usage: "format logs in JSON",
Category: "general",
},
&cli.BoolFlag{ //nolint: exhaustruct
Name: enablePlaygroundFlag,
Usage: "enable graphql playground (under /v1)",
Category: "server",
EnvVars: []string{"ENABLE_PLAYGROUND"},
},
&cli.StringFlag{ //nolint: exhaustruct
Name: storageLocalConfigPath,
Usage: "Path to the local mimir config file",
Value: "/tmp/root/nhost/nhost.toml",
Category: "plugins",
EnvVars: []string{"STORAGE_LOCAL_CONFIG_PATH"},
},
&cli.StringFlag{ //nolint: exhaustruct
Name: storageLocalSecretsPath,
Usage: "Path to the local mimir secrets file",
Value: "/tmp/root/.secrets",
Category: "plugins",
EnvVars: []string{"STORAGE_LOCAL_SECRETS_PATH"},
},
&cli.StringSliceFlag{ //nolint: exhaustruct
Name: storageLocalRunServicesPath,
Usage: "Path to the local mimir run services files",
Category: "plugins",
EnvVars: []string{"STORAGE_LOCAL_RUN_SERVICES_PATH"},
},
},
Action: serve,
}
}
func dummyMiddleware(
ctx context.Context,
_ any,
next graphql.Resolver,
) (any, error) {
return next(ctx)
}
func dummyMiddleware2(
ctx context.Context,
_ any,
next graphql.Resolver,
_ []string,
) (any, error) {
return next(ctx)
}
func runServicesFiles(runServices ...string) map[string]string {
m := make(map[string]string)
for _, path := range runServices {
id := uuid.NewString()
m[id] = path
}
return m
}
func serve(cCtx *cli.Context) error {
logger := getLogger(cCtx.Bool(debugFlag), cCtx.Bool(logFormatJSONFlag))
logger.Info(cCtx.App.Name + " v" + cCtx.App.Version)
logFlags(logger, cCtx)
configFile := cCtx.String(storageLocalConfigPath)
secretsFile := cCtx.String(storageLocalSecretsPath)
runServices := runServicesFiles(cCtx.StringSlice(storageLocalRunServicesPath)...)
st := NewLocal(configFile, secretsFile, runServices)
data, err := st.GetApps(configFile, secretsFile, runServices)
if err != nil {
return fmt.Errorf("failed to get data from plugin: %w", err)
}
plugins := []graph.Plugin{st}
resolver, err := graph.NewResolver(data, Querier{}, plugins)
if err != nil {
return fmt.Errorf("failed to create resolver: %w", err)
}
r := graph.SetupRouter(
"/v1/configserver",
resolver,
dummyMiddleware,
dummyMiddleware2,
cCtx.Bool(enablePlaygroundFlag),
cCtx.App.Version,
[]graphql.FieldMiddleware{},
gin.Recovery(),
cors.Default(),
)
if err := r.Run(cCtx.String(bindFlag)); err != nil {
return fmt.Errorf("failed to run gin: %w", err)
}
return nil
}

View File

@@ -0,0 +1,220 @@
package configserver
import (
"context"
"encoding/json"
"errors"
"fmt"
"os"
"strings"
"github.com/nhost/be/services/mimir/graph"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/project/env"
"github.com/pelletier/go-toml/v2"
"github.com/sirupsen/logrus"
)
const zeroUUID = "00000000-0000-0000-0000-000000000000"
var ErrNotImpl = errors.New("not implemented")
type Local struct {
// we use paths instead of readers/writers because the intention is that these
// files will be mounted as volumes in a container and if the file is changed
// outside of the container, the filedescriptor might just be pointing to the
// old file.
config string
secrets string
runServices map[string]string
}
func NewLocal(config, secrets string, runServices map[string]string) *Local {
return &Local{
config: config,
secrets: secrets,
runServices: runServices,
}
}
func unmarshal[T any](config any) (*T, error) {
b, err := json.Marshal(config)
if err != nil {
return nil, fmt.Errorf("problem marshaling cue value: %w", err)
}
var cfg T
if err := json.Unmarshal(b, &cfg); err != nil {
return nil, fmt.Errorf("problem unmarshaling cue value: %w", err)
}
return &cfg, nil
}
func (l *Local) GetServices(runServices map[string]string) (graph.Services, error) {
services := make(graph.Services, 0, len(runServices))
for id, r := range runServices {
b, err := os.ReadFile(r)
if err != nil {
return nil, fmt.Errorf("failed to read run service file: %w", err)
}
var cfg model.ConfigRunServiceConfig
if err := toml.Unmarshal(b, &cfg); err != nil {
return nil, fmt.Errorf("failed to unmarshal run service config: %w", err)
}
services = append(services, &graph.Service{
ServiceID: id,
Config: &cfg,
})
}
return services, nil
}
func (l *Local) GetApps(
configFile, secretsFile string, runServicesFiles map[string]string,
) ([]*graph.App, error) {
b, err := os.ReadFile(configFile)
if err != nil {
return nil, fmt.Errorf("failed to read config file: %w", err)
}
var rawCfg any
if err := toml.Unmarshal(b, &rawCfg); err != nil {
return nil, fmt.Errorf("failed to unmarshal config: %w", err)
}
cfg, err := unmarshal[model.ConfigConfig](rawCfg)
if err != nil {
return nil, fmt.Errorf("failed to fill config: %w", err)
}
b, err = os.ReadFile(secretsFile)
if err != nil {
return nil, fmt.Errorf("failed to read secrets file: %w", err)
}
var secrets model.Secrets
if err := env.Unmarshal(b, &secrets); err != nil {
return nil, fmt.Errorf(
"failed to parse secrets, make sure secret values are between quotes: %w",
err,
)
}
services, err := l.GetServices(runServicesFiles)
if err != nil {
return nil, fmt.Errorf("failed to get services: %w", err)
}
pgMajorVersion := "14"
if cfg.GetPostgres().GetVersion() != nil {
pgMajorVersion = strings.Split(*cfg.GetPostgres().GetVersion(), ".")[0]
}
return []*graph.App{
{
Config: cfg,
SystemConfig: &model.ConfigSystemConfig{ //nolint:exhaustruct
Postgres: &model.ConfigSystemConfigPostgres{ //nolint:exhaustruct
MajorVersion: &pgMajorVersion,
Database: "local",
ConnectionString: &model.ConfigSystemConfigPostgresConnectionString{
Backup: "a",
Hasura: "a",
Auth: "a",
Storage: "a",
},
},
},
Secrets: secrets,
Services: services,
AppID: zeroUUID,
},
}, nil
}
func (l *Local) CreateApp(_ context.Context, _ *graph.App, _ logrus.FieldLogger) error {
return ErrNotImpl
}
func (l *Local) DeleteApp(_ context.Context, _ *graph.App, _ logrus.FieldLogger) error {
return ErrNotImpl
}
func (l *Local) UpdateConfig(_ context.Context, _, newApp *graph.App, _ logrus.FieldLogger) error {
b, err := toml.Marshal(newApp.Config)
if err != nil {
return fmt.Errorf("failed to marshal app config: %w", err)
}
if err := os.WriteFile(l.config, b, 0o644); err != nil { //nolint:gosec,mnd
return fmt.Errorf("failed to write config: %w", err)
}
return nil
}
func (l *Local) UpdateSystemConfig(_ context.Context, _, _ *graph.App, _ logrus.FieldLogger) error {
return ErrNotImpl
}
func (l *Local) UpdateSecrets(_ context.Context, _, newApp *graph.App, _ logrus.FieldLogger) error {
m := make(map[string]string)
for _, v := range newApp.Secrets {
m[v.Name] = v.Value
}
b, err := toml.Marshal(m)
if err != nil {
return fmt.Errorf("failed to marshal app secrets: %w", err)
}
if err := os.WriteFile(l.secrets, b, 0o644); err != nil { //nolint:gosec,mnd
return fmt.Errorf("failed to write secrets: %w", err)
}
return nil
}
func (l *Local) CreateRunServiceConfig(
_ context.Context, _ string, _ *graph.Service, _ logrus.FieldLogger,
) error {
return ErrNotImpl
}
func (l *Local) UpdateRunServiceConfig(
_ context.Context, _ string, _, newSvc *graph.Service, _ logrus.FieldLogger,
) error {
wr, ok := l.runServices[newSvc.ServiceID]
if !ok {
return fmt.Errorf("run service not found: %s", newSvc.ServiceID) //nolint:err113
}
b, err := toml.Marshal(newSvc.Config)
if err != nil {
return fmt.Errorf("failed to marshal run service config: %w", err)
}
if err := os.WriteFile(wr, b, 0o644); err != nil { //nolint:gosec,mnd
return fmt.Errorf("failed to write run service config: %w", err)
}
return nil
}
func (l *Local) DeleteRunServiceConfig(
_ context.Context, _ string, _ *graph.Service, _ logrus.FieldLogger,
) error {
return ErrNotImpl
}
func (l *Local) ChangeDatabaseVersion(
_ context.Context,
_, _ *graph.App,
_ logrus.FieldLogger,
) error {
return ErrNotImpl
}

View File

@@ -0,0 +1,286 @@
package configserver_test
import (
"os"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/nhost/be/services/mimir/graph"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/cmd/configserver"
)
const rawConfig = `[hasura]
adminSecret = 'hasuraAdminSecret'
webhookSecret = 'webhookSecret'
[[hasura.jwtSecrets]]
type = 'HS256'
key = 'asdasdasdasd'
[observability]
[observability.grafana]
adminPassword = 'asdasd'
`
const rawSecrets = `someSecret = 'asdasd'
`
func ptr[T any](v T) *T {
return &v
}
func newApp() *graph.App {
return &graph.App{
Config: &model.ConfigConfig{
Global: nil,
Graphql: nil,
Hasura: &model.ConfigHasura{ //nolint:exhaustruct
AdminSecret: "hasuraAdminSecret",
WebhookSecret: "webhookSecret",
JwtSecrets: []*model.ConfigJWTSecret{
{
Type: ptr("HS256"),
Key: ptr("asdasdasdasd"),
},
},
},
Functions: nil,
Auth: nil,
Postgres: nil,
Provider: nil,
Storage: nil,
Ai: nil,
Observability: &model.ConfigObservability{
Grafana: &model.ConfigGrafana{
AdminPassword: "asdasd",
Smtp: nil,
Alerting: nil,
Contacts: nil,
},
},
},
SystemConfig: &model.ConfigSystemConfig{ //nolint:exhaustruct
Postgres: &model.ConfigSystemConfigPostgres{ //nolint:exhaustruct
MajorVersion: ptr("14"),
Database: "local",
ConnectionString: &model.ConfigSystemConfigPostgresConnectionString{
Backup: "a",
Hasura: "a",
Auth: "a",
Storage: "a",
},
},
},
Secrets: []*model.ConfigEnvironmentVariable{
{
Name: "someSecret",
Value: "asdasd",
},
},
Services: graph.Services{},
AppID: "00000000-0000-0000-0000-000000000000",
}
}
func TestLocalGetApps(t *testing.T) {
t.Parallel()
cases := []struct {
name string
configRaw string
secretsRaw string
expected []*graph.App
}{
{
name: "works",
configRaw: rawConfig,
secretsRaw: rawSecrets,
expected: []*graph.App{newApp()},
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
configF, err := os.CreateTemp(t.TempDir(), "TestLocalGetApps")
if err != nil {
t.Fatalf("failed to create temp file: %v", err)
}
defer os.Remove(configF.Name())
if _, err := configF.WriteString(tc.configRaw); err != nil {
t.Fatalf("failed to write to temp file: %v", err)
}
secretsF, err := os.CreateTemp(t.TempDir(), "TestLocalGetApps")
if err != nil {
t.Fatalf("failed to create temp file: %v", err)
}
defer os.Remove(secretsF.Name())
if _, err := secretsF.WriteString(tc.secretsRaw); err != nil {
t.Fatalf("failed to write to temp file: %v", err)
}
st := configserver.NewLocal(
configF.Name(),
secretsF.Name(),
nil,
)
got, err := st.GetApps(configF.Name(), secretsF.Name(), nil)
if err != nil {
t.Errorf("GetApps() got error: %v", err)
}
cmpOpts := cmpopts.IgnoreUnexported(graph.App{}) //nolint:exhaustruct
if diff := cmp.Diff(tc.expected, got, cmpOpts); diff != "" {
t.Errorf("GetApps() mismatch (-want +got):\n%s", diff)
}
})
}
}
func TestLocalUpdateConfig(t *testing.T) { //nolint:dupl
t.Parallel()
cases := []struct {
name string
configRaw string
secretsRaw string
newApp *graph.App
expected string
}{
{
name: "works",
configRaw: rawConfig,
secretsRaw: rawSecrets,
newApp: newApp(),
expected: rawConfig,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
configF, err := os.CreateTemp(t.TempDir(), "TestLocalGetApps")
if err != nil {
t.Fatalf("failed to create temp file: %v", err)
}
defer os.Remove(configF.Name())
if _, err := configF.WriteString(tc.configRaw); err != nil {
t.Fatalf("failed to write to temp file: %v", err)
}
secretsF, err := os.CreateTemp(t.TempDir(), "TestLocalGetApps")
if err != nil {
t.Fatalf("failed to create temp file: %v", err)
}
defer os.Remove(secretsF.Name())
if _, err := secretsF.WriteString(tc.secretsRaw); err != nil {
t.Fatalf("failed to write to temp file: %v", err)
}
st := configserver.NewLocal(
configF.Name(),
secretsF.Name(),
nil,
)
if err := st.UpdateConfig(
t.Context(),
nil,
tc.newApp,
nil,
); err != nil {
t.Errorf("UpdateConfig() got error: %v", err)
}
b, err := os.ReadFile(configF.Name())
if err != nil {
t.Errorf("failed to read config file: %v", err)
}
if diff := cmp.Diff(tc.expected, string(b)); diff != "" {
t.Errorf("UpdateConfig() mismatch (-want +got):\n%s", diff)
}
})
}
}
func TestLocalUpdateSecrets(t *testing.T) { //nolint:dupl
t.Parallel()
cases := []struct {
name string
configRaw string
secretsRaw string
newApp *graph.App
expected string
}{
{
name: "works",
configRaw: rawConfig,
secretsRaw: rawSecrets,
newApp: newApp(),
expected: rawSecrets,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
configF, err := os.CreateTemp(t.TempDir(), "TestLocalGetApps")
if err != nil {
t.Fatalf("failed to create temp file: %v", err)
}
defer os.Remove(configF.Name())
if _, err := configF.WriteString(tc.configRaw); err != nil {
t.Fatalf("failed to write to temp file: %v", err)
}
secretsF, err := os.CreateTemp(t.TempDir(), "TestLocalGetApps")
if err != nil {
t.Fatalf("failed to create temp file: %v", err)
}
defer os.Remove(secretsF.Name())
if _, err := secretsF.WriteString(tc.secretsRaw); err != nil {
t.Fatalf("failed to write to temp file: %v", err)
}
st := configserver.NewLocal(
configF.Name(),
secretsF.Name(),
nil,
)
if err := st.UpdateSecrets(
t.Context(),
nil,
tc.newApp,
nil,
); err != nil {
t.Errorf("UpdateSecrets() got error: %v", err)
}
b, err := os.ReadFile(secretsF.Name())
if err != nil {
t.Errorf("failed to read config file: %v", err)
}
if diff := cmp.Diff(tc.expected, string(b)); diff != "" {
t.Errorf("UpdateSecrets() mismatch (-want +got):\n%s", diff)
}
})
}
}

View File

@@ -0,0 +1,54 @@
package configserver
import (
"strings"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
)
func getLogger(debug bool, formatJSON bool) *logrus.Logger {
logger := logrus.New()
if formatJSON {
logger.Formatter = &logrus.JSONFormatter{} //nolint: exhaustruct
} else {
logger.SetFormatter(&logrus.TextFormatter{ //nolint: exhaustruct
FullTimestamp: true,
})
}
if debug {
logger.SetLevel(logrus.DebugLevel)
gin.SetMode(gin.DebugMode)
} else {
logger.SetLevel(logrus.InfoLevel)
gin.SetMode(gin.ReleaseMode)
}
return logger
}
func logFlags(logger logrus.FieldLogger, cCtx *cli.Context) {
fields := logrus.Fields{}
for _, flag := range cCtx.App.Flags {
name := flag.Names()[0]
fields[name] = cCtx.Generic(name)
}
for _, flag := range cCtx.Command.Flags {
name := flag.Names()[0]
if strings.Contains(name, "pass") ||
strings.Contains(name, "token") ||
strings.Contains(name, "secret") ||
strings.Contains(name, "key") {
fields[name] = "******"
continue
}
fields[name] = cCtx.Generic(name)
}
logger.WithFields(fields).Info("started with settings")
}

View File

@@ -0,0 +1,13 @@
package configserver
import (
"context"
"github.com/google/uuid"
)
type Querier struct{}
func (q Querier) GetAppDesiredState(_ context.Context, _ uuid.UUID) (int32, error) {
return 0, nil
}

View File

@@ -0,0 +1,28 @@
package deployments
import "github.com/urfave/cli/v2"
const flagSubdomain = "subdomain"
func commonFlags() []cli.Flag {
return []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagSubdomain,
Usage: "Project's subdomain to operate on, defaults to linked project",
EnvVars: []string{"NHOST_SUBDOMAIN"},
},
}
}
func Command() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "deployments",
Aliases: []string{},
Usage: "Manage deployments",
Subcommands: []*cli.Command{
CommandList(),
CommandLogs(),
CommandNew(),
},
}
}

104
cli/cmd/deployments/list.go Normal file
View File

@@ -0,0 +1,104 @@
package deployments
import (
"fmt"
"time"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/nhostclient/graphql"
"github.com/urfave/cli/v2"
)
func CommandList() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "list",
Aliases: []string{},
Usage: "List deployments in the cloud environment",
Action: commandList,
Flags: commonFlags(),
}
}
func printDeployments(ce *clienv.CliEnv, deployments []*graphql.ListDeployments_Deployments) {
id := clienv.Column{
Header: "ID",
Rows: make([]string, 0),
}
date := clienv.Column{
Header: "Date",
Rows: make([]string, 0),
}
duration := clienv.Column{
Header: "Duration",
Rows: make([]string, 0),
}
status := clienv.Column{
Header: "Status",
Rows: make([]string, 0),
}
user := clienv.Column{
Header: "User",
Rows: make([]string, 0),
}
ref := clienv.Column{
Header: "Ref",
Rows: make([]string, 0),
}
message := clienv.Column{
Header: "Message",
Rows: make([]string, 0),
}
for _, d := range deployments {
var startedAt time.Time
if d.DeploymentStartedAt != nil && !d.DeploymentStartedAt.IsZero() {
startedAt = *d.DeploymentStartedAt
}
var (
endedAt time.Time
deplPuration time.Duration
)
if d.DeploymentEndedAt != nil && !d.DeploymentEndedAt.IsZero() {
endedAt = *d.DeploymentEndedAt
deplPuration = endedAt.Sub(startedAt)
}
id.Rows = append(id.Rows, d.ID)
date.Rows = append(date.Rows, startedAt.Format(time.RFC3339))
duration.Rows = append(duration.Rows, deplPuration.String())
status.Rows = append(status.Rows, *d.DeploymentStatus)
user.Rows = append(user.Rows, *d.CommitUserName)
ref.Rows = append(ref.Rows, d.CommitSha)
message.Rows = append(message.Rows, *d.CommitMessage)
}
ce.Println("%s", clienv.Table(id, date, duration, status, user, ref, message))
}
func commandList(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
proj, err := ce.GetAppInfo(cCtx.Context, cCtx.String(flagSubdomain))
if err != nil {
return fmt.Errorf("failed to get app info: %w", err)
}
cl, err := ce.GetNhostClient(cCtx.Context)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
deployments, err := cl.ListDeployments(
cCtx.Context,
proj.ID,
)
if err != nil {
return fmt.Errorf("failed to get deployments: %w", err)
}
printDeployments(ce, deployments.GetDeployments())
return nil
}

131
cli/cmd/deployments/logs.go Normal file
View File

@@ -0,0 +1,131 @@
package deployments
import (
"context"
"errors"
"fmt"
"time"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/nhostclient"
"github.com/urfave/cli/v2"
)
const (
flagFollow = "follow"
flagTimeout = "timeout"
)
func CommandLogs() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "logs",
Aliases: []string{},
Usage: "View deployments logs in the cloud environment",
Action: commandLogs,
ArgsUsage: "<deployment_id>",
Flags: append(
commonFlags(),
[]cli.Flag{
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagFollow,
Usage: "Specify if the logs should be streamed",
Value: false,
},
&cli.DurationFlag{ //nolint:exhaustruct
Name: flagTimeout,
Usage: "Specify the timeout for streaming logs",
Value: time.Minute * 5, //nolint:mnd
},
}...,
),
}
}
func showLogsSimple(
ctx context.Context,
ce *clienv.CliEnv,
cl *nhostclient.Client,
deploymentID string,
) error {
resp, err := cl.GetDeploymentLogs(ctx, deploymentID)
if err != nil {
return fmt.Errorf("failed to get deployments: %w", err)
}
for _, log := range resp.GetDeploymentLogs() {
ce.Println(
"%s %s",
log.GetCreatedAt().Format(time.RFC3339),
log.GetMessage(),
)
}
return nil
}
func showLogsFollow(
ctx context.Context,
ce *clienv.CliEnv,
cl *nhostclient.Client,
deploymentID string,
) (string, error) {
ticker := time.NewTicker(time.Second * 2) //nolint:mnd
printed := make(map[string]struct{})
for {
select {
case <-ctx.Done():
return "", nil
case <-ticker.C:
resp, err := cl.GetDeploymentLogs(ctx, deploymentID)
if err != nil {
return "", fmt.Errorf("failed to get deployments: %w", err)
}
for _, log := range resp.GetDeploymentLogs() {
if _, ok := printed[log.GetID()]; !ok {
ce.Println(
"%s %s",
log.GetCreatedAt().Format(time.RFC3339),
log.GetMessage(),
)
printed[log.GetID()] = struct{}{}
}
}
if resp.Deployment.DeploymentEndedAt != nil {
return *resp.Deployment.DeploymentStatus, nil
}
}
}
}
func commandLogs(cCtx *cli.Context) error {
deploymentID := cCtx.Args().First()
if deploymentID == "" {
return errors.New("deployment_id is required") //nolint:err113
}
ce := clienv.FromCLI(cCtx)
cl, err := ce.GetNhostClient(cCtx.Context)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
if cCtx.Bool(flagFollow) {
ctx, cancel := context.WithTimeout(cCtx.Context, cCtx.Duration(flagTimeout))
defer cancel()
if _, err := showLogsFollow(ctx, ce, cl, deploymentID); err != nil {
return err
}
} else {
if err := showLogsSimple(cCtx.Context, ce, cl, deploymentID); err != nil {
return err
}
}
return nil
}

118
cli/cmd/deployments/new.go Normal file
View File

@@ -0,0 +1,118 @@
package deployments
import (
"context"
"fmt"
"time"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/nhostclient/graphql"
"github.com/urfave/cli/v2"
)
const (
flagRef = "ref"
flagMessage = "message"
flagUser = "user"
flagUserAvatarURL = "user-avatar-url"
)
func CommandNew() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "new",
Aliases: []string{},
Usage: "[EXPERIMENTAL] Create a new deployment",
ArgsUsage: "<git_ref>",
Action: commandNew,
Flags: append(
commonFlags(),
[]cli.Flag{
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagFollow,
Usage: "Specify if the logs should be streamed. If set, the command will wait for the deployment to finish and stream the logs. If the deployment fails the command will return an error.", //nolint:lll
Value: false,
},
&cli.DurationFlag{ //nolint:exhaustruct
Name: flagTimeout,
Usage: "Specify the timeout for streaming logs",
Value: time.Minute * 5, //nolint:mnd
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagRef,
Usage: "Git reference",
EnvVars: []string{"GITHUB_SHA"},
Required: true,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagMessage,
Usage: "Commit message",
Required: true,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagUser,
Usage: "Commit user name",
EnvVars: []string{"GITHUB_ACTOR"},
Required: true,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagUserAvatarURL,
Usage: "Commit user avatar URL",
},
}...,
),
}
}
func ptr[i any](v i) *i {
return &v
}
func commandNew(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
cl, err := ce.GetNhostClient(cCtx.Context)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
proj, err := ce.GetAppInfo(cCtx.Context, cCtx.String(flagSubdomain))
if err != nil {
return fmt.Errorf("failed to get app info: %w", err)
}
resp, err := cl.InsertDeployment(
cCtx.Context,
graphql.DeploymentsInsertInput{
App: nil,
AppID: ptr(proj.ID),
CommitMessage: ptr(cCtx.String(flagMessage)),
CommitSha: ptr(cCtx.String(flagRef)),
CommitUserAvatarURL: ptr(cCtx.String(flagUserAvatarURL)),
CommitUserName: ptr(cCtx.String(flagUser)),
DeploymentStatus: ptr("SCHEDULED"),
},
)
if err != nil {
return fmt.Errorf("failed to insert deployment: %w", err)
}
ce.Println("Deployment created: %s", resp.InsertDeployment.ID)
if cCtx.Bool(flagFollow) {
ce.Println("")
ctx, cancel := context.WithTimeout(cCtx.Context, cCtx.Duration(flagTimeout))
defer cancel()
status, err := showLogsFollow(ctx, ce, cl, resp.InsertDeployment.ID)
if err != nil {
return fmt.Errorf("error streaming logs: %w", err)
}
if status != "DEPLOYED" {
return fmt.Errorf("deployment failed: %s", status) //nolint:err113
}
}
return nil
}

313
cli/cmd/dev/cloud.go Normal file
View File

@@ -0,0 +1,313 @@
package dev
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
"syscall"
"text/tabwriter"
"time"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/cmd/config"
"github.com/nhost/nhost/cli/cmd/software"
"github.com/nhost/nhost/cli/dockercompose"
"github.com/nhost/nhost/cli/nhostclient/graphql"
"github.com/urfave/cli/v2"
)
const (
flagSubdomain = "subdomain"
flagPostgresURL = "postgres-url"
)
func CommandCloud() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "cloud",
Aliases: []string{},
Usage: "Start local development environment connected to an Nhost Cloud project (BETA)",
Action: commandCloud,
Flags: []cli.Flag{
&cli.UintFlag{ //nolint:exhaustruct
Name: flagHTTPPort,
Usage: "HTTP port to listen on",
Value: defaultHTTPPort,
EnvVars: []string{"NHOST_HTTP_PORT"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagDisableTLS,
Usage: "Disable TLS",
Value: false,
EnvVars: []string{"NHOST_DISABLE_TLS"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagApplySeeds,
Usage: "Apply seeds. If the .nhost folder does not exist, seeds will be applied regardless of this flag",
Value: false,
EnvVars: []string{"NHOST_APPLY_SEEDS"},
},
&cli.UintFlag{ //nolint:exhaustruct
Name: flagsHasuraConsolePort,
Usage: "If specified, expose hasura console on this port. Not recommended",
Value: 0,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagDashboardVersion,
Usage: "Dashboard version to use",
Value: "nhost/dashboard:2.33.0",
EnvVars: []string{"NHOST_DASHBOARD_VERSION"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfigserverImage,
Hidden: true,
Value: "",
EnvVars: []string{"NHOST_CONFIGSERVER_IMAGE"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagDownOnError,
Usage: "Skip confirmation",
EnvVars: []string{"NHOST_YES"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagCACertificates,
Usage: "Mounts and everrides path to CA certificates in the containers",
EnvVars: []string{"NHOST_CA_CERTIFICATES"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagSubdomain,
Usage: "Project's subdomain to operate on, defaults to linked project",
EnvVars: []string{"NHOST_SUBDOMAIN"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagPostgresURL,
Usage: "Postgres URL",
Required: true,
EnvVars: []string{"NHOST_POSTGRES_URL"},
},
},
}
}
func commandCloud(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
if !clienv.PathExists(ce.Path.NhostToml()) {
return errors.New( //nolint:err113
"no nhost project found, please run `nhost init` or `nhost config pull`",
)
}
if !clienv.PathExists(ce.Path.Secrets()) {
return errors.New( //nolint:err113
"no secrets found, please run `nhost init` or `nhost config pull`",
)
}
proj, err := ce.GetAppInfo(cCtx.Context, cCtx.String(flagSubdomain))
if err != nil {
return fmt.Errorf("failed to get app info: %w", err)
}
configserverImage := cCtx.String(flagConfigserverImage)
if configserverImage == "" {
configserverImage = "nhost/cli:" + cCtx.App.Version
}
applySeeds := cCtx.Bool(flagApplySeeds)
return Cloud(
cCtx.Context,
ce,
cCtx.App.Version,
cCtx.Uint(flagHTTPPort),
!cCtx.Bool(flagDisableTLS),
applySeeds,
dockercompose.ExposePorts{
Auth: cCtx.Uint(flagAuthPort),
Storage: cCtx.Uint(flagStoragePort),
Graphql: cCtx.Uint(flagsHasuraPort),
Console: cCtx.Uint(flagsHasuraConsolePort),
Functions: cCtx.Uint(flagsFunctionsPort),
},
cCtx.String(flagDashboardVersion),
configserverImage,
cCtx.String(flagCACertificates),
cCtx.Bool(flagDownOnError),
proj,
cCtx.String(flagPostgresURL),
)
}
func cloud( //nolint:funlen
ctx context.Context,
ce *clienv.CliEnv,
appVersion string,
dc *dockercompose.DockerCompose,
httpPort uint,
useTLS bool,
applySeeds bool,
ports dockercompose.ExposePorts,
dashboardVersion string,
configserverImage string,
caCertificatesPath string,
proj *graphql.AppSummaryFragment,
postgresURL string,
) error {
ctx, cancel := context.WithCancel(ctx)
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
go func() {
<-sigChan
cancel()
}()
ce.Infoln("Validating configuration...")
cfg, cfgSecrets, err := config.ValidateRemote(
ctx,
ce,
proj.GetSubdomain(),
proj.GetID(),
)
if err != nil {
return fmt.Errorf("failed to validate configuration: %w", err)
}
ctxWithTimeout, cancel := context.WithTimeout(ctx, 5*time.Second) //nolint:mnd
defer cancel()
ce.Infoln("Checking versions...")
if err := software.CheckVersions(ctxWithTimeout, ce, cfgSecrets, appVersion); err != nil {
ce.Warnln("Problem verifying recommended versions: %s", err.Error())
}
ce.Infoln("Setting up Nhost development environment...")
composeFile, err := dockercompose.CloudComposeFileFromConfig(
cfgSecrets,
ce.LocalSubdomain(),
proj.GetSubdomain(),
proj.GetRegion().GetName(),
cfgSecrets.Hasura.GetAdminSecret(),
postgresURL,
ce.ProjectName(),
httpPort,
useTLS,
ce.Path.NhostFolder(),
ce.Path.DotNhostFolder(),
ce.Path.Root(),
ports,
dashboardVersion,
configserverImage,
caCertificatesPath,
)
if err != nil {
return fmt.Errorf("failed to generate docker-compose.yaml: %w", err)
}
if err := dc.WriteComposeFile(composeFile); err != nil {
return fmt.Errorf("failed to write docker-compose.yaml: %w", err)
}
ce.Infoln("Starting Nhost development environment...")
if err = dc.Start(ctx); err != nil {
return fmt.Errorf("failed to start Nhost development environment: %w", err)
}
ce.Infoln("Applying configuration to Nhost Cloud project...")
if err = config.Apply(ctx, ce, proj.GetID(), cfg, true); err != nil {
return fmt.Errorf("failed to apply configuration: %w", err)
}
endpoint := fmt.Sprintf(
"https://%s.hasura.%s.nhost.run",
proj.GetSubdomain(), proj.GetRegion().GetName(),
)
if err := migrations(ctx, ce, dc, endpoint, applySeeds); err != nil {
return err
}
docker := dockercompose.NewDocker()
ce.Infoln("Downloading metadata...")
if err := docker.HasuraWrapper(
ctx,
ce.LocalSubdomain(),
ce.Path.NhostFolder(),
*cfgSecrets.Hasura.Version,
"metadata", "export",
"--skip-update-check",
"--log-level", "ERROR",
"--endpoint", endpoint,
"--admin-secret", cfgSecrets.Hasura.GetAdminSecret(),
); err != nil {
return fmt.Errorf("failed to create metadata: %w", err)
}
ce.Infoln("Nhost development environment started.")
printCloudInfo(ce.LocalSubdomain(), httpPort, useTLS)
return nil
}
func printCloudInfo(
subdomain string,
httpPort uint,
useTLS bool,
) {
w := tabwriter.NewWriter(os.Stdout, 0, 0, 4, ' ', 0) //nolint:mnd
fmt.Fprintf(w, "URLs:\n")
fmt.Fprintf(w, "- Console:\t\t%s\n", dockercompose.URL(
subdomain, "hasura", httpPort, useTLS))
fmt.Fprintf(w, "- Dashboard:\t\t%s\n", dockercompose.URL(
subdomain, "dashboard", httpPort, useTLS))
w.Flush()
}
func Cloud(
ctx context.Context,
ce *clienv.CliEnv,
appVersion string,
httpPort uint,
useTLS bool,
applySeeds bool,
ports dockercompose.ExposePorts,
dashboardVersion string,
configserverImage string,
caCertificatesPath string,
downOnError bool,
proj *graphql.AppSummaryFragment,
postgresURL string,
) error {
dc := dockercompose.New(ce.Path.WorkingDir(), ce.Path.DockerCompose(), ce.ProjectName())
if err := cloud(
ctx,
ce,
appVersion,
dc,
httpPort,
useTLS,
applySeeds,
ports,
dashboardVersion,
configserverImage,
caCertificatesPath,
proj,
postgresURL,
); err != nil {
return upErr(ce, dc, downOnError, err) //nolint:contextcheck
}
return nil
}

25
cli/cmd/dev/compose.go Normal file
View File

@@ -0,0 +1,25 @@
package dev
import (
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/dockercompose"
"github.com/urfave/cli/v2"
)
func CommandCompose() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "compose",
Aliases: []string{},
Usage: "docker compose wrapper, sets project name and compose file automatically",
Action: commandCompose,
Flags: []cli.Flag{},
SkipFlagParsing: true,
}
}
func commandCompose(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
dc := dockercompose.New(ce.Path.WorkingDir(), ce.Path.DockerCompose(), ce.ProjectName())
return dc.Wrapper(cCtx.Context, cCtx.Args().Slice()...) //nolint:wrapcheck
}

15
cli/cmd/dev/dev.go Normal file
View File

@@ -0,0 +1,15 @@
package dev
import "github.com/urfave/cli/v2"
func Command() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "dev",
Aliases: []string{},
Usage: "Operate local development environment",
Subcommands: []*cli.Command{
CommandCompose(),
CommandHasura(),
},
}
}

39
cli/cmd/dev/down.go Normal file
View File

@@ -0,0 +1,39 @@
package dev
import (
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/dockercompose"
"github.com/urfave/cli/v2"
)
const (
flagVolumes = "volumes"
)
func CommandDown() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "down",
Aliases: []string{},
Usage: "Stop local development environment",
Action: commandDown,
Flags: []cli.Flag{
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagVolumes,
Usage: "Remove volumes",
Value: false,
},
},
}
}
func commandDown(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
dc := dockercompose.New(ce.Path.WorkingDir(), ce.Path.DockerCompose(), ce.ProjectName())
if err := dc.Stop(cCtx.Context, cCtx.Bool(flagVolumes)); err != nil {
ce.Warnln("failed to stop Nhost development environment: %s", err)
}
return nil
}

41
cli/cmd/dev/hasura.go Normal file
View File

@@ -0,0 +1,41 @@
package dev
import (
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/dockercompose"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
func CommandHasura() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "hasura",
Aliases: []string{},
Usage: "hasura-cli wrapper",
Action: commandHasura,
Flags: []cli.Flag{},
SkipFlagParsing: true,
}
}
func commandHasura(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
cfg := &model.ConfigConfig{} //nolint:exhaustruct
if err := clienv.UnmarshalFile(ce.Path.NhostToml(), cfg, toml.Unmarshal); err != nil {
return fmt.Errorf("failed to parse config: %w", err)
}
docker := dockercompose.NewDocker()
return docker.HasuraWrapper( //nolint:wrapcheck
cCtx.Context,
ce.LocalSubdomain(),
ce.Path.NhostFolder(),
*cfg.Hasura.Version,
cCtx.Args().Slice()...,
)
}

30
cli/cmd/dev/logs.go Normal file
View File

@@ -0,0 +1,30 @@
package dev
import (
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/dockercompose"
"github.com/urfave/cli/v2"
)
func CommandLogs() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "logs",
Aliases: []string{},
Usage: "Show logs from local development environment",
Action: commandLogs,
Flags: []cli.Flag{},
SkipFlagParsing: true,
}
}
func commandLogs(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
dc := dockercompose.New(ce.Path.WorkingDir(), ce.Path.DockerCompose(), ce.ProjectName())
if err := dc.Logs(cCtx.Context, cCtx.Args().Slice()...); err != nil {
ce.Warnln("%s", err)
}
return nil
}

579
cli/cmd/dev/up.go Normal file
View File

@@ -0,0 +1,579 @@
package dev
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
"path/filepath"
"strings"
"syscall"
"text/tabwriter"
"time"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/cmd/config"
"github.com/nhost/nhost/cli/cmd/run"
"github.com/nhost/nhost/cli/cmd/software"
"github.com/nhost/nhost/cli/dockercompose"
"github.com/nhost/nhost/cli/project/env"
"github.com/urfave/cli/v2"
)
func deptr[T any](t *T) T { //nolint:ireturn
if t == nil {
return *new(T)
}
return *t
}
const (
flagHTTPPort = "http-port"
flagDisableTLS = "disable-tls"
flagPostgresPort = "postgres-port"
flagApplySeeds = "apply-seeds"
flagAuthPort = "auth-port"
flagStoragePort = "storage-port"
flagsFunctionsPort = "functions-port"
flagsHasuraPort = "hasura-port"
flagsHasuraConsolePort = "hasura-console-port"
flagDashboardVersion = "dashboard-version"
flagConfigserverImage = "configserver-image"
flagRunService = "run-service"
flagDownOnError = "down-on-error"
flagCACertificates = "ca-certificates"
)
const (
defaultHTTPPort = 443
defaultPostgresPort = 5432
)
func CommandUp() *cli.Command { //nolint:funlen
return &cli.Command{ //nolint:exhaustruct
Name: "up",
Aliases: []string{},
Usage: "Start local development environment",
Action: commandUp,
Flags: []cli.Flag{
&cli.UintFlag{ //nolint:exhaustruct
Name: flagHTTPPort,
Usage: "HTTP port to listen on",
Value: defaultHTTPPort,
EnvVars: []string{"NHOST_HTTP_PORT"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagDisableTLS,
Usage: "Disable TLS",
Value: false,
EnvVars: []string{"NHOST_DISABLE_TLS"},
},
&cli.UintFlag{ //nolint:exhaustruct
Name: flagPostgresPort,
Usage: "Postgres port to listen on",
Value: defaultPostgresPort,
EnvVars: []string{"NHOST_POSTGRES_PORT"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagApplySeeds,
Usage: "Apply seeds. If the .nhost folder does not exist, seeds will be applied regardless of this flag",
Value: false,
EnvVars: []string{"NHOST_APPLY_SEEDS"},
},
&cli.UintFlag{ //nolint:exhaustruct
Name: flagAuthPort,
Usage: "If specified, expose auth on this port. Not recommended",
Value: 0,
},
&cli.UintFlag{ //nolint:exhaustruct
Name: flagStoragePort,
Usage: "If specified, expose storage on this port. Not recommended",
Value: 0,
},
&cli.UintFlag{ //nolint:exhaustruct
Name: flagsFunctionsPort,
Usage: "If specified, expose functions on this port. Not recommended",
Value: 0,
},
&cli.UintFlag{ //nolint:exhaustruct
Name: flagsHasuraPort,
Usage: "If specified, expose hasura on this port. Not recommended",
Value: 0,
},
&cli.UintFlag{ //nolint:exhaustruct
Name: flagsHasuraConsolePort,
Usage: "If specified, expose hasura console on this port. Not recommended",
Value: 0,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagDashboardVersion,
Usage: "Dashboard version to use",
Value: "nhost/dashboard:2.33.0",
EnvVars: []string{"NHOST_DASHBOARD_VERSION"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfigserverImage,
Hidden: true,
Value: "",
EnvVars: []string{"NHOST_CONFIGSERVER_IMAGE"},
},
&cli.StringSliceFlag{ //nolint:exhaustruct
Name: flagRunService,
Usage: "Run service to add to the development environment. Can be passed multiple times. Comma-separated values are also accepted. Format: /path/to/run-service.toml[:overlay_name]", //nolint:lll
EnvVars: []string{"NHOST_RUN_SERVICE"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagDownOnError,
Usage: "Skip confirmation",
EnvVars: []string{"NHOST_YES"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagCACertificates,
Usage: "Mounts and everrides path to CA certificates in the containers",
EnvVars: []string{"NHOST_CA_CERTIFICATES"},
},
},
Subcommands: []*cli.Command{
CommandCloud(),
},
}
}
func commandUp(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
// projname to be root directory
if !clienv.PathExists(ce.Path.NhostToml()) {
return errors.New( //nolint:err113
"no nhost project found, please run `nhost init` or `nhost config pull`",
)
}
if !clienv.PathExists(ce.Path.Secrets()) {
return errors.New( //nolint:err113
"no secrets found, please run `nhost init` or `nhost config pull`",
)
}
configserverImage := cCtx.String(flagConfigserverImage)
if configserverImage == "" {
configserverImage = "nhost/cli:" + cCtx.App.Version
}
applySeeds := cCtx.Bool(flagApplySeeds) || !clienv.PathExists(ce.Path.DotNhostFolder())
return Up(
cCtx.Context,
ce,
cCtx.App.Version,
cCtx.Uint(flagHTTPPort),
!cCtx.Bool(flagDisableTLS),
cCtx.Uint(flagPostgresPort),
applySeeds,
dockercompose.ExposePorts{
Auth: cCtx.Uint(flagAuthPort),
Storage: cCtx.Uint(flagStoragePort),
Graphql: cCtx.Uint(flagsHasuraPort),
Console: cCtx.Uint(flagsHasuraConsolePort),
Functions: cCtx.Uint(flagsFunctionsPort),
},
cCtx.String(flagDashboardVersion),
configserverImage,
cCtx.String(flagCACertificates),
cCtx.StringSlice(flagRunService),
cCtx.Bool(flagDownOnError),
)
}
func migrations(
ctx context.Context,
ce *clienv.CliEnv,
dc *dockercompose.DockerCompose,
endpoint string,
applySeeds bool,
) error {
if clienv.PathExists(filepath.Join(ce.Path.NhostFolder(), "migrations", "default")) {
ce.Infoln("Applying migrations...")
if err := dc.ApplyMigrations(ctx, endpoint); err != nil {
return fmt.Errorf("failed to apply migrations: %w", err)
}
} else {
ce.Warnln("No migrations found, make sure this is intentional or it could lead to unexpected behavior")
}
if clienv.PathExists(filepath.Join(ce.Path.NhostFolder(), "metadata", "version.yaml")) {
ce.Infoln("Applying metadata...")
if err := dc.ApplyMetadata(ctx, endpoint); err != nil {
return fmt.Errorf("failed to apply metadata: %w", err)
}
} else {
ce.Warnln("No metadata found, make sure this is intentional or it could lead to unexpected behavior")
}
if applySeeds {
if clienv.PathExists(filepath.Join(ce.Path.NhostFolder(), "seeds", "default")) {
ce.Infoln("Applying seeds...")
if err := dc.ApplySeeds(ctx, endpoint); err != nil {
return fmt.Errorf("failed to apply seeds: %w", err)
}
}
}
return nil
}
func restart(
ctx context.Context,
ce *clienv.CliEnv,
dc *dockercompose.DockerCompose,
composeFile *dockercompose.ComposeFile,
) error {
ce.Infoln("Restarting services to reapply metadata if needed...")
args := []string{"restart"}
if _, ok := composeFile.Services["storage"]; ok {
args = append(args, "storage")
}
if _, ok := composeFile.Services["auth"]; ok {
args = append(args, "auth")
}
if _, ok := composeFile.Services["ai"]; ok {
args = append(args, "ai")
}
if _, ok := composeFile.Services["functions"]; ok {
args = append(args, "functions")
}
if err := dc.Wrapper(ctx, args...); err != nil {
return fmt.Errorf("failed to restart services: %w", err)
}
ce.Infoln("Verifying services are healthy...")
// this ensures that all services are healthy before returning
if err := dc.Start(ctx); err != nil {
return fmt.Errorf("failed to wait services: %w", err)
}
return nil
}
func reload(
ctx context.Context,
ce *clienv.CliEnv,
dc *dockercompose.DockerCompose,
) error {
ce.Infoln("Reapplying metadata...")
if err := dc.ReloadMetadata(ctx); err != nil {
return fmt.Errorf("failed to reapply metadata: %w", err)
}
return nil
}
func parseRunServiceConfigFlag(value string) (string, string, error) {
parts := strings.Split(value, ":")
switch len(parts) {
case 1:
return parts[0], "", nil
case 2: //nolint:mnd
return parts[0], parts[1], nil
default:
return "", "", fmt.Errorf( //nolint:err113
"invalid run service format, must be /path/to/config.toml:overlay_name, got %s",
value,
)
}
}
func processRunServices(
ce *clienv.CliEnv,
runServices []string,
secrets model.Secrets,
) ([]*dockercompose.RunService, error) {
r := make([]*dockercompose.RunService, 0, len(runServices))
for _, runService := range runServices {
cfgPath, overlayName, err := parseRunServiceConfigFlag(runService)
if err != nil {
return nil, err
}
cfg, err := run.Validate(ce, cfgPath, overlayName, secrets, false)
if err != nil {
return nil, fmt.Errorf("failed to validate run service %s: %w", cfgPath, err)
}
r = append(r, &dockercompose.RunService{
Path: cfgPath,
Config: cfg,
})
}
return r, nil
}
func up( //nolint:funlen,cyclop
ctx context.Context,
ce *clienv.CliEnv,
appVersion string,
dc *dockercompose.DockerCompose,
httpPort uint,
useTLS bool,
postgresPort uint,
applySeeds bool,
ports dockercompose.ExposePorts,
dashboardVersion string,
configserverImage string,
caCertificatesPath string,
runServices []string,
) error {
ctx, cancel := context.WithCancel(ctx)
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM, os.Interrupt)
go func() {
<-sigChan
cancel()
}()
var secrets model.Secrets
if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
return fmt.Errorf(
"failed to parse secrets, make sure secret values are between quotes: %w",
err,
)
}
cfg, err := config.Validate(ce, "local", secrets)
if err != nil {
return fmt.Errorf("failed to validate config: %w", err)
}
ctxWithTimeout, cancel := context.WithTimeout(ctx, 5*time.Second) //nolint:mnd
defer cancel()
ce.Infoln("Checking versions...")
if err := software.CheckVersions(ctxWithTimeout, ce, cfg, appVersion); err != nil {
ce.Warnln("Problem verifying recommended versions: %s", err.Error())
}
runServicesCfg, err := processRunServices(ce, runServices, secrets)
if err != nil {
return err
}
ce.Infoln("Setting up Nhost development environment...")
composeFile, err := dockercompose.ComposeFileFromConfig(
cfg,
ce.LocalSubdomain(),
ce.ProjectName(),
httpPort,
useTLS,
postgresPort,
ce.Path.NhostFolder(),
ce.Path.DotNhostFolder(),
ce.Path.Root(),
ports,
ce.Branch(),
dashboardVersion,
configserverImage,
clienv.PathExists(ce.Path.Functions()),
caCertificatesPath,
runServicesCfg...,
)
if err != nil {
return fmt.Errorf("failed to generate docker-compose.yaml: %w", err)
}
if err := dc.WriteComposeFile(composeFile); err != nil {
return fmt.Errorf("failed to write docker-compose.yaml: %w", err)
}
ce.Infoln("Starting Nhost development environment...")
if err = dc.Start(ctx); err != nil {
return fmt.Errorf("failed to start Nhost development environment: %w", err)
}
if err := migrations(ctx, ce, dc, "http://graphql:8080", applySeeds); err != nil {
return err
}
if err := restart(ctx, ce, dc, composeFile); err != nil {
return err
}
docker := dockercompose.NewDocker()
ce.Infoln("Downloading metadata...")
if err := docker.HasuraWrapper(
ctx,
ce.LocalSubdomain(),
ce.Path.NhostFolder(),
*cfg.Hasura.Version,
"metadata", "export",
"--skip-update-check",
"--log-level", "ERROR",
"--endpoint", dockercompose.URL(ce.LocalSubdomain(), "hasura", httpPort, useTLS),
"--admin-secret", cfg.Hasura.AdminSecret,
); err != nil {
return fmt.Errorf("failed to create metadata: %w", err)
}
if err := reload(ctx, ce, dc); err != nil {
return err
}
ce.Infoln("Nhost development environment started.")
printInfo(ce.LocalSubdomain(), httpPort, postgresPort, useTLS, runServicesCfg)
return nil
}
func printInfo(
subdomain string,
httpPort, postgresPort uint,
useTLS bool,
runServices []*dockercompose.RunService,
) {
w := tabwriter.NewWriter(os.Stdout, 0, 0, 4, ' ', 0) //nolint:mnd
fmt.Fprintf(w, "URLs:\n")
fmt.Fprintf(w,
"- Postgres:\t\tpostgres://postgres:postgres@localhost:%d/local\n",
postgresPort,
)
fmt.Fprintf(w, "- Hasura:\t\t%s\n", dockercompose.URL(
subdomain, "hasura", httpPort, useTLS))
fmt.Fprintf(w, "- GraphQL:\t\t%s\n", dockercompose.URL(
subdomain, "graphql", httpPort, useTLS))
fmt.Fprintf(w, "- Auth:\t\t%s\n", dockercompose.URL(
subdomain, "auth", httpPort, useTLS))
fmt.Fprintf(w, "- Storage:\t\t%s\n", dockercompose.URL(
subdomain, "storage", httpPort, useTLS))
fmt.Fprintf(w, "- Functions:\t\t%s\n", dockercompose.URL(
subdomain, "functions", httpPort, useTLS))
fmt.Fprintf(w, "- Dashboard:\t\t%s\n", dockercompose.URL(
subdomain, "dashboard", httpPort, useTLS))
fmt.Fprintf(w, "- Mailhog:\t\t%s\n", dockercompose.URL(
subdomain, "mailhog", httpPort, useTLS))
for _, svc := range runServices {
for _, port := range svc.Config.GetPorts() {
if deptr(port.GetPublish()) {
fmt.Fprintf(
w,
"- run-%s:\t\tFrom laptop:\t%s://localhost:%d\n",
svc.Config.Name,
port.GetType(),
port.GetPort(),
)
fmt.Fprintf(
w,
"\t\tFrom services:\t%s://run-%s:%d\n",
port.GetType(),
svc.Config.Name,
port.GetPort(),
)
}
}
}
fmt.Fprintf(w, "\n")
fmt.Fprintf(w, "SDK Configuration:\n")
fmt.Fprintf(w, " Subdomain:\t%s\n", subdomain)
fmt.Fprintf(w, " Region:\tlocal\n")
fmt.Fprintf(w, "")
fmt.Fprintf(w, "Run `nhost up` to reload the development environment\n")
fmt.Fprintf(w, "Run `nhost down` to stop the development environment\n")
fmt.Fprintf(w, "Run `nhost logs` to watch the logs\n")
w.Flush()
}
func upErr(
ce *clienv.CliEnv,
dc *dockercompose.DockerCompose,
downOnError bool,
err error,
) error {
ce.Warnln("%s", err.Error())
if !downOnError {
ce.PromptMessage("Do you want to stop Nhost's development environment? [y/N] ")
resp, err := ce.PromptInput(false)
if err != nil {
ce.Warnln("failed to read input: %s", err)
return nil
}
if resp != "y" && resp != "Y" {
return nil
}
}
ce.Infoln("Stopping Nhost development environment...")
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
if err := dc.Stop(ctx, false); err != nil {
ce.Warnln("failed to stop Nhost development environment: %s", err)
}
return err
}
func Up(
ctx context.Context,
ce *clienv.CliEnv,
appVersion string,
httpPort uint,
useTLS bool,
postgresPort uint,
applySeeds bool,
ports dockercompose.ExposePorts,
dashboardVersion string,
configserverImage string,
caCertificatesPath string,
runServices []string,
downOnError bool,
) error {
dc := dockercompose.New(ce.Path.WorkingDir(), ce.Path.DockerCompose(), ce.ProjectName())
if err := up(
ctx,
ce,
appVersion,
dc,
httpPort,
useTLS,
postgresPort,
applySeeds,
ports,
dashboardVersion,
configserverImage,
caCertificatesPath,
runServices,
); err != nil {
return upErr(ce, dc, downOnError, err) //nolint:contextcheck
}
return nil
}

View File

@@ -0,0 +1,170 @@
package dockercredentials
import (
"context"
"encoding/json"
"fmt"
"os"
"os/exec"
"github.com/nhost/nhost/cli/clienv"
"github.com/urfave/cli/v2"
)
const (
flagDockerConfig = "docker-config"
flagNoInteractive = "no-interactive"
)
const (
credentialsPath = "/usr/local/bin/docker-credential-nhost-login" //nolint:gosec
credentialsHelper = "nhost-login"
)
func CommandConfigure() *cli.Command {
home, err := os.UserHomeDir()
if err != nil {
home = "/root"
}
return &cli.Command{ //nolint:exhaustruct
Name: "configure",
Aliases: []string{},
Usage: "Install credentials helper and configure docker so it can authenticate with Nhost's registry",
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagDockerConfig,
Usage: "Path to docker config file",
EnvVars: []string{"DOCKER_CONFIG"},
Value: home + "/.docker/config.json",
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagNoInteractive,
Usage: "Do not prompt for confirmation",
EnvVars: []string{"NO_INTERACTIVE"},
Value: false,
},
},
Action: actionConfigure,
}
}
const script = `#!/bin/sh
%s docker-credentials $@
`
func canSudo(ctx context.Context) bool {
if err := exec.CommandContext(ctx, "sudo", "-n", "true").Run(); err != nil {
return false
}
return true
}
func writeScript(ctx context.Context, ce *clienv.CliEnv) error {
ce.Println("Installing credentials helper for docker in %s", credentialsPath)
executable, err := os.Executable()
if err != nil {
return fmt.Errorf("could not get executable path: %w", err)
}
script := fmt.Sprintf(script, executable)
tmpfile, err := os.CreateTemp("", "nhost-docker-credentials")
if err != nil {
return fmt.Errorf("could not create temporary file: %w", err)
}
defer tmpfile.Close()
if _, err := tmpfile.WriteString(script); err != nil {
return fmt.Errorf("could not write to temporary file: %w", err)
}
if err := tmpfile.Chmod(0o755); err != nil { //nolint:mnd
return fmt.Errorf("could not chmod temporary file: %w", err)
}
if !canSudo(ctx) {
ce.Println("I need root privileges to install the file. Please, enter your password.")
}
if err := exec.CommandContext( //nolint:gosec
ctx, "sudo", "mv", tmpfile.Name(), credentialsPath,
).Run(); err != nil {
return fmt.Errorf("could not move temporary file: %w", err)
}
return nil
}
func configureDocker(dockerConfig string) error {
f, err := os.OpenFile(dockerConfig, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0o644) //nolint:mnd
if err != nil {
return fmt.Errorf("could not open docker config file: %w", err)
}
defer f.Close()
var config map[string]interface{}
if err := json.NewDecoder(f).Decode(&config); err != nil {
config = make(map[string]interface{})
}
credHelpers, ok := config["credHelpers"].(map[string]interface{})
if !ok {
credHelpers = make(map[string]interface{})
}
credHelpers["registry.ap-south-1.nhost.run"] = credentialsHelper
credHelpers["registry.ap-southeast-1.nhost.run"] = credentialsHelper
credHelpers["registry.eu-central-1.nhost.run"] = credentialsHelper
credHelpers["registry.eu-west-2.nhost.run"] = credentialsHelper
credHelpers["registry.us-east-1.nhost.run"] = credentialsHelper
credHelpers["registry.sa-east-1.nhost.run"] = credentialsHelper
credHelpers["registry.us-west-2.nhost.run"] = credentialsHelper
config["credHelpers"] = credHelpers
if err := f.Truncate(0); err != nil {
return fmt.Errorf("could not truncate docker config file: %w", err)
}
if _, err := f.Seek(0, 0); err != nil {
return fmt.Errorf("could not seek docker config file: %w", err)
}
if err := json.NewEncoder(f).Encode(config); err != nil {
return fmt.Errorf("could not encode docker config file: %w", err)
}
return nil
}
func actionConfigure(c *cli.Context) error {
ce := clienv.FromCLI(c)
if err := writeScript(c.Context, ce); err != nil {
return err
}
if c.Bool(flagNoInteractive) {
return configureDocker(c.String(flagDockerConfig))
}
//nolint:lll
ce.PromptMessage(
"I am about to configure docker to authenticate with Nhost's registry. This will modify your docker config file on %s. Should I continue? [y/N] ",
c.String(flagDockerConfig),
)
v, err := ce.PromptInput(false)
if err != nil {
return fmt.Errorf("could not read input: %w", err)
}
if v == "y" || v == "Y" {
return configureDocker(c.String(flagDockerConfig))
}
return nil
}

View File

@@ -0,0 +1,17 @@
package dockercredentials
import "github.com/urfave/cli/v2"
func Command() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "docker-credentials",
Aliases: []string{},
Usage: "Perform docker-credentials operations",
Subcommands: []*cli.Command{
CommandGet(),
CommandErase(),
CommandStore(),
CommandConfigure(),
},
}
}

View File

@@ -0,0 +1,20 @@
package dockercredentials
import (
"github.com/urfave/cli/v2"
)
func CommandErase() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "erase",
Aliases: []string{},
Hidden: true,
Usage: "This action doesn't do anything",
Action: actionErase,
}
}
func actionErase(c *cli.Context) error {
_, _ = c.App.Writer.Write([]byte("Please, use the nhost CLI to logout\n"))
return nil
}

View File

@@ -0,0 +1,99 @@
package dockercredentials
import (
"bufio"
"context"
"encoding/json"
"fmt"
"os"
"github.com/nhost/nhost/cli/clienv"
"github.com/urfave/cli/v2"
)
const (
flagAuthURL = "auth-url"
flagGraphqlURL = "graphql-url"
)
func CommandGet() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "get",
Aliases: []string{},
Usage: "Get credentials for the logged in user",
Hidden: true,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagAuthURL,
Usage: "Nhost auth URL",
EnvVars: []string{"NHOST_CLI_AUTH_URL"},
Value: "https://otsispdzcwxyqzbfntmj.auth.eu-central-1.nhost.run/v1",
Hidden: true,
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagGraphqlURL,
Usage: "Nhost GraphQL URL",
EnvVars: []string{"NHOST_CLI_GRAPHQL_URL"},
Value: "https://otsispdzcwxyqzbfntmj.graphql.eu-central-1.nhost.run/v1",
Hidden: true,
},
},
Action: actionGet,
}
}
func getToken(ctx context.Context, authURL, graphqlURL string) (string, error) {
ce := clienv.New(
os.Stdout,
os.Stderr,
&clienv.PathStructure{},
authURL,
graphqlURL,
"unneeded",
"unneeded",
"unneeded",
)
session, err := ce.LoadSession(ctx)
if err != nil {
return "", err //nolint:wrapcheck
}
return session.Session.AccessToken, nil
}
//nolint:tagliatelle
type response struct {
ServerURL string `json:"ServerURL"`
Username string `json:"Username"`
Secret string `json:"Secret"`
}
func actionGet(c *cli.Context) error {
scanner := bufio.NewScanner(c.App.Reader)
var input string
for scanner.Scan() {
input += scanner.Text()
}
token, err := getToken(c.Context, c.String(flagAuthURL), c.String(flagGraphqlURL))
if err != nil {
return err
}
b, err := json.Marshal(response{
ServerURL: input,
Username: "nhost",
Secret: token,
})
if err != nil {
return fmt.Errorf("failed to marshal response: %w", err)
}
if _, err = c.App.Writer.Write(b); err != nil {
return fmt.Errorf("failed to write response: %w", err)
}
return nil
}

View File

@@ -0,0 +1,20 @@
package dockercredentials
import (
"github.com/urfave/cli/v2"
)
func CommandStore() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "store",
Aliases: []string{},
Hidden: true,
Usage: "This action doesn't do anything",
Action: actionStore,
}
}
func actionStore(c *cli.Context) error {
_, _ = c.App.Writer.Write([]byte("Please, use the nhost CLI to login\n"))
return nil
}

253
cli/cmd/project/init.go Normal file
View File

@@ -0,0 +1,253 @@
package project
import (
"context"
"embed"
"errors"
"fmt"
"io/fs"
"os"
"path/filepath"
"github.com/hashicorp/go-getter"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/cmd/config"
"github.com/nhost/nhost/cli/dockercompose"
"github.com/urfave/cli/v2"
"gopkg.in/yaml.v3"
)
const (
flagRemote = "remote"
)
//go:embed templates/init/*
var embeddedFS embed.FS
func writeFiles(ps *clienv.PathStructure, root, relPath string) error {
dirEntries, err := embeddedFS.ReadDir(filepath.Join(root, relPath))
if err != nil {
return fmt.Errorf("failed to read dir: %w", err)
}
for _, entry := range dirEntries {
if entry.IsDir() {
return writeFiles(ps, root, filepath.Join(relPath, entry.Name()))
}
src := filepath.Join(root, relPath, entry.Name())
fileData, err := fs.ReadFile(embeddedFS, src)
if err != nil {
return fmt.Errorf("failed to read file %s: %w", src, err)
}
dst := filepath.Join(ps.Root(), relPath, entry.Name())
f, err := os.OpenFile(
filepath.Join(ps.Root(), dst),
os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o600, //nolint:mnd
)
if err != nil {
return fmt.Errorf("failed to open file %s: %w", dst, err)
}
defer f.Close()
if _, err := f.Write(fileData); err != nil {
return fmt.Errorf("failed to write file %s: %w", dst, err)
}
}
return nil
}
const hasuraMetadataVersion = 3
func CommandInit() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "init",
Aliases: []string{},
Usage: "Initialize a new Nhost project",
Action: commandInit,
Flags: []cli.Flag{
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagRemote,
Usage: "Initialize pulling configuration, migrations and metadata from the linked project",
Value: false,
EnvVars: []string{"NHOST_REMOTE"},
},
},
}
}
func commandInit(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
if clienv.PathExists(ce.Path.NhostFolder()) {
return errors.New("nhost folder already exists") //nolint:err113
}
if err := os.MkdirAll(ce.Path.NhostFolder(), 0o755); err != nil { //nolint:mnd
return fmt.Errorf("failed to create nhost folder: %w", err)
}
ce.Infoln("Initializing Nhost project")
if err := config.InitConfigAndSecrets(ce); err != nil {
return fmt.Errorf("failed to initialize configuration: %w", err)
}
if cCtx.Bool(flagRemote) {
if err := InitRemote(cCtx.Context, ce); err != nil {
return fmt.Errorf("failed to initialize remote project: %w", err)
}
} else {
if err := initInit(cCtx.Context, ce.Path); err != nil {
return fmt.Errorf("failed to initialize project: %w", err)
}
}
ce.Infoln("Successfully initialized Nhost project, run `nhost up` to start development")
return nil
}
func initInit(
ctx context.Context, ps *clienv.PathStructure,
) error {
hasuraConf := map[string]any{"version": hasuraMetadataVersion}
if err := clienv.MarshalFile(hasuraConf, ps.HasuraConfig(), yaml.Marshal); err != nil {
return fmt.Errorf("failed to save hasura config: %w", err)
}
if err := initFolders(ps); err != nil {
return err
}
if err := writeFiles(ps, "templates/init", ""); err != nil {
return err
}
getclient := &getter.Client{ //nolint:exhaustruct
Ctx: ctx,
Src: "github.com/nhost/hasura-auth/email-templates",
Dst: "nhost/emails",
Mode: getter.ClientModeAny,
Detectors: []getter.Detector{
&getter.GitHubDetector{},
},
}
if err := getclient.Get(); err != nil {
return fmt.Errorf("failed to download email templates: %w", err)
}
return nil
}
func initFolders(ps *clienv.PathStructure) error {
folders := []string{
ps.DotNhostFolder(),
filepath.Join(ps.Root(), "functions"),
filepath.Join(ps.NhostFolder(), "migrations", "default"),
filepath.Join(ps.NhostFolder(), "metadata"),
filepath.Join(ps.NhostFolder(), "seeds"),
filepath.Join(ps.NhostFolder(), "emails"),
}
for _, f := range folders {
if err := os.MkdirAll(f, 0o755); err != nil { //nolint:mnd
return fmt.Errorf("failed to create folder %s: %w", f, err)
}
}
return nil
}
func InitRemote(
ctx context.Context,
ce *clienv.CliEnv,
) error {
proj, err := ce.GetAppInfo(ctx, "")
if err != nil {
return fmt.Errorf("failed to get app info: %w", err)
}
cfg, err := config.Pull(ctx, ce, proj, true)
if err != nil {
return fmt.Errorf("failed to pull config: %w", err)
}
if err := initInit(ctx, ce.Path); err != nil {
return err
}
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
hasuraAdminSecret, err := cl.GetHasuraAdminSecret(ctx, proj.ID)
if err != nil {
return fmt.Errorf("failed to get hasura admin secret: %w", err)
}
hasuraEndpoint := fmt.Sprintf(
"https://%s.hasura.%s.nhost.run", proj.Subdomain, proj.Region.Name,
)
if err := deploy(
ctx, ce, cfg, hasuraEndpoint, hasuraAdminSecret.App.Config.Hasura.AdminSecret,
); err != nil {
return fmt.Errorf("failed to deploy: %w", err)
}
ce.Infoln("Project initialized successfully!")
return nil
}
func deploy(
ctx context.Context,
ce *clienv.CliEnv,
cfg *model.ConfigConfig,
hasuraEndpoint string,
hasuraAdminSecret string,
) error {
docker := dockercompose.NewDocker()
ce.Infoln("Creating postgres migration")
if err := docker.HasuraWrapper(
ctx,
ce.LocalSubdomain(),
ce.Path.NhostFolder(),
*cfg.Hasura.Version,
"migrate", "create", "init", "--from-server", "--schema", "public",
"--database-name", "default",
"--skip-update-check",
"--log-level", "ERROR",
"--endpoint", hasuraEndpoint,
"--admin-secret", hasuraAdminSecret,
); err != nil {
return fmt.Errorf("failed to create postgres migration: %w", err)
}
ce.Infoln("Downloading metadata...")
if err := docker.HasuraWrapper(
ctx,
ce.LocalSubdomain(),
ce.Path.NhostFolder(),
*cfg.Hasura.Version,
"metadata", "export",
"--skip-update-check",
"--log-level", "ERROR",
"--endpoint", hasuraEndpoint,
"--admin-secret", hasuraAdminSecret,
); err != nil {
return fmt.Errorf("failed to create metadata: %w", err)
}
return nil
}

31
cli/cmd/project/link.go Normal file
View File

@@ -0,0 +1,31 @@
package project
import (
"fmt"
"os"
"github.com/nhost/nhost/cli/clienv"
"github.com/urfave/cli/v2"
)
func CommandLink() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "link",
Aliases: []string{},
Usage: "Link local app to a remote one",
Action: commandLink,
Flags: []cli.Flag{},
}
}
func commandLink(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
if err := os.MkdirAll(ce.Path.DotNhostFolder(), 0o755); err != nil { //nolint:mnd
return fmt.Errorf("failed to create .nhost folder: %w", err)
}
_, err := ce.Link(cCtx.Context)
return err //nolint:wrapcheck
}

38
cli/cmd/project/list.go Normal file
View File

@@ -0,0 +1,38 @@
package project
import (
"context"
"fmt"
"github.com/nhost/nhost/cli/clienv"
"github.com/urfave/cli/v2"
)
func CommandList() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "list",
Aliases: []string{},
Usage: "List remote apps",
Action: commandList,
Flags: []cli.Flag{},
}
}
func commandList(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
return List(cCtx.Context, ce)
}
func List(ctx context.Context, ce *clienv.CliEnv) error {
cl, err := ce.GetNhostClient(ctx)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
orgs, err := cl.GetOrganizationsAndWorkspacesApps(ctx)
if err != nil {
return fmt.Errorf("failed to get workspaces: %w", err)
}
return clienv.Printlist(ce, orgs) //nolint:wrapcheck
}

View File

@@ -0,0 +1 @@
package project

View File

@@ -0,0 +1,2 @@
.nhost
.secrets

View File

@@ -0,0 +1,14 @@
{
"name": "functions",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "functions",
"version": "1.0.0",
"license": "ISC",
"devDependencies": {}
}
}
}

View File

@@ -0,0 +1,13 @@
{
"name": "functions",
"version": "1.0.0",
"description": "",
"main": "index.js",
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}

View File

@@ -0,0 +1,95 @@
package run
import (
"encoding/json"
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/nhostclient/graphql"
"github.com/urfave/cli/v2"
)
func CommandConfigDeploy() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config-deploy",
Aliases: []string{},
Usage: "Deploy service configuration",
Action: commandConfigDeploy,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfig,
Aliases: []string{},
Usage: "Service configuration file",
Value: "nhost-run-service.toml",
Required: true,
EnvVars: []string{"NHOST_RUN_SERVICE_CONFIG"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagServiceID,
Usage: "Service ID to update. Applies overlay of the same name",
Required: true,
EnvVars: []string{"NHOST_RUN_SERVICE_ID"},
},
},
}
}
func transform[T, V any](t *T) (*V, error) {
b, err := json.Marshal(t)
if err != nil {
return nil, fmt.Errorf("failed to marshal: %w", err)
}
var v V
if err := json.Unmarshal(b, &v); err != nil {
return nil, fmt.Errorf("failed to unmarshal: %w", err)
}
return &v, nil
}
func commandConfigDeploy(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
cl, err := ce.GetNhostClient(cCtx.Context)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
secrets, appID, err := getRemoteSecrets(cCtx.Context, cl, cCtx.String(flagServiceID))
if err != nil {
return err
}
cfg, err := Validate(
ce,
cCtx.String(flagConfig),
cCtx.String(flagServiceID),
secrets,
true,
)
if err != nil {
return err
}
replaceConfig, err := transform[model.ConfigRunServiceConfig, graphql.ConfigRunServiceConfigInsertInput](
cfg,
)
if err != nil {
return fmt.Errorf("failed to transform configuration into replace input: %w", err)
}
if _, err := cl.ReplaceRunServiceConfig(
cCtx.Context,
appID,
cCtx.String(flagServiceID),
*replaceConfig,
); err != nil {
return fmt.Errorf("failed to replace service config: %w", err)
}
ce.Infoln("Service configuration replaced")
return nil
}

View File

@@ -0,0 +1,95 @@
package run
import (
"fmt"
"os"
"path/filepath"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/cmd/config"
"github.com/urfave/cli/v2"
)
const flagEditor = "editor"
func CommandConfigEdit() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config-edit",
Aliases: []string{},
Usage: "Edit service configuration",
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfig,
Aliases: []string{},
Usage: "Service configuration file",
Value: "nhost-run-service.toml",
Required: true,
EnvVars: []string{"NHOST_RUN_SERVICE_CONFIG"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagEditor,
Usage: "Editor to use",
Value: "vim",
EnvVars: []string{"EDITOR"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagOverlayName,
Usage: "If specified, apply this overlay",
EnvVars: []string{"NHOST_RUN_SERVICE_ID", "NHOST_SERVICE_OVERLAY_NAME"},
},
},
Action: commandConfigEdit,
}
}
func commandConfigEdit(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
overlayName := cCtx.String(flagOverlayName)
if overlayName == "" {
if err := config.EditFile(
cCtx.Context, cCtx.String(flagEditor), cCtx.String(flagConfig),
); err != nil {
return fmt.Errorf("failed to edit config: %w", err)
}
return nil
}
if err := os.MkdirAll(ce.Path.RunServiceOverlaysFolder(
cCtx.String(flagConfig),
), 0o755); err != nil { //nolint:mnd
return fmt.Errorf("failed to create json patches directory: %w", err)
}
tmpdir, err := os.MkdirTemp(os.TempDir(), "nhost-jsonpatch")
if err != nil {
return fmt.Errorf("failed to create temporary directory: %w", err)
}
defer os.RemoveAll(tmpdir)
tmpfileName := filepath.Join(tmpdir, "nhost.toml")
if err := config.CopyConfig[model.ConfigRunServiceConfig](
cCtx.String(flagConfig),
tmpfileName,
ce.Path.RunServiceOverlay(cCtx.String(flagConfig), overlayName),
); err != nil {
return fmt.Errorf("failed to copy config: %w", err)
}
if err := config.EditFile(cCtx.Context, cCtx.String(flagEditor), tmpfileName); err != nil {
return fmt.Errorf("failed to edit config: %w", err)
}
if err := config.GenerateJSONPatch(
cCtx.String(flagConfig),
tmpfileName,
ce.Path.RunServiceOverlay(cCtx.String(flagConfig), overlayName),
); err != nil {
return fmt.Errorf("failed to generate json patch: %w", err)
}
return nil
}

View File

@@ -0,0 +1,52 @@
package run
import (
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
const flagImage = "image"
func CommandConfigEditImage() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config-edit-image",
Aliases: []string{},
Usage: "Edits configuration file and sets the image",
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfig,
Aliases: []string{},
Usage: "Service configuration file",
Value: "nhost-run-service.toml",
EnvVars: []string{"NHOST_RUN_SERVICE_CONFIG"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagImage,
Aliases: []string{},
Usage: "Image to use",
Required: true,
EnvVars: []string{"NHOST_RUN_SERVICE_IMAGE"},
},
},
Action: commandConfigEditImage,
}
}
func commandConfigEditImage(cCtx *cli.Context) error {
var cfg model.ConfigRunServiceConfig
if err := clienv.UnmarshalFile(cCtx.String(flagConfig), &cfg, toml.Unmarshal); err != nil {
return fmt.Errorf("failed to unmarshal config: %w", err)
}
cfg.Image.Image = cCtx.String(flagImage)
if err := clienv.MarshalFile(cfg, cCtx.String(flagConfig), toml.Marshal); err != nil {
return fmt.Errorf("failed to marshal config: %w", err)
}
return nil
}

View File

@@ -0,0 +1,107 @@
package run
import (
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/be/services/mimir/schema"
"github.com/nhost/nhost/cli/clienv"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
func ptr[T any](v T) *T {
return &v
}
func CommandConfigExample() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config-example",
Aliases: []string{},
Usage: "Shows an example config file",
Action: commandConfigExample,
Flags: []cli.Flag{},
}
}
func commandConfigExample(cCtx *cli.Context) error { //nolint:funlen
ce := clienv.FromCLI(cCtx)
//nolint:mnd
cfg := &model.ConfigRunServiceConfig{
Name: "my-run-service",
Image: &model.ConfigRunServiceImage{
Image: "docker.io/org/img:latest",
PullCredentials: ptr(
`{"https://myregistry.com/v1": {"username": "myuser", "password": "mypassword"}}`,
),
},
Command: []string{
"start",
},
Environment: []*model.ConfigEnvironmentVariable{
{
Name: "ENV_VAR1",
Value: "value1",
},
{
Name: "ENV_VAR2",
Value: "value2",
},
},
Ports: []*model.ConfigRunServicePort{
{
Port: 8080,
Type: "http",
Publish: ptr(true),
Ingresses: []*model.ConfigIngress{
{
Fqdn: []string{"my-run-service.acme.com"},
Tls: &model.ConfigIngressTls{
ClientCA: ptr("---BEGIN CERTIFICATE---\n...\n---END CERTIFICATE---"),
},
},
},
},
},
Resources: &model.ConfigRunServiceResources{
Compute: &model.ConfigComputeResources{
Cpu: 125,
Memory: 256,
},
Storage: []*model.ConfigRunServiceResourcesStorage{
{
Name: "my-storage",
Capacity: 1,
Path: "/var/lib/my-storage",
},
},
Replicas: 1,
Autoscaler: nil,
},
HealthCheck: &model.ConfigHealthCheck{
Port: 8080,
InitialDelaySeconds: ptr(10),
ProbePeriodSeconds: ptr(20),
},
}
sch, err := schema.New()
if err != nil {
return fmt.Errorf("failed to create schema: %w", err)
}
cfg, err = sch.FillRunServiceConfig(cfg)
if err != nil {
return fmt.Errorf("failed to validate config: %w", err)
}
b, err := toml.Marshal(cfg)
if err != nil {
return fmt.Errorf("failed to marshal config: %w", err)
}
ce.Println("%s", b)
return nil
}

View File

@@ -0,0 +1,72 @@
package run
import (
"encoding/json"
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
const flagServiceID = "service-id"
func CommandConfigPull() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config-pull",
Aliases: []string{},
Usage: "Download service configuration",
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfig,
Aliases: []string{},
Usage: "Service configuration file",
Value: "nhost-run-service.toml",
EnvVars: []string{"NHOST_RUN_SERVICE_CONFIG"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagServiceID,
Usage: "Service ID to update",
Required: true,
EnvVars: []string{"NHOST_RUN_SERVICE_ID"},
},
},
Action: commandConfigPull,
}
}
func commandConfigPull(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
cl, err := ce.GetNhostClient(cCtx.Context)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
appID, err := getAppIDFromServiceID(cCtx.Context, cl, cCtx.String(flagServiceID))
if err != nil {
return err
}
resp, err := cl.GetRunServiceConfigRawJSON(
cCtx.Context,
appID,
cCtx.String(flagServiceID),
false,
)
if err != nil {
return fmt.Errorf("failed to get service config: %w", err)
}
var v model.ConfigRunServiceConfig
if err := json.Unmarshal([]byte(resp.RunServiceConfigRawJSON), &v); err != nil {
return fmt.Errorf("failed to unmarshal config: %w", err)
}
if err := clienv.MarshalFile(v, cCtx.String(flagConfig), toml.Marshal); err != nil {
return fmt.Errorf("failed to save config to file: %w", err)
}
return nil
}

View File

@@ -0,0 +1,67 @@
package run
import (
"fmt"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/project/env"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
func CommandConfigShow() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config-show",
Aliases: []string{},
Usage: "Shows Run service configuration after resolving secrets",
Description: "Note that this command will always use the local secrets, even if you specify subdomain",
Action: commandConfigShow,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfig,
Aliases: []string{},
Usage: "Service configuration file",
Value: "nhost-run-service.toml",
EnvVars: []string{"NHOST_RUN_SERVICE_CONFIG"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagOverlayName,
Usage: "If specified, apply this overlay",
EnvVars: []string{"NHOST_RUN_SERVICE_ID", "NHOST_SERVICE_OVERLAY_NAME"},
},
},
}
}
func commandConfigShow(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
var secrets model.Secrets
if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
return fmt.Errorf(
"failed to parse secrets, make sure secret values are between quotes: %w",
err,
)
}
cfg, err := Validate(
ce,
cCtx.String(flagConfig),
cCtx.String(flagOverlayName),
secrets,
false,
)
if err != nil {
return err
}
b, err := toml.Marshal(cfg)
if err != nil {
return fmt.Errorf("error marshalling config: %w", err)
}
ce.Println("%s", b)
return nil
}

View File

@@ -0,0 +1,216 @@
package run
import (
"context"
"errors"
"fmt"
"os"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/be/services/mimir/schema"
"github.com/nhost/be/services/mimir/schema/appconfig"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/cmd/config"
"github.com/nhost/nhost/cli/nhostclient"
"github.com/nhost/nhost/cli/nhostclient/graphql"
"github.com/nhost/nhost/cli/project/env"
"github.com/pelletier/go-toml/v2"
"github.com/urfave/cli/v2"
)
const (
flagConfig = "config"
flagOverlayName = "overlay-name"
)
func CommandConfigValidate() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "config-validate",
Aliases: []string{},
Usage: "Validates service configuration after resolving secrets",
Action: commandConfigValidate,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfig,
Aliases: []string{},
Usage: "Service configuration file",
Value: "nhost-run-service.toml",
EnvVars: []string{"NHOST_RUN_SERVICE_CONFIG"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagOverlayName,
Usage: "If specified, apply this overlay",
EnvVars: []string{"NHOST_SERVICE_OVERLAY_NAME"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagServiceID,
Usage: "If specified, apply this overlay and remote secrets for this service",
EnvVars: []string{"NHOST_RUN_SERVICE_ID"},
},
},
}
}
func respToSecrets(env []*graphql.GetSecrets_AppSecrets) model.Secrets {
secrets := make(model.Secrets, len(env))
for i, s := range env {
secrets[i] = &model.ConfigEnvironmentVariable{
Name: s.Name,
Value: s.Value,
}
}
return secrets
}
func loadConfig(
path string,
) (*model.ConfigRunServiceConfig, error) {
cfg := &model.ConfigRunServiceConfig{} //nolint:exhaustruct
r, err := os.Open(path)
if err != nil {
return cfg, fmt.Errorf("failed to open file: %w", err)
}
defer r.Close()
decoder := toml.NewDecoder(r)
decoder.DisallowUnknownFields()
if err := decoder.Decode(cfg); err != nil {
return cfg, fmt.Errorf("failed to parse config: %w", err)
}
return cfg, nil
}
func getAppIDFromServiceID(
ctx context.Context,
cl *nhostclient.Client,
serviceID string,
) (string, error) {
resp, err := cl.GetRunServiceInfo(
ctx,
serviceID,
)
if err != nil {
return "", fmt.Errorf("failed to get app info from service id: %w", err)
}
return resp.GetRunService().GetAppID(), nil
}
func Validate(
ce *clienv.CliEnv,
configPath string,
overlayName string,
secrets model.Secrets,
testSecretsOnly bool,
) (*model.ConfigRunServiceConfig, error) {
cfg, err := loadConfig(configPath)
if err != nil {
return nil, err
}
if clienv.PathExists(ce.Path.RunServiceOverlay(configPath, overlayName)) {
cfg, err = config.ApplyJSONPatches(*cfg, ce.Path.RunServiceOverlay(configPath, overlayName))
if err != nil {
return nil, fmt.Errorf("failed to apply json patches: %w", err)
}
}
schema, err := schema.New()
if err != nil {
return nil, fmt.Errorf("failed to create schema: %w", err)
}
cfgSecretsResolved, err := appconfig.SecretsResolver(cfg, secrets, schema.FillRunServiceConfig)
if err != nil {
return nil, fmt.Errorf("failed to validate config: %w", err)
}
if !testSecretsOnly {
cfg = cfgSecretsResolved
}
return cfg, nil
}
func getRemoteSecrets(
ctx context.Context,
cl *nhostclient.Client,
serviceID string,
) (model.Secrets, string, error) {
appID, err := getAppIDFromServiceID(ctx, cl, serviceID)
if err != nil {
return nil, "", err
}
secretsResp, err := cl.GetSecrets(
ctx,
appID,
)
if err != nil {
return nil, "", fmt.Errorf("failed to get secrets: %w", err)
}
return respToSecrets(secretsResp.GetAppSecrets()), appID, nil
}
func commandConfigValidate(cCtx *cli.Context) error {
var (
overlayName string
serviceID string
)
switch {
case cCtx.String(flagServiceID) != "" && cCtx.String(flagOverlayName) != "":
return errors.New("cannot specify both service id and overlay name") //nolint:err113
case cCtx.String(flagServiceID) != "":
serviceID = cCtx.String(flagServiceID)
overlayName = serviceID
case cCtx.String(flagOverlayName) != "":
overlayName = cCtx.String(flagOverlayName)
}
ce := clienv.FromCLI(cCtx)
var secrets model.Secrets
ce.Infoln("Getting secrets...")
if serviceID != "" {
cl, err := ce.GetNhostClient(cCtx.Context)
if err != nil {
return fmt.Errorf("failed to get nhost client: %w", err)
}
secrets, _, err = getRemoteSecrets(cCtx.Context, cl, serviceID)
if err != nil {
return err
}
} else {
if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
return fmt.Errorf(
"failed to parse secrets, make sure secret values are between quotes: %w",
err,
)
}
}
ce.Infoln("Verifying configuration...")
if _, err := Validate(
ce,
cCtx.String(flagConfig),
overlayName,
secrets,
false,
); err != nil {
return err
}
ce.Infoln("Configuration is valid!")
return nil
}

84
cli/cmd/run/dev.go Normal file
View File

@@ -0,0 +1,84 @@
package run
import (
"fmt"
"regexp"
"github.com/nhost/be/services/mimir/model"
"github.com/nhost/nhost/cli/clienv"
"github.com/nhost/nhost/cli/project/env"
"github.com/urfave/cli/v2"
)
const (
flagDevPrependExport = "prepend-export"
)
const dotenvEscapeRegex = `[\\\"!\$]`
func CommandEnv() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "env",
Aliases: []string{},
Usage: "Outputs environment variables. Useful to generate .env files",
Action: commandConfigDev,
Flags: []cli.Flag{
&cli.StringFlag{ //nolint:exhaustruct
Name: flagConfig,
Aliases: []string{},
Usage: "Service configuration file",
Value: "nhost-run-service.toml",
EnvVars: []string{"NHOST_RUN_SERVICE_CONFIG"},
},
&cli.StringFlag{ //nolint:exhaustruct
Name: flagOverlayName,
Usage: "If specified, apply this overlay",
EnvVars: []string{"NHOST_RUN_SERVICE_ID", "NHOST_SERVICE_OVERLAY_NAME"},
},
&cli.BoolFlag{ //nolint:exhaustruct
Name: flagDevPrependExport,
Usage: "Prepend 'export' to each line",
EnvVars: []string{"NHOST_RuN_SERVICE_ENV_PREPEND_EXPORT"},
},
},
}
}
func escape(s string) string {
re := regexp.MustCompile(dotenvEscapeRegex)
return re.ReplaceAllString(s, "\\$0")
}
func commandConfigDev(cCtx *cli.Context) error {
ce := clienv.FromCLI(cCtx)
var secrets model.Secrets
if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
return fmt.Errorf(
"failed to parse secrets, make sure secret values are between quotes: %w",
err,
)
}
cfg, err := Validate(
ce,
cCtx.String(flagConfig),
cCtx.String(flagOverlayName),
secrets,
false,
)
if err != nil {
return err
}
for _, v := range cfg.GetEnvironment() {
value := escape(v.Value)
if cCtx.Bool(flagDevPrependExport) {
ce.Println("export %s=\"%s\"", v.Name, value)
} else {
ce.Println("%s=\"%s\"", v.Name, value)
}
}
return nil
}

27
cli/cmd/run/dev_test.go Normal file
View File

@@ -0,0 +1,27 @@
package run //nolint:testpackage
import "testing"
func TestEscape(t *testing.T) {
t.Parallel()
cases := []struct {
s string
want string
}{
{
s: `#asdasd;l;kq23\\n40-0as9d"$\`,
want: `#asdasd;l;kq23\\\\n40-0as9d\"\$\\`,
},
}
for _, tc := range cases {
t.Run(tc.s, func(t *testing.T) {
t.Parallel()
if got := escape(tc.s); got != tc.want {
t.Errorf("escape() = %v, want %v", got, tc.want)
}
})
}
}

21
cli/cmd/run/run.go Normal file
View File

@@ -0,0 +1,21 @@
package run
import "github.com/urfave/cli/v2"
func Command() *cli.Command {
return &cli.Command{ //nolint:exhaustruct
Name: "run",
Aliases: []string{},
Usage: "Perform operations on Nhost Run",
Subcommands: []*cli.Command{
CommandConfigShow(),
CommandConfigDeploy(),
CommandConfigEdit(),
CommandConfigEditImage(),
CommandConfigPull(),
CommandConfigValidate(),
CommandConfigExample(),
CommandEnv(),
},
}
}

Some files were not shown because too many files have changed in this diff Show More