-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unified HTML landing page (NOT a dashboard!) #531
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bc02ce6
add caddy charts
willcl-ark 1429a31
deploy caddy
willcl-ark 258fb0a
auto port-forward and teardown
willcl-ark a28d262
document FO access via landing page
willcl-ark 5df196d
move fork-observer and caddy into warnet-logging namespace
willcl-ark 31c08e1
deploy caddy if either fork-observer or logging enabled
willcl-ark 4879b03
add warnet dashboard
willcl-ark 48acdde
test fork-observer access via caddy dashboard
willcl-ark 121d303
grafana running behind caddy
m3dwards 20b97a0
Update fork-observer chat note
willcl-ark 13f14c3
dont' copy caddy files to project dir
willcl-ark e75cace
logging: add to create inquirer
willcl-ark File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 @@ | ||
# Quick run | ||
|
||
## Installation | ||
|
||
Either install warnet via pip, or clone the source and install: | ||
|
||
### via pip | ||
|
||
You can install warnet via `pip` into a virtual environment with | ||
|
||
```bash | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip install warnet | ||
``` | ||
|
||
### via cloned source | ||
|
||
You can install warnet from source into a virtual environment with | ||
|
||
```bash | ||
git clone https://github.com/bitcoin-dev-project/warnet.git | ||
cd warnet | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip install -e . | ||
``` | ||
|
||
## Running | ||
|
||
To get started first check you have all the necessary requirements: | ||
|
||
```bash | ||
warnet setup | ||
``` | ||
|
||
Then create your first network: | ||
|
||
```bash | ||
# Create a new network in the current directory | ||
warnet init | ||
|
||
# Or in a directory of choice | ||
warnet new <directory> | ||
``` | ||
|
||
Follow the guide to configure network variables. | ||
|
||
## fork-observer | ||
|
||
If you enabled [fork-observer](https://github.com/0xB10C/fork-observer), it will be available from the landing page at `localhost:2019`. |
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 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,24 @@ | ||
apiVersion: v2 | ||
name: caddy-server | ||
description: A Helm chart for Caddy | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.0 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: 0.1.0 |
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 @@ | ||
Caddy is serving your every need. |
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,57 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "caddy.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "caddy.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "caddy.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "caddy.labels" -}} | ||
helm.sh/chart: {{ include "caddy.chart" . }} | ||
{{ include "caddy.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "caddy.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "caddy.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "caddy.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "caddy.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- 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,11 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "caddy.fullname" . }} | ||
labels: | ||
{{- include "caddy.labels" . | nindent 4 }} | ||
data: | ||
Caddyfile: | | ||
{{- .Values.caddyConfig | nindent 4 }} | ||
index: | | ||
{{- .Values.htmlConfig | nindent 4 }} |
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,38 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ include "caddy.fullname" . }} | ||
labels: | ||
{{- include "caddy.labels" . | nindent 4 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
app: {{ include "caddy.fullname" . }} | ||
spec: | ||
restartPolicy: "{{ .Values.restartPolicy }}" | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 4 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 8 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: web | ||
containerPort: {{ .Values.port }} | ||
protocol: TCP | ||
livenessProbe: | ||
{{- toYaml .Values.livenessProbe | nindent 8 }} | ||
readinessProbe: | ||
{{- toYaml .Values.readinessProbe | nindent 8 }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 8 }} | ||
volumeMounts: | ||
{{- toYaml .Values.volumeMounts | nindent 8 }} | ||
volumes: | ||
{{- toYaml .Values.volumes | nindent 4 }} |
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,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "caddy.fullname" . }} | ||
labels: | ||
{{- include "caddy.labels" . | nindent 4 }} | ||
app: {{ include "caddy.fullname" . }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.port }} | ||
targetPort: web | ||
protocol: TCP | ||
name: http | ||
selector: | ||
{{- include "caddy.selectorLabels" . | nindent 4 }} |
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,123 @@ | ||
# Default values for caddy. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
namespace: warnet | ||
|
||
restartPolicy: Always | ||
|
||
image: | ||
repository: caddy | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "2.8.4" | ||
|
||
imagePullSecrets: [] | ||
|
||
nameOverride: "" | ||
|
||
fullnameOverride: "" | ||
|
||
podLabels: | ||
app: "warnet" | ||
mission: "proxy" | ||
|
||
podSecurityContext: {} | ||
# fsGroup: 2000 | ||
|
||
securityContext: {} | ||
# capabilities: | ||
# drop: | ||
# - ALL | ||
# readOnlyRootFilesystem: true | ||
# runAsNonRoot: true | ||
# runAsUser: 1000 | ||
|
||
service: | ||
type: ClusterIP | ||
|
||
resources: {} | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
# choice for the user. This also increases chances charts run on environments with little | ||
# resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
livenessProbe: | ||
httpGet: | ||
path: /live | ||
port: 80 | ||
failureThreshold: 3 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
|
||
readinessProbe: | ||
httpGet: | ||
path: /ready | ||
port: 80 | ||
failureThreshold: 1 | ||
periodSeconds: 1 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
|
||
volumes: | ||
- name: caddy-config | ||
configMap: | ||
name: caddy | ||
items: | ||
- key: Caddyfile | ||
path: Caddyfile | ||
- key: index | ||
path: index | ||
|
||
volumeMounts: | ||
- name: caddy-config | ||
mountPath: /etc/caddy/Caddyfile | ||
subPath: Caddyfile | ||
- name: caddy-config | ||
mountPath: /usr/share/caddy/index.html | ||
subPath: index | ||
|
||
port: 80 | ||
|
||
caddyConfig: | | ||
:80 { | ||
respond /live 200 | ||
respond /ready 200 | ||
|
||
root * /usr/share/caddy | ||
file_server | ||
|
||
handle_path /fork-observer/* { | ||
reverse_proxy fork-observer:2323 | ||
} | ||
|
||
handle_path /grafana/* { | ||
reverse_proxy loki-grafana:80 | ||
} | ||
|
||
} | ||
|
||
htmlConfig: | | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Welcome</title> | ||
</head> | ||
<body> | ||
<h1>Welcome to the Warnet dashboard</h1> | ||
<p>You can access the following services:</p> | ||
<ul> | ||
<li><a href="/grafana/">Grafana</a></li> | ||
<li><a href="/fork-observer/">Fork Observer</a></li> | ||
</ul> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -1,5 +1 @@ | ||
To view forkobserver you must forward the port from the cluster to your local machine | ||
|
||
kubectl port-forward fork-observer 2323 | ||
|
||
fork-observer will then be available at web address: http://localhost:2323 | ||
Fork observer enabled. |
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 |
---|---|---|
|
@@ -29,4 +29,6 @@ nodes: | |
- tank-0006 | ||
- name: tank-0006 | ||
fork_observer: | ||
enabled: false | ||
enabled: true | ||
caddy: | ||
enabled: true |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just for my own understanding, grafana stuff is in
manifests/
for legacy reasons, yeah? was surprised its not also being deployed by helm (not a blocker for this PR tho)