hydrus/help/server.html

62 lines
6.6 KiB
HTML
Raw Normal View History

2013-02-19 00:11:43 +00:00
<html>
<head>
<title>running your own server</title>
<link href="hydrus.ico" rel="shortcut icon" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="content">
2017-01-04 22:48:23 +00:00
<p class="warning">The server is hacked-together and quite technical. It requires a fair amount of experience with the client and its concepts, and it does not operate on a timescale that works well on a LAN. I suggest you only try running your own server once you have a bit of experience synchronising with mine or someone else's and you think, 'Hey, I know exactly what that does, and I would like one!'</p>
2013-02-19 00:11:43 +00:00
<h3>setting up a server</h3>
2015-08-12 20:35:24 +00:00
<p>I will use two terms, <i>server</i> and <i>service</i>, to mean two distinct things:</p>
2013-02-19 00:11:43 +00:00
<ul>
2015-08-12 20:35:24 +00:00
<li>A <b>server</b> is an instantiation of the hydrus server executable (e.g. server.exe in Windows). It has a complicated and flexible database that can run many different services in parallel.</li>
2013-02-19 00:11:43 +00:00
<li>A <b>service</b> sits on a port (e.g. 45871) and responds to certain http requests (e.g. /file or /update) that the hydrus client can plug into. A service might be a repository for a certain kind of data, the administration interface to manage what services run on a server, or anything else.</li>
</ul>
2014-11-12 23:33:13 +00:00
<p>Setting up a hydrus server is easy compared to, say, Apache. There are no .conf files to mess about with, and everything is controlled through the client. When started, the server will place an icon in your system tray in Windows or open a small frame in Linux or OS X. To close the server, either right-click the system tray icon and select exit, or just close the frame.</p>
2015-08-12 20:35:24 +00:00
<p>The basic process for setting up a server is:</p>
2013-02-19 00:11:43 +00:00
<ul>
<li>Start the server.</li>
<li>Set up your client with its address and initialise the administration interface</li>
<li>Set the server's options and services.</li>
2014-10-01 22:58:32 +00:00
<li>Make some accounts for your users.</li>
2013-02-19 00:11:43 +00:00
<li>???</li>
<li>Profit</li>
</ul>
2015-08-12 20:35:24 +00:00
<p>Let's look at these steps in more detail:</p>
2013-02-19 00:11:43 +00:00
<h3>start the server</h3>
2015-08-12 20:35:24 +00:00
<p>Since the server and client have so much common code, I package them together. If you have the client, you have the server. If you installed in Windows, you can hit the shortcut in your start menu. Otherwise, go straight to 'server' or 'server.exe' or 'server.pyw' in your installation directory. The program will first try to take port 45870 for its administration interface, so make sure that is free. Open your firewall as appropriate.</p>
2013-02-19 00:11:43 +00:00
<h3>set up the client</h3>
2015-08-12 20:35:24 +00:00
<p>In the <i>services->manage services</i> dialog, go to the <i>servers admin</i> tab, give your server admin interface a nickname and set the credentials to:</p>
<ul>
<li>whateveritshostnameis:45870</li>
</ul>
<p>If you are running the server on the same computer as the client, its hostname is 'localhost'.</p>
<p>Ok those changes, and go to <i>review services</i>.</p>
<p>On the page for your new server, hit the initialise button. If you have everything set right, the server should generate its first, administrator account and return the access key, which the client will automatically set to the account for you.</p>
2013-12-11 22:09:25 +00:00
<p class="warning">YOU'LL WANT TO SAVE THAT KEY IN A SAFE PLACE</p>
2013-02-19 00:11:43 +00:00
<p>If you lose your admin access key, there is no way to get it back, and if you are not sqlite-proficient, you'll have to restart from the beginning by deleting your server's database files.</p>
2017-01-04 22:48:23 +00:00
<p>If the client can't connect to the server, it is either not running or you have a firewall/port-mapping problem. If you want a quick way to test the server's visibility, just put https://host:port into your browser--if it is working, your browser will probably complain about its self-signed https certificate. Once you add a certificate exception, the server should return some simple html identifying itself.</p>
2013-02-19 00:11:43 +00:00
<h3>set up the server</h3>
2015-12-09 23:16:41 +00:00
<p>You should have a new submenu, 'administrate services', under 'services', in the client gui. This is where you control most server and service-wide stuff.</p>
2015-08-12 20:35:24 +00:00
<p><i>admin->your server->manage services</i> lets you add, edit, and delete the services your server runs. Every time you add one, you will also be added as that service's first administrator, and the admin menu will gain a new entry for it.</i>
2013-03-15 02:38:12 +00:00
<h3>making accounts</h3>
2015-08-12 20:35:24 +00:00
<p>Go <i>admin->your service->create new accounts</i> to create new registration keys. Send the registration keys to the users you want to give these new accounts. A registration key will only work once, so if you want to give several people the same account, they will have to share the access key amongst themselves once one of them has registered the account. (Or you can register the account yourself and send them all the same access key. Do what you like!)</p>
2013-02-19 00:11:43 +00:00
<p>Go <i>admin->manage account types</i> to add, remove, or edit account types. Make sure everyone has at least downloader (get_data) permissions so they can stay synchronised.</p>
2015-08-12 20:35:24 +00:00
<p>You can create as many accounts of whatever kind you like. Depending on your usage scenario, you may want to have all uploaders, one uploader and many downloaders, or just a single administrator. There are many combinations.</p>
2013-02-19 00:11:43 +00:00
<h3>???</h3>
<p>The most important part is to have fun! There are no losers on the INFORMATION SUPERHIGHWAY.</p>
<h3>profit</h3>
2014-10-01 22:58:32 +00:00
<p>I honestly hope you can get some benefit out of my code, whether just as a backup or as part of a far more complex system. Please mail me your comments as I am always keen to make improvements.</p>
2013-02-19 00:11:43 +00:00
<h3>btw, how to backup a repo's db</h3>
2015-08-12 20:35:24 +00:00
<p>All of a server's files and options are stored in its accompanying .db file and respective subdirectories, which are created on first startup (just like with the client). To backup or restore, you have two options:</p>
2013-02-19 00:11:43 +00:00
<ul>
2015-08-12 20:35:24 +00:00
<li>Shut down the server, copy the database files and directories, then restart it. This is the only way, currently, to restore a db.</li>
2015-12-02 22:32:18 +00:00
<li>In the client, hit admin->your server->make a backup. This will lock the db server-side while it makes a copy of everything server-related to server_install_dir/db/server_backup. When the operation is complete, you can ftp/batch-copy/whatever the server_backup folder wherever you like.</li>
2013-02-19 00:11:43 +00:00
</ul>
<h3>OMG EVERYTHING WENT WRONG</h3>
<p>If you get to a point where you can no longer boot the repository, try running SQLite Studio and opening server.db. If the issue is simple<6C>like manually changing the port number<65>you may be in luck. Send me an email if it is tricky.</p>
2015-08-12 20:35:24 +00:00
<p>Remember that everything is breaking all the time. Make regular backups, and you'll minimise your problems.</p>
2013-02-19 00:11:43 +00:00
</div>
</body>
</html>