Add finnish version of the first post, refactor AsciiDoc on other pages
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Now the documents follow the AsciiDoctor best practices https://asciidoctor.org/docs/asciidoc-recommended-practices/
This commit is contained in:
Marko Korhonen 2024-01-28 11:40:09 +02:00
parent 2b3a0bfa34
commit 12b21aec19
Signed by: FunctionalHacker
GPG key ID: A7F78BCB859CD890
8 changed files with 198 additions and 153 deletions

View file

@ -6,20 +6,17 @@ featured_image: hero.jpg
---
= PGP
I like PGP and I secure everything I can with it. If you would like to
send me encrypted files, emails or anything of that sort, you came to
the right page.
I like PGP and I secure everything I can with it.
If you would like to send me encrypted files, emails or anything of that sort, you came to the right page.
== Keyoxide
I have setup a link:https://keyoxide.org/wkd/marko%40korhonen.cc[profile at Keyoxide]
which has all of the information about my key. It also serves as proof of ownership to many
of my online accounts.
I have setup a link:https://keyoxide.org/wkd/marko%40korhonen.cc[profile at Keyoxide] which has all of the information about my key.
It also serves as proof of ownership to many of my online accounts.
== WKD
I also have a WKD (Web Key Directory) server setup so supported clients should be able to
automatically import my key based on my email address mailto:marko@korhonen.cc[]
I also have a WKD (Web Key Directory) server setup so supported clients should be able to automatically import my key based on my email address mailto:marko@korhonen.cc[]
=== Fetch key with Sequoia
@ -37,6 +34,11 @@ include::assets/gpg.sh[]
== Update 2022-08-28: new key
I have decided to change my old RSA key to ed25519. I have link:assets/marko_korhonen_pgp.asc.sig[signed the new key] with link:assets/old_key/marko_korhonen_pgp.asc[my old key] if you wish to verify cryptographically that the new key belongs to me (given that you believed that my old key belonged to me to begin with 😉). Revocation certificate for the old key is available at link:assets/old_key/marko_korhonen_pgp.rev[here].
I have decided to change my old RSA key to ed25519.
I have link:assets/marko_korhonen_pgp.asc.sig[signed the new key] with link:assets/old_key/marko_korhonen_pgp.asc[my old key] if you wish to verify cryptographically that the new key belongs to me (given that you believed that my old key belonged to me to begin with 😉).
Revocation certificate for the old key is available at link:assets/old_key/marko_korhonen_pgp.rev[here].
On a related note, I can wholeheartedly recommend changing to ed25519 to anyone. It is supposedly more secure than RSA but to my surprise, it is many times faster too. With my old key it used to take 2-3 seconds to decrypt a password from my password manager. Now, it's practically instant.
On a related note, I can wholeheartedly recommend changing to ed25519 to anyone.
It is supposedly more secure than RSA but to my surprise, it is many times faster too.
With my old key it used to take 2-3 seconds to decrypt a password from my password manager.
Now, it's practically instant.

View file

@ -5,20 +5,17 @@ date: 2022-06-10
---
= PGP
Tykkään PGP:stä ja turvaan sillä kaiken minkä pystyn. Jos haluaisit lähettää
minulle enkryptoituja tiedostoja, sähköposteja tai muuta vastaavaa, tulit
oikeaan paikkaan.
Tykkään PGP:stä ja turvaan sillä kaiken minkä pystyn.
Jos haluaisit lähettää minulle enkryptoituja tiedostoja, sähköposteja tai muuta vastaavaa, tulit oikeaan paikkaan.
== Keyoxide
Minulla on link:https://https://keyoxide.org/wkd/marko%40korhonen.cc[Keyoxide profiili]
josta löydät kaikki tarvittavat tiedot avaimestani. Keyoxide toimii myös todisteena
monista omistamistani tileistä netissä.
Minulla on link:https://https://keyoxide.org/wkd/marko%40korhonen.cc[Keyoxide profiili] josta löydät kaikki tarvittavat tiedot avaimestani.
Keyoxide toimii myös todisteena monista omistamistani tileistä netissä.
== WKD
Olen myös asentanut WKD (Web Key Directory) serverin joten tuetut ohjelmat pystyvät noutamaan
avaimen automaattisesti sähköpostiosoitteeni mailto:marko@korhonen.cc[] perusteella.
Olen myös asentanut WKD (Web Key Directory) serverin joten tuetut ohjelmat pystyvät noutamaan avaimen automaattisesti sähköpostiosoitteeni mailto:marko@korhonen.cc[] perusteella.
=== Nouda avain Sequoia:lla
@ -36,6 +33,11 @@ include::assets/gpg.sh[]
== Päivitys 28.8.2022: uusi avain
Olen päättänyt vaihtaa vanhan RSA-avaimeni ed25519 avaimeksi. Olen link:assets/marko_korhonen_pgp.asc.sig[allekirjoittanut uuden avaimen] link:assets/old_key/marko_korhonen_pgp.asc[vanhalla avaimellani], jos haluat varmistaa kryptograafisesti, että uusi avain kuuluu minulle (jos siis uskoit alunperinkään että vanha avain kuului minulle 😉). Vanhan avaimen peruutussertifikaatti löytyy link:assets/old_key/marko_korhonen_pgp.rev[täältä].
Olen päättänyt vaihtaa vanhan RSA-avaimeni ed25519 avaimeksi.
Olen link:assets/marko_korhonen_pgp.asc.sig[allekirjoittanut uuden avaimen] link:assets/old_key/marko_korhonen_pgp.asc[vanhalla avaimellani], jos haluat varmistaa kryptograafisesti, että uusi avain kuuluu minulle (jos siis uskoit alunperinkään että vanha avain kuului minulle 😉).
Vanhan avaimen peruutussertifikaatti löytyy link:assets/old_key/marko_korhonen_pgp.rev[täältä].
Tähän liittyen, voin vilpittömästi suositella kenelle tahansa vaihtamista ed25519 avaimeen. Se on oletettavasti turvallisempi kuin RSA, mutta yllätyksekseni se on myös monta kertaa nopeampi. Vanhalla avaimellani salasanan salauksen purkaminen salasanamanageristani kesti 2-3 sekuntia. Nyt se on käytännössä välitöntä.
Tähän liittyen, voin vilpittömästi suositella kenelle tahansa vaihtamista ed25519 avaimeen.
Se on oletettavasti turvallisempi kuin RSA, mutta yllätyksekseni se on myös monta kertaa nopeampi.
Vanhalla avaimellani salasanan salauksen purkaminen salasanamanageristani kesti 2-3 sekuntia.
Nyt se on käytännössä välitöntä.

View file

@ -2,7 +2,6 @@
title: Creating this site
description: My journey with AsciiDoc and Hugo, and how we got here
date: 2022-09-14
lastmod:
featured_image: hero.jpg
menu:
sidebar:
@ -15,51 +14,43 @@ Marko Korhonen <marko@korhonen.cc>
v1.0, 2022-09-14
== Introduction
As seems to be customary on technology related blogs, the first post about
creating the blog itself. So here we are, this is the first post in my blog,
detailing the steps I took to arrive here.
As seems to be customary on technology related blogs, the first post is about creating the blog itself.
So here we are, this is the first post in my blog, detailing the steps I took to arrive here.
== Assessing the options
I first got interested in static site generators years ago when my friend
Fatih built link:https://teaddict.net[his site] with
link:https://jekyllrb.com[Jekyll]. It felt very refreshing at the time
since I was hosting my homepage on WordPress, which always seemed a little
too bloated and overkill for my needs.
I first got interested in static site generators years ago when my friend Fatih built link:https://teaddict.net[his site] with link:https://jekyllrb.com[Jekyll].
It felt very refreshing at the time since I was hosting my homepage on WordPress, which always seemed a little too bloated and overkill for my needs.
=== Jekyll
I tried setting up Jekyll multiple times during 2021 but got discouraged
by the build process which involved specifying all sorts of bundles and
gems for just for building my site (I never was very into Ruby to begin with).
I also got to debug all sorts of build problems which were a result of my
very specific requirements for the blog. I added multiple plugins which didn't
work together very well. The biggest hurdle to overcome was the fact that I
wanted to use link:https://en.wikipedia.org/wiki/AsciiDoc[AsciiDoc]
as the mark-up language and Jekyll doesn't natively support this so I had to
use a link:https://github.com/asciidoctor/jekyll-asciidoc[plugin] to bring
in the functionality. This plugin specifically didn't seem to work very well
with the other plugins I required and the theme I had selected.
Anyways, I never got further with setting up the site so I put the project
on the backburner. From the inception of the
link:https://korhonen.cc[korhonen.cc] domain in late 2020 until summer 2022
the main domain just showed a 404 error. I had a lot of self-hosted
applications only on subdomains.
I tried setting up Jekyll multiple times during 2021 but got discouraged by the build process which involved specifying all sorts of bundles and gems for just for building the site (I never was very into Ruby to begin with).
I also got to debug all sorts of build problems which were a result of my very specific requirements for the blog.
I added multiple plugins which didn't work together very well.
The biggest hurdle to overcome was the fact that I wanted to use link:https://en.wikipedia.org/wiki/AsciiDoc[AsciiDoc] as the mark-up language.
Jekyll doesn't natively support this so I had to use a link:https://github.com/asciidoctor/jekyll-asciidoc[plugin] to bring in the functionality.
This plugin specifically didn't seem to work very well with the other plugins I required and the theme I had selected.
Anyways, I never got further with setting up the site so I put the project on the backburner.
From the inception of the my current domain link:https://korhonen.cc[korhonen.cc] in late 2020 until summer 2022 the main domain just showed a 404 error.
I had a lot of self-hosted applications only on subdomains.
=== Hugo
After discovering link:https://gohugo.io[Hugo] I got very exited immediately.
It seemed to be an answer to all of my problems. The main benefits were
* Single binary
* Support for AsciiDoc out of the box
Because of this, I got a basic site setup within a matter of minutes. No
more fiddling with bundles and gems. I also didn't require any other
plugins since Hugo seemed to support everything I wanted natively.
Because of this, I got a basic site setup within a matter of minutes.
No more fiddling with bundles and gems.
I also didn't require any other plugins since Hugo seemed to support everything I wanted natively.
== Configuration
I opted to use the link:https://github.com/hossainemruz/toha[Hugo Toha] theme
for my site since it seemed to do well all of the things I wanted to
accomplish with this site
I opted to use the link:https://github.com/hossainemruz/toha[Hugo Toha] theme for my site since it seemed to do well all of the things I wanted to accomplish with this site
* A website where I can add any number of static pages (not blog posts)
** link:/pgp[Information page about my PGP key]
@ -67,38 +58,29 @@ accomplish with this site
* link:/[Introduction and portfolio]
* link:/posts[A blog]
The configuration of Hugo and the theme took quite a while but was well
worth it. I now have a beautiful multipurpose site which is easy to maintain
and expand.
The configuration of Hugo and the theme took quite a while but was well worth it.
I now have a beautiful multipurpose site which is easy to maintain and expand.
=== Commenting system
I wanted to add support for users to add comments on the blog. While I usually
self-host everything I can, this time I landed with
link:https://giscus.app[Giscus]. It's built upon the GitHub discussions
platform so all I needed to do was to create a repository in GitHub with
the discussions feature enabled and configure it in Toha (the Hugo theme
I selected).
I went through all of the options that Toha supported but none of them were
self-hostable and I didn't feel like implementing support for a different
platform myself. This might be a cool future project at some point though.
I wanted to add support for users to add comments on the blog.
While I usually self-host everything I can, this time I landed with link:https://giscus.app[Giscus].
It's built upon the GitHub discussions platform so all I needed to do was to create a repository in GitHub with the discussions feature enabled and configure it in Toha (the Hugo theme I selected).
I went through all of the options that Toha supported but none of them were self-hostable and I didn't feel like implementing support for a different platform myself.
This might be a cool future project at some point though.
== Automating the build process
_Update 2022-12-17: I have switched from Drone CI to Woodpecker CI. Woodpecker is a FOSS fork of Drone as Drone has moved to a proprietary license._
_Update 2022-12-17 part 2: I have switched from Gitea to Forgejo. Forgejo is a FOSS fork of Gitea as Gitea seems to be moving towards a closed business model._
While I was setting up this site, I found out about
link:https://woodpecker-ci.org[Woodpecker CI] which seems to suit my needs beautifully.
I have tried link:https://www.jenkins.io[Jenkins] in the past but didn't
find it very easy to work with and I didn't like the fact that it was so heavy
on resources.
While I was setting up this site, I found out about link:https://woodpecker-ci.org[Woodpecker CI] which seems to suit my needs beautifully.
I have tried link:https://www.jenkins.io[Jenkins] in the past but didn't find it very easy to work with and I didn't like the fact that it was so heavy on resources.
Setting up Woodpecker took only about 30 minutes thanks to the excellent
documentation and native link:https://forgejo.org[Forgejo] Support
(which I was already using for some years before this). Setting up the
pipeline took a little bit more trial and error but in the end it proved
to be pretty easy.
Setting up Woodpecker took only about 30 minutes thanks to the excellent documentation and native link:https://forgejo.org[Forgejo] Support (which I was already using for some years before this).
Setting up the pipeline took a little bit more trial and error but in the end it proved to be pretty easy.
Relevant configuration files
@ -107,19 +89,13 @@ Relevant configuration files
* link:https://git.korhonen.cc/FunctionalHacker/dotfiles/src/branch/main/docker/woodpecker/docker-compose.toml[Woodpecker CI configuration]
== Future plans
I don't plan to become a regular blogger any time soon but if I find
something that I think would be of value to other people, I will write
about it here if I find the time and energy.
I really enjoy tinkering
with Linux and self-hosting applications on my server so I might write some
tutorials about these topics in the future. I'm also a passionate
link:https://neovim.io[NeoVim] user so I might write a post about
link:https://git.korhonen.cc/FunctionalHacker/dotfiles/src/branch/main/home/.config/nvim[my configuration]
sometime soon.
I don't plan to become a regular blogger any time soon but if I find something that I think would be of value to other people, I will write about it here if I find the time and energy.
Just for fun, here is a screenshot of me writing this blog post. How meta
of me 😃
I really enjoy tinkering with Linux and self-hosting applications on my server so I might write some tutorials about these topics in the future.
I'm also a passionate link:https://neovim.io[NeoVim] user so I might write a post about link:https://git.korhonen.cc/FunctionalHacker/dotfiles/src/branch/main/home/.config/nvim[my configuration] sometime soon.
Just for fun, here is a screenshot of me writing this blog post. How meta of me 😃
.A screenshot of me writing a blog post about this blog
image::assets/writing_blogpost_neovim_hugo.png[Me writing this blog post]

View file

@ -1,14 +1,104 @@
---
title: Tämän sivun luominen
description: Matkani AsciiDocin and Hugon parissa ja miten tähän pisteeseen päädyttiin
date: 2022-07-19
draft: true
date: 2022-09-14
featured_image: hero.jpg
menu:
sidebar:
name: Tämän sivun luominen
identifier: creating_this_site
---
:toc:
= Tämän sivun luominen
= Tämän sivuston luominen
Marko Korhonen <marko@korhonen.cc>
v1.0, 2022-07-19
v1.0, 2022-09-14
== Johdanto
Kuten tekniikkaan liittyvissä blogeissa näyttää olevan tapana, ensimmäinen postaus on itse blogin luomisesta.
Joten tässä ollaan, tämä on blogini ensimmäinen postaus, jossa kerrotaan yksityiskohtaisesti vaiheet, joita tein päästäkseni tänne.
Kuten teknologiaan liittyvissä blogeissa näyttää olevan tapana, ensimmäinen postaus on itse blogin luomisesta.
Joten tässä olemme, tämä on ensimmäinen kirjoitus blogissani, joka kuvaa vaiheet jotka johtivat tähän pisteeseen.
== Vaihtoehtojen arviointi
Kiinnostuin ensimmäisen kerran staattisista sivugeneraattoreista vuosia sitten, kun ystäväni Fatih rakensi link:https://teaddict.net[oman sivunsa] käyttäen link:https://jekyllrb.com[Jekylliä].
Se tuntui erittäin virkistävältä tuolloin, koska siihen aikaan kotisivuni olivat WordPressissä, mikä tuntui aina hieman liian ylimitoitetulta ja raskaalta tarpeisiini nähden.
=== Jekyll
Yritin asentaa Jekylliä useita kertoja vuonna 2021, mutta menetin mielenkiinnon monimutkaisen build-prosessin takia, joka vaati kaikenlaisten bundlejen ja gemien määrittämistä (en koskaan ollut erityisen kiinnostunut Rubysta alun perinkään).
Minun piti myös debuggata kaikenlaisia ongelmia, jotka johtuivat blogilleni asettamistani vaatimuksista.
Lisäsin useita liitännäisiä, jotka eivät toimineet kovin hyvin yhdessä.
Suurin haaste oli se, että halusin käyttää sivun kirjoittamiseen link:https://en.wikipedia.org/wiki/AsciiDoc[AsciiDocia].
Jekyll tue tätä oletuksena, joten minun piti käyttää link:https://github.com/asciidoctor/jekyll-asciidoc[pluginia].
Tämä plugin ei näyttänyt toimivan kovin hyvin muiden tarvitsemieni pluginien ja teeman kanssa.
Joka tapauksessa en koskaan päässyt pidemmälle sivuston asentamisessa, joten laitoin projektin taka-alalle.
Alusta lähtien nykyisen domainini link:https://korhonen.cc[korhonen.cc] perustamisesta joulukuussa 2020 aina kesään 2022 asti domainin juuri näytti vain 404-virheen. Minulla oli paljon itse hostattuja sovelluksia asennettuna vain subdomaineissa.
=== Hugo
Löydettyäni link:https://gohugo.io[Hugon] innostuin heti. Se näytti olevan vastaus kaikkiin ongelmiini.
Päälimmäiset edut olivat
* Staattinen binääri
* Suora tuki AsciiDocille
Tämän ansiosta sain perussivuston käyttöön muutamassa minuutissa.
Ei enää sotkemista bundlejen ja gemien kanssa.
Minun ei myöskään tarvinnut käyttää mitään plugineita, koska Hugo näytti tukevan oletuksena kaikkea mitä tarvitsin.
== Konfigurointi
Päätin käyttää link:https://github.com/hossainemruz/toha[Hugo Toha] -teemaa sivustollani, koska se näytti tekevän hyvin kaikki asiat, jotka halusin saavuttaa tällä sivustolla
* Verkkosivusto, johon voin lisätä helposti haluamani määrän staattisia sivuja (ei blogikirjoituksia)
** link:/fi/pgp[Sivu tietoja PGP-avaimestani]
** link:/fi/korhonen_aur[Sivu tietoja Arch Linux -varastostani]
* link:/fi[Esittely ja portfolio]
* link:/fi/posts[Blogi]
Hugon ja teeman konfigurointi kesti aikansa, mutta oli sen arvoista.
Minulla on nyt kaunis ja monipuolinen sivusto, jota on helppo ylläpitää ja laajentaa.
=== Kommentointijärjestelmä
Halusin lisätä mahdollisuuden käyttäjille kommentoida blogiani. Vaikka yleensä hostaan itse kaiken mahdollisen, tällä kertaa päädyin link:https://giscus.app[Giscus]-palveluun.
Se käyttää GitHub Discussions alustaa backendinään, joten minun tarvitsi vain luoda repo GitHubissa jossa on tämä ominaisuus päällä ja konfiguroida se Tohaan (valitsemaani Hugon teemaan).
Kävin läpi kaikki Tohan tuetut vaihtoehdot, mutta mikään niistä ei ollut itse hostattavissa.
En halunnut myöskään toteuttaa tukea uudelle kommenttialustalle itse.
Tämä voisi olla kuitenkin hauska projekti tulevaisuudessa.
== Build prosessin automatisointi
_Päivitys 2022-12-17: Olen vaihtanut Drone CI:stä Woodpecker CI:hin.
Woodpecker on avoimen lähdekoodin fork Dronesta, koska Drone siirtyi suljettuun lisenssiin._
_Päivitys 2022-12-17 osa 2: Olen vaihtanut Giteasta Forgejoon.
Forgejo on avoimen lähdekoodin fork Gitesta, koska Gitea näyttää siirtyvän suljettuun liiketoimintamalliin._
Kun asensin tätä sivustoa, sain tietää link:https://woodpecker-ci.org[Woodpecker CI]:stä, joka näytti sopivan tarpeisiini erinomaisesti.
Olin kokeillut link:https://www.jenkins.io[Jenksiä] aiemmin, mutta en pitänyt sitä kovin helppokäyttöisenä.
En myöskään pitänyt siitä, että se kulutti niin paljon resursseja.
Woodpeckerin asentaminen kesti vain noin 30 minuuttia erinomaisen dokumentaation ja sisäänrakennetun link:https://forgejo.org[Forgejo]-tuen ansiosta (jota käytin jo vuosia ennen tätä).
Pipelinen asentaminen vaati hieman enemmän kokeilua ja virheiden korjausta, mutta loppujen lopuksi se osoittautui melko helpoksi.
Asiaan liittyvät konfiguraatiotiedostot
* link:https://git.korhonen.cc/FunctionalHacker/korhonen.cc/src/branch/main/.woodpecker.yml[Sivuston buildiin käytetty pipeline]
* link:https://git.korhonen.cc/FunctionalHacker/dotfiles/src/branch/main/docker/forgejo/docker-compose.toml[Forgejo-serverin konfiguraatio]
* link:https://git.korhonen.cc/FunctionalHacker/dotfiles/src/branch/main/docker/woodpecker/docker-compose.toml[Woodpecker CI:n konfiguraatio]
== Tulevaisuuden suunnitelmat
En aio tulla säännölliseksi bloggaajaksi lähiaikoina.
Jos löydän jotain, mikä voisi olla arvokasta muille, kirjoitan siitä täällä, jos vaan löydän siihen aikaa ja energiaa.
Nautin paljon Linuxin näpräämisestä ja sovellusten itse hostaamisesta palvelimellani, joten saatan kirjoittaa joitain ohjeita näistä aiheista tulevaisuudessa.
Olen myös link:https://neovim.io[NeoVim]-käyttäjä, joten saatan kirjoittaa postauksen link:https://git.korhonen.cc/FunctionalHacker/dotfiles/src/branch/main/home/.config/nvim[asetuksistani] jossakin vaiheessa.
Tässä on kuvankaappaus minusta kirjoittamassa tätä blogikirjoitusta. Aika meta 😃
.Kuvankaappaus minusta kirjoittamassa blogikirjoitusta tästä blogista
image::assets/writing_blogpost_neovim_hugo.png[Minä kirjoittamassa tätä blogikirjoitusta]

View file

@ -11,50 +11,39 @@ menu:
:toc:
= Migrate Misskey root account
I recently migrated my single user Fediverse server from
https://misskey-hub.net[Misskey] to https://joinfirefish.org[Firefish] and
I encountered an issue that I did not find documented elsewhere, so
I thought I'd write down the solution I found, in case anyone would
benefit from it and save some time in the future.
I recently migrated my single user Fediverse server from https://misskey-hub.net[Misskey] to https://joinfirefish.org[Firefish].
During the migration I encountered an issue that I did not find documented elsewhere.
I thought I'd write down the solution I found, in case anyone would benefit from it and save some time in the future.
I decided to migrate to a new domain at the same time, so the easiest way
was just to create a new server and migrate my account and not fuss about
migrating the Misskey instance itself.
I decided to migrate to a new domain at the same time, so the easiest way was just to create a new server and migrate my account and not fuss about migrating the Misskey instance itself.
Being a single user instance, my account was also the "root" account of
Misskey. Misskey does not allow migrating the root account, if trying to do
so, you will just get an error along the lines of "root cannot migrate".
Being a single user instance, my account was also the "root" account of Misskey.
Misskey does not allow migrating the root account, if trying to do so, you will just get an error along the lines of "root cannot migrate".
== Solution
I took to the database to find out what I can do bypassing the UI, and lo and
behold, I found an `isRoot` column in the `user` table. I didn't want to end up
without a root account on my old instance however, so I went to the Misskey
control panel and created a new account, simply called 'root'.
I took to the database to find out what I can do bypassing the UI, and lo and behold, I found an `isRoot` column in the `user` table.
I didn't want to end up without a root account on my old instance however, so I went to the Misskey control panel and created a new account, simply called "root".
Misskey seems to save all of it's known users to the `user` table, not only
the actual local accounts. To find the local accounts only, you can use
the following query
Misskey seems to save all of it's known users to the `user` table, not only the actual local accounts.
To find the local accounts only, you can use the following query
[source,sql]
----
include::code/query_users[]
include::code/query_users.sql[]
----
Now you can simply make your new root account's `isRoot` column `true` and
your actual user account `false`. After that, the migration will work.
Now you can simply make your new root account's `isRoot` column `true` and your actual user account `false`.
After that, the migration will work.
[source,sql]
----
include::code/update_users[]
include::code/update_users.sql[]
----
You should probably check that you only modified 2 rows before committing the
transaction.
You should probably check that you only modified 2 rows before committing the transaction.
I would imagine that this solution should work for the numerous Misskey forks
around, but I have not tested it so your results may vary.
I would imagine that this solution should work for the numerous Misskey forks around, but I have not tested it so your results may vary.
If you found this post useful, make sure to share, tweet, toot, bleep and bloop
this on your social media service of choice. If you have any issues with this
process, you can leave a comment below and I will try to help you out.
If you found this post useful, make sure to share, tweet, toot, bleep and bloop this on your social media service of choice.
If you have any issues with this process, you can leave a comment below and I will try to help you out.

View file

@ -12,53 +12,39 @@ menu:
:toc:
= Misskeyn root-tilin migraatio
Vaihdoin äskettäin yhden käyttäjän Fediverse-palvelimeni
https://misskey-hub.net[Misskey]stä https://joinfirefish.org[Firefish]iin ja
kohtasin ongelman, jota en löytänyt dokumentoituna muualla. Päätin jakaa
löytämäni ratkaisun, jos joku muu hyötyisi siitä ja säästäisi aikaansa
tulevaisuudessa.
Vaihdoin äskettäin yhden käyttäjän Fediverse-palvelimeni https://misskey-hub.net[Misskey]stä https://joinfirefish.org[Firefish]iin.
Kohtasin ongelman, jota en löytänyt dokumentoituna muualla.
Päätin jakaa löytämäni ratkaisun, jos joku muu hyötyisi siitä ja säästäisi aikaansa tulevaisuudessa.
Päätin samalla siirtyä uuteen verkkotunnukseen, joten helpoin tapa oli luoda
uusi palvelin ja migratoida käyttäjätili sen sijaan, että vaivautuisin
migratoimaan koko Misskey-instanssia.
Päätin samalla siirtyä uuteen verkkotunnukseen, joten helpoin tapa oli luoda uusi palvelin ja migratoida käyttäjätili sen sijaan, että vaivautuisin migratoimaan koko Misskey-instanssia.
Koska kyseessä oli yhden käyttäjän instanssi, tili oli myös Misskeyn "root"
tili. Misskey ei salli root-tilin siirtämistä, ja jos yrität, saat virheen
"root cannot migrate" tai jotain sinne päin.
Koska kyseessä oli yhden käyttäjän instanssi, tili oli myös Misskeyn "root" tili.
Misskey ei salli root-tilin siirtämistä, ja jos yrität, saat virheen "root cannot migrate" tai jotain sinne päin.
== Ratkaisu
Menin tietokantaan selvittääkseni, mitä voisin tehdä ohittamalla
käyttöliittymän, ja kas, löysin `isRoot`-sarakkeen `user`-taulusta. En
kuitenkaan halunnut jäädä ilman root-tiliä vanhassa instanssissani,
joten menin Misskeyn hallintapaneeliin ja loin uuden tilin, yksinkertaisesti
nimeltään 'root'.
Menin tietokantaan selvittääkseni, mitä voisin tehdä ohittamalla käyttöliittymän, ja kas, löysin `isRoot`-sarakkeen `user`-taulusta.
En kuitenkaan halunnut jäädä ilman root-tiliä vanhassa instanssissani, joten menin Misskeyn hallintapaneeliin ja loin uuden tilin, yksinkertaisesti nimeltään "root".
Misskey näyttää tallentavan kaikki tunnetut käyttäjät `user`-tauluun, ei vain
varsinaisia paikallia käyttäjätilejä. Paikallisten tilien löytämiseksi voit
käyttää seuraavaa kyselyä
Misskey näyttää tallentavan kaikki tunnetut käyttäjät `user`-tauluun, ei vain varsinaisia paikallia käyttäjätilejä.
Paikallisten tilien löytämiseksi voit käyttää seuraavaa kyselyä
[source]
[source,sql]
----
include::code/query_users[]
include::code/query_users.sql[]
----
Nyt voit yksinkertaisesti asettaa uuden root-tilin `isRoot`-sarakkeen arvoksi
`true` ja oman käyttäjätilin arvoksi `false`. Sen jälkeen migraation pitäisi
toimia.
Nyt voit yksinkertaisesti asettaa uuden root-tilin `isRoot`-sarakkeen arvoksi `true` ja oman käyttäjätilin arvoksi `false`.
Sen jälkeen migraation pitäisi toimia.
[source]
[source,sql]
----
include::code/update_users[]
include::code/update_users.sql[]
----
Kannattaa varmistaa, että muutit vain 2 riviä ennen kuin kommitoit
transaktion.
Kannattaa varmistaa, että muutit vain 2 riviä ennen kuin kommitoit transaktion.
Olettaisin, että tämä ratkaisu toimii myös Misskey forkeissa, mutta en ole
testannut.
Olettaisin, että tämä ratkaisu toimii myös Misskey forkeissa, mutta en ole testannut.
Jos tästä postauksesta oli sinulle hyötyä, muista jakaa, twiitata, tuutata ja
piippailla se haluamassasi sosiaalisen median palvelussa. Jos sinulla on
ongelmia tässä prosessissa, voit myös jättää kommentin alapuolella
niin voin yrittää auttaa.
Jos tästä postauksesta oli sinulle hyötyä, muista jakaa, twiitata, tuutata ja piippailla se haluamassasi sosiaalisen median palvelussa.
Jos sinulla on ongelmia tässä prosessissa, voit myös jättää kommentin alapuolelle niin voin yrittää auttaa.