Skip to content
Snippets Groups Projects

Update README.md with local environment setup

Open scott_earnest requested to merge issue/c2pa_sign-3499975:3499975-readme-updates-for into 1.x
1 file
+ 74
0
Compare changes
  • Side-by-side
  • Inline
+ 74
0
@@ -27,6 +27,80 @@ Ensure that the c2patool binary is on the system
@@ -27,6 +27,80 @@ Ensure that the c2patool binary is on the system
- Enter in the path to your certificates directory, if the certificate and key are in the $C2PA_SIGN_CERT and $C2PA_PRIVATE_KEY environment variables they will be automatically detected.
- Enter in the path to your certificates directory, if the certificate and key are in the $C2PA_SIGN_CERT and $C2PA_PRIVATE_KEY environment variables they will be automatically detected.
- Enter in the path to the c2patool binary (if it is located in the $PATH it will be automatically detected).
- Enter in the path to the c2patool binary (if it is located in the $PATH it will be automatically detected).
 
## LOCAL ENVIRONMENT SETUP
 
 
You can check the status of the "c2patool" and the "C2PA Signing Certificate"
 
from the Drupal Status report. If either of these show a warning or error you
 
may need to do some additional setup/configuration.
 
 
### c2patool
 
 
The `c2patool` will need to be executable from inside your local environment.
 
Inside your container configuration, you will want to make sure that the
 
following 2 commands are run to install `rust` then the `c2patool`.
 
```shell
 
/usr/bin/curl https://sh.rustup.rs -sSf | sh -s -- -y
 
${HOME}/.cargo/bin/cargo install c2patool --version=^0.9.1 --root=/usr/local --bin
 
```
 
If your container has `c2patool` installed successfully, you will see the
 
version in the status report, similar to:
 
---
 
***c2patool***
 
- /usr/local/bin/c2patool(0.9.12)
 
- Executable found at /usr/local/bin/c2patool (0.9.12)
 
---
 
 
### C2PA Signing Certificate
 
You can download the `es256` certificate chain and key from the:
 
[c2patool sample folder in GitHub](https://github.com/contentauth/c2patool/tree/main/sample)
 
 
Save these to a folder that you can access inside your container, for example
 
inside "sites/default/files". The files need to have the same name, one with
 
the ".key" extension and one with the ".pem". This constitutes the key "pair".
 
 
After saving the files, you would have a file structure similar to:
 
```text
 
├── sites
 
├── default
 
├── files
 
├── shared
 
├── signing_certs
 
├── es256.key
 
└── es256.pem
 
```
 
Then inside of your `settings.local.php` file, you will define the config
 
override:
 
```php
 
$config['c2pa_sign.settings']['certificate_file_directory'] = 'sites/default/files/shared/signing_certs/';
 
```
 
(note this needs a trailing slash)
 
 
Then inside of your status report you should see information similar to:
 
 
---
 
***C2PA Signing Certificate***
 
 
sites/default/files/shared/signing_certs/es256.pem\
 
CERTIFICATE DETAILS\
 
Certificate File: sites/default/files/shared/signing_certs/es256.pem\
 
Certificate usage count: 0\
 
Valid Not Before: Fri, 10 Jun 2022 18:46:40 +0000\
 
Valid Not After: Mon, 26 Aug 2030 18:46:40 +0000\
 
Signing Algorithm: ecdsa-with-SHA256
 
- Issuer ...
 
- Subject ...
 
---
 
 
### c2pa_sign_aws_kms
 
Inside of a development environment, you will most likely NOT have AWS signing
 
keys, so you will see an error on the "Content Credentials" screen, similar to:
 
```text
 
Error connecting to AWS KMS to get available keys: Error executing "ListAliases" on "https://kms.us-gov-west-1.amazonaws.com";
 
```
 
You can disable the `c2pa_sign_aws_kms` locally to avoid this message, but the
 
c2patool should function correctly despite the message. If you disable this
 
module, please make sure not to let that config get upstream.
 
## MAINTAINERS
## MAINTAINERS
Current maintainers for Drupal 10:
Current maintainers for Drupal 10:
Loading