template.yaml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. ---
  2. kind: compose
  3. metadata:
  4. icon:
  5. provider: selfh
  6. id: pangolin
  7. name: Pangolin
  8. description: 'Self-hosted reverse proxy server that securely exposes private resources on distributed networks through
  9. encrypted WireGuard tunnels. Pangolin enables access from anywhere without opening ports, using a custom
  10. user-space WireGuard client (Newt) for secure connectivity. Features include automatic tunnel management,
  11. integrated CrowdSec security, and support for both PostgreSQL and SQLite databases.
  12. ## References
  13. * **Project:** https://github.com/fosrl/pangolin
  14. * **Documentation:** https://github.com/fosrl/pangolin/blob/main/README.md
  15. * **Docker Hub:** https://hub.docker.com/r/fosrl/pangolin
  16. '
  17. version: latest
  18. author: Christian Lempa
  19. date: '2025-11-13'
  20. tags:
  21. - traefik
  22. - swarm
  23. - proxy
  24. - wireguard
  25. draft: true
  26. next_steps: '### 1. Configure Database
  27. {% if postgres_enabled -%}
  28. Make sure PostgreSQL is running and accessible at:
  29. * Connection string: {{ postgres_connection_string }}
  30. {% else -%}
  31. Pangolin will use SQLite database stored in the data volume.
  32. {% endif -%}
  33. ### 2. Deploy the Service
  34. {% if swarm_enabled -%}
  35. Deploy to Docker Swarm:
  36. ```bash
  37. docker stack deploy -c compose.yaml pangolin
  38. ```
  39. {% else -%}
  40. Start Pangolin using Docker Compose:
  41. ```bash
  42. docker compose up -d
  43. ```
  44. {% endif -%}
  45. ### 3. Access the Web Interface
  46. {% if traefik_enabled -%}
  47. * Navigate to: **https://{{ traefik_host }}.{{ traefik_domain }}**
  48. {% else -%}
  49. * Navigate to: **http://localhost:{{ ports_http }}**
  50. {% endif -%}
  51. ### 4. Configure WireGuard Clients
  52. * Use the Pangolin web interface to create and manage WireGuard tunnels
  53. * Deploy Newt client on remote machines to establish secure connections
  54. '
  55. schema: '1.2'
  56. spec:
  57. general:
  58. vars:
  59. service_name:
  60. default: pangolin
  61. container_name:
  62. default: pangolin
  63. container_hostname:
  64. default: pangolin
  65. restart_policy:
  66. type: enum
  67. options:
  68. - unless-stopped
  69. - always
  70. - on-failure
  71. - 'no'
  72. default: unless-stopped
  73. required: true
  74. traefik:
  75. vars:
  76. traefik_host:
  77. default: pangolin
  78. traefik_network:
  79. default: traefik
  80. type: str
  81. required: true
  82. traefik_domain:
  83. default: home.arpa
  84. type: str
  85. required: true
  86. traefik_enabled:
  87. type: bool
  88. default: false
  89. description: Enable Traefik integration
  90. traefik_tls:
  91. vars:
  92. traefik_tls_certresolver:
  93. type: str
  94. default: cloudflare
  95. required: true
  96. traefik_tls_enabled:
  97. type: bool
  98. default: false
  99. description: Enable Traefik TLS
  100. network:
  101. vars:
  102. network_name:
  103. default: pangolin_network
  104. network_macvlan_ipv4_address:
  105. type: str
  106. default: 192.168.1.253
  107. needs:
  108. - network_mode=macvlan
  109. required: true
  110. network_macvlan_parent_interface:
  111. type: str
  112. default: eth0
  113. needs:
  114. - network_mode=macvlan
  115. required: true
  116. network_macvlan_subnet:
  117. type: str
  118. default: 192.168.1.0/24
  119. needs:
  120. - network_mode=macvlan
  121. required: true
  122. network_macvlan_gateway:
  123. type: str
  124. default: 192.168.1.1
  125. needs:
  126. - network_mode=macvlan
  127. required: true
  128. network_external:
  129. type: bool
  130. default: false
  131. description: Whether the network is external
  132. network_mode:
  133. type: str
  134. default: bridge
  135. description: The network mode for the container
  136. ports:
  137. vars:
  138. ports_http:
  139. description: External HTTP port (web interface)
  140. type: int
  141. default: 8080
  142. needs:
  143. - traefik_enabled=false
  144. - network_mode=bridge
  145. volume:
  146. vars:
  147. volume_mount_path:
  148. default: /mnt/storage/pangolin
  149. volume_nfs_server:
  150. type: str
  151. default: 192.168.1.1
  152. needs:
  153. - volume_mode=nfs
  154. required: true
  155. volume_nfs_path:
  156. type: str
  157. default: /export
  158. needs:
  159. - volume_mode=nfs
  160. required: true
  161. volume_nfs_options:
  162. type: str
  163. default: rw,nolock,soft
  164. needs:
  165. - volume_mode=nfs
  166. required: true
  167. volume_mode:
  168. type: enum
  169. options:
  170. - local
  171. - mount
  172. - nfs
  173. default: local
  174. description: The volume mode
  175. resources:
  176. vars:
  177. resources_enabled:
  178. type: bool
  179. default: false
  180. resources_cpu_limit:
  181. type: str
  182. default: 1.0
  183. required: true
  184. resources_cpu_reservation:
  185. type: str
  186. default: 0.25
  187. needs:
  188. - swarm_enabled=true
  189. required: true
  190. resources_memory_limit:
  191. type: str
  192. default: 1G
  193. required: true
  194. resources_memory_reservation:
  195. type: str
  196. default: 512M
  197. needs:
  198. - swarm_enabled=true
  199. required: true
  200. postgres:
  201. title: PostgreSQL Configuration
  202. toggle: postgres_enabled
  203. needs: null
  204. vars:
  205. postgres_enabled:
  206. type: bool
  207. default: false
  208. description: Use PostgreSQL database (SQLite is default)
  209. postgres_connection_string:
  210. type: str
  211. default: postgresql://postgres:postgres@localhost:5432
  212. description: PostgreSQL connection string
  213. needs: postgres_enabled=true
  214. environment:
  215. title: Environment Variables
  216. toggle: environment_enabled
  217. needs: null
  218. vars:
  219. environment_enabled:
  220. type: bool
  221. default: false
  222. description: Configure additional environment variables
  223. environment_crowdsec_enabled:
  224. type: bool
  225. default: false
  226. description: Enable CrowdSec integration
  227. needs: environment_enabled=true
  228. environment_log_level:
  229. type: enum
  230. default: info
  231. options:
  232. - debug
  233. - info
  234. - warn
  235. - error
  236. description: Log level
  237. needs: environment_enabled=true
  238. swarm:
  239. vars:
  240. swarm_enabled:
  241. type: bool
  242. default: false
  243. description: Enable Docker Swarm mode
  244. swarm_placement_host:
  245. type: str
  246. default: ''
  247. description: The placement host
  248. swarm_placement_mode:
  249. type: str
  250. default: replicated
  251. description: The placement mode
  252. swarm_replicas:
  253. type: int
  254. default: 1
  255. description: The number of replicas