Skip to content
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

Tycho #221

Merged
merged 23 commits into from
Mar 1, 2023
Merged

Tycho #221

Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ S3 ninja

S3 ninja emulates the Amazon S3 API for development and test purposes.

![Screenshot](http://s3ninja.net/assets/images/screenie_min.jpg)
![Screenshot](src/site/assets/images/screenie_min.png)

See http://s3ninja.net for more details.

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<url>http://s3ninja.net</url>

<properties>
<sirius.kernel>dev-34.8.0</sirius.kernel>
<sirius.web>dev-63.0.1</sirius.web>
<sirius.kernel>dev-35.0.0</sirius.kernel>
<sirius.web>dev-64.0.1</sirius.web>
</properties>

<repositories>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/ninja/APILog.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ public String getTod() {
*/
public String getCSS() {
if ("ERROR".equals(result)) {
return "error";
return "sci-left-border-red";
}
if ("REJECTED".equals(result)) {
return "warning";
return "sci-left-border-yellow";
}

return "";
return "sci-left-border-gray";
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ninja/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public List<Bucket> getBuckets() {
}
}

result.sort((bucket1, bucket2) -> bucket1.getName().compareToIgnoreCase(bucket2.getName()));

return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ product {
vcs = "${build.vcs.number}"
tagLine = "S3 ninja emulates the S3 API for development and testing purposes."
claim = "It is however not intended as production system as it neither provides scalability nor replication or proper security."
wondergemRoot = "/ui"
tychoRoot = "/ui"
}

http {
Expand Down
Binary file removed src/main/resources/assets/images/menu_logo.png
Binary file not shown.
1 change: 0 additions & 1 deletion src/main/resources/assets/images/menu_logo.svg

This file was deleted.

90 changes: 0 additions & 90 deletions src/main/resources/assets/stylesheets/custom.scss

This file was deleted.

5 changes: 5 additions & 0 deletions src/main/resources/assets/tycho/images/menu_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/main/resources/assets/tycho/styles/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$primary-color: #9d2011;
$accent-color: $primary-color;
$linkColor: $primary-color;
14 changes: 14 additions & 0 deletions src/main/resources/extensions/tycho-page-menu/menu.html.pasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<i:arg type="String" name="point"/>
<i:pragma name="priority" value="10"/>

<i:switch test="@point">
<i:block name="left">
<t:menuItem label="Home" url="/ui" />
<t:menuItem label="Access Logs" url="/ui?log" />
<t:menuItem label="License" url="/ui?license" />
<t:menuItem label="Supported API" url="/ui?api"/>
</i:block>
<i:block name="right">
<t:menuItem label="F**k me on GitHub" url="https://github.com/scireum/s3ninja" />
</i:block>
</i:switch>
14 changes: 0 additions & 14 deletions src/main/resources/extensions/wondergem-page-menu/menu.html.pasta

This file was deleted.

17 changes: 11 additions & 6 deletions src/main/resources/templates/api.html.pasta
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
<w:page title="Supported API">
<i:block name="breadcrumbBar"/>
<t:page title="Supported API">
<i:block name="breadcrumbs">
<li>
<a href="/ui?api">Supported API</a>
</li>
</i:block>

<i:invoke template="/templates/header.html.pasta" title="Supported API"/>
<i:invoke template="/templates/header.html.pasta"
title="Supported API"/>
jakobvogel marked this conversation as resolved.
Show resolved Hide resolved

<div class="row">
<div class="col-md-12">
<div class="well">
<div>
<p>
Basically all object methods are supported. However, no ACLs are checked. If the bucket is public,
everyone can access its contents.
Otherwise, a valid hash has to be provided as Authorization header. The hash will be checked as
expected by amazon, but no multiline-headers are supported yet. (Multi-value headers are supported).
expected by amazon, but no multiline-headers are supported yet. (Multi-value headers are supported.)
</p>
<legend>Supported Methods</legend>
<ul>
Expand Down Expand Up @@ -38,4 +43,4 @@
<i:block name="footer">
<i:invoke template="/templates/footer.html.pasta"/>
</i:block>
</w:page>
</t:page>
110 changes: 71 additions & 39 deletions src/main/resources/templates/bucket.html.pasta
Original file line number Diff line number Diff line change
@@ -1,58 +1,90 @@
<i:arg name="bucket" type="ninja.Bucket"/>
<i:arg name="page" type="Page"/>
<i:arg name="bucket"
type="ninja.Bucket"/>
<i:arg name="page"
type="Page"/>

<w:page title="@bucket.getName()">
<i:block name="breadcrumbBar"/>
<t:page title="@bucket.getName()">
<i:block name="breadcrumbs">
<li>
<a href="@apply('/ui/%s', bucket.getEncodedName())">@bucket.getName()</a>
</li>
</i:block>

<i:invoke template="/templates/header.html.pasta"
title="@bucket.getName()"
subtitle="Private buckets can only be accessed using proper API keys. Public buckets can be accessed by anyone."/>
jakobvogel marked this conversation as resolved.
Show resolved Hide resolved


<div class="row">
<div class="col-md-4">
<div class="well">
<w:fileUpload uploadUrl="@apply('/ui/%s?upload', bucket.getEncodedName())"/>
<div class="card shadow-sm mb-4">
<div class="card-body">
<i:if test="bucket.isPrivate()">
<a class="btn btn-success w-100"
href="/ui/@bucket.getEncodedName()?make-public">
<i class="fa-solid fa-lock-open"></i>
Make Public
</a>
<i:else>
<a class="btn btn-danger w-100"
href="/ui/@bucket.getEncodedName()?make-private">
<i class="fa-solid fa-lock"></i>
Make Private
</a>
</i:else>
</i:if>
</div>
</div>
<div class="card shadow-sm mb-4">
<div class="card-body">
<t:fileUpload btnClass="btn-secondary w-100"
uploadUrl="@apply('/ui/%s?upload', bucket.getEncodedName())"/>
<div class="text-muted text-small">
Drag files onto the button to upload them.
</div>
</div>
</div>
</div>
<div class="col-md-8">
<w:tableSearchHeader page="@page" baseUrl="@apply('/ui/%s', bucket.getEncodedName())">
<i:if test="bucket.isPrivate()">
<a class="btn btn-success" href="/ui/@bucket.getEncodedName()?make-public">Make Public</a>
<i:else>
<a class="btn btn-danger" href="/ui/@bucket.getEncodedName()?make-private">Make Private</a>
</i:else>
</i:if>
</w:tableSearchHeader>
<t:searchHeader page="@page"
baseUrl="@apply('/ui/%s', bucket.getEncodedName())"></t:searchHeader>

<w:table data="page">
<thead>
<tr>
<th>Object</th>
<th></th>
</tr>
</thead>
<tbody>
<i:for type="ninja.StoredObject" var="obj" items="page.getItems()">
<tr>
<td>
<a class="link" href="/ui/@bucket.getEncodedName()/@obj.getEncodedKey()">@obj.getKey()</a><br/>
<span class="muted">@obj.getSize()</span>
<span class="muted pull-right">@obj.getLastModified()</span>
</td>
<td class="align-center col-md-2">
<w:deleteLink url="@apply('/ui/%s/%s?delete', bucket.getEncodedName(), obj.getEncodedKey())"/>
</td>
</tr>
</i:for>
</tbody>
</w:table>
<div class="card shadow-sm mb-4">
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>Object</th>
<th></th>
</tr>
</thead>
<tbody>
<i:for type="ninja.StoredObject"
var="obj"
items="page.getItems()">
<tr>
<td>
<a class="link"
href="/ui/@bucket.getEncodedName()/@obj.getEncodedKey()">@obj.getKey()</a><br/>
<div class="text-muted small">@obj.getSize()</div>
<div class="text-muted small">@obj.getLastModified()</div>
</td>
<td class="text-right pr-0">
<t:deleteButton
url="@apply('/ui/%s/%s?delete', bucket.getEncodedName(), obj.getEncodedKey())"/>
</td>
</tr>
</i:for>
</tbody>
</table>
</div>
</div>

<w:pagination page="@page" baseUrl="@apply('/ui/%s', bucket.getEncodedName())"/>
<t:pagination page="@page"
baseUrl="@apply('/ui/%s', bucket.getEncodedName())"/>
</div>
</div>

<i:block name="footer">
<i:invoke template="/templates/footer.html.pasta"/>
</i:block>
</w:page>
</t:page>
11 changes: 6 additions & 5 deletions src/main/resources/templates/footer.html.pasta
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<div class="footer">
<div class="container">
<div class="pull-left">
<small>@sirius.kernel.info.Product.getProduct().getName() is made with all the love in the world by <a
href="http://www.scireum.de" target="_blank">scireum</a> in Remshalden
<div class="container-fluid d-flex justify-content-between">
<div>
<small>
@sirius.kernel.info.Product.getProduct().getName() is made with all the love in the world by
<a href="http://www.scireum.de" target="_blank">scireum</a> in Remshalden
</small>
</div>
<div class="pull-right" style="text-align: right">
<div class="text-right">
<small>@sirius.kernel.info.Product.getProduct().getDetails()</small>
</div>
</div>
Expand Down
Loading