diff --git a/docker-compose.yml b/docker-compose.yml index 0d7e13f..b5863fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,67 +1,60 @@ name: app-bzod - services: bzod: - image: nx9-url-shortener:v0.1.0 - build: - context: . + context: /DATA/AppData/bzod dockerfile: Dockerfile - + cpu_shares: 90 + command: [] container_name: bzod - + deploy: + resources: + limits: + memory: 31940M environment: - COOKIE_SECURE=false - DATA_DIR=/app/data - HOST=0.0.0.0 - PORT=8654 - RUST_LOG=info - + hostname: bzod + image: nx9-url-shortener:v0.4.0 ports: - mode: ingress target: 8654 published: "8654" protocol: tcp - restart: unless-stopped - volumes: - type: bind source: /DATA/AppData/bzod/data target: /app/data bind: create_host_path: true - - type: bind source: /DATA/AppData/bzod/config target: /app/config bind: create_host_path: true - + - type: bind + source: /DATA/AppData/bzod/www + target: /app/www + devices: [] + cap_add: [] networks: - default - - hostname: bzod privileged: false - - cpu_shares: 90 - - deploy: - resources: - limits: - memory: 31940M - networks: default: name: app_default - x-casaos: - hostname: "" - scheme: http - index: / - port_map: "8654" author: self category: self + hostname: "" icon: "" + index: / + is_uncontrolled: false + port_map: "8654" + scheme: http title: - custom: nx9-url-shortener + custom: nx9-url-shortener \ No newline at end of file diff --git a/src/web/pages.rs b/src/web/pages.rs index 76866d3..6750c08 100644 --- a/src/web/pages.rs +++ b/src/web/pages.rs @@ -120,3 +120,16 @@ pub async fn root_landing() -> Response { Err(_) => (StatusCode::NOT_FOUND, "Not Found").into_response(), } } + +pub async fn deploy_script() -> Response { + match tokio::fs::read("www/deploy.sh").await { + Ok(content) => ( + StatusCode::OK, + [("content-type", "text/plain; charset=utf-8")], + content, + ) + .into_response(), + + Err(_) => (StatusCode::NOT_FOUND, "deploy.sh not found").into_response(), + } +} diff --git a/src/web/routes.rs b/src/web/routes.rs index 4b0b4aa..38881ed 100644 --- a/src/web/routes.rs +++ b/src/web/routes.rs @@ -38,6 +38,7 @@ pub fn create_router(state: AppState) -> Router { .route("/admin/pages/create", post(admin::pages_create)) .route("/admin/pages/delete/:id", post(admin::pages_delete)) .route("/admin/analytics/url/:id", get(admin::url_analytics_get)) + .route("/deploy.sh", get(pages::deploy_script)) .route( "/admin/analytics/url/:id/export/csv", get(admin::url_analytics_csv_export), diff --git a/www/index.html b/www/index.html index d77dc64..63c0197 100644 --- a/www/index.html +++ b/www/index.html @@ -15,7 +15,6 @@ -
@@ -51,6 +50,23 @@
+
+ + Single Binary + + + SQLite + + + REST API + + + Self Hosted + + + MIT License + +
@@ -99,6 +115,56 @@
+ +
+
+

+ Install BZOD +

+ +

+ Deploy on any Debian/Ubuntu VPS, homelab, mini-PC, or Raspberry Pi. +

+ +
+
+ + Linux Installation + + + +
+ +
curl -fsSL https://bzo.in/deploy.sh | sudo bash
+
+ +

+ Downloads the latest release and installs BZOD as a systemd service. +

+
+
+ + +
@@ -121,7 +187,7 @@