Automatic commit

This commit is contained in:
Nicolas Meienberger 2022-04-07 10:34:18 +02:00
parent 4939cd323d
commit 812f7a4888
67 changed files with 7409 additions and 114 deletions

6
.gitignore vendored
View File

@ -2,7 +2,10 @@
nginx/*
letsencrypt/*
app-data/*
traefik/ssl/*
!traefik/ssl/.gitkeep
!app-data/.gitkeep
!letsencrypt/mkcert/.gitkeep
state/*
!state/.gitkeep
@ -10,5 +13,4 @@ state/*
tipi.config.json
# Commit empty directories
!nignx/.gitkeep
!letsencrypt/.gitkeep
!nignx/.gitkeep

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://raw.githubusercontent.com/ansible-community/schemas/main/f/ansible-playbook.json": "file:///Users/nicolas/Projects/runtipi/ansible/playbooks/install-dependencies.yml"
}
}

2
ansible/ansible.cfg Normal file
View File

@ -0,0 +1,2 @@
[defaults]
INVENTORY = hosts

View File

@ -0,0 +1,7 @@
packages:
- jq
- mkcert
### ZSH Settings
zsh_theme: "powerlevel10k/powerlevel10k"
ohmyzsh_git_url: https://github.com/robbyrussell/oh-my-zsh

2
ansible/hosts Normal file
View File

@ -0,0 +1,2 @@
[localhost]
tipi ansible_connection=local

13
ansible/setup.yml Normal file
View File

@ -0,0 +1,13 @@
---
- hosts: tipi
become: yes
tasks:
- import_tasks: tasks/essential.yml
- import_tasks: tasks/zsh.yml
- import_tasks: tasks/nginx.yml
- import_tasks: tasks/pi-hole.yml
- import_tasks: tasks/pi-vpn.yml
- import_tasks: tasks/nextcloud.yml
# - name: Reboot machine
# reboot:

115
ansible/tasks/essential.yml Normal file
View File

@ -0,0 +1,115 @@
- name: Create new user for system
user:
name: tipi
comment: Tipi user
uid: 1040
group: admin
- name: Update packages
become: tipi
apt:
update_cache: yes
upgrade: yes
- name: Install essential packages
package:
name: "{{ packages }}"
state: latest
- name: Check if docker is installed
stat:
path: /usr/bin/docker
register: docker_status
- name: Check if docker pgp key is installed
stat:
path: /usr/share/keyrings/docker-archive-keyring.gpg
register: docker_pgp_key_status
- name: Download docker
shell: "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"
when: not docker_pgp_key_status.stat.exists
- name: Setup stable docker repository
shell: 'echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null'
when: not docker_status.stat.exists
- name: Update packages
apt:
update_cache: yes
upgrade: yes
- name: Install essential packages
package:
name:
- docker-ce
- docker-ce-cli
- containerd.io
state: latest
- name: Check if docker-compose is installed
stat:
path: /usr/local/bin/docker-compose
register: docker_compose_status
- name: Install docker-compose
shell: 'curl -L "https://github.com/docker/compose/releases/download/v2.3.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose'
when: not docker_compose_status.stat.exists
- name: Disable iptables for increased security with docker
lineinfile:
path: /etc/default/docker
regexp: "^DOCKER_OPTS="
line: 'DOCKER_OPTS="--iptables=false"'
- name: Add group docker
group:
name: docker
- name: Add user to group docker
user:
name: tipi
group: docker
- name: Disable SSH password auth
lineinfile:
dest: /etc/ssh/sshd_config
regexp: "^#PasswordAuthentication yes"
line: "PasswordAuthentication no"
register: sshd_config
- name: Enable passwordless sudo for tipi user
lineinfile:
dest: /etc/sudoers
regexp: "^%wheel"
line: "tipi ALL=(ALL) NOPASSWD: ALL"
validate: "/usr/sbin/visudo -cf %s"
- name: Restart SSH daemon
service:
name: sshd
state: restarted
when: sshd_config.changed
- name: Allow SSH in UFW
community.general.ufw:
rule: allow
port: 22
from: 192.168.2.0/24
proto: tcp
- name: Allow port 80 in UFW
community.general.ufw:
rule: allow
port: 80
proto: tcp
- name: Allow port 443 in UFW
community.general.ufw:
rule: allow
port: 443
proto: tcp
- name: Enable UFW
community.general.ufw:
state: enabled

View File

@ -0,0 +1,80 @@
version: "3.5"
services:
db:
image: mariadb:10.5
container_name: db-anonaddy
command:
- "mysqld"
- "--character-set-server=utf8mb4"
- "--collation-server=utf8mb4_unicode_ci"
volumes:
- "${APP_DATA_DIR}/db:/var/lib/mysql"
environment:
MARIADB_DATABASE: anonaddy
MARIADB_USER: anonaddy
MARIADB_ROOT_PASSWORD: anonaddy
MARIADB_PASSWORD: anonaddy
restart: unless-stopped
networks:
- tipi_main_network
redis:
image: redis:4.0-alpine
container_name: redis-anonaddy
restart: unless-stopped
networks:
- tipi_main_network
anonaddy:
image: anonaddy/anonaddy:0.11.1
container_name: anonaddy
ports:
- 25:25
- ${APP_ANONADDY_PORT}:8000
depends_on:
- db
- redis
volumes:
- "${APP_DATA_DIR}/data:/data"
environment:
DB_HOST: db-anonaddy
DB_PASSWORD: anonaddy
REDIS_HOST: redis-anonaddy
APP_KEY: ${APP_ANONADDY_KEY}
ANONADDY_DOMAIN: ${APP_ANONADDY_DOMAIN}
ANONADDY_SECRET: ${APP_ANONADDY_SECRET}
restart: unless-stopped
networks:
- tipi_main_network
labels:
traefik.enable: true
traefik.http.routers.anonaddy.rule: Host(`anonaddy.tipi.local`)
traefik.http.routers.anonaddy.tls: true
traefik.http.routers.anonaddy.entrypoints: websecure
traefik.http.routers.anonaddy.service: anonaddy
traefik.http.services.anonaddy.loadbalancer.server.port: 8000
# labels:
# traefik.enable: true
# traefik.http.routers.anonaddy.rule: PathPrefix(`/anonaddy`)
# # Redirect to ending /
# traefik.http.middlewares.anonaddy-redirect.redirectregex.regex: ^(http:\/\/(\[[\w:.]+\]|[\w\._-]+)(:\d+)?)\/anonaddy$$
# traefik.http.middlewares.anonaddy-redirect.redirectregex.replacement: $${1}/anonaddy/
# # Strip /anonaddy/ from URL
# traefik.http.middlewares.anonaddy-stripprefix.stripprefixregex.regex: (/anonaddy/|/anonaddy)
# traefik.http.middlewares.anonaddy-headers.headers.customrequestheaders.Host: $$host
# traefik.http.middlewares.anonaddy-headers.headers.customrequestheaders.X-Forwarded-Proto: $$scheme
# traefik.http.middlewares.anonaddy-headers.headers.customrequestheaders.X-Forwarded-For: $$proxy_add_x_forwarded_for
# traefik.http.middlewares.anonaddy-headers.headers.customrequestheaders.X-Real-IP: $$remote_addr
# traefik.http.middlewares.anonaddy-headers.headers.customrequestheaders.X-Frame-Options: "SAMEORIGIN"
# # Apply middleware
# traefik.http.routers.anonaddy.middlewares: anonaddy-redirect, anonaddy-stripprefix, anonaddy-headers
# traefik.http.routers.anonaddy.entrypoints: http
# traefik.http.routers.anonaddy.service: anonaddy
# traefik.http.services.anonaddy.loadbalancer.server.port: 8000

View File

@ -0,0 +1,6 @@
version: "3.7"
networks:
tipi_main_network:
external:
name: runtipi_tipi_main_network

View File

@ -0,0 +1,24 @@
version: "3.7"
services:
freshrss:
container_name: freshrss
image: freshrss/freshrss:1.19.2
restart: unless-stopped
ports:
- "${APP_FRESHRSS_PORT}:80"
volumes:
- ${APP_DATA_DIR}/data/:/var/www/FreshRSS/data
- ${APP_DATA_DIR}/extensions/:/var/www/FreshRSS/extensions
environment:
CRON_MIN: '*/20'
TZ: $TZ
networks:
- tipi_main_network
labels:
traefik.enable: true
traefik.http.routers.freshrss.rule: Host(`freshrss.tipi.local`)
traefik.http.routers.freshrss.service: freshrss
traefik.http.routers.freshrss.tls: true
traefik.http.routers.freshrss.entrypoints: websecure
traefik.http.services.freshrss.loadbalancer.server.port: 80

View File

@ -2,7 +2,7 @@ version: "3.7"
services:
db-nextcloud:
network_mode: "container:gluetun"
container_name: db-nextcloud
user: '1000:1000'
image: mariadb:10.5.12
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
@ -14,30 +14,35 @@ services:
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
networks:
- tipi_main_network
redis-nextcloud:
network_mode: "container:gluetun"
container_name: redis-nextcloud
user: '1000:1000'
image: redis:6.2.2-buster
restart: on-failure
volumes:
- "${APP_DATA_DIR}/data/redis:/data"
networks:
- tipi_main_network
cron:
network_mode: "container:gluetun"
image: nextcloud:22.0.0-apache
restart: on-failure
volumes:
- ${APP_DATA_DIR}/data/nextcloud:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
- redis
- db-nextcloud
- redis-nextcloud
networks:
- tipi_main_network
web-nextcloud:
network_mode: "container:gluetun"
nextcloud:
user: root
container_name: nextcloud
image: nextcloud:22.1.1-apache
restart: unless-stopped
ports:
@ -52,13 +57,25 @@ services:
- MYSQL_USER=nextcloud
- NEXTCLOUD_ADMIN_USER=tipi
- NEXTCLOUD_ADMIN_PASSWORD=password
- NEXTCLOUD_TRUSTED_DOMAINS=${APP_NEXTCLOUD_PORT}
depends_on:
- db
- redis
- db-nextcloud
- redis-nextcloud
networks:
- tipi_main_network
labels:
traefik.enable: true
traefik.http.routers.traefik.rule: Host(`nextcloud.${DOMAIN}`)
traefik.http.services.traefik.loadbalancer.server.port: $APP_NEXTCLOUD_PORT
traefik.enable: true
traefik.http.routers.nextcloud.rule: Host(`nextcloud.tipi.local`)
traefik.http.routers.nextcloud.service: nextcloud
traefik.http.routers.nextcloud.tls: true
traefik.http.routers.nextcloud.entrypoints: websecure
traefik.http.services.nextcloud.loadbalancer.server.port: 80
# labels:
# traefik.enable: true
# traefik.http.routers.nextcloud.rule: PathPrefix(`/nextcloud`)
# traefik.http.routers.nextcloud.entrypoints: http
# traefik.http.routers.nextcloud.service: nextcloud
# traefik.http.services.nextcloud.loadbalancer.server.port: 80

View File

@ -3,18 +3,18 @@ version: "3.7"
services:
unbound:
user: '1000:1000'
network_mode: "container:gluetun"
image: "klutchell/unbound:latest"
volumes:
- ${APP_DATA_DIR}/data/unbound:/etc/unbound
networks:
- tipi_main_network
pihole:
network_mode: "container:gluetun"
image: pihole/pihole
restart: on-failure
ports:
# - 53:53
# - 53:53/udp
- 53:53
- 53:53/udp
- ${APP_PI_HOLE_PORT}:80
volumes:
- ${APP_DATA_DIR}/data/pihole:/etc/pihole/
@ -25,6 +25,8 @@ services:
- PIHOLE_DNS=unbound
depends_on:
- unbound
networks:
- tipi_main_network
labels:
traefik.enable: true
traefik.http.routers.traefik.rule: Host(`pihole.${DOMAIN}`)

View File

@ -0,0 +1,26 @@
version: "3.7"
services:
server:
container_name: simple-torrent
image: boypt/cloud-torrent:1.3.9
user: "1000:1000"
restart: on-failure
ports:
- "${APP_SIMPLETORRENT_PORT}:${APP_SIMPLETORRENT_PORT}"
command: >
--port=${APP_SIMPLETORRENT_PORT}
--config-path /config/simple-torrent.json
volumes:
- ${APP_DATA_DIR}/data/torrents:/torrents
- ${APP_DATA_DIR}/data/downloads:/downloads
- ${APP_DATA_DIR}/data/config:/config
networks:
- tipi_main_network
labels:
traefik.enable: true
traefik.http.routers.simple-torrent.rule: Host(`simple-torrent.tipi.local`)
traefik.http.routers.simple-torrent.service: simple-torrent
traefik.http.routers.simple-torrent.tls: true
traefik.http.routers.simple-torrent.entrypoints: websecure
traefik.http.services.simple-torrent.loadbalancer.server.port: ${APP_SIMPLETORRENT_PORT}

6
apps/test/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM ubuntu:latest
# Install curl
RUN apt-get update && apt-get install -y curl
ENTRYPOINT ["tail", "-f", "/dev/null"]

View File

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

View File

@ -1,26 +1,29 @@
version: '3.7'
services:
wg-easy:
network_mode: "container:gluetun"
container_name: wg-easy
image: 'weejewel/wg-easy:latest'
restart: unless-stopped
volumes:
- ${APP_DATA_DIR}:/etc/wireguard
ports:
- 51820:51820
- ${APP_WGEASY_PORT}:51821
environment:
WG_HOST: 'wireguard.meienberger.dev'
PASSWORD: 'password'
WG_DEFAULT_DNS: 'pihole'
# WG_POST_UP: ...
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
# ports:
# - '51820:51820/udp'
# - '51821:51821/tcp'
networks:
- tipi_main_network
labels:
traefik.enable: true
traefik.http.routers.traefik.rule: Host(`wg.${DOMAIN}`)
traefik.http.services.traefik.loadbalancer.server.port: $APP_WGEASY_PORT
traefik.http.routers.wireguard.rule: Host(`wireguard.tipi.local`)
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

3
dashboard/.eslintrc.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}

35
dashboard/.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo

14
dashboard/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM node:latest
WORKDIR /app
COPY ./package.json ./
COPY ./yarn.lock ./
RUN yarn
COPY ./ ./
RUN yarn build
CMD ["yarn", "start"]

34
dashboard/README.md Normal file
View File

@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

5
dashboard/next-env.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

6
dashboard/next.config.js Normal file
View File

@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
module.exports = nextConfig

31
dashboard/package.json Normal file
View File

@ -0,0 +1,31 @@
{
"name": "dashboard",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@chakra-ui/react": "^1.8.7",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"framer-motion": "^6",
"next": "12.1.4",
"react": "18.0.0",
"react-dom": "18.0.0",
"systeminformation": "^5.11.9",
"validator": "^13.7.0"
},
"devDependencies": {
"@types/node": "17.0.23",
"@types/react": "17.0.43",
"@types/react-dom": "17.0.14",
"@types/validator": "^13.7.2",
"eslint": "8.12.0",
"eslint-config-next": "12.1.4",
"typescript": "4.6.3"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -0,0 +1,4 @@
<svg width="283" height="64" viewBox="0 0 283 64" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="#000"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,32 @@
import React from "react";
import Img from "next/image";
import Link from "next/link";
import { Button, Flex, useBreakpointValue } from "@chakra-ui/react";
interface IProps {
onClickMenu: () => void;
}
const Header: React.FC<IProps> = ({ onClickMenu }) => {
const buttonVisibility = useBreakpointValue<"visible" | "hidden">({
base: "visible",
md: "hidden",
});
return (
<header>
<Flex alignItems="center" bg="tomato" paddingLeft={5} paddingRight={5}>
<Flex position="absolute" visibility={buttonVisibility || "visible"}>
<Button onClick={onClickMenu}>O</Button>
</Flex>
<Flex justifyContent="center" flex="1">
<Link href="/" passHref>
<Img src="/logo.svg" alt="Tipi" width={100} height={60} />
</Link>
</Flex>
</Flex>
</header>
);
};
export default Header;

View File

@ -0,0 +1,34 @@
import {
Button,
Flex,
useBreakpointValue,
useDisclosure,
} from "@chakra-ui/react";
import React from "react";
import Header from "./Header";
import Menu from "./Menu";
import MenuDrawer from "./MenuDrawer";
const Layout: React.FC = ({ children }) => {
const menuWidth = useBreakpointValue({ base: 0, md: 200 });
const { isOpen, onOpen, onClose } = useDisclosure();
return (
<Flex height="100vh" bg="green.500" direction="column">
<MenuDrawer isOpen={isOpen} onClose={onClose}>
<Menu />
</MenuDrawer>
<Header onClickMenu={onOpen} />
<Flex flex="1">
<Flex width={menuWidth} bg="blue.500">
<Menu />
</Flex>
<Flex flex="1" padding={5} bg="yellow.300">
{children}
</Flex>
</Flex>
</Flex>
);
};
export default Layout;

View File

@ -0,0 +1,11 @@
import React from "react";
const Menu: React.FC = () => {
return (
<div>
<h1>Menu</h1>
</div>
);
};
export default Menu;

View File

@ -0,0 +1,33 @@
import {
Drawer,
DrawerBody,
DrawerCloseButton,
DrawerContent,
DrawerFooter,
DrawerHeader,
DrawerOverlay,
} from "@chakra-ui/react";
import React from "react";
interface IProps {
isOpen: boolean;
onClose: () => void;
}
const MenuDrawer: React.FC<IProps> = ({ children, isOpen, onClose }) => {
return (
<Drawer isOpen={isOpen} placement="left" onClose={onClose}>
<DrawerOverlay />
<DrawerContent>
<DrawerCloseButton />
<DrawerHeader>Create your account</DrawerHeader>
<DrawerBody>{children}</DrawerBody>
<DrawerFooter>
<div>Github</div>
</DrawerFooter>
</DrawerContent>
</Drawer>
);
};
export default MenuDrawer;

View File

@ -0,0 +1 @@
export { default } from "./Layout";

View File

@ -0,0 +1,109 @@
import validator from "validator";
interface IFormField {
name: string;
type: string;
required: boolean;
description?: string;
placeholder?: string;
validate?: (value: string) => boolean;
}
interface IAppConfig {
id: string;
name: string;
description: string;
logo: string;
url: string;
color: string;
install_form: { fields: IFormField[] };
}
const APP_ANONADDY: IAppConfig = {
id: "anonaddy",
name: "Anonaddy",
description: "Create Unlimited Email Aliases For Free",
url: "https://anonaddy.com/",
color: "#00a8ff",
logo: "https://anonaddy.com/favicon.ico",
install_form: {
fields: [
{
name: "API Key",
type: "text",
placeholder: "API Key",
required: true,
validate: (value: string) => validator.isBase64(value),
},
{
name: "Return Path",
type: "text",
description: "The email address that bounces will be sent to",
placeholder: "Return Path",
required: false,
validate: (value: string) => validator.isEmail(value),
},
{
name: "Admin Username",
type: "text",
description: "The username of the admin user",
placeholder: "Admin Username",
required: true,
},
{
name: "Enable Registration",
type: "boolean",
description: "Allow users to register",
placeholder: "Enable Registration",
required: false,
},
{
name: "Domain",
type: "text",
description: "The domain that will be used for the email address",
placeholder: "Domain",
required: true,
validate: (value: string) => validator.isFQDN(value),
},
{
name: "Hostname",
type: "text",
description: "The hostname that will be used for the email address",
placeholder: "Hostname",
required: true,
validate: (value: string) => validator.isFQDN(value),
},
{
name: "Secret",
type: "text",
description: "The secret that will be used for the email address",
placeholder: "Secret",
required: true,
},
{
name: "From Name",
type: "text",
description: "The name that will be used for the email address",
placeholder: "From Name",
required: true,
validate: (value: string) =>
validator.isLength(value, { min: 1, max: 64 }),
},
{
name: "From Address",
type: "text",
description:
"The email address that will be used for the email address",
placeholder: "From Address",
required: true,
validate: (value: string) => validator.isEmail(value),
},
],
},
};
const APPS_CONFIG = {
available: [APP_ANONADDY],
};
export default APPS_CONFIG;

View File

@ -0,0 +1,13 @@
import { ChakraProvider } from "@chakra-ui/react";
import "../styles/globals.css";
import type { AppProps } from "next/app";
function MyApp({ Component, pageProps }: AppProps) {
return (
<ChakraProvider>
<Component {...pageProps} />
</ChakraProvider>
);
}
export default MyApp;

View File

@ -0,0 +1,13 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from "next";
import si from "systeminformation";
type Data = Awaited<ReturnType<typeof si.currentLoad>>;
const handler = async (req: NextApiRequest, res: NextApiResponse<Data>) => {
const cpuLoad = await si.currentLoad();
res.status(200).json(cpuLoad);
};
export default handler;

View File

@ -0,0 +1,13 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from "next";
import si from "systeminformation";
type Data = Awaited<ReturnType<typeof si.fsSize>>;
const handler = async (req: NextApiRequest, res: NextApiResponse<Data>) => {
const disk = await si.fsSize();
res.status(200).json(disk);
};
export default handler;

View File

@ -0,0 +1,13 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from "next";
import si from "systeminformation";
type Data = Awaited<ReturnType<typeof si.mem>>;
const handler = async (req: NextApiRequest, res: NextApiResponse<Data>) => {
const memory = await si.mem();
res.status(200).json(memory);
};
export default handler;

View File

@ -0,0 +1,12 @@
import type { NextPage } from "next";
import Layout from "../components/Layout";
const Home: NextPage = () => {
return (
<Layout>
<div>Content</div>
</Layout>
);
};
export default Home;

View File

@ -0,0 +1,116 @@
.container {
padding: 0 2rem;
}
.main {
min-height: 100vh;
padding: 4rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.footer {
display: flex;
flex: 1;
padding: 2rem 0;
border-top: 1px solid #eaeaea;
justify-content: center;
align-items: center;
}
.footer a {
display: flex;
justify-content: center;
align-items: center;
flex-grow: 1;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.title,
.description {
text-align: center;
}
.description {
margin: 4rem 0;
line-height: 1.5;
font-size: 1.5rem;
}
.code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
}
.card {
margin: 1rem;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
max-width: 300px;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
}
.card h2 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.logo {
height: 1em;
margin-left: 0.5rem;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}

View File

@ -0,0 +1,16 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}

20
dashboard/tsconfig.json Normal file
View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}

2795
dashboard/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,64 +1,60 @@
version: '3.7'
services:
gluetun:
container_name: gluetun
image: qmcgaw/gluetun
cap_add:
- NET_ADMIN
environment:
- VPN_SERVICE_PROVIDER=mullvad
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
- WIREGUARD_ADDRESSES=${WIREGUARD_ADDRESSES}
- SERVER_COUNTRIES=Switzerland
- OWNED_ONLY=yes
ports:
- "${APP_WGEASY_PORT}:51821"
- '51820:51820'
- '80:80'
- '81:81'
- '443:443'
nginx-proxy:
network_mode: "service:gluetun"
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
volumes:
- ${PWD}/nginx:/data
- ${PWD}/letsencrypt:/etc/letsencrypt
# traefik-app:
# image: traefik:latest
# restart: always
# # ports:
# # - 80:80
# # - 443:443
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock:ro
# - ${PWD}/letsencrypt:/letsencrypt
# command:
# - --api.insecure=true
# - --providers.docker
# - --providers.docker.exposedbydefault=false
# - --entrypoints.web.address=:80
# - --entrypoints.web.http.redirections.entrypoint.to=websecure
# # - --entrypoints.web.forwardedHeaders.trustedIPs=172.26.0.0/16,172.80.0.0/24
# - --entrypoints.websecure.address=:443
# # - --entrypoints.websecure.forwardedHeaders.trustedIPs=172.26.0.0/16,172.80.0.0/24
# # - --entrypoints.websecure.http.tls.domains[0].main=${DOMAIN}
# # - --entrypoints.websecure.http.tls.domains[0].sans=*.${DOMAIN}
# - --entrypoints.websecure.http.tls.certresolver=myresolver
# # - --certificatesresolvers.myresolver.acme.dnschallenge=true
# # - --certificatesresolvers.myresolver.acme.dnschallenge.provider=infomaniak
# # - --certificatesresolvers.myresolver.acme.email=${MAIL_ADR}
# - --certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json
# gluetun:
# container_name: gluetun
# image: qmcgaw/gluetun
# cap_add:
# - NET_ADMIN
# environment:
# # INFOMANIAK_ACCESS_TOKEN: ${INFOMANIAK_ACCESS_TOKEN}
# INFOMANIAK_POLLING_NTERVAL: 10
# INFOMANIAK_PROPAGATION_TIMEOUT: 180
# labels:
# traefik.enable: true
# traefik.http.routers.traefik.rule: Host(`proxy.${DOMAIN}`)
# traefik.http.services.traefik.loadbalancer.server.port: 8080
# - VPN_SERVICE_PROVIDER=mullvad
# - VPN_TYPE=wireguard
# - WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
# - WIREGUARD_ADDRESSES=${WIREGUARD_ADDRESSES}
# - SERVER_COUNTRIES=Switzerland
# - OWNED_ONLY=yes
# ports:
# - 80:80
# - 8080:8080
# networks:
# - tipi_main_network
reverse-proxy:
container_name: reverse-proxy
image: traefik:v2.6
restart: always
ports:
- 80:80
- 443:443
- 8080:8080
security_opt:
- no-new-privileges:true
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/traefik:/root/.config
networks:
- tipi_main_network
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
container_name: dashboard
volumes:
- ${PWD}/state:/app/state
- ${PWD}/config:/app/config:ro
ports:
- 3000:3000
networks:
- tipi_main_network
labels:
traefik.enable: true
traefik.http.routers.dashboard.rule: Host(`tipi.local`)
traefik.http.routers.dashboard.tls: true
traefik.http.routers.dashboard.entrypoints: websecure
traefik.http.routers.dashboard.service: dashboard
traefik.http.services.dashboard.loadbalancer.server.port: 3000
networks:
tipi_main_network:

View File

@ -10,7 +10,6 @@ fi
ROOT_FOLDER="$($rdlk -f $(dirname "${BASH_SOURCE[0]}")/..)"
STATE_FOLDER="${ROOT_FOLDER}/state"
DOMAIN="thisprops.com"
show_help() {
cat << EOF
@ -83,20 +82,36 @@ compose() {
# App data folder
local env_file="${ROOT_FOLDER}/.env"
local app_compose_file="${app_dir}/docker-compose.yml"
local app_url="${app}.${DOMAIN}"
local common_compose_file="${ROOT_FOLDER}/apps/docker-compose.common.yml"
local app_dir="${ROOT_FOLDER}/apps/${app}"
# Vars to use in compose file
export APP_DATA_DIR="${app_data_dir}"
export APP_URL="${app_url}"
export APP_PASSWORD="password"
export APP_DIR="${app_dir}"
docker-compose \
--env-file "${env_file}" \
--project-name "${app}" \
--file "${app_compose_file}" \
--file "${common_compose_file}" \
"${@}"
}
# Install new app
if [[ "$command" = "install" ]]; then
compose "${app}" pull
# # Copy env file sample to .env
# if [[ -f "${app_dir}/.env-sample" ]]; then
# # Append to .env
# echo "Copying .env-sample to .env for ${app} if not already done"
# fi
compose "${app}" up -d
exit
fi
# Removes images and destroys all data for an app
if [[ "$command" = "uninstall" ]]; then

View File

@ -25,26 +25,16 @@ ENV_FILE="./templates/.env"
# Copy template configs to intermediary configs
[[ -f "./templates/.env-sample" ]] && cp "./templates/.env-sample" "$ENV_FILE"
# Install jq if not installed
if ! command -v jq > /dev/null; then
echo "Installing jq..."
apt-get update
apt-get install -y jq
# Install ansible if not installed
if ! command -v ansible-playbook > /dev/null; then
echo "Installing Ansible..."
sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible
fi
# Install docker if not installed
if ! command -v docker > /dev/null; then
echo "Installing docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
fi
# Install docker-compose if not installed
if ! command -v docker-compose > /dev/null; then
echo "Installing docker-compose..."
curl -L "https://github.com/docker/compose/releases/download/v2.3.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
fi
ansible-playbook ansible/setup.yml -K
echo "Generating config files..."
for template in "${ENV_FILE}"; do

View File

@ -34,9 +34,12 @@ function get_json_field() {
str=$(get_json_field ${STATE_FOLDER}/apps.json installed)
apps_to_start=($str)
for app in "${apps_to_start[@]}"; do
"${ROOT_FOLDER}/scripts/app.sh" stop $app
done
# If apps_to_start is not empty, then we're stopping all apps
if [[ ${#apps_to_start[@]} -gt 0 ]]; then
for app in "${apps_to_start[@]}"; do
"${ROOT_FOLDER}/scripts/app.sh" stop $app
done
fi
echo "Stopping Docker services..."
echo

View File

@ -1,3 +1,6 @@
{
"installed": ""
"installed": "freshrss",
"environment": {
"anonaddy": {}
}
}

1
system-api/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

72
system-api/dist/server.js vendored Normal file
View File

@ -0,0 +1,72 @@
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/server.ts
import express from "../node_modules/express/index.js";
// src/routes/system.routes.ts
import { Router } from "../node_modules/express/index.js";
// src/controllers/system.controller.ts
import si from "../node_modules/systeminformation/lib/index.js";
var getCpuInfo = (req, res) => __async(void 0, null, function* () {
const cpuLoad = yield si.currentLoad();
res.status(200).send({ load: cpuLoad.currentLoad });
});
var getDiskInfo = (req, res) => __async(void 0, null, function* () {
const disk = yield si.fsSize();
const rootDisk = disk.find((item) => item.mount === "/");
if (!rootDisk) {
throw new Error("Could not find root disk");
}
const result = {
size: rootDisk.size,
used: rootDisk.used,
available: rootDisk.available
};
res.status(200).send(result);
});
var getMemoryInfo = (req, res) => __async(void 0, null, function* () {
const memory = yield si.mem();
const result = {
total: memory.total,
free: memory.free,
used: memory.used
};
res.status(200).json(result);
});
var system_controller_default = { getCpuInfo, getDiskInfo, getMemoryInfo };
// src/routes/system.routes.ts
var router = Router();
router.route("/cpu").get(system_controller_default.getCpuInfo);
router.route("/disk").get(system_controller_default.getDiskInfo);
router.route("/memory").get(system_controller_default.getMemoryInfo);
var system_routes_default = router;
// src/server.ts
var app = express();
var port = 3001;
app.use("/system", system_routes_default);
app.listen(port, () => {
console.log(`System API listening on port ${port}`);
});
//# sourceMappingURL=server.js.map

7
system-api/dist/server.js.map vendored Normal file
View File

@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/server.ts", "../src/routes/system.routes.ts", "../src/controllers/system.controller.ts"],
"sourcesContent": ["import express from \"express\";\nimport { systemRoutes } from \"./routes\";\n\nconst app = express();\nconst port = 3001;\n\napp.use(\"/system\", systemRoutes);\n\napp.listen(port, () => {\n console.log(`System API listening on port ${port}`);\n});\n", "import { Router } from \"express\";\nimport { SystemController } from \"../controllers\";\n\nconst router = Router();\n\nrouter.route(\"/cpu\").get(SystemController.getCpuInfo);\nrouter.route(\"/disk\").get(SystemController.getDiskInfo);\nrouter.route(\"/memory\").get(SystemController.getMemoryInfo);\n\nexport default router;\n", "import { Request, Response } from \"express\";\nimport si from \"systeminformation\";\n\ntype CpuData = {\n load: number;\n};\n\ntype DiskData = {\n size: number;\n used: number;\n available: number;\n};\n\ntype MemoryData = {\n total: number;\n free: number;\n used: number;\n};\n\n/**\n *\n * @param req\n * @param res\n */\nconst getCpuInfo = async (req: Request, res: Response<CpuData>) => {\n // const cpuInfo = await cpu.getCpuInfo();\n const cpuLoad = await si.currentLoad();\n\n res.status(200).send({ load: cpuLoad.currentLoad });\n};\n\n/**\n *\n * @param req\n * @param res\n */\nconst getDiskInfo = async (req: Request, res: Response<DiskData>) => {\n const disk = await si.fsSize();\n\n const rootDisk = disk.find((item) => item.mount === \"/\");\n\n if (!rootDisk) {\n throw new Error(\"Could not find root disk\");\n }\n\n const result: DiskData = {\n size: rootDisk.size,\n used: rootDisk.used,\n available: rootDisk.available,\n };\n\n res.status(200).send(result);\n};\n\n/**\n *\n * @param req\n * @param res\n */\nconst getMemoryInfo = async (req: Request, res: Response<MemoryData>) => {\n const memory = await si.mem();\n\n const result: MemoryData = {\n total: memory.total,\n free: memory.free,\n used: memory.used,\n };\n\n res.status(200).json(result);\n};\n\nexport default { getCpuInfo, getDiskInfo, getMemoryInfo };\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACCA;AAuBA,IAAM,aAAa,CAAO,KAAc,QAA2B;AAEjE,QAAM,UAAU,MAAM,GAAG,YAAY;AAErC,MAAI,OAAO,GAAG,EAAE,KAAK,EAAE,MAAM,QAAQ,YAAY,CAAC;AACpD;AAOA,IAAM,cAAc,CAAO,KAAc,QAA4B;AACnE,QAAM,OAAO,MAAM,GAAG,OAAO;AAE7B,QAAM,WAAW,KAAK,KAAK,CAAC,SAAS,KAAK,UAAU,GAAG;AAEvD,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,0BAA0B;AAAA,EAC5C;AAEA,QAAM,SAAmB;AAAA,IACvB,MAAM,SAAS;AAAA,IACf,MAAM,SAAS;AAAA,IACf,WAAW,SAAS;AAAA,EACtB;AAEA,MAAI,OAAO,GAAG,EAAE,KAAK,MAAM;AAC7B;AAOA,IAAM,gBAAgB,CAAO,KAAc,QAA8B;AACvE,QAAM,SAAS,MAAM,GAAG,IAAI;AAE5B,QAAM,SAAqB;AAAA,IACzB,OAAO,OAAO;AAAA,IACd,MAAM,OAAO;AAAA,IACb,MAAM,OAAO;AAAA,EACf;AAEA,MAAI,OAAO,GAAG,EAAE,KAAK,MAAM;AAC7B;AAEA,IAAO,4BAAQ,EAAE,YAAY,aAAa,cAAc;;;ADpExD,IAAM,SAAS,OAAO;AAEtB,OAAO,MAAM,MAAM,EAAE,IAAI,0BAAiB,UAAU;AACpD,OAAO,MAAM,OAAO,EAAE,IAAI,0BAAiB,WAAW;AACtD,OAAO,MAAM,SAAS,EAAE,IAAI,0BAAiB,aAAa;AAE1D,IAAO,wBAAQ;;;ADNf,IAAM,MAAM,QAAQ;AACpB,IAAM,OAAO;AAEb,IAAI,IAAI,WAAW,qBAAY;AAE/B,IAAI,OAAO,MAAM,MAAM;AACrB,UAAQ,IAAI,gCAAgC,MAAM;AACpD,CAAC;",
"names": []
}

28
system-api/package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "system-api",
"version": "1.0.0",
"description": "",
"main": "src/server.ts",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "esbuild --bundle src/server.ts --outdir=dist --allow-overwrite --sourcemap --platform=node --minify --analyze=verbose --external:./node_modules/* --format=esm",
"build:watch": "esbuild --bundle src/server.ts --outdir=dist --allow-overwrite --sourcemap --platform=node --external:./node_modules/* --format=esm --watch",
"start:dev": "NODE_ENV=development nodemon --trace-deprecation --trace-warnings --watch dist dist/server.js",
"dev": "concurrently \"yarn build:watch\" \"yarn start:dev\""
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.3",
"node-port-scanner": "^3.0.1",
"public-ip": "^5.0.0",
"systeminformation": "^5.11.9"
},
"devDependencies": {
"@types/express": "^4.17.13",
"concurrently": "^7.1.0",
"esbuild": "^0.14.32",
"nodemon": "^2.0.15"
}
}

View File

@ -0,0 +1 @@
export { default as SystemController } from "./system.controller";

View File

@ -0,0 +1,15 @@
import { Request, Response } from "express";
import publicIp from "public-ip";
import portScanner from "node-port-scanner";
const isPortOpen = async (req: Request, res: Response<boolean>) => {
const port = req.params.port;
const host = await publicIp.v4();
const isOpen = await portScanner(host, [port]);
console.log(port);
res.status(200).send(isOpen);
};

View File

@ -0,0 +1,72 @@
import { Request, Response } from "express";
import si from "systeminformation";
type CpuData = {
load: number;
};
type DiskData = {
size: number;
used: number;
available: number;
};
type MemoryData = {
total: number;
free: number;
used: number;
};
/**
*
* @param req
* @param res
*/
const getCpuInfo = async (req: Request, res: Response<CpuData>) => {
// const cpuInfo = await cpu.getCpuInfo();
const cpuLoad = await si.currentLoad();
res.status(200).send({ load: cpuLoad.currentLoad });
};
/**
*
* @param req
* @param res
*/
const getDiskInfo = async (req: Request, res: Response<DiskData>) => {
const disk = await si.fsSize();
const rootDisk = disk.find((item) => item.mount === "/");
if (!rootDisk) {
throw new Error("Could not find root disk");
}
const result: DiskData = {
size: rootDisk.size,
used: rootDisk.used,
available: rootDisk.available,
};
res.status(200).send(result);
};
/**
*
* @param req
* @param res
*/
const getMemoryInfo = async (req: Request, res: Response<MemoryData>) => {
const memory = await si.mem();
const result: MemoryData = {
total: memory.total,
free: memory.free,
used: memory.used,
};
res.status(200).json(result);
};
export default { getCpuInfo, getDiskInfo, getMemoryInfo };

View File

@ -0,0 +1 @@
export { default as systemRoutes } from "./system.routes";

View File

@ -0,0 +1,10 @@
import { Router } from "express";
import { SystemController } from "../controllers";
const router = Router();
router.route("/cpu").get(SystemController.getCpuInfo);
router.route("/disk").get(SystemController.getDiskInfo);
router.route("/memory").get(SystemController.getMemoryInfo);
export default router;

11
system-api/src/server.ts Normal file
View File

@ -0,0 +1,11 @@
import express from "express";
import { systemRoutes } from "./routes";
const app = express();
const port = 3001;
app.use("/system", systemRoutes);
app.listen(port, () => {
console.log(`System API listening on port ${port}`);
});

20
system-api/tsconfig.json Normal file
View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}

1685
system-api/yarn-error.log Normal file

File diff suppressed because it is too large Load Diff

1623
system-api/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

3
traefik/README.md Normal file
View File

@ -0,0 +1,3 @@
mkcert -install
mkcert -cert-file ./local-cert.pem -key-file ./local-key.pem "docker.localhost" "*.docker.localhost" "tipi.local" "*.tipi.local"

14
traefik/dynamic.yml Normal file
View File

@ -0,0 +1,14 @@
http:
routers:
traefik:
rule: "Host(`proxy.tipi.local`)"
service: "api@internal"
tls:
domains:
- main: "tipi.local"
sans:
- "*.tipi.local"
tls:
certificates:
- certFile: "/root/.config/ssl/local-cert.pem"
keyFile: "/root/.config/ssl/local-key.pem"

View File

View File

@ -0,0 +1,16 @@
{
"myresolver": {
"Account": {
"Email": "",
"Registration": {
"body": {
"status": "valid"
},
"uri": "https://acme-v02.api.letsencrypt.org/acme/acct/476208700"
},
"PrivateKey": "MIIJKAIBAAKCAgEAn42EtgYsqNgwXbt6e/Ix1er5hMUjiWOql0Cf6wQ09FRTpBTc4iKxxjINH03k8tJe501rAYliPfrBtt6TwQ4FNlPRFWULS8pTQ9Fq6Ra1QvgGgQMrwroQDd5fuXdUbWMMd0HB1SgwqY+m6xNfVZt4Wk0O0J2dmHHFeYHleztW8Bb34Sd0EjyLhIhG6FLC4hCb0s64r7TsdDz8nL0SbCZmEA1zXBPycb7QAzCi1Ruhdr2ts7+LcvbP7L6nXcAgGEMNSFp2EEOug//hwDJ9WoHdmaEUQEssghOpahK2aIY7jP4ge5vnz07/SNJaJJVVETNQm7DMjx4bANJALeECttaBt/5u4TSXWyIJ9kSKJTPLlRbH3JeC3Yo51PBGZ49Wz/IRK5zWD0IHWAdrruuYscpwiNfMuGk0C7S24GmVLTzgvcqVKtpnR3xcLbnoatln0djC7kWpbhHfPE9x5FJbkE5PfGLbG6iA88YFYtKVuzcM2o7SwdpF+vArArEPB5uH3BLYo85rv7sO182kXnOJ95ii0iQ1yj//FH1t8BOiZIvkn25wbMumv9k3iFMS+Gm4U9SRjbyR8sPgZS7LHLRPKhh0wqpBUb5X/9PHmEPaF10wS71UTJv7sRE9k82K1Oz9/NgMcHhOiU2gP5orgBJKF6TsIyrwRJiSrj3oL52OkWAKnOsCAwEAAQKCAgBElgUSah0Qh75izJCeb0JU/qk8FbJtANb4JeOYlzpcPVOnGQDKhLd+x000w7tDVoNNUs5I3tHIat6SyaMiPfCnpegfFkyAy/x3DrKyd/x7STsigkZxcqIsFAd6Jn24d/eH3FCCXMBuYz4Rl0ZH+okF6FISA28XdPC6hsgq7Rs2Iel0dA1FOZmP4zT38Xusyg7x08M4ZMGwRfchOXWN4APHqsCIOFrj4m5wsJuOmE4USP0+Y3yCcu52io5PkqM5SrmO/LP70dxXCcv1Xr7cBS9JNyEJckczs1gELP8Ud39p4GP+PsqrJv4+Q45UY40p07E2/A0zCHH7LGZCUpNkHVmtHISyrrebgvlyG0Tk/jC5v4X9gGpVz5n1h7IhrhP3NwNSZ4OgO2Kptay8M/1DFVGMS3Gp2kLqLAYhcvrikgmd22Kj+t/ZCwqGV3zAvNhe15Q1Di2VNLCtOHTazqMbt9DhP/9NfcyjhpA1r2R/afM3O4iVe9f6LwU46Y4WHICymuXzTrMHJ/8z2Jh21d2ZAB/kxqlK4755IWRUC9RRE1Vle7Hz4vyxy/L6kyFujKQ9sULnQNWOE1xAuFxGtReojPATbc1HegIRqewGAQdqbtqVFTX5s4FBMshktOKgYyQHNxyHkOerc3c0Ey2nm70uAFczhpnNS1ajkOvAnZWEo5RSIQKCAQEAyXtrYv9sAK2B0YopW13n+XUllnHjaqts2oBNvL76X0ahK6xlQoW8pLWEoU150VXwarSWTrqOhMTECjuwuDjAWk5tbs9voYbC0TqRxeujlD0TnfnU+0a27nz1E9j5b00SEP2ntn++/xMe12cVw+7GLm4PGUqSwSs33rDSkoZBBMx65TOalaS43b2/qWTRf/CD46a+Awc2DrscMTAOJBkpoz0ziFeVFrjCIxTGZ1Ng21Ti+jzxPZLk63aYFsDVtV4QxSYDSeaYEAPT4IJzhANxj3ihbv//IxcYQef+FHQwkxrFh2d1ctuHe+rnbJBssuvRCLUuXr7i5dngvI3o7d47lQKCAQEAyrmshysDyfi0q355ErcZnItDZSusNiq6zGPW3hBs+QP1PlRgHHxc5mpA0clRnIT4xqy2cN382gQW+5txtuM9CepZRHKfmRVzUsmdqzEyhVcaya8O8dSo6rvWmtEnEvIMiJmvul9olJtIPM6gFZHfwXsdplyn+9OOo+yV/Q79aqhT56vlp6DmIHWL3g9ZqKnUEBaA1WZlSQdS9MyU7WyoIEKHsZWQ9wLgcrEV7gOWauRot4eA4VVsl9SeC/XMQgGSw40HOA3/Amng/AcrjTwVLI7f+eMeB4HB52KHHkleGxwPy0oM4jIYT2EaQI+regqby4dGA2otMnpkv5RIsetWfwKCAQEAqbS0GfmsXdHHU9h8x0GMn9ilZVfeRr3HfS+uyrlNqCyUmnWmAOcmotFlunvIjKNHUolzRTLr0jbuLPRkAHeExUvj7v74NuSMebFMkZnN+ZGMUXbahx/j+3Ly9tm+F5qiCf+tYRGurajMRIDGm3cmJHt9aj8e52fgskjbxKEiaMlXBnF11m+dauBlbGfH8myCmqCa0XAkfznpICEq+ArdwGpPWpryr+XFV8kq6GMZZQTV/hKQ2907xnzo09lu6Eon8/b1tCxvjqW6tBMM+3fvEfp4d0dW/pZ4TyL6Jv5K380f7dId4jW4o46TiSUI+ZeZRS1etl0wPoxLOGaLeLfEFQKCAQAp0w7OQEii1cXoj8pI2y/UhULdT5pS/pPVcU+2NutUoMVrG5tMpTfBbfB7l65XvXNaAe4N8S6miCt5s4NNeSpxrkDGh2N4AN3vGZuG4zqKGgNz0sMhj39eFmzbOgV2uittz09bAy4fYr4PlY2fhZ4FW/ItDXa21Nnb5ga30+zioWHWLTfPUrnHvpihsscLriYLP6lK3bpNy84IpWCgb0dsiG1YbQQggh5uayycE29oFEGqg7FKTAaAeKQ20XpXr91orOLtZK3VAKUjOhN5KwkvTTbWZk4evF2V8FTyIa7hpvN3PIrV7AHp9p2k7j8xiZjE7964+6HhhTDd+ajZ1DTfAoIBAHnnLVPmFsQktM5dNcESNcJPoeZTggO+vQsHYPn6dxMxXRnzR3/vC7Be/WECq0u4k8Kt0SET5fEw3cbWIeDUNd8q+oETtePO7rPOC6DUYtEkXMoQr7lvsmfVq0qbTXsqxW1MCCB8HXUHD/uZHjueUHLBZETlB6s0r2IlRsf+8CBt9CF8hA/qZHqVqkePfP/uAe69wICDcVxdAJ/C8juMv0BY6g7+BtCAqgSqKYy4iQDP1EswwUV7z5V8HjuTmkS2Bhs0fziP1UoLq3fk86ZefB3wcYkBv8kXHPgDbpo/PaIyGeGvE8/hT7nJh50nAgwFwp8f7tcmafiNKudZVZq3Sso=",
"KeyType": "4096"
},
"Certificates": null
}
}

View File

0
traefik/ssl/.gitkeep Normal file
View File

28
traefik/traefik.yml Normal file
View File

@ -0,0 +1,28 @@
api:
dashboard: true
insecure: true
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
watch: true
exposedByDefault: false
file:
filename: /root/.config/dynamic.yml
watch: true
entryPoints:
webinsecure:
address: ":80"
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ":443"
log:
level: DEBUG