From nobody Tue Dec 06 15:37:09 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NRPft0hhjz4jxJN; Tue, 6 Dec 2022 15:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NRPft07z9z3x9G; Tue, 6 Dec 2022 15:37:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670341030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oBC2MlUNtMwSrMmIzu6pnmzxscw+uuu3QTM4eTnTfjY=; b=AX9sSo7oihQI1mDWKeu4Ylq1mzG2OT1E4OTwQJSbM61Hu3oTOuLfqy+HY5rgKZR8Ee1JzJ +pDU1D8nXp8ydgdCUnBF60sfbVTgkmzBQYT/KBc978KgaIr87bWiw6DhVMPOlBilaeT+I9 ftZafVzdGZNRWSwkegIJI3/maGAJZ0FEwxPGsxpG8MYnwi7Agksdy9LuZCh53jv6O4tAnZ 6Rly+Enr6rXfgKUdbvFqys4W3uyAxRITBOz9TXIefrhJtCAiggiN+VfKrhgP0r1VfHb03W pRRFKm3XoxEv7Auxa0wSybxfkB0o7tGbFptZ+BRKdRcUzNVxtChWjD0FfgcKGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670341030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oBC2MlUNtMwSrMmIzu6pnmzxscw+uuu3QTM4eTnTfjY=; b=musXksnq4iCGijf9SwI9n+3TA2Rg1wa/2x0jw7wUOoJHDXqPLH/Z54fu+YzWsByRKI64Y9 IjNdECRfV1w3Y8x812P0jRUUtjzct57/BtCCE8t9s236R+hAsISo0lCBhaDXuCk5Lh9K1d K496F2zZPJR0HZFcXwhPHpxj0KrJFqbMmFQ3LWh2IRTpPO/lOzR1676sxPNBoKuGFwfYll ClUBgeFfcCPTNez/DZuWkMxUcpm8rvQ/MZIKqadDe185GHfXTiSNBRIZCJvD5sSeDpYOeL WLM4ARMEtnsVAbOFtOyhxXNrgkCeW5b7u4xYSqPCPmaHL1jzrKq46vahZynJRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670341030; a=rsa-sha256; cv=none; b=M8ZyoVX3yo90kYL3WglK4KALPr3ozrllF6uslpsFQ7QSlTsR1xOAqABwjujbV5IwbkEdf3 afU72hmzrGU8bBxGia1QxE+bb0QKjzfcMSU9RDOM8YTQGBHuTEBdE7+22nv0O+0aJXtJUR /2PXctyREMrjkFbDH5BTon5eEe5J4b+OgWjXYgkP6cHYjU6gNEn8XLFsTXEoJtxkhQiLlj /5wDfjM9tIU1cUMYgwXpe09R2QioBEeTIRKNHjO3fl6U8aqYjaTM72XjFgm+XtYdXNNPHr LpP40G/Lxq9oBwa+psBV4QEBI0iAb6ROihjbpoJVBjuNk4Abs3kN+U7xdwM9MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NRPfs6JL8zjQj; Tue, 6 Dec 2022 15:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2B6Fb9pA005829; Tue, 6 Dec 2022 15:37:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B6Fb99U005828; Tue, 6 Dec 2022 15:37:09 GMT (envelope-from git) Date: Tue, 6 Dec 2022 15:37:09 GMT Message-Id: <202212061537.2B6Fb99U005828@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 079641ccb7fb - main - net-im/mastodon: Resurrect List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 079641ccb7fb642169e9143c8b13830cbd4aef0f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=079641ccb7fb642169e9143c8b13830cbd4aef0f commit 079641ccb7fb642169e9143c8b13830cbd4aef0f Author: Muhammad Moinur Rahman AuthorDate: 2022-12-06 15:33:18 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2022-12-06 15:37:05 +0000 net-im/mastodon: Resurrect Mastodon is an alternative implementation of GNU social, a free, open-source social network. It is a decentralized alternative to commercial platforms based on ActivityStreams, Webfinger, PubsubHubbub and Salmon. The project focuses on creating a clean REST API and a good user interface. Ruby on Rails is used for the back-end, while React.js and Redux are used for the dynamic front-end. For easier maintenance of the port some part of the installation procedure remains to be completed by the end user. The main howto is available at https://wiki.freebsd.org/Ports/net-im/mastodon. A great thanks to Stefano Marinelli for the fabulous post on running Mastodon on a FreeBSD instance which helped a lot in porting this. The link to the original post is also available on the above mentioned wiki page. Sponsored by: Nepustil --- MOVED | 1 - net-im/Makefile | 1 + net-im/mastodon/Makefile | 71 +++++++++++++++++++++++++++++ net-im/mastodon/distinfo | 3 ++ net-im/mastodon/files/mastodon_sidekiq.in | 45 ++++++++++++++++++ net-im/mastodon/files/mastodon_streaming.in | 45 ++++++++++++++++++ net-im/mastodon/files/mastodon_web.in | 44 ++++++++++++++++++ net-im/mastodon/files/patch-.profile | 5 ++ net-im/mastodon/files/patch-dist_nginx.conf | 46 +++++++++++++++++++ net-im/mastodon/pkg-descr | 6 +++ net-im/mastodon/pkg-message | 10 ++++ 11 files changed, 276 insertions(+), 1 deletion(-) diff --git a/MOVED b/MOVED index 6f7df459f967..282219db96dd 100644 --- a/MOVED +++ b/MOVED @@ -10216,7 +10216,6 @@ mail/p5-Mail-Cache||2018-07-16|Has expired: Unmaintained www/p5-ZConf-RSS||2018-07-16|Has expired: Unmaintained www/p5-ZConf-RSS-GUI-GTK||2018-07-16|Has expired: Unmaintained devel/p5-ZConf-GUI||2018-07-16|Has expired: Unmaintained -net-im/mastodon||2018-07-16|Has expired: Breaks too frequently x11-fm/p5-PerlFM||2018-07-16|Has expired: Unmaintained astro/p5-ZConf-Weather||2018-07-16|Has expired: Unmaintained sysutils/p5-ZConf-Cron||2018-07-16|Has expired: Unmaintained diff --git a/net-im/Makefile b/net-im/Makefile index 670ef3853921..8ffa1680e2a3 100644 --- a/net-im/Makefile +++ b/net-im/Makefile @@ -70,6 +70,7 @@ SUBDIR += libstrophe SUBDIR += loudmouth SUBDIR += lurch + SUBDIR += mastodon SUBDIR += matterbridge SUBDIR += matterhorn SUBDIR += matterircd diff --git a/net-im/mastodon/Makefile b/net-im/mastodon/Makefile new file mode 100644 index 000000000000..eddd118e9063 --- /dev/null +++ b/net-im/mastodon/Makefile @@ -0,0 +1,71 @@ +PORTNAME= mastodon +DISTVERSIONPREFIX= v +DISTVERSION= 4.0.2 +CATEGORIES= net-im www + +MAINTAINER= bofh@FreeBSD.org +COMMENT= GNU Social-compatible microblogging server +WWW= https://github.com/tootsuite/mastodon + +LICENSE= AGPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libidn.so:dns/libidn +RUN_DEPENDS= autoconf>=2.71:devel/autoconf \ + curl>0:ftp/curl \ + ffmpeg>0:multimedia/ffmpeg \ + git>=0:devel/git \ + gmake>0:devel/gmake \ + gnupg>0:security/gnupg \ + redis>0:databases/redis \ + rubygem-bundler>=0:sysutils/rubygem-bundler \ + sudo>0:security/sudo \ + wget>0:ftp/wget \ + yarn>:www/yarn + +USES= magick:7,run pgsql +USE_GITHUB= yes +USE_RC_SUBR= mastodon_sidekiq mastodon_streaming mastodon_web +USE_RUBY= yes + +NO_ARCH= yes +NO_BUILD= yes + +USERS= ${PORTNAME} +GROUPS= ${PORTNAME} + +RM_MASTODONFILES= .dockerignore dist/mastodon-web.service \ + dist/mastodon-sidekiq.service \ + dist/mastodon-streaming.service +RM_MASTODONDIRS= .circleci .github + +post-extract: +.for _F in ${RM_MASTODONFILES} + @${RM} ${WRKSRC}/${_F} +.endfor +.for _D in ${RM_MASTODONDIRS} + @${RM} -r ${WRKSRC}/${_D} +.endfor + +post-patch: + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|'\ + ${WRKSRC}/dist/nginx.conf + +do-install: + ${FIND} ${WRKSRC} -name '*.orig' -delete + ${FIND} ${WRKSRC} -name '*.bak' -delete + ${FIND} ${WRKSRC} -name '*.gitkeep' -delete + ${FIND} ${WRKSRC} -name '*.gitignore' -delete + ${MV} ${WRKSRC}/dist/nginx.conf ${WRKSRC}/dist/nginx.conf.sample + (cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/www/${PORTNAME}) + +post-install: + @${ECHO_CMD} "@owner mastodon" >> ${TMPPLIST} + @${ECHO_CMD} "@group mastodon" >> ${TMPPLIST} + ${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \ + ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | \ + ${SED} -E -e '/sample$$/ s#^#@sample #' >> ${TMPPLIST} + ${FIND} -s ${STAGEDIR}${WWWDIR} -type d | ${SORT} | \ + ${SED} -e 's#^${STAGEDIR}${PREFIX}/#@dir #' >> ${TMPPLIST} + +.include diff --git a/net-im/mastodon/distinfo b/net-im/mastodon/distinfo new file mode 100644 index 000000000000..8869673daffd --- /dev/null +++ b/net-im/mastodon/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1669830294 +SHA256 (mastodon-mastodon-v4.0.2_GH0.tar.gz) = 70a4d9dcd9b746f6e9ced9b567ee5ad81e530cfaccb7f471259b917c20166309 +SIZE (mastodon-mastodon-v4.0.2_GH0.tar.gz) = 27934855 diff --git a/net-im/mastodon/files/mastodon_sidekiq.in b/net-im/mastodon/files/mastodon_sidekiq.in new file mode 100644 index 000000000000..0b2bc18d803c --- /dev/null +++ b/net-im/mastodon/files/mastodon_sidekiq.in @@ -0,0 +1,45 @@ +#!/bin/sh + +# $FreeBSD$ +# PROVIDE: mastodon_sidekiq +# REQUIRE: DAEMON postgresql +# KEYWORD: shutdown + +. /etc/rc.subr + +name="mastodon_sidekiq" +desc="Mastodon Sidekiq Service" +rcvar="mastodon_sidekiq_enable" + +load_rc_config ${name} + +start_precmd="${name}_prestart" +stop_cmd="${name}_stop" + +mastodon_sidekiq_user="mastodon" +mastodon_sidekiq_chdir="%%WWWDIR%%" +mastodon_sidekiq_env="RAILS_ENV=production \ +DB_POOL=25 \ +PATH=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/sbin:%%PREFIX%%/bin:~/bin \ +MALLOC_ARENA_MAX=2" +pidfile="/var/run/mastodon/${name##mastodon_}.pid" +ppidfile="/var/run/mastodon/${name##mastodon_}_supervisor.pid" +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/bundle" +procname_args="exec sidekiq -c 25" +command_args="-f -T ${name} -P ${ppidfile} -p ${pidfile} -S -r ${procname} ${procname_args}" + +mastodon_sidekiq_prestart() +{ + if [ ! -d "/var/run/mastodon" ]; then + install -d -o "${mastodon_sidekiq_user}" -g "${mastodon_sidekiq_user}" -m 750 "/var/run/mastodon" + fi +} + +mastodon_sidekiq_stop() +{ + /bin/kill -9 `cat ${ppidfile}` + /bin/kill -15 `cat ${pidfile}` +} + +run_rc_command "$1" diff --git a/net-im/mastodon/files/mastodon_streaming.in b/net-im/mastodon/files/mastodon_streaming.in new file mode 100644 index 000000000000..762d5eea8d45 --- /dev/null +++ b/net-im/mastodon/files/mastodon_streaming.in @@ -0,0 +1,45 @@ +#!/bin/sh + +# $FreeBSD$ +# PROVIDE: mastodon_streaming +# REQUIRE: DAEMON postgresql +# KEYWORD: shutdown + +. /etc/rc.subr + +name="mastodon_streaming" +desc="Mastodon Streaming Service" +rcvar="mastodon_streaming_enable" + +load_rc_config ${name} + +start_precmd="${name}_prestart" +stop_cmd="${name}_stop" + +mastodon_streaming_user="mastodon" +mastodon_streaming_chdir="%%WWWDIR%%" +mastodon_streaming_env="NODE_ENV=production \ +PORT=4000 \ +STREAMING_CLUSTER_NUM=1 \ +PATH=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/sbin:%%PREFIX%%/bin:~/bin" +pidfile="/var/run/mastodon/${name##mastodon_}.pid" +ppidfile="/var/run/mastodon/${name##mastodon_}_supervisor.pid" +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/node" +procname_args="./streaming" +command_args="-f -T ${name} -P ${ppidfile} -p ${pidfile} -S -r ${procname} ${procname_args}" + +mastodon_streaming_prestart() +{ + if [ ! -d "/var/run/mastodon" ]; then + install -d -o "${mastodon_streaming_user}" -g "${mastodon_streaming_user}" -m 750 "/var/run/mastodon" + fi +} + +mastodon_streaming_stop() +{ + /bin/kill -9 `cat ${ppidfile}` + /bin/kill -15 `cat ${pidfile}` +} + +run_rc_command "$1" diff --git a/net-im/mastodon/files/mastodon_web.in b/net-im/mastodon/files/mastodon_web.in new file mode 100644 index 000000000000..e72dbba7cd0e --- /dev/null +++ b/net-im/mastodon/files/mastodon_web.in @@ -0,0 +1,44 @@ +#!/bin/sh + +# $FreeBSD$ +# PROVIDE: mastodon_web +# REQUIRE: DAEMON postgresql +# KEYWORD: shutdown + +. /etc/rc.subr + +name="mastodon_web" +desc="Mastodon Web Service" +rcvar="mastodon_web_enable" + +load_rc_config ${name} + +start_precmd="${name}_prestart" +stop_cmd="${name}_stop" + +mastodon_web_user="mastodon" +mastodon_web_chdir="%%WWWDIR%%" +mastodon_web_env="RAILS_ENV=production \ +PORT=3000 \ +PATH=/sbin:/bin:/usr/sbin:/usr/bin:%%PREFIX%%/sbin:%%PREFIX%%/bin:~/bin" +pidfile="/var/run/mastodon/${name##mastodon_}.pid" +ppidfile="/var/run/mastodon/${name##mastodon_}_supervisor.pid" +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/bundle" +procname_args="exec puma -C config/puma.rb" +command_args="-f -T ${name} -P ${ppidfile} -p ${pidfile} -S -r ${procname} ${procname_args}" + +mastodon_web_prestart() +{ + if [ ! -d "/var/run/mastodon" ]; then + install -d -o "${mastodon_web_user}" -g "${mastodon_web_user}" -m 750 "/var/run/mastodon" + fi +} + +mastodon_web_stop() +{ + /bin/kill -9 `cat ${ppidfile}` + /bin/kill -15 `cat ${pidfile}` +} + +run_rc_command "$1" diff --git a/net-im/mastodon/files/patch-.profile b/net-im/mastodon/files/patch-.profile new file mode 100644 index 000000000000..ab2ad3170a9e --- /dev/null +++ b/net-im/mastodon/files/patch-.profile @@ -0,0 +1,5 @@ +--- .profile.orig 2022-12-06 11:15:00 UTC ++++ .profile +@@ -1 +1 @@ +-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/.apt/lib/x86_64-linux-gnu:/app/.apt/usr/lib/x86_64-linux-gnu/mesa:/app/.apt/usr/lib/x86_64-linux-gnu/pulseaudio ++export LC_ALL="en_US.UTF-8" diff --git a/net-im/mastodon/files/patch-dist_nginx.conf b/net-im/mastodon/files/patch-dist_nginx.conf new file mode 100644 index 000000000000..4322a71e51a0 --- /dev/null +++ b/net-im/mastodon/files/patch-dist_nginx.conf @@ -0,0 +1,46 @@ +--- dist/nginx.conf.orig 2022-11-30 18:16:44 UTC ++++ dist/nginx.conf +@@ -17,31 +17,32 @@ server { + listen 80; + listen [::]:80; + server_name example.com; +- root /home/mastodon/live/public; ++ root %%PREFIX%%/www/mastodon/public; + location /.well-known/acme-challenge/ { allow all; } + location / { return 301 https://$host$request_uri; } + } + + server { +- listen 443 ssl http2; +- listen [::]:443 ssl http2; + server_name example.com; ++ # Uncomment these lines once you acquire a certificate: ++ # listen 443 ssl http2; ++ # listen [::]:443 ssl http2; + +- ssl_protocols TLSv1.2 TLSv1.3; +- ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA; +- ssl_prefer_server_ciphers on; +- ssl_session_cache shared:SSL:10m; +- ssl_session_tickets off; ++ # ssl_protocols TLSv1.2 TLSv1.3; ++ # ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA; ++ # ssl_prefer_server_ciphers on; ++ # ssl_session_cache shared:SSL:10m; ++ # ssl_session_tickets off; + + # Uncomment these lines once you acquire a certificate: +- # ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; +- # ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; ++ # ssl_certificate %%PREFIX%%/etc/ssl/example.com/fullchain.pem; ++ # ssl_certificate_key %%PREFIX%%/etc/ssl/example.com/key.pem; + + keepalive_timeout 70; + sendfile on; + client_max_body_size 80m; + +- root /home/mastodon/live/public; ++ root %%PREFIX%%/www/mastodon/public; + + gzip on; + gzip_disable "msie6"; diff --git a/net-im/mastodon/pkg-descr b/net-im/mastodon/pkg-descr new file mode 100644 index 000000000000..dcd902d1fe83 --- /dev/null +++ b/net-im/mastodon/pkg-descr @@ -0,0 +1,6 @@ +Mastodon is an alternative implementation of GNU social, a free, +open-source social network. It is a decentralized alternative to +commercial platforms based on ActivityStreams, Webfinger, PubsubHubbub +and Salmon. The project focuses on creating a clean REST API and a good +user interface. Ruby on Rails is used for the back-end, while React.js +and Redux are used for the dynamic front-end. diff --git a/net-im/mastodon/pkg-message b/net-im/mastodon/pkg-message new file mode 100644 index 000000000000..492b6a4b7474 --- /dev/null +++ b/net-im/mastodon/pkg-message @@ -0,0 +1,10 @@ +[ +{ type: install + message: <