<link rel="self" type="application/atom+xml" hreflang="" href="gemini://benjaminja.com/tags/gemini/feed.xml" />
<link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/tags/gemini/" /><id>/</id>
2024-06-09T22:42:13Z
Hugo 0.129.0
<title><![CDATA[Planning Gemini Hosting Service]]></title>
<link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2024/06/09-plan-gemini-host/" />
<id>gemini://benjaminja.com/log/2024/06/09-plan-gemini-host/</id>
<updated>2024-06-09T22:42:13Z</updated>
<summary type="gemini"><![CDATA[I have an idea for a project that I’m pretty excited about and I think it could be very helpful to the gemini community. I’ve started building it, but I realized that I should get peoples opinions before I go any further.
]]><![CDATA[I have an idea for a project that I’m pretty excited about and I think it could be very helpful to the gemini community. I’ve started building it, but I realized that I should get peoples opinions before I go any further. I would love to hear from you, whether that be through a post response, or a direct message.
Even though gemini is a very simple protocol and can be created with ease, you still need some technical expertise to set up a server. There are of course groups which allow you to have your own capsule directory such as [gemlog.blue], [bbs.geminispace.org]. [Or you could join a pubnix.]
=> gemlog.blue | bbs.geminispace.org | Or you could join a pubnix.
These are all great alternatives to having your own domain, but I haven’t seen any service that would provide simple hosting for your own domain. My project is to provide gemini hosting without needing to know all the technical things about hosting.
There will be two ways to manage your website. One way will be through the https portal which runs with htmx and fails safely if js is disabled. You will also be able to manage your capsule through gemini/titan.
I really want this to be a robust system, so I am building it in the cloud with AWS. Since AWS doesn’t know what gemini is, I will have to be using one of their EC2 VPS to host the gemini side of things. I’ve thought about going serverless for the web server, but that really does just over complicate everything; especially when I’m trying make a service that is server-side rendered. So instead, everything will live on the EC2 instance.
I’ve done some estimations about how much it will cost me to host this server, and it seems that right now, it will cost about $14/month. I think there are some cost saving measures that can be done to reduce cost of this. I’m using a t4g.nano instance which should cost $3/month. Most of the costs seem to be coming from the VPC at around $10/month with $3 for a public IP and $7 for endpoints to S3, and DynamoDb. There might be ways to reduce the cost of the VPC, but I don’t really know what would be needed to do.
One of the more controversial things that I expect to come from this service is pricing. I don’t want to make a profit on this project, but I also don’t want to be losing money. I feel like I could charge $1/month to host a gemini server for anyone, and scale up the service horizontally to provide lower latencies across countries as more people join. There are a few problems that I immediately see with charging people for hosting.
¹ I’m realizing that this not possible because of how complex regulations are around credit card transactions.
I could also run the service off of donations. I think this would be the preferable option, however it does not scale well. I can’t imagine there would be enough donations to keep everything running when there are a million users (There will never be that many people or I’ll eat my hat).
Maybe there could be a compromise where everyone owes $1/month, but donations get distributed randomly between users Twitch Gift Sub style. Or donations could go directly to specific people. If there are enough donations to cover the costs of the servers, then it would be free for everyone.
I am interested to know how people feel about the idea of this service. Is it something you would want to use if you didn’t already have a place to host your capsule? Are you interested in it enough to transition from your existing service? Does the idea of paying for a gemini capsule sound bad? Do you have a suggestion for how this could be done?
I’ve mostly just put down my thoughts as they’ve come to me. So I hope that my thoughts aren’t too sporadic. I really want gemini to be more accessible to creators and I would like to know what people really want before I go further into the project than I already am.
=> 📭 Message me | 📝Or mention this post
]]>
<category term="gemini" label="Gemini" scheme="gemini://benjaminja.com/tags/gemini/" />
<category term="projects" label="Projects" scheme="gemini://benjaminja.com/tags/projects/" />
<category term="geminauts" label="Geminauts" scheme="gemini://benjaminja.com/tags/geminauts/" />
<published>2024-06-09T22:42:13Z</published></entry>
<title><![CDATA[Simple Site Generator]]></title>
<link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2023/09/03-simple_site_gen/" />
<id>gemini://benjaminja.com/log/2023/09/03-simple_site_gen/</id>
<updated>2023-09-03T08:06:00Z</updated>
<summary type="gemini"><![CDATA[It’s been a while since I last posted. I have been busy working on my weatherstation. I’ll need to write about that soon, but for now I want to talk about the state of my capsule.
]]><![CDATA[It’s been a while since I last posted. I have been busy working on my weatherstation. I’ll need to write about that soon, but for now I want to talk about the state of my capsule.
During my breaks from the weatherstation, I have been working on my own site generator. I have finally got it to the point where I can start using it in production. There’s definitely a lot of work left to be done before I can publish it for others to use.
I have been calling it simple-site
for now, though I’ll probably think of a better name when I actually release it. I have designed the generator to be as simple possible while allowing for complexity to come if desired.
The design starts out with templating. I designed my own simple templating engine that I found works surprisingly well. Each document will be rendered and passed to a chain of configured templates. To get added functionality, scripts can be created which will behave like functions in the templating engine. If you need more control, then generator scripts can be used to make alterations to the structure of the site.
Since I have migrated my capsule over to the new system, I have most likely missed a few things.
Here is a pretty simple example of what my generator does. Hopefully it can help visualize what’s going on.
+- content | +- index.gmi | +- my-image.jpg +- templates | +- base.gmi +- site.toml
$ simple-site site.toml Rendering "index.gmi" with template "base.gmi"Copying "my-image.jpg"
=> Rewriting my Site Generator
=> 📭 Message me | 📝Or mention this post
]]>
<category term="projects" label="Projects" scheme="gemini://benjaminja.com/tags/projects/" />
<category term="capsule" label="Capsule" scheme="gemini://benjaminja.com/tags/capsule/" />
<category term="gemini" label="Gemini" scheme="gemini://benjaminja.com/tags/gemini/" />
<published>2023-09-03T08:06:00Z</published></entry>
<title><![CDATA[How I deploy to my server]]></title>
<link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2023/02/13-how_i_deploy/" />
<id>gemini://benjaminja.com/log/2023/02/13-how_i_deploy/</id>
<updated>2023-02-14T17:25:00Z</updated>
<summary type="gemini"><![CDATA[I don’t run this capsule on a server that I physically own. I rent out my server from digitalocean. Since my server doesn’t need to have lots of computing power or memory, I have opted to use the cheapest server possible that pennies can buy.
]]><![CDATA[I don’t run this capsule on a server that I physically own. I rent out my server from digitalocean. Since my server doesn’t need to have lots of computing power or memory, I have opted to use the cheapest server possible that pennies can buy. The only problem is that the server is so underpowered: it is nearly impossible to install software from source. In this log, I will explain how I go about deploying software to my server.
I’ve deployed my server as a droplet using a single shared CPU with 512 MB of memory. Because of these low specs, I have decided that all of my server/CGI software will run on native binaries to make using my capsule as smooth as possible.
The main server software that I use is made with Rust; a language known for its long and intensive compilations. I tried building it on my server and it took around 10 minutes before the build crashed from a lack of available memory. I would probably be better off cross compiling from my computer and uploading the binary than trying to find some workaround.
Compiling software for the server can vary widely from language to language, but it is almost always the same to upload your built binary to the server. The way I do it is by having a deploy.sh
script in the root of a project that will build, upload, and install the software on the server.
BINARY=path/to/binary REMOTE=root@my_server BINAME="$(basename "$BINARY")"BINDIR=/usr/local/bin TMPDIR=/var/tmp # TODO Buildscp "$BINARY""$REMOTE:$TMPDIR/"ssh "$REMOTE""cd $TMPDIR && install -Dm755 ./$BINAME$BINDIR/$BINAME && rm ./$BINAME"
Of course depending on the type of software I’m deploying, the script may need to change to fit the project’s needs. I feel that it would be simpler to just scp the binary directly into the installed destination rather than installing it with a separate command, but I kind of like it.
Rust has become my goto language when it comes to compiled software. It supports a lot of language features that I like. It can feel like a high-level language while still allowing for low level control. My problem with Rust is with how difficult it is to cross compile. In theory, it is very easy to cross compile Rust, but when external libraries are used: the process becomes infinitely more complicated.
You will first need to install a target for your toolchain (This is fairly easy). If the program doesn’t use any external libraries, you should be good to go. Otherwise, you will need to install a C cross compiling toolchain (This can be tricky depending on your host system) and tell rust the linker you will be using in .cargo/config.toml
. If your build still fails, a library might be compiling C from source, so you will need to tell rust that any C code should be built using your cross compiling toolchain in an environment variable. If you still can’t cross compile the software, then get ready for a never ending rabbit hole.
There is a tool that will help you do cross compiling that I wish I had known about before I spent a week learning how to do it manually. It is called “Cross”, and allows you to do cross compilations with very little hassle.
=> Cross
You will need to have Docker installed for Cross to work, but I think I have read that it might be possible to configure Cross to use Zig as a linker/compiler instead of building inside a Docker container.
Building with Cross is usually as simple as replacing cargo
with cross
. Depending on your needs, you may need to create a Cross.toml
to customize your build, but that is still simpler than doing it manually.
TARGET=x86_64-unknown-linux-gnu BINAME=BINARY=target/release/$TARGET/$BINAME cross build --release --target $TARGET
In comparison to Rust, Go is a walk in the park. All that is needed to cross compile Go is two environment variables: GOOS
and GOARCH
. I don’t know if there are any edge cases that might show up when building. I really should learn Go.
BINAME=BINARY=$BINAME GOOS=linux GOARCH=amd64 go build
I haven’t needed to do anything else for Go to work, but I also don’t know the language. If it were possible to use external libraries, then I would imagine that cross compilation could get more complicated, but I just don’t know enough about the language to know if that’s even possible.
This isn’t a language, but I figure it’s worth mentioning. When I deploy my capsule, I upload the project up to the server and then render it. This allows for semi-dynamic content that is stored exclusively on the server to be rendered into the capsule. The way I go about deploying the capsule is a little bit funky, but it works and that’s all that matters.
DIR="$(dirname -- "${BASH_SOURCE[0]}")"SERVER='gemini@my_server'DEST='/path/to/capsule/data/'SOURCE="$DIR/."GEMINI="/var/www/gemini/my.site/"COMMAND="${1:-upload}"# Upload to the serverif["$COMMAND"="upload"]; then# Synchronize the project with the server rsync -rltp --delete-after -z --exclude='./git' --filter=':- .gitignore' -h "$SOURCE""$SERVER:$DEST" echo "Uploaded capsule"# Run the build section of the deploy script on the server ssh -t "$SERVER""cd $DEST ; ./deploy.sh build"elif["$COMMAND"="build"]; then# Render the capsule cd "$DIR" kiln build RES=$? if[ $RES -ne 0]; then exit $RES fi# Copy the rendered files into the server folder rsync -r "${DEST}public/""$GEMINI" RES=$? if[ $RES -ne 0]; then exit $RES fielse echo "Invalid Command, should be one of [upload, build]"fi
I haven’t yet had the chance to deploy any other types of software, but I can imagine that some will be easier than others. Zig should be pretty simple, but C/C++ scares me. The thought of having to find or build libraries does not seem at all fun. Though C/C++ should still be easier than Rust.
=> 📭 Message me | 📝Or mention this post
]]>
<category term="projects" label="Projects" scheme="gemini://benjaminja.com/tags/projects/" />
<category term="capsule" label="Capsule" scheme="gemini://benjaminja.com/tags/capsule/" />
<category term="gemini" label="Gemini" scheme="gemini://benjaminja.com/tags/gemini/" />
<published>2023-02-14T17:25:00Z</published></entry>
<title><![CDATA[My Capsule Plans]]></title>
<link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2023/02/10-capsule_plans/" />
<id>gemini://benjaminja.com/log/2023/02/10-capsule_plans/</id>
<updated>2023-02-10T19:20:00Z</updated>
<summary type="gemini"><![CDATA[I have been getting fairly ambitious with ideas for my capsule. This is dangerous with me being in the middle of a heavy semester, so I am going to write down my plans and implement them later.
]]><![CDATA[I have been getting fairly ambitious with ideas for my capsule. This is dangerous with me being in the middle of a heavy semester, so I am going to write down my plans and implement them later. Hopefully I don’t end up working on these projects to avoid my schoolwork (I am writing this very log to distract myself from a project I need to do 🙃).
At the moment, I am serving my capsule on the www under a proxy. This has been good, but I would like to have more control of how it looks. To do this, I want to serve my capsule natively on both gemini and https protocols.
I want the feel of the web version to be simple, but feel like it was meant for the web. Primarily so that I can have a navigation section and inline images.
If I were to do this, I might need to write most of my content in markdown so that I can convert it into http/gemtext without much fuss.
Seeing some of the implementations of gemini mentions has been really good. Notably Sean’s implementation where mentions to a post are placed at the bottom of the page under ‘Discussions about this entry’. I particularly like how it feels like I’m going through a big discussion thread without the need of looking through an aggregator.
=> Thoughts on an implementation of Gemini mentions (The post where I first saw mentions being used)
I want to have a feature like this myself, but I also don’t want to do any of it by hand. The idea would be to have a gemmention CGI script that adds mentioned pages to a database, then ask the site generator to rebuild the capsule (Any mentions would be placed in a footing after the article).
I’ve already written a CGI program that can upload mentions to a database, but I have yet to figure out how to insert mentions into posts. I would like to make the program portable so that anyone who would like to have similar functionality could do it themselves. The only problem is that the software I wrote is too complicated to publish without a lot of simplifications.
On most of my pages, I have added a little topics section at the top of the page. I want to have a section of my capsule where you can sort by similar topics.
I would have tags stored in the frontmatter and my site generator could generate pages for each topic. Also the title, date, and tags could be automatically inserted into the generated gemini files so I don’t have to repeat myself too much.
An example of the frontmatter might be like:
--- title: My Capsule Plans date: 2023-02-10T12:20:00-07:00 tags: - plans - capsule author: ttocsneb --- I have been getting fairly ambitious with ideas for my capsule...
=> Kiln
I am currently using Kiln to build my capsule. It has been great so far, but there are a few features that confuse me. I think that most of my problems lie in the fact that I am not familier with the Go templating engine.
I know that I can use kiln to build an alternative http format, but I’m not sure whether it will be able to do what I want with gemmentions and topics. I think it should be possible using the templating engine, but I will need to do research to verify. If I end up not being able to do these things, then I might design my own site generator inspired by Kiln, maybe something with python and jinja2.
=> 📭 Message me | 📝Or mention this post
]]>
<category term="plans" label="Plans" scheme="gemini://benjaminja.com/tags/plans/" />
<category term="capsule" label="Capsule" scheme="gemini://benjaminja.com/tags/capsule/" />
<category term="gemini" label="Gemini" scheme="gemini://benjaminja.com/tags/gemini/" />
<published>2023-02-10T19:20:00Z</published></entry>
<title><![CDATA[Trying out my own gemlog]]></title>
<link rel="alternate" type="text/gemini" hreflang="" href="gemini://benjaminja.com/log/2023/01/06-trying_out_gemlog/" />
<id>gemini://benjaminja.com/log/2023/01/06-trying_out_gemlog/</id>
<updated>2023-01-06T18:59:00Z</updated>
<summary type="gemini"><![CDATA[I am by no means a writer. I may have grown up a native english speaker, but my words don’t reflect that. I have always gotten a C or worse in my english classes, and writing essays has always been an arduous task for me.
]]><![CDATA[I am by no means a writer. I may have grown up a native english speaker, but my words don’t reflect that. I have always gotten a C or worse in my english classes, and writing essays has always been an arduous task for me. Despite this, I want to write gemlogs. I can’t yet articulate why I want to write a blog of sorts, but I think it has something to do with wanting to be a part of the gemispace community.
I’ve lurked around here for almost 2 years now. I learned about gemini in late 2020 from some random tech youtuber who gave a review for gemini as a replacement to the web. At the time, I was taking a systems programming class where we learned about the kernel and how to interact with it. Our final project was to create an http/1.0 proxy in c. I wished that I could have instead created a gemini proxy instead. After the class, I tried creating my own gemini server. I ended up giving up on it due to scope creep.
I’ve really enjoyed discovering all the stuff that people have made here. Station is very cool. I’ve only just recently discovered antenna which has gotten me to go through so many rabbit holes. I feel like it’s about time for me to become a part of this community and write about my experiences.
Despite this, I am quite scared of posting my writing. I am worried about what people might think of me–that I’m not good enough, people won’t care for what I have to say or possibly worse, people will care about what I have to say. People might start to have expectations of me that I would not be able to provide. Having eyes on me is scary. People will judge me (good or bad) and there is nothing that I can do about it.
While I am worried about creating a gemlog, I think it will be good for me. I shouldn’t be scared. My writing is probably not as bad as I think it is and if it is, the quality should improve with time. I hope you will enjoy what I have to offer, and more importantly I hope I won’t abandon my gemlog when the going gets tough.
=> 📭 Message me | 📝Or mention this post
]]>
<category term="writing" label="Writing" scheme="gemini://benjaminja.com/tags/writing/" />
<category term="gemini" label="Gemini" scheme="gemini://benjaminja.com/tags/gemini/" />
<published>2023-01-06T18:59:00Z</published></entry>
text/xml
This content has been proxied by September (ba2dc).