summaryrefslogtreecommitdiff
path: root/abdul-blog/matterbridge-in-tildeserver.gmi
diff options
context:
space:
mode:
authorW. Kosior <koszko@koszko.org>2024-05-27 12:19:19 +0200
committerW. Kosior <koszko@koszko.org>2024-05-27 12:29:59 +0200
commitee8fac8ab8529e2d105c7e55c2c9b28aefd19b46 (patch)
tree7f7559d0ba91710624eb2c76a9765587595d8153 /abdul-blog/matterbridge-in-tildeserver.gmi
parent2d05ae83321cdf8aa3abab6acdd69f331ef4b89a (diff)
downloadAGH-ctf-course-2024-magister.tar.gz
AGH-ctf-course-2024-magister.zip
Update and add remaining files.HEADmagister
Diffstat (limited to 'abdul-blog/matterbridge-in-tildeserver.gmi')
-rw-r--r--abdul-blog/matterbridge-in-tildeserver.gmi174
1 files changed, 174 insertions, 0 deletions
diff --git a/abdul-blog/matterbridge-in-tildeserver.gmi b/abdul-blog/matterbridge-in-tildeserver.gmi
new file mode 100644
index 0000000..f7e3e03
--- /dev/null
+++ b/abdul-blog/matterbridge-in-tildeserver.gmi
@@ -0,0 +1,174 @@
+# Matterbridge in tildeserver
+
+Hello friends, today I maked a bridge with Matterbridge program for Discord and Matrix room I talk in. It is cool because I run this in Guix functional package manager with UNIX Tilde server.
+
+## Config .scm
+
+I added 1 line to mine home config to using new modules
+
+```
+ ((gnu packages messaging) #:select (matterbridge))
+```
+
+And I has added more lines down under
+
+```
+(define home-matterbridge-services
+ (const
+ (list (shepherd-service
+ (provision '(mattermost))
+ (modules '((shepherd support))) ;for '%user-log-dir'
+ (start #~(make-forkexec-constructor
+ '(#$(file-append matterbridge "/bin/matterbridge")
+ "--conf"
+ #$(local-file "config.toml"))
+ #:log-file (string-append %user-log-dir
+ "/matterbridge.log")))
+ (stop #~(make-kill-destructor))
+ (documentation "Start local matterbridge.")))))
+
+(define home-matterbridge-service-type
+ (service-type
+ (name 'home-matterbridge)
+ (extensions
+ (list (service-extension home-shepherd-service-type
+ home-matterbridge-services)))
+ (description "Bridge messaging platforms using matterbridge.")
+ (default-value #f)))
+```
+
+That define service, that I use in home environment, like this
+
+```
+ (service home-matterbridge-service-type)
+```
+
+This is similar to Minetest Server service.
+
+=> /~abdul/minetest-server.gmi mine Minetest Server blog post
+
+## Matterbridge config .toml
+
+I use also an .toml file to configuring the Matterbridge program. It have this
+
+```
+[matrix.noevil-pl]
+Server="https://matrix.noevil.pl"
+Login="abdul"
+Password="***************"
+RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
+NoHomeServerSuffix=false
+
+[discord.cyber]
+Server="3333333333333333333"
+Token="000000000000000000000000.111111.22222222222222222222222222222222222222"
+RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
+PreserveThreading=true
+
+[[gateway]]
+name="secret_room"
+enable=true
+
+[[gateway.inout]]
+account="matrix.noevil-pl"
+channel="!HNiADouYMzLGUUxtxw:noevil.pl"
+
+[[gateway.inout]]
+account="discord.cyber"
+channel="ID:1207786885481500702"
+```
+
+There I replace an real password with "***************".
+
+## Full config .scm
+
+This is mine config full
+
+```
+(use-modules ((gnu home) #:select (home-environment))
+ ((gnu home services) #:select
+ (home-activation-service-type home-files-service-type service
+ service-extension service-type))
+ ((gnu home services shells) #:select
+ (home-bash-configuration home-bash-service-type))
+ ((gnu home services shepherd) #:select
+ (home-shepherd-service-type shepherd-service))
+ ((gnu packages messaging) #:select (matterbridge))
+ ((gnu packages minetest) #:select (minetest-server))
+ ((gnu system shadow) #:select (%default-dotguile))
+ ((guix gexp) #:select (file-append gexp local-file plain-file)))
+
+(define home-matterbridge-services
+ (const
+ (list (shepherd-service
+ (provision '(mattermost))
+ (modules '((shepherd support))) ;for '%user-log-dir'
+ (start #~(make-forkexec-constructor
+ '(#$(file-append matterbridge "/bin/matterbridge")
+ "--conf"
+ #$(local-file "config.toml"))
+ #:log-file (string-append %user-log-dir
+ "/matterbridge.log")))
+ (stop #~(make-kill-destructor))
+ (documentation "Start local matterbridge.")))))
+
+(define home-matterbridge-service-type
+ (service-type
+ (name 'home-matterbridge)
+ (extensions
+ (list (service-extension home-shepherd-service-type
+ home-matterbridge-services)))
+ (description "Bridge messaging platforms using matterbridge.")
+ (default-value #f)))
+
+(define home-minetest-services
+ (const
+ (list (shepherd-service
+ (provision '(minetest))
+ (modules '((shepherd support))) ;for '%user-log-dir'
+ (start #~(make-forkexec-constructor
+ '(#$(file-append minetest-server "/bin/minetestserver")
+ "--gameid" "minetest"
+ "--config" #$(local-file "abdultest.conf"))
+ #:environment-variables
+ (cons
+ (format #f "MINETEST_SUBGAME_PATH=~a/share/minetest/games"
+ #$(@@ (gnu packages minetest) minetest-data))
+ (default-environment-variables))
+ #:log-file (string-append %user-log-dir
+ "/minetest.log")))
+ (stop #~(make-kill-destructor))
+ (documentation "Start Minetest block game like Minecraft.")))))
+
+(define home-minetest-activation
+ (const #~(mkdir-p "/home/ctftilde/ctftilde-abdul/.local/minetest/abdultest")))
+
+(define home-minetest-service-type
+ (service-type
+ (name 'home-minetest)
+ (extensions
+ (list (service-extension home-shepherd-service-type
+ home-minetest-services)
+ (service-extension home-activation-service-type
+ home-minetest-activation)))
+ (description "Minetest block game like Minecraft.")
+ (default-value #f)))
+
+(home-environment
+ (services
+ (list
+ (service home-bash-service-type
+ (home-bash-configuration
+ (bash-profile (list (plain-file
+ "bash_ps1"
+ "export PS1=\"\nā†“ā† $PS1\nā†’ \"")))))
+
+ (service home-files-service-type
+ `((".guile" ,%default-dotguile)))
+
+ (service home-matterbridge-service-type)
+
+ (service home-minetest-service-type))))
+```
+
+=> /~abdul/index.gmi back into blog index