mirror of
https://github.com/m0wer/tiddlywiki-docker.git
synced 2026-01-23 02:24:25 +00:00
Compare commits
24 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1189048d9 | ||
|
|
7e13280efb | ||
|
|
3c862c8e89 | ||
|
|
00c8f052e5 | ||
|
|
24c06f6080 | ||
|
|
fa5c8bcb20 | ||
|
|
a8dcc9ea79 | ||
|
|
3694397677 | ||
|
|
1c741f590e | ||
|
|
fafc396148 | ||
|
|
66a77d3d60 | ||
|
|
93b30fcea0 | ||
|
|
2652f4e6fa | ||
|
|
42324d0fe6 | ||
|
|
24beb3bc3d | ||
|
|
2a342a1cfb | ||
|
|
fbfdfdbd3d | ||
|
|
5687667a91 | ||
|
|
a378b10a57 | ||
|
|
2c0ab91984 | ||
|
|
daaa7c5f4e | ||
|
|
f7bbe5cc1c | ||
|
|
8ca707e750 | ||
|
|
c71a3fcd89 |
4 changed files with 91 additions and 23 deletions
37
.github/workflows/docker.yml
vendored
37
.github/workflows/docker.yml
vendored
|
|
@ -1,30 +1,37 @@
|
|||
---
|
||||
name: docker
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 3 5 * *' # every friday at 3am
|
||||
- cron: 0 3 5 * * # every friday at 3am
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags:
|
||||
- '*.*.*'
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- master
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Set up dynamic build ARGs
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Set up dynamic build ARGs
|
||||
id: getargs
|
||||
run: echo "::set-output name=version::$(cat ./stable/VERSION)"
|
||||
-
|
||||
name: Docker meta
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
|
|
@ -41,18 +48,18 @@ jobs:
|
|||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
-
|
||||
name: Login to DockerHub
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
platforms: linux/amd64
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
FROM node:alpine
|
||||
|
||||
RUN npm install -g tiddlywiki@5.2.0
|
||||
RUN npm install -g tiddlywiki@5.2.7
|
||||
|
||||
# Setup wiki volume
|
||||
VOLUME /var/lib/tiddlywiki
|
||||
|
|
@ -10,5 +10,5 @@ WORKDIR /var/lib/tiddlywiki
|
|||
ADD init-and-run-wiki /usr/local/bin/init-and-run-wiki
|
||||
|
||||
# Meta
|
||||
ENTRYPOINT ["/bin/sh"]
|
||||
CMD ["/usr/local/bin/init-and-run-wiki"]
|
||||
EXPOSE 8080
|
||||
|
|
|
|||
56
README.md
56
README.md
|
|
@ -12,7 +12,7 @@ Hub](https://hub.docker.com/r/m0wer/tiddlywiki).
|
|||
|
||||
Image Name | Tag | TiddyWiki Version
|
||||
-----------------|------------|------------------
|
||||
m0wer/tiddlywiki | latest | 5.2.0
|
||||
m0wer/tiddlywiki | latest | 5.2.7
|
||||
m0wer/tiddlywiki | v[X] | [X]
|
||||
m0wer/tiddlywiki | test | ?
|
||||
|
||||
|
|
@ -42,10 +42,8 @@ In this example, the folder `$(pwd)/.tiddlywiki` is used for the data.
|
|||
|
||||
## Authentication
|
||||
|
||||
Default credentials are `user`:`wiki`.
|
||||
|
||||
Simply provide the `USERNAME` and `PASSWORD` environment variables to
|
||||
customize.
|
||||
Authentication is disabled by default. To enable it, simply provide the
|
||||
`USERNAME` and `PASSWORD` environment variables.
|
||||
|
||||
## Other settings
|
||||
|
||||
|
|
@ -58,3 +56,51 @@ If you are in a memory-constrained environment, you can provide the
|
|||
|
||||
Set the `DEBUG_LEVEL` environment variable to `debug`. For example by passing
|
||||
`-e DEBUG_LEVEL=debug` option in `docker run`.
|
||||
|
||||
### Path prefix
|
||||
|
||||
Set the `PATH_PREFIX` environment variable to customize the path prefix for
|
||||
serving TiddlyWiki. For example by passing `-e PATH_PREFIX=\wiki` option in
|
||||
`docker run`. According to this [note][path-prefix-note], please remember to
|
||||
configure the client as well.
|
||||
|
||||
[path-prefix-note]: https://tiddlywiki.com/static/Using%2520a%2520custom%2520path%2520prefix%2520with%2520the%2520client-server%2520edition.html
|
||||
|
||||
## Docker Compose
|
||||
|
||||
To keep all the docker settings, environment variables and volume data in a folder you can use `docker compose`.
|
||||
|
||||
Create a folder for the project:
|
||||
|
||||
```
|
||||
mkdir my-tiddlywiki-docker
|
||||
cd my-tiddlywiki-docker
|
||||
```
|
||||
|
||||
Create a folder for the data:
|
||||
|
||||
```
|
||||
mkdir tiddlywiki
|
||||
```
|
||||
|
||||
Create `docker-compose.yml` with the following contents:
|
||||
|
||||
```
|
||||
version: '3'
|
||||
services:
|
||||
tiddlywiki:
|
||||
image: m0wer/tiddlywiki
|
||||
volumes:
|
||||
- ./tiddlywiki:/var/lib/tiddlywiki
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 8080:8080
|
||||
#environment:
|
||||
# - DEBUG_LEVEL=debug
|
||||
# - PATH_PREFIX=\wiki
|
||||
# - NODE_MEM=128
|
||||
# - USERNAME=test
|
||||
# - PASSWORD=test
|
||||
```
|
||||
|
||||
Then run `docker compose up -d`.
|
||||
|
|
|
|||
17
init-and-run-wiki
Executable file → Normal file
17
init-and-run-wiki
Executable file → Normal file
|
|
@ -16,7 +16,22 @@ if [ ! -d /var/lib/tiddlywiki/mywiki ]; then
|
|||
mkdir /var/lib/tiddlywiki/mywiki/tiddlers
|
||||
fi
|
||||
|
||||
# Define plugins, see https://tiddlywiki.com/static/Using%2520TiddlyWiki%2520on%2520Node.js.html
|
||||
if [ -n "$PLUGINS" ]; then
|
||||
plugins_params="$PLUGINS"
|
||||
fi
|
||||
|
||||
# Configure listen command, see https://tiddlywiki.com/static/ListenCommand.html
|
||||
listen_params="host=0.0.0.0 port=8080"
|
||||
listen_params="$listen_params debug-level=${DEBUG_LEVEL-none}"
|
||||
if [ -n "$PATH_PREFIX" ]; then
|
||||
listen_params="$listen_params path-prefix=$PATH_PREFIX"
|
||||
fi
|
||||
if [ -n "$USERNAME" ]; then
|
||||
listen_params="$listen_params username=$USERNAME"
|
||||
listen_params="$listen_params password=${PASSWORD-wiki}"
|
||||
fi
|
||||
|
||||
# Start the tiddlywiki server
|
||||
|
||||
exec /usr/bin/env node $NODEJS_V8_ARGS $tiddlywiki_script mywiki --listen host=0.0.0.0 port=8080 username="${USERNAME:-user}" password="${PASSWORD-wiki}" debug-level=${DEBUG_LEVEL-none}
|
||||
exec /usr/bin/env node $NODEJS_V8_ARGS $tiddlywiki_script $plugins_params mywiki --listen $listen_params $EXTRAOPTIONS
|
||||
Loading…
Add table
Add a link
Reference in a new issue