You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

angular-server-side-configuration

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-server-side-configuration - npm Package Compare versions

Comparing version

to
13.1.0

11

package.json
{
"name": "angular-server-side-configuration",
"version": "13.0.0",
"version": "13.1.0",
"description": "Configure an angular application on the server",

@@ -71,3 +71,10 @@ "repository": {

},
"sideEffects": false
"sideEffects": [
"./esm2020/ng-env/public_api.mjs",
"./esm2020/process/public_api.mjs",
"./fesm2015/angular-server-side-configuration-ng-env.mjs",
"./fesm2015/angular-server-side-configuration-process.mjs",
"./fesm2020/angular-server-side-configuration-ng-env.mjs",
"./fesm2020/angular-server-side-configuration-process.mjs"
]
}

@@ -108,3 +108,3 @@ # angular-server-side-configuration

#### NG_ENV.\* _Deprecated_
#### NG\_ENV.\* *Deprecated*

@@ -161,9 +161,52 @@ Import NG_ENV from `angular-server-side-configuration/ng-env`

Insert environment variables. Looks for an ngssc.json file inside the current or
given directory. Directory defaults to current working directory.
Usage: ngssc insert [options] [directory]
| Options | Description |
| ----------------- | --------------------------------------------------------------------------------- |
| `-r, --recursive` | Recursively searches for ngssc.json files and applies the contained configuration |
| `--dry` | Perform the insert without actually inserting the variables |
| Options | Description |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `--recursive, -r` | Recursively searches for ngssc.json files and applies the contained configuration. |
| `--nginx` | Applies default configuration for ngssc insert to work with nginx. Sets working directory to /usr/share/nginx/html/ and recursive to true. |
| `--dry` | Perform the insert without actually inserting the variables. |
#### ngssc substitute
Substitutes the variable \$\{NGSSC_CSP_HASH\} in files ending with ".template"
and copies the file while removing the ".template" extension.
\$\{NGSSC_CSP_HASH\} represents the CSP hash value of the IIFE generated/inserted by the
insert command, wrapped by single quotes.
By default looks for "\*.template" files in the current working directory. Specify another
directory to search for "\*.template" files via argument.
(e.g. `ngssc substitute /path/to/template/files`)
When applying the variable(s), the file is copied to the same directory without the
".template" extension with the substituion applied.
(e.g. `ngssc substitute`: /a/my.conf.template => /a/my.conf)
Use the "--out" flag to define a different output directory.
(e.g. `ngssc substitute --out=/b`: /a/my.conf.template => /b/my.conf)
Optionally supports substituting environment variables with the --include-env flag.
The format \$\{EXAMPLE\} must be used (\$EXAMPLE will not work). Additionally only
alphanumeric characters and \_ are allowed as variable names (e.g. \$\{EXAMPLE_KEY\}).
(e.g. `ngssc substitute --include-env`)
**ATTENTION**: Since the official nginx container image already provides a similar mechanism
with substitution, it is recommended **not** to use the `/etc/nginx/templates` directory.
Instead use the directory `/etc/nginx/ngssc-templates`.
Usage: ngssc substitute [options] [directory]
| Options | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--ngssc-path` | Path to the ngssc.json file or containing directory to be used for the generated IIFE. Supports glob. Defaults to [current working directory]/\*\*/ngssc.json. Throws if multiple ngssc.json with different variant or variables are found. |
| `--hash-algorithm, -a` | The hash algorithm to be used. Supports sha256, sha384 and sha512. Defaults to sha512. |
| `--out, -o` | The directory into which the updated files should be copied. |
| `--include-env, -e` | Substitute all variables in the format of \$\{VARIABLE_NAME\}. |
| `--nginx` | Applies default configuration for ngssc substitute to work with nginx. Sets ngssc-path to /usr/share/nginx/html/, template directory to /etc/nginx/ngssc-templates/ and out directory to /etc/nginx/conf.d/. |
| `--dry` | Perform the insert without actually inserting the variables |
##### Minimal Example

@@ -177,3 +220,3 @@

# Install ngssc binary
ADD https://github.com/kyubisation/angular-server-side-configuration/releases/download/v13.0.0/ngssc_64bit /usr/sbin/ngssc
ADD https://github.com/kyubisation/angular-server-side-configuration/releases/download/v13.1.0/ngssc_64bit /usr/sbin/ngssc
RUN chmod +x /usr/sbin/ngssc

@@ -194,2 +237,5 @@

ngssc insert /usr/share/nginx/html
# Substitute CSP variable (and optionally environment variables)
# See documentation above
#ngssc substitute --ngssc-path=/usr/share/nginx/html -o=/etc/nginx/conf.d/ /etc/nginx/ngssc-templates/
```

@@ -196,0 +242,0 @@

2

schematics/migration.json

@@ -15,3 +15,3 @@ {

"dockerfile": {
"version": "13.0.0",
"version": "13.1.0",
"description": "Updates the download url for ngssc",

@@ -18,0 +18,0 @@ "factory": "./ng-update/index#dockerfile"