Skip to content

Commit c5021f9

Browse files
authored
Merge pull request #9 from resizes/sftpgo
feat: added missing info
2 parents 9817f0e + 894c43d commit c5021f9

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

blog/2025-02-17-sftp/index.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,57 @@ With this, a folder with the Helm Chart dependencies called `charts` and a `Char
240240

241241
A folder called **templates** is also needed. There will be created both `externalsecret.yaml` and `secretstore.yaml`. This will allow us to manage the secrets we have previously stored in our **AWS Secret Manager**.
242242

243+
244+
## postgresql
245+
It's necessary to configure our postgres. To do so, access to the Postgres database is done through the `sftpgo-postgresql` secret.
246+
247+
<br>
248+
249+
```sh
250+
kubectl exec -it sftpgo-postgresql-0 -- psql -U postgres
251+
```
252+
</br>
253+
254+
Once inside, write the configuration needed, in this case it is:
255+
256+
<br>
257+
258+
```sh
259+
CREATE USER "sftpgo" WITH ENCRYPTED PASSWORD 'sftpgo_pg_pwd';
260+
CREATE DATABASE "sftpgo.db";
261+
GRANT ALL PRIVILEGES ON DATABASE "sftpgo.db" TO "sftpgo";
262+
CREATE TABLE schema_version (
263+
version INT NOT NULL
264+
);
265+
GRANT ALL PRIVILEGES ON SCHEMA public TO sftpgo;
266+
SELECT grantee, privilege_type
267+
FROM information_schema.role_table_grants
268+
WHERE table_schema = 'public';
269+
ALTER SCHEMA public OWNER TO sftpgo;
270+
exit
271+
```
272+
273+
</br>
274+
275+
Subsequently,enter this time in the sftpgo specific database.
276+
277+
<br>
278+
279+
```sh
280+
kubectl exec -it sftpgo-postgresql-0 -- psql -U postgres -d sftpgo.db
281+
GRANT ALL PRIVILEGES ON DATABASE "sftpgo.db" TO sftpgo;
282+
GRANT USAGE, CREATE ON SCHEMA public TO sftpgo;
283+
ALTER SCHEMA public OWNER TO sftpgo;
284+
exit
285+
```
286+
287+
</br>
288+
289+
With this we would already have the necessary configuration inside postgres.
290+
> **Remember**: Each time the password and user are changed in the secret manager, we must (in addition to killing it in argocd) perform the above steps again inside postgres.
291+
292+
<br>
293+
243294
### secretstore.yaml
244295

245296
The secret store is necessary to be able to manage our secrets. Its code would look something like the following:

0 commit comments

Comments
 (0)