Skip to content

Commit 08fae77

Browse files
committed
feat: add Personal Site
1 parent eaca744 commit 08fae77

File tree

9 files changed

+56
-3
lines changed

9 files changed

+56
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ _This [Ansible](https://www.ansible.com) configuration automates the setup of a
3838
- **AdGuard Home** for ad-blocking and privacy protection
3939
- **Beaver Habits Tracker** for habit tracking
4040
- **Dotfiles** for a standardized environment
41+
- **Personal Site** for hosting your personal website
4142

4243
## ⚙️ Requirements
4344

@@ -130,7 +131,7 @@ Please set your timezone id (TZ identifier) with `TIMEZONE` (check this [Wikiped
130131
To enable secure SSH access, copy your public key to the Raspberry Pi:
131132

132133
```sh
133-
ssh-copy-id nhan@raspberrypi.local
134+
ssh-copy-id nhan@npham.de
134135
```
135136

136137
### 2. Update SSH Configuration

inventory.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[raspberrypi]
2-
pi.npham.de ansible_user=nhan ansible_become=true
2+
npham.de ansible_user=nhan ansible_become=true

playbook.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@
4444
- ente-auth
4545
- adguard-home
4646
- pivpn
47+
- personal-site

roles/caddy/files/Caddyfile.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
}
1111
}
1212

13+
{{ PERSONAL_SITE_DOMAIN }} {
14+
reverse_proxy localhost:{{ PERSONAL_SITE_PORT }}
15+
}
16+
1317
https://{{ VAULTWARDEN_DOMAIN }} {
1418
# This setting may have compatibility issues with some browsers
1519
# (e.g., attachment downloading on Firefox). Try disabling this

roles/glance/files/config/server.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@
145145
hide: true
146146
nextcloud-aio-watchtower:
147147
hide: true
148+
personal-site:
149+
name: Personal Site
150+
icon: https://npham.de/favicon.ico
151+
url: https://npham.de
152+
description: Personal Site
148153
vaultwarden:
149154
name: Vaultwarden
150155
icon: si:vaultwarden

roles/personal-site/files/.env.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GITHUB_PERSONAL_ACCESS_TOKEN={{ PERSONAL_SITE_GITHUB_API_TOKEN }}
2+
NOTION_SECRET={{ PERSONAL_SITE_NOTION_SECRET }}
3+
NOTION_DATABASE_ID={{ PERSONAL_SITE_NOTION_DB_ID }}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
web:
3+
build: .
4+
container_name: personal-site
5+
ports:
6+
- "127.0.0.1:{{ PERSONAL_SITE_PORT }}:3000"
7+
env_file: .env

roles/personal-site/tasks/main.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
- name: Set up personal site
3+
vars:
4+
personal_site_dir: "/mnt/data/personal-site"
5+
6+
block:
7+
- name: Download personal site
8+
ansible.builtin.git:
9+
dest: "{{ personal_site_dir }}"
10+
repo: "https://github.com/Nitestack/personal-site.git"
11+
12+
- name: Copy docker-compose.yml to personal site directory
13+
ansible.builtin.template:
14+
src: "../files/docker-compose.yml.j2"
15+
dest: "{{ personal_site_dir }}/docker-compose.yml"
16+
17+
- name: Copy .env to personal site directory
18+
ansible.builtin.template:
19+
src: "../files/.env.j2"
20+
dest: "{{ personal_site_dir }}/.env"
21+
22+
- name: Start Docker Compose
23+
community.docker.docker_compose_v2:
24+
project_src: "{{ personal_site_dir }}"
25+
build: always

secrets.example.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BEAVERHABITS_DOMAIN: "habits.example.com"
1010
BEAVERHABITS_PORT: 8085
1111

1212
# Cloudflare DDNS Updater
13-
CLOUDFLARE_DOMAINS: "pi.example.com"
13+
CLOUDFLARE_DOMAINS: "example.com"
1414
CLOUDFLARE_API_TOKEN: "" # `Edit zone DNS` permissions
1515

1616
# Ente Auth
@@ -38,6 +38,13 @@ NEXTCLOUD_DOMAIN: "cloud.example.com"
3838
NEXTCLOUD_PORT: 11000
3939
NEXTCLOUD_AIO_PORT: 8080
4040

41+
# Personal Site
42+
PERSONAL_SITE_DOMAIN: "example.com"
43+
PERSONAL_SITE_PORT: 3001
44+
PERSONAL_SITE_GITHUB_API_TOKEN: ""
45+
PERSONAL_SITE_NOTION_SECRET: ""
46+
PERSONAL_SITE_NOTION_DB_ID: ""
47+
4148
# PiVPN
4249
PIVPN_DOMAIN: "vpn.example.com"
4350
PIVPN_PORT: 51820

0 commit comments

Comments
 (0)