Skip to content

Commit

Permalink
Merge branch 'main' into php-better-php_ini_scan_dir-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoda-BZH authored Feb 18, 2025
2 parents 0b42c8b + fd918f2 commit 033c1f6
Show file tree
Hide file tree
Showing 18 changed files with 517 additions and 120 deletions.
5 changes: 5 additions & 0 deletions .github/styles/config/vocabularies/Doc/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,8 @@ VSCode
webroot
Wildfly
Zooper
CRDs
namespace
namespaces
Kubectl
toolchain
2 changes: 1 addition & 1 deletion .github/workflows/external-doc-update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Update external doc?

on:
pull_request_target:
pull_request:
types: [opened, synchronize]
branches: [ main ]

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/review-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Manage review app
uses: CleverCloud/clever-cloud-review-app@v1.1.1
uses: CleverCloud/clever-cloud-review-app@v2.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}
Expand All @@ -39,4 +39,4 @@ jobs:
type: 'static-apache'
set-env: true
environment: 'review'
domain: '${{ github.event.pull_request.base.repo.name }}-PR-${{ github.event.number }}.cleverapps.io/developers'
domain: '${{ github.event.pull_request.base.repo.name }}-PR-${{ github.event.number }}.cleverapps.io/developers'
29 changes: 29 additions & 0 deletions content/changelog/2025/02-04-otoroshi-available.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: "Otoroshi v16.23.2 is available, with Biscuit Studio and LLM updates"
date: 2025-02-04
tags:
- addons
- Otoroshi
authors:
- name: Sébastien Allemand
link: https://github.com/allemas
image: https://github.com/allemas.png?size=40
- name: David Legrand
link: https://github.com/davlgd
image: https://github.com/davlgd.png?size=40
description: Discover and use Biscuit, the easy way
excludeSearch: true
---

Otoroshi `v16.23.2` is now available on Clever Cloud for new add-ons. You can also update `CC_OTOROSHI_VERSION` to `v16.23.2`, `CC_OTOROSHI_APIM_VERSION` to `1738687356` in the Java application and rebuild it.

This version includes the brand new Biscuit Studio, allowing you to use such tokens (we use in production for Materia KV and Pulsar) in your routes. It comes with key pair generator, Biscuit verifier, attenuation and roles management tools. The [client credentials plugin](https://cloud-apim.github.io/otoroshi-biscuit-studio/docs/plugins/clientcredentials) supports Biscuit to add a OAuth2 `client_credentials` flow to your routes.

Web Application Firewall (WAF) plugin and interface are also enhanced in this release. Otoroshi can now use secrets management services declared with environment variables. This allows an easy integration of Clever KMS, our secrets management service available in private alpha for dedicated customers.

LLM plugin includes a better models management, compatible with OVHcloud AI endpoints. Functions calling is enabled in Anthropic and Cohere, DeepSeek is available as a provider, [Citations from Anthropic](https://docs.anthropic.com/en/docs/build-with-claude/citations) are handled, such as reasoning models and tokens.

- [Learn more about Biscuit](https://doc.biscuitsec.org/home)
- [Learn more about Otoroshi Biscuit Studio](https://cloud-apim.github.io/otoroshi-biscuit-studio/docs/overview)
- [Learn more about Otoroshi with LLM on Clever Cloud](/developers/doc/addons/otoroshi/)
- [Otoroshi LLM on Clever Cloud video streams](https://www.youtube.com/@Clevercloud-platform/search?query=Otoroshi)
18 changes: 18 additions & 0 deletions content/changelog/2025/02-05-mysql-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: MySQL update, with a new option
date: 2025-02-05
tags:
- addons
- update
authors:
- name: David Legrand
link: https://github.com/davlgd
image: https://github.com/davlgd.png?size=40
description: Use skip-log-bin from Clever Tools
excludeSearch: true
---

We deployed updated MySQL images for releases 8.4 (8.4.2-2) and 8.0 (8.0.39-30). A new option is available at database creation from Clever Tools: [skip-log-bin](https://dev.mysql.com/doc/refman/8.4/en/replication-options-binary-log.html#option_mysqld_log-bin). To use it, add `--option skip-log-bin` flag with the `clever create addon mysql-addon` command.

* [Learn more about MySQL 8.4](https://www.percona.com/blog/mysql-8-4-first-peek/)
* [Learn more about MySQL on Clever Cloud](/developers/doc/addons/mysql/)
27 changes: 27 additions & 0 deletions content/changelog/2025/02-12-php-8.4-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: "PHP 8.4 is available, Symfony CLI included"
date: 2025-02-12
tags:
- images
- update
authors:
- name: David Legrand
link: https://github.com/davlgd
image: https://github.com/davlgd.png?size=40
description: FrankenPHP is next to come
excludeSearch: true
---

We deployed an updated PHP image with no impact for our users.

* PHP 8.4.3
* Composer 2.8.5
* Symfony CLI 5.10.7
* Linux kernel 6.12.9

You can now use `8.4` as `CC_PHP_VERSION` environment variable, `8.3` is still the default for now.

Only some extensions support PHP 8.4 for now: apcu, amqp, blackfire, event, elastic-apm, gnupg, grpc, imap, mailparse, maxminddb, memcache, memcached, mongodb, newrelic, oauth, pdflib, protobuf pspell, rdkafka, redis, ssh2, solr, tideways, uploadprogress, zip. We'll add support for more extensions as they are released.

* [PHP migration guide from 8.3 to 8.4](https://www.php.net/migration84)
* [Learn more about PHP on Clever Cloud](/developers/doc/applications/php/)
26 changes: 25 additions & 1 deletion content/doc/administrate/ssh-clever-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The `-t` flag is mandatory for the ssh connection to work properly. If your term

## Access your application's folder

No matter wich way you've decided to use to SSH to the machine, your application's folder is located at: `/home/bas/<app_id>`.
No matter which way you've decided to use to SSH to the machine, your application's folder is located at: `/home/bas/<app_id>`.

## Show your application's logs

Expand All @@ -103,3 +103,27 @@ journalctl -efa -u bas-deploy.service
```
You can also use `journalctl` [with other options](https://www.commandlinux.com/man-page/man1/journalctl.1.html) if you need to.
## Troubleshooting
A commonly encountered issue when using `clever ssh` is:
```
Error: Failed to choose instance: 'Error while running choice script: Error: This application has no instances you can ssh to'
```
First, make sure your application is running, otherwise there is no instance to connect to.
If your application is up, this means you aren't allowed to access the organization or application. This might be due to permission issue.
If you're supposed to have access to the application, this is likely due to a key management issue. To fix it:
* make sure you've added your public key on your Clever Cloud profile. You can refer to our documentation to [add your SSH key on Clever Cloud](../../account/ssh-keys-management#add-a-public-ssh-key-on-clever-cloud)
* make sure your SSH agent is using the proper private key

A useful command for debugging is:
```
ssh -t ssh@sshgateway-clevercloud-customers.services.clever-cloud.com -v
```

This command shows information about your SSH connection attempt, such as the key, and the organization your key is linked to.

If you don't see your SSH key listed, you must [add it to your SSH agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent).
If your key is present but not resolved as the first one in the list, you can [force the use of a specific key](../../account/ssh-keys-management/#configure-your-ssh-agent)
85 changes: 4 additions & 81 deletions content/doc/applications/docker/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,95 +119,18 @@ You can use the [ARG](https://docs.docker.com/engine/reference/builder/#arg) ins

Every environment variable defined for your application will be passed as a build environment variable using the `--build-arg=<ENV>` parameter during the `docker build` phase.

### Dockerized Rust application Deployment

To make your dockerized application run on clever Cloud, you need to:

* expose port 8080 in your docker file
* run the application with `CMD` or `ENTRYPOINT`

For instance, here is the `Dockerfile` used for the Rust application:

```Dockerfile{linenos=table}
# rust tooling is provided by `archlinux-rust`
FROM geal/archlinux-rust
MAINTAINER Geoffroy Couprie, contact@geoffroycouprie.com
# needed by rust
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
# relevant files are in `./source`
ADD . /source
WORKDIR /source
# Clever Cloud expects your app to listen on port 8080
EXPOSE 8080
RUN rustc -V
# Build your application
RUN cargo build
# Run the application with `CMD`
CMD cargo run
```

### Dockerized HHVM application Deployment

Deploying a [HHVM](https://hhvm.com/) application is a bit trickier as it needs to have both HHVM and [nginx](https://www.nginx.com/) running as daemons. To be able to have them running both, we need to put them in a start script:

```bash{linenos=table}
#!/bin/sh
hhvm --mode server -vServer.Type=fastcgi -vServer.Port=9000&
service nginx start
composer install
echo "App running on port 8080"
tail -f /var/log/hhvm/error.log
```

Since the two servers are running as daemons, we need to start a long-running process. In this case we use `tail -f`. We then add `start.sh` as the `CMD` in the `Dockerfile`

```Dockerfile{linenos=table}
# We need HHVM
FROM jolicode/hhvm
# We need nginx
RUN sudo apt-get update \
&& sudo apt-get install -y nginx
ADD . /root
RUN sudo chmod +x /root/start.sh
# Nginx configuration
ADD hhvm.hdf /etc/hhvm/server.hdf
ADD nginx.conf /etc/nginx/sites-available/hack.conf
RUN sudo ln -s /etc/nginx/sites-available/hack.conf /etc/nginx/sites-enabled/hack.conf
# Checking nginx config
RUN sudo nginx -t
RUN sudo chown -R www-data:www-data /root
WORKDIR /root
# The app needs to listen on port 8080
EXPOSE 8080
# Launch the start script
CMD ["sudo","/root/start.sh"]
```

### Sample dockerized applications


We provide a few examples of dockerized applications on Clever Cloud.

* [Elixir App](https://GitHub.com/CleverCloud/demo-docker-elixir/blob/master/Dockerfile)
* [Hack / HHVM App](https://GitHub.com/CleverCloud/demo-hhvm)
* [Seaside / Smalltalk App](https://GitHub.com/CleverCloud/demo-seaside)
* [Rust App](https://GitHub.com/CleverCloud/demo-rust)

You might need to use the `CC_DOCKERFILE = <name of your Dockerfile>` variable.


{{% content/env-injection %}}

{{% content/deploy-git %}}
Expand Down
10 changes: 5 additions & 5 deletions content/doc/applications/javascript/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The `package.json` file should look like the following:
"start" : "node myapp.js"
},
"engines" : {
"node" : "^20"
"node" : "^22"
}
}
```
Expand Down Expand Up @@ -92,8 +92,8 @@ Here are various scenarios:

* `CC_NODE_DEV_DEPENDENCIES=install`: Development dependencies will be installed.
* `CC_NODE_DEV_DEPENDENCIES=ignore`: Development dependencies will not be installed.
* `NODE_ENV=production, CC_NODE_DEV_DEPENDENCIES=install`: Development dependencies will be installed.
* `NODE_ENV=production, CC_NODE_DEV_DEPENDENCIES=ignore`: Development dependencies will not be installed.
* `NODE_ENV=production` and `CC_NODE_DEV_DEPENDENCIES=install`: Development dependencies will be installed.
* `NODE_ENV=production` and `CC_NODE_DEV_DEPENDENCIES=ignore`: Development dependencies will not be installed.
* `NODE_ENV=production`: Package manager (NPM / Yarn) default behavior. Development dependencies will not be installed.
* Neither `NODE_ENV` nor `CC_NODE_DEV_DEPENDENCIES` are defined: Package manager (NPM / Yarn) default behavior. Development dependencies will be installed.

Expand Down Expand Up @@ -182,7 +182,7 @@ To deploy an application with pnpm, set the following environment variables:
{{< tabs items="npm, Corepack" >}}

{{< tab >}}**Install with `npm`**:

```bash
CC_NODE_BUILD_TOOL="custom"
CC_PRE_BUILD_HOOK="npm install -g pnpm"
Expand All @@ -192,7 +192,7 @@ To deploy an application with pnpm, set the following environment variables:
{{< /tab >}}

{{< tab >}}**Enable with Corepack**:

```bash
CC_NODE_BUILD_TOOL="custom"
CC_PRE_BUILD_HOOK="corepack enable pnpm"
Expand Down
6 changes: 6 additions & 0 deletions content/doc/applications/php/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,18 +409,24 @@ Others PHP frameworks tested on Clever Cloud:
You can check enabled extensions and versions by viewing our `phpinfo()` example for:

- [PHP 5.6](https://php56info.cleverapps.io)
- [PHP 7.1](https://php71info.cleverapps.io)
- [PHP 7.2](https://php72info.cleverapps.io)
- [PHP 7.3](https://php73info.cleverapps.io)
- [PHP 7.4](https://php74info.cleverapps.io)
- [PHP 8.0](https://php80info.cleverapps.io)
- [PHP 8.1](https://php81info.cleverapps.io)
- [PHP 8.2](https://php82info.cleverapps.io)
- [PHP 8.3](https://php83info.cleverapps.io)
- [PHP 8.4](https://php84info.cleverapps.io)

**Warning**: some extensions need to be [enabled explicitly](#enable-specific-extensions)

Clever Cloud PHP application enables the following PHP extensions by default: `amqp`, `bcmath`, `bz2`, `ctype`, `curl`, `date`, `dba`, `dom`, `exif`, `fileinfo`, `filter`, `ftp`, `gd`, `gettext`, `gmp`, `gRPC`, `hash`, `icon`, `imap`, `imagick`, `intl`, `json`, `ldap`, `libsodium`, `mbstring`, `mcrypt`, `memcached`, `memcache`, `mongodb`, `mysqli`, `mysqlnd`, `odbc`, `opcache`, `openssl`, `pnctl`, `pcre`, `PDO`, `pgsql`, `Phar`, `posix`, `protobuf`, `Pspell`, `random`, `readline`, `redis`, `reflection`, `session`, `simplexml`, `soap`, `sockets`, `solr`, `SPL`, `ssh2`, `sqlite3`, `tidy`, `tokenizer`, `xml`, `xmlreader`, `xmlwriter`, `xsl`, `zip`, `zlib`

{{< callout type="info" >}}
Only some extensions support PHP 8.4 for now: `apcu`, `event`, `imap`, `memcache`, `mongodb`, `pspell`, `rdkafka`, `redis`, `ssh2`, `tideways`, `uploadprogress`, `zip`. We'll add support for more extensions as they are released.
{{< /callout >}}

You can add `DISABLE_<extension_name>: true` in your [environment variable]({{< ref "doc/develop/env-variables.md" >}}) to disable them.

If you have a request about modules, feel free to contact [Clever Cloud Support](https://console.clever-cloud.com/ticket-center-choice).
Expand Down
30 changes: 30 additions & 0 deletions content/doc/applications/static/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,36 @@ RewriteRule ^ - [L]
RewriteRule ^ /index.html
```

## Prerendering with Prerender.io

When you use a SPA framework, you are using Client side rendering.
One of the problem with this method is a poor SEO as search engine crawlers have more difficulty reading the content of this type of application.
To minimize this issue, prerendering can be a solution.

If you want to Prerender your application on Clever Cloud, one solution is to use [Prerender.io](https://prerender.io/).
To use it with our static applications, you need a `.htaccess` file like this at the root of your project:

```ApacheConf
<IfModule mod_headers.c>
RequestHeader set X-Prerender-Token "<PRERENDER_TOKEN>"
RequestHeader set X-Prerender-Version "prerender-apache@2.0.0"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
<IfModule mod_proxy_http.c>
RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|yandex|baiduspider|facebookexternalhit|twitterbot|rogerbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|redditbot|applebot|flipboard|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|google\ page\ speed|qwantify|bitrix\ link\ preview|xing-contenttabreceiver|google-inspectiontool|chrome-lighthouse|telegrambot [NC,OR]
RewriteCond %{QUERY_STRING} _escaped_fragment_
RewriteCond %{REQUEST_URI} ^(?!.*?(\.js|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.doc|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff|\.svg))
RewriteRule ^(index\.html|index\.php)?(.*) http://service.prerender.io/%{REQUEST_SCHEME}://%{HTTP_HOST}$2 [P,END]
</IfModule>
</IfModule>
```
You can find your `PRERENDER_TOKEN` on your [Prerender.io account](https://prerender.io/).

You can verify your configuration work using [this guide](https://docs.prerender.io/docs/how-to-test-your-site-after-you-have-successfully-validated-your-prerender-integration).
## Apache Configuration with `CC_WEBROOT`

If you set the `CC_WEBROOT = /<web-folder>` environment variable, make sure you put your `.htaccess` file at the root of your `/<web-folder>`. This is where Apache will look for directives when you deploy an application in a Static runtime.
Expand Down
7 changes: 7 additions & 0 deletions content/doc/find-help/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ For operations that may exceed the 180-second limit, implement one of these appr
- Break up long-running operations into smaller tasks

Use your embedded [Grafana]({{< ref "doc/metrics/">}} "Grafana on Clever Cloud") to monitor resource usage when implementing any of these solutions.

##### How can I diagnosing Network Issue with `curl`

To gather detailed timing information for each step of the connection process, run the following `curl` command:
``` bash
curl -o /dev/null -s -w "DNS resolution: %{time_namelookup}s\nTCP connection: %{time_connect}s\nTLS handshake: %{time_appconnect}s\nTime to first byte: %{time_starttransfer}s\nTotal time: %{time_total}s\n" https://<example.com>
```

{{% /details %}}

Expand Down
Loading

0 comments on commit 033c1f6

Please sign in to comment.