8000 Add pgsodium extension to supabase/postgres ansible build scripts (#105) · chazgorman/postgres-1@e695e16 · GitHub
[go: up one dir, main page]

Skip to content

Commit e695e16

Browse files
authored
Add pgsodium extension to supabase/postgres ansible build scripts (supabase#105)
* Add pgsodium tasks to ansible playbook. * fix up release checksums * update README with pgsodium description.
1 parent 46216b5 commit e695e16

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Unmodified Postgres with some useful plugins. Our goal with this repo is not to
2626
| [plv8](https://github.com/plv8/plv8) | Write in Javascript functions in Postgres. |
2727
| [pg_plan_filter](https://github.com/pgexperts/pg_plan_filter) | Only allow statements that fulfill set criteria to be executed. |
2828
| [pg_net](https://github.com/supabase/pg_net) | Expose the SQL interface for async networking. |
29+
| [pg_sodium](https://github.com/michelp/pgsodium) | Modern encryption API using libsodium. |
2930

3031
Can't find your favorite extension? Suggest for it to be added into future versions [here](https://github.com/supabase/supabase/discussions/679)!
3132

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# libsodium and pgsodium
2+
- name: libsodium - download libsodium
3+
get_url:
4+
url: "https://download.libsodium.org/libsodium/releases/libsodium-{{ libsodium_release }}.tar.gz"
5+
dest: /tmp/libsodium-{{ libsodium_release }}.tar.gz
6+
checksum: "{{ libsodium_release_checksum }}"
7+
8+
- name: libsodium - unpack archive
9+
unarchive:
10+
remote_src: yes
11+
src: /tmp/libsodium-{{ libsodium_release }}.tar.gz
12+
dest: /tmp
13+
become: yes
14+
15+
- name: libsodium - configure
16+
shell:
17+
cmd: ./configure
18+
chdir: /tmp/libsodium-{{ libsodium_release }}
19+
become: yes
20+
21+
- name: libsodium - build
22+
make:
23+
chdir: /tmp/libsodium-{{ libsodium_release }}
24+
become: yes
25+
26+
- name: libsodium - install
27+
make:
28+
chdir: /tmp/libsodium-{{ libsodium_release }}
29+
target: install
30+
become: yes
31+
32+
- name: pgsodium - download pgsodium
33+
get_url:
34+
url: "https://github.com/michelp/pgsodium/archive/refs/tags/v1.3.0.tar.gz"
35+
dest: /tmp/pgsodium-{{ pgsodium_release }}.tar.gz
36+
checksum: "{{ pgsodium_release_checksum }}"
37+
38+
- name: pgsodium - unpack archive
39+
unarchive:
40+
remote_src: yes
41+
src: /tmp/pgsodium-{{ pgsodium_release }}.tar.gz
42+
dest: /tmp
43+
become: yes
44+
45+
- name: pgsodium - build
46+
make:
47+
chdir: /tmp/pgsodium-{{ pgsodium_release }}
48+
become: yes
49+
50+
- name: pgsodium - install
51+
make:
52+
chdir: /tmp/pgsodium-{{ pgsodium_release }}
53+
target: install
54+
become: yes
55+

ansible/tasks/setup-extensions.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@
4141
import_tasks: tasks/postgres-extensions/14-pg_plan_filter.yml
4242

4343
- name: Install pg_net
44-
import_tasks: tasks/postgres-extensions/15-pg_net.yml
44+
import_tasks: tasks/postgres-extensions/15-pg_net.yml
45+
46+
- name: Install pgsodium
47+
import_tasks: tasks/postgres-extensions/16-pgsodium.yml

ansible/vars.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,9 @@ pg_net_release_checksum: sha1:22c40ae9039778a6bf7344e4357640edf8620a7e
8383

8484
vector_x86_deb: 'https://packages.timber.io/vector/0.17.0/vector-0.17.0-amd64.deb'
8585
vector_arm_deb: 'https://packages.timber.io/vector/0.17.0/vector-0.17.0-arm64.deb'
86+
87+
libsodium_release: "1.0.18"
88+
libsodium_release_checksum: sha1:795b73e3f92a362fabee238a71735579bf46bb97
89+
90+
pgsodium_release: "1.3.0"
91+
pgsodium_release_checksum: sha1:d7b00ce0437b697a8a0076eeb80b17b7fef80fc2

0 commit comments

Comments
 (0)
0