generated from DAM/ts-TEMPLATE
certified
This commit is contained in:
parent
7b54261cb4
commit
bb3c4c0347
52
README.md
52
README.md
@ -1,44 +1,47 @@
|
|||||||
# {{Service}} with Tailscale Integration
|
# SearchXNG with Tailscale Integration
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
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
|
## Prerequisites
|
||||||
|
|
||||||
- Docker and Docker Compose installed on your system
|
- Docker and Docker Compose installed on your system
|
||||||
- A Tailscale account and auth key (get one from https://login.tailscale.com/admin/authkeys)
|
- 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
|
- Basic understanding of Docker and networking concepts
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
```
|
```
|
||||||
ts-{{service}}/
|
ts-searchxng/
|
||||||
├── docker-compose.yml
|
├── docker-compose.yml
|
||||||
├── tailscale/
|
├── tailscale/
|
||||||
│ ├── tailscale-data/ # Persistent Tailscale state
|
│ ├── tailscale-data/ # Persistent Tailscale state
|
||||||
│ └── config/ # Tailscale configuration files
|
│ └── config/ # Tailscale configuration files
|
||||||
└── {{service}}/
|
└── searchxng/
|
||||||
└── config/ # {{Service}} configuration files
|
└── config/ # SearchXNG configuration files
|
||||||
```
|
```
|
||||||
|
|
||||||
## Setup Instructions
|
## Setup Instructions
|
||||||
|
|
||||||
1. **Clone the Repository**
|
1. **Clone the Repository**
|
||||||
```bash
|
```bash
|
||||||
git clone https://gitea.damconsulting.llc/DAM/ts-{{service}}
|
git clone https://gitea.damconsulting.llc/DAM/ts-searchxng
|
||||||
cd ts-{{service}}
|
cd ts-searchxng
|
||||||
```
|
```
|
||||||
2. Create Required Directories
|
2. Create Required Directories
|
||||||
```bash
|
```bash
|
||||||
mkdir -p tailscale/tailscale-data
|
mkdir -p tailscale/tailscale-data
|
||||||
|
mkdir -p searchxng
|
||||||
```
|
```
|
||||||
3. Configure Tailscale
|
3. Configure Tailscale
|
||||||
- Replace `{{YOUR_TAILSCALE_AUTHKEY}}` in the docker-compose.yml with your actual Tailscale auth key
|
- 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
|
- 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
|
- CAUTION: Changing `"${TS_CERT_DOMAIN}:443": false` to `true` will expose the service to the internet
|
||||||
|
|
||||||
4. Configure {{Service}}
|
4. Configure SearchXNG
|
||||||
- See the [documentation]({{service_docs}}) for configuration options
|
- 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
|
5. Start the Services
|
||||||
```bash
|
```bash
|
||||||
@ -48,30 +51,30 @@ ts-{{service}}/
|
|||||||
6. Wait for Certificate to propagate [~2m]
|
6. Wait for Certificate to propagate [~2m]
|
||||||
|
|
||||||
7. Login
|
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
|
## Services
|
||||||
|
|
||||||
### {{service}}-ts (Tailscale)
|
### searchxng-ts (Tailscale)
|
||||||
|
|
||||||
- Runs Tailscale VPN client
|
- Runs Tailscale VPN client
|
||||||
- Image: tailscale/tailscale:latest
|
- Image: tailscale/tailscale:latest
|
||||||
- Container name: {{service}}-ts
|
- Container name: searchxng-ts
|
||||||
- Hostname: {{service}}
|
- Hostname: searchxng
|
||||||
- Requires NET_ADMIN and SYS_MODULE capabilities
|
- Requires NET_ADMIN and SYS_MODULE capabilities
|
||||||
- Persists state in ./tailscale/tailscale-data
|
- Persists state in ./tailscale/tailscale-data
|
||||||
- Uses configuration from ./tailscale/config
|
- Uses configuration from ./tailscale/config
|
||||||
|
|
||||||
### {{service}}
|
### searchxng
|
||||||
|
|
||||||
- Depends on {{service}}-ts service
|
- Depends on searchxng-ts service
|
||||||
|
|
||||||
## Usage
|
## 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:
|
- To manually get the Tailscale IP/hostname of your container:
|
||||||
```bash
|
```bash
|
||||||
docker logs {{service}}-ts
|
docker logs searchxng-ts
|
||||||
```
|
```
|
||||||
Look for the Tailscale IP address in the logs.
|
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):
|
- Uncomment and adjust the ports mapping if you need direct access (without Tailscale):
|
||||||
```yaml
|
```yaml
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 8080:8080
|
||||||
```
|
```
|
||||||
- Stopping the Services
|
- Stopping the Services
|
||||||
```bash
|
```bash
|
||||||
@ -90,19 +93,18 @@ ts-{{service}}/
|
|||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
- Check container logs:
|
- Check container logs:
|
||||||
```bash
|
```bash
|
||||||
docker logs {{service}}-ts
|
docker logs searchxng-ts
|
||||||
docker logs {{service}}
|
docker logs searchxng
|
||||||
```
|
```
|
||||||
- Ensure your Tailscale auth key is valid and not expired
|
- Ensure your Tailscale auth key is valid and not expired
|
||||||
- Verify the configuration files have proper permissions
|
- Verify the configuration files have proper permissions
|
||||||
- Make sure required directories exist before starting
|
- Make sure required directories exist before starting
|
||||||
|
|
||||||
## Notes
|
## 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
|
- Direct port mapping is disabled by default as Tailscale handles the networking
|
||||||
- Services restart automatically unless explicitly stopped
|
- Services restart automatically unless explicitly stopped
|
||||||
- For more information:
|
- For more information:
|
||||||
- Tailscale documentation: https://tailscale.com/kb/
|
- Tailscale documentation: https://tailscale.com/kb/
|
||||||
- {{Service}} [documentation]({{service_docs}})
|
- SearchXNG [documentation](https://docs.searxng.org/admin/settings/index.html)
|
||||||
- {{Service}} [repository]({{service_repo}})
|
- SearchXNG [repository](https://github.com/searxng/searxng)
|
||||||
- {{Service}} [linuxserve.io]({{service_lcsr}})
|
|
@ -1,10 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
{{service}}-ts:
|
searchxng-ts:
|
||||||
image: tailscale/tailscale:latest
|
image: tailscale/tailscale:latest
|
||||||
hostname: {{service}}
|
hostname: searchxng
|
||||||
container_name: {{service}}-ts
|
container_name: searchxng-ts
|
||||||
environment:
|
environment:
|
||||||
- TS_AUTHKEY={{YOUR_TAILSCALE_AUTHKEY}}
|
- TS_AUTHKEY={{YOUR_TAILSCALE_AUTHKEY}} # <------- Replace with your Tailscale auth key
|
||||||
- TS_STATE_DIR=/var/lib/tailscale
|
- TS_STATE_DIR=/var/lib/tailscale
|
||||||
- TS_SERVE_CONFIG=/config/serve.json
|
- TS_SERVE_CONFIG=/config/serve.json
|
||||||
volumes:
|
volumes:
|
||||||
@ -15,7 +15,17 @@ services:
|
|||||||
- net_admin
|
- net_admin
|
||||||
- sys_module
|
- sys_module
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
{{service-compose}}
|
searxng:
|
||||||
network_mode: service:{{service}}-ts
|
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:
|
depends_on:
|
||||||
- {{service}}-ts
|
- searchxng-ts
|
@ -8,7 +8,7 @@
|
|||||||
"${TS_CERT_DOMAIN}:443": {
|
"${TS_CERT_DOMAIN}:443": {
|
||||||
"Handlers": {
|
"Handlers": {
|
||||||
"/": {
|
"/": {
|
||||||
"Proxy": "http://127.0.0.1:3000"
|
"Proxy": "http://127.0.0.1:8080"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user