Difference between revisions of "PKI ACME Responder with PostgreSQL Database"

From Dogtag
Jump to: navigation, search
m (See Also)
m (Removing Database)
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
  
 
= Initializing Database =
 
= Initializing Database =
 +
 +
Use the provided [https://github.com/dogtagpki/pki/blob/master/base/acme/conf/database/postgresql/create.sql create.sql] to initialize the ACME database.
  
 
To initialize a local database:
 
To initialize a local database:
Line 34: Line 36:
 
     }
 
     }
 
}
 
}
 +
</pre>
 +
 +
= Removing Database =
 +
 +
Use the provided [https://github.com/dogtagpki/pki/blob/master/base/acme/conf/database/postgresql/drop.sql drop.sql] to remove the ACME database.
 +
 +
To remove a local database:
 +
 +
<pre>
 +
$ sudo -u postgres psql -f /usr/share/pki/acme/conf/database/postgresql/drop.sql
 +
</pre>
 +
 +
To remove a remote database:
 +
 +
<pre>
 +
$ psql <url> -f /usr/share/pki/acme/conf/database/postgresql/drop.sql
 
</pre>
 
</pre>
  

Latest revision as of 20:30, 14 January 2020

Installing JDBC Driver

$ dnf install postgresql-jdbc
$ cd /usr/share/pki/server/common/lib
$ ln -s /usr/share/java/postgresql-jdbc/postgresql.jar

Initializing Database

Use the provided create.sql to initialize the ACME database.

To initialize a local database:

$ sudo -u postgres psql -f /usr/share/pki/acme/conf/database/postgresql/create.sql

To initialize a remote database:

$ psql <url> -f /usr/share/pki/acme/conf/database/postgresql/create.sql

Configuring ACME Responder

The configuration will be stored in /etc/pki/pki-tomcat/acme/database.json, for example:

{
    "class": "org.dogtagpki.acme.database.PostgreSQLDatabase",
    "parameters": {
        "url": "jdbc:postgresql://localhost:5432/acme",
        "user": "acme",
        "password": "Secret.123"
    }
}

Removing Database

Use the provided drop.sql to remove the ACME database.

To remove a local database:

$ sudo -u postgres psql -f /usr/share/pki/acme/conf/database/postgresql/drop.sql

To remove a remote database:

$ psql <url> -f /usr/share/pki/acme/conf/database/postgresql/drop.sql

See Also