From e4ba069fa7d393341b9c7f071b6bb50b8d15b1e5 Mon Sep 17 00:00:00 2001 From: adelorenzo Date: Thu, 4 Jan 2024 00:52:29 +0100 Subject: [PATCH] Thu Jan 4 12:52:29 AM CET 2024 --- default.profile | 12 ++++++++++++ gen_random.sh | 12 ++++++------ random_numbers.db | Bin 8192 -> 8192 bytes 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 default.profile diff --git a/default.profile b/default.profile new file mode 100644 index 0000000..10c86da --- /dev/null +++ b/default.profile @@ -0,0 +1,12 @@ +config: {} +description: Default LXD profile +devices: + eth0: + name: eth0 + network: lxdbr0 + type: nic + root: + path: / + pool: default + type: disk +name: default diff --git a/gen_random.sh b/gen_random.sh index c5cf591..7148865 100755 --- a/gen_random.sh +++ b/gen_random.sh @@ -8,7 +8,7 @@ minecraft-std() { lxc project create $random -c features.images=false > /dev/null lxc project switch $random > /dev/null lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null + cat default.profile | lxc --project $random profile edit default > /dev/null lxc launch --project $random -p default minecraft-server $random-minecraft-std --network vn-$random --config limits.cpu=2 --config limits.memory=2048MiB > /dev/null lxc launch --project $random -p default wireguard-server $random-vpn-server --network vn-$random --config limits.cpu=1 --config limits.memory=1024MiB > /dev/null } @@ -17,16 +17,16 @@ minecraft-max() { lxc project create $random -c features.images=false > /dev/null lxc project switch $random > /dev/null lxc --project $random network create vn-$random > /dev/null - cat /root/default.profile | lxc --project $random profile edit default > /dev/null + cat default.profile | lxc --project $random profile edit default > /dev/null lxc launch --project $random -p default minecraft-server $random-minecraft-max --network vn-$random --config limits.cpu=4 --config limits.memory=4096MiB > /dev/null lxc launch --project $random -p default wireguard-server $random-vpn-server --network vn-$random --config limits.cpu=1 --config limits.memory=1024MiB > /dev/null } +$1 + # Setup VPN vpn_port=`python3 /opt/thekube/ports.py` lxc config device add $random-vpn-server udp$vpn_port proxy listen=udp:0.0.0.0:$vpn_port connect=udp:127.0.0.1:51820 -curl --silent -X PUT --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/${random}/${random} -d "{"_id":"$random"}" > /dev/null -random_rev=`curl --silent -X GET https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random | jq -c '._rev' | sed 's/^.//' | sed 's/.$//'` +curl --silent -X PUT --user "adelorenzo:dimi2014" https://couchdb.oe74.cloud/kk_users/${random}/${random} -d "{"_id":"$random"}" +#random_rev=`curl --silent -X GET https://adelorenzo:dimi2014@couchdb.oe74.cloud/kk_users/$random | jq -c '._rev' | sed 's/^.//' | sed 's/.$//'` #curl --silent -H "Content-Type: text/x-yaml" -X PUT --data-binary @${random}-wg_server.yaml --user "adelorenzo:dimi2014" "https://couchdb.oe74.cloud/kk_users/${random}/${random}-wg_server.yaml?rev=$random_rev" > /dev/null - -$1 diff --git a/random_numbers.db b/random_numbers.db index c649f23de2dbb1572cb0e165647a76cca8d51d8a..845e05bb67d17ebbee85a6f1b022627e3b095c0c 100644 GIT binary patch delta 76 zcmZp0XmFSy%_uri#+gxcW5N=CW)c2`$?O7(9Q+mh1^gNO37ZWC4EPn;M3@!^b0>WK@h!S`s4=r1^}1@5aa*= delta 37 tcmZp0XmFSy%_ulg#+gxYW5N=CW&!?&$?O7(n+*l@`6o7LPHvEI006@}3XcE)