-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Muhammed Hussein Karimi <info@karimi.dev>
- Loading branch information
1 parent
d09d3d7
commit a5bd102
Showing
11 changed files
with
345 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
name: publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
branches: | ||
- "*" | ||
|
||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build: | ||
name: Build Container Image | ||
runs-on: ubuntu-latest | ||
continue-on-error: false | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v3.3.0 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v3.2.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- id: image_name_generator | ||
uses: ASzc/change-string-case-action@v6 | ||
with: | ||
string: ${{ env.IMAGE_NAME }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ steps.image_name_generator.outputs.lowercase }} | ||
|
||
- name: Build and push Docker image | ||
id: build-and-push-release | ||
uses: docker/build-push-action@v5.3.0 | ||
with: | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
context: . | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY }}/${{ steps.image_name_generator.outputs.lowercase }}:latest | ||
${{ env.REGISTRY }}/${{ steps.image_name_generator.outputs.lowercase }}:${{ github.ref_name }} | ||
deploy: | ||
name: Deploy to parminpaas.ir | ||
needs: build | ||
runs-on: ubuntu-latest | ||
continue-on-error: false | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: tale/kubectl-action@v1 | ||
with: | ||
base64-kube-config: ${{ secrets.KUBE_CONFIG }} | ||
|
||
- uses: helmwave/setup-action@v0.2.0 | ||
name: Install helmwave | ||
with: | ||
version: "0.36.3" | ||
|
||
- name: Templating helmwave.yml.tpl | ||
working-directory: "./deployments/kubernetes" | ||
run: "helmwave yml" | ||
env: | ||
CERT_MANAGER_CLUSTER_ISSUER: ${{ secrets.CERT_MANAGER_CLUSTER_ISSUER }} | ||
DOMAIN: ${{ secrets.DOMAIN }} | ||
INGRESS_CLASS: ${{ secrets.INGRESS_CLASS }} | ||
VERSION: ${{ github.ref_name }} | ||
|
||
- name: Plan | ||
working-directory: "./deployments/kubernetes" | ||
run: helmwave build | ||
env: | ||
CERT_MANAGER_CLUSTER_ISSUER: ${{ secrets.CERT_MANAGER_CLUSTER_ISSUER }} | ||
DOMAIN: ${{ secrets.DOMAIN }} | ||
INGRESS_CLASS: ${{ secrets.INGRESS_CLASS }} | ||
VERSION: ${{ github.ref_name }} | ||
|
||
- name: Deploy | ||
working-directory: "./deployments/kubernetes" | ||
run: helmwave up --kubedog --progress | ||
env: | ||
CERT_MANAGER_CLUSTER_ISSUER: ${{ secrets.CERT_MANAGER_CLUSTER_ISSUER }} | ||
DOMAIN: ${{ secrets.DOMAIN }} | ||
INGRESS_CLASS: ${{ secrets.INGRESS_CLASS }} | ||
VERSION: ${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Deployments | ||
|
||
Currently we are providing Docker Compose and Kubernetes (Helmwave) Deployment methods to self-host this project. | ||
|
||
* [Kubernetes](./kubernetes/README.md) | ||
* [Docker Compose](./docker/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Docker Compose Deployment | ||
|
||
## Requirements | ||
|
||
* Docker | ||
* Docker Compose CLI Plugin | ||
* Docker Daemon Access | ||
|
||
## How to run | ||
|
||
Simple run | ||
|
||
```shell | ||
docker compose pull | ||
docker compose up -d | ||
``` | ||
|
||
Open your browser at <http://127.0.0.1:3000> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: storage-browser | ||
services: | ||
storage-browser: | ||
image: ghcr.io/parmincloud/storage-browser:main | ||
container_name: storage-browser | ||
restart: always | ||
healthcheck: | ||
test: ["CMD-SHELL", "bash", "-c", "nc -vz 127.0.0.1 3000"] | ||
interval: 5s | ||
timeout: 1s | ||
retries: 2 | ||
start_period: 1s | ||
ports: | ||
- target: 3000 | ||
published: 3000 | ||
protocol: tcp | ||
mode: ingress | ||
name: http | ||
host_ip: 0.0.0.0 | ||
|
||
networks: | ||
default: | ||
name: storage-browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.helmwave/ | ||
helmwave.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Kubernetes Deployment | ||
|
||
Self Host Storage Browser in K8s | ||
|
||
Powered By Helmwave, Stakater Application helm chart and Bedag Raw helm chart (for kong configurations) | ||
|
||
## Requirements | ||
|
||
* [Helmwave](https://helmwave.app) | ||
* Ability to create namespace or having full access to namespace (named `storage-browser`) | ||
|
||
## How to run | ||
|
||
Set env vars like below | ||
|
||
```shell | ||
INGRESS_CLASS=nginx # Optional, name of the ingressClass special configs and annotations will set and applied if one of nginx or kong set | ||
VERSION=main # Required, Branch name or tag | ||
CERT_MANAGER_CLUSTER_ISSUER=http-issuer # Optional, name of cert-manager cluster-issuer (Required if you want HTTPS support) | ||
DOMAIN=storage-browser.example.com # Required, Domain name of the deployment | ||
``` | ||
|
||
Then run | ||
|
||
```shell | ||
# Template helmwave configuration | ||
helmwave yml | ||
# Build chart(s) information (values, etc.) | ||
helmwave build | ||
# Bring it Up | ||
helmwave up --kubedog --progress | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: 0.36.3 | ||
project: StorageBrowser | ||
|
||
{{- $ingressClass := env "INGRESS_CLASS" }} | ||
|
||
repositories: | ||
- name: stakater | ||
url: https://stakater.github.io/stakater-charts | ||
{{- if eq $ingressClass "kong" }} | ||
- name: bedag | ||
url: https://bedag.github.io/helm-charts | ||
{{- end }} | ||
|
||
releases: | ||
{{- if eq $ingressClass "kong" }} | ||
- name: storage-browser-kong | ||
namespace: storage-browser | ||
description: Kong configurations for ParminCloud S3 Object Storage Browser | ||
max_history: 3 | ||
allow_failure: false | ||
create_namespace: true | ||
reuse_values: false | ||
wait: true | ||
wait_for_jobs: true | ||
chart: | ||
name: bedag/raw | ||
values: | ||
- src: values.kong.yaml | ||
strict: true | ||
{{- end }} | ||
|
||
- name: storage-browser | ||
namespace: storage-browser | ||
description: ParminCloud S3 Object Storage Browser | ||
max_history: 3 | ||
allow_failure: false | ||
create_namespace: true | ||
reuse_values: false | ||
wait: true | ||
wait_for_jobs: true | ||
chart: | ||
name: stakater/application | ||
values: | ||
- src: ./values.yaml | ||
strict: true | ||
renderer: sprig | ||
{{- if eq $ingressClass "kong" }} | ||
depends_on: | ||
- name: storage-browser-kong | ||
optional: false | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
resources: | ||
- apiVersion: configuration.konghq.com/v1 | ||
kind: KongPlugin | ||
metadata: | ||
name: bot-detection | ||
plugin: bot-detection | ||
config: {} | ||
- apiVersion: configuration.konghq.com/v1beta1 | ||
kind: KongUpstreamPolicy | ||
metadata: | ||
name: storage-browser | ||
spec: | ||
algorithm: least-connections | ||
healthchecks: | ||
active: | ||
type: http | ||
httpPath: / | ||
healthy: | ||
httpStatuses: | ||
- 200 | ||
interval: 5 | ||
successes: 2 | ||
unhealthy: | ||
httpFailures: 1 | ||
interval: 5 |
Oops, something went wrong.