Compare commits
No commits in common. "e2ae63f07ff25a1b7b4bdfafcde088d16b042547" and "0da5e27830f8bf90d35cf2cd8ddab57ae1cba4ee" have entirely different histories.
e2ae63f07f
...
0da5e27830
@ -1,15 +1,14 @@
|
|||||||
FROM docker.io/golang:1.23 AS build
|
ARG VER=1.23
|
||||||
|
|
||||||
|
FROM "docker.io/golang:$VER" as build
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
COPY go.mod go.sum .
|
ARG VER
|
||||||
RUN go mod download
|
COPY main.go .
|
||||||
COPY src/ .
|
RUN printf "module main\ngo $VER" > go.mod && CGO_ENABLED=0 go build -o /app
|
||||||
RUN CGO_ENABLED=0 go build -o /app
|
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=build /app .
|
COPY --from=build /app /app
|
||||||
COPY html/ html/
|
COPY static/ /static/
|
||||||
COPY css/ css/
|
COPY html/ /html/
|
||||||
COPY static/ static/
|
|
||||||
COPY tmpl/ tmpl/
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["./app"]
|
CMD ["/app"]
|
||||||
|
@ -4,19 +4,3 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
develop:
|
|
||||||
watch:
|
|
||||||
- action: rebuild
|
|
||||||
path: src/
|
|
||||||
- action: sync+restart
|
|
||||||
path: tmpl/
|
|
||||||
target: tmpl/
|
|
||||||
- action: sync+restart
|
|
||||||
path: html/
|
|
||||||
target: html/
|
|
||||||
- action: sync
|
|
||||||
path: css/
|
|
||||||
target: css/
|
|
||||||
- action: sync
|
|
||||||
path: static/
|
|
||||||
target: static/
|
|
||||||
|
@ -1,171 +0,0 @@
|
|||||||
:root {
|
|
||||||
--primary-color: #000000;
|
|
||||||
--background-color: #f5f5f5;
|
|
||||||
--text-color: #333;
|
|
||||||
--secondary-text-color: #777;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
margin: 20px auto;
|
|
||||||
max-width: 900px;
|
|
||||||
padding: 40px;
|
|
||||||
background-color: var(--background-color);
|
|
||||||
color: var(--text-color);
|
|
||||||
border-radius: 8px;
|
|
||||||
font-family: 'Open Sans', Arial, sans-serif;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 2.5em;
|
|
||||||
color: var(--primary-color);
|
|
||||||
margin-bottom: 30px;
|
|
||||||
text-align: center;
|
|
||||||
animation: fadeInDown 1s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title {
|
|
||||||
font-size: 1.8em;
|
|
||||||
color: var(--primary-color);
|
|
||||||
margin-top: 40px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
position: relative;
|
|
||||||
animation: fadeInLeft 1s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title::after {
|
|
||||||
content: '';
|
|
||||||
width: 50px;
|
|
||||||
height: 3px;
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
position: absolute;
|
|
||||||
bottom: -10px;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p, li {
|
|
||||||
line-height: 1.6;
|
|
||||||
font-size: 1.1em;
|
|
||||||
animation: fadeIn 1s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
margin-left: 20px;
|
|
||||||
list-style-type: disc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.features ul li {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.team-list {
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.team-list li {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-link-container {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 40px;
|
|
||||||
animation: fadeInUp 1s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-link {
|
|
||||||
text-decoration: none;
|
|
||||||
color: var(--primary-color);
|
|
||||||
font-weight: bold;
|
|
||||||
border: 2px solid var(--primary-color);
|
|
||||||
padding: 10px 20px;
|
|
||||||
border-radius: 5px;
|
|
||||||
transition: background-color 0.3s, color 0.3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-link:hover {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fadeInDown {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(-20px);
|
|
||||||
} to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fadeInLeft {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(-20px);
|
|
||||||
} to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateX(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fadeInUp {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(20px);
|
|
||||||
} to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fadeIn {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
} to {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.content {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title {
|
|
||||||
font-size: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
p, li {
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
.content {
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 1.8em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-title {
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
p, li {
|
|
||||||
font-size: 0.9em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: var(--primary-color);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
div {
|
|
||||||
position: absolute;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 3em;
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
a.nostyle {
|
|
||||||
color: inherit;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
module main
|
|
||||||
|
|
||||||
go 1.23.3
|
|
@ -1,63 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
{{template "head.tmpl". }}
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="description" class="content">
|
|
||||||
<h1 class="title">What is Icing?</h1>
|
|
||||||
|
|
||||||
<div class="project-overview">
|
|
||||||
<p>
|
|
||||||
Icing is a simple, lightweight, and efficient dialer designed to
|
|
||||||
replace your everyday phone app. It ensures end-to-end encryption of
|
|
||||||
telephone communications by implementing a home-made, analogic-based
|
|
||||||
voice encryption. Inspired by SRTP (Secure Real-time Transport
|
|
||||||
Protocol), using ECDH (Elliptic Curve Diffie-Hellman).
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="features">
|
|
||||||
<h2 class="section-title">Key Features</h2>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<strong>End-to-End Encryption:</strong> Secure your calls with
|
|
||||||
robust encryption protocols.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>Transparent:</strong> If your peer doesn't use Icing, the
|
|
||||||
call remains completely normal.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<strong>Analogic-based:</strong> An open-source, exportable,
|
|
||||||
protocol that <strong>works without internet.</strong>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="how-it-works">
|
|
||||||
<h2 class="section-title">How It Works</h2>
|
|
||||||
<p>
|
|
||||||
Icing generates a cryptographic key pair for you. Share your public key
|
|
||||||
with a neat QR code.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
During a call between two Icing users, voices are encrypted,
|
|
||||||
compressed, and transmitted via the telephone network using the Icing
|
|
||||||
Acoustic Protocol.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="team">
|
|
||||||
<h2 class="section-title">The Team</h2>
|
|
||||||
<ul class="team-list">
|
|
||||||
<li>{{template "stephane"}}</li>
|
|
||||||
<li>{{template "alexis"}}</li>
|
|
||||||
<li>{{template "ange"}}</li>
|
|
||||||
<li>{{template "bartosz"}}</li>
|
|
||||||
<li>{{template "florian"}}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
229
website/html/description.html
Normal file
229
website/html/description.html
Normal file
@ -0,0 +1,229 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Icing</title>
|
||||||
|
<!-- <link rel="stylesheet" href="style.css"/> -->
|
||||||
|
<style>
|
||||||
|
/* Theme colors */
|
||||||
|
:root {
|
||||||
|
--primary-color: #000000; /* Green accent color */
|
||||||
|
--background-color: #f5f5f5; /* Light background */
|
||||||
|
--text-color: #333; /* Dark text */
|
||||||
|
--secondary-text-color: #777; /* Secondary text color */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Base styles */
|
||||||
|
.content {
|
||||||
|
margin: 20px auto;
|
||||||
|
max-width: 900px;
|
||||||
|
padding: 40px;
|
||||||
|
background-color: var(--background-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
border-radius: 8px;
|
||||||
|
font-family: 'Open Sans', Arial, sans-serif;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 2.5em;
|
||||||
|
color: var(--primary-color);
|
||||||
|
margin-bottom: 30px;
|
||||||
|
text-align: center;
|
||||||
|
animation: fadeInDown 1s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 1.8em;
|
||||||
|
color: var(--primary-color);
|
||||||
|
margin-top: 40px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
position: relative;
|
||||||
|
animation: fadeInLeft 1s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title::after {
|
||||||
|
content: '';
|
||||||
|
width: 50px;
|
||||||
|
height: 3px;
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
position: absolute;
|
||||||
|
bottom: -10px;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p, li {
|
||||||
|
line-height: 1.6;
|
||||||
|
font-size: 1.1em;
|
||||||
|
animation: fadeIn 1s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin-left: 20px;
|
||||||
|
list-style-type: disc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.features ul li {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-list {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.team-list li {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-link-container {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 40px;
|
||||||
|
animation: fadeInUp 1s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-link {
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--primary-color);
|
||||||
|
font-weight: bold;
|
||||||
|
border: 2px solid var(--primary-color);
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
transition: background-color 0.3s, color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-link:hover {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInDown {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(-20px);
|
||||||
|
} to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInLeft {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateX(-20px);
|
||||||
|
} to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInUp {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(20px);
|
||||||
|
} to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
} to {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive Design */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.content {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
p, li {
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.content {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 1.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
p, li {
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--primary-color);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="description" class="content">
|
||||||
|
<h1 class="title">Project Description</h1>
|
||||||
|
|
||||||
|
<div class="project-overview">
|
||||||
|
<h2 class="section-title">What is Icing?</h2>
|
||||||
|
<p>
|
||||||
|
Icing is a simple, lightweight, and efficient dialer designed to replace your everyday phone app. It ensures end-to-end encryption of telephone communications by implementing a home-made, analogic-based voice encryption. Inspired by SRTP (Secure Real-time Transport Protocol), using ECDH (Elliptic Curve Diffie-Hellman).
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="features">
|
||||||
|
<h2 class="section-title">Key Features</h2>
|
||||||
|
<ul>
|
||||||
|
<li><strong>End-to-End Encryption:</strong> Secure your calls with robust encryption protocols.</li>
|
||||||
|
<li><strong>Transparent:</strong> If your peer doesn't use Icing, the call remains completely normal.</li>
|
||||||
|
<li><strong>Analogic-based:</strong> An open-source, exportable, protocol that <strong>works without internet.</strong></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="how-it-works">
|
||||||
|
<h2 class="section-title">How It Works</h2>
|
||||||
|
<p>
|
||||||
|
Icing generates a cryptographic key pair for you. Share your public key with a neat QR code.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
During a call between two Icing users, voices are encrypted, compressed, and transmitted via the telephone network using the Icing Acoustic Protocol.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="team">
|
||||||
|
<h2 class="section-title">Our Team</h2>
|
||||||
|
<p>
|
||||||
|
We are a team of five dedicated individuals working on this solution:
|
||||||
|
</p>
|
||||||
|
<ul class="team-list">
|
||||||
|
<li><a href="https://github.com/AlexisDanlos/" target="_blank">Alexis Danlos</a></li>
|
||||||
|
<li><a href="https://github.com/AustralEpitech/" target="_blank">AustralEpitech</a></li>
|
||||||
|
<li><a href="https://github.com/Bartoszkk/" target="_blank">Bartoszkk</a></li>
|
||||||
|
<li><a href="https://github.com/FlorianGRIFFON/" target="_blank">Florian GRIFFON</a></li>
|
||||||
|
<li><a href="https://github.com/STCB/" target="_blank">STCB</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,13 +1,31 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
{{template "head.tmpl" .}}
|
<style>
|
||||||
|
.centered {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
font-size: 3em;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-underline {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a class="nostyle" href="/about">
|
<div id="home">
|
||||||
<div class="title">
|
<h1 class="centered">
|
||||||
<h1>ICING</h1>
|
<router-link to="/description" class="no-underline">ICING</router-link>
|
||||||
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
11
website/html/style.css
Normal file
11
website/html/style.css
Normal file
File diff suppressed because one or more lines are too long
32
website/main.go
Normal file
32
website/main.go
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"path/filepath"
|
||||||
|
)
|
||||||
|
|
||||||
|
func route(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.URL.Path == "/style.css" {
|
||||||
|
http.ServeFile(w, r, "/html/style.css")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(r.URL.Path) > len("/static/") && r.URL.Path[:len("/static/")] == "/static/" {
|
||||||
|
http.ServeFile(w, r, r.URL.Path)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if r.URL.Path == "/" {
|
||||||
|
http.ServeFile(w, r, "/html/index.html")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
http.ServeFile(w, r, filepath.Join("/html", r.URL.Path + ".html"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", route)
|
||||||
|
|
||||||
|
err := http.ListenAndServe(":3000", nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
@ -3,35 +3,32 @@ set -o pipefail
|
|||||||
|
|
||||||
function kapply() {
|
function kapply() {
|
||||||
for f in "$@"; do
|
for f in "$@"; do
|
||||||
kubectl apply -f <(envsubst < "manifests/$f")
|
kubectl apply -f \
|
||||||
|
<(envsubst "$(env | xargs printf '$%s ')" < "manifests/$f")
|
||||||
done
|
done
|
||||||
}; export -f kapply
|
}
|
||||||
|
|
||||||
function kcreatesec() {
|
function kcreatesec() {
|
||||||
kubectl create secret generic --dry-run=client -oyaml "$@" | kubectl replace -f-
|
kubectl create secret generic --save-config --dry-run=client -oyaml "$@" | kubectl apply -f-
|
||||||
}; export -f kcreatesec
|
}
|
||||||
|
|
||||||
function kcreatecm() {
|
function kcreatecm() {
|
||||||
kubectl create configmap --dry-run=client -oyaml "$@" | kubectl replace -f-
|
kubectl create configmap --dry-run=client -oyaml "$@" | kubectl apply -f-
|
||||||
}; export -f kcreatecm
|
}
|
||||||
|
|
||||||
function kgseckey() {
|
function kgseckey() {
|
||||||
local sec="$1"; shift
|
local sec="$1"; shift
|
||||||
local key="$1"; shift
|
local key="$1"; shift
|
||||||
|
|
||||||
if ! kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\" // empty" | base64 -d; then
|
kubectl get secret "$sec" -o jsonpath="{.data.$key}" | base64 -d
|
||||||
return 1
|
}
|
||||||
fi
|
|
||||||
}; export -f kgseckey
|
|
||||||
|
|
||||||
function kgcmkey() {
|
function kgcmkey() {
|
||||||
local cm="$1"; shift
|
local cm="$1"; shift
|
||||||
local key="$1"; shift
|
local key="$1"; shift
|
||||||
|
|
||||||
if ! kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\" // empty"; then
|
kubectl get configmap "$cm" -o jsonpath="{.data.$key}"
|
||||||
return 1
|
}
|
||||||
fi
|
|
||||||
}; export -f kgcmkey
|
|
||||||
|
|
||||||
|
|
||||||
kapply common/app.yaml
|
kapply common/app.yaml
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
export NB_REPLICAS=1
|
export NB_REPLICAS=1
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
export NB_REPLICAS=3
|
export NB_REPLICAS=3
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
branch="$(git describe --contains --all HEAD)"
|
|
||||||
|
|
||||||
xdg-open "https://$branch.g-eip-700-tls-7-1-eip-stephane.corbiere.icing.k8s.gmoker.com"
|
|
@ -1,14 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
http.HandleFunc("/", route)
|
|
||||||
generateTmpl()
|
|
||||||
if err := http.ListenAndServe(":3000", nil); err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"net/http"
|
|
||||||
"regexp"
|
|
||||||
"slices"
|
|
||||||
)
|
|
||||||
|
|
||||||
type URLParam struct{}
|
|
||||||
|
|
||||||
var routes = []struct {
|
|
||||||
methods []string
|
|
||||||
regex *regexp.Regexp
|
|
||||||
handler http.HandlerFunc
|
|
||||||
}{
|
|
||||||
{[]string{"GET"}, url(""), index},
|
|
||||||
{[]string{"GET"}, url("/static/.+"), static},
|
|
||||||
{[]string{"GET"}, url("/(.+\\.css)"), css},
|
|
||||||
{[]string{"GET"}, url("/([^/]+)"), html},
|
|
||||||
}
|
|
||||||
|
|
||||||
func url(s string) *regexp.Regexp {
|
|
||||||
return regexp.MustCompile("^" + s + "/?$")
|
|
||||||
}
|
|
||||||
|
|
||||||
func getParam(r *http.Request, i int) string {
|
|
||||||
return r.Context().Value(URLParam{}).([]string)[i]
|
|
||||||
}
|
|
||||||
|
|
||||||
func route(w http.ResponseWriter, r *http.Request) {
|
|
||||||
for _, rt := range routes {
|
|
||||||
matches := rt.regex.FindStringSubmatch(r.URL.Path)
|
|
||||||
if len(matches) > 0 {
|
|
||||||
if !slices.Contains(rt.methods, r.Method) {
|
|
||||||
w.Header().Set("Allow", r.Method)
|
|
||||||
http.Error(
|
|
||||||
w, "405 method not allowed", http.StatusMethodNotAllowed,
|
|
||||||
)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
fmt.Println(r.Method, r.URL.Path)
|
|
||||||
rt.handler(w, r.WithContext(
|
|
||||||
context.WithValue(r.Context(), URLParam{}, matches[1:]),
|
|
||||||
))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
http.NotFound(w, r)
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"html/template"
|
|
||||||
"path/filepath"
|
|
||||||
"regexp"
|
|
||||||
)
|
|
||||||
|
|
||||||
var TMPL map[string][]byte
|
|
||||||
|
|
||||||
func generateTmpl() {
|
|
||||||
files, _ := filepath.Glob("html/*.html")
|
|
||||||
re := regexp.MustCompile("html/(.+).html")
|
|
||||||
pages := make([]string, len(files))
|
|
||||||
|
|
||||||
for i, f := range files {
|
|
||||||
pages[i] = re.FindStringSubmatch(f)[1]
|
|
||||||
}
|
|
||||||
TMPL = make(map[string][]byte, len(files))
|
|
||||||
for i, f := range files {
|
|
||||||
b := new(bytes.Buffer)
|
|
||||||
t, _ := template.ParseFiles(f)
|
|
||||||
t.ParseGlob("tmpl/*.tmpl")
|
|
||||||
t.Execute(b, map[string]any{
|
|
||||||
"page": pages[i],
|
|
||||||
"pages": pages,
|
|
||||||
})
|
|
||||||
TMPL[pages[i]] = b.Bytes()
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"path/filepath"
|
|
||||||
)
|
|
||||||
|
|
||||||
func index(w http.ResponseWriter, r *http.Request) {
|
|
||||||
html(w, r.WithContext(
|
|
||||||
context.WithValue(r.Context(), URLParam{}, []string{"index"}),
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
func static(w http.ResponseWriter, r *http.Request) {
|
|
||||||
http.ServeFile(w, r, r.URL.Path)
|
|
||||||
}
|
|
||||||
|
|
||||||
func css(w http.ResponseWriter, r *http.Request) {
|
|
||||||
http.ServeFile(w, r, filepath.Join("css", getParam(r, 0)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func html(w http.ResponseWriter, r *http.Request) {
|
|
||||||
if t, found := TMPL[getParam(r, 0)]; found {
|
|
||||||
w.Write(t)
|
|
||||||
} else {
|
|
||||||
http.NotFound(w, r)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
<title>Icing</title>
|
|
||||||
<link rel="stylesheet" href="style.css"/>
|
|
||||||
<link rel="stylesheet" href="{{.page}}.css"/>
|
|
@ -1,19 +0,0 @@
|
|||||||
{{define "alexis"}}
|
|
||||||
<a href="https://github.com/AlexisDanlos" target="_blank">Alexis DANLOS</a>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{define "ange"}}
|
|
||||||
<a href="https://yw5n.com" target="_blank">Ange DUHAYON</a>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{define "bartosz"}}
|
|
||||||
<a href="https://github.com/Bartoszkk" target="_blank">Bartosz MICHALAK</a>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{define "florian"}}
|
|
||||||
<a href="https://github.com/FlorianGRIFFON" target="_blank">Florian GRIFFON</a>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{define "stephane"}}
|
|
||||||
<a href="https://github.com/STCB/" target="_blank">Stephane CORBIERE</a>
|
|
||||||
{{end}}
|
|
Loading…
Reference in New Issue
Block a user