Explorar o código

Custom build wg-easy

Nicolas Meienberger %!s(int64=3) %!d(string=hai) anos
pai
achega
2bf8c374f6

+ 0 - 0
apps/test/Dockerfile → apps/busybox/Dockerfile


+ 11 - 0
apps/busybox/config.json

@@ -0,0 +1,11 @@
+{
+  "name": "BusyBox",
+  "port": 3000,
+  "id": "busybox",
+  "description": "",
+  "short_desc": "",
+  "author": "",
+  "source": "",
+  "image": "https://raw.githubusercontent.com/docker-library/docs/cc5d5e47fd7e0c57c9b8de4c1bfb6258e0dac85d/busybox/logo.png",
+  "form_fields": {}
+}

+ 6 - 0
apps/busybox/docker-compose.yml

@@ -0,0 +1,6 @@
+version: "3.7"
+services:
+  test:
+    image: meienberger/ubuntu-test
+    networks:
+      - tipi_main_network

+ 1 - 2
apps/filerun/docker-compose.yml

@@ -14,7 +14,7 @@ services:
 
   filerun:
     container_name: filerun
-    image: filerun/filerun
+    image: filerun/filerun:arm64v8
     environment:
       FR_DB_HOST: filerun-db
       FR_DB_PORT: 3306
@@ -36,4 +36,3 @@ services:
       - ${ROOT_FOLDER}/app-data:/user-files
     networks:
       - tipi_main_network
-    

+ 0 - 9
apps/radarr/config.json

@@ -7,7 +7,6 @@
   "author": "",
   "source": "",
   "image": "https://avatars.githubusercontent.com/u/25025331?s=200&v=4",
-  "dependencies": ["transmission"],
   "form_fields": {
     "torrent-client": {
       "type": "text",
@@ -16,14 +15,6 @@
       "min": 3,
       "required": true,
       "env_variable": "TORRENT_CLIENT"
-    },
-    "test": {
-      "type": "text",
-      "label": "testvar",
-      "max": 50,
-      "min": 3,
-      "required": true,
-      "env_variable": "TEST_VAR"
     }
   }
 }

+ 3 - 3
apps/radarr/docker-compose.yml

@@ -6,7 +6,7 @@ services:
     environment:
       - PUID=1000
       - PGID=1000
-      - TZ=Europe/London
+      - TZ=${TZ}
       - AUTO_UPDATE=true
     volumes:
       - ${APP_DATA_DIR}/data/config:/config
@@ -16,7 +16,7 @@ services:
     restart: unless-stopped
     networks:
       - tipi_main_network
-      
+
   radarr:
     image: lscr.io/linuxserver/radarr
     container_name: radarr
@@ -32,4 +32,4 @@ services:
       - ${APP_PORT}:7878
     restart: unless-stopped
     networks:
-      - tipi_main_network
+      - tipi_main_network

+ 0 - 8
apps/test/docker-compose.yml

@@ -1,8 +0,0 @@
-version: '3.7'
-services:
-  test:
-    build:
-      context: .
-      dockerfile: Dockerfile
-    networks:
-      - tipi_main_network

+ 1 - 1
apps/wg-easy/config.json

@@ -12,7 +12,7 @@
   "image": "https://avatars.githubusercontent.com/u/13991055?s=200&v=4",
   "form_fields": {
     "host": {
-      "type": "ip",
+      "type": "fqdnip",
       "label": "Your public IP address or domain name",
       "required": true,
       "env_variable": "WIREGUARD_HOST"

+ 30 - 27
apps/wg-easy/docker-compose.yml

@@ -1,29 +1,32 @@
-version: '3.7'
+version: "3.7"
 services:
   wg-easy:
-      container_name: wg-easy
-      image: 'weejewel/wg-easy:latest'
-      restart: unless-stopped
-      volumes:
-        - ${APP_DATA_DIR}:/etc/wireguard
-      ports:
-        - 51820:51820
-        - ${APP_PORT}:51821
-      environment:
-        WG_HOST: '${WIREGUARD_HOST}'
-        PASSWORD: '${WIREGUARD_PASSWORD}'
-      cap_add:
-        - NET_ADMIN
-        - SYS_MODULE
-      sysctls:
-        - net.ipv4.conf.all.src_valid_mark=1
-        - net.ipv4.ip_forward=1
-      networks:
-        - tipi_main_network
-      # labels:
-      #   traefik.enable: true
-      #   traefik.http.routers.wireguard.rule: Host(`wireguard.tipi.home`)
-      #   traefik.http.routers.wireguard.service: wireguard
-      #   traefik.http.routers.wireguard.tls: true
-      #   traefik.http.routers.wireguard.entrypoints: websecure
-      #   traefik.http.services.wireguard.loadbalancer.server.port: 51821
+    container_name: wg-easy
+    image: "meienberger/wg-easy:latest"
+    restart: unless-stopped
+    network_mode: "host"
+    volumes:
+      - ${APP_DATA_DIR}:/etc/wireguard
+      - /lib/modules:/lib/modules
+    ports:
+      - 51820:51820/udp
+      - ${APP_PORT}:51821
+    environment:
+      WG_HOST: "${WIREGUARD_HOST}"
+      PASSWORD: "${WIREGUARD_PASSWORD}"
+      WG_DEFAULT_DNS: 8.8.8.8
+      WG_ALLOWED_IPS: 0.0.0.0/0,::/0
+      WG_FWMARK: 51820
+    cap_add:
+      - NET_ADMIN
+      - SYS_MODULE
+    # sysctls:
+    # - net.ipv4.conf.all.src_valid_mark=1
+    # - net.ipv4.ip_forward=1
+    # labels:
+    #   traefik.enable: true
+    #   traefik.http.routers.wireguard.rule: Host(`wireguard.tipi.home`)
+    #   traefik.http.routers.wireguard.service: wireguard
+    #   traefik.http.routers.wireguard.tls: true
+    #   traefik.http.routers.wireguard.entrypoints: websecure
+    #   traefik.http.services.wireguard.loadbalancer.server.port: 51821

+ 2 - 0
dashboard/src/components/Form/validators.ts

@@ -19,6 +19,8 @@ export const validateAppConfig = (values: Record<string, string>, fields: (AppCo
       errors[field.id] = 'Field must be a valid domain';
     } else if (values[field.id] && field.type === FieldTypes.ip && !validator.isIP(values[field.id])) {
       errors[field.id] = 'Field must be a valid IP address';
+    } else if (values[field.id] && field.type === FieldTypes.fqdnip && !validator.isFQDN(values[field.id] || '') && !validator.isIP(values[field.id])) {
+      errors[field.id] = 'Field must be a valid domain or IP address';
     }
   });
 

+ 1 - 1
dashboard/src/core/api.ts

@@ -1,6 +1,6 @@
 import axios, { Method } from 'axios';
 
-const BASE_URL = 'http://localhost:3001';
+export const BASE_URL = 'http://192.168.2.146:3001';
 
 interface IFetchParams {
   endpoint: string;

+ 2 - 1
dashboard/src/core/fetcher.ts

@@ -1,8 +1,9 @@
 import { BareFetcher } from 'swr';
 import axios from 'axios';
+import { BASE_URL } from './api';
 
 const fetcher: BareFetcher<any> = (url: string) => {
-  return axios.get(url, { baseURL: 'http://localhost:3001' }).then((res) => res.data);
+  return axios.get(url, { baseURL: BASE_URL }).then((res) => res.data);
 };
 
 export default fetcher;

+ 1 - 0
dashboard/src/core/types.ts

@@ -5,6 +5,7 @@ export enum FieldTypes {
   number = 'number',
   fqdn = 'fqdn',
   ip = 'ip',
+  fqdnip = 'fqdnip',
 }
 
 interface FormField {

+ 1 - 1
scripts/app.sh

@@ -118,7 +118,7 @@ fi
 # Removes images and destroys all data for an app
 if [[ "$command" = "uninstall" ]]; then
   echo "Removing images for app ${app}..."
-  compose "${app}" down --rmi all --remove-orphans
+  compose "${app}" down --remove-orphans
 
   echo "Deleting app data for app ${app}..."
   if [[ -d "${app_data_dir}" ]]; then

+ 1 - 1
state/apps.json

@@ -1 +1 @@
-{"installed":" transmission filerun anonaddy","environment":{"anonaddy":{}}}
+{"installed":"transmission wg-easy jellyfin radarr filerun nextcloud busybox","environment":{"anonaddy":{}}}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 14346 - 1
system-api/package-lock.json


+ 1 - 1
system-api/src/config/apps.ts

@@ -1 +1 @@
-export const appNames = ['nextcloud', 'freshrss', 'anonaddy', 'filerun', 'wg-easy', 'radarr', 'transmission', 'jellyfin', 'pi-hole'];
+export const appNames = ['nextcloud', 'freshrss', 'anonaddy', 'filerun', 'wg-easy', 'radarr', 'transmission', 'jellyfin', 'pi-hole', 'busybox'];

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio