From 51a014e14c7a49eaad4eb79e296b8dbeb9c4a487 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Fri, 23 Aug 2024 21:26:02 +0200 Subject: [PATCH] Add linkstack and privatebin Signed-off-by: Bensuperpc --- Makefile | 2 +- README.md | 5 ++++ .../caddy/config/bensuperpc.org/Caddyfile | 16 ++++++++++ .../it-tools/docker-compose.it-tools.yml | 3 +- infrastructure/it-tools/env/it-tools.env | 2 -- .../linkstack/docker-compose.linkstack.yml | 30 +++++++++++++++++++ infrastructure/linkstack/env/linkstack.env | 7 +++++ .../privatebin/docker-compose.privatebin.yml | 29 ++++++++++++++++++ 8 files changed, 89 insertions(+), 5 deletions(-) delete mode 100644 infrastructure/it-tools/env/it-tools.env create mode 100644 infrastructure/linkstack/docker-compose.linkstack.yml create mode 100644 infrastructure/linkstack/env/linkstack.env create mode 100644 infrastructure/privatebin/docker-compose.privatebin.yml diff --git a/Makefile b/Makefile index 90c06b5..211023f 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ DOCKER := docker -PROFILES := caddy wordpress adminer syncthing uptime-kuma jellyfin qbittorrent psitransfer gitea it-tools watchtower +PROFILES := caddy wordpress adminer syncthing uptime-kuma jellyfin qbittorrent psitransfer gitea it-tools privatebin linkstack watchtower PROFILE_CMD := $(addprefix --profile ,$(PROFILES)) # gitea-runner transmission diff --git a/README.md b/README.md index 13c8157..256e5a6 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ If you have any **questions** or **suggestions**, feel free to open an issue or - [x] SyncThing (File synchronization) - [x] PsiTransfer (File sharing) - [x] it-tools (Tools for IT) +- [x] Privatebin (Pastebin) ## Screenshots @@ -77,6 +78,7 @@ And then, caddy will generate the certificate for you and renew it automatically | [syncthing.bensuperpc.org](https://syncthing.bensuperpc.org) | Sub | SyncThing for file synchronization | | [psitransfer.bensuperpc.org](https://psitransfer.bensuperpc.org) | Sub | PsiTransfer for file sharing | | [it-tools.bensuperpc.org](https://it-tools.bensuperpc.org) | Sub | Tools for IT | +| [privatebin.bensuperpc.org](https://privatebin.bensuperpc.org) | Sub | Pastebin | | bensuperpc.com | Main | Redirect to bensuperpc.org | | bensuperpc.fr | Main | Redirect to bensuperpc.org | | bensuperpc.net | Main | Redirect to bensuperpc.org | @@ -181,6 +183,7 @@ You can find all service on this table: | SyncThing | SyncThing for file synchronization | [syncthing.bensuperpc.org](https://syncthing.bensuperpc.org) | | PsiTransfer | PsiTransfer for file sharing | [psitransfer.bensuperpc.org](https://psitransfer.bensuperpc.org) | | it-tools | Tools for IT | [it-tools.bensuperpc.org](https://it-tools.bensuperpc.org) | +| Privatebin | Pastebin | [privatebin.bensuperpc.org](https://privatebin.bensuperpc.org) | You can disable some services by removing the service name in PROFILES variable in the [Makefile](Makefile) file. @@ -208,6 +211,8 @@ To enable the gitea CI: https://medium.com/@lokanx/how-to-build-docker-container - [SyncThing](https://syncthing.net/) - [PsiTransfer](https://psitransfer.com/) - [It-tools](https://github.com/CorentinTh/it-tools) +- [Privatebin](https://github.com/PrivateBin/PrivateBin) +- [Linkstack](https://linkstack.org) - [Imagisphe](https://imagisphe.re/) ## License diff --git a/infrastructure/caddy/config/bensuperpc.org/Caddyfile b/infrastructure/caddy/config/bensuperpc.org/Caddyfile index f5d4070..ff818c6 100644 --- a/infrastructure/caddy/config/bensuperpc.org/Caddyfile +++ b/infrastructure/caddy/config/bensuperpc.org/Caddyfile @@ -93,6 +93,22 @@ tools.bensuperpc.org { redir https://it-tools.bensuperpc.org permanent } +privatebin.bensuperpc.org { + reverse_proxy privatebin:8080 +} + +pastebin.bensuperpc.org { + redir https://privatebin.bensuperpc.org permanent +} + +linkstack.bensuperpc.org { + reverse_proxy linkstack:443 { + transport http { + tls_insecure_skip_verify + } + } +} + link.bensuperpc.org { # TODO: Use service with database # Friendly links diff --git a/infrastructure/it-tools/docker-compose.it-tools.yml b/infrastructure/it-tools/docker-compose.it-tools.yml index 5776805..5398724 100644 --- a/infrastructure/it-tools/docker-compose.it-tools.yml +++ b/infrastructure/it-tools/docker-compose.it-tools.yml @@ -8,12 +8,11 @@ services: restart: on-failure:5 depends_on: - caddy - env_file: - - ./it-tools/env/it-tools.env networks: - infra-network security_opt: - no-new-privileges:true + read_only: true deploy: resources: limits: diff --git a/infrastructure/it-tools/env/it-tools.env b/infrastructure/it-tools/env/it-tools.env deleted file mode 100644 index 4032ffe..0000000 --- a/infrastructure/it-tools/env/it-tools.env +++ /dev/null @@ -1,2 +0,0 @@ -PSITRANSFER_ADMIN_PASS=n9jLVNT9QUotTJTT91JqH4GyBTg9pvEn -#PSITRANSFER_PORT=3000 diff --git a/infrastructure/linkstack/docker-compose.linkstack.yml b/infrastructure/linkstack/docker-compose.linkstack.yml new file mode 100644 index 0000000..9dcb75b --- /dev/null +++ b/infrastructure/linkstack/docker-compose.linkstack.yml @@ -0,0 +1,30 @@ +services: + # linkstack + linkstack: + image: linkstackorg/linkstack:latest + container_name: linkstack + profiles: + - linkstack + restart: on-failure:5 + depends_on: + - caddy + env_file: + - ./linkstack/env/linkstack.env + volumes: + - linkstack_data:/htdocs + networks: + - infra-network + security_opt: + - no-new-privileges:true + deploy: + resources: + limits: + cpus: '0.5' + memory: 512M + reservations: + cpus: '0.001' + memory: 20M + +volumes: + linkstack_data: + name: linkstack_data \ No newline at end of file diff --git a/infrastructure/linkstack/env/linkstack.env b/infrastructure/linkstack/env/linkstack.env new file mode 100644 index 0000000..9cf68f3 --- /dev/null +++ b/infrastructure/linkstack/env/linkstack.env @@ -0,0 +1,7 @@ +HTTP_SERVER_NAME="linkstack.bensuperpc.org" +HTTPS_SERVER_NAME="linkstack.bensuperpc.org" +TZ="Europe/Paris" +PHP_MEMORY_LIMIT="512M" +UPLOAD_MAX_FILESIZE="8M" +LOG_LEVEL="info" +SERVER_ADMIN="bensuperpc@gmail.com" diff --git a/infrastructure/privatebin/docker-compose.privatebin.yml b/infrastructure/privatebin/docker-compose.privatebin.yml new file mode 100644 index 0000000..305cbab --- /dev/null +++ b/infrastructure/privatebin/docker-compose.privatebin.yml @@ -0,0 +1,29 @@ +services: + # privatebin + privatebin: + image: privatebin/nginx-fpm-alpine:latest + container_name: privatebin + profiles: + - privatebin + restart: on-failure:5 + depends_on: + - caddy + volumes: + - privatebin_data:/srv/data + networks: + - infra-network + security_opt: + - no-new-privileges:true + read_only: true + deploy: + resources: + limits: + cpus: '0.5' + memory: 512M + reservations: + cpus: '0.001' + memory: 20M + +volumes: + privatebin_data: + name: privatebin_data \ No newline at end of file