Giter Club home page Giter Club logo

tiddlywiki's Introduction

tiddlywiki

TiddlyWiki 5 Docker image.

Google Cloud users may also be interested in https://github.com/neechbear/tiddlywiki-gce.

Supported Tags

  • 5.2.0, 5.2.0-node17.0-alpine3.13
  • 5.1.23, 5.1.23-node14.18.1-alpine3.14
  • 5.1.22, 5.1.22-node14.9.0-alpine3.12

Requirements

  1. Install Docker. See https://docs.docker.com/install/ for help. For lazy and non-security minded Linux users, simply run the following command: curl -fsSL get.docker.com | sudo bash

  2. If you want to automatically start TiddlyWiki on boot, you will need to be running a recent Linux distribution that uses systemd. (Ubuntu 12 or older, for example, do not support systemd by default).

Manual Execution

$ docker run -p 8080:8080 --name mywiki nicolaw/tiddlywiki

Open your browser to http://localhost:8080 to access the TiddlyWiki.

Alternatively the following will instruct Docker to keep your TiddlyWiki container running at all times untill explicitly stopped with a docker stop or docker kill command:

$ mkdir ~/tiddlywiki
$ docker run \
    -p 8080:8080 -d --restart unless-stopped --name mywiki \
    -v ~/tiddlywiki:/var/lib/tiddlywiki \
    nicolaw/tiddlywiki

Systemd Service

A systemd service unit file is included in the source repository of this project. (See https://github.com/neechbear/tiddlywiki ). This can be installed to automatically start one or more TiddlyWikis every time your machine boots.

It also provides you with some level of configurability by simply changing the contents of the /etc/tiddlywiki/mywiki.service.conf configuration file.

$ sudo mkdir /etc/tiddlywiki/
$ sudo cp tiddlywiki.service /etc/systemd/system/mywiki.service
$ sudo cp tiddlywiki.service.conf /etc/tiddlywiki/mywiki.service.conf
$ sudo systemctl daemon-reload
$ sudo systemctl start mywiki.service

Check the status of the TiddlyWiki service, or watch the logs using the following commands:

$ sudo systemctl status mywiki.service
$ sudo journalctl -f -u mywiki.service

Tiddler Data Storage

The container stores the Tiddler data in /var/lib/tiddlywiki. This will automatically be saved inside an anonymous Docker volume.

Specifying a volume bind mount location for /var/lib/tiddlywiki will cause the Tiddler data to be written to that location on your local filesystem.

$ docker run --rm -p 8080:8080 -v ~/wikidata:/var/lib/tiddlyiki --name mywiki nicolaw/tiddlywiki

In the case of operating TiddlyWiki from systemd, the Docker volume has the same name as the systemd service name (mywiki.service by default). Use docker volume inspect mywiki.service see where your data is being stored on disk in the event that you wish to perform a backup.

Alternatively, to specify a bind mount location, uncomment and modify the TW_DOCKERVOLUME line, and optionally the TW_DOCKERUID and TW_DOCKERGID lines in the /etc/tiddlywiki/mywiki.service.conf configuration file.

You will need to restart the service once you have saved your file change.

$ sudo vi /etc/tiddlywiki/mywiki.service.conf
$ sudo systemctl restart mywiki.service

Authentication

By default, the username is set to anonymous with no password.

Specify the TW_USERNAME and TW_PASSWORD environment variables to enable password authentication.

$ docker run -p 8080:8080 -e "TW_USERNAME=$USER" -e "TW_PASSWORD=hunter2" --name mywiki nicolaw/tiddlywiki

Similarly if you are using systemd to start your TiddlyWiki, uncomment and modify the TW_USERNAME and TW_PASSWORD lines from the /etc/tiddlywiki/mywiki.service.conf file.

You will need to restart the service once you have saved your file change.

$ sudo vi /etc/tiddlywiki/mywiki.service.conf
$ sudo systemctl restart mywiki.service

Configurable Variables

Refer to the canonical online documentation for help for additional help.

TW_WIKINAME=mywiki
TW_USERNAME=janedoe
TW_PASSWORD=
TW_PORT=8080
TW_ROOTTIDDLER=$:/core/save/all
TW_RENDERTYPE=text/plain
TW_SERVETYPE=text/html
TW_HOST=0.0.0.0
TW_PATHPREFIX=

You can alter how the NodeJS tiddlywiki server will operate by changing these two variables.

If you are operating in a low memory environment (inside a small AWS, GCE or other cloud virtual machine for example), you may wish to set NODE_MEM to specify the maximum memory can NodeJS may use (specified in MB).

NODE_MEM=400
NODE_OPTIONS=

The following variables only affect the operation while using the system service unit to start TiddlyWiki. They do nothing if you are running the Docker container independently of systemd.

TW_DOCKERVOLUME=/home/janedoe/tiddlywiki
TW_DOCKERUID=0
TW_DOCKERGID=0

Docker Compose

More experienced users may wish to use docker-compose to dynamically build a customised container image using the Git source repostiory as the build context. This allows control over the following Dockerfile build arguments:

  • TW_VERSION - The upstream version of TiddlyWiki to install from NPM (https://www.npmjs.com/package/tiddlywiki)

  • BASE_IMAGE - The Docker base container image to inherit from (should contain the node interpreter)

  • USER - Unix user or UID to run the TiddlyWiki process as (useful if your container runtime environment does not allow you to override)

The Makefile in the https://github.com/neechbear/tiddlywiki.git also makes use of these build arguments in a similar way.

Example Docker compose definition:

tiddlywiki:
   container_name: tiddlywiki
   image: nicolaw/tiddlywiki
   build:
     context: https://github.com/neechbear/tiddlywiki.git
     args:
       TW_VERSION: 5.1.23
       USER: 501
       BASE_IMAGE: 14-alpine3.12

Author

Nicola Worthington [email protected], https://nicolaw.uk, https://nicolaw.uk/#TiddlyWiki.

License

MIT License

Copyright (c) 2018-2021 Nicola Worthington

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

tiddlywiki's People

Contributors

anjomro avatar neechbear avatar pathetic-lynx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tiddlywiki's Issues

systemd version does not auto start

The systemd config is incomplete. It correctly starts the service in current session, but does not auto start on reboot. In order to set a service to auto start, it must be enabled. But upon trying to use the following command

sudo systemctl enable mywiki.service

it reports that the service unit file is missing the [Install] section.

Please review the config.

Port 8080

Why does the Dockerfile explicitly expose port 8080?
Isn't declaring a port with docker run -p sufficient?

[Idea] Support for pre-installing plugins

Hi there,

First of all thank you for this Dockerized TiddlyWiki, it is really useful!

Secondly, I have a feature request: it would be nice if this Dockerized solution supported the pre-installation of specific TiddlyWiki plugins. I'm not exactly sure about how to automate downloading them, how they are identified and versioned, but it would make this project even more useful.

For context and some inspiration, to automate the installation of TiddlyMap I created a very similar project, which is heavily based on yours. And actually after finishing that I realized it would be much better if your project supported this use-case out of the box.

To accomplish it, I had to do 2 things:

The step of downloading said plugins could be in the same init-and-run script, but we definitely need to copy them to their right destination after the wiki instance has been initialized.

I think the end goal should be to support the pre-installation of specific plugins via providing a simple text file of them, very similar to how the Dockerized Jenkins does it. We could achieve something similar by extending init-and-run.

What do you think?

Support for ARM and other platforms

Hi folks,

Could I ask for ARM and other architecture support? The base Node image it relies on supports all kinds of architectures and personally I would like to run this on ARM64.

Please share your thoughts!

docker-compose example is a little bit confusing

Hi there,
i am sure there is reason behind it, but i could not start via the docker-compose example.

https://github.com/neechbear/tiddlywiki#docker-compose

There is a part missing of the compose file, a random port declared i dont know the purpose of and the volume deceleration is missing.

a more helpful example would be

version: "3.9"
services:
  tiddlywiki:
    container_name: tiddlywiki
    image: nicolaw/tiddlywiki
    volumes:
      - tiddlywiki:/home/diab/tiddlywiki_data_safe
    ports:
      - "8080:8080"
volumes:
  tiddlywiki: null

Update to 5.1.23

Hello,

Would it be possible to merge the pull request to update the version in this container to 5.1.23?

Thank you!

spelling mistake

$ docker run --rm -p 8080:8080 -v ~/wikidata:/var/lib/tiddlyiki --name mywiki nicolaw/tiddlywiki

This:

-v ~/wikidata:/var/lib/tiddlyiki

Should be:

-v ~/wikidata:/var/lib/tiddlywiki

Using TW_PATHPREFIX causes errors

Hi, thanks for putting this together, it has been very helpful.

I wanted to configure the path that tiddlywiki would be available at. It does appear at that path, but tiddlywiki itself is broken. The following minimal example demonstrates the issue.

docker run -p 8080:8080 -e TW_PATHPREFIX=/wiki nicolaw/tiddlywiki 

The UI shows the following errors
image

I did see this in the documentation:
https://tiddlywiki.com/static/Using%2520a%2520custom%2520path%2520prefix%2520with%2520the%2520client-server%2520edition.html

Perhaps a comment to mention that additional changes are needed or perhaps something in init-and-run that automatically sets up path prefix would be great.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.