Skip to content

Commit

Permalink
Getting Started to DokuWiki Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardnico committed Aug 25, 2024
1 parent edffb2a commit def5749
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 37 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 106 additions & 15 deletions data/pages/howto/getting_started/1_dokuwiki.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,127 @@
{ "path": ":wiki:markup_docs:getting_started:1_dokuwiki" },
{ "path": ":wiki:markup_getting_started:1_dokuwiki" }
],
"name": "Dokuwiki Installation",
"page_id": "52gxusbx7sb0v76bgvn9v",
"template": "holy",
"title": "How to install Dokuwiki ?"
"name": "Dokuwiki Up and Running",
"page_id": "52gxusbx7sb0v76bgvn9v"
}
---
====== ComboStrap Getting Started - Dokuwiki Instance ======
====== How to get DokuWiki Up and Running? ======

===== About =====
Because [[:combostrap|ComboStrap]] is built on top of the [[doku>|Dokuwiki Engine]], the first step is to have a DokuWiki Installation.
Because [[:combostrap|ComboStrap]] is built on top of the [[doku>|Dokuwiki Engine]], the first step is to have a DokuWiki app up and running.

This article will show you how.

We supports two kind of installation:
* [[#Docker|Docker]] - our image that comes with battery included
* [[#server|Standalone Server]] - on a raw server

===== Docker / Server =====

===== Type =====
This tutorial series uses our [[:docs:admin:docker|Docker image]] for consistency
but if you have a standalone server and want to install DokuWiki on it, you can also follow this [[howto:server_installation:start|tutorial series]].


==== Docker ====

===== Steps =====

We recommend greatly to start with [[#docker|Docker]] as:
We recommend greatly to use our [[:docs:admin:docker|DokuWiki in Docker image]] as:
* it's the easiest way to get DokuWiki up and running
* it contains all performance cache system (php-fpm and opcache)
* a Server DokuWiki installation is not easy and straightforward.
* a Server DokuWiki installation is not easy and straightforward
* and [[:docs:admin:docker#features|more]].


==== Server ====
==== Install Docker ====

To get DokuWiki on a server, you can follow this [[howto:server_installation:start|installation tutorial]]

Download the Docker binary or install a package as explained on this [[https://docs.docker.com/engine/install/|article]].


==== On Windows? ====

On Windows, you need to install WSL by following this [[https://learn.microsoft.com/en-us/windows/wsl/install|instructions]].
Why? Because Php is still a Linux and C technology that is really slow on Windows. This is architectural as explained on [[https://github.com/docker/for-win/issues/6742|this issue]]

==== Create a data directory ====
* Create a directory to store the DokuWiki Data
<code bash>
mkdir -p ~/site-combo-starter
</code>
* And go into it to change the current directory
<code bash>
cd site-combo-starter
</code>

==== Start DokuWiki in Docker ====

Start a DokuWiki Docker Instance with the following command.
<code bash>
docker run \
--name site-combo-starter \
--rm \
-p 8080:80 \
--user 1000:1000 \
-e DOKU_DOCKER_ACL_POLICY='public' \
-e DOKU_DOCKER_ADMIN_NAME='admin' \
-e DOKU_DOCKER_ADMIN_PASSWORD='welcome' \
-v $PWD:/var/www/html \
ghcr.io/combostrap/dokuwiki:php8.3-latest
</code>
where:
* ''DOKU_DOCKER_ACL_POLICY='public''' will configure a wiki that can only be seen by the public. You need to login to modify it.
* ''DOKU_DOCKER_ADMIN_NAME='admin''' create a user named ''admin'' with the ''admin'' permission.
* ''DOKU_DOCKER_ADMIN_PASSWORD='welcome''' is the password of the admin user
* ''%%-v $PWD:/var/www/html%%'' mount your current directory ''PWD'' into the image at the HTML server root ''/var/www/html''
* ''--user 1000:1000'' will create file as if it were you creating them. The user ''1000'' is the UID of your Desktop user (in Windows WSL at least)






==== Check that the instance has started ====

The command above will:
* start php,
* install DokuWiki,
* install the [[https://github.com/ComboStrap/site-starter|starter site]]
* and is ready when you see this lines:
<console>
INFO success: caddy entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO success: php_error_log entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
INFO success: php_fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
</console>
* You can then access DokuWiki at http://localhost:8080

{{:howto:getting_started:site-starter-home-page-snapshot.png?600|}}


<note>
=== How to stop the instance ===

If you want to stop the instance:
* you can press ''Control+C'' with your keyboard in the current terminal
* Or you can open another terminal and stop it with the following command
<code bash>
docker stop site-combo-starter
</code>
</note>


==== Login ====


Go to the [[http://localhost:8080/?do=login|login page]]: http://localhost:8080/?do=login

And enter the credentials:
* user: ''admin''
* password: ''welcome''




===== Next Step =====

In the next step, you will learn to install a ''favicon''

<button color='white'>
[[:howto:getting_started:6_favicon|Configure a Favicon]]
</button>
24 changes: 17 additions & 7 deletions data/pages/howto/getting_started/6_favicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ In our case we have chosen an icon directly from https://materialdesignicons.com

==== Upload the favicons ====

* Then upload the below icon files with the [[doku>media_manager|media manager]] to the root location (ie DOKUWIKI_HOME/data/media/)
* Then upload the below icon files with the [[http://localhost:8080/start?ns=&tab_files=files&do=media|Media Manager]] (([[doku>media_manager|media manager]])) to the root location (ie DOKUWIKI_HOME/data/media/)
* Click on this link [[http://localhost:8080/start?ns=&tab_files=files&do=media]] and upload the following files
* ''favicon.ico''
* ''favicon-32x32.png''
* ''favicon-16x16.png''
Expand Down Expand Up @@ -80,15 +81,24 @@ The [[docs:social:facebook|facebook page]] will tell your more about the specifi
{{strap:favicon_verification.png|}}


==== OpenSearch Favicon ====

In the [[docs:app:search|open search]], unfortunately, the icon is the icon of the template and is [[https://github.com/dokuwiki/dokuwiki/blob/master/lib/exe/opensearch.php#L17|hardcoded]], there is nothing we can do to change it at this place.
We still advertise it via [[:docs:type:website#internal_search_engine|sitelinks]] to search engines.

If you want it also at this place, you need to put it manually on the server at ''%%$DOKUWIKI_HOME/lib/tpl/dokuwiki/images/favicon.ico%%''.

==== Next Step ====

<btn color="white">
[[7_menu|Create a menu]]
[[7_menu|Create a top navigation menu]]
</btn>

\\
\\
\\

===== Support =====

==== OpenSearch Favicon ====

In the [[docs:app:search|open search]], unfortunately, the icon is the icon of the template and is [[https://github.com/dokuwiki/dokuwiki/blob/master/lib/exe/opensearch.php#L17|hardcoded]], there is nothing we can do to change it at this place.

We advertise it via [[:docs:type:website#internal_search_engine|sitelinks]] to search engines.

Most of the search engine, support it this ways, if you really **really** want it, you need to put it manually at ''%%$DOKUWIKI_HOME/lib/tpl/dokuwiki/images/favicon.ico%%''.
25 changes: 11 additions & 14 deletions data/pages/howto/getting_started/7_menu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ This is where we will create a [[docs:menubar:menubar|menu bar]].

===== Steps=====

* Create a page called '':slot_header'' at the [[:docs:page:system:home|home level]] . ie, with the following URL:
<code>
http://yourdomain.com/doku.php?id=slot_header
</code>
* Enter the below [[docs:menubar:menubar|menu bar]] example

* Go to this URL http://localhost:8080/doku.php?id=slot_header to create a page called '':slot_header'' at the [[:docs:page:system:home|home level]]
* You will see the [[docs:menubar:menubar|menu bar]] of the starter site.


If you have uploaded a icon in the [[6_favicon|Favicon step]], a minimal ''header slot'' with a [[docs:menubar:menubar|menu bar]] would look like:
You can:
* modify it
* or enter a more complicated example. If you have uploaded a icon in the [[6_favicon|Favicon step]], a minimal ''header slot'' with a [[docs:menubar:menubar|menu bar]] would look like:

<webcode name="Default" iframe>
<code dw>
Expand All @@ -57,11 +54,11 @@ My Brand name
More ... see the [[docs:menubar:menubar|menu bar page]]

===== Next Steps =====
In the same way, you can also modify the [[docs:theme:element:page-footer|page footer]].

Then you can:
* Check the [[docs:component|UI Components]]
* Learn about [[docs:router:router|Routing and redirections]]
* Have a look at the [[docs:seo:seo|SEO page]]
In the same way, you can also modify the [[docs:theme:element:page-footer|page footer]] with the following link: http://localhost:8080/doku.php?id=slot_footer

In the next step, we will store your site as combo site in Git.

For more tips and tops, you can also [[:newsletter|subscribe to the newsletter]].
<button color='white'>
[[8_git|Store my WebSite in Git]]
</button>
119 changes: 119 additions & 0 deletions data/pages/howto/getting_started/8_git.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---json
{
"aliases": [
{ "path": ":howto:getting_started:5_git" }
],
"name": "Git Site",
"page_id": "4335hckjomaayfepj2m1v"
}
---
====== How to store your site in Git? ======


===== About =====
This page will show you how to store your site as [[:docs:admin:website|combo site]] in a remote Git repository.


===== Steps =====

==== Create a remote Git Repository ====
We will be using [[https://github/com|GitHub]] as example but you can use any Git Repository Provider such as [[https://gogs.io/|Gogs]], [[https://gitlab.com|GitLab]] or [[https://gitea.com/|Gitea]].

For GitHub, follow this [[https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-new-repository|article]] to create your new repository.






==== Create a local Git Repository ====

In the directory that was used with the [[howto:getting_started:1_dokuwiki|docker command]], initialize a Git repository
<code bash>
cd /tmp/site-combo-starter
# Init (ie create ) a local repo
git init
</code>
* Rename the master branch to main
<code bash>
git branch -M main
</code>

==== Add the Git remote ====

* Add the URL of your repository as origin
<code bash>
git remote add origin https://github.com/ComboStrap/site-starter.git
</code>

==== Check the untracked files ====

<code bash>
git status
</code>
<console>
On branch main

No commits yet

Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitattributes
.gitignore
README.md
conf/
data/
docs/
lib/
robots.txt

nothing added to commit but untracked files present (use "git add" to track)
</console>
==== Add the combo site files ====

Add them all
<code bash>
git add .
</code>

==== Create your first commit ====

* Create a commit
<code bash>
git commit -m "First commit"
</code>

==== Push them to your remote repository ====

* Push
<code bash>
git push -u origin main
# enter your credentials
# or use SSH Keys (https://docs.github.com/en/authentication/connecting-to-github-with-ssh)
</code>
<console>
Enumerating objects: 45, done.
Counting objects: 100% (45/45), done.
Delta compression using up to 16 threads
Compressing objects: 100% (36/36), done.
Writing objects: 100% (45/45), 50.71 KiB | 10.14 MiB/s, done.
Total 45 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To github.com:ComboStrap/site-starter.git
* [new branch] main -> main
branch 'main' set up to track 'origin/main'.
</console>

===== Next =====

You can now develop, change your wiki and push your change to your Git Repository.

Then you can:
* Check the [[docs:component|UI Components]]
* Learn about [[docs:router:router|Routing and redirections]]
* Have a look at the [[docs:seo:seo|SEO page]]

For more tips and tops, you can also [[:newsletter|subscribe to the newsletter]].



1 change: 1 addition & 0 deletions data/pages/howto/getting_started/getting_started.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This ''how-to'' guide regroups a series of article to get you started.
- [[1_dokuwiki]]
- [[6_favicon]]
- [[7_menu]]
- [[5_git]]

===== Start =====
<btn>
Expand Down
2 changes: 1 addition & 1 deletion data/pages/howto/getting_started/sidebar.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<page-explorer tree></page-explorer>
<page-explorer tree></page-explorer>

0 comments on commit def5749

Please sign in to comment.