diff --git a/.env.production.example b/.env.production.example index 5f8ddc9..b56d734 100644 --- a/.env.production.example +++ b/.env.production.example @@ -2,7 +2,7 @@ CONTAINER_NAME=universal-web REVERSE_PROXY_NETWORK= UPLOADS_VOLUME_NAME=universal_web_uploads -APP_HOST=https://gitara.farmeris.sk +APP_HOST=https://eshop.example.com PORT=5150 SERVER_BINDING=0.0.0.0 diff --git a/Caddyfile b/Caddyfile index 96922db..4f67a47 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,4 +1,4 @@ -gitara.farmeris.sk { +eshop.example.com { encode gzip @static path /static/* @@ -6,9 +6,9 @@ gitara.farmeris.sk { rewrite /favicon.ico /static/favicon/favicon.ico - reverse_proxy gitara-web:5150 + reverse_proxy kompress:5150 } -www.gitara.farmeris.sk { - redir https://gitara.farmeris.sk{uri} permanent +eshop.example.com { + redir https://eshop.example.com{uri} permanent } diff --git a/Cargo.lock b/Cargo.lock index bd7a600..89b6c53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1523,36 +1523,6 @@ dependencies = [ "wasip3", ] -[[package]] -name = "gitara_web" -version = "0.1.0" -dependencies = [ - "async-trait", - "axum", - "axum-extra", - "bytes", - "chrono", - "dotenvy", - "fluent-templates", - "include_dir", - "insta", - "loco-rs", - "migration", - "regex", - "rstest", - "sea-orm", - "serde", - "serde_json", - "serial_test", - "time", - "tokio", - "tracing", - "tracing-subscriber", - "unic-langid", - "uuid", - "validator", -] - [[package]] name = "glob" version = "0.3.3" @@ -2124,6 +2094,36 @@ dependencies = [ "simple_asn1", ] +[[package]] +name = "kompress_eshop" +version = "0.1.0" +dependencies = [ + "async-trait", + "axum", + "axum-extra", + "bytes", + "chrono", + "dotenvy", + "fluent-templates", + "include_dir", + "insta", + "loco-rs", + "migration", + "regex", + "rstest", + "sea-orm", + "serde", + "serde_json", + "serial_test", + "time", + "tokio", + "tracing", + "tracing-subscriber", + "unic-langid", + "uuid", + "validator", +] + [[package]] name = "kqueue" version = "1.1.1" diff --git a/Cargo.toml b/Cargo.toml index 705229a..243ff2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [workspace] [package] -name = "gitara_web" +name = "kompress_eshop" version = "0.1.0" edition = "2021" publish = false -default-run = "gitara_web-cli" +default-run = "kompress-eshop-cli" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -45,7 +45,7 @@ axum-extra = { version = "0.10", features = ["form"] } bytes = { version = "1" } [[bin]] -name = "gitara_web-cli" +name = "kompress-eshop-cli" path = "src/bin/main.rs" required-features = [] diff --git a/Dockerfile b/Dockerfile index f1fbf19..e56cf59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /usr/src COPY . . -RUN cargo build --release --bin gitara_web-cli +RUN cargo build --release --bin kompress-cli FROM debian:bookworm-slim @@ -17,9 +17,9 @@ WORKDIR /usr/app COPY --from=builder /usr/src/assets assets COPY --from=builder /usr/src/config config -COPY --from=builder /usr/src/target/release/gitara_web-cli gitara_web-cli +COPY --from=builder /usr/src/target/release/kompress-cli kompress-cli ENV LOCO_ENV=production EXPOSE 5150 -ENTRYPOINT ["/usr/app/gitara_web-cli"] +ENTRYPOINT ["/usr/app/kompress-cli"] CMD ["start"] diff --git a/assets/i18n/en-US/main.ftl b/assets/i18n/en-US/main.ftl index fb4979f..e483bdf 100644 --- a/assets/i18n/en-US/main.ftl +++ b/assets/i18n/en-US/main.ftl @@ -1,6 +1,6 @@ -brand = My guitar +brand = Kompress eshop hello-world = Hello world! -meta-description = A guitar player's personal site. News, blog posts, albums, and songs in one place. +meta-description = Kompress eshop nav-home = Home nav-about = About nav-blog = Blog diff --git a/assets/i18n/en/main.ftl b/assets/i18n/en/main.ftl index b82bab3..cbe6be4 100644 --- a/assets/i18n/en/main.ftl +++ b/assets/i18n/en/main.ftl @@ -1,6 +1,6 @@ -brand = My guitar +brand = Kompress eshop hello-world = Hello world! -meta-description = A guitar player's personal site. News, blog posts, albums, and songs in one place. +meta-description = Kompress eshop nav-home = Home nav-about = About nav-blog = Blog diff --git a/assets/i18n/sk/main.ftl b/assets/i18n/sk/main.ftl index e940352..1d74e65 100644 --- a/assets/i18n/sk/main.ftl +++ b/assets/i18n/sk/main.ftl @@ -1,6 +1,6 @@ -brand = Moja gitara +brand = Kompress eshop hello-world = Ahoj svet! -meta-description = Osobná stránka gitaristu. Novinky, blog, albumy a skladby na jednom mieste. +meta-description = Kompress eshop nav-home = Domov nav-about = O mne nav-blog = Blog diff --git a/config/development.yaml b/config/development.yaml index 11fb1c8..cc8ae30 100644 --- a/config/development.yaml +++ b/config/development.yaml @@ -71,7 +71,7 @@ mailer: # Database Configuration database: # Database connection URI - uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/gitara_web_development") }} + uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/kompress_eshop_development") }} # When enabled, the sql query will be logged. enable_logging: false # Set the timeout duration when acquiring a connection. diff --git a/config/test.yaml b/config/test.yaml index 545d337..aaa5904 100644 --- a/config/test.yaml +++ b/config/test.yaml @@ -68,7 +68,7 @@ mailer: # Database Configuration database: # Database connection URI - uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/gitara_web_test") }} + uri: {{ get_env(name="DATABASE_URL", default="postgres://uni_loco_web_user:3@localhost:5432/kompress_eshop_test") }} # When enabled, the sql query will be logged. enable_logging: false # Set the timeout duration when acquiring a connection. diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 2728832..e227687 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,6 +1,6 @@ services: - gitara-web: - container_name: gitara-web + kompress: + container_name: kompress build: context: . dockerfile: Dockerfile @@ -9,9 +9,9 @@ services: env_file: - .env.production volumes: - - gitara_web_data:/usr/app/data + - kompress_eshop_data:/usr/app/data networks: - - gitara-net + - kompress_eshop-net restart: unless-stopped healthcheck: test: ["CMD-SHELL", "curl -fsS http://localhost:5150/_ping"] @@ -21,10 +21,10 @@ services: start_period: 20s networks: - gitara-net: + kompress_eshop-net: external: true volumes: - gitara_web_data: + kompress_eshop_data: external: true - name: gitara_web_data + name: kompress_eshop_data diff --git a/examples/playground.rs b/examples/playground.rs index dcf7eab..0dfe1d0 100644 --- a/examples/playground.rs +++ b/examples/playground.rs @@ -1,6 +1,6 @@ #[allow(unused_imports)] use loco_rs::{cli::playground, prelude::*}; -use gitara_web::app::App; +use kompress_eshop::app::App; #[tokio::main] async fn main() -> loco_rs::Result<()> { diff --git a/flake.nix b/flake.nix index dd420d3..ab6d0c4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Development Nix flake for the gitara_web (kompress_eshop) loco-rs app"; + description = "Development Nix flake for the kompress (kompress_eshop) loco-rs app"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -41,8 +41,8 @@ cargo = pkgs.rust-bin.stable.latest.minimal; rustc = pkgs.rust-bin.stable.latest.minimal; }; - gitara-web = rustPlatform.buildRustPackage { - pname = "gitara_web"; + kompress = rustPlatform.buildRustPackage { + pname = "kompress_eshop"; inherit version; src = ./.; cargoLock.lockFile = ./Cargo.lock; @@ -57,7 +57,7 @@ ]; # Build only the application binary. - cargoBuildFlags = [ "--bin" "gitara_web-cli" ]; + cargoBuildFlags = [ "--bin" "kompress-eshop-cli" ]; # Tests need a database/runtime environment; skip during the build. doCheck = false; @@ -66,8 +66,8 @@ }; in { - gitara-web = gitara-web; - default = gitara-web; + kompress = kompress; + default = kompress; } ); diff --git a/src/bin/main.rs b/src/bin/main.rs index 334a43f..312a88e 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -1,6 +1,6 @@ use loco_rs::cli; use migration::Migrator; -use gitara_web::app::App; +use kompress_eshop::app::App; #[tokio::main] async fn main() -> loco_rs::Result<()> { diff --git a/src/fixtures/users.yaml b/src/fixtures/users.yaml index 8f5b5ed..c8331ba 100644 --- a/src/fixtures/users.yaml +++ b/src/fixtures/users.yaml @@ -1,17 +1,19 @@ --- -- id: 1 +- id: 2 pid: 11111111-1111-1111-1111-111111111111 email: user1@example.com password: "$argon2id$v=19$m=19456,t=2,p=1$ETQBx4rTgNAZhSaeYZKOZg$eYTdH26CRT6nUJtacLDEboP0li6xUwUF/q5nSlQ8uuc" api_key: lo-95ec80d7-cb60-4b70-9b4b-9ef74cb88758 name: user1 + theme: light created_at: "2023-11-12T12:34:56.789Z" updated_at: "2023-11-12T12:34:56.789Z" -- id: 2 +- id: 3 pid: 22222222-2222-2222-2222-222222222222 email: user2@example.com password: "$argon2id$v=19$m=19456,t=2,p=1$ETQBx4rTgNAZhSaeYZKOZg$eYTdH26CRT6nUJtacLDEboP0li6xUwUF/q5nSlQ8uuc" api_key: lo-153561ca-fa84-4e1b-813a-c62526d0a77e name: user2 + theme: light created_at: "2023-11-12T12:34:56.789Z" updated_at: "2023-11-12T12:34:56.789Z" diff --git a/tests/models/categories.rs b/tests/models/categories.rs index e368f28..654bf42 100644 --- a/tests/models/categories.rs +++ b/tests/models/categories.rs @@ -1,4 +1,4 @@ -use gitara_web::app::App; +use kompress_eshop::app::App; use loco_rs::testing::prelude::*; use serial_test::serial; diff --git a/tests/models/order_items.rs b/tests/models/order_items.rs index e368f28..654bf42 100644 --- a/tests/models/order_items.rs +++ b/tests/models/order_items.rs @@ -1,4 +1,4 @@ -use gitara_web::app::App; +use kompress_eshop::app::App; use loco_rs::testing::prelude::*; use serial_test::serial; diff --git a/tests/models/orders.rs b/tests/models/orders.rs index e368f28..654bf42 100644 --- a/tests/models/orders.rs +++ b/tests/models/orders.rs @@ -1,4 +1,4 @@ -use gitara_web::app::App; +use kompress_eshop::app::App; use loco_rs::testing::prelude::*; use serial_test::serial; diff --git a/tests/models/product_images.rs b/tests/models/product_images.rs index e368f28..654bf42 100644 --- a/tests/models/product_images.rs +++ b/tests/models/product_images.rs @@ -1,4 +1,4 @@ -use gitara_web::app::App; +use kompress_eshop::app::App; use loco_rs::testing::prelude::*; use serial_test::serial; diff --git a/tests/models/product_tags.rs b/tests/models/product_tags.rs index e368f28..654bf42 100644 --- a/tests/models/product_tags.rs +++ b/tests/models/product_tags.rs @@ -1,4 +1,4 @@ -use gitara_web::app::App; +use kompress_eshop::app::App; use loco_rs::testing::prelude::*; use serial_test::serial; diff --git a/tests/models/products.rs b/tests/models/products.rs index e368f28..654bf42 100644 --- a/tests/models/products.rs +++ b/tests/models/products.rs @@ -1,4 +1,4 @@ -use gitara_web::app::App; +use kompress_eshop::app::App; use loco_rs::testing::prelude::*; use serial_test::serial; diff --git a/tests/models/shipping_methods.rs b/tests/models/shipping_methods.rs index e368f28..654bf42 100644 --- a/tests/models/shipping_methods.rs +++ b/tests/models/shipping_methods.rs @@ -1,4 +1,4 @@ -use gitara_web::app::App; +use kompress_eshop::app::App; use loco_rs::testing::prelude::*; use serial_test::serial; diff --git a/tests/models/users.rs b/tests/models/users.rs index fd8399b..21bf08e 100644 --- a/tests/models/users.rs +++ b/tests/models/users.rs @@ -3,7 +3,7 @@ use insta::assert_debug_snapshot; use loco_rs::testing::prelude::*; use sea_orm::{ActiveModelTrait, ActiveValue, IntoActiveModel}; use serial_test::serial; -use gitara_web::{ +use kompress_eshop::{ models::users::{self, Model, RegisterParams}, app::App, }; diff --git a/tests/requests/auth.rs b/tests/requests/auth.rs index 023e9d2..49f84e6 100644 --- a/tests/requests/auth.rs +++ b/tests/requests/auth.rs @@ -2,7 +2,7 @@ use insta::{assert_debug_snapshot, with_settings}; use loco_rs::testing::prelude::*; use rstest::rstest; use serial_test::serial; -use gitara_web::{models::users, app::App}; +use kompress_eshop::{models::users, app::App}; use super::prepare_data; diff --git a/tests/requests/prepare_data.rs b/tests/requests/prepare_data.rs index 57174f7..0fe9d02 100644 --- a/tests/requests/prepare_data.rs +++ b/tests/requests/prepare_data.rs @@ -1,6 +1,6 @@ use axum::http::{HeaderName, HeaderValue}; use loco_rs::{app::AppContext, TestServer}; -use gitara_web::{models::users, views::auth::LoginResponse}; +use kompress_eshop::{models::users, views::auth::LoginResponse}; const USER_EMAIL: &str = "test@loco.com"; const USER_PASSWORD: &str = "1234";