Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-brooke committed Jan 19, 2019
2 parents 835dec0 + 8374432 commit f2479b2
Show file tree
Hide file tree
Showing 41 changed files with 1,419 additions and 169 deletions.
30 changes: 28 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
FROM tomcat:alpine
COPY target/smeagol-*-standalone.war $CATALINA_HOME/webapps/smeagol.war
FROM alpine:3.6

MAINTAINER Simon Brooke <[email protected]>

ENV JAVA_HOME=/usr/lib/jvm/default-jvm

RUN apk add --no-cache openjdk8 && \
ln -sf "${JAVA_HOME}/bin/"* "/usr/bin/"

# ensure the directories I'm going to write to actually exist!
RUN mkdir -p /usr/local/bin
RUN mkdir -p /usr/local/etc

COPY target/smeagol-*-standalone.jar /usr/local/bin/smeagol.jar
COPY resources/passwd /usr/local/etc/passwd
COPY resources/config.edn /usr/local/etc/config.edn
COPY resources/public/content /usr/local/etc/content

ENV SMEAGOL_CONFIG=/usr/local/etc/config.edn
ENV SMEAGOL_CONTENT_DIR=/usr/local/etc/content
ENV SMEAGOL_PASSWD=/usr/local/etc/passwd
ENV TIMBRE_DEFAULT_STACKTRACE_FONTS="{}"
ENV TIMBRE_LEVEL=':info'
ENV PORT=80

EXPOSE 80

CMD java -jar /usr/local/bin/smeagol.jar

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ You can (if you're logged in) upload files, including images, using the **Upload

![Smeagol](http://vignette3.wikia.nocookie.net/lotr/images/e/e1/Gollum_Render.png/revision/latest?cb=20141218075509)

## Includes
You can include pages into the current page you're working on. To do so, you can add a include link:

`&[:indent-heading s/Num :indent-list s/Num](relative or absolute uri s/Str)`

Parameters semantics:
* uri: The page to include. At the moment only pages from the current wiki are allowed. A page called "PageToBeIncluded" will result in a uri "PageToBeIncluded.md".
* indent-heading: You can indent headings of included page to adjust the included content to your surrounding structure. Indents 0-9 are supported.
* indent-list: In Same manner you can indent lists of included page to adjust the included content to your surrounding structure. Indents 0-9 are supported.

Security warning: At the moment there is no check against directory traversal attack. So include feature may expose files outside of your wiki content-dir.

## Advertisement
If you like what you see here, I am available for work on open source Clojure projects.

Expand Down
15 changes: 15 additions & 0 deletions doc/include.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Include Feature
## Requirements
The user can include page title, abstract or the whole content in a given page. Headings and enumerations can be indented by a given include-level.

## Thoughts & Questions
* Which include syntax should be used?
* page include can be definde alongsite of image includes - sth. like
`&[:indent-heading s/Num :indent-list s/Num](relative or absolute url s/Str)`
* Which kind of urls should we accept for page includes?
* relative local urls (we will need some care to prohibit directory traversal ...)
* absolute github / gitlab / gitblit urls without authentication.
* Which metadata can be used for title / abstract ?
* MultiMarcdown-Metadata is supported by clj-markdown :-)
* How can we test page includes?
* we will need a content resolver component for testing and at least one for production resolving.
10 changes: 5 additions & 5 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject smeagol "1.0.0-rc3"
(defproject smeagol "1.0.2"
:description "A simple Git-backed Wiki inspired by Gollum"
:url "https://github.com/simon-brooke/smeagol"
:license {:name "GNU General Public License,version 2.0 or (at your option) any later version"
Expand All @@ -7,10 +7,9 @@
[clj-yaml "0.4.0"]
[com.cemerick/url "0.1.1"]
[com.fzakaria/slf4j-timbre "0.3.7"]
[com.stuartsierra/component "0.3.2"]
[com.taoensso/encore "2.92.0"]
[com.cemerick/url "0.1.1"]
[com.taoensso/timbre "4.10.0"]
[com.fzakaria/slf4j-timbre "0.3.7"]
[com.taoensso/tower "3.0.2" :exclusions [com.taoensso/encore]]
[crypto-password "0.2.0"]
[environ "1.1.0"]
Expand All @@ -28,6 +27,7 @@
[org.slf4j/log4j-over-slf4j "1.7.25"]
[org.slf4j/jul-to-slf4j "1.7.25"]
[org.slf4j/jcl-over-slf4j "1.7.25"]
[prismatic/schema "1.1.9"]
[prone "1.1.4"]
[ring/ring-anti-forgery "1.1.0"]
[ring-server "0.4.0"]
Expand Down Expand Up @@ -61,10 +61,10 @@
:release-tasks [["vcs" "assert-committed"]
["change" "version" "leiningen.release/bump-version" "release"]
["vcs" "commit"]
;; ["vcs" "tag"] -- not working, problems with secret key
["vcs" "tag" "v." "--no-sign"]
["clean"]
["bower" "install"]
["ring" "uberwar"]
["ring" "uberjar"]
["docker" "build"]
["docker" "push"]
["change" "version" "leiningen.release/bump-version"]
Expand Down
18 changes: 13 additions & 5 deletions resources/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; config.edn: a simple configuration map for Smeagol; inspired by Cryogen.
;;; This is top-level configuration.
;;; This is top-level configuration. All values can be overridden with
;;; environment variables.

;; ; ; ; ; ; ; ; ; ;
{
:site-title "Smeagol" ;; overall title of the site, used in page headings
:default-locale "en-GB" ;; default language used for messages
:formatters {"vega" smeagol.formatting/process-vega
:content-dir "resources/public/content"
:start-page "Introduction"
;; where content is served from.
:default-locale "en-GB" ;; default language used for messages
:formatters {"vega" smeagol.formatting/process-vega
"vis" smeagol.formatting/process-vega
"mermaid" smeagol.formatting/process-mermaid
"backticks" smeagol.formatting/process-backticks}
}
:log-level :info ;; the minimum logging level; one of
;; :trace :debug :info :warn :error :fatal
:passwd "resources/passwd"
;; where the password file is stored
:site-title "Smeagol"} ;; overall title of the site, used in
;; page headings
144 changes: 144 additions & 0 deletions resources/i18n/de-DE.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; Smeagol: a very simple Wiki engine.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; German language translation contributed by and
;;;; Copyright (C) 2017 Soukyan Blackwood <[email protected]>
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; en-GB.edn: English-language messages.
;;; This is essentially all the text in the chrome - that which isn't editable
;;; through the wiki itself; and the test in the sanity check report.

;; ; ; ; ; ; ; ; ; ;
{:add-user-label "Neuen Benutzer zufügen" ;; label for the add user link on edit users page
:change-pass-label "Kennwort ändern!"
;; text of the change password widget itself on the
;; change password page
:change-pass-link "Kennwort ändern"
;; text of the change password link on the menu
:change-pass-prompt "Um Ihr Kennwort zu ändern"
;; text of the change password widget prompt on the
;; change password page
:change-col-hdr "Änderungen" ;; header for the changes column in history
:chpass-bad-match "Die von Ihnen vorgeschlagenen Kennwörter stimmen nicht überein"
;; error text if proposed passwords don't match
:chpass-fail "Ihr Kennwort wurde nicht geändert"
;; error text on fail other htan too short or bad match
:chpass-success "Ihr Kennwort wurde geändert"
;; confirmation text on password change
:chpass-too-short "Das von Ihnen vorgeschlagene Kennwort war zu kurz: 8 Zeichen erforderlich"
;; error text if proposed password is too short
:chpass-title-prefix "Kennwort ändern für"
;; prefix for title of change password page
:content-dir "Das Inhaltsverzeichnis"
;; used in sanity check report
:content-dir-exists "Das Inhaltsverzeichnis existiert"
;; used in sanity check report
:content-dir-is-dir "Das Inhaltsverzeichnis ist ein Verzeichnis"
;; used in sanity check report
:cookies-about "Über Cookies" ;; about cookies text
:cookies-more "Es wird von Ihrem Browser gelöscht, sobald Sie diese Seite verlassen. Diese Webseite benutzt keine Cookies von dritten Parteien, daher kann Ihr Besuch hier nicht von anderen Seiten verfolgt werden."
;; more about cookies text
:default-page-title "Einleitung" ;; title of the default page in this wiki
:del-col-hdr "Löschen" ;; header for delete column on edit users page
:del-user-fail "Könnte Benutzer nicht löschen"
;; error message on failure to delete user
:del-user-success "Benutzer wurde erfolgreich gelöscht"
;; confirmation message on deletion of user
:diff-title-prefix "Änderungen seit der Version"
;; prefix for the header of the changes page
:does-not-exist "existiert nicht"
;; (of a file or directory); used in sanity check report
:edit-col-hdr "Bearbeiten" ;; header for edit column on edit users page
:edit-page-link "Diese Seite bearbeiten"
;; text of the edit page link on the content frame
:edit-title-prefix "Bearbeiten" ;; prefix for title of edit content page
:edit-users-link "Benutzer bearbeiten" ;; text of the edit users link on the menu
:edit-users-title "Benutzer zum Bearbeiten auswählen"
;; title of edit users page
:email-prompt "E-Mail Adresse" ;; text of the email widget prompt on edit user page
:file-or-directory "Datei oder Verzeichnis"
;; used in sanity check report
:file-summary-prompt "Beschreibung/was wurde gändert"
;; prompt for the file upload summary input
:file-upload-link-text "Sie können auf diese Datei verweisen, mit Hilfe von einer Verknüpfung von der Form"
;; Text introducing the link to an uploaded file
:file-upload-prompt "Datei zum Hochladen" ;; prompt string for the file upload widget
:file-upload-title "Upload a file" ;; title for the file upload page
:is-admin-prompt "Ist Administrator?"
:here "hier" ;; used in sanity check report
:home-link "Startseite" ;; text of the home link on the menu
:is-not-directory "ist kein Verzeichnis"
;; (of a file or directory) used in sanity check report
:is-not-readable "ist nicht lesbar"
;; (of a file or directory) used in sanity check report
:is-not-writable "ist nicht schreibbar"
;; (of a file or directory) used in sanity check report
:login-label "Log in!" ;; text of the login widget on the login page
:login-link "Log in" ;; text of the login link on the menu
:login-prompt "Um dieses Wiki zu bearbeiten"
;; text of the action widget prompt on the login page
:logout-label "Abmelden!" ;; text of the logout widget on the logout page
:logout-link "Abmelden" ;; text of the logout link on the menu
:logged-in-as "Sie sind angemeldet als"
;; text of the 'logged in as' label on the menu
:history-link "Historie" ;; text of the history link on the content frame
:history-title-prefix "Historie von" ;; prefix of the title on the history page
:new-pass-prompt "Neues Kennwort" ;; text of the new password widget prompt on the change
;; password and edit user pages
:no-admin-users "In der Datei 'passwd' gibt es keine Benutzer mit Administratorrechten"
;; used in sanity check report
:old-pass-prompt "Ihr Kennwort"
;; text of the old password widget prompt on the change
;; password page, and password widget on login page
:password-file "Die Kennwort ('passwd') Datei"
;; used in sanity check report
:problems-found "Probleme gefunden"
;; used in sanity check report
:rpt-pass-prompt "und noch einmal" ;; text of the new password widget prompt on the change
;; password and edit user pages
:save-prompt "Wenn Sie mit dem Bearbeiten fertig sind"
;; text of the save widget label on edit content
;; and edit user page
:save-label "Speichern!" ;; text of the save widget itself
:save-user-fail "Benutzer konnte nicht gespeichert werden"
:save-user-success "Benutzer erfolgreich gespeichert"
:see-documentation "Für mehr Information sehen Sie bitte die Dokumentation "
;; used in sanity check report
:smeagol-not-initialised
"Smeagol ist nicht richtig initialisiert"
;; title of the sanity check report
:smeagol-misconfiguration
"Smeagol konnte einige der Ressourcen, von denen es abhängt,
nicht finden; wahrscheinlich wegen einer Fehlkonfiguration oder fehlenden Umgebungsvariablen."
;; used in sanity check report
:user-lacks-field "Das Feld für den Benutzereintrag in die passwd Datei fehlt"
;; used in sanity check report
:username-prompt "Benutzername" ;; text of the username widget prompt on edit user page
;; text of the is admin widget prompt on edit user page
:user-title-prefix "Benutzer bearbeiten" ;; prefix for title of edit user page
:vers-col-hdr "Version" ;; header for the version column in history
:what-col-hdr "Wass" ;; header for the what column in history
:what-changed-prompt "Was haben Sie verändert?"
;; text of the summary widget prompt on edit
;; content page
:when-col-hdr "Was" ;; header for the when column in history
:your-uname-prompt "Ihr Benutzername" ;; text of the username widget prompt on the login page
}
1 change: 1 addition & 0 deletions resources/i18n/de.edn
2 changes: 1 addition & 1 deletion resources/i18n/en-GB.edn
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
;; error text on fail other htan too short or bad match
:chpass-success "Your password was changed"
;; confirmation text on password change
:chpass-too-short "You proposed password wasn't long enough: eight characters required"
:chpass-too-short "Your proposed password wasn't long enough: eight characters required"
;; error text if proposed password is too short
:chpass-title-prefix "Change password for"
;; prefix for title of change password page
Expand Down
1 change: 1 addition & 0 deletions resources/i18n/lt.edn
Loading

0 comments on commit f2479b2

Please sign in to comment.