Skip to content
codelingPublic
forked from panicsteve/w2wiki

About

A web-based, wiki-like notepad that you host yourself

Resources

Stars

3 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

368 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

W2 wiki

W2 wiki is a web-based, wiki-like notepad that you can host yourself.

Features:

  • Elegant text markup:
    • Uses Markdown Syntax.
    • It supports double-brackets [[like this]] to link to another page in the wiki by title
    • A line with only ![[Page name]] embeds the content of that page (nested up to INCLUDE_MAX_DEPTH levels; cycles and oversized embeds are replaced by a marker)
  • Title & content search
  • Filesystem storage (no database required) in plain Markdown text files.
  • Image uploading support
  • Optionally password-protected
  • Unlike cloud / hosted solutions, you retain control of your data
  • Written in PHP for portability and hackability
  • Extremely compact (only a few .php files and a .css file)
  • Differences to original w2wiki by panicsteve:
    • Rudimentary, optional git integration to commit (and push) each page edit, and to pull changes made elsewhere
    • Support for renaming and deleting pages
    • Markdown formatting syntax help on edit page
    • Localization support (en/de/ja/oc translations included)
    • Improved icon-based interface
    • Optional sidebar fed by a special page (shown when viewing pages, in the page list and in search results, but not when editing)
    • Merged All/Recent list of all pages
    • Links:
      • Possibility to display pages that link to the current page
      • Support for links to sub-captions (using # in links)
      • When navigating to a non-existing page, show links to similar pages
      • Mark links to non-existing pages (by default in red)
      • Mark external links with globe icon
    • Image uploads:
      • Option to shrink uploaded images (based on maximum side length)
      • Fix rotation (based on EXIF data)
      • List of uploaded images providing usage information and option to delete

TODO

  • Upload folder: the name is configurable (UPLOAD_FOLDER, UPLOAD_URL), but it still has to be a direct subfolder of PAGES_PATH (to capture uploads in the git repository), and the web server has to serve it statically, e.g. via a soft link in the root folder (see INSTALL.md)

Installation & Configuration

See Installation instructions, including running W2 in a container (Docker or Podman).

Tests

Automated tests (PHPUnit, run against a private copy of the wiki) are described in tests/README.md; they run on GitHub Actions for pull requests.

Security Notice

In its current form, W2 wiki is not security-hardened; it's recommended to only run on an additionally secured server (e.g. in a small, private network for one user only; and secured behind a VPN and/or HTTPS with basic authentication).

By default, there is no authentication at all (REQUIRE_PASSWORD defaults to false, see config.sample.php): everybody who can reach the wiki can read and edit all pages, and upload and delete files. This is meant for a wiki on a private computer or network. Recommended setups if the wiki can be reached by others:

  • Always serve it over HTTPS.
  • Either set REQUIRE_PASSWORD to true and store a hash of your password (created with password_hash) in W2_PASSWORD_HASH, see the installation instructions. There is only this one password for everybody. Failed logins are limited (lockouts that grow with every failure, and a limit over all clients). Unsalted SHA-1 password hashes are deprecated and will stop working in a future version.
  • Or use the access control of your web server or a reverse proxy: an IP allowlist ($allowedIPs), HTTP Basic Authentication (which allows several users), or an authenticating proxy with single sign-on or a second factor.
  • Uploaded files are served directly by the web server and are not protected by the wiki's password; only the web server's access control protects them.

SVG uploads are disabled by default, since SVG files can contain scripts; they can be enabled with the optional enshrined/svg-sanitize library, see the installation instructions.

License

W2 is licensed under the MIT license.

Every source file (PHP, JavaScript, CSS, shell scripts, workflows and the Containerfile) names its license with an SPDX identifier in the first lines:

/*
 * SPDX-License-Identifier: MIT
 *
 * W2
 *
 * What the file is for, in a sentence or two.
 */

Files which only have a comment line start with // SPDX-License-Identifier: MIT (# ... in shell scripts, YAML and the Containerfile). Copyright notices of earlier authors stay in the files they were in. The bundled Michelf/ files are PHP Markdown and keep their own notices. tests/Unit/FileHeaderTest.php fails for a source file without the identifier.

Acknowledgements

Originally written by Steven Frank and others, with modifications by

W2 wiki uses PHP Markdown by Michel Fortin for rendering Markdown to HTML.

The Markdown syntax description is taken from daringfireball.net.

Maintainer of this fork is codeling.

Reporting Bugs

Please report bugs in the github issue tracker of this fork.

About

A web-based, wiki-like notepad that you host yourself

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages