Commit c5fe52
2025-08-26 15:25:07 Kevin Jung Park: Linux deleted.| linux/docker containers/wiki & documentation/documize.md .. /dev/null | |
| @@ 1,179 0,0 @@ | |
| - | # Documize |
| - | <br/> |
| - | |
| - | # Introduction |
| - | |
| - | This guide installs **Documize Community** on a fresh Ubuntu 20.04/22.04/24.04 server, sets up PostgreSQL correctly, and runs Documize as a **systemd** service. |
| - | It uses the current Documize distribution method (single Linux binary), avoids the buggy config-file path, and relies on flags/environment variables. |
| - | |
| - | --- |
| - | <br/> |
| - | |
| - | ## Assumptions & requirements |
| - | |
| - | - Ubuntu (amd64) with `sudo` access and Internet. |
| - | - Documize will listen on **port 8080** (you can later put it behind Traefik/Nginx). |
| - | - Database user: `docuser`, Database name: `documize`. |
| - | - Replace the placeholders: |
| - | - `YourPasswordHere` → a strong DB password you choose. |
| - | - `YourSaltHere` → a random 32–64 hex chars string (see Step 7). |
| - | |
| - | --- |
| - | <br/> |
| - | |
| - | ## 1) Update system & install helpers |
| - | |
| - | ```bash |
| - | sudo apt update && sudo apt upgrade -y |
| - | sudo apt install -y curl wget jq ca-certificates postgresql postgresql-contrib |
| - | |
| - | ``` |
| - | |
| - | Enable PostgreSQL: |
| - | ```bash |
| - | sudo systemctl enable --now postgresql |
| - | sudo systemctl status postgresql --no-pager |
| - | ``` |
| - | |
| - | <br/> |
| - | |
| - | ## 2) Create PostgreSQL role, database |
| - | ```bash |
| - | sudo -u postgres psql <<'SQL' |
| - | -- Create app user (set your own strong password) |
| - | DO $$ |
| - | BEGIN |
| - | IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'docuser') THEN |
| - | CREATE USER docuser WITH ENCRYPTED PASSWORD 'YourPasswordHere'; |
| - | END IF; |
| - | END |
| - | $$; |
| - | |
| - | -- (Re)create database with UTF-8 and owned by docuser |
| - | DROP DATABASE IF EXISTS documize; |
| - | CREATE DATABASE documize |
| - | OWNER docuser |
| - | TEMPLATE template0 |
| - | ENCODING 'UTF8'; |
| - | |
| - | -- Ensure the public schema is correctly owned and writable |
| - | ALTER SCHEMA public OWNER TO docuser; |
| - | GRANT ALL ON SCHEMA public TO docuser; |
| - | GRANT CREATE, USAGE ON SCHEMA public TO docuser; |
| - | SQL |
| - | ``` |
| - | |
| - | Quick connectivity check: |
| - | ```bash |
| - | pg_isready -d "host=localhost port=5432 dbname=documize user=docuser" |
| - | ``` |
| - | <br/> |
| - | |
| - | ## 3) Create a system user and folders for Documize |
| - | ```bash |
| - | sudo useradd -r -s /usr/sbin/nologin -d /opt/documize documize || true |
| - | sudo mkdir -p /opt/documize /var/lib/documize /etc/documize |
| - | sudo chown -R documize:documize /opt/documize /var/lib/documize |
| - | ``` |
| - | <br/> |
| - | |
| - | ## 4) Download the latest Documize Community binary (Linux amd64) |
| - | Use GitHub “latest” (auto-picks the newest Linux binary): |
| - | ```bash |
| - | DL_URL="$(curl -s https://api.github.com/repos/documize/community/releases/latest \ |
| - | | jq -r '.assets[] | select(.name | test("linux-amd64$")) | .browser_download_url')" |
| - | |
| - | echo "Downloading: $DL_URL" |
| - | sudo curl -L "$DL_URL" -o /opt/documize/documize |
| - | sudo chmod 0755 /opt/documize/documize |
| - | sudo chown documize:documize /opt/documize/documize |
| - | ``` |
| - | <br/> |
| - | |
| - | ## 5) (Optional) Open the firewall for 8080 (UFW) |
| - | ```bash |
| - | sudo ufw allow 8080/tcp |
| - | sudo ufw reload |
| - | ``` |
| - | <br/> |
| - | |
| - | ## 6) One-off smoke test (no config file; flags + env) |
| - | First, generate a salt (or use your own): |
| - | ```bash |
| - | openssl rand -hex 32 |
| - | ``` |
| - | |
| - | Then run Documize just once in the foreground: |
| - | ```bash |
| - | sudo -u documize env \ |
| - | DOCUMIZEDBTYPE=postgresql \ |
| - | DOCUMIZEDB='host=localhost port=5432 dbname=documize user=docuser password=YourPasswordHere sslmode=disable' \ |
| - | DOCUMIZESALT='YourSaltHere' \ |
| - | /opt/documize/documize -port 8080 |
| - | ``` |
| - | Open: http://server-ip:8080/setup |
| - | Confirm the page loads. Ctrl+C to stop when you’re done checking. |
| - | <br/> |
| - | |
| - | ## 7) Persist with systemd (recommended) |
| - | Create an env file for the service: |
| - | ```bash |
| - | sudo tee /etc/documize/env >/dev/null <<'EOF' |
| - | DOCUMIZEDBTYPE=postgresql |
| - | DOCUMIZEDB=host=localhost port=5432 dbname=documize user=docuser password=YourPasswordHere sslmode=disable |
| - | DOCUMIZESALT=YourSaltHere |
| - | EOF |
| - | sudo chmod 0640 /etc/documize/env |
| - | sudo chown root:documize /etc/documize/env |
| - | ``` |
| - | Create the systemd unit: |
| - | ```bash |
| - | sudo tee /etc/systemd/system/documize.service >/dev/null <<'EOF' |
| - | [Unit] |
| - | Description=Documize Community |
| - | After=network.target postgresql.service |
| - | Wants=postgresql.service |
| - | |
| - | [Service] |
| - | User=documize |
| - | Group=documize |
| - | WorkingDirectory=/opt/documize |
| - | EnvironmentFile=/etc/documize/env |
| - | ExecStart=/opt/documize/documize -port 8080 |
| - | Restart=always |
| - | RestartSec=5s |
| - | |
| - | [Install] |
| - | WantedBy=multi-user.target |
| - | EOF |
| - | |
| - | sudo systemctl daemon-reload |
| - | sudo systemctl enable --now documize |
| - | sudo systemctl status documize --no-pager |
| - | ``` |
| - | <br/> |
| - | |
| - | ## 8) Complete the setup wizard |
| - | Open: |
| - | `http://<server-ip>:8080/setup` |
| - | Fill in organization/admin details → Complete setup. |
| - | From now on you’ll use the normal login URL (the setup route is one-time). |
| - | |
| - | <br/> |
| - | |
| - | :::success |
| - | # Installation completed! |
| - | Documost is now installed. |
| - | ::: |
| - | |
| - | <br/> |
| - | |
| - | ## 9) Useful operations |
| - | ```bash |
| - | # service control |
| - | sudo systemctl stop documize |
| - | sudo systemctl start documize |
| - | sudo systemctl restart documize |
| - | sudo systemctl status documize --no-pager |
| - | journalctl -u documize -f # live logs |
| - | ``` |
| linux/docker containers/wiki & documentation/otter wiki.md .. /dev/null | |
| @@ 1,1 0,0 @@ | |
| - | # Otter Wiki |
| linux/docker installation/ubuntu.md .. /dev/null | |
| @@ 1,63 0,0 @@ | |
| - | # Docker |
| - | |
| - | ## Introduction |
| - | In this document, you will learn to install the latest and official Docker on your server. |
| - | <br/> |
| - | |
| - | ## Installation |
| - | **Uninstall old versions** |
| - | |
| - | > [!IMPORTANT] |
| - | > There are many unofficial packages, including: |
| - | > - docker.io |
| - | > - docker-compose |
| - | > - docker-compose-v2 |
| - | > - docker-doc |
| - | > - podman-docker |
| - | <br/> |
| - | |
| - | Run this command to uninstall older pacakges: |
| - | ```bash |
| - | for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done |
| - | ``` |
| - | <br/> |
| - | |
| - | **Install using the apt repository** |
| - | |
| - | Set up Docker repository, copy and run this hole command: |
| - | ```bash |
| - | # Add Docker's official GPG key: |
| - | sudo apt-get update |
| - | sudo apt-get install ca-certificates curl |
| - | sudo install -m 0755 -d /etc/apt/keyrings |
| - | sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc |
| - | sudo chmod a+r /etc/apt/keyrings/docker.asc |
| - | |
| - | # Add the repository to Apt sources: |
| - | echo \ |
| - | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ |
| - | $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ |
| - | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null |
| - | sudo apt-get update |
| - | ``` |
| - | <br/> |
| - | |
| - | **Install Docker packages** |
| - | ```bash |
| - | sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin |
| - | ``` |
| - | <br/> |
| - | |
| - | **Start docker and test** |
| - | |
| - | This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits. |
| - | ```bash |
| - | sudo service docker start |
| - | sudo docker run hello-world |
| - | ``` |
| - | <br/> |
| - | |
| - | :::success |
| - | # Installation completed! |
| - | You have installed and started Docker successfully. |
| - | ::: |