Code Monkey home page Code Monkey logo

archivatory's Introduction

Archivatory

How to use:

  1. Head over to https://archivatory.com
  2. Click "Choose File"
  3. Click "Upload"
  4. Wait for the file to upload
  5. Save the hash and link (user accounts save the hashes automatically!)

Set Us As A Peer!

In order to keep Archivatory from becoming just another "holder-of-files" make sure to set us as one of your IPFS peers: ipfs swarm connect /ip4/139.99.131.59/tcp/6537/ipfs/QmYUTAbwZWck3LW9XZBcHTz2Jaip3mGfYDt3LTXdPLEh23

Setting Up Your Own Archivatory:

Set Up A LAMP Server:

For a great guide check out Digital Ocean

Configure Your php.ini file:

  1. Head to /etc/php/7.0/apache2/ (Ubutnu 16.04)
  2. Open php.ini in your text editor of choice.
  3. Change the following:
  • post_max_size set to 0 for unlimited or choose a limit.
    • upload_max_size set to the max allowed upload for your instance.
    • memory_limit If running a server that only has an Archivatory instance do not set this higher that half of your total server RAM. This tells PHP how much RAM it is allowed to hog.
    • max_execution_time Limits the execution time per scripte. Large files may need more run time.
    • For more information on these settings see PHP: Handling file upload - Common Pitfalls.

Create Databases and Tables:

mysql -u root -p

CREATE DATABASE archivatory;

CREATE TABLE users (
    id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
    username VARCHAR(50) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE DATABASE archivatoryUploads;

Table creation in archivatoryUploads is done in the memUp.php script

Add config/congfig.php & config/uploadDBconfig.php

These two file are needed in order to have the site talk to your databases. They are not included in the package as of June 28th, 2018 to avoid confusion between development and production servers.

config.php

<?php
/* Database credentials. Assuming you are running MySQL */
define('DB_SERVER', 'localhost');
define('DB_USERNAME', '');
define('DB_PASSWORD', '');
define('DB_NAME', 'archivatory');
 
/* Attempt to connect to MySQL database */
$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
 
// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}

uploadDBconfig.php

<?php
// Database credentials.
$dbServerName = "localhost";
$dbUsername = "";
$dbPassword = "";
$dbName = "archivatoryUploads";
 
// Attempt to connect to MySQL database 
$link = mysqli_connect($dbServerName, $dbUsername, $dbPassword, $dbName);
 
// Check connection
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}

Full setup script is in the works.

Configure IPFS

<?php
// have apache set up ipfs
$initIPFS = shell_exec("ipfs init 2&>1");

// Tell IPFS not to use local network discovery
$mdnOff = shell_exec("ipfs config --json Discovery.MDNS.Enabled false 2&>1");

// Set IPFS to filter out common local IP addresses
$filterIPFS = shell_exec("ipfs config --json Swarm.AddrFilters '[
	\"/ip4/10.0.0.0/ipcidr/8\",
	\"/ip4/100.64.0.0/ipcidr/10\",
	\"/ip4/169.254.0.0/ipcidr/16\",
	\"/ip4/172.16.0.0/ipcidr/12\",
	\"/ip4/192.0.0.0/ipcidr/24\",
	\"/ip4/192.0.0.0/ipcidr/29\",
	\"/ip4/192.0.0.8/ipcidr/32\",
	\"/ip4/192.0.0.170/ipcidr/32\",
	\"/ip4/192.0.0.171/ipcidr/32\",
	\"/ip4/192.0.2.0/ipcidr/24\",
	\"/ip4/192.168.0.0/ipcidr/16\",
	\"/ip4/198.18.0.0/ipcidr/15\",
	\"/ip4/198.51.100.0/ipcidr/24\",
	\"/ip4/203.0.113.0/ipcidr/24\",
	\"/ip4/240.0.0.0/ipcidr/4\"
]' 2&>1");

// Checking for execution of above commands
echo $initIPFS;
if ($mdnOff) {
				echo "MDNS Disabled.";
}
if ($filterIPFS) {
				echo "Swarm filter added.";
}

Run IPFS as Apache

<?php shell_exec("IPFS_FD_MAX=4096 ipfs daemon &"); ?>

archivatory's People

Contributors

onozasi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bsormagec onozasi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.