Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Caddy support #6

Merged
merged 1 commit into from
Jun 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
local.taiga.io {

# backend admin and api
@taiga-back path /admin* /api*
handle @taiga-back {
reverse_proxy 127.0.0.1:8001
}

# events
handle /events* {
reverse_proxy 127.0.0.1:8888
}

# static and frontend
handle {
root /static/* /home/taiga/taiga-back
root * /home/taiga/taiga-front-dist/dist

try_files {path} {path}/ /index.html
file_server
}

# unprotected section
handle /media/exports/* {
header Content-disposition "attachment"
root * /home/taiga/taiga-back
file_server
}

# protected section
handle_path /media/* {
reverse_proxy localhost:8003 {
@accel header X-Accel-Redirect *
handle_response @accel {
root * /home/taiga/taiga-back
header Content-Disposition "attachment"
rewrite {http.reverse_proxy.header.X-Accel-Redirect}
file_server
}
}
}

# TLS, log, etc
# Configure your TLS following the best practices inside your company
}
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ doc:
asciidoctor -T custom-html5 -o dist/integrations-slack.html integrations-slack.adoc
asciidoctor -T custom-html5 -o dist/backup-and-restore.html backup-and-restore.adoc
cp -r assets/* dist || exit 1
cp Caddyfile dist || exit 1
pdf:
asciidoctor -a allow-uri-read -r asciidoctor-pdf -b pdf -o dist/pdfs/index.pdf index.adoc
asciidoctor -a allow-uri-read -r asciidoctor-pdf -b pdf -o dist/pdfs/setup-production.pdf setup-production.adoc
25 changes: 23 additions & 2 deletions setup-production.adoc
Original file line number Diff line number Diff line change
@@ -733,8 +733,8 @@ cp ~/taiga-protected/env.sample ~/taiga-protected/.env

The `SECRET_KEY` value in `.env` must be the same as the `SECRET_KEY` in `~/taiga-back/settings/config.py`.

[[start-and-expose]]
=== Start and Expose Taiga
[[start-taiga]]
=== Start Taiga

Now it's time to create the different systemd services to serve different modules of Taiga.

@@ -883,6 +883,11 @@ sudo systemctl enable taiga-protected
sudo systemctl status taiga-protected
----

[[expose-taiga-nginx]]
=== Expose Taiga with NGINX

The recommended way to serve Taiga is to use NGINX proxy server.

[[nginx]]
.Remove the default NGINX config file to avoid collision with Taiga:
[source,bash]
@@ -1008,6 +1013,22 @@ sudo systemctl restart 'taiga*'

**Now you should have the service up and running on: `https://example.com/`**

[[expose-taiga-other]]
=== Other methods to expose Taiga

.Caddy server
It's possible to serve Taiga with Caddy as well, following the next guides:

- install caddy >= 2.4.1
- create a symlink from `media` to `_protected`
[source,bash]
----
cd ~/taiga-back
ln -s media/ _protected
----
- use a Caddyfile based on link:Caddyfile[this]


[[extend-taiga]]
=== Extend Taiga