major rewrite, use markdown and build.sh

This commit is contained in:
spider 2021-03-10 00:33:09 -05:00 committed by www-data
parent 12762f5ab9
commit d75f73dd29
17 changed files with 527 additions and 57 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.html
vendor/
signup/

View File

@ -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

37
build.sh Executable file
View File

@ -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/

View File

@ -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;
}

View File

@ -13,7 +13,7 @@
<p>Welcome to tilde.cafe!</p>
<nav>
<a href="/">home</a>
<a href="#">wiki</a>
<a href="/wiki">wiki</a>
<a href="/signup">signup</a>
</nav>
</header>

98
src/code-of-conduct.md Normal file
View File

@ -0,0 +1,98 @@
# code of conduct
> **tl;dr** learn by doing and helping. be excellent to each other. have fun!
<!--
## purpose
a primary goal of tilde.cafe is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. as such, we are committed to providing a friendly, safe and welcoming environment for all.
this code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.
we invite all those who participate in tilde.cafe to help us create safe and positive experiences for everyone.
## tilde.cafe mission
[full goals/roadmap document](https://tilde.cafe/wiki/goals-roadmap)
**tilde.cafe exists to foster an engaged community for socializing, learning, and making cool stuff**
in a mass-media age, it is up to small, intentional communities to gather and work together to provide a space outside of the advertising-laden, profit-seeking, corporate-owned world of social media.
to that end, tilde.cafe strives to be a radically inclusive community where people of all backgrounds and all technological experience levels can come together to learn, to teach, and to delight in one another's creations.
-->
## 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`
<!--
- [jan6](https://tilde.cafe/~jan6/):
- [jan6@tilde.cafe](mailto:jan6@tilde.cafe)
- on irc `/query jan6 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/).
<!--
## 11. terms of service</h2>
please also see the [terms of service](tos)
-->

View File

@ -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)

View File

@ -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

30
src/wiki/blogs.md Normal file
View File

@ -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.
<!-- TODO: .config, css, rss, gemini -->
# 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

30
src/wiki/email.md Normal file
View File

@ -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
<!--
## sieve - TODO
-->

51
src/wiki/faq.md Normal file
View File

@ -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
<!--
todo
- can i password login
(ssh? how to create certificates?)
-->

45
src/wiki/gemini.md Normal file
View File

@ -0,0 +1,45 @@
<!-- this wiki page seems done -->
# 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

View File

@ -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).

5
src/wiki/gopher.md.todo Normal file
View File

@ -0,0 +1,5 @@
# gopher
- public_gopher
- docs link
- clients

1
src/wiki/index.md Normal file
View File

@ -0,0 +1 @@
# current wiki pages

29
src/wiki/irc.md Normal file
View File

@ -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.
<!--
todo
- clients
- cli
- irssi
- weechat
- gui
- hexchat
- web
- kiwi
-->

64
src/wiki/website.md Normal file
View File

@ -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/`
<!-- TODO: add chmod in getting-started? -->
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("<h1>this is a header</h1>")
<!--
**lua:**
TODO: seems lua has both cgi and also this thing called Lua Page?
-->
**php:**
<!-- TODO: better example maybe? -->
<!DOCTYPE html>
<html>
<body>
<h1>here's a header</h1>
<?php echo "this will be shown"; ?>
</body>
</html>
---
you can use your `public_html` to write a blog! check out the [blogs](blogs.html) page for more info.
<!-- TODO: custom domains? -->