Du ser en gammel version af denne side. Se den nuværende version.

Sammenlign med nuværende Vis sidehistorik

« Forrige Version 70 Næste »

TO:DOs

  • Make draw.io to SVG work on Linux
  • Test xwiki.cfg - xwiki.store.versioning=0 to prevent page versions for tagging etc
  • Set created date/time on Blogposts (not only publised date) - SQL Seems to be the way (afkryds) 
  • Set  created date/time on pages (less important) - SQL Seems to be the way (afkryds) 
  • Improve logging from convert.py a bit (afkryds) 
  • Limit access to User Index (a personal need) (afkryds) 
  • Implement robots.txt in docker (afkryds) 
  • Disable public user Registration (afkryds) 

Install XWiki as a Docker solution

Officiel: https://xwiki.com/en/Blog/HowtoinstallXWikiusingDocker/

I Use: https://github.com/xwiki/xwiki-docker - And a hidden .evn file:

.env
# Default environment values
XWIKI_VERSION=16.10.11
DB_USER=xwiki
DB_PASSWORD=********
DB_DATABASE=xwiki
POSTGRES_ROOT_PASSWORD=*********'

The Docker Compose file:

docker-compose.yml
networks:
  bridge:
    driver: bridge
services:
  # The container that runs XWiki in Tomcat, with the appropriate JDBC driver (for postgres).
  web:
    image: "xwiki:${XWIKI_VERSION}-postgres-tomcat"
    container_name: xwiki-postgres-tomcat-web
    restart: unless-stopped
    depends_on:
      - db
    ports:
      - "8080:8080"
    # Default values defined in .env file.
    # The DB_USER/DB_PASSWORD/DB_DATABASE/DB_HOST variables are used in the hibernate.cfg.xml file.
    environment:
      - XWIKI_VERSION=${XWIKI_VERSION}
      - DB_USER=${DB_USER}
      - DB_PASSWORD=${DB_PASSWORD}
      - DB_DATABASE=${DB_DATABASE}
      - DB_HOST=xwiki-postgres-db
      - JAVA_OPTS="-Xmx2048m"
      - TZ=Europe/Copenhagen
    # Provide a name instead of an auto-generated id for xwiki data (the permanent directory in included in it)
    # configured in the Dockerfile, to make it simpler to identify in 'docker volume ls'.
    volumes:
      - /data/xwiki/xwiki-data:/usr/local/xwiki
      - /opt/xwiki/robots.txt:/usr/local/xwiki/webapps/ROOT/robots.txt
    networks:
      - bridge
  # The container that runs the database (postgres)
  db:
    image: "postgres:17"
    container_name: xwiki-postgres-db
    restart: unless-stopped
    volumes:
      - /data/xwiki/postgres-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_ROOT_PASSWORD=${POSTGRES_ROOT_PASSWORD}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_DB=${DB_DATABASE}
      - POSTGRES_INITDB_ARGS=--encoding=UTF8 --locale-provider=builtin --locale=C.UTF-8
    networks:
      - bridge

Go to the Web-interface and do the installation to end after startup.

Remove Extensions

  • Tour App - Not needed and gives anonymous users info not needed

Install Extensions

This can vary a bit - but for my migration scripts, these may be needed as they do substitute several Confluence Macro's:

Other possible

  • Map Macro
  • Numbered Headings Application

Migrate

If You use Gliffy in Confluence, install Draw.io on Confluence as trial and migrate all Gliffy drawings to Draw.io - As the Gliffy macro etc is not supported at all in XWiki.

Clone migration from bitbucket.org, create a python env in the cloned dir and install requirements:

You may neeed to: apt install python3.12-venv

Start installing and prepare for migration:

git clone https://moseiseydk@bitbucket.org/moseiseydk/confluence-migrate.git
python3 -m venv confluence-migrate
cd confluence-migrate
source bin/activate
pip install requests
pip install atlassian-python-api  
pip install python-slugify  

Create the config.py file:

confluence_username = ''
confluence_password = ''
confluence_url = 'https://www.server.dk'
confluence_members_group = 'confluence-users'

xwiki_username = ''
xwiki_password = ''
xwiki_url = 'https://xwiki.server.dk'

#The first created user under installation
xwiki_admin_username = 'admin'

#Skip blog and pages with restrictions - good for test env.
skip_restricted_content = False

#Spaces to migrate in Confluence - Capital and lower cases can be tricky
#Pages on same level as Home page is not migrated, only the tree structure from Home
space_keys = ["key1","key2","key3"]

#Start on the XWiki - the import will start from here
wiki_space = "Main" # XWiki Home
#wiki_space = "Sandbox" # XWki Sandbox

#Create users and groups
create_users = True
create_groups = True

# Blogposts
blog_start_at = 0
blog_max_limit = 100
blog_max_count = 2000 # Bug as the Atlassian API does not return a size of the total number. Set this number high

#Diagram Application - None, Free or Pro
diagram_app_type = "Free"

#OSType (for Draw.io CLI) - macos, linux
os_type = "macos"

#Logging
persist_log_to_file = True

#Stop on Error
stop_on_error = True

#Debug
log_urls = False
log_xml = False

#Database. Requires port 5432 access to the Database
skip_database_update = False
xwiki_database_host = "xwiki.server.dk"
xwiki_database_name = "xwiki"
xwiki_database_user = "xwiki"
xwiki_database_password = ""
xwiki_database_port = "5432"

Edit the confluence.py file and add all space keys You wish to migrate to XWiki:

space_keys = ["test","familieblog","anmeldelser","andrebilleder","khvg145","familiebilleder","it","ATLASSIAN"]

Take a backup / snapshot of the server her - its a baseline

Execute the migration script:

Limitations:

  • All Blogs will end in the "Blog" in Xwiki
  • A max of 50 attachments are supported from a Confluence page (a problem with the atlassian-python-api)
  • The migration can be re-run at any time, XWiki will just update the Page / Blog, but 1-2 history versions will be added per run, so its not optimal for the final run, but for tests it can be fine.
  • max_count = 2000 is set for "blogpost" as there are no way to tell when we are done (a problem with the atlassian-python-api). Make sure this is higher that the total number of blogposts in Your Confluence
  • The page layout of a Confluence page is converted to a Xwiki "container" macro in the migration, that is not to good, some macros will report: The [video] macro is a standalone macro and it cannot be used inline. (This macro generates standalone content. As a consequence you need to make sure to use a syntax that separates your macro from the content before and after it so that it's on a line by itself. For example in XWiki Syntax 2.0+ this means having 2 newline characters (a.k.a line breaks) separating your macro from the content before and after it.)

Start the migration script:

python3 confluence.py

Post migration

If skip_database_update = False then You need to apply the 2 SQL's afterwards:

sudo apt-get install -y postgresql-client-16

psql -U xwiki -h localhost -d xwiki < pages.sql
psql -U xwiki -h localhost -d xwiki < blogs.sql

Do a visual compare.

Examine log.txt for Errors.

In things went wrong, roll back to the backup.

Reindex:

Style

You may want to style Xwiki, I do a different Theme and a little LESS:

/* Administration: Vertical Menus */
@list-group-active-border: @list-group-border;

/* Increasing default contrast for accessibility. */
/* Slight change on @gray-light to make it pass the 4.5 contrast threshold on a white background. */
@gray-light: #727272;
/* Gray-light is too light on a light backgrounds. @gray for muted text is easier to read. */
@text-muted: @gray;
/* The boxes background is too dark for links, we make it a lighter shade than bootstrap default. */
@state-danger-bg: #f8ecec;
@state-success-bg: #e5f3df;
@state-info-bg: #e1f1f9;
/* Input-color-placeholder is hardcoded in bootstrap, we need to override it. */
@input-color-placeholder: @gray-light;

/* Drawer */
@xwiki-drawer-menu-item-hover-bg: @list-group-hover-bg;
@xwiki-drawer-menu-item-hover-color: @list-group-link-hover-color;

/* Headings */
@headings-font-weight: 500;

/* Other */
@well-bg: @body-bg;

/* Center complete XWiki page layout */

/* Center XWiki content at 1600px */
#contentcontainer {
    max-width: 1600px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}


/* Load Inter font */
@import (css) url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Main typography */
body {
    font-family: 'Inter', Arial, sans-serif !important;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Article content */
#contentcontainer {
    font-size: 15px;
    line-height: 1.8;
}

/* Headings */
#contentcontainer h1,
#contentcontainer h2,
#contentcontainer h3,
#contentcontainer h4 {
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

#contentcontainer h1 {
    font-size: 2.3em;
}

#contentcontainer h2 {
    font-size: 1.8em;
}

#contentcontainer h3 {
    font-size: 1.4em;
}

/* Paragraph spacing */
#contentcontainer p {
    margin-bottom: 1.2em;
}

/* Keep code in a monospace font */
#contentcontainer pre,
#contentcontainer code {
    font-family: 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.9em;
}


/* Blue striped background outside content */
html,
body {
    background-color: #102b46 !important;

    background-image: repeating-linear-gradient(
        135deg,
        #102b46 0px,
        #102b46 12px,
        #173b5d 12px,
        #173b5d 24px
    ) !important;

    background-attachment: fixed !important;
}

/* Keep XWiki's outer layout transparent */
#xwikimaincontainer,
#xwikimaincontainerinner {
    background: transparent !important;
}

/* White centered content area */
#contentcontainer {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 30px !important;

    background: #ffffff !important;
    box-sizing: border-box;

    min-height: 80vh;
}

/* Mobile layout */
@media (max-width: 768px) {
    #contentcontainer {
        padding: 18px !important;
    }
}


Other

Disable Registration in the Amin UI (If You want to)

Under "Rights" - set it explicit:


Disable URLs

XWiki is very "open" and for an external website use, we want to block a few URL's

User Index:

RewriteEngine On
RewriteRule ^/bin/view/Main/UserDirectory - [F,L]

Application Index:

RewriteRule ^/bin/view/Applications/ - [F,L]

Wiki Index:

RewriteRule ^/bin/view/WikiManager/ - [F,L]

User Registration:

RewriteRule ^/bin/register - [F,L]


Enable CKEditor features

Pr. default the CKEditor toolbar is very limited in functionality, in the Administrator backend is possible to enable more toolbar features:

https://extensions.xwiki.org/xwiki/bin/view/Extension/CKEditor%20Integration/#HStandardCKEditorFeatures

  • Ingen etiketter