diff --git a/.gitignore b/.gitignore index a73b8123..f1869ebd 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ local/ node_modules/ static/export/ static/sites/ +lib/ diff --git a/build/client/editor.js b/build/client/editor.js index 671558d2..37aa6cc1 100644 --- a/build/client/editor.js +++ b/build/client/editor.js @@ -1,4 +1,6 @@ window.CodeMirror = require('codemirror/lib/codemirror'); +window.marked = require('marked/lib/marked'); + require('codemirror/mode/css/css'); require('codemirror/mode/gfm/gfm'); require('codemirror/mode/htmlmixed/htmlmixed'); @@ -7,5 +9,4 @@ require('codemirror/mode/markdown/markdown'); require('codemirror/mode/xml/xml'); require('./cm-skin-mode'); -window.marked = require('marked/lib/marked'); require('uikit/dist/js/components/htmleditor'); diff --git a/build/extra/antville.mv.db b/build/extra/antville.mv.db deleted file mode 100644 index a2175afb..00000000 Binary files a/build/extra/antville.mv.db and /dev/null differ diff --git a/build/extra/h2-1.3.176.jar b/build/extra/h2-1.3.176.jar deleted file mode 100644 index 54b8ce8e..00000000 Binary files a/build/extra/h2-1.3.176.jar and /dev/null differ diff --git a/build/extra/h2-1.4.197.jar b/build/extra/h2-1.4.197.jar deleted file mode 100644 index 5f311db5..00000000 Binary files a/build/extra/h2-1.4.197.jar and /dev/null differ diff --git a/build/extra/h2.txt b/build/extra/h2.txt deleted file mode 100644 index 64ff88ca..00000000 --- a/build/extra/h2.txt +++ /dev/null @@ -1,12 +0,0 @@ -H2 is dual licensed and available under a modified version of the MPL 1.1 (Mozilla Public License) or under the (unmodified) EPL 1.0 (Eclipse Public License). The changes to the MPL are underlined. There is a License FAQ for both the MPL and the EPL, most of that is applicable to the H2 License as well. - - * You can use H2 for free. You can integrate it into your application (including commercial applications), and you can distribute it. - * Files containing only your code are not covered by this license (it is 'commercial friendly'). - * Modifications to the H2 source code must be published. - * You don't need to provide the source code of H2 if you did not modify anything. - -However, nobody is allowed to rename H2, modify it a little, and sell it as a database engine without telling the customers it is in fact H2. This happened to HSQLDB: a company called 'bungisoft' copied HSQLDB, renamed it to 'RedBase', and tried to sell it, hiding the fact that it was in fact just HSQLDB. It seems 'bungisoft' does not exist any more, but you can use the Wayback Machine and visit old web pages of http://www.bungisoft.com. - -About porting the source code to another language (for example C# or C++): converted source code (even if done manually) stays under the same copyright and license as the original code. The copyright of the ported source code does not (automatically) go to the person who ported the code. - -For the full license text see http://www.h2database.com/html/license.html. diff --git a/build/extra/helma.jar b/build/extra/helma.jar deleted file mode 100644 index 81cf1d8a..00000000 Binary files a/build/extra/helma.jar and /dev/null differ diff --git a/build/extra/launcher.jar b/build/extra/launcher.jar deleted file mode 100644 index 2026e6f5..00000000 Binary files a/build/extra/launcher.jar and /dev/null differ diff --git a/build/extra/start.bat b/build/extra/start.bat deleted file mode 100644 index 67aa5332..00000000 --- a/build/extra/start.bat +++ /dev/null @@ -1,83 +0,0 @@ -:: -:: The Antville Project -:: http://code.google.com/p/antville -:: -:: Copyright 2001–2014 by the Workers of Antville. -:: -:: Licensed under the Apache License, Version 2.0 (the ``License''); -:: you may not use this file except in compliance with the License. -:: You may obtain a copy of the License at -:: -:: http://www.apache.org/licenses/LICENSE-2.0 -:: -:: Unless required by applicable law or agreed to in writing, software -:: distributed under the License is distributed on an ``AS IS'' BASIS, -:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -:: See the License for the specific language governing permissions and -:: limitations under the License. -:: - -@echo off - -set JAVA_HOME= -set HOP_HOME= -set HTTP_PORT= -set XMLRPC_PORT= -set AJP13_PORT= -set RMI_PORT= -set CONFIG_FILE= -set OPTIONS= - -set HTTP_PORT=8080 -rem set XMLRPC_PORT=8081 -rem set AJP13_PORT=8009 -rem set RMI_PORT=5050 -rem set CONFIGFILE=./etc/jetty.xml - -rem set HOP_HOME="c:\program files\helma" -rem set JAVA_HOME="c:\program files\java" - -set JAVA_OPTIONS=-Djava.awt.headless=true -Dfile.encoding=utf-8 - -set INSTALL_DIR=%~d0%~p0 - -if "%JAVA_HOME%"=="" goto default - set JAVACMD=%JAVA_HOME%\bin\java - goto end -:default - set JAVACMD=java -:end - -if "%HOP_HOME%"=="" ( - set HOP_HOME=%INSTALL_DIR% -) -cd %HOP_HOME% - -if not "%CONFIG_FILE%"=="" ( - echo Using configuration file %CONFIG_FILE% - set OPTION=%OPTIONS% -c %CONFIG_FILE% - goto java -) -if not "%HTTP_PORT%"=="" ( - echo Starting HTTP server on port %HTTP_PORT% - set OPTIONS=%OPTIONS% -w %HTTP_PORT% -) -if not "%XMLRPC_PORT%"=="" ( - echo Starting XML-RPC server on port %XMLRPC_PORT% - set OPTIONS=%OPTIONS% -x %XMLRPC_PORT% -) -if not "%AJP13_PORT%"=="" ( - echo Starting AJP13 listener on port %AJP13_PORT% - set OPTIONS=%OPTIONS% -jk %AJP13_PORT% -) -if not "%RMI_PORT%"=="" ( - echo Starting RMI server on port %RMI_PORT% - set OPTIONS=%OPTIONS% -p %RMI_PORT% -) -if not "%HOP_HOME%"=="" ( - echo Serving applications from %HOP_HOME% - set OPTIONS=%OPTIONS% -h "%HOP_HOME% -) - -:java -%JAVACMD% %JAVA_OPTIONS% -jar "%INSTALL_DIR%\launcher.jar" %OPTIONS% diff --git a/build/extra/start.sh b/build/extra/start.sh deleted file mode 100755 index 41a65c0e..00000000 --- a/build/extra/start.sh +++ /dev/null @@ -1,80 +0,0 @@ -# The Antville Project -# http://code.google.com/p/antville -# -# Copyright 2001–2014 by the Workers of Antville. -# -# Licensed under the Apache License, Version 2.0 (the ``License''); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an ``AS IS'' BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -#!/bin/sh - -HTTP_PORT=8080 -#XMLRPC_PORT=8081 -#AJP13_PORT=8009 -#RMI_PORT=5050 -#CONFIG_FILE=./etc/jetty.xml - -#JAVA_HOME=/usr/lib/java -#HOP_HOME=/usr/local/helma - -JAVA_OPTIONS="-Djava.awt.headless=true -Dfile.encoding=utf-8" - -if [ "$JAVA_HOME" ]; then - JAVACMD="$JAVA_HOME/bin/java" - # Check if java command is executable - if [ ! -x $JAVACMD ]; then - echo "Warning: JAVA_HOME variable may be set incorrectly:" - echo " No executable found at $JAVACMD" - fi -else - JAVACMD=java -fi - -INSTALL_DIR="${0%/*}" -cd $INSTALL_DIR -INSTALL_DIR=$PWD - -if [ -z "$HOP_HOME" ]; then - HOP_HOME="${0%/*}" - cd $HOP_HOME - HOP_HOME=$PWD -else - cd $HOP_HOME -fi -echo "Starting Helma in directory $HOP_HOME" - -if [ "$CONFIG_FILE" ]; then - SWITCHES="$SWITCHES -c $CONFIG_FILE" - echo Using configuration file $CONFIG_FILE -else - if [ "$HTTP_PORT" ]; then - SWITCHES="$SWITCHES -w $HTTP_PORT" - echo Starting HTTP server on port $HTTP_PORT - fi - if [ "$XMLRPC_PORT" ]; then - SWITCHES="$SWITCHES -x $XMLRPC_PORT" - echo Starting XML-RPC server on port $XMLRPC_PORT - fi - if [ "$AJP13_PORT" ]; then - SWITCHES="$SWITCHES -jk $AJP13_PORT" - echo Starting AJP13 listener on port $AJP13_PORT - fi - if [ "$RMI_PORT" ]; then - SWITCHES="$SWITCHES -p $RMI_PORT" - echo Starting RMI server on port $RMI_PORT - fi - if [ "$HOP_HOME" ]; then - SWITCHES="$SWITCHES -h $HOP_HOME" - fi -fi - -$JAVACMD $JAVA_OPTIONS -jar "$INSTALL_DIR/launcher.jar" $SWITCHES diff --git a/legal/medialoot.txt b/claustra/connect/licenses/medialoot.txt similarity index 100% rename from legal/medialoot.txt rename to claustra/connect/licenses/medialoot.txt diff --git a/legal/scribe.txt b/claustra/connect/licenses/scribe.txt similarity index 100% rename from legal/scribe.txt rename to claustra/connect/licenses/scribe.txt diff --git a/code/Global/Global.js b/code/Global/Global.js index 12ce4110..4e122cf1 100644 --- a/code/Global/Global.js +++ b/code/Global/Global.js @@ -50,6 +50,7 @@ app.addRepository('modules/jala/code/Utilities.js'); fname.endsWith('.js') && app.addRepository(app.dir + '/../i18n/' + fname); } })(); + // I18n.js needs to be added *after* the message files or the translations get lost app.addRepository('modules/jala/code/I18n.js'); diff --git a/db/h2.compat/db.properties b/db/h2.compat/db.properties index 3ca69a76..7223f5bf 100644 --- a/db/h2.compat/db.properties +++ b/db/h2.compat/db.properties @@ -17,5 +17,5 @@ antville.url = jdbc:h2:./db/antville;ifexists=true;mode=postgresql antville.driver = org.h2.Driver -antville.user = sa -antville.password = +antville.user = antville +antville.password = antville diff --git a/db/postgre.sql b/db/postgre.sql index 9eacb953..c4a617b8 100644 --- a/db/postgre.sql +++ b/db/postgre.sql @@ -177,6 +177,8 @@ create table metadata ( create index metadata_parent_idx on metadata (parent_type, parent_id); create index metadata_name_idx on metadata (name); + +-- This returns an error in H2 database create index metadata_value_idx on metadata using hash (value); --!helma <% #end_of_metadata %> diff --git a/legal/jdom.txt b/legal/jdom.txt deleted file mode 100644 index a0333d0a..00000000 --- a/legal/jdom.txt +++ /dev/null @@ -1,49 +0,0 @@ -Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions, and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions, and the disclaimer that follows - these conditions in the documentation and/or other materials - provided with the distribution. - - 3. The name "JDOM" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact . - - 4. Products derived from this software may not be called "JDOM", nor - may "JDOM" appear in their name, without prior written permission - from the JDOM Project Management . - - In addition, we request (but do not require) that you include in the - end-user documentation provided with the redistribution and/or in the - software itself an acknowledgement equivalent to the following: - "This product includes software developed by the - JDOM Project (http://www.jdom.org/)." - Alternatively, the acknowledgment may be graphical using the logos - available at http://www.jdom.org/images/logos. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - This software consists of voluntary contributions made by many - individuals on behalf of the JDOM Project and was originally - created by Jason Hunter and - Brett McLaughlin . For more information - on the JDOM Project, please see . diff --git a/legal/rome.txt b/legal/rome.txt deleted file mode 100644 index b4b30c1c..00000000 --- a/legal/rome.txt +++ /dev/null @@ -1,13 +0,0 @@ - Copyright 2004 Sun Microsystems, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/lib/jdom-1.0.jar b/lib/jdom-1.0.jar deleted file mode 100644 index 288e64cb..00000000 Binary files a/lib/jdom-1.0.jar and /dev/null differ diff --git a/lib/lesscss-1.7.0.1.1.jar b/lib/lesscss-1.7.0.1.1.jar deleted file mode 100644 index feab0d6a..00000000 Binary files a/lib/lesscss-1.7.0.1.1.jar and /dev/null differ diff --git a/lib/rome-1.0.jar b/lib/rome-1.0.jar deleted file mode 100644 index 32576c1c..00000000 Binary files a/lib/rome-1.0.jar and /dev/null differ diff --git a/package.json b/package.json index 3c0ad16b..b3688da2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antville", - "version": "1.6.18", + "version": "1.618", "description": "Antville is an open source project aimed at the development of a high performance, feature rich weblog hosting software. It can easily host up to several thousands of sites (the number of weblogs is rather limited by the installation owner’s choice and server power than by software limitations).", "main": "main.js", "directories": { @@ -8,18 +8,12 @@ "test": "tests" }, "scripts": { - "build": "yarn build:fonts; yarn build:main; yarn build:editor", - "build:editor": "yarn build:editor:scripts; yarn build:editor:styles", - "build:editor:scripts": "browserify build/client/editor.js -o static/scripts/editor.min.js -d -p [minifyify --map /static/scripts/editor.min.map.json --output static/scripts/editor.min.map.json]", - "build:editor:styles": "lessc --clean-css build/client/editor.less static/styles/editor.min.css", - "build:fonts": "cp -Rp ./node_modules/uikit/dist/fonts static/", - "build:main": "yarn build:main:scripts; yarn build:main:styles", - "build:main:scripts": "browserify build/client/main.js -o static/scripts/main.min.js -d -p [minifyify --map /static/scripts/main.min.map.json --output static/scripts/main.min.map.json]", - "build:main:styles": "lessc --clean-css build/client/main.less static/styles/main.min.css", - "jars": "yarn jar:jdom; yarn jar:less; yarn jar:rome", - "jar:jdom": "(cd lib; curl -LO https://repo1.maven.org/maven2/jdom/jdom/1.0/jdom-1.0.jar)", - "jar:less": "(cd lib; curl -LO https://repo1.maven.org/maven2/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar)", - "jar:rome": "(cd lib; curl -LO https://repo1.maven.org/maven2/rome/rome/1.0/rome-1.0.jar)" + "antclick": "tools/antclick.sh", + "build": "tools/build.sh", + "clean": "rm -rf build/work", + "export": "tools/export.sh", + "jars": "tools/jars.sh", + "package": "tools/package.sh" }, "repository": { "type": "git", diff --git a/tools/antclick.sh b/tools/antclick.sh new file mode 100755 index 00000000..3ae20e60 --- /dev/null +++ b/tools/antclick.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env sh + +. tools/init.sh + +helma_package=https://github.com/antville/helma/releases/download/v20200321/helma-20200329.tgz + +# Build dependencies +yarn build + +( + cd $export_dir + mkdir -p antclick + + echo Downloading Helma package… + + $curl $helma_package + + package_file=$(basename $helma_package) + + # FIXME: Remove when Helma package is released (and uncomment line 12) + #cp /home/tobi/Projects/helma/current/build/distributions/$package_file . + + echo Extracting Helma package… + + tar -xzf $package_file --strip-components=1 -C antclick + + cd antclick + + echo Removing unneeded files… + + rm -rf apps/* db/* docs extras + rm -rf apps/antville/docs apps/antville/tools + + echo Copying Antville application into Helma installation… + + cp -r $export_dir/antville apps/ + cp $export_dir/antville/tools/antclick/apps.properties . + + echo Downloading H2 database… + + mkdir -p lib/ext + cd lib/ext + + jar_path=com/h2database/h2/1.4.200/h2-1.4.200.jar + jar_file=$(basename $jar_path) + license_dir=../../licenses/$jar_file/META-INF + + $curl $jar_repo/$jar_path + mkdir -p $license_dir + curl -L# https://raw.githubusercontent.com/h2database/h2database/master/LICENSE.txt > $license_dir/LICENSE.txt + + cd - + rm -f db/antville.mv.db + + echo Initializing Antville schema in H2 database… + + java -cp lib/ext/h2-1.4.200.jar org.h2.tools.RunScript \ + -continueOnError \ + -script apps/antville/db/postgre.sql \ + -url jdbc:h2:./db/antville \ + -user antville \ + -password antville + + echo Generating .tbz package… + + cd .. + mkdir -p $dist_dir + + package_name=antclick-$npm_package_version + + tar -cjf $dist_dir/$package_name.tbz antclick + + echo Generating .zip package… + + zip -lqr $dist_dir/$package_name.zip antclick +) diff --git a/build/extra/apps.properties b/tools/antclick/apps.properties similarity index 100% rename from build/extra/apps.properties rename to tools/antclick/apps.properties diff --git a/build/extra/server.properties b/tools/antclick/server.properties similarity index 100% rename from build/extra/server.properties rename to tools/antclick/server.properties diff --git a/tools/build.sh b/tools/build.sh new file mode 100755 index 00000000..6ed96a4e --- /dev/null +++ b/tools/build.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +. tools/init.sh + +# Build dependencies +yarn export +yarn jars + +( + cd $export_dir/antville + + echo Installing dependencies… + + yarn install + + echo Building client-side scripts… + + prefix=static/scripts/main.min + yarn browserify build/client/main.js -o $prefix.js -d -p [minifyify --map /$prefix.map.json --output $prefix.map.json] + yarn lessc --clean-css build/client/main.less static/styles/main.min.css + + prefix=static/scripts/editor.min + yarn browserify build/client/editor.js -o $prefix.js -d -p [minifyify --map /$prefix.map.json --output $prefix.map.json] + yarn lessc --clean-css build/client/editor.less static/styles/editor.min.css + + echo Copying statcic files… + + cp -Rp ./node_modules/uikit/dist/fonts static/ + + echo Generate license file… + + # FIXME: Add output of this command to somewhere… + yarn licenses generate-disclaimer > /dev/null + + echo Removing unneeded dependencies… + + find node_modules/* -maxdepth 0 -not \( -path */string-strip-html -o -path */marked \) -print0 | xargs -0 rm -rf + rm -rf node_modules/.[^.]* +) diff --git a/tools/export.sh b/tools/export.sh new file mode 100755 index 00000000..f4ce51c1 --- /dev/null +++ b/tools/export.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env sh + +. tools/init.sh + +rm -rf $source_dir +mkdir -p $source_dir + +( + echo Cloning repository… + + cd $source_dir + git clone $antville_repo antville + + export_dir=$export_dir/antville + + echo Exporting application… + + cd antville + git checkout develop + git checkout-index -f -a --prefix=$export_dir/ + + hash=$(git rev-parse --short HEAD) + + cd $export_dir + root_js_file=code/Root/Root.js + + sed -i "s|0|$npm_package_version|g" $root_js_file + sed -i "s|0|$hash|g" $root_js_file + sed -i "s||$(date +"%b %d, %Y")|g" $root_js_file + + echo Removing unneeded files… + + #rm -rf .git* build.xml build docs i18n/*.po* +) diff --git a/tools/init.sh b/tools/init.sh new file mode 100644 index 00000000..4c4aa73c --- /dev/null +++ b/tools/init.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +base_dir=$(pwd) +build_dir=$base_dir/build +work_dir=$build_dir/work + +dist_dir=$work_dir/dist +export_dir=$work_dir/export +source_dir=$work_dir/src + +jar_repo=https://repo1.maven.org/maven2 +antville_repo=https://github.com/antville/antville.git +#antville_repo=/home/tobi/Projects/antville/current + +curl="curl -LO#" diff --git a/tools/jars.sh b/tools/jars.sh new file mode 100755 index 00000000..de80e350 --- /dev/null +++ b/tools/jars.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env sh + +. tools/init.sh + +jar_dir=$export_dir/antville/lib +license_dir=$export_dir/antville/licenses + +echo $license_dir + +( + mkdir -p $jar_dir + mkdir -p $license_dir + + cd $jar_dir + + echo Downloading jdom.jar… + + jar_path=jdom/jdom/1.0/jdom-1.0.jar + jar_file=$(basename $jar_path) + + $curl $jar_repo/$jar_path + unzip -lp $jar_file META-INF/LICENSE.txt > $license_dir/jdom.txt + + echo Downloading lesscss.jar + + jar_path=org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar + jar_file=$(basename $jar_path) + + $curl $jar_repo/$jar_path + unzip -lp $jar_file META-INF/LICENSE.txt > $license_dir/lesscss.txt + + echo Downloading rome.jar… + + $curl $jar_repo/rome/rome/1.0/rome-1.0.jar + curl -L# https://raw.githubusercontent.com/rometools/rome/master/LICENSE > $license_dir/rome.txt +) diff --git a/tools/package.sh b/tools/package.sh new file mode 100755 index 00000000..ac76c2d9 --- /dev/null +++ b/tools/package.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env sh + +. tools/init.sh + +# Build dependencies +yarn build + +package_name=antville-$npm_package_version + +mkdir -p $dist_dir + +echo Generating .tbz package… + +cd $export_dir +tar -cjf $dist_dir/$package_name.tbz antville + +echo Generating .zip package… + +zip -lqr $dist_dir/$package_name.zip antville