Skip to content

Commit f3bd838

Browse files
author
Burgy Benjamin
committed
Rename the project because it will have more responsibilities.
1 parent 62a67cf commit f3bd838

File tree

28 files changed

+118
-108
lines changed

28 files changed

+118
-108
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ erl_crash.dump
2323
/tmp/
2424

2525
# Ignore package tarball (built via "mix hex.build").
26-
kdrive_bridge-*.tar
26+
ksuite_middleware-*.tar
2727

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ FROM ${BUILDER_IMAGE} as builder
2222

2323
# install build dependencies
2424
RUN apt-get update -y && apt-get install -y build-essential git \
25-
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
25+
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
2626

2727
# prepare build dir
2828
WORKDIR /app
2929

3030
# install hex + rebar
3131
RUN mix local.hex --force && \
32-
mix local.rebar --force
32+
mix local.rebar --force
3333

3434
# set build ENV
3535
ENV MIX_ENV="prod"
@@ -80,7 +80,7 @@ RUN chown nobody /app
8080
ENV MIX_ENV="prod"
8181

8282
# Only copy the final release from the build stage
83-
COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/kdrive_bridge ./
83+
COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/ksuite_middleware ./
8484

8585
USER nobody
8686

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# KdriveBridge
1+
# Ksuite-middleware
22

3-
The goal of this project is to provide access to the content of your files saved in kDrive without the KSuite layer by calling the URL:
3+
Project providing a single endpoint with a single API configuration to access to many resources from a KSuite environment.
4+
5+
## Kdrive
46

57
```
68
http://localhost:4000/files/<your-kdrive-file-id>
@@ -11,29 +13,29 @@ http://localhost:4000/files/<your-kdrive-file-id>
1113
| Environment variables | Description |
1214
|-----------------------|------------------------------------------------------------------------------------------------------------------------------|
1315
| KDRIVE_ID | The identifier of your KDrive. |
14-
| KDRIVE_API_TOKEN | The API token to use the KDrive API. |
16+
| KSUITE_API_TOKEN | The API token to use the KDrive API. |
1517
| PHX_HOST | The host the web server. (default: example.com) |
1618
| PORT | The port for the web server. (default: 4000) |
1719
| SECRET_KEY_BASE | Secret key used by the [phoenix framework](https://hexdocs.pm/phoenix/deployment.html#handling-of-your-application-secrets). |
1820

1921
```yaml
2022
version: '3'
2123
services:
22-
kdrive-bridge:
23-
image: minidfx/kdrive-bridge:v0.3.0
24+
ksuite-middleware:
25+
image: minidfx/ksuite-middleware:v0.4.0
2426
environment:
2527
- SECRET_KEY_BASE=<secret>
2628
- PHX_HOST=<host>
2729
- PORT=<port>
2830
- KDRIVE_ID=<id>
29-
- KDRIVE_API_TOKEN=<token>
31+
- KSUITE_API_TOKEN=<token>
3032
ports:
3133
- 4000:4000
3234
```
3335
3436
## Running with Docker (recommended way)
3537
36-
With Docker, running the application is a breeze. Simply update the environment variables SECRET_KEY_BASE, PHX_HOST, KDRIVE_ID, and KDRIVE_API_TOKEN. Then, run it to kickstart the application.
38+
With Docker, running the application is a breeze. Simply update the environment variables SECRET_KEY_BASE, PHX_HOST, KDRIVE_ID, and KSUITE_API_TOKEN. Then, run it to kickstart the application.
3739
3840
```bash
3941
docker-compose up

config/config.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
# General application configuration
88
import Config
99

10-
config :kdrive_bridge,
10+
config :ksuite_middleware,
1111
generators: [timestamp_type: :utc_datetime]
1212

1313
# Configures the endpoint
14-
config :kdrive_bridge, KdriveBridgeWeb.Endpoint,
14+
config :ksuite_middleware, KsuiteMiddlewareWeb.Endpoint,
1515
url: [host: "localhost"],
1616
adapter: Phoenix.Endpoint.Cowboy2Adapter,
1717
render_errors: [
18-
formats: [json: KdriveBridgeWeb.ErrorJSON],
18+
formats: [json: KsuiteMiddlewareWeb.ErrorJSON],
1919
layout: false
2020
],
21-
pubsub_server: KdriveBridge.PubSub,
21+
pubsub_server: KsuiteMiddleware.PubSub,
2222
live_view: [signing_salt: "7nfCI6sX"]
2323

2424
# Configures Elixir's Logger

config/dev.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Config
66
# The watchers configuration can be used to run external
77
# watchers to your application. For example, we can use it
88
# to bundle .js and .css sources.
9-
config :kdrive_bridge, KdriveBridgeWeb.Endpoint,
9+
config :ksuite_middleware, KsuiteMiddlewareWeb.Endpoint,
1010
# Binding to loopback ipv4 address prevents access from other machines.
1111
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
1212
http: [ip: {0, 0, 0, 0}, port: 4000],
@@ -40,7 +40,7 @@ config :kdrive_bridge, KdriveBridgeWeb.Endpoint,
4040
# different ports.
4141

4242
# Enable dev routes for dashboard and mailbox
43-
config :kdrive_bridge, dev_routes: true
43+
config :ksuite_middleware, dev_routes: true
4444

4545
# Do not include metadata nor timestamps in development logs
4646
config :logger, :console, format: "[$level] $message\n"

config/runtime.exs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import Config
1212
# If you use `mix release`, you need to explicitly enable the server
1313
# by passing the PHX_SERVER=true when you start it:
1414
#
15-
# PHX_SERVER=true bin/kdrive_bridge start
15+
# PHX_SERVER=true bin/ksuite_middleware start
1616
#
1717
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
1818
# script that automatically sets the env var above.
1919
if System.get_env("PHX_SERVER") do
20-
config :kdrive_bridge, KdriveBridgeWeb.Endpoint, server: true
20+
config :ksuite_middleware, KsuiteMiddlewareWeb.Endpoint, server: true
2121
end
2222

2323
if config_env() == :prod do
@@ -36,9 +36,9 @@ if config_env() == :prod do
3636
host = System.get_env("PHX_HOST") || "example.com"
3737
port = String.to_integer(System.get_env("PORT") || "4000")
3838

39-
config :kdrive_bridge, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
39+
config :ksuite_middleware, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
4040

41-
config :kdrive_bridge, KdriveBridgeWeb.Endpoint,
41+
config :ksuite_middleware, KsuiteMiddlewareWeb.Endpoint,
4242
url: [host: host, port: 443, scheme: "http"],
4343
http: [
4444
# Enable IPv6 and bind on all interfaces.
@@ -50,16 +50,16 @@ if config_env() == :prod do
5050
],
5151
secret_key_base: secret_key_base
5252

53-
config :kdrive_bridge,
53+
config :ksuite_middleware,
5454
kdrive_id: System.get_env("KDRIVE_ID") || raise("The KDRIVE_ID variable was missing"),
55-
kdrive_api_token: System.get_env("KDRIVE_API_TOKEN") || raise("The KDRIVE_API_TOKEN variable was missing")
55+
ksuite_api_token: System.get_env("KSUITE_API_TOKEN") || raise("The KSUITE_API_TOKEN variable was missing")
5656

5757
# ## SSL Support
5858
#
5959
# To get SSL working, you will need to add the `https` key
6060
# to your endpoint configuration:
6161
#
62-
# config :kdrive_bridge, KdriveBridgeWeb.Endpoint,
62+
# config :ksuite_middleware, KsuiteMiddlewareWeb.Endpoint,
6363
# https: [
6464
# ...,
6565
# port: 443,
@@ -81,7 +81,7 @@ if config_env() == :prod do
8181
# We also recommend setting `force_ssl` in your endpoint, ensuring
8282
# no data is ever sent via http, always redirecting to https:
8383
#
84-
# config :kdrive_bridge, KdriveBridgeWeb.Endpoint,
84+
# config :ksuite_middleware, KsuiteMiddlewareWeb.Endpoint,
8585
# force_ssl: [hsts: true]
8686
#
8787
# Check `Plug.SSL` for all available options in `force_ssl`.

config/test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Config
22

33
# We don't run a server during test. If one is required,
44
# you can enable the server option below.
5-
config :kdrive_bridge, KdriveBridgeWeb.Endpoint,
5+
config :ksuite_middleware, KsuiteMiddlewareWeb.Endpoint,
66
http: [ip: {127, 0, 0, 1}, port: 4002],
77
secret_key_base: "BQY9JpU3sNCk28WVxTGzJMma6M4DIiMD+4L/OskOMPSgOXp08t6OBveo2ccdxYxr",
88
server: false

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
version: '3'
22
services:
3-
kdrive-bridge:
3+
ksuite-middleware:
44
build: .
5-
image: minidfx/kdrive-bridge:v0.3.0
5+
image: minidfx/ksuite-middleware:v0.4.0
66
environment:
77
- SECRET_KEY_BASE=<secret>
88
- PHX_HOST=<host>
99
- PORT=<port>
1010
- KDRIVE_ID=<id>
11-
- KDRIVE_API_TOKEN=<token>
11+
- KSUITE_API_TOKEN=<token>
1212
ports:
1313
- 4000:4000

lib/kdrive_bridge.ex renamed to lib/ksuite_middleware.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
defmodule KdriveBridge do
1+
defmodule KsuiteMiddleware do
22
@moduledoc """
3-
KdriveBridge keeps the contexts that define your domain
3+
KsuiteMiddleware keeps the contexts that define your domain
44
and business logic.
55
66
Contexts are also responsible for managing your data, regardless
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
defmodule KdriveBridge.Application do
1+
defmodule KsuiteMiddleware.Application do
22
# See https://hexdocs.pm/elixir/Application.html
33
# for more information on OTP Applications
44
@moduledoc false
@@ -8,26 +8,26 @@ defmodule KdriveBridge.Application do
88
@impl true
99
def start(_type, _args) do
1010
children = [
11-
KdriveBridgeWeb.Telemetry,
12-
{DNSCluster, query: Application.get_env(:kdrive_bridge, :dns_cluster_query) || :ignore},
13-
{Phoenix.PubSub, name: KdriveBridge.PubSub},
14-
# Start a worker by calling: KdriveBridge.Worker.start_link(arg)
15-
# {KdriveBridge.Worker, arg},
11+
KsuiteMiddlewareWeb.Telemetry,
12+
{DNSCluster, query: Application.get_env(:ksuite_middleware, :dns_cluster_query) || :ignore},
13+
{Phoenix.PubSub, name: KsuiteMiddleware.PubSub},
14+
# Start a worker by calling: KsuiteMiddleware.Worker.start_link(arg)
15+
# {KsuiteMiddleware.Worker, arg},
1616
# Start to serve requests, typically the last entry
17-
KdriveBridgeWeb.Endpoint
17+
KsuiteMiddlewareWeb.Endpoint
1818
]
1919

2020
# See https://hexdocs.pm/elixir/Supervisor.html
2121
# for other strategies and supported options
22-
opts = [strategy: :one_for_one, name: KdriveBridge.Supervisor]
22+
opts = [strategy: :one_for_one, name: KsuiteMiddleware.Supervisor]
2323
Supervisor.start_link(children, opts)
2424
end
2525

2626
# Tell Phoenix to update the endpoint configuration
2727
# whenever the application is updated.
2828
@impl true
2929
def config_change(changed, _new, removed) do
30-
KdriveBridgeWeb.Endpoint.config_change(changed, removed)
30+
KsuiteMiddlewareWeb.Endpoint.config_change(changed, removed)
3131
:ok
3232
end
3333
end

0 commit comments

Comments
 (0)