dynamic dns
This commit is contained in:
parent
3a05db554c
commit
fb8a03ae22
4 changed files with 12 additions and 5 deletions
|
@ -1,7 +1,3 @@
|
||||||
-- wget run http://68.46.126.104:48228/turtle/client.lua
|
|
||||||
|
|
||||||
local ipaddr = "68.46.126.104"
|
|
||||||
|
|
||||||
if not ipaddr then
|
if not ipaddr then
|
||||||
if fs.exists("/disk/ip") then
|
if fs.exists("/disk/ip") then
|
||||||
local ipfile = fs.open("/disk/ip")
|
local ipfile = fs.open("/disk/ip")
|
||||||
|
|
|
@ -9,6 +9,7 @@ edition = "2021"
|
||||||
anyhow = "1.0.75"
|
anyhow = "1.0.75"
|
||||||
axum = "0.7.2"
|
axum = "0.7.2"
|
||||||
bit-struct = "0.3.2"
|
bit-struct = "0.3.2"
|
||||||
|
const_format = "0.2.32"
|
||||||
feistel_rs = "0.1.0"
|
feistel_rs = "0.1.0"
|
||||||
rstar = "0.11.0"
|
rstar = "0.11.0"
|
||||||
rustmatica = "0.1.1"
|
rustmatica = "0.1.1"
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
GLOBAL_IP=`dig +short @dns.toys -4 ip`
|
||||||
|
|
||||||
|
.PHONY: server server-opt
|
||||||
|
server: surnames.txt names.txt
|
||||||
|
GLOBAL_IP=$(GLOBAL_IP) cargo run
|
||||||
|
|
||||||
|
server-opt: surnames.txt names.txt
|
||||||
|
GLOBAL_IP=$(GLOBAL_IP) cargo run --release
|
||||||
|
|
||||||
surnames.txt:
|
surnames.txt:
|
||||||
curl https://raw.githubusercontent.com/Hyneman/moby-project/672f6bdca054c42d375f065ffee87e8ceba0c242/moby/mwords/21986na.mes |\
|
curl https://raw.githubusercontent.com/Hyneman/moby-project/672f6bdca054c42d375f065ffee87e8ceba0c242/moby/mwords/21986na.mes |\
|
||||||
iconv -f cp1252 - > surnames.txt
|
iconv -f cp1252 - > surnames.txt
|
||||||
|
|
|
@ -13,6 +13,7 @@ use names::Name;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tokio::sync::{Mutex, RwLock};
|
use tokio::sync::{Mutex, RwLock};
|
||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
|
use const_format::formatcp;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
enum Direction {
|
enum Direction {
|
||||||
|
@ -172,5 +173,5 @@ struct TurtleResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn client() -> &'static str {
|
async fn client() -> &'static str {
|
||||||
include_str!("../../client/client.lua")
|
formatcp!("local ipaddr = {}\n{}", env!("GLOBAL_IP"), include_str!("../../client/client.lua"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue