Skip to content

Commit

Permalink
✨ (linkstack): Added a new role linkstack
Browse files Browse the repository at this point in the history
  • Loading branch information
theobori committed Jun 17, 2024
1 parent 04db94e commit 32fc089
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 12 deletions.
3 changes: 3 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
- role: monitoring
tags: monitoring

- role: linkstack
tags: linkstack

- role: vitalk.secure-ssh
tags: ssh
ssh_user: "{{ ansible_ssh_user }}"
Expand Down
2 changes: 1 addition & 1 deletion roles/calibre_web/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;

proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/etherpad/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ server {

location / {
include proxy_params;
proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/gitea/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ server {
include proxy_params;
proxy_set_header X-Real-IP $remote_addr;

proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
16 changes: 16 additions & 0 deletions roles/linkstack/files/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3.8"

services:
linkstack:
image: linkstackorg/linkstack
container_name: linkstack
hostname: linkstack
env_file: .env
ports:
- "127.0.0.1:8880:80"
restart: unless-stopped
volumes:
- linkstack:/htdocs

volumes:
linkstack:
18 changes: 18 additions & 0 deletions roles/linkstack/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- name: Include service role
ansible.builtin.include_role:
name: "service"
vars:
service_name: "linkstack"
service_fqdn: "links.{{ domain }}"
service_nginx_port: "8880"
service_certbot: true
service_nginx: true
service_tor: true
service_docker_compose: true
service_systemd_service: true

- name: Copy LinkStack environment file
ansible.builtin.template:
src: ".env.j2"
dest: "{{ base_dir }}/linkstack/.env"
mode: "0640"
3 changes: 3 additions & 0 deletions roles/linkstack/templates/.env.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
HTTP_SERVER_NAME: "links.{{ domain }}"
HTTPS_SERVER_NAME: "links.{{ domain }}"
SERVER_ADMIN: "{{ mailer_from }}"
22 changes: 22 additions & 0 deletions roles/linkstack/templates/nginx.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
server {
include listen-443;
server_name {{ server_name }};

include ssl_params;
ssl_certificate /etc/letsencrypt/live/{{ server_name }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ server_name }}/privkey.pem;

include header_params;

location / {
include proxy_params;

proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;

# Fixes Mixed Content errors.
add_header 'Content-Security-Policy' 'upgrade-insecure-requests';

proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/nextcloud/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ server {

location / {
include proxy_params;
proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/personal_services/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ server {
include proxy_params;
add_header Content-Security-Policy "default-src 'none'; manifest-src 'self'; font-src 'self' https:; style-src 'self' 'unsafe-hashes' 'sha256-rV9I2X3m+USubUYRTavlYrp7o/qO7hN5BS/JKHv32hY=' 'nonce-$ssl_session_id'; media-src 'self'; frame-ancestors 'self'; base-uri 'none'; form-action 'none'; style-src-elem 'self' 'unsafe-inline' https:; img-src 'self' https:; script-src 'self'; script-src-elem 'self' 'nonce-$ssl_session_id' https:; connect-src 'self'";

proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/personal_website/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ server {

location / {
include proxy_params;
proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/private_bin/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ server {

location / {
include proxy_params;
proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/proxitok/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ server {

location / {
include proxy_params;
proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/searxng/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ server {

location / {
include proxy_params;
proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}

2 changes: 1 addition & 1 deletion roles/ssp/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;

proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/tt_rss/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ server {
include proxy_params;
proxy_set_header X-Forwarded-Proto $scheme;

proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}
2 changes: 1 addition & 1 deletion roles/uptime_kuma/templates/nginx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ server {

location / {
include proxy_params;
proxy_pass http://localhost:{{ server_port }}/;
proxy_pass http://127.0.0.1:{{ server_port }}/;
}
}

0 comments on commit 32fc089

Please sign in to comment.