generated from kappsegla/maven-java-template
-
Notifications
You must be signed in to change notification settings - Fork 2
96 Create page for testing filytypes #26
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
Closed
Martin-E-Karlsson
wants to merge
41
commits into
ithsjava25:main
from
ithsjava25:96-create-page-for-testing-filytypes
Closed
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
98b40a1
Initial commit med all kod (#16)
Kathify c1b5f70
build: configure pom.xml with needed plugin/tools. (#19)
eeebbaandersson bf4d977
Initial commit för tcp-server (#17)
Kathify 148411e
Issue #12 (#21)
Xeutos 9ac7b57
Feature/docker image builder issue#11 (#25)
Xeutos 875d1ef
Feature/http parse headers (#18)
FeFFe1996 9289c7d
Feature/http response builder (#24)
JohanHiths 6bdb1ef
Feature/http parse request line (#20)
FeFFe1996 781e34a
Add Bucket4j dependency in pom file (#40)
gvaguirres 511b5ee
Add support for serving static files (#42)
codebyNorthsteep aaeba6d
Updates pom.xml, with jackson-dependencies, for config file (#48)
fredrikmohlen 524f33c
* Move HTTP handling to a dedicated ConnectionHandler (#50)
donne41 8cc69d8
Feature/13 implement config file (#22)
MartinStenhagen c0e3de6
Enhancement/404 page not found (#53)
codebyNorthsteep bcb828c
Feature/issue59 run configloader (#61)
MartinStenhagen 945d32b
23 define and create filter interface (#46)
eraiicphu 3128ac7
Feature/mime type detection #8 (#47)
gitnes94 d4e7481
Dockerfile update (#52) (#63)
Xeutos 5c80eaa
Added comprehensive README.MD (#67)
gitnes94 6950c14
Fix: Path traversal vulnerability in StaticFileHandler (#65)
apaegs 78f7e21
Resolve port: CLI > config > default (#29)
viktorlindell12 86f2ba7
Refactor status codes to constants #71 (#77)
eeebbaandersson 103178a
fixed file path (#86)
gurkvatten e72f073
Fix path in Dockerfile for `www` directory copy operation (#87)
codebyNorthsteep ff4cd12
Feature/27 ipfilter (#70)
apaegs 7652687
Feature/LocaleFilter (#81)
AntonAhlqvist d6f1d26
Create LoggFilter (#83)
AnnaZiafar 27e627c
Return status code 500 (#79)
AnnaZiafar db0c574
Feature/LocaleFilterCookie (#92)
AntonAhlqvist b7154fa
added brotli4j (#94)
gurkvatten fa1599a
Issue/69 remove html concat (#73)
Rickank c7c63e8
Implement configurable filter pipeline (global + per‑route filters) #…
Ericthilen 245e188
28 file format compression filter (#82)
gurkvatten bc93313
Feature/32 filter request timeout class (#90)
eeebbaandersson 598358e
Created test-files/ directory for testing files and the file-test.htm…
Martin-E-Karlsson 557cdd0
Added the design of the file-test.html page
Martin-E-Karlsson 7d9c594
Added JavaScript logic to display files
Martin-E-Karlsson e31f485
Fixed warnings
Martin-E-Karlsson 80ffccf
Feature/config loading from classpath (#72)
MartinStenhagen bb5bdc8
- Cleaned up unused HTML code
Martin-E-Karlsson 088e926
Merge branch 'main' into 96-create-page-for-testing-filytypes
Martin-E-Karlsson 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 hidden or 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 @@ | ||
| name: Java CI with Maven | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Get Java Version | ||
| run: | | ||
| JAVA_VERSION=$(mvn help:evaluate "-Dexpression=maven.compiler.release" -q -DforceStdout) | ||
| echo "JAVA_VERSION=$JAVA_VERSION" >> $GITHUB_ENV | ||
|
|
||
| - name: Set up JDK ${{ env.JAVA_VERSION }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: ${{ env.JAVA_VERSION }} | ||
| distribution: 'temurin' | ||
| cache: maven | ||
|
|
||
| - name: Compile with Maven | ||
| run: mvn -B compile --file pom.xml | ||
|
|
||
| - name: Test with Maven | ||
| run: mvn -B test --file pom.xml |
This file contains hidden or 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,35 @@ | ||
| name: Publish Docker Image to Github Packages on Release | ||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v6.0.2 | ||
| - uses: docker/setup-qemu-action@v3.7.0 | ||
| - uses: docker/setup-buildx-action@v3.12.0 | ||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3.7.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Extract metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5.10.0 | ||
| with: | ||
| images: ghcr.io/ithsjava25/webserver | ||
| - name: Build and push | ||
| uses: docker/build-push-action@v6.18.0 | ||
| with: | ||
| context: . | ||
| push: true | ||
| platforms: linux/amd64, linux/arm64 | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
|
|
This file contains hidden or 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 @@ | ||
| FROM maven:3-eclipse-temurin-25-alpine AS build | ||
| WORKDIR /build | ||
| COPY src/ src/ | ||
| COPY pom.xml pom.xml | ||
| RUN mvn compile | ||
| RUN mvn dependency:copy-dependencies -DincludeScope=compile | ||
|
|
||
| FROM eclipse-temurin:25-jre-alpine | ||
| EXPOSE 8080 | ||
| RUN addgroup -S appgroup && adduser -S appuser -G appgroup | ||
| WORKDIR /app/ | ||
| COPY --from=build /build/target/classes/ /app/ | ||
| COPY --from=build /build/target/dependency/ /app/dependencies/ | ||
| COPY www/ ./www/ | ||
| USER appuser | ||
| ENTRYPOINT ["java", "-classpath", "/app:/app/dependencies/*", "org.example.App"] | ||
This file contains hidden or 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,49 @@ | ||
| # Konfiguration: port (CLI → config-fil → default) | ||
|
|
||
| Det här projektet väljer vilken port servern ska starta på enligt följande prioritet: | ||
|
|
||
| 1. **CLI-argument** (`--port <port>`) – högst prioritet | ||
| 2. **Config-fil** (`application.yml`: `server.port`) | ||
| 3. **Default** (`8080`) – används om port saknas i config eller om config-filen saknas | ||
|
|
||
| --- | ||
|
|
||
| ## 1) Default-värde | ||
|
|
||
| Om varken CLI eller config anger port används: | ||
|
|
||
| - **8080** (default för `server.port` i `AppConfig`) | ||
|
|
||
| --- | ||
|
|
||
| ## 2) Config-fil: `application.yml` | ||
|
|
||
| ### Var ska filen ligga? | ||
| Standard: | ||
| - `src/main/resources/application.yml` | ||
|
|
||
| ### Exempel | ||
| ```yaml | ||
| server: | ||
| port: 9090 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 3) CLI-argument | ||
|
|
||
| CLI kan användas för att override:a config: | ||
|
|
||
| ```bash | ||
| java -cp target/classes org.example.App --port 8000 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 4) Sammanfattning | ||
|
|
||
| Prioritet: | ||
|
|
||
| 1. CLI (`--port`) | ||
| 2. `application.yml` (`server.port`) | ||
| 3. Default (`8080`) |
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.
Uh oh!
There was an error while loading. Please reload this page.