diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
deleted file mode 100644
index fde1b09..0000000
--- a/.github/workflows/main.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-# This is a basic workflow to help you get started with Actions
-
-name: CI
-
-# Controls when the action will run.
-on:
- # Triggers the workflow on push or pull request events but only for the master branch
- push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
-
- # Allows you to run this workflow manually from the Actions tab
- workflow_dispatch:
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
- test_stable:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- firefox: [ '73.0' ]
- include:
- - nim-version: 'stable'
- cache-key: 'stable'
- steps:
- - uses: actions/checkout@v2
- - name: Checkout submodules
- run: git submodule update --init --recursive
-
- - name: Setup firefox
- uses: browser-actions/setup-firefox@latest
- with:
- firefox-version: ${{ matrix.firefox }}
-
- - name: Get Date
- id: get-date
- run: echo "::set-output name=date::$(date "+%Y-%m-%d")"
- shell: bash
-
- - name: Cache choosenim
- uses: actions/cache@v2
- with:
- path: ~/.choosenim
- key: ${{ runner.os }}-choosenim-${{ matrix.cache-key }}
-
- - name: Cache nimble
- uses: actions/cache@v2
- with:
- path: ~/.nimble
- key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
-
- - uses: jiro4989/setup-nim-action@v1
- with:
- nim-version: "${{ matrix.nim-version }}"
-
- - name: Install geckodriver
- run: |
- sudo apt-get -qq update
- sudo apt-get install autoconf libtool libsass-dev
-
- wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz
- mkdir geckodriver
- tar -xzf geckodriver-v0.29.1-linux64.tar.gz -C geckodriver
- export PATH=$PATH:$PWD/geckodriver
-
- - name: Install choosenim
- run: |
- export CHOOSENIM_CHOOSE_VERSION="stable"
- curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
- sh init.sh -y
- export PATH=$HOME/.nimble/bin:$PATH
- nimble refresh -y
-
- - name: Run tests
- run: |
- export MOZ_HEADLESS=1
- nimble -y install
- nimble -y test
-
diff --git a/.gitignore b/.gitignore
index fe26a8a..55c0cb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,10 +14,3 @@ createdb
editdb
.vscode
-forum.json*
-browsertester
-setup_nimforum
-buildcss
-nimforum.css
-
-/src/frontend/forum.js
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..b5c6c9b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,45 @@
+os:
+ - linux
+
+language: c
+
+cache:
+ directories:
+ - "$HOME/.nimble"
+ - "$HOME/.choosenim"
+
+addons:
+ firefox: "73.0"
+
+before_install:
+ - sudo apt-get -qq update
+ - sudo apt-get install autoconf libtool
+ - git clone -b 3.5.4 https://github.com/sass/libsass.git
+ - cd libsass
+ - autoreconf --force --install
+ - |
+ ./configure \
+ --disable-tests \
+ --disable-static \
+ --enable-shared \
+ --prefix=/usr
+ - sudo make -j5 install
+ - cd ..
+
+ - wget https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
+ - mkdir geckodriver
+ - tar -xzf geckodriver-v0.26.0-linux64.tar.gz -C geckodriver
+ - export PATH=$PATH:$PWD/geckodriver
+
+install:
+ - export CHOOSENIM_CHOOSE_VERSION="stable"
+ - |
+ curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
+ sh init.sh -y
+ - export PATH=$HOME/.nimble/bin:$PATH
+ - nimble refresh -y
+
+script:
+ - export MOZ_HEADLESS=1
+ - nimble -y install
+ - nimble -y test
diff --git a/README.md b/README.md
index d7dedb4..05d4667 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ nimble frontend
nimble backend
```
+
Development typically involves running `nimble devdb` which sets up the
database for development and testing, then `nimble backend`
which compiles and runs the forum's backend, and `nimble frontend`
@@ -87,38 +88,6 @@ separately to build the frontend. When making changes to the frontend it
should be enough to simply run `nimble frontend` again to rebuild. This command
will also build the SASS ``nimforum.scss`` file in the `public/css` directory.
-### With docker
-
-You can easily launch site on localhost if you have `docker` and `docker-compose`.
-You don't have to setup dependencies (libsass, sglite, pcre, etc...) on you host PC.
-
-To get up and running:
-
-```bash
-cd docker
-docker-compose build
-docker-compose up
-```
-
-And you can access local NimForum site.
-Open http://localhost:5000 .
-
-# Troubleshooting
-
-You might have to run `nimble install karax@#5f21dcd`, if setup fails
-with:
-
-```
-andinus@circinus ~/projects/forks/nimforum> nimble --verbose devdb
-[...]
- Installing karax@#5f21dcd
- Tip: 24 messages have been suppressed, use --verbose to show them.
- Error: No binaries built, did you specify a valid binary name?
-[...]
- Error: Exception raised during nimble script execution
-```
-
-The hash needs to be replaced with the one specified in output.
# Copyright
diff --git a/docker/Dockerfile b/docker/Dockerfile
deleted file mode 100644
index cb3191a..0000000
--- a/docker/Dockerfile
+++ /dev/null
@@ -1,14 +0,0 @@
-FROM nimlang/nim:1.2.6-ubuntu
-
-RUN apt-get update -yqq \
- && apt-get install -y --no-install-recommends \
- libsass-dev \
- sqlite3 \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/*
-
-WORKDIR /app
-COPY . /app
-
-# install dependencies
-RUN nimble install -Y
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
deleted file mode 100644
index 8657235..0000000
--- a/docker/docker-compose.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-version: "3.7"
-
-services:
- forum:
- build:
- context: ../
- dockerfile: ./docker/Dockerfile
- volumes:
- - "../:/app"
- ports:
- - "5000:5000"
- entrypoint: "/app/docker/entrypoint.sh"
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
deleted file mode 100755
index d8f5923..0000000
--- a/docker/entrypoint.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-git submodule update --init --recursive
-
-# setup
-nimble c -d:release src/setup_nimforum.nim
-./src/setup_nimforum --dev
-
-# build frontend
-nimble c -r src/buildcss
-nimble js -d:release src/frontend/forum.nim
-mkdir -p public/js
-cp src/frontend/forum.js public/js/forum.js
-
-# build backend
-nimble c src/forum.nim
-./src/forum
diff --git a/nimforum.nimble b/nimforum.nimble
index 58a22f7..1b32ba2 100644
--- a/nimforum.nimble
+++ b/nimforum.nimble
@@ -1,5 +1,5 @@
# Package
-version = "2.1.0"
+version = "2.0.2"
author = "Dominik Picheta"
description = "The Nim forum"
license = "MIT"
@@ -13,15 +13,15 @@ skipExt = @["nim"]
# Dependencies
requires "nim >= 1.0.6"
-requires "jester#405be2e"
-requires "bcrypt#440c5676ff6"
+requires "jester#d8a03aa"
+requires "bcrypt#head"
requires "hmac#9c61ebe2fd134cf97"
requires "recaptcha#d06488e"
requires "sass#649e0701fa5c"
-requires "karax#5f21dcd"
+requires "karax#f6bda9a"
-requires "webdriver#429933a"
+requires "webdriver#c2fee57"
# Tasks
@@ -32,9 +32,6 @@ task backend, "Compiles and runs the forum backend":
task runbackend, "Runs the forum backend":
exec "./src/forum"
-task testbackend, "Runs the forum backend in test mode":
- exec "nimble c -r -d:skipRateLimitCheck src/forum.nim"
-
task frontend, "Builds the necessary JS frontend (with CSS)":
exec "nimble c -r src/buildcss"
exec "nimble js -d:release src/frontend/forum.nim"
diff --git a/public/css/nimforum.scss b/public/css/nimforum.scss
index 2daecdb..9842d8d 100644
--- a/public/css/nimforum.scss
+++ b/public/css/nimforum.scss
@@ -22,7 +22,6 @@ table th {
// Custom styles.
// - Navigation bar.
$navbar-height: 60px;
-$default-category-color: #a3a3a3;
$logo-height: $navbar-height - 20px;
.navbar-button {
@@ -51,7 +50,6 @@ $logo-height: $navbar-height - 20px;
// Unfortunately we must colour the controls in the navbar manually.
.search-input {
@extend .form-input;
- min-width: 120px;
border-color: $navbar-border-color-dark;
}
@@ -123,22 +121,6 @@ $logo-height: $navbar-height - 20px;
}
}
-.category-description {
- opacity: 0.6;
- font-size: small;
-}
-
-.category-status {
- font-size: small;
- font-weight: bold;
-
- .topic-count {
- margin-left: 5px;
- opacity: 0.7;
- font-size: small;
- }
-}
-
.category {
white-space: nowrap;
}
@@ -184,33 +166,6 @@ $logo-height: $navbar-height - 20px;
}
}
-.thread-list {
- @extend .container;
- @extend .grid-xl;
-}
-
-.category-list {
- @extend .thread-list;
-
-
- .category-title {
- @extend .thread-title;
- a, a:hover {
- color: lighten($body-font-color, 10%);
- text-decoration: none;
- }
- }
-
- .category-description {
- opacity: 0.6;
- }
-}
-
-#categories-list .category {
- border-left: 6px solid;
- border-left-color: $default-category-color;
-}
-
$super-popular-color: #f86713;
$popular-color: darken($super-popular-color, 25%);
$threads-meta-color: #545d70;
@@ -262,7 +217,7 @@ $threads-meta-color: #545d70;
.category-color {
width: 0;
height: 0;
- border: 0.25rem solid $default-category-color;
+ border: 0.3rem solid #98c766;
display: inline-block;
margin-right: 5px;
}
@@ -301,14 +256,6 @@ $threads-meta-color: #545d70;
}
}
-.thread-replies, .thread-time, .views-text, .popular-text, .centered-header {
- text-align: center;
-}
-
-.thread-users {
- text-align: left;
-}
-
.thread-time {
color: $threads-meta-color;
@@ -779,3 +726,8 @@ hr {
margin-top: $control-padding-y*2;
}
}
+
+// - Hide features that have not been implemented yet.
+#main-buttons > section.navbar-section:nth-child(1) {
+ display: none;
+}
\ No newline at end of file
diff --git a/public/karax.html b/public/karax.html
index 3f7f41b..31abb4f 100644
--- a/public/karax.html
+++ b/public/karax.html
@@ -15,6 +15,7 @@