From d410b35b375c0e864eb742cc06213b86f175333c Mon Sep 17 00:00:00 2001 From: Adrien Date: Thu, 29 Dec 2022 10:39:32 +0100 Subject: [PATCH] Add Framadate and mastodon notes --- 20220526082057-self_hosted_server.org | 8 ++- 20220927123818-mastodon.org | 86 +++++++++++++++++++++++++++ 20221001210655-framadate.org | 37 ++++++++++++ 3 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 20220927123818-mastodon.org create mode 100644 20221001210655-framadate.org diff --git a/20220526082057-self_hosted_server.org b/20220526082057-self_hosted_server.org index a066e4a..a364539 100644 --- a/20220526082057-self_hosted_server.org +++ b/20220526082057-self_hosted_server.org @@ -1,6 +1,6 @@ :PROPERTIES: :ID: 47707ab9-7792-4592-b25b-8dd2f2e45b05 -:mtime: 20220604101605 +:mtime: 20221229104128 :ctime: 20220526082057 :END: #+title: Self-hosted server @@ -29,3 +29,9 @@ certbot certonly --nginx --force-renew -d imap.adrien.run * Vidéo ** Plateforme de streaming *** [[https://github.com/Chocobozzz/PeerTube][PeerTube]] + +* Rendez-vous (remplacement de Doodle) +** [[id:8bb29bf5-219f-49ff-b410-e7cc2473337f][framadate]] + +* Microblogging +** [[id:056e86ae-99ad-45c6-be11-fe6582028870][mastodon]] diff --git a/20220927123818-mastodon.org b/20220927123818-mastodon.org new file mode 100644 index 0000000..61ac073 --- /dev/null +++ b/20220927123818-mastodon.org @@ -0,0 +1,86 @@ +:PROPERTIES: +:ID: 056e86ae-99ad-45c6-be11-fe6582028870 +:mtime: 20221229104009 +:ctime: 20220927123818 +:END: +#+title: mastodon + +* Introduction +Service de microblogging open-source et décentalisée. + +* Installation +#+BEGIN_SRC shell +# Mastodon requires nodejs 16 +sudo snap install node --classic + +apt install imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev file git-core \ +g++ libprotobuf-dev protobuf-compiler pkg-config nodejs gcc autoconf \ +bison build-essential libssl-dev libyaml-dev libreadline6-dev \ +zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev \ +nginx redis-server redis-tools postgresql postgresql-contrib \ +certbot python3-certbot-nginx libidn11-dev libicu-dev libjemalloc-dev + +yarn set version stable + +# We will be using rbenv to manage Ruby versions, because it’s easier to get the right versions and +# to update once a newer release comes out. rbenv must be installed for a single Linux user, +# therefore, first we must create the user Mastodon will be running as: +adduser --disabled-login mastodon + +# The following command shall be run using root priviledges (sudo) +su - mastodon +# Proceed to install rbenv and rbenv-build: +git clone https://github.com/rbenv/rbenv.git ~/.rbenv +echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc +git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build +RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.3 +rbenv global 3.0.3 +gem install bundler --no-document +exit + +# Creating mastodon user in postgres +sudo -u postgres psql +#+END_SRC +#+BEGIN_SRC sql +CREATE USER mastodon CREATEDB; +#+END_SRC + +#+BEGIN_SRC shell +# The following command shall be run using root priviledges (sudo) +su - mastodon + +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash - +nvm install v16.17.1 +npx browserslist@latest --update-db + +git clone https://github.com/tootsuite/mastodon.git live && cd live +git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1) +sed -i 's/\([ ]*"emoji-mart": \)"[^"]*",/\1"^3.0.1",/' package.json + +bundle config deployment 'true' +bundle config without 'development test' +bundle install -j$(getconf _NPROCESSORS_ONLN) +yarn install --pure-lockfile + +RAILS_ENV=production bundle exec rake mastodon:setup + +exit +#+END_SRC + +#+BEGIN_SRC shell +cp /home/mastodon/live/dist/nginx.conf /etc/nginx/sites-available/mastodon +sed -i 's/example.com/mastodon.adrien.run/' /etc/nginx/sites-available/mastodon +sed -i 's/\([ ]*server 127.0.0.1\):3000/\1:3001/' /etc/nginx/sites-available/mastodon +sed -i 's/\# \(ssl_certificate[ ]*.*\)/\1/' /etc/nginx/sites-available/mastodon + +certbot --nginx -d example.com +ln -s /etc/nginx/sites-available/mastodon /etc/nginx/sites-enabled/mastodon + +cp /home/mastodon/live/dist/mastodon-*.service /etc/systemd/system/ +sed -i 's/\(Environment="PORT\)=3000/\1=3001/' /etc/systemd/system/mastodon-web.service +systemctl daemon-reload + +#+END_SRC + +* Références + * [[https://docs.joinmastodon.org/admin/install/][Installing from source - Mastodon documentation]] diff --git a/20221001210655-framadate.org b/20221001210655-framadate.org new file mode 100644 index 0000000..79bb2f4 --- /dev/null +++ b/20221001210655-framadate.org @@ -0,0 +1,37 @@ +:PROPERTIES: +:ID: 8bb29bf5-219f-49ff-b410-e7cc2473337f +:mtime: 20221002111411 +:ctime: 20221001210655 +:END: +#+title: framadate + +* Introduction +Service pouvant être hébergé sur son propre server et proposant une alternative à /doodle/. + +* Installation +#+BEGIN_SRC shell +apt install php-pgsql php php-intl php-mbstring +# The following command shall be run using root priviledges (sudo) +mysql -u root -p +#+END_SRC + +#+BEGIN_SRC sql +CREATE DATABASE IF NOT EXISTS `framadate` DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; +CREATE USER 'framadate'@'localhost' IDENTIFIED BY 'useastrongpassword'; +GRANT ALL PRIVILEGES ON `framadate`.* TO 'framadate'@'localhost'; +#+END_SRC + +#+BEGIN_SRC shell +adduser --disabled-login framadate +# The following command shall be run using root priviledges (sudo) +su - framadate +wget https://packages.framasoft.org/projects/framadate/framadate-1.1.19.zip -P . +unzip ./framadate-1.1.19.zip + +chown -R www-data: /home/framadate/framadate +sudo -u www-data htpasswd -bc /home/framadate/framadate/admin/.htpasswd admin 'admin_password' +#+END_SRC + +* Références + * [[https://framagit.org/framasoft/framadate/framadate/-/wikis/home][Framadate · GitLab]] +