Skip to content

Commit 26df3aa

Browse files
Merge pull request #7 from kepler16/jv/change-pxorrozussoy
Add support for regex in hosts
2 parents c2d1555 + c94553e commit 26df3aa

File tree

10 files changed

+136
-110
lines changed

10 files changed

+136
-110
lines changed

.github/workflows/release.yaml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@ jobs:
99
build:
1010
strategy:
1111
matrix:
12-
os: [ubuntu-latest, macos-latest, macos-latest-xlarge]
1312
include:
14-
- os: ubuntu-latest
15-
binary-name: kl-linux-amd64
16-
- os: macos-latest
17-
binary-name: kl-macos-amd64
18-
- os: macos-latest-xlarge
19-
binary-name: kl-macos-arm64
13+
- arch: linux-amd64
14+
runs-on: ubuntu-latest
15+
- arch: linux-arm64
16+
runs-on: arm-c8
17+
- arch: macos-amd64
18+
runs-on: macos-latest
19+
- arch: macos-arm64
20+
runs-on: macos-latest-xlarge
2021

2122
env:
2223
GITHUB_USERNAME: ${{ secrets.ORG_GITHUB_ACTOR }}
2324
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
2425

25-
runs-on: ${{ matrix.os }}
26+
runs-on: ${{ matrix.runs-on }}
2627
steps:
2728
- name: Checkout git repo
2829
uses: actions/checkout@v2
@@ -32,38 +33,34 @@ jobs:
3233
- name: Fetch Tags
3334
run: git fetch --tags origin
3435

35-
- uses: actions/setup-java@v2
36+
- uses: graalvm/setup-graalvm@v1
3637
with:
37-
distribution: 'temurin'
38-
java-version: 21
38+
java-version: '22'
39+
distribution: 'graalvm'
40+
github-token: ${{ secrets.GITHUB_TOKEN }}
3941

4042
- uses: extractions/setup-just@v1
4143
- uses: DeLaGuardo/[email protected]
4244
with:
4345
cli: latest
4446

45-
- uses: graalvm/setup-graalvm@v1
46-
with:
47-
java-version: '21'
48-
distribution: 'graalvm'
49-
github-token: ${{ secrets.GITHUB_TOKEN }}
50-
5147
- name: Configure Auth
5248
run: |
49+
mkdir -p ~/.m2/
5350
cp ./build/settings.xml ~/.m2/settings.xml
5451
5552
- name: Build Native Image
5653
run: just build-native
5754

5855
- name: Pack binary
5956
run: |
60-
tar -czf ${{ matrix.binary-name }}.tar.gz -C ./target kl
57+
tar -czf kl-${{ matrix.arch }}.tar.gz -C ./target kl
6158
6259
- uses: actions/upload-artifact@v3
6360
with:
64-
name: kl-native-images
61+
name: binaries
6562
if-no-files-found: error
66-
path: ${{ matrix.binary-name }}.tar.gz
63+
path: kl-${{ matrix.arch }}.tar.gz
6764

6865
release:
6966
runs-on: ubuntu-latest
@@ -75,7 +72,7 @@ jobs:
7572
- name: Download Binary Artifacts
7673
uses: actions/download-artifact@v2
7774
with:
78-
name: kl-native-images
75+
name: binaries
7976
path: bin
8077

8178
- name: Calculate checksums
@@ -86,11 +83,6 @@ jobs:
8683
8784
mv checksums.txt bin/checksums.txt
8885
89-
- uses: actions/setup-java@v2
90-
with:
91-
distribution: 'temurin'
92-
java-version: 21
93-
9486
- name: Release
9587
uses: softprops/action-gh-release@v1
9688
if: startsWith(github.ref, 'refs/tags/')

LICENCE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) [year] [fullname]
3+
Copyright (c) Kepler16
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 100 additions & 45 deletions
Large diffs are not rendered by default.

build.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
(def basis (b/create-basis {:project "deps.edn"
66
:aliases [:native]}))
77
(def class-dir "target/classes")
8-
(def uber-file "target/kl.jar")
8+
(def jar-file "target/kl.jar")
99

1010
(defn clean [_]
1111
(b/delete {:path "target"}))
1212

13-
(defn uber [_]
13+
(defn build [_]
1414
(clean nil)
1515
(b/copy-dir {:src-dirs ["src" "resources"]
1616
:target-dir class-dir})
@@ -22,6 +22,6 @@
2222
"-Dclojure.spec.skip-macros=true"]})
2323

2424
(b/uber {:class-dir class-dir
25-
:uber-file uber-file
25+
:uber-file jar-file
2626
:basis basis
2727
:main 'k16.kl.cli}))

deps.edn

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{:mvn/repos {"github-kepler" {:url "https://maven.pkg.github.com/kepler16/*"}}
22

33
:paths ["src" "resources"]
4-
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
5-
metosin/malli {:mvn/version "0.13.0"}
4+
:deps {org.clojure/clojure {:mvn/version "1.11.3"}
5+
metosin/malli {:mvn/version "0.16.2"}
66
meta-merge/meta-merge {:mvn/version "1.0.0"}
7-
metosin/jsonista {:mvn/version "0.3.7"}
7+
metosin/jsonista {:mvn/version "0.3.9"}
88
clj-commons/clj-yaml {:mvn/version "1.0.27"}
9-
babashka/process {:mvn/version "0.5.21"}
10-
jansi-clj/jansi-clj {:mvn/version "1.0.1"}
9+
babashka/process {:mvn/version "0.5.22"}
10+
jansi-clj/jansi-clj {:mvn/version "1.0.3"}
1111
cli-matic/cli-matic {:mvn/version "0.5.4"}
1212
org.clojars.civa86/pretty.cli {:mvn/version "1.0.1"}
1313
funcool/promesa {:mvn/version "11.0.678"}
14-
http-kit/http-kit {:mvn/version "2.7.0"}}
14+
http-kit/http-kit {:mvn/version "2.8.0"}}
1515

16-
:aliases {:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.5"}}
16+
:aliases {:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.5"}}
1717
:ns-default build}
1818

1919
:native {:extra-deps {com.github.clj-easy/graal-build-time {:mvn/version "1.0.5"}}}

justfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
clean:
2-
clojure -T:build clean
3-
4-
build: clean
5-
clojure -T:build uber
1+
build:
2+
clojure -T:build build
63

74
native-image:
85
$GRAALVM_HOME/bin/native-image -jar target/kl.jar target/kl

resources/META-INF/native-image/k16.kl/native-image.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Args = --no-fallback \
22
--features=clj_easy.graal_build_time.InitClojureClasses \
33
--report-unsupported-elements-at-runtime \
44
-H:+UnlockExperimentalVMOptions \
5+
--initialize-at-build-time=org.fusesource.jansi.Ansi$Attribute,org.fusesource.jansi.Ansi$Color \
56
-H:ReflectionConfigurationResources=${.}/reflect-config.json \
67
-H:ResourceConfigurationResources=${.}/resource-config.json \
78
-H:+ReportExceptionStackTraces

resources/k16/kl/module/network/module.edn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040
:networks {:kl {:ipv4_address "172.5.0.100"}}}
4141

4242
:proxy ^:replace
43-
{:image "traefik:v2.6"
43+
{:image "traefik:v3.1"
4444
:restart "unless-stopped"
4545
:networks {:kl {:ipv4_address "172.5.0.101"}}
4646
:command ["--api.insecure=true"
47+
"--log.level=INFO"
48+
"--accesslog=true"
4749
"--providers.file.directory=/proxy-config"
4850
"--providers.file.watch=true"]
4951
:ports ["80:80"]

src/k16/kl/api/proxy.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(api.fs/from-config-dir "proxy/" (str module-name ".yaml")))
88

99
(defn- route->traefik-rule [{:keys [host path-prefix]}]
10-
(cond-> (str "Host(`" host "`)")
10+
(cond-> (str "HostRegexp(`" host "`)")
1111
path-prefix (str " && PathPrefix(`" path-prefix "`)")))
1212

1313
(defn- build-routes [module]

src/k16/kl/prompt/editor.clj

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)