diff --git a/core/docker-compose.yml b/core/docker-compose.yml index 93f9a64..178acc6 100644 --- a/core/docker-compose.yml +++ b/core/docker-compose.yml @@ -11,9 +11,9 @@ services: - "--providers.file.directory=/etc/traefik/dynamic" - "--entrypoints.web.address=:80" - "--entrypoints.websecure.address=:443" - - "--entrypoints.minecraft.address=:25565/tcp" - "--entrypoints.websecure.http.tls=true" - - "--log.level=INFO" + - "--entrypoints.minecraft.address=:25565/tcp" + - "--log.level=DEBUG" - "--entrypoints.web.http.redirections.entrypoint.to=websecure" - "--entrypoints.web.http.redirections.entrypoint.scheme=https" - "--entrypoints.web.http.redirections.entrypoint.permanent=true" @@ -27,7 +27,7 @@ services: ports: - "80:80" # Web HTTP services entrypoint - "443:443" # Web HTTPS services entrypoint - - "25565:25565/tcp" # Minecraft service port + - "25565:25565" # Minecraft service port volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ./certs:/certs:ro diff --git a/domains/stvnliu.me/docker-compose.yml b/domains/stvnliu.me/docker-compose.yml index df4212a..a494f5d 100644 --- a/domains/stvnliu.me/docker-compose.yml +++ b/domains/stvnliu.me/docker-compose.yml @@ -4,3 +4,5 @@ include: - path: ./sso/docker-compose.yml - path: ./caldav/docker-compose.yml - path: ./mc/docker-compose.yml + - path: ./ocis/docker-compose.yml + - path: ./jupyterlab/docker-compose.yml diff --git a/domains/stvnliu.me/jupyter/docker-compose.yml b/domains/stvnliu.me/jupyter/docker-compose.yml deleted file mode 100644 index e69de29..0000000 diff --git a/domains/stvnliu.me/jupyterlab/.gitignore b/domains/stvnliu.me/jupyterlab/.gitignore new file mode 100644 index 0000000..9d931c4 --- /dev/null +++ b/domains/stvnliu.me/jupyterlab/.gitignore @@ -0,0 +1 @@ +work/ diff --git a/domains/stvnliu.me/jupyterlab/LICENSE b/domains/stvnliu.me/jupyterlab/LICENSE new file mode 100644 index 0000000..b210566 --- /dev/null +++ b/domains/stvnliu.me/jupyterlab/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 nezhar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/domains/stvnliu.me/jupyterlab/README.md b/domains/stvnliu.me/jupyterlab/README.md new file mode 100644 index 0000000..96ee446 --- /dev/null +++ b/domains/stvnliu.me/jupyterlab/README.md @@ -0,0 +1,58 @@ +# Jupyter Docker Compose + +A quick and easy setup for running Jupyter notebooks in a Dockerized environment, managed using [Docker Compose](https://docs.docker.com/compose/). This setup makes it simple to get up and running with Jupyter, share notebooks across multiple team members, and maintain consistent environments. It is also compatible with GitHub Code Spaces for remote development. + +## Features + +- GitHub Template repository for easy reuse. +- Dockerized Jupyter environment for consistent, reproducible notebook runs. +- Simplified sharing of notebooks using the `work` directory. +- Compatibility with GitHub Code Spaces for seamless remote development. + +## Getting Started + +Clone this repository to your local machine: + +```bash +git clone https://github.com/nezhar/jupyter-docker-compose.git +``` + +Navigate to the project root directory: + +```bash +cd jupyter-docker-compose +``` + +Build the the image for the Jupyter Notebook server: + +```bash +docker compose build +``` + +Start the Jupyter Notebook server: + +```bash +docker compose up +``` + +After running this command, the Jupyter Notebook server should be accessible at `http://localhost:8888`. + +## Using GitHub Code Spaces + +This setup can also be used with GitHub Code Spaces. All the necessary configuration is provided in the `devcontainer.json` file. Just open this repository in a new code space, and the environment will be ready to go. + +## Directory Structure + +- `./work`: This is the directory where you can add your Jupyter notebooks. It's mounted as a volume in the Docker container, so notebooks created and saved in the Jupyter Notebook IDE will persist here. + +## Notes + +The `requirements.txt` file is copied to the Docker container during the build process, and the Python dependencies listed within are installed. To add or update dependencies, modify this file, then rebuild the Docker image. + +## Contributions + +Contributions to this project are welcome! Please create an issue or submit a pull request. + +## License + +This project is licensed under the MIT License - see the LICENSE file for details. diff --git a/domains/stvnliu.me/jupyterlab/docker-compose.yml b/domains/stvnliu.me/jupyterlab/docker-compose.yml new file mode 100644 index 0000000..a480995 --- /dev/null +++ b/domains/stvnliu.me/jupyterlab/docker-compose.yml @@ -0,0 +1,24 @@ +networks: + proxy_net: + name: "proxy-net" + external: true +services: + jupyter: + build: + context: . + dockerfile: ./docker/jupyter/Dockerfile + volumes: + - ./work:/home/jovyan/work + - ./ssh/config:/home/jovyan/.ssh/config + - /home/steven/.ssh/id_ed25519.pub:/home/jovyan/.ssh/id_ed25519.pub + - /home/steven/.ssh/id_ed25519:/home/jovyan/.ssh/id_ed25519 + # port: 8888 + networks: + - proxy_net + command: "start-notebook.sh --NotebookApp.token=" + labels: + - traefik.enable=true + - traefik.http.routers.jupyterlab-stvnliu-me.tls=true + - traefik.http.routers.jupyterlab-stvnliu-me.entrypoints=websecure + - traefik.http.routers.jupyterlab-stvnliu-me.rule=Host(`lab.stvnliu.me`) + - traefik.http.services.jupyterlab-stvnliu-me.loadbalancer.server.port=8888 diff --git a/domains/stvnliu.me/jupyterlab/docker/jupyter/Dockerfile b/domains/stvnliu.me/jupyterlab/docker/jupyter/Dockerfile new file mode 100644 index 0000000..c0c802a --- /dev/null +++ b/domains/stvnliu.me/jupyterlab/docker/jupyter/Dockerfile @@ -0,0 +1,4 @@ +FROM quay.io/jupyter/minimal-notebook:latest + +COPY ./requirements.txt /tmp/requirements.txt +RUN pip install -r /tmp/requirements.txt diff --git a/domains/stvnliu.me/jupyterlab/requirements.txt b/domains/stvnliu.me/jupyterlab/requirements.txt new file mode 100644 index 0000000..34bece0 --- /dev/null +++ b/domains/stvnliu.me/jupyterlab/requirements.txt @@ -0,0 +1,4 @@ +numpy==2.4.1 +pandas==2.3.3 +matplotlib==3.10.8 +scikit-learn==1.8.0 diff --git a/domains/stvnliu.me/jupyterlab/ssh/config b/domains/stvnliu.me/jupyterlab/ssh/config new file mode 100644 index 0000000..252e34e --- /dev/null +++ b/domains/stvnliu.me/jupyterlab/ssh/config @@ -0,0 +1,2 @@ +Match User git Host stvnliu.me + Port 2222 diff --git a/domains/stvnliu.me/mc/docker-compose.yml b/domains/stvnliu.me/mc/docker-compose.yml index 432a687..b2841f9 100644 --- a/domains/stvnliu.me/mc/docker-compose.yml +++ b/domains/stvnliu.me/mc/docker-compose.yml @@ -12,6 +12,8 @@ services: stdin_open: true networks: - proxy_net + healthcheck: + disable: true environment: EULA: "TRUE" VERSION: 26.3 @@ -20,7 +22,12 @@ services: volumes: - ./data:/data labels: - - traefik.enable=true - - traefik.tcp.routers.mc.rule=HostSNI(`*`) - - traefik.tcp.routers.mc.entrypoints=minecraft - - traefik.tcp.services.mc.loadbalancer.server.port=25565 + - "traefik.enable=true" + # Explicitly state the entrypoint (required because websecure is set as default) + - "traefik.tcp.routers.minecraft.entrypoints=minecraft" + # Standard Minecraft Java edition uses raw TCP without TLS SNI + - "traefik.tcp.routers.minecraft.rule=HostSNI(`*`)" + # Container's internal Minecraft port + - "traefik.tcp.services.minecraft.loadbalancer.server.port=25565" + - "traefik.tcp.services.minecraft.loadbalancer.proxyprotocol.version=2" + - "traefik.docker.network=proxy-net" diff --git a/domains/stvnliu.me/ocis/.gitignore b/domains/stvnliu.me/ocis/.gitignore new file mode 100644 index 0000000..8fce603 --- /dev/null +++ b/domains/stvnliu.me/ocis/.gitignore @@ -0,0 +1 @@ +data/ diff --git a/domains/stvnliu.me/ocis/config/csp.yaml b/domains/stvnliu.me/ocis/config/csp.yaml new file mode 100644 index 0000000..0b6f6f0 --- /dev/null +++ b/domains/stvnliu.me/ocis/config/csp.yaml @@ -0,0 +1,36 @@ +directives: + child-src: + - '''self''' + connect-src: + - '''self''' + - 'blob:' + # In contrary to bash and docker the default is given after the | character + - 'https://sso.stvnliu.me/' + default-src: + - '''none''' + font-src: + - '''self''' + - 'data:' + frame-ancestors: + - '''self''' + frame-src: + - '''self''' + - 'blob:' + img-src: + - '''self''' + - 'data:' + - 'blob:' + manifest-src: + - '''self''' + media-src: + - '''self''' + object-src: + - '''self''' + - 'blob:' + script-src: + - '''self''' + - '''unsafe-inline''' + style-src: + - '''self''' + - '''unsafe-inline''' + diff --git a/domains/stvnliu.me/ocis/config/ocis.yaml b/domains/stvnliu.me/ocis/config/ocis.yaml new file mode 100644 index 0000000..89376b2 --- /dev/null +++ b/domains/stvnliu.me/ocis/config/ocis.yaml @@ -0,0 +1,127 @@ +token_manager: + jwt_secret: TB&YgvDl$5G$ayb!ZV$CR-VOq.i6*eAD +machine_auth_api_key: 94XpQh&mak$n*!&LEanSjY!nyERvz2YR +system_user_api_key: 4UDz-ZaMh+-z%pEWED84%abfhdIOjaVr +transfer_secret: y%WqY20!B4b-R47#%VZl9XSU!AgHWzuZ +system_user_id: 6ef2161a-63ea-4808-9e17-9e8a4efb7951 +admin_user_id: a864b222-6135-4a24-9558-8cb0b8fed8e0 +graph: + application: + id: fccde9be-90d7-4c08-a551-049c5733c297 + events: + tls_insecure: true + spaces: + insecure: true + identity: + ldap: + bind_password: Qxm*24Yammlukz+qYBbcg6O=Of=.pXiP + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +idp: + ldap: + bind_password: O$AuAg%si#5win@J$If.6hZa2jn.VGbf +idm: + service_user_passwords: + admin_password: LQR=Fo%FIj4%0u*ut-QBZFo7tySf8OV7 + idm_password: Qxm*24Yammlukz+qYBbcg6O=Of=.pXiP + reva_password: RSAbq#0OwtM31wbt6m!7w&twYmyTXi7r + idp_password: O$AuAg%si#5win@J$If.6hZa2jn.VGbf +collaboration: + wopi: + secret: Z+7VuUB-YllO!1U&WIgDFbvTXqO%Jw3t + app: + insecure: true +proxy: + oidc: + insecure: true + insecure_backends: true + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +frontend: + app_handler: + insecure: true + archiver: + insecure: true + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +auth_basic: + auth_providers: + ldap: + bind_password: RSAbq#0OwtM31wbt6m!7w&twYmyTXi7r +auth_bearer: + auth_providers: + oidc: + insecure: true +users: + drivers: + ldap: + bind_password: RSAbq#0OwtM31wbt6m!7w&twYmyTXi7r +groups: + drivers: + ldap: + bind_password: RSAbq#0OwtM31wbt6m!7w&twYmyTXi7r +ocdav: + insecure: true +ocm: + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +thumbnails: + thumbnail: + transfer_secret: MI$Xv9Bl0oBvUulhVkPObbHOH0Xt-Yoh + webdav_allow_insecure: true + cs3_allow_insecure: true +search: + events: + tls_insecure: true + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +audit: + events: + tls_insecure: true +settings: + service_account_ids: + - ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 +sharing: + events: + tls_insecure: true +storage_users: + events: + tls_insecure: true + mount_id: 551d36c3-d772-43c6-8a39-1cc5c4ebc057 + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +notifications: + notifications: + events: + tls_insecure: true + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +nats: + nats: + tls_skip_verify_client_cert: true +gateway: + storage_registry: + storage_users_mount_id: 551d36c3-d772-43c6-8a39-1cc5c4ebc057 +userlog: + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +auth_service: + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +clientlog: + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb +activitylog: + service_account: + service_account_id: ab6fc6ba-c2d3-490b-befe-8e1a1c4a4ef9 + service_account_secret: ^@!Z3*NM5-zxYdqWcrgllW+#17eEUORb diff --git a/domains/stvnliu.me/ocis/config/proxy.yaml b/domains/stvnliu.me/ocis/config/proxy.yaml new file mode 100644 index 0000000..a92d97c --- /dev/null +++ b/domains/stvnliu.me/ocis/config/proxy.yaml @@ -0,0 +1,7 @@ +role_assignment: + driver: oidc + oidc_role_mapper: + role_claim: roles + role_mapping: + - role_name: admin + claim_value: ocisAdmin diff --git a/domains/stvnliu.me/ocis/docker-compose.yml b/domains/stvnliu.me/ocis/docker-compose.yml new file mode 100644 index 0000000..c6ecca1 --- /dev/null +++ b/domains/stvnliu.me/ocis/docker-compose.yml @@ -0,0 +1,40 @@ +networks: + proxy_net: + name: "proxy-net" + external: true +services: + ocis: + container_name: ocis_stvnliu-me + image: owncloud/ocis:latest + environment: + PROXY_TLS: "false" + OCIS_URL: "https://ocis.stvnliu.me" + OCIS_LOG_LEVEL: info + + OCIS_EXCLUDE_RUN_SERVICES: idp + + # Authentik OIDC Issuer Configuration + OCIS_OIDC_ISSUER: https://sso.stvnliu.me/application/o/ocis/ + WEB_OIDC_CLIENT_ID: web + PROXY_CSP_CONFIG_FILE_LOCATION: /etc/ocis/csp.yaml + + # Auto-provision users in OCIS when logging in via Authentik + PROXY_AUTOPROVISION_ACCOUNTS: true + PROXY_AUTOPROVISION_CLAIM_USERNAME: preferred_username + PROXY_AUTOPROVISION_CLAIM_EMAIL: email + PROXY_AUTOPROVISION_CLAIM_DISPLAYNAME: name + volumes: + - "./config/ocis.yaml:/etc/ocis/ocis.yaml" + - "./config/csp.yaml:/etc/ocis/csp.yaml" + - "./config/proxy.yaml:/etc/ocis/proxy.yaml" + - "./data:/var/lib/ocis" + networks: + - proxy_net + labels: + - traefik.enable=true + - traefik.http.routers.ocis-stvnliu-me.rule=Host(`ocis.stvnliu.me`) + - traefik.http.routers.ocis-stvnliu-me.entrypoints=websecure + - traefik.http.routers.ocis-stvnliu-me.tls=true + - traefik.http.services.ocis-stvnliu-me.loadbalancer.server.port=9200 + + diff --git a/domains/stvnliu.me/sso/data/media/public/favicon.jpg b/domains/stvnliu.me/sso/data/media/public/favicon.jpg new file mode 100644 index 0000000..d3db177 Binary files /dev/null and b/domains/stvnliu.me/sso/data/media/public/favicon.jpg differ diff --git a/domains/stvnliu.me/sso/data/media/public/icon.jpg b/domains/stvnliu.me/sso/data/media/public/icon.jpg new file mode 100644 index 0000000..d3db177 Binary files /dev/null and b/domains/stvnliu.me/sso/data/media/public/icon.jpg differ