Skip to content

Commit

Permalink
amend! draft!: feat: host outline with Docker compose
Browse files Browse the repository at this point in the history
draft!: feat: host outline with Docker compose
  • Loading branch information
SilasPeters committed Jul 20, 2024
1 parent e822e57 commit a45cec0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
1 change: 1 addition & 0 deletions ansible/group_vars/production/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ secret_outline:
s3_secret_access_key: "{{ vault_secret_outline.s3_secret_access_key }}"
s3_bucket: "outline-wiki-prod"
mailgun_password: "{{ vault_secret_outline.mailgun_password }}"
postgresql_password: "{{ vault_secret_outline.postgresql_password }}"

secret_koala_manual:
password: "{{ vault_secret_koala_manual.password }}"
Expand Down
1 change: 1 addition & 0 deletions ansible/group_vars/staging/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ secret_outline:
s3_secret_access_key: "{{ vault_secret_outline.s3_secret_access_key }}"
s3_bucket: "outline-wiki-staging"
mailgun_password: "{{ vault_secret_outline.mailgun_password }}"
postgresql_password: "{{ vault_secret_outline.postgresql_password }}"

secret_koala_manual:
password: "{{ vault_secret_koala_manual.password }}"
Expand Down
9 changes: 0 additions & 9 deletions ansible/roles/outline/handlers/main.yml

This file was deleted.

6 changes: 1 addition & 5 deletions ansible/roles/outline/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- name: "Ensure Postgres role exists"
community.postgresql.postgresql_user:
name: "outline"
password: "{{ secret_outline.postgresql_password }}" # Sadly seems required to make authentication over localhost work, for peer authentication fails somehow
state: "present"

- name: "Ensure database exists"
Expand Down Expand Up @@ -57,8 +58,3 @@
dest: "/etc/nginx/sites-enabled/outline.conf"
notify: "reload nginx"

# TODO test creating and restoring backup
# TODO is het erg dat outline:outline in templates staat?
# TODO AWS_S3 accelration URL?
# TODO FILE_STORAGE niet local maar s3?
# TODO compose-up.yml moet misschien andere naam krijgen?
2 changes: 1 addition & 1 deletion ansible/roles/outline/templates/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
env_file: ./docker.env
# ports:
# - "4568:3000"
network_mode: host
network_mode: host # TODO replace this
volumes:
- storage-data:/var/lib/outline/data
# depends_on:
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/outline/templates/docker.env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ UTILS_SECRET={{ secret_outline.utils_key }}

# For production point these at your databases, in development the default
# should work out of the box.
DATABASE_URL=postgres://outline:outline@localhost/outline?dbname=outline #?dbname=outline&user=outline&host=/run/postgresql
DATABASE_URL=postgres://outline:{{ secret_outline.postgresql_password }}@localhost/outline
DATABASE_CONNECTION_POOL_MIN=
DATABASE_CONNECTION_POOL_MAX=
# Uncomment this to disable SSL for connecting to Postgres
Expand Down Expand Up @@ -61,7 +61,7 @@ FILE_STORAGE_WORKSPACE_IMPORT_MAX_SIZE=
AWS_ACCESS_KEY_ID={{ secret_outline.s3_access_key_id }}
AWS_SECRET_ACCESS_KEY={{ secret_outline.s3_secret_access_key }}
AWS_REGION=eu-west-1
#AWS_S3_ACCELERATE_URL=
#AWS_S3_ACCELERATE_URL= (this costs money, bleh)
AWS_S3_UPLOAD_BUCKET_URL=https://{{ secret_outline.s3_bucket }}.s3.eu-west-1.amazonaws.com
AWS_S3_UPLOAD_BUCKET_NAME={{ secret_outline.s3_bucket }}
AWS_S3_FORCE_PATH_STYLE=true
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/outline/templates/outline.conf.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ~^(compendium|stickypedia|wiki)\.{{ canonical_hostname }};
server_name ~^(compendium|stickypedia|wiki|stickywiki)\.{{ canonical_hostname }};

ssl_certificate /etc/letsencrypt/live/compendium.{{ canonical_hostname }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/compendium.{{ canonical_hostname }}/privkey.pem;
Expand Down

0 comments on commit a45cec0

Please sign in to comment.