Ubuntu Installation
Ubuntu 24.04 LTS, possibly others too.
System packages
sudo apt updatesudo apt install -y build-essential cpanminus git make automake autoconf cmake wgetsudo apt install -y libwebp-dev libgif-dev libjpeg-dev libpng-dev libtiff-dev libheif-dev libgd-devsudo apt install -y imagemagick librsvg2-bin librsvg2-dev pngquantsudo apt install -y postgresql postgresql-client postgresql-server-dev-all redis-server libhiredis-devsudo apt install -y libargon2-dev uuid-dev libevdev-dev libhtml-tidy-perlsudo apt install -y mkisofs xorriso growisofs transmission-cli nginx-full apache2-utilssudo apt install -y texlive-base texlive-latex-base texlive-latex-recommended texlive-fonts-recommendedsudo apt install -y texlive-latex-extra texlive-lang-european
Perl modules
Install modules:
sudo cpanm Mojolicious EV Mojo::Pg Mojo::Redis DBD::Pgsudo cpanm GD Imager Imager::File::JPEG Imager::File::GIF Imager::File::PNG Imager::File::TIFF Imager::File::HEIF Imager::File::WEBPsudo cpanm Mojolicious::Plugin::LocaleTextDomainOO Locale::TextDomain::OO::Extractsudo cpanm Params::Classify Params::Util Params::Validate Crypt::Argon2 Crypt::PBKDF2 Crypt::Eksblowfish::Bcrypt CryptX Digest::SHA Digest::SHA1 App::bmkpasswd Bytes::Random::Secure::Tinysudo cpanm Clone Data::UUID UUID DateTime DateTime::TimeZone Date::Calc Date::Format Hash::Mergesudo cpanm Text::MultiMarkdown MojoX::MIME::Types IO::Compress::Gzip YAML::XSsudo cpanm MIME::Base64 MIME::Lite MIME::Types File::Spec File::MimeInfo Time::HiRessudo cpanm --force HTML::Parsersudo cpanm HTML::FormatText HTML::TreeBuilder Business::Tax::VAT::Validationsudo cpanm Session::Token Mojolicious::Plugin::Util::RandomString Mojolicious::Plugin::OAuth2 Crypt::OpenSSL::Bignum Crypt::OpenSSL::RSA Mojo::JWTsudo cpanm Mojolicious::Plugin::Captcha Mojolicious::Plugin::Mail Test::Harnesssudo cpanm Net::DNS::Resolver Net::IP Net::IDN::Encode
Database
sudo -u postgres createuser samizdat -Psudo -u postgres createdb -O samizdat -E UTF-8 -T template0 --locale=en_US.UTF-8 samizdatsudo systemctl enable redis-server postgresqlsudo systemctl start redis-server postgresql
Edit /etc/postgresql/*/main/pg_hba.conf, add: local samizdat samizdat scram-sha-256
Then: sudo systemctl restart postgresql
Application
sudo mkdir -p /sites && cd /sitessudo git clone https://github.com/FAKEMedium/Samizdat.git && cd Samizdatsudo chown -R www-data:www-data /sites/Samizdatsudo -u www-data cp samizdat.dist.yml samizdat.ymlsudo -u www-data nano samizdat.yml- Edit configsudo -u www-data make fetchall && sudo -u www-data bin/samizdat migrate && sudo -u www-data make i18n
Optional Webpack frontend:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -sudo apt-get install -y nodejs libvips-dev python3
For single installation:
sudo -u www-data make webpackinitsudo -u www-data make webpack
For multiple sites (shared node_modules):
System-wide (requires root):
sudo mkdir -p /usr/local/share/samizdat && cd /usr/local/share/samizdatsudo cp /sites/Samizdat/package.json .sudo mkdir -p .npm-cachesudo HOME=/usr/local/share/samizdat npm_config_cache=/usr/local/share/samizdat/.npm-cache npm install
User-level (no root):
mkdir -p ~/samizdat-shared && cd ~/samizdat-sharedcp /sites/Samizdat/package.json .mkdir -p .npm-cacheHOME=$(pwd) npm_config_cache=$(pwd)/.npm-cache npm install
Then in each site: make webpack (will auto-detect and link to shared node_modules)
SSL cert (dev):
sudo -u www-data make cert
Usage
make debug- Dev server (https://localhost:3443)make serverstart/stop- Productionmake static_all/en/sv- Generate content cachemake i18n test routes- Dev tasksmake webpack- Build assetsmake iso- ISObin/samizdat migrate- DB migrations