Compare commits

...

24 commits

Author SHA1 Message Date
Florian Vahl
e1189048d9
Enabeling manual workflow dispatch 2023-04-16 20:50:40 +02:00
Florian Vahl
7e13280efb
Remove ARMv7 target until node freeze is fixed 2023-04-16 20:46:41 +02:00
Florian Vahl
3c862c8e89
Bump action versions 2023-04-04 18:10:28 +02:00
Florian
00c8f052e5 Set correct entrypoint 2023-04-04 17:24:51 +02:00
m0wer
24c06f6080 update to 5.2.7 2023-04-03 21:21:24 +02:00
m0wer
fa5c8bcb20 update reame latest version to 5.2.6 2023-04-03 21:18:10 +02:00
ArcticLampyrid
a8dcc9ea79 Update Dockerfile 2023-03-22 07:33:47 +01:00
m0wer
3694397677
Merge pull request #11 from cornernote/patch-3
allow extra options via environment variables
2023-01-19 08:40:56 +01:00
m0wer
1c741f590e
Merge branch 'master' into patch-3 2023-01-19 08:40:28 +01:00
m0wer
fafc396148
Merge pull request #10 from cornernote/patch-1
allow plugins via environment variable
2023-01-19 08:39:38 +01:00
m0wer
66a77d3d60
Merge pull request #9 from cornernote/patch-2
added guide for docker compose
2023-01-19 08:38:59 +01:00
Brett O'Donnell
93b30fcea0
allow extra options via environment variables
For example, when using https://github.com/OokTech/TW5-Bob you need the option `--wsserver`.  This will allow you to do `EXTRAOPTIONS=--wsserver`.
2023-01-14 15:42:21 +10:30
Brett O'Donnell
2652f4e6fa
added guide for docker compose
This PR adds a guide to the readme to use this project with `docker compose`, which is a useful way to keep all the docker settings, environment variables and volume data in a folder.
2023-01-14 15:02:40 +10:30
Brett O'Donnell
42324d0fe6
allow plugins via environment variable
This change will allow plugins to be defined via environment variable `PLUGINS`, for example:

```
PLUGINS=+plugins/tiddlywiki/filesystem +plugins/tiddlywiki/tiddlyweb ++./mygreatplugin
```
2023-01-14 14:50:55 +10:30
m0wer
24beb3bc3d
Merge pull request #8 from jyusang/master
Configure server path prefix
2022-07-16 17:56:51 +02:00
jyusang
2a342a1cfb feat(init-and-run-wiki): Support path-prefix listen parameter 2022-07-16 16:15:03 +08:00
jyusang
fbfdfdbd3d chore(Dockerfile): Remove unnecessary expose
This `EXPOSE` is probably not needed and it's more flexible to use the `-p`
flag in `docker run`.
2022-07-16 15:16:16 +08:00
jyusang
5687667a91 refactor(init-and-run-wiki): Extract listen command configuration 2022-07-16 14:59:07 +08:00
m0wer
a378b10a57
Merge pull request #7 from m0wer/ci/build_for_arm
Ci/build for arm
2021-11-26 21:18:35 +03:00
m0wer
2c0ab91984
ci(docker): setup qemu 2021-11-26 21:13:44 +03:00
m0wer
daaa7c5f4e
ci(docker): setup buildx for crossplatform 2021-11-26 21:10:25 +03:00
m0wer
f7bbe5cc1c
ci(docker): build for arm 2021-11-26 21:07:53 +03:00
m0wer
8ca707e750
Merge pull request #6 from m0wer/feat/disable_auth_by_default
feat(init-and-run-wiki): disable auth by default
2021-11-26 21:03:08 +03:00
m0wer
c71a3fcd89
feat(init-and-run-wiki): disable auth by default 2021-11-26 21:00:37 +03:00
4 changed files with 91 additions and 23 deletions

View file

@ -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 }}

View file

@ -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

View file

@ -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
View 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