Skip to content

Commit

Permalink
Merge pull request #123 from opennetadmin/develop
Browse files Browse the repository at this point in the history
Update Docs and sync up with github community stuff
  • Loading branch information
mattpascoe authored Jan 7, 2018
2 parents b98765b + 3945e19 commit 7e0e638
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 163 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CONTACT
* http://opennetadmin.com/ -- Main website
* http://opennetadmin.com/community -- Contact information
* https://github.com/opennetadmin/ona/wiki -- Online documentation
* http://opennetadmin.com/forum -- User discussion group
* https://github.com/opennetadmin/ona/issues -- Discussion and issues

LICENSE
-------
Expand Down
10 changes: 10 additions & 0 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Code of conduct
===============

Pretty simple.. Don't be a jerk.

Treat others as you would want to be treated, Love your neighbor as yourself.

It's not hard.

Thanks.
88 changes: 1 addition & 87 deletions docs/CODING_STANDARDS
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DEVELOPERS
CODING STANDARDS
Synopsis:
* Comments are to begin with two forward slashes: //
* Use an indent of 4 spaces, with NO TABS!
* Use an indent of 2 or 4 spaces, with NO TABS!
* Functions must have a descriptive header with the name, description,
input requirements, output, and example usage.
* At least one command line argument is REQUIRED before a script does
Expand Down Expand Up @@ -35,89 +35,3 @@ USE OF THE $_SESSION VARIABLE
* All authentication and user data is stored under $_SESSION['ona']['auth']
When a user logs out, only $_SESSION['ona']['auth'] is deleted.
*














----------


Upgrading FCKeditor

--------------------------------------------------
CLEAN FILES
--------------------------------------------------
cd ~/FCKeditor/
rm -rf _* editor/_source/ fckeditor.afp fckeditor.asp fckeditor.cfc fckeditor.cfm fckeditor.lasso fckeditor.pl fckeditor.py


--------------------------------------------------
Customize Config ~/FCKeditor/fckconfig.js
--------------------------------------------------

FCKConfig.ToolbarSets["wincFCKeditor"] = [
['Source','-','Save'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['TextColor','BGColor'],
['Link','Unlink','Anchor'],
['Image','Table','Rule','Smiley','SpecialChar'],
'/',
['Style','FontFormat','FontName','FontSize']
] ;


--------------------------------------------------
Enable File Uploads
--------------------------------------------------
## Edit ~/FCKeditor/fckconfig.js
var _FileBrowserLanguage = 'php' ;
var _QuickUploadLanguage = 'php' ;

## Edit ~/FCKeditor/editor/filemanager/browser/default/connectors/php/config.php
## Edit ~/FCKeditor/editor/filemanager/upload/default/connectors/php/config.php
## (same changes in both)

$Config['Enabled'] = true ;
$base = dirname(__FILE__);
while ($base and (!is_dir($base.'/include'))) $base = preg_replace('+/[^/]*$+', '', $base);
$baseURL = str_replace($_SERVER['DOCUMENT_ROOT'], '', $base); $baseURL = rtrim($baseURL, '/');
$Config['UserFilesPath'] = "{$baseURL}/uploads/" ;
$Config['UserFilesAbsolutePath'] = "{$base}/uploads/" ;

## Create some folders
cd document-root
mkdir -p uploads/file/ uploads/flash/ uploads/image/ uploads/media/
chmod -R 777 uploads/


-----------------------------------------------------------------------------------------------------------
Upgrading ADODB
rm adodb (symlink)
unzip adodb493.zip
mv adodb adodb-v493
ln -s adodb-v493 adodb
cd adodb
rm -rf docs/ tests/ cute_icons_for_site/ contrib/ pear/ session/


-----------------------------------------------------------------------------------------------------------
Upgrading xajax
To cleanup:
rm -rf tests/ examples/


21 changes: 21 additions & 0 deletions docs/CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Contributing
------------

Thank you for taking the time to look at this. Any help we can get from the
community is much appreciated and helps the project move forward.

OpenNetAdmin uses the Gitflow workflow. More info here: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

I'm not going to go into a huge description of the process here. The easiest way for others
to contribute is to use a forking workflow.

Some good info on those workflows are here:
* https://help.github.com/articles/fork-a-repo/
* https://help.github.com/articles/working-with-forks/
* https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow

Then once you have new code checked into your repo fork, submit a pull request for consideration.

More info here: https://help.github.com/articles/creating-a-pull-request-from-a-fork/

Thanks again for your participation.
5 changes: 0 additions & 5 deletions docs/DEVELOPERS

This file was deleted.

114 changes: 58 additions & 56 deletions docs/INSTALL
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
Here are some basic notes on installation of the system.
INSTALL
-------

You can access the online documentation for upgrades at https://github.com/opennetadmin/ona/wiki/Install

Requirements
------------

ONA has a simple set of requirements to run. I will describe them each briefly here.

* You will need a web server to service the page. Apache was the web server used to do the development and testing.
* You will need a database to store the data. MySQL was the database used to develop and test with. We use the ADODB PHP database abstraction layer so using Postgres or Oracle should not be an issue although we have not tested with those backends.
* You will need a PHP interpreter. ONA was written in the PHP language. Currently PHP version 5 or newer is required.
* In addition to PHP, you will need at least one PHP database module that may or may not be part of your distributions main install. You can check that they exist by issuing the command `php -m |grep mysql` You will see a list of the installed modules and something like "mysql" should be in the list.
* You also need to install the `php-gmp` and `php-mbstring` modules as well.
* While we are using the database abstraction system ADODB, the database creation scripts are all based off of MySQL . So for the time being, MySQL is the only truly supported database.

Requisite Steps
---------------
* cd /opt (or other directory you wish, all documentation assumes /opt)
* git clone https://github.com/opennetadmin/ona.git
* You can still use a tar if desired from https://github.com/opennetadmin/ona/releases/latest
* Add a symlink in your web server root that points `ona -> /opt/ona/www`. An example would be: `ln -s /opt/ona/www /var/www/ona` assuming your apache root is `/var/www`. An alternative to a symlink could be to add something like the following to your apache configuration:

> Alias /ona "/opt/ona/www/"
> <Directory "/opt/ona/www/">
> Options Indexes MultiViews FollowSymLinks
> AllowOverride All
> Require all granted
> </Directory>

* `touch /var/log/ona.log` This is the default location for the ONA system log.
* `chown www-data /opt/ona/www/local/config /var/log/ona.log` (or whatever your web server user is)
* Opensuse uses `wwwrun`
* Note that on some systems like Centos, that use SElinux, you may need to adjust the security context for /opt/ona/www/local as [explained here](http://stackoverflow.com/questions/8138288/php-fopen-failed-to-open-stream-permission-denied). `chcon -R -t httpd_sys_script_rw_t /opt/ona/www/local` should do it.

### Web install Method
* Point your broswer to http://localhost/ona (replace localhost with your server name if needed) and follow the install steps
* If needed you can manually run the installer by adding the following to the url. `http://localhost/ona/?runinstaller=y`
* You could also create the following file to invoke the installer: `touch /opt/ona/www/local/config/run_installer`
* Accept the GPL license.
* A new page with a set of questions will appear.
* In the first box, ensure that all of the prerequisite checks are indicating 'Yes'. If not, fix them and reload the page to refresh their status.
* Fill out the form (Help information is also in a box at the bottom of the form):
* Database host: This is the IP or DNS name of the server hosting your database. This is usually `localhost` but can certainly point to any other server.
* Database type: Since we use ADODB we can use many database backends, Currently however only MySQL is actually supported. Hope to fix this soon!
* Database admin: This is the username of a user that can create databases and tables on your database server. Many times this is `root`.
* Database admin password: The password for the admin user.
* Database name: Since ONA supports `contexts` a database name instance should be given. You should always use `default` for your primary install. Only adjust this value if you will be using contexts. This name will be prefixed with `ona_` when created so you will see databases in your system called `ona_default` for example. Also note that if you already have an instance with this name, the database will be dropped and re-created so please back it up and be cautious.
* Application database user name: This is a user that will be created on the database server to be used by the application for connections. This user will be granted permissions to update tables in our new database. The default user is `ona_sys`.
* Application database user password: The password for our new user.
* Default domain name: This is the default name that the system will use when adding new hosts. The domain will be created automatically for you in the system. It would typically be the name of the domain for your organization.
* Click create database. **NOTE:** Please remember this will drop any existing database that has the same name as provided in the database name field in order to re-create it.
* Click the `CLICK HERE TO START` link to begin.

### CLI install method
* run `php /opt/ona/install/installcli.php`
* Answer the questions.

The files in www/local will not be touched and are meant to house local
configuration and modules/plugins. However a few files will be touched by
the installer in www/local/config such as the database_settings.inc.php file

REQUIREMENTS:
An apache server
A mysql server
PHP
php-mysql module

INSTALL:

1. Download the latest file from http://opennetadmin.com/docs/download
2. tar -C /opt -zxvf ona-v00.00.00.tar.gz
This should extract the tar file into /opt/ona

3. Add a symlink in your web server root that points "ona -> /opt/ona/www"
For example: ln -s /opt/ona/www /var/www/ona

-or-

Add this to your apache configuration file in the approrpiate location:

Alias /ona "/opt/ona/www/"
<Directory "/opt/ona/www/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
</Directory>

4. touch /var/log/ona.log
5. chmod 666 /var/log/ona.log
6. chown www-data /opt/ona/www/local/config (or whatever your web server user is)
7. Point your broswer to http://<servername>/ona
8. You can log in as "admin" with a password of "admin"


MISC:

# These steps are not required but are things I might do in the future... They are not recomended at this point

adduser ona
addgroup ona
# ona:x:1001:1001:OpenNetAdmin,,,:/opt/ona:/bin/false <-- should look something like this
chown -R ona:ona /opt/ona

export PATH=$PATH:/opt/ona/bin

add a symlink of /tftpboot/ona -> /opt/ona/<something>


OTHER RECOMMENDATIONS:
1. Use something like eaccelerator.
2. Get the php-gmp modules, or compile php with gmp support. These are used for extended IP functions.
They are not required as they are used for functions not fully implemented yet.
30 changes: 21 additions & 9 deletions docs/UPGRADES
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
Upgrades prior to version 08.02.18 must be manually done by loading the file install/PRE-v08.02.18-to-08.02.18.sql into the database.
This upgrade step has not been tested and likly has errors.
UPGRADES
========

If you are currently on v08.02.18 and you are upgrading to version v08.04.15 then you must load the following sql file:
You can access the online documentation for upgrades at https://github.com/opennetadmin/ona/wiki/Upgrades

mysql -u <adminuser> -p ona < install/v08.02.18-to-v08.04.15.sql
Upgrades should automatically be detected and performed. As usual MAKE A BACKUP FIRST!
Its likely that I screwed something up and your data will be ground into a fine dust.
Currently the autoupgrade of database elements only works when using a MySQL database.

Updates after version v08.04.15 should automatically process.
Quick steps for upgrade:

Also, each time you install a new tar archive, you will most likly need to change
permissions on the /opt/ona/www/local/config directory to whatever your webserver user is.
* edit /opt/ona/www/local/config/database_settings.inc.php
* edit the ```db_type``` setting and change it to 'mysqli' if it is not already.
* Git pull
* cd to /opt/ona or wherever you've installed it
* git pull
* (OR) Download new tar file
* Download the latest tar archive from https://github.com/opennetadmin/ona/archive/master.tar.gz
* `tar --strip-components=1 -C /opt/ona -zxvf ona-master.tar.gz` Or change -C /opt/ona to wherever your installed it to on your system
* `chown www-data /opt/ona/www/local/config` (or whatever your web server user is)
* Point your browser to http://localhost/ona/?runinstaller=y OR use cli installer `php /opt/ona/install/installcli.php`
* If you do not run the upgrade installer you may run into issues. You must execute the link above after installing the tar archive.
* After the license info you will be informed that an upgrade will occur. Select OK to the upgrade (after your backups n stuff)
* If there is any new database updates they should be applied and you should see a note about the upgrade_index being updated as well as version numbers.
* Once in, should see the latest version number displayed on the dashboard.

This can be done with the following command, as an example:
chown www-data /opt/ona/www/local/config
2 changes: 1 addition & 1 deletion install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$runinstall = $onabase.'/www/local/config/run_install';
$xmlfile_tables = $base.'/ona-table_schema.xml';
$xmlfile_data = $base.'/ona-data.xml';
$license_text = file_get_contents($base.'/../docs/LICENSE');
$license_text = file_get_contents($base.'/../LICENSE');
$new_ver = trim(file_get_contents($onabase.'/VERSION'));
$curr_ver = '';

Expand Down
2 changes: 1 addition & 1 deletion install/installcli.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
echo "ONA is licensed under GPL v2.0.\n";
$showlicense = promptUser("Would you like to view license? [y/N] ", 'n');
if ($showlicense == 'y') {
system("more -80 {$base}/../docs/LICENSE");
system("more -80 {$base}/../LICENSE");
promptUser("[Press Enter To Continue]");
}

Expand Down
4 changes: 1 addition & 3 deletions www/winc/list_subnets.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,7 @@ class="act"
<a title="Delete subnet"
class="act"
onClick="var doit=confirm('Are you sure you want to delete this subnet?');
if (doit == true)
xajax_window_submit('edit_subnet', xajax.getFormValues('{$form['form_id']}_list_subnet_{$record['id']}'), 'delete');"
onClick="xajax_window_submit('edit_subnet', xajax.getFormValues('{$form['form_id']}_list_subnet_{$record['id']}'), 'delete');"
><img src="{$images}/silk/delete.png" border="0"></a>&nbsp;
EOL;
}
Expand Down

0 comments on commit 7e0e638

Please sign in to comment.