Commit a2d32cda authored by Vlad Dumitru's avatar Vlad Dumitru
Browse files

First commit

parents
Pipeline #4792 failed with stages
in 0 seconds
/target
/lib
/classes
/checkouts
pom.xml
dev-config.edn
test-config.edn
*.jar
*.class
/.lein-*
profiles.clj
/.env
.nrepl-port
/node_modules
/log
/resources/public/css/*
FROM openjdk:8-alpine
COPY target/uberjar/konditorei.jar /konditorei/app.jar
EXPOSE 3000
CMD ["java", "-jar", "/konditorei/app.jar"]
web: java -Dclojure.main.report=stderr -cp target/uberjar/konditorei.jar clojure.main -m konditorei.core
# konditorei
## Before running
Compile the stylus files:
stylus resources/stylus/style.stylus -o resources/public/css/style.css
## Running
To start a web server for the application, run:
lein run
(ns konditorei.dev-middleware
(:require
[ring.middleware.reload :refer [wrap-reload]]
[selmer.middleware :refer [wrap-error-page]]
[prone.middleware :refer [wrap-exceptions]]))
(defn wrap-dev [handler]
(-> handler
wrap-reload
wrap-error-page
(wrap-exceptions {:app-namespaces ['konditorei]})))
(ns konditorei.env
(:require
[selmer.parser :as parser]
[clojure.tools.logging :as log]
[konditorei.dev-middleware :refer [wrap-dev]]))
(def defaults
{:init
(fn []
(parser/cache-off!)
(log/info "\n-=[konditorei started successfully using the development profile]=-"))
:stop
(fn []
(log/info "\n-=[konditorei has shut down successfully]=-"))
:middleware wrap-dev})
(ns user
"Userspace functions you can run by default in your local REPL."
(:require
[konditorei.config :refer [env]]
[clojure.pprint]
[clojure.spec.alpha :as s]
[expound.alpha :as expound]
[mount.core :as mount]
[konditorei.core :refer [start-app]]))
(alter-var-root #'s/*explain-out* (constantly expound/printer))
(add-tap (bound-fn* clojure.pprint/pprint))
(defn start
"Starts application.
You'll usually want to run this on startup."
[]
(mount/start-without #'konditorei.core/repl-server))
(defn stop
"Stops application."
[]
(mount/stop-except #'konditorei.core/repl-server))
(defn restart
"Restarts application."
[]
(stop)
(start))
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<charset>UTF-8</charset>
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>log/konditorei.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/konditorei.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days of history -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern>
</encoder>
</appender>
<logger name="org.apache.http" level="warn" />
<logger name="org.xnio.nio" level="warn" />
<logger name="io.undertow.websockets.core.request" level="warn" />
<logger name="io.undertow.request" level="warn" />
<logger name="io.undertow.session" level="warn" />
<logger name="io.undertow.request" level="warn" />
<root level="DEBUG">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>
(ns konditorei.env
(:require [clojure.tools.logging :as log]))
(def defaults
{:init
(fn []
(log/info "\n-=[konditorei started successfully]=-"))
:stop
(fn []
(log/info "\n-=[konditorei has shut down successfully]=-"))
:middleware identity})
{:prod true
:port 3000}
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>log/konditorei.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/konditorei.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days of history -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5relative %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.apache.http" level="warn" />
<logger name="org.xnio.nio" level="warn" />
<logger name="io.undertow.websockets.core.request" level="warn" />
<logger name="io.undertow.request" level="warn" />
<logger name="io.undertow.session" level="warn" />
<logger name="io.undertow.request" level="warn" />
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="10 seconds">
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<charset>UTF-8</charset>
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>log/konditorei.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/konditorei.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 30 days of history -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%date{ISO8601} [%thread] %-5level %logger{36} - %msg %n</pattern>
</encoder>
</appender>
<logger name="org.apache.http" level="warn" />
<logger name="org.xnio.nio" level="warn" />
<logger name="io.undertow.websockets.core.request" level="warn" />
<logger name="io.undertow.request" level="warn" />
<logger name="io.undertow.session" level="warn" />
<logger name="io.undertow.request" level="warn" />
<root level="DEBUG">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>
(defproject konditorei "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies [[ch.qos.logback/logback-classic "1.2.3"]
[clojure.java-time "0.3.2"]
[cprop "0.1.17"]
[expound "0.8.9"]
[funcool/struct "1.4.0"]
[luminus-transit "0.1.2"]
[luminus-undertow "0.1.10"]
[luminus/ring-ttl-session "0.3.3"]
[markdown-clj "1.10.5"]
[metosin/muuntaja "0.6.8"]
[metosin/reitit "0.5.12"]
[metosin/ring-http-response "0.9.2"]
[mount "0.1.16"]
[nrepl "0.8.3"]
[org.clojure/clojure "1.10.2"]
[org.clojure/data.json "1.0.0"]
[org.clojure/tools.cli "1.0.194"]
[org.clojure/tools.logging "1.1.0"]
[org.webjars/webjars-locator "0.40"]
[org.webjars/webjars-locator-jboss-vfs "0.1.0"]
[ring-webjars "0.2.0"]
[ring/ring-core "1.9.1"]
[ring/ring-defaults "0.3.2"]
[selmer "1.12.33"]
[clj-http "3.12.0"]]
:min-lein-version "2.0.0"
:source-paths ["src/clj"]
:test-paths ["test/clj"]
:resource-paths ["resources"]
:target-path "target/%s/"
:main ^:skip-aot konditorei.core
:plugins []
:profiles
{:uberjar {:omit-source true
:aot :all
:uberjar-name "konditorei.jar"
:source-paths ["env/prod/clj" ]
:resource-paths ["env/prod/resources"]}
:dev [:project/dev :profiles/dev]
:test [:project/dev :project/test :profiles/test]
:project/dev {:jvm-opts ["-Dconf=dev-config.edn" ]
:dependencies [[pjstadig/humane-test-output "0.10.0"]
[prone "2020-01-17"]
[ring/ring-devel "1.9.1"]
[ring/ring-mock "0.4.0"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.24.1"]
[jonase/eastwood "0.3.5"]]
:source-paths ["env/dev/clj" ]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user
:timeout 120000}
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}
:project/test {:jvm-opts ["-Dconf=test-config.edn" ]
:resource-paths ["env/test/resources"] }
:profiles/dev {}
:profiles/test {}})
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>/{{ key }} &middot; konditorei</title>
{% style "/css/style.css" %}
</head>
<body>
<header>
<h1 class="field">
<span class="dim name"><strong>GRASS</strong></span>
<span class="value">the Graz corpus of Read And Spontaneous Speech</span>
</h1>
<nav>
<a class="crumb" href="/tree/">root</a> /
{% for crumb in breadcrumbs %}
{% if forloop.last %}
<span class="active">{{ crumb.name }}</span>
{% else %}
<a class="crumb" href="/tree{{ crumb.path }}">{{ crumb.name }}</a> /
{% endif %}
{% endfor %}
</nav>
</header>
<main>
{% block content %}
{% endblock %}
</main>
<footer>
<p><strong>konditorei</strong></p>
</footer>
{% block page-scripts %}
{% endblock %}
</body>
</html>
{% extends "base.html" %}
{% block content %}
<div class="sides">
<div class="side">
<hr>
<div class="content">
<h2 class="field">
<span class="dim name">bundle</span>
<span class="value">{{ name }}</span>
</h2>
<div class="field">
<span class="dim name">layers</span>
<span class="value">
{% for l in layers %}
<a href="#" class="tag">{{ l }}</a>
{% endfor %}
</span>
</div>
</div>
<hr>
</div>
<div class="side">
<hr>
<div class="content">
<div class="field">
<span class="dim name"><h2>history</h2></span>
<span class="value">
{% for h in history %}
<div class="history">
<div class="header">
<span class="date-time dim">{{ h.date|date:"yyyy-MM-dd HH:mm:ss" }}</span>
<span class="author"><a href="#">{{ h.author }}</a></span>
</div>
<div class="message">{{ h.message }}</div>
</div>
{% endfor %}
</span>
</div>
</div>
<hr>
</div>
{% endblock %}
<!DOCTYPE html>
<html>
<head>
<title>Something Bad Happened</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h1>Error: {{status}}</h1>
<hr>
{% if title %}
<h2>{{title}}</h2>
{% endif %}
{% if message %}
<h4>{{message}}</h4>
{% endif %}
</body>
</html>
{% extends "base.html" %}
{% block content %}
<div class="sides">
<div class="side">
<hr>
<div class="field">
<div class="dim name">files</div>
<div class="value">
<div class="files">
{% for c in tree %}
<div class="file">
{% if c.type = "folder" %}
<span class="name"><a href="/tree/{{ c.name }}">{{ c.name }}</a>/</span>
{% elif c.type = "bundle" %}
<span class="name"><a href="/bundle/{{ key }}/{{ c.name }}">{{ c.name }}</a></span>
{% endif %}
</div>
{% endfor %}
</div>
</div>
</div>
<hr>
</div>
<div class="side rhs">
<hr>
<div class="content text-content">
{{ readme|markdown }}
</div>
<hr>
</div>
</div>
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment