diff --git a/README.md b/README.md index 421f25e..41b526e 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,47 @@ -# {{Service}} with Tailscale Integration +# SearchXNG with Tailscale Integration -![{{Service}} with Tailscale](https://damconsulting.llc/images/logo_yellow.svg "{{Service}}") +![SearchXNG with Tailscale](https://raw.githubusercontent.com/searxng/searxng/master/client/simple/src/brand/searxng.svg "SearchXNG") -This project sets up a {{Service}} instance with Tailscale VPN integration using Docker Compose. It creates a secure, private network connection for your {{Service}} instance using Tailscale. +This project sets up a SearchXNG instance with Tailscale VPN integration using Docker Compose. It creates a secure, private network connection for your SearchXNG instance using Tailscale. ## Prerequisites - Docker and Docker Compose installed on your system - A Tailscale account and auth key (get one from https://login.tailscale.com/admin/authkeys) +- Tailscale SSL/TLS enabled (toggled in tailscale admin page) - Basic understanding of Docker and networking concepts ## Project Structure ``` -ts-{{service}}/ +ts-searchxng/ ├── docker-compose.yml ├── tailscale/ │ ├── tailscale-data/ # Persistent Tailscale state │ └── config/ # Tailscale configuration files -└── {{service}}/ - └── config/ # {{Service}} configuration files +└── searchxng/ + └── config/ # SearchXNG configuration files ``` ## Setup Instructions 1. **Clone the Repository** ```bash - git clone https://gitea.damconsulting.llc/DAM/ts-{{service}} - cd ts-{{service}} + git clone https://gitea.damconsulting.llc/DAM/ts-searchxng + cd ts-searchxng ``` 2. Create Required Directories ```bash mkdir -p tailscale/tailscale-data + mkdir -p searchxng ``` 3. Configure Tailscale - Replace `{{YOUR_TAILSCALE_AUTHKEY}}` in the docker-compose.yml with your actual Tailscale auth key - Optionally, update the file in `tailscale/config/serve.json` if you need specific Tailscale serve configurations - CAUTION: Changing `"${TS_CERT_DOMAIN}:443": false` to `true` will expose the service to the internet -4. Configure {{Service}} - - See the [documentation]({{service_docs}}) for configuration options +4. Configure SearchXNG + - Replace `{{YOUR_TAILNET_DOMAIN}}` in the docker-compose.yml with your actual Tailscale domain name + - See the [documentation](https://docs.searxng.org/admin/settings/index.html) for configuration options 5. Start the Services ```bash @@ -48,30 +51,30 @@ ts-{{service}}/ 6. Wait for Certificate to propagate [~2m] 7. Login - - After starting the services your service should be available via tailnet at https://{{service}}.{{YOUR_TAILNET_DOMAIN}}.ts.net ie https://{{service}}.tail12345.ts.net/ + - After starting the services your service should be available via tailnet at https://searchxng.{{YOUR_TAILNET_DOMAIN}}.ts.net ie https://searchxng.tail12345.ts.net/ ## Services -### {{service}}-ts (Tailscale) +### searchxng-ts (Tailscale) - Runs Tailscale VPN client - Image: tailscale/tailscale:latest -- Container name: {{service}}-ts -- Hostname: {{service}} +- Container name: searchxng-ts +- Hostname: searchxng - Requires NET_ADMIN and SYS_MODULE capabilities - Persists state in ./tailscale/tailscale-data - Uses configuration from ./tailscale/config -### {{service}} +### searchxng -- Depends on {{service}}-ts service +- Depends on searchxng-ts service ## Usage -- After starting the services your service should be available via tailnet at `https://{{service}}.{{YOUR_TAILNET_DOMAIN}}.ts.net` ie `https://{{service}}.tail12345.ts.net/` +- After starting the services your service should be available via tailnet at `https://searchxng.{{YOUR_TAILNET_DOMAIN}}.ts.net` ie `https://searchxng.tail12345.ts.net/` - To manually get the Tailscale IP/hostname of your container: ```bash - docker logs {{service}}-ts + docker logs searchxng-ts ``` Look for the Tailscale IP address in the logs. @@ -80,7 +83,7 @@ ts-{{service}}/ - Uncomment and adjust the ports mapping if you need direct access (without Tailscale): ```yaml ports: - - 3000:3000 + - 8080:8080 ``` - Stopping the Services ```bash @@ -90,19 +93,18 @@ ts-{{service}}/ ## Troubleshooting - Check container logs: ```bash - docker logs {{service}}-ts - docker logs {{service}} + docker logs searchxng-ts + docker logs searchxng ``` - Ensure your Tailscale auth key is valid and not expired - Verify the configuration files have proper permissions - Make sure required directories exist before starting ## Notes -- The {{Service}} service uses the Tailscale service's network stack via `network_mode: service:{{service}}-ts` +- The SearchXNG service uses the Tailscale service's network stack via `network_mode: service:searchxng-ts` - Direct port mapping is disabled by default as Tailscale handles the networking - Services restart automatically unless explicitly stopped - For more information: - Tailscale documentation: https://tailscale.com/kb/ - - {{Service}} [documentation]({{service_docs}}) - - {{Service}} [repository]({{service_repo}}) - - {{Service}} [linuxserve.io]({{service_lcsr}}) \ No newline at end of file + - SearchXNG [documentation](https://docs.searxng.org/admin/settings/index.html) + - SearchXNG [repository](https://github.com/searxng/searxng) \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 72aa767..f403b61 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ services: - {{service}}-ts: + searchxng-ts: image: tailscale/tailscale:latest - hostname: {{service}} - container_name: {{service}}-ts + hostname: searchxng + container_name: searchxng-ts environment: - - TS_AUTHKEY={{YOUR_TAILSCALE_AUTHKEY}} + - TS_AUTHKEY={{YOUR_TAILSCALE_AUTHKEY}} # <------- Replace with your Tailscale auth key - TS_STATE_DIR=/var/lib/tailscale - TS_SERVE_CONFIG=/config/serve.json volumes: @@ -15,7 +15,17 @@ services: - net_admin - sys_module restart: unless-stopped - {{service-compose}} - network_mode: service:{{service}}-ts + searxng: + image: searxng/searxng + container_name: searxng + # ports: + # - "${PORT}:8080" + volumes: + - ./searxng:/etc/searxng + environment: + - BASE_URL=https://searchxng.{{YOUR_TAILNET_DOMAIN}}.ts.net/ # <------- Replace with your Tailscale domain ie https://searchxng.tail123456.ts.net/ + - INSTANCE_NAME=my-instance + restart: unless-stopped + network_mode: service:searchxng-ts depends_on: - - {{service}}-ts \ No newline at end of file + - searchxng-ts \ No newline at end of file diff --git a/tailscale/config/serve.json b/tailscale/config/serve.json index 121ffb8..37aa7f5 100644 --- a/tailscale/config/serve.json +++ b/tailscale/config/serve.json @@ -8,7 +8,7 @@ "${TS_CERT_DOMAIN}:443": { "Handlers": { "/": { - "Proxy": "http://127.0.0.1:3000" + "Proxy": "http://127.0.0.1:8080" } } }