public class Deploy extends Service
<target name="deploy"> <java fork="yes" classname="se.rupy.http.Deploy" classpath="http.jar"> <arg line="localhost:8000"/><!-- any host:port --> <arg line="service.jar"/><!-- your application jar --> <arg line="secret"/><!-- see run.bat and run.sh --> </java> </target>
Modifier and Type | Class and Description |
---|---|
static class |
Deploy.Archive
This is our dynamic classloader.
|
CREATE, DISCONNECT, TIMEOUT
Constructor and Description |
---|
Deploy(java.lang.String path) |
Deploy(java.lang.String path,
java.lang.String pass) |
Modifier and Type | Method and Description |
---|---|
static void |
deploy(Event event,
java.lang.String host,
java.io.File file,
java.lang.String pass)
Async hot-deploy.
|
static void |
deploy(java.lang.String host,
java.io.File file,
java.lang.String pass)
Sync hot-deploy.
|
void |
filter(Event event)
The service method, equivalent of HttpServlet.service().
|
static java.lang.String |
hash(java.io.File file,
java.lang.String algo)
Hash file to hex.
|
static java.lang.String |
hash(java.io.File file,
java.lang.String pass,
java.lang.String cookie)
The hash chain: file -> pass -> cookie = the man in the
middle can read your deployment file but he cannot alter,
deploy or re-deploy it!
Basically: don't put passwords in clear text in the deployment jar and you will be fine! To get your host, pass and database IP on host.rupy.se call Daemon.send(Event event, Object message) with "{"type": "account"}"
like so:
String account = (String) daemon.send("{\"type\": \"account\"}"); It returns something like: "{"host": "xxx", "pass": "xxx", "ip": "xxx"}" |
static java.lang.String |
hash(java.lang.String hash,
java.lang.String algo)
Hash string to hex.
|
static void |
main(java.lang.String[] args) |
static java.lang.String |
name(java.lang.String name) |
java.lang.String |
path()
The identifier that should trigger this service.
|
static int |
pipe(java.io.InputStream in,
java.io.OutputStream out) |
static int |
pipe(java.io.InputStream in,
java.io.OutputStream out,
int length) |
static int |
pipe(java.io.InputStream in,
java.io.OutputStream out,
int length,
int limit) |
public Deploy(java.lang.String path, java.lang.String pass)
public Deploy(java.lang.String path)
public java.lang.String path()
Service
event.daemon().chain(event, "/login").filter(event); throw event; // stop the chainor
event.reply().header("Location", "/login"); event.reply().code("302 Found"); throw event; // stop the chain
public void filter(Event event) throws Event, java.lang.Exception
Service
public static java.lang.String name(java.lang.String name)
public static int pipe(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public static int pipe(java.io.InputStream in, java.io.OutputStream out, int length) throws java.io.IOException
java.io.IOException
public static int pipe(java.io.InputStream in, java.io.OutputStream out, int length, int limit) throws java.io.IOException
java.io.IOException
public static void deploy(java.lang.String host, java.io.File file, java.lang.String pass) throws java.io.IOException, java.security.NoSuchAlgorithmException
host
- file
- pass
- java.io.IOException
java.security.NoSuchAlgorithmException
public static void deploy(Event event, java.lang.String host, java.io.File file, java.lang.String pass) throws java.lang.Exception
event
- host
- file
- pass
- java.lang.Exception
public static java.lang.String hash(java.io.File file, java.lang.String pass, java.lang.String cookie) throws java.security.NoSuchAlgorithmException, java.io.FileNotFoundException, java.io.IOException
Daemon.send(Event event, Object message)
with "{"type": "account"}"
like so:
java.security.NoSuchAlgorithmException
java.io.FileNotFoundException
java.io.IOException
public static java.lang.String hash(java.lang.String hash, java.lang.String algo) throws java.security.NoSuchAlgorithmException, java.io.UnsupportedEncodingException
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException
public static java.lang.String hash(java.io.File file, java.lang.String algo) throws java.security.NoSuchAlgorithmException, java.io.FileNotFoundException, java.io.IOException
java.security.NoSuchAlgorithmException
java.io.FileNotFoundException
java.io.IOException
public static void main(java.lang.String[] args)