Compare commits

...

30 Commits

Author SHA1 Message Date
Blade of Darkness 527916b078 Add Backup wiki page 2021-09-24 23:53:39 +02:00
southerntofu 51620f7d22 Allow dots in requested page name 2021-03-21 10:46:35 +01:00
southerntofu 290b0dcf39 Add path debugging print statements in comment 2021-03-21 10:46:18 +01:00
southerntofu 42a438fc52 Make codeblocks responsive and don't hardcode baseURL 2021-03-20 19:15:04 +01:00
Blade of Darkness 8d5275e3a4 could return 403 instead 2021-03-20 18:53:06 +01:00
southerntofu 549e014daa Don't output anything only 403 on fishy request 2021-03-20 18:33:58 +01:00
southerntofu 6d6093990d Minimal README with nginx example config 2021-03-20 18:31:16 +01:00
southerntofu 79b32dda8e You can't escape the webroot 2021-03-20 17:53:54 +01:00
southerntofu 708dc5a3f1 Handle 404 gracefully 2021-03-20 17:43:07 +01:00
southerntofu 3c0a380ce3 Remove hardcoded paths to local files 2021-03-20 17:36:39 +01:00
Blade of Darkness abf209326c Avoid indefined variable warning 2021-01-12 14:27:16 +01:00
Blade of Darkness 2503482ae2 Avoid warning undefined variable 2021-01-12 14:05:31 +01:00
Blade of Darkness 68aded8aef Add ssh clients, split OpenSSH specific info and add url for PuTTY 2021-01-12 13:48:41 +01:00
Blade of Darkness 26cab9a719 Fix: broken url 2020-11-26 03:11:43 +01:00
Ubergeek 9937cb3ca5 Updated spec for ip_info 2020-01-24 21:26:21 -05:00
Ubergeek 82e100abf7 Updated API doc 2020-01-23 09:12:03 -05:00
Ubergeek 888ab902c6 Keep api in sync 2020-01-22 13:34:36 -05:00
Ubergeek 387af5a51f Adding new API call 2020-01-22 11:22:56 -05:00
Ubergeek ac0749c01b Beginning spec for thunix API 2020-01-21 08:20:55 -05:00
Blade of Darkness 9a39cc2c5f added: How to generate an SSH Public key on Android smartphone 2019-11-27 00:20:14 +00:00
Ubergeek a1911c60a2 Updated some formatting on the mail page 2019-09-17 14:18:24 +00:00
Ubergeek 38f25baa37 Updated email page 2019-09-17 14:17:48 +00:00
ubergeek 9bf0c92e4f Merge branch 'getmail' of lugubris/wiki into master 2019-09-17 07:33:41 -04:00
Lugubris ddb798556b
wiki/unsorted/lugubris/getmail: New page, wiki/email: Update
wiki/email: Mention POP is also supported on thunix.net
2019-09-17 10:33:22 +00:00
dovahkin f5bf210eb8 Started definitions of what "git" is, and continuing on with contrib section. 2019-09-05 21:34:13 -04:00
Ubergeek 0b11fcaaef Updating toc 2019-08-05 18:37:04 +00:00
Ubergeek 7040920fd6 Adding git.md 2019-07-26 14:15:01 +00:00
Ubergeek 759213c4c6 Merge branch 'master' of ttm.sh:thunix/wiki 2019-07-16 13:18:14 +00:00
Ubergeek 974d7038c7 Some article cleanup 2019-07-16 13:18:04 +00:00
ubergeek 5e6f43a783 Merge branch 'master' of fosslinux/wiki into master 2019-07-16 05:11:58 -04:00
17 changed files with 318 additions and 37 deletions

View File

@ -2,4 +2,4 @@
RewriteRule ^$ main [QSA]
RewriteRule ^index\.php$ wiki.php?page=main [QSA]
RewriteCond %{REQUEST_URI} !(/includes/|/media)
RewriteRule ^([A-Za-z0-9\/]+)/?$ wiki.php?page=$1 [QSA]
RewriteRule ^([A-Za-z0-9\.\/]+)/?$ wiki.php?page=$1 [QSA]

26
README.md Normal file
View File

@ -0,0 +1,26 @@
# thunix wiki
Requires a webserver and PHP. The web server needs to be configured to:
- serve wiki.php by default (not index.php)
- when a requested URL does not correspond to an actual file, pass the requested page to wiki.php?page=
On apache, this is achieved by provided [.htaccess](.htaccess). On nginx, you can do something like:
```
server {
listen 80;
root /var/www/wiki_webroot;
index wiki.php;
server_name _;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
location ~ ^/(.+)$ {
try_files $uri $uri/ /wiki.php?page=$1;
}
}
```

View File

@ -1,7 +1,7 @@
# Table of Contents
- Chapter 1 - Thunix and You.
1. What the fuck is Thunix?
1. What is Thunix?
- History of Thunix
2. Staff Bios
3. Thunix Rules and Policies
@ -10,7 +10,7 @@
6. [Contributions Directory](/wiki/Thunix/contribdir)
7. [System-Generated Pages](/wiki/system/main)
- Chapter 2 - SSH Shit.
- Chapter 2 - SSH Tips and Tricks
1. To Be Linked. (WIP)
- Chapter 3 - Contributing

88
articles/wiki/api.md Normal file
View File

@ -0,0 +1,88 @@
# Thunix API
This is the working spec for the Thunix API. Until finalization, the spec will be consider v1. v1 of the API shall be considered unstable, and a work in progress.
The API will be authenticated, at all times, using the user's credentials sent in the host headers.
The API shall return a 200 for successful requests, with the JSON paylod.
The API shall return a 400 for any endpoint not existent.
The API shall return a 401 for unauthenticated requests.
The API shall return a 403 for requests which are authenticated, but not permissible for the authenticated user.
The API shall return a 418 for requests to the "/teapot" endpoint.
The API shall return a 420 for requests exceeding the rate limits.
The API shall return a 501 for requests which exist in the spec, but have not been implemented yet.
## API Format
The API is a RESTful API, and the following URIs will be used:
```
https://{hostname}/api/1/{action}
```
## Informational APIs
### ip_info
This endpoint shall return a JSON payload containing interfaces, with the name, address, and netmask:
```
{
"Interfaces":[
{
"Interface":"lo",
"Address":"127.0.0.1",
"Netmask":"255.0.0.0"
},
{
"Interface":"eth0",
"Address":"213.239.234.117",
"Netmask":"255.255.255.255"
},
{
"Interface":"client1",
"Address":"10.0.1.1",
"Netmask":"255.255.255.0"
},
{
"Interface":"wg-p2p",
"Address":"10.0.0.5",
"Netmask":"255.255.255.0"
}
]
}
```
### uptime
This will return a JSON payload of system uptime:
```
{
"days":164,
"hours":16,
"mins":22,
"secs":3
}
```
### teapot
This shall return a JSON payload, describing the current tea making capabilities of the system:
```
{
"tea" : "available",
"height" : "short",
"width" : "stout
}
```

View File

@ -33,7 +33,7 @@ With every push to this wiki, is one less thing that the SysAdmins have to expla
At this point, I am rambling... You get the point? Contributing is an effective means to help where one cannot by other means.
### Cool story bro, now how the fuck is that relevant to outside of Thunix?
### Cool story bro, now how is that relevant to outside of Thunix?
      The point was this; No matter how big or small a contribution might be, it has the potential to really affect the entire ecosystem.

View File

@ -8,7 +8,8 @@ Your email can be accessed in one of three ways:
1. Running the Mutt or Alpine email clients through your SSH account
2. Logging into your email account from our [Rainloop web mail](https://www.thunix.net/webmail/) service
3. Through an email client program installed on your computer, using IMAP
3. Through an email client program installed on your computer, using IMAP or POP
4. Some other tool, such as [getmail](/wiki/unsorted/lugubris/getmail)
Unlike the email services provided by Microsoft, Yahoo, Google and other providers, who intrusively spy on its users beyond reasonable law enforcement and advertising tactics, thunix email services will always respect user privacy, as you can see through our [GDPR Statement and Privacy Policy](https://www.thunix.net/gdpr).
@ -30,4 +31,4 @@ Thunix uses the Rainloop web interface to give users email access through their
You can also access thunix email using your favourite client software, including but not limited to Mozilla Thunderbird, Microsoft Office Outlook, Claws Mail or any email client that supports IMAP. The below picture illustrates the settings needed to configure your email client to fetch mail from thunix. Though it shows Thunderbird's configuration menu, this applies to all email client programs.
![Email settings in a Thunderbird dialog](https://www.thunix.net/images/mail.png)
![Email settings in a Thunderbird dialog](https://www.thunix.net/media/mail.png)

72
articles/wiki/git.md Normal file
View File

@ -0,0 +1,72 @@
**This document is unfinished, and in draft state**
# Git Crash Course
Git can take some getting used to, but once you've mastered a few of the operations, it really begins to make sense.
## Common Workflow
A common workflow goes like this:
1. Clone Repo
2. Create a *feature branch*
3. Switch to your feature branch
4. Make changes
5. Ask for a merge/merge into master
6. Push to your origin
### Clone Repo
To clone a repo, you use the git clone command, ie
```
git clone https://tildegit.org/thunix/ansible
```
This makes a local copy of the code repo. Whatever changes you make here, nobody else sees what you did, until you *commit* and then *push*.
### Create Feature Branch
You usually don't want to work right on the *master* branch, until you're ready to push the code live. So, to make a new feature branch, try this:
```
git branch -v
```
This will show you what branches you currently have. You probably only have one right now: *master*. Let's make a new one:
```
git checkout -b UpdatingKey
```
Now do look at your branches again:
```
git branch -v
```
You'll see you know have *master* and *UpdatingKey*. You'll see there's an asterisk next to *UpdatingKey*. This means that is the branch you're currently working on.
### Make Changes
Let's make some changes in your new feature branch.
```
touch mykey.asc
git status
```
You'll see there is a file *mykey.asc* which says it's not currently tracked. Let's add the file:
```
git add mykey.asc
git status
```
You should see there's a new file to commit. Let's do that:
```
git commit -am 'Adding my key'
```

View File

@ -6,13 +6,17 @@ When you [sign up](https://www.thunix.net/signup) for an account on thunix, you'
On our signup page, you'll seen an entry for a "Public SSH Key." SSH key pairs work on the basis of having two files; one is a public key that you can send to us when we create your account, while the other is a private key that you keep on your computer, away from public knowledge. If you're wondering where to find these things, you have to generate them yourself.
Generating SSH key pairs requires software that also allows you to connect to a shell server using SSH (such as OpenSSH or PuTTY). On Windows and UNIX-like operating systems with OpenSSH Client software installed, including all Linux variants, BSD variants and macOS, the terminal command:
Generating SSH key pairs requires software that also allows you to connect to a shell server using SSH (such as OpenSSH, ConnectBot, Termius, OpenSSH-Win32/64 or PuTTY).
With [OpenSSH](http://www.openssh.com/) Client software installed on Windows and UNIX-like operating systems, including all Linux variants, BSD variants and macOS, the terminal command:
`ssh-keygen`
Will generate both the public and private SSH key files for you. You would be prompted for a file name to save the key files as, then a passphrase to help generate the files from. Then, out of the two files, open the public key file (the file with the file suffix \*.pub) in your favourite text editor, copy all its text and paste it in the Public SSH Key section of our signup page when submitting your registration form.
PuTTY handles key generation differently, as the PuTTYGen program is graphical. However, the interface makes key generation very self-explanatory (it simply involves moving your mouse cursor around your screen). The resulting key files can be saved and, as with the public key file saved by OpenSSH's shh-keygen program, open your new public key file in your favourite text editor, copy all its text and paste it in the Public SSH Key section of our signup page when submitting your registration form.
[PuTTY](https://www.putty.org/) handles key generation differently, as the PuTTYGen program is graphical. However, the interface makes key generation very self-explanatory (it simply involves moving your mouse cursor around your screen). The resulting key files can be saved and, as with the public key file saved by OpenSSH's shh-keygen program, open your new public key file in your favourite text editor, copy all its text and paste it in the Public SSH Key section of our signup page when submitting your registration form.
[ConnectBot](https://f-droid.org/en/packages/org.connectbot/) is the SSH client available for Android smartphone. You can generate an type rsa 2048 bits and copy this public key, in the "Manage Public Keys" menu.
## Logging into Thunix through SSH

View File

@ -0,0 +1,22 @@
backup(1) Thunix backup backup(1)
NAME backup - creating data backup script
SYNOPSIS backup
DESCRIPTION Thunix uses a daily cron job that runs /usr/local/bin/backup
script to store tar gzip compressed files located on local disk in BACKUP
Cycle: full weekly and incrementals daily.
Incremental backup restore process:
First extract files from the full backup.
Then extract files in the correct order from each incremental backup.
BUGS No known bugs.
SEE ALSO tar(1), gzip(1), crontab(1), find(1), mysqldump(1)
AUTHOR Thunix Corporation (http://thunix.net)
11.0 24 September 2021 backup(1)

View File

@ -3,7 +3,8 @@
These documents are autogenerated from our man pages, and various readmes used here on thunix.
* [ansible](/wiki/system/ansible)
* [backup](/wiki/system/backup)
* [chat](/wiki/system/chat)
* [iris](/wiki/system/iris)
* [thunix](/wiki/system/thunix)
* [tildegit.org](/wiki/system/tildegit.org)
* [iris](/wiki/system/iris)

View File

@ -1 +1,18 @@
# WIP
# What is Git?
### Definitions:
       [Git Definition, explained by git itself.](https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F)
       [In a broader sense:](https://aws.amazon.com/devops/source-control/)
### Definition in summary
      Basically, the point of Git/SCM's is to keep track of changes to any file, project, or workspace in an enviroment offsite where you can view, manage, revert, and effectively maintain said items.
Example. Say you wanted to make a simple website from scratch. Git would allow you to take every change, or a group of changes, and make these into updates; called commits. These commits store data of everything inside the repository(a fancy word for workspace/project) from the start, allowing you to watch how a project grows. This record allows you to keep backups of your project, in case you lose it locally. It even allows you to undo changes in the event a new change causes issues.
Honestly, you could go on and **on** and ***on*** about how git can enhance the way you work on projects. Where it REALLY shines though is when you group together with other individuals and work together! Git allows MANY people to work on the same project. If a change is made, these users can store their earlier progress, and pull the new changes made!(more on this later.) This entire system builds an ecosystem; where work is done efficiently and effectively.
For example. THIS ENTIRE WIKI is a Git Repository! Every contributor works together to build this project! We all come together to build you a central place to find guides and things. How nice and handy, right? I mean having a *full guide* of things like contribing and git; all in one place, with nice and pretty text?!? Fucking awesome.
### A more in-depth look at Git and History of.
      

View File

@ -0,0 +1,43 @@
## getmail
---
getmail is a mail retriever designed to allow you to get your mail from one or more mail accounts on various mail servers to your local machine for reading with a minimum of fuss. getmail is designed to be secure, flexible, reliable, and easy-to-use.
### Configuration
- Create a file under .getmail in your home directory (Default: .getmail/getmailrc)
#### Retrieving email
Here is an example configuration file used with a thunix account:
```
[retriever]
type = SimplePOP3SSLRetriever
server = thunix.net
username = user
port = 995
password_command = ("/path/to/password-retriever", "-p", "myaccount@thunix.net")
[destination]
type = Maildir
path = ~/Maildir/inbox/
``
If the default filename (getmailrc) is not used then one can retrieve email by executing `$ getmail --rcfile thunix`, replace thunix with the filename used.
#### Password management
Passwords can be directly stored in the config file instead of using an external password retriever. To store password in config file use "password" parameter:
```
password = correct horse battery staple
```
This is not recommended, you should instead use an external retriever if possible. If "password" parameter is used then users should set right permission for ".getmail" directory, use `$ mkdir -m 0700 ~/.getmail` to create the directory.
### Related
- [getmail documentation](http://pyropus.ca/software/getmail/)
- [getmail - Arch Wiki](https://wiki.archlinux.org/index.php/Getmail)

View File

@ -1,11 +1,4 @@
<?php
//Name of your site
$site_name="Thunix Wiki";
//Root for the site, in a browser
$site_root="https://wiki.thunix.net";
//Local base root for app files
$doc_root="/var/www/wiki.thunix.net/";
?>

3
includes/404.md Normal file
View File

@ -0,0 +1,3 @@
# 404
This page ("$page") does not exist.

View File

@ -5,4 +5,4 @@
* [Sandbox](/sandbox)
* [Thunix.net](https://thunix.net)
* [Contact Thunix Staff](https://thunix.net/contact.php)
* [Contact Thunix Staff](https://thunix.net/contact)

View File

@ -88,3 +88,8 @@ body {
text-align: center;
padding-top: 30pt;
}
pre > code {
overflow-x: auto;
display: block;
}

View File

@ -7,34 +7,40 @@ Parsedown is licensed under the MIT license.
include('config.php');
include('parsedown-1.7.3/Parsedown.php');
$page = $_GET['page'];
$style = $_GET['style'];
$page = isset($_GET['page']) ? $_GET['page'] : 'main';
// Sanitize page request so we don't allow to read EVERY markdown file
// for example ../../../home/foobar/mysecretdocument
if (strpos($page, "../") !== false) {
header('HTTP/1.0 403 Forbidden');
exit();
}
$content_file = "articles/$page.md";
// When you need some debugging
//echo "<br>page: $page";
//echo "<br>content file: $content_file";
$Parsedown = new Parsedown();
$Parsedown->setSafeMode(true);
if ( $page == "") {
$page = "main";
}
if(isset($_GET['style']))
$site_style = $_GET['style'];
else
$site_style="site";
if ( $style == "") {
if ( $site_style == "") {
$site_style="site";
}
}
else {
$site_style=$style;
}
$header = file_get_contents("includes/header.md");
$sidebar = file_get_contents("includes/sidebar.md");
$content = file_exists($content_file) ? file_get_contents($content_file) : str_replace('$page', "$page", file_get_contents("includes/404.md"));
$footer = file_get_contents("includes/footer.md");
// TODO: Stylesheet URL assumes wiki is not operate in subfolder
$header = file_get_contents("$doc_root/includes/header.md");
$sidebar = file_get_contents("$doc_root/includes/sidebar.md");
$content = file_get_contents("$doc_root/articles/$page.md");
$footer = file_get_contents("$doc_root/includes/footer.md");
print "<!DOCTYPE html>
<html lang='en'>
<head>
<title>$site_name - $page</title>
<link rel='stylesheet' type='text/css' href='$site_root/includes/$site_style.css'>
<link rel='stylesheet' type='text/css' href='/includes/$site_style.css'>
</head>
<body>
<!-- Begin Header -->