From d75f73dd29a694932aa9b7f55cb16dd97411bc71 Mon Sep 17 00:00:00 2001 From: spider Date: Wed, 10 Mar 2021 00:33:09 -0500 Subject: [PATCH] major rewrite, use markdown and build.sh --- .gitignore | 3 ++ Makefile | 21 -------- build.sh | 37 ++++++++++++++ css/cafe.css | 74 +++++++++++++++++++++++++--- inc/header.html | 2 +- src/code-of-conduct.md | 98 +++++++++++++++++++++++++++++++++++++ src/index.md | 10 ++-- src/template.md | 22 --------- src/wiki/blogs.md | 30 ++++++++++++ src/wiki/email.md | 30 ++++++++++++ src/wiki/faq.md | 51 +++++++++++++++++++ src/wiki/gemini.md | 45 +++++++++++++++++ src/wiki/getting-started.md | 62 +++++++++++++++++++++++ src/wiki/gopher.md.todo | 5 ++ src/wiki/index.md | 1 + src/wiki/irc.md | 29 +++++++++++ src/wiki/website.md | 64 ++++++++++++++++++++++++ 17 files changed, 527 insertions(+), 57 deletions(-) create mode 100644 .gitignore delete mode 100644 Makefile create mode 100755 build.sh create mode 100644 src/code-of-conduct.md delete mode 100644 src/template.md create mode 100644 src/wiki/blogs.md create mode 100644 src/wiki/email.md create mode 100644 src/wiki/faq.md create mode 100644 src/wiki/gemini.md create mode 100644 src/wiki/getting-started.md create mode 100644 src/wiki/gopher.md.todo create mode 100644 src/wiki/index.md create mode 100644 src/wiki/irc.md create mode 100644 src/wiki/website.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d2b7c3e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.html +vendor/ +signup/ diff --git a/Makefile b/Makefile deleted file mode 100644 index 26d224b..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -SRC_MD_FILES != find src -name '*.md' -DST_HTML_FILES := $(SRC_MD_FILES:src/%.md=%.html) - -MARKDOWN != command -v markdown 2> /dev/null - -all: dep-markdown $(DST_HTML_FILES) - -%.html: src/%.md - $(info building $@) - @cat inc/header.html > $@ - @$(MARKDOWN) $< >> $@ - @cat inc/footer.html >> $@ - -clean: - $(info removing generated files) - -rm *.html - -dep-markdown:: -ifndef MARKDOWN - $(error missing dependency 'markdown'. please install and try again) -endif diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..901c5cd --- /dev/null +++ b/build.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +#umask 0113 + +#. in reference to src/ +for path in . ./wiki;do + tmpindex=$(mktemp --suffix '.md') # for generating list of markdown links for index.html + + path="src/$path" + cat "$path/index.md" > $tmpindex + + dir="$(echo $path|cut -d / -f 2-)"; + + find "$path" -maxdepth 1 -name "*.md" -exec sh -c "dir=\"$dir\" tmpindex=\"$tmpindex\""' + filename="$(basename "{}"|rev|cut -d . -f 2-|rev)"; + + if (echo "$dir" | grep "wiki") >/dev/null && (echo "$filename"|grep -v "^index$") >/dev/null;then + echo "- [$filename]($filename.html)" >> $tmpindex + fi + + echo "building dist/$dir/$filename.html"; + mkdir -p "dist/$dir/" && touch "dist/$dir/$filename.html"; + markdown "src/$dir/$filename.md" | + cat inc/header.html - inc/footer.html >"dist/$dir/$filename.html" + ' \; + +done + +echo "creating index page for wiki..." +markdown "$tmpindex" | + cat inc/header.html - inc/footer.html > dist/wiki/index.html + +rm "$tmpindex" + +echo "all done!" + +# rsync (flags to delete if src is deleted) dist/ /var/www/tilde.cafe/ diff --git a/css/cafe.css b/css/cafe.css index 8249e59..2dab592 100644 --- a/css/cafe.css +++ b/css/cafe.css @@ -1,12 +1,12 @@ :root { /* --nc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; */ - --nc-font-sans: Consolas, monaco, 'Ubuntu Mono', 'Liberation Mono', 'Courier New', Courier, monospace; - --nc-font-mono: Consolas, monaco, 'Ubuntu Mono', 'Liberation Mono', 'Courier New', Courier, monospace; + --nc-font-sans: 'IBM Plex Mono', Consolas, monaco, 'Ubuntu Mono', 'Liberation Mono', 'Courier New', Courier, monospace; + --nc-font-mono: 'IBM Plex Mono', Consolas, monaco, 'Ubuntu Mono', 'Liberation Mono', 'Courier New', Courier, monospace; - /* Light theme */ + /* Light theme - old bg: 1d2021 */ --nc-tx-1: #ffffff; - --nc-tx-2: #eeeeee; - --nc-bg-1: #1d2021; + --nc-tx-2: #cccccc; + --nc-bg-1: #1e1e1e; --nc-bg-2: #282828; --nc-bg-3: #32302f; --nc-lk-1: #3291FF; @@ -17,8 +17,8 @@ /* Dark theme */ --nc-d-tx-1: #ffffff; - --nc-d-tx-2: #eeeeee; - --nc-d-bg-1: #1d2021; + --nc-d-tx-2: #cccccc; + --nc-d-bg-1: #1e1e1e; --nc-d-bg-2: #282828; --nc-d-bg-3: #32302f; --nc-d-lk-1: #3291FF; @@ -27,3 +27,63 @@ --nc-d-ac-1: #7928CA; --nc-d-ac-tx: #FFFFFF; } + +a { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +body { + max-width: 820px; + font-size: 1rem; +} + +/* cyrillic-ext */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/ibmplexmono/v6/-F63fjptAgt5VM-kVkqdyU8n1iIq129k.woff2) format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/ibmplexmono/v6/-F63fjptAgt5VM-kVkqdyU8n1isq129k.woff2) format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* vietnamese */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/ibmplexmono/v6/-F63fjptAgt5VM-kVkqdyU8n1iAq129k.woff2) format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/ibmplexmono/v6/-F63fjptAgt5VM-kVkqdyU8n1iEq129k.woff2) format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'IBM Plex Mono'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url(https://fonts.gstatic.com/s/ibmplexmono/v6/-F63fjptAgt5VM-kVkqdyU8n1i8q1w.woff2) format('woff2'); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + diff --git a/inc/header.html b/inc/header.html index e58e309..9afc581 100644 --- a/inc/header.html +++ b/inc/header.html @@ -13,7 +13,7 @@

Welcome to tilde.cafe!

diff --git a/src/code-of-conduct.md b/src/code-of-conduct.md new file mode 100644 index 0000000..ac21510 --- /dev/null +++ b/src/code-of-conduct.md @@ -0,0 +1,98 @@ +# code of conduct + +> **tl;dr** learn by doing and helping. be excellent to each other. have fun! + + + +## expected behavior + +the following behaviors are expected and requested of all community members: + +- participate in an authentic and active way. in doing so, you contribute to the health and longevity of this community. +- exercise consideration and respect in your speech and actions. +- attempt collaboration before conflict. +- refrain from demeaning, discriminatory, or harassing behavior and speech. +- be mindful of your surroundings and of your fellow participants. +- teach when people need help. don't do it for them. + +## unacceptable behavior + +the following behaviors are considered harassment and are unacceptable within our community: + +- violence, threats of violence or violent language directed against another person. +- sexist, racist, homophobic, transphobic, ableist or otherwise discriminatory jokes and language. +- posting or displaying sexually explicit or violent material. +- posting or threatening to post other people's personally identifying information ("doxing"). +- personal insults, particularly those related to gender, sexual orientation, race, religion, or disability. +- unwelcome sexual attention. this includes sexualized comments or jokes. +- deliberate intimidation, stalking or following. + +## consequences of unacceptable behavior + +unacceptable behavior from any community member, including sponsors and those with decision-making authority (sudo), will not be tolerated. + +anyone asked to stop unacceptable behavior is expected to comply immediately. + +if a community member engages in unacceptable behavior, the community organizers may take any action they deem appropriate, up to and including a temporary ban or permanent expulsion from tilde.cafe without warning (meaning your account will be terminated and all user data deleted). + +## reporting guidelines + +if you are subject to or witness unacceptable behavior, or have any other concerns, please contact an admin (see info below). + +additionally, help engaging with law enforcement is available. + +## addressing grievances + +if you feel you have been falsely or unfairly accused of violating this code of conduct, use the contact info below to send a concise description of your grievance. + +## scope + +we expect all tilde.cafe members to abide by this code of conduct while: + +- engaging with other members +- publishing content on tilde.cafe + +## contact info + +tilde.cafe admins: + +you can also send a mail to [sudoers@tilde.cafe](mailto:sudoers@tilde.cafe) to make sure we all get it. + +- [spider](https://tilde.cafe/~spider/): + - [spider@tilde.cafe](mailto:spider@tilde.cafe) + - on irc `/query spider hello` + + + +## license and attribution + +this code of conduct is based on [citizencodeofconduct.org](http://citizencodeofconduct.org) and [tilde.town coc](http://tilde.town/wiki/conduct.html) +under the terms of the [creative commons attribution-sharealike license](http://creativecommons.org/licenses/by-sa/3.0/). + + diff --git a/src/index.md b/src/index.md index c78b468..b6341c3 100644 --- a/src/index.md +++ b/src/index.md @@ -1,9 +1,7 @@ -welcome to tilde.cafe, a shared system where you can explore linux in a friendly, community-driven environment. -host your own website, chat to other users, play a few games, enjoy! +welcome to tilde.cafe, a multi-user system (inspired by [the tildeverse](https://tildeverse.org)) where you can explore linux in a friendly environment. -i always wanted to create a public linux server, then i discovered [the tildeverse](https://tildeverse.org) -it didn't take long before i finally started my own server and here we are :) +host your own files, website, blog, chat to other users, play a few games, etc -i still have a fair bit of work to do, click my name below if you want to check out my todo list! +for more information check out the [faq](/wiki/faq.html) page on our wiki, enjoy! -[~spider](/~spider/) +[~spider](/~spider) diff --git a/src/template.md b/src/template.md deleted file mode 100644 index 3ce158c..0000000 --- a/src/template.md +++ /dev/null @@ -1,22 +0,0 @@ -# heading - -## subheading - -### even deeper - -- dot points -- like this - -we can do *italics* **bold** and ~strikethrough~ - -here's a `bit of code` - -and a whole -```json -{ - "code": "block" -} -``` - ---- -horizontal rule diff --git a/src/wiki/blogs.md b/src/wiki/blogs.md new file mode 100644 index 0000000..d20651a --- /dev/null +++ b/src/wiki/blogs.md @@ -0,0 +1,30 @@ +you can create a blog that is publicly available on the web in your `public_html`. +if you haven't already, check out [the wiki page about editting your site](website.html) first. + +# bashblog + +bashblog is a simple and quick way to create and manage your blogs, it's available system-wide as `bb` + +you can use it to manage your blog, write posts, etc, from anywhere. and your blog will be generated at `~/public_html/blog/`. if you like, you could navigate into it first. + + cd ~/public_html + +now, you can start writing your first post! + + bb post + +it opens the editor in your `$EDITOR` enviroment variable, if you're unsure, set it to `nano` +first: `export EDITOR=nano`. you can put that line in your `~/.bashrc` if you'd like to keep using the +selected editor. + +after you save and close your editor, follow the instructions and check out your live blog on your homepage! + +the process will be the same everytime you're ready to add a new entry. just run `bb post` from anywhere. + + + +# ssgs + +here is the list of static site generators (which can not only be used for blogs but others too) installed on tilde.cafe: + +- markdown diff --git a/src/wiki/email.md b/src/wiki/email.md new file mode 100644 index 0000000..1a5577e --- /dev/null +++ b/src/wiki/email.md @@ -0,0 +1,30 @@ +# email + +your tilde.cafe account comes with a @tilde.cafe email address + +## checking mail + +`neomutt` (and `mutt`) are pre installed and should work out of the box + +you could also use your own client and connect with imap/smtp or pop3: + +- email address: username@tilde.cafe +- username: username (without domain) +- password: your shell password +- imap: imap.tilde.cafe + - tls: port 993 + - starttls: port 143 +- pop3: pop.tilde.cafe port 995 +- smtp: smtp.tilde.cafe + - tls: port 465 + - starttls: 587 + +## forwarding + +if you would like to forward all your mail to a different email address, put the destination email inside `~/.forward` + + echo myemail@example.com > ~/.forward + + diff --git a/src/wiki/faq.md b/src/wiki/faq.md new file mode 100644 index 0000000..2f9da39 --- /dev/null +++ b/src/wiki/faq.md @@ -0,0 +1,51 @@ +# faq + +## what is tilde.cafe? + +tilde.cafe is a multi-user linux server that runs on debian, it was started at the end of 2020. + +it was created in the spirit of the tildeverse. partly to get other people familiar with linux, +partly for ~spider to improve his own linux skills + +once you have an account you can host your own files, website, blog, play games, chat to other people, work on projects together, etc + +you can sign up on the [sign up page](/signup) + + +## what is a tilde? + +a tilde character "~" followed by the username represents the user's "home" in linux. +`~spider` would link to spider's home directory. + +a tilde in the community sense, is a home on the internet :) + + +## what is the tildeverse? + +the tildeverse is a "loose" association of tildes and cool services for tildes. +in other words, it's a collection of public access unix systems (or *pubnixes*) that have been +grouped together to create a bigger community, and they share services between each other. + +you can learn more about the tildeverse on its homepage: [tildeverse.org](https://tildeverse.org). + + +## so i have an account. now what? + +welcome! there's a lot of things you can do here, check out the [getting started guide](getting-started.html). + + +## can i get a package installed? + +probably! send an email to sudoers@tilde.cafe + + +## how do i remove or rename my account? + +send an email to sudoers@tilde.cafe + + diff --git a/src/wiki/gemini.md b/src/wiki/gemini.md new file mode 100644 index 0000000..08961b3 --- /dev/null +++ b/src/wiki/gemini.md @@ -0,0 +1,45 @@ + +# gemini + +the [gemini protocol](https://gemini.circumlunar.space/) ([http proxy](https://portal.mozz.us/)) was created in 2019. + +gemini is a new internet protocol which: + +- is heavier than gopher +- is lighter than the web +- will not replace either +- strives for maximum power to weight ratio +- takes user privacy very seriously + +--- + +the `~/public_gemini` directory is not created by default. use `mkdir ~/public_gemini` to create it, then +you can start adding index.gmi etc, it will be served at gemini://tilde.cafe/~username/. + +for more information about how you write gemtext, check out the +[Introduction to Gemtext Markup](https://gemini.circumlunar.space/docs/gemtext.gmi), +there is also a [cheatsheet](https://gemini.circumlunar.space/docs/cheatsheet.gmi). + +to browse gemini content, you will need a client or a [web proxy](https://portal.mozz.us). + + +## clients + +- [`amfora`](https://github.com/makeworld-the-better-one/amfora) +- and... + + +## CGI + +make sure you set the correct **shebang** and make the file **executable**. + +then, print the status and type per the gemini spec: here's a simple example in sh + + #!/bin/sh + printf "20 text/gemini\r\n" + printf "hello world\n" + +note that the first line **must send `\r\n`** + + +feel free to drop by `#gemini` on [tilde.chat irc](irc.html) if you have questions diff --git a/src/wiki/getting-started.md b/src/wiki/getting-started.md new file mode 100644 index 0000000..d680083 --- /dev/null +++ b/src/wiki/getting-started.md @@ -0,0 +1,62 @@ +# getting started + + _______________________ + < welcome to tilde.cafe > + ----------------------- + \ ^__^ + \ (oo)\_______ + (__)\ )\/\ + ||----w | + || || + + +## logging in + +### windows 10 + +- open cmd or powershell (alternatively a 3rd party program like putty) +- `ssh username@tilde.cafe` +- enter your ssh key passphrase if needed + +if you have windows subsystem for linux (WSL), then open your wsl terminal and follow instructions above. + + +### linux + +- open a terminal +- `ssh username@tilde.cafe` +- enter your ssh key passphrase if needed + + +### mac + +- browse to applications/utilities/terminal and launch terminal (or press cmd+space, start typing terminal, and press return) +- `ssh username@tilde.cafe` +- enter your ssh key passphrase if needed + + +## basic linux commands + +below are some basic commands to get around via ssh. + +- `ls` = list files and folders in the current directory +- `cd` = change directory +- `pwd` = tells you which directory you are in +- `nano` = a command line text editor, similar to notepad + + +## editing your website + +using the commands above we can update our homepage: + +- type `ls` to see what files and folders are in your home directory +- type `cd ~/public_html` to get to your web site's directory +- type `nano index.html` to open your homepage in nano. + +edit the file as you like. when done press `ctrl + x` to quit. +you'll be asked if you want to save, press `y` to confirm. (or `n` to quit without saving) +if it asks you for a filename, press `enter` to confirm. + +now navigate to https://tilde.cafe/~your_username to see the result! + +for more information about your website, check out [the website page](website.html). diff --git a/src/wiki/gopher.md.todo b/src/wiki/gopher.md.todo new file mode 100644 index 0000000..b3849d0 --- /dev/null +++ b/src/wiki/gopher.md.todo @@ -0,0 +1,5 @@ +# gopher + +- public_gopher +- docs link +- clients diff --git a/src/wiki/index.md b/src/wiki/index.md new file mode 100644 index 0000000..0df8760 --- /dev/null +++ b/src/wiki/index.md @@ -0,0 +1 @@ +# current wiki pages diff --git a/src/wiki/irc.md b/src/wiki/irc.md new file mode 100644 index 0000000..a74a95b --- /dev/null +++ b/src/wiki/irc.md @@ -0,0 +1,29 @@ +# IRC + +on tilde.cafe you can hangout and chat on the `#cafe` channel of [tilde.chat](https://tilde.chat) irc. + +[tilde.chat](https://tilde.chat) is an irc network for the tildeverse ([what is the tildeverse?](faq.html)). +it is available publicly at irc.tilde.chat:6697 (with ssl). + + +## how to connect + +- the `chat` command automatically connects you to tilde.chat with `weechat` and joins the channels #meta and #cafe. +- `irssi` + +--- + +see the [tilde.chat wiki](https://tilde.chat/wiki) for info on bots and other specifics. + + diff --git a/src/wiki/website.md b/src/wiki/website.md new file mode 100644 index 0000000..2f7a8d0 --- /dev/null +++ b/src/wiki/website.md @@ -0,0 +1,64 @@ +# website + +your `~/public_html` directory is served at: + +- tilde.cafe/~username/ +- username.tilde.cafe +- tilde.cafe/u/username/ + + +## dynamic options + +static content are served normally, but there are also some dynamic options: + +- php: `.php` extension +- python: `.py` extension +- lua: `.lua` extension +- shell: `.sh` or `.cgi` extension +- cgi scripts: name it whatever you want and place the executable file in `cgi-bin/` + + + +make sure the scripts have the correct shebang, is set as executable +and prints the content type header first. + + +### examples + +**sh:** + + #!/usr/bin/sh + printf "Content-type:text/plain\r\n\r\n" + echo "hello!!!" + +**python:** + +(you can of course write html in your cgi script too) + + #!/usr/bin/env python3 + print("Content-type:text/html\r\n\r\n") + print("

this is a header

") + + + + +**php:** + + + + + + +

here's a header

+ + + + +--- + +you can use your `public_html` to write a blog! check out the [blogs](blogs.html) page for more info. + +