-
Notifications
You must be signed in to change notification settings - Fork 230
Installation
With the release of version 0.14.0 the default installation method for Hashtopolis has been changed from using the bundled version to using Docker images. The official Docker images are published at: https://hub.docker.com/u/hashtopolis
Requirements:
- Instructions tested on Ubuntu 22.04 & Windows 11 (WSL2)
- Install docker, https://docs.docker.com/engine/install/ubuntu/ or https://docs.docker.com/desktop/install/windows-install/
- Install docker compose v2 https://docs.docker.com/compose/install/linux/#install-using-the-repository
- Create a folder
mkdir hashtopolis
and change into the foldercd hashtopolis
wget https://raw.githubusercontent.com/hashtopolis/server/master/docker-compose.yml
wget https://raw.githubusercontent.com/hashtopolis/server/master/env.example -O .env
- Edit the
.env
file and change the settings to your likingsnano .env
- Optional: if you want to test the new API and new UI, set the
HASHTOPOLIS_APIV2_ENABLE
to1
inside the.env
file. NOTE: The APIv2 and UIv2 are a technical preview. Currently when enable everyone through the new API will be fully admin!
- Optional: if you want to test the new API and new UI, set the
docker compose up
- Access the Hashtopolis UI through: http://127.0.0.1:8080 and the new Hashtopolis UI through http://127.0.0.1:4200 using the credentials (user=admin, password=hashtopolis)
When using WSL2, please enable Docker Compose V2 and WSL Integration in Dokter Desktop
- Clone the web-ui repo:
git clone https://github.com/hashtopolis/web-ui.git
cd web-ui
- Build the web-ui repo and tag it
docker build . -t hashtopolis/frontend:latest
- Move one directory back
cd ..
- Clone the server repo:
git clone https://github.com/hashtopolis/server.git
cd server
- Optional: Check output of
file docker-entrypoint.sh
if it mentions 'with CRLF line terminators' your git checkout is converting line-ending on checkout, which is causing issues for files within the docker container. This is common behaviour for example within Windows (WSL) instances, to fix:git config core.eol lf
git config core.autocrlf input
git rm -rf --cached .
git reset --hard HEAD
- Check output of
file docker-entrypoint.sh
is should output: 'docker-entrypoint.sh: Bourne-Again shell script, ASCII text executable'
- Copy the env.example and edit the values to your likings
cp env.example .env
- Optional: if you want to test the new API and new UI, set the
HASHTOPOLIS_APIV2_ENABLE
to1
inside the.env
file. NOTE: The APIv2 and UIv2 are a technical preview. Currently when enable everyone through the new API will be fully admin!
- Optional: if you want to test the new API and new UI, set the
- Build the server docker image
docker build -t hashtopolis/backend:latet --target hashtopolis-server-prod
- Start everything
docker compose up
- Access the Hashtopolis UI through: http://127.0.0.1:8080 and the new Hashtopolis UI through http://127.0.0.1:4200 using the credentials (user=admin, password=hashtopolis)
This method is not supported and only here to give some guidance. It recommended way to deploy Hashtopolis from version 0.14.0 is to use Docker.
OS Ubuntu 22.04
sudo apt update && sudo apt upgrade
sudo apt install mysql-server
sudo apt install apache2
sudo apt install libapache2-mod-php php-mysql php php-gd php-pear php-curl
sudo apt install git unzip curl
sudo a2enmod rewrite
Secure the mysql installation by running mysql_secure_installation
sudo mysql
CREATE DATABASE hashtopolis;
CREATE USER 'hashtopolis'@'localhost' IDENTIFIED BY '<PASSWORD HERE>';
GRANT ALL PRIVILEGES ON hashtopolis.* TO 'hashtopolis'@'localhost' WITH GRANT OPTION;
exit
You may want to increase these PHP parameters to accommodate your intended usage.
sudo nano /etc/php/8.1/apache2/php.ini
...
memory_limit = ...
upload_max_filesize = ...
post_max_size = ...
...
In order to leverage the usage of TCP sessions in the python client, the timeout of the server needs to be set to something higher than your status update time (5s by default) (in Apache2 the timeout is 5s by default). For Apache2 you need to add/modify following setting:
sudo nano /etc/apache2/apache2.conf
...
KeepAliveTimeout 10
...
Download the release bundle from: https://github.com/hashtopolis/server/releases
wget https://github.com/hashtopolis/server/archive/refs/tags/v0.14.0.zip -O server-0.14.0.zip
Unzip the release zip
unzip server-x.x.x.zip
sudo mv server-x.x.x/ /var/www/hashtopolis-backend
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sudo composer install --working-dir=/var/www/hashtopolis-backend
Point your Apache config towards your Hashtopolis instance
sudo nano /etc/apache2/sites-enabled/000-default.conf
...
DocumentRoot /var/www/hashtopolis-backend/src
...
Set the database password in a config file
sudo nano /var/www/hashtopolis-backend/src/inc/conf.php
<?php
//START CONFIG
$CONN['user'] = 'hashtopolis';
$CONN['pass'] = '<PASSWORD HERE>';
$CONN['server'] = 'localhost';
$CONN['db'] = 'hashtopolis';
$CONN['port'] = '3306';
$DIRECTORIES = [
"files" => "/var/www/hashtopolis-backend/files/",
"import" => "/var/www/hashtopolis-backend/import/",
"log" => "/var/www/hashtopolis-backend/log/",
"config" => "/var/www/hashtopolis-backend/config/",
];
//END CONFIG
Create the Hashtopolis user, setup database and fix permissions
sudo php -f /var/www/hashtopolis-backend/src/inc/load.php
sudo chown -R www-data:www-data /var/www/hashtopolis-backend
sudo systemctl restart apache2
All done! Access Hashtopolis via port 80: http://localhost/
The new web-ui is currently in preview! When enabling this, everyone using the new web-ui will become full admin user!!!
Download the web-ui release via https://github.com/hashtopolis/web-ui/releases Unzip the release and open a terminal inside the web-ui folder
unzip web-ui-x.x.x.zip
cd web-ui
# Install nodejs, see https://github.com/nodesource/distributions#debinstall
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install Angular and the dependencies
npm install
# Edit the application file to point it to the hashtopolis server:
sed -i 's/localhost:8080/<ip of hashtopolis backend server>:8080/g' src/config/default/app/main.ts
# Build a package to be used with apache
npm run build
sudo mkdir -p /var/www/hashtopolis-frontend/
sudo cp -r dist/* /var/www/hashtopolis-frontend/
sudo chown -R www-data:www-data /var/www/hashtopolis-frontend/
sudo nano /etc/apache2/sites-enabled/000-default.conf
# Replace the file with roughly the following contents
# IMPORTANT, if you don't set the HASHTOPOLIS_APIV2_ENABLE environment variable in the config. The APIv2 will not be enabled!
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/hashtopolis-backend/src/
SetEnv HASHTOPOLIS_APIV2_ENABLE 1
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/var/www/hashtopolis-backend/">
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:4200>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/hashtopolis-frontend
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo nano /etc/apache2/ports.conf
# Replace the file with roughly the following contents:
Listen 8080
Listen 4200
sudo systemctl restart apache2
This is for Ubuntu 16.10 and for Hashtopolis release 0.13.1