Skip to content

Commit 4cb429c

Browse files
authored
add https redirection (#126)
* add https redirection * add e2e test * reviex
1 parent 85a930d commit 4cb429c

File tree

18 files changed

+55
-15
lines changed

18 files changed

+55
-15
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ The configuration includes the following parameters:
159159
* `runtime`: (Optional) runtime of the function, if you need to deploy multiple functions with different runtimes in your Serverless Project. If absent, `provider.runtime` will be used to deploy the function, see [this example project](./examples/multiple).
160160
* `events` (Optional): List of events to trigger your functions (e.g, trigger a function based on a schedule with `CRONJobs`). See `events` section below
161161
* `custom_domains` (Optional): List of custom domains, refer to the [how to add a custom domain](https://www.scaleway.com/en/docs/compute/functions/how-to/add-a-custom-domain-name-to-a-function/) documentation page
162+
* `httpOption` (Optional): force https redirection, possible values are `enabled` and `redirected` (default: `enabled`)
162163

163164
### Security and secret management
164165

@@ -439,7 +440,7 @@ If `singleSource` is set to `true`, functions and containers not defined in your
439440
- You have [created a Container Registry namespace](https://www.scaleway.com/en/docs/compute/container-registry/how-to/create-namespace/)
440441
- You have installed Docker and can build and push your image to your registry.
441442

442-
To manafge your containers, you must first define them in the `custom.containers` field in your `serverless.yml` configuration file.
443+
To manage your containers, you must first define them in the `custom.containers` field in your `serverless.yml` configuration file.
443444

444445
Each container must specify the relative path of its application directory (containing the Dockerfile, and all files related to the application to deploy):
445446

deploy/lib/createContainers.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ module.exports = {
8989
timeout: container.timeout,
9090
privacy: container.privacy,
9191
port: container.port,
92+
http_option: container.httpOption,
9293
};
9394

9495
// checking if there is custom_domains set on container creation.
@@ -121,6 +122,7 @@ module.exports = {
121122
timeout: container.timeout,
122123
privacy: container.privacy,
123124
port: container.port,
125+
http_option: container.httpOption,
124126
};
125127

126128
this.serverless.cli.log(`Updating container ${container.name}...`);

deploy/lib/createFunctions.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ Runtime lifecycle doc : https://www.scaleway.com/en/docs/compute/functions/refer
166166
handler: func.handler,
167167
privacy: func.privacy,
168168
domain_name: func.domain_name,
169+
http_option: func.httpOption,
169170
};
170171

171172
const availableRuntimes = await this.listRuntimes();
@@ -205,6 +206,7 @@ Runtime lifecycle doc : https://www.scaleway.com/en/docs/compute/functions/refer
205206
handler: func.handler,
206207
privacy: func.privacy,
207208
domain_name: func.domain_name,
209+
http_option: func.httpOption,
208210
};
209211

210212
const availableRuntimes = await this.listRuntimes();

examples/container-schedule/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "ISC",
1111
"dependencies": {},
1212
"devDependencies": {
13-
"serverless-scaleway-functions": "^0.4.4"
13+
"serverless-scaleway-functions": "^0.4.5"
1414
},
1515
"description": ""
1616
}

examples/container-schedule/serverless.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ custom:
3131
# maxScale: 2
3232
# maxConcurrency: 50
3333
# timeout: 20000
34+
# httpOption: redirected
3435
# Local environment variables - used only in given function
3536
env:
3637
local: local

examples/container/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "ISC",
1111
"dependencies": {},
1212
"devDependencies": {
13-
"serverless-scaleway-functions": "^0.4.4"
13+
"serverless-scaleway-functions": "^0.4.5"
1414
},
1515
"description": ""
1616
}

examples/container/serverless.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ custom:
2626
# maxConcurrency: 50
2727
# timeout: 20000
2828
# port: 8080
29+
# httpOption: redirected
2930
# Local environment variables - used only in given function
3031
env:
3132
local: local

examples/go/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license": "ISC",
1010
"dependencies": {},
1111
"devDependencies": {
12-
"serverless-scaleway-functions": "^0.4.4"
12+
"serverless-scaleway-functions": "^0.4.5"
1313
},
1414
"description": ""
1515
}

examples/go113/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license": "ISC",
1010
"dependencies": {},
1111
"devDependencies": {
12-
"serverless-scaleway-functions": "^0.4.4"
12+
"serverless-scaleway-functions": "^0.4.5"
1313
},
1414
"description": ""
1515
}

examples/multiple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"license": "ISC",
1111
"dependencies": {},
1212
"devDependencies": {
13-
"serverless-scaleway-functions": "^0.4.4"
13+
"serverless-scaleway-functions": "^0.4.5"
1414
},
1515
"description": ""
1616
}

0 commit comments

Comments
 (0)