• Stars
    star
    176
  • Rank 216,987 (Top 5 %)
  • Language
    Nim
  • License
    MIT License
  • Created over 6 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Nim fullstack website framework - deploy a website within minutes

Nim Website Creator

A quick website tool. Run the nim file and access your webpage. Website: https://nimwc.org

Features

  • Blog with custom meta-information and URL's
  • Security - 2FA, Firejail, reCAPTCHA
  • Fully customizable - log viewer, custom JS & CSS
  • Plugins with many features

See more in FEATURES.md

Requirements

To get started you only need:

  • Nim >= 1.0.0 (tested with 1.4.8)

Optional dependencies (disabled by default):

  • webp (libwebp) (only required when using WebP)
  • firejail >= 0.9.58 (only required when using Firejail)
  • Xvfb (xorg-server-xvfb, required by firejail setting noX=)
  • When using Firejail and enabling/disabling a plugin a manual full restart of NimWC is required. It is therefore not advised to enable/disable plugins in the browser when using Firejail.

Install

Install Nim

To compile and install you need Nim. You can easily install Nim using choosenim with:

curl https://nim-lang.org/choosenim/init.sh -sSf | sh

Install NimWC

You only need to perform 1a or 1b or 1c - not both of them.

1a) Install with Nimble

If you are using [Nimble](https://github.com/nim-lang/nimble) an executable will be generated and symlinked to `nimwc`, which then can be executed anywhere on your system.
# Install nimwc with nimble
nimble install nimwc

# Edit the config.cfg accordingly
# (change the confg.cfg path to your nimble folder and the correct package version)
nano ~/.nimble/pkgs/nimwc-[PACKAGE-VERSION]/config/config.cfg

# Run nimwc
# (to add an Admin append the arg "newadmin": nimwc --newadmin)
# (to include some standard pages: nimwc --insertdata)
nimwc

# Login
127.0.0.1:7000/login

1b) Compile

This will generate the executable in the folder.

# Clone the repository
git clone https://github.com/ThomasTJdev/nim_websitecreator
cd nim_websitecreator

# Generate and edit the config.cfg accordingly
cp config/config_default.cfg config/config.cfg
nano config/config.cfg

# Compile
nimble -d:release build

# Run nimwc
# (to add an Admin append the arg "newadmin": nimwc --newadmin)
# (to include some standard pages: nimwc --insertdata)
./nimwc

# Login
127.0.0.1:7000/login

1c) Curl

This will guide you through the installation.

curl https://raw.githubusercontent.com/ThomasTJdev/nim_websitecreator/master/devops/autoinstall.sh -sSf | sh
# OR
curl https://raw.githubusercontent.com/ThomasTJdev/nim_websitecreator/master/devops/autoinstall.sh -sSfLO && echo "6cc7510305db7b0ae5e3755137e71c23c7e08829264ddfb82702e6cac297f1063b46c48c01eafb16156c27a53aa23d1737c34f354ae1834c8498f5bd64b81b3c autoinstall.sh" | sha512sum -c - && sh ./autoinstall.sh

Use

Arguments

These arguments should be prepended to executable file, e.g. ./nimwc cdata

  • --showconfig = Show parsed INI configuration and compile options.
  • --newadmin = Add the Admin user.
  • --gitupdate = Updates and force a hard reset.
  • --initplugin = Create plugin skeleton inside tmp/.
  • --vacuumdb = Vacuum database and continue (database maintenance).
  • --backupdb = Compressed full backup of database.
  • --backupdb-gpg = Compressed signed full backup of database.
  • --newdb = Generates the database with standard tables (does not override or delete tables). newdb will be initialized automatic, if no database exists.
  • --insertdata = Insert standard data, e.g --insertdata bulma (this will override existing data)
    • bulma = Use Bulma CSS, No JS required (official design) [Default official theme]
    • bootstrap = Use Bootstrap and jQuery
    • water = Water CSS framework, No JS, HTML Classless (No classes on HTML required)

Compile options:

These options are only available at compiletime:

  • -d:rc = Recompile. NimWC is using a launcher, it is therefore needed to force a recompile.
  • -d:adminnotify = Send error logs (ERROR) to the specified admin email.
  • -d:dev = Development.
  • -d:devemailon = Send email when -d:dev is activated.
  • -d:demo = Used on public test site Nim Website Creator. This option will override the database every 1 hour with the standard data.
  • -d:gitupdate = Updates directly from Git and force a hard reset.
  • -d:postgres = Use Postgres database instead of SQLite.
  • -d:packedjson = Use PackedJSON instead of std lib JSON. Performance optimization.

User profiles

There are 3 main user profiles:

  • User
  • Moderator
  • Admin

The access rights below applies to main program. Plugins can have their own definition of user rights.

User

The "User" can login and see private pages and blog pages. This user has no access to adding or editing anything.

Moderator

The "Moderator" can login and see private pages and blog pages. The user can add and delete users, but cannot delete or add "Admin" users. The user cannot edit JS, CSS and core HTML - only within the pages and blogposts.

Admin

The "Admin" has access to anything.

Blog

You can easily add and edit blogpages. The blogpages support metadata: meta description and meta keywords. It is also possible to specify a category and tags.

Blog sorting

In the settings menu you can specify how your blogposts should be sorted, e.g. on modfied date in ascending order.

Blog searching

To only show blogpost with a specific name, tag or category, you have to append the criteria to the URL. It is not possible to combine these.

website.com/blog?name=nim
website.com/blog?category=article
website.com/blog?tags=code

Plugins

Multiple plugins are available. You can download them within the program at <webpage>/plugins/repo.

The plugin repository are located here: NimWC plugin repository

Shortcuts

When editing a blogpage or a normal page press Ctrl+S to save.

DevOps

Docker, Vagrant, SystemD Service, NGNIX, Admin stuff, etc

Docker

  • Use the Dockerfile as starting point for your NimWC containers.
  • You can run the build_docker.sh and run_docker.sh scripts without changing anything to try out nimwc.

Vagrant

NGNIX Config

Google reCAPTCHA

To activate Google reCAPTCHA claim you site and server key and insert them into config.cfg.

SystemD

Copy the file nimwc.service into /lib/systemd/system/

sudo nano /lib/systemd/system/nimwc.service

Enable auto start of NimWC:

sudo systemctl enable nimwc
sudo systemctl start nimwc
sudo systemctl status nimwc

CI Builds

CrossCompiling, Build for old Linux

Sometimes you may need Build for very very old Linux, like old Centos and Debian Old Stable, from a recent Linux, like new Arch or Ubuntu, heres how you can do it, without a virtual machine with an old Linux to build.

How to Firejail

Optional dependency.

  • Default settings will work Ok on most systems, sane defaults.
  • Some settings are kind of technical, you should know some Linux Kernel related stuff.
  • Links are provided on the Firejail config page when makes sense.
  • You can harden your system even more by tweaking the Firejail config.
  • You can always come back to the default settings and it will work Ok.
  • Check that Firejail Status at bottom of the page is mostly green.

You can choose how much CPU & RAM NimWC can use, Firejail will make NimWC believe that theres less CPU & RAM that the actually physically available. If you choose too small resources for too big load, then it will feel like when you try to run a heavy program on a VirtualBox with too small CPU & RAM, but will still run, or do the best to try to run. This can be useful for Clouds that charge you extra when you pass certain threshold of CPU & RAM usage.

NimWC does not depend on any Hardware device to run, like audio, video, USB, DVD, etc, so you can block the access to the hardware peripehals, that also blocks its hardware drivers and libraries that may have vulnerabilities, making your NimWC more secure.

There are options to block root user and the rest of the users on the Linux system, thats help protect your NimWC against Privilege Scalations, thats when an unprivileged normal user becomes superuser root, or an user can see other users stuff.

Caches and Temporary directories are mounted as private temporary unique autogenerated TMPFS, meaning that the real ones can not be altered from within NimWC.

noMnt=true is for when you run 1 instance NimWC per server, noMnt=false is for when you run multiple instances NimWC per server, because it may or may not block other instances of accesing subfolders on /mnt/ simultaneously.

noX=false if you are running a headless server or ChromeBook. noX=true uses Xvfb for X Isolation (xorg-server-xvfb), you may need to install it if you want to use it, but is not a hard dependency, just use noX=false and you dont need to install it if you dont want to.

The features come from the Linux Kernel itself, so theres zero cost on performance and the technology is already there even if you use it or not.

So in conclusion NimWC being compiled binary wont need access to most of your system, just its own folder, the integration with Firejails hides everything else.

Install

You local version of firejail to needs be >= 0.9.58. Install using your package manager:

# Arch (package manager)
sudo pacman -S firejail

# Ubuntu (built files)
https://launchpad.net/ubuntu/+source/firejail/0.9.58-1 # <-- download
sudo apt install ./firejail_0.9.58-1_arm64.deb

# Compile
git clone https://github.com/netblue30/firejail.git
cd firejail
./configure && make && sudo make install-strip

Resources

Videos

Stars

Stars over time

License

NimWC uses The Peer Production License (PPL).

PPL is derived from the Creative Commons Attribution-NonCommercial-ShareAlike license. However unlike CC-BY-NC-SA, PPL demands reciprocation (whether monetary or otherwise) from non-contributing commercial entities (aka Big Corporations). This means, that mega-corporation cannot just take all your code, rename it, and sell it without contributing back to you.

The Peer Production License is a reciprocity-based license by which commons are freely accessible to those who contribute to create them, while third party non-contributing entities profiting from these commons can be charged a license fee to sustain the project in the long run.

For all other meanings of license, is very similar to MIT license.

More Repositories

1

WMD

Python framework for IT security tools
Python
262
star
2

python_gdork_sqli

This python script is developed to show, how many vulnerables websites, which are laying around on the web. 1) Scan net for urls prone to SQL injection 2) Check if urls is vulnerable 3) Exploit with sqlmap
Python
54
star
3

nim_wiringPiNim

Nim-lang wrapper for wiringPi for controlling a Raspberry Pi
Nim
36
star
4

nim_homeassistant

Nim Home Assistant (NimHA) is a hub for combining multiple home automation devices and automating jobs.
Nim
35
star
5

nim_qr

QR-code package for Nim
C
21
star
6

nimtomd

Convert a Nim file to Markdown
Nim
15
star
7

nim_nimble_gui

A simple GUI front for Nimble
Nim
11
star
8

nim_awsS3

Amazon Simple Storage Service (AWS S3) basic API support
Nim
11
star
9

nim_sqlbuilder

SQL builder for Nim queries
Nim
10
star
10

mummy_utils

Utility package for mummy multithreaded server
Nim
8
star
11

KanboardSubtasksBoard

Kanboard plugin - Show subtasks on main board without hovering over subtask-icon
PHP
8
star
12

nim_slacklib

Nim-lang library for working with a slack app or sending messages to a slack channel
Nim
7
star
13

KanboardColorfulTags

Kanboard plugin - Add colors to tags like labels in the Gitlab Issue Board.
7
star
14

nim_webframework

Framework for creating websites with Nim
Nim
6
star
15

choosenim_gui

GUI for choosenim
Nim
6
star
16

python_scapy_sniff_http

Python script sniffing HTTP traffic and finding PWD's, cookies, etc.
Python
6
star
17

nimwc_plugins

Plugin repository for Nim Website Creator
Nim
5
star
18

nim_nordnet_api

Scraping API for www.nordnet.dk ready to integrate with Home Assistant (Hassio)
Nim
4
star
19

flask_system_information

on flask application for monitoring system information. Network connections, uptime, logins, processes, etc.
Python
4
star
20

nim_sermon

The health of your system and more
Nim
4
star
21

nim_tutorials

Nim
4
star
22

nimics

ICS-file generator. Create an invite.ics file and attach it to a mail.
Nim
4
star
23

nim_xiaomi

Nim package for working with Xiaomi devices
Nim
4
star
24

AllBoardView

Kanboard plugin - Viewing all boards at the same time (using Webix)
CSS
3
star
25

nim_awsSTS

AWS Security Token Service API in Nim
Nim
3
star
26

nim_eloverblik_api

API for www.eloverblik.dk - samling af energiforbrug
Nim
3
star
27

asus_graph_c3js

Flask script for monitoring ASUS routers logs. Parse ASUS router network logs to HTML format and visualize the data with C3js.
Python
3
star
28

KanboardStatusColor

Kanboard plugin - Change the status color from left border to icon
3
star
29

jester2swagger

Convert Jester to Swagger to Postman
Nim
3
star
30

katana_sniffhttp

KatanaFramework module - Sniff HTTP traffic for usernames and passwords.
Python
3
star
31

nmqttgui

A GUI for nmqtt
Nim
2
star
32

nim_onedrive

Nim library to get information on files and folders in OneDrive
Nim
2
star
33

python_console_bettercap

Python front for Bettercap. No code conversion, only a front/console.
Python
2
star
34

nimwc_basket

NimWC plugin to enable an ecommerce webshop, where user can buy products and get a receipt.
Nim
2
star
35

nim_awsSigV4

Nim
2
star
36

nim_openai

API for openAI
Nim
2
star
37

nimwc_newsletter

NimWC plugin to enable a newsletter/mailing list
Nim
2
star
38

nim_alarmsystem

Raspberry Pi alarm system with a main controller and a slave programmed in Nim
Nim
2
star
39

nimwc_backup

Nim Website Creator (NimWC) plugin to enable backup of database
Nim
1
star
40

nimwc_themes

Nim Website Creator (NimWC) plugin to enable a themes (different stylesheets)
CSS
1
star
41

nim_socket

Socket server and client in Nim-lang
Nim
1
star
42

nimwc_templates

Nim Website Creator (NimWC) plugin to enable a templates
CSS
1
star
43

nimwc_openregistration

Nim Website Creator plugin to enable public registration of new users
Nim
1
star
44

ncompile

GUI compiler for Nim
HTML
1
star
45

katana_findsqlinj

KatanaFramework module - Find websites vuln for SQL injection.
Python
1
star
46

AllBoardViewHTML

This plugin adds a view for viewing all boards at the same time.
PHP
1
star