Browse Source

Merge branch 'master' into development

pull/24/head
Teknikode 8 years ago
parent
commit
6de8a98ab3
  1. 113
      README.md
  2. 3
      git/index.php
  3. 6
      git/views/layout.twig
  4. 33
      includes/delete_account.php
  5. 2
      includes/process_registration.php
  6. 11
      templates/default/header.php
  7. BIN
      templates/default/img/screenshots/blog_screenshot.PNG
  8. BIN
      templates/default/img/screenshots/blog_screenshot_thumb.png
  9. BIN
      templates/default/img/screenshots/git_screenshot.PNG
  10. BIN
      templates/default/img/screenshots/git_screenshot_thumb.png
  11. BIN
      templates/default/img/screenshots/paste_screenshot.PNG
  12. BIN
      templates/default/img/screenshots/paste_screenshot_thumb.png
  13. BIN
      templates/default/img/screenshots/podcast_screenshot.PNG
  14. BIN
      templates/default/img/screenshots/podcast_screenshot_thumb.png
  15. BIN
      templates/default/img/screenshots/upload_screenshot.PNG
  16. BIN
      templates/default/img/screenshots/upload_screenshot_thumb.png
  17. 2
      templates/default/js/codemirror/codemirror.js
  18. 10
      templates/default/js/raphael/raphael.js

113
README.md

@ -1,15 +1,108 @@ @@ -1,15 +1,108 @@
Teknik Web Services
===================
# Teknik Web Services
* Copyright (c), 2013-2014, Chris Woodward (admin@teknik.io)
---------------
This is the source for the Teknik services.
Teknik is a suite of services with attractive and functional interfaces.
# Requirements
## Features
* File Upload w/ encryption
* Pastebin
* Blogs
* Git Repositories
* Podcasts
* Easy to use API
* Server Statistics
* Flexible installation and configuration
---------------
## Screenshots
[![File Upload Screenshot](https://cdn.teknik.io/default/img/screenshots/upload_screenshot_thumb.png)](https://cdn.teknik.io/default/img/screenshots/upload_screenshot.PNG)
[![Pastebin Screenshot](https://cdn.teknik.io/default/img/screenshots/paste_screenshot_thumb.png)](https://cdn.teknik.io/default/img/screenshots/paste_screenshot.PNG)
[![Blog Screenshot](https://cdn.teknik.io/default/img/screenshots/blog_screenshot_thumb.png)](https://cdn.teknik.io/default/img/screenshots/blog_screenshot.PNG)
[![Podcast Screenshot](https://cdn.teknik.io/default/img/screenshots/podcast_screenshot_thumb.png)](https://cdn.teknik.io/default/img/screenshots/podcast_screenshot.PNG)
[![Git Screenshot](https://cdn.teknik.io/default/img/screenshots/git_screenshot_thumb.png)](https://cdn.teknik.io/default/img/screenshots/git_screenshot.PNG)
You can also see a live demo [here](https://www.teknik.io).
## Requirements
In order to run Teknik on your server, you'll need:
* IIS 7 with URL Rewrite module or Apache with mod_rewrite enabled (Requires conversion of web.config files)
* PHP >= 5.4.14
* MySQL
* hMailServer (If running email as well)
* Git >= 1.7.2
* gitolite
## Installation
* Clone the Teknik repository to your web root directory, or anywhere else you want to run Teknik from.
```
cd /var/www
git clone git://teknik.io/Teknik
```
* Do not clone the development branch unless you want to run the latest code. It may be unstable.
* Create a database and import DB.sql to create the required tables.
* Rename and Edit Configs
- Teknik Configuration
* Rename the `includes/config.php.default` file to `includes/config.php`.
* Open up the `includes/config.php` and configure the site installation.
- Git Viewer Configuration
* Rename the `git/config.ini-example` file to `git/config.ini`.
* Open up the `git/config.ini` and configure the git viewer.
- Server Stats Configuration
* Rename the `stats/phpsysinfo.ini.new` file to `stats/phpsysinfo.ini`.
* Open up the `stats/phpsysinfo.ini` and configure the server stats.
- Mail Web Interface Configuration
* Rename the `mail/config/mail.inc.php.dist` file to `mail/config/mail.inc.php`.
* Rename the `mail/config/db.inc.php.dist` file to `mail/config/db.inc.php`.
* Open up the `mail/config/mail.inc.php` and configure the mail web interface settings.
* Open up the `mail/config/db.inc.php` and configure the mail database settings.
* If you are running IIS
- Add the following virtual directories to every page (home, upload, git, etc...):
* templates `/var/www/Teknik/templates`
* includes `/var/www/Teknik/includes`
* If you are running Apache
- Create an Alias for each of the following:
* templates `/var/www/Teknik/templates`
* includes `/var/www/Teknik/includes`
* Create the cache folders and give read/write permissions to your web server user:
```
cd /var/www/Teknik/templates/default
mkdir -p cache/js
chmod -R 777 cache
cd /var/www/Teknik/git
mkdir cache
chmod 777 cache
```
* Create a local repo of the gitolite-admin repository and give it read/write permissions to the PHP script user.
- In order to clone the repo, you will need to be added as an administrator within gitolite. Refer to [Gitolite](http://gitolite.com/gitolite/) for information on how to set that up.
```
cd /var/Repositories/
git clone git@teknik.io:gitolite-admin
chown -R www_user:GitGroup /var/Repositories/gitolite-admin/*
chmod -R 750 /var/Repositories/gitolite-admin/*
```
**That's it**, installation complete! If you're having problems, let us know through the [Contact](https://contact.teknik.io/) page.
## Authors and contributors
* [Chris Woodward](https://www.teknik.io) (Creator, developer)
## License
[BSD 3-Clause license](http://opensource.org/licenses/BSD-3-Clause)
## Development
You can view Teknik's [Development Branch](https://dev.teknik.io/) to see the current new features. (It may not work, as it is a development branch)
## Contributing
If you are a developer, we need your help. Teknik is a young project and we have lot's of stuff to do. Some developers are contributing with new features, others with bug fixes. But you can also dedicate yourself to refactoring the current codebase and improving what we already have. Any help you can give would be greatly appreciated!
## Further information
If you want to know more about the features of Teknik, check the [Help](https://help.teknik.io/) page. Also, if you're having problems with Teknik, let us know through the [Contact](https://contact.teknik.io/) page. Don't forget to give feedback and suggest new features! :)
- Mail Server (I suggest hmailserver)
- PHP >= 5.4.14
- Git >= 1.7.2
- MySQL Database

3
git/index.php

@ -19,9 +19,6 @@ if(!preg_match($pattern, $url)) @@ -19,9 +19,6 @@ if(!preg_match($pattern, $url))
include('../templates/'.$CONF['template'].'/header.php');
set_page_title("Teknik Git");
?>
<script src="<?php echo get_page_url($CONF['page'], $CONF); ?>/templates/<?php echo $CONF['template']; ?>/js/codemirror/codemirror.js"></script>
<?php
}
if (php_sapi_name() == 'cli-server' && file_exists(substr($_SERVER['REQUEST_URI'], 1))) {

6
git/views/layout.twig

@ -1,7 +1 @@ @@ -1,7 +1 @@
<!--[if lt IE 9]>
<script src="{{ app.request.basepath }}/web/js/html5.js"></script>
<![endif]-->
{% block body %}{% endblock %}
<script src="{{ app.request.basepath }}/web/js/raphael.js"></script>
<script src="{{ app.request.basepath }}/web/js/codemirror.js"></script>
<script src="{{ app.request.basepath }}/web/js/showdown.js"></script>

33
includes/delete_account.php

@ -12,34 +12,35 @@ if(isset($_POST)) @@ -12,34 +12,35 @@ if(isset($_POST))
$email = $user->username . "@" . $CONF['host'];
$account = $domain->Accounts->ItemByAddress($email);
$account->Delete();
$file = $CONF['ssh_pub_keys'];
//delete any public keys from git auth
$fh = fopen($file, 'r+');
if ($fh)
$Git = new Git();
$Git->windows_mode();
$repo = $Git->open($CONF['git_repo_path'][0].'gitolite-admin\\');
$repo->setenv('HOME', '/home/www_user');
$dir = $CONF['git_repo_path'][0].'gitolite-admin\\keydir\\u\\'.$user->username;
if (is_dir($dir))
{
if (filesize($file) > 0)
foreach (glob($dir."\\*") as $filename)
{
$data = fread($fh, filesize($file));
$reg_key = preg_quote($user->public_key, '/');
$reg_user = preg_quote($user->username, '/');
$forced_commands = preg_quote($CONF['forced_commands'], '/');
$new_data = preg_replace("/($forced_commands)(\s)($reg_key)(\s)($reg_user)(\n)*/", "", $data);
fclose($fh);
$fh = fopen($file, 'w');
fwrite($fh, $new_data);
if (is_file($filename))
{
$repo->run('rm keydir/u/'.$user->username.'/'.basename($filename));
}
}
}
fclose($fh);
$repo->commit('Removed all keys for '.$user->username);
$repo->push('origin', 'master');
/*
$r = new minecraftRcon($CONF['minecraft_server'], $CONF['rcon_port'], $CONF['rcon_pass']);
// Authenticate, and if so, execute command(s)
if ( $r->Auth() ) {
$r->mcRconCommand('pex user '.$user->minecraft_user." group remove Member");
}
*/
//delete the user from the main database
$user->delete($db);

2
includes/process_registration.php

@ -97,7 +97,7 @@ if(isset($_POST)) @@ -97,7 +97,7 @@ if(isset($_POST))
}
//log them in
$userTools->login($username, hashPassword($password, $CONF), false);
$userTools->login($username, hashPassword($password, $CONF), false, $CONF);
//redirect them to a welcome page
echo "true";

11
templates/default/header.php

@ -49,7 +49,16 @@ @@ -49,7 +49,16 @@
case "contact":
array_push($jsFiles, 'contact.js');
break;
case "git":
case "git":
$url = curPageURL();
$pattern = "/^(.*)((\/zipball\/)|(\/tarball\/)|(\/raw\/))(.*)$/";
if(!preg_match($pattern, $url))
{
array_push($jsFiles,
'raphael/raphael.js',
'showdown/showdown.js',
'codemirror/codemirror.js');
}
array_push($jsFiles, 'git.js');
break;
case "pod":

BIN
templates/default/img/screenshots/blog_screenshot.PNG

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
templates/default/img/screenshots/blog_screenshot_thumb.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
templates/default/img/screenshots/git_screenshot.PNG

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
templates/default/img/screenshots/git_screenshot_thumb.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
templates/default/img/screenshots/paste_screenshot.PNG

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
templates/default/img/screenshots/paste_screenshot_thumb.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
templates/default/img/screenshots/podcast_screenshot.PNG

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
templates/default/img/screenshots/podcast_screenshot_thumb.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
templates/default/img/screenshots/upload_screenshot.PNG

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
templates/default/img/screenshots/upload_screenshot_thumb.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

2
templates/default/js/codemirror/codemirror.js

File diff suppressed because one or more lines are too long

10
templates/default/js/raphael/raphael.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save