x1aaron / lxq Goto Github PK
View Code? Open in Web Editor NEWLXQ is an automation platform for LXD
LXQ is an automation platform for LXD
I have been thinking about LXQ over the weekend and I thinking about other ways to deploy applications.
One thought I had was using Salt Stack.
Another thought I had was using premade images, then we could just pull the images in.
Thoughts?
Hi, this looks cool. What license is this under? I realize this isn't a huge project yet, but it is important, since you are essentially cloning a copy into every users site. If some are using it for commercial purposes, as I plan to do, we would like to have our bases covered.
Thanks for the work!
Your scripts seem to be using wget from raw.github.com, you should just git clone
the whole thing once, (and update it with git as needed), and just run from there.
git clone https://github.com/aaronstuder/lxq.git /opt/lxq/
Deleted
Hi Aaron.
It seems to me that lxq remove is broken for installed on host kind of apps.
I installed cockpit but remove won't work:
root@lxd-server:~# lxq remove cockpit
ERROR: cockpit not found
I can fix my installation following and reversing the command in /opt/lxq/apps/cockpit/cockpit.install but it's not so comfortable.
Setups LXD and creates a container with NGINX as a reserve proxy.
should be "reverse"
I've found that many/most of the Bitnami applications work fine in LXD containers.
https://bitnami.com/stacks/cloud
Click on the Bitnami application you are interested in.
Under DEPLOYMENT OFFERING... under ON MY COMPUTER
Click on the WIN/MAC/LINUX tab
And you will see on the far right a Button to download the Bitnami Installer for that app.
Once it has downloaded to your PC, copy it to the LXD container you made for it.
Create an LXD container for that Application
lxc exec <container_name> bash
chmod +x app_installer_name
then
execute app_installer_name
The Bitnami installer then does its job installing the applicaiton for you.
You may have to still open a port etc but from your Host you should be able to point your browser to what the Bitnami tells you and you then should be able to use that application.
Obviously, to reach those from the Internet you'd have to use LXD's Device Proxy command to redirect traffic to your Host into the Container but that's easy enough to do.
Just a thought but wanted to tell you about Bitnami in case you weren't aware of it.
Hi,
I made a little change in your script and I'd like to share it with you.
You assume in apps/nginx.rules that the network interface is eth0, but, nowday it often has another name.
Because this is very crucial for dnat success of the configuration, I propose this changing:
diff --git a/apps/nginx/nginx.rules b/apps/nginx/nginx.rules
index 6a12be6..1e7b0e1 100644
--- a/apps/nginx/nginx.rules
+++ b/apps/nginx/nginx.rules
@@ -1,2 +1,2 @@
-iptables -t nat -I PREROUTING -i eth0 -p TCP -d $PUBLIC_IP --dport 80 -j DNAT --to-destination $CONTAINER_IP:80
-iptables -t nat -I PREROUTING -i eth0 -p TCP -d $PUBLIC_IP --dport 443 -j DNAT --to-destination $CONTAINER_IP:443
\ No newline at end of file
+iptables -t nat -I PREROUTING -i $INTERFACE -p TCP -d $PUBLIC_IP --dport 80 -j DNAT --to-destination $CONTAINER_IP:80
+iptables -t nat -I PREROUTING -i $INTERFACE -p TCP -d $PUBLIC_IP --dport 443 -j DNAT --to-destination $CONTAINER_IP:443
and
diff --git a/lxq b/lxq
index 49eb7dc..daac463
--- a/lxq
+++ b/lxq
@@ -354,8 +354,11 @@ init() {
mkdir /etc/lxq/
echo "LXQ_INIT=TRUE" >> /etc/lxq/lxq.cfg
PUBLIC_IP=`curl -s ifconfig.me`
+ INTERFACE=`ip link | awk -F: '$0 !~ "lo|vir|lxd|^[^0-9]"{print $2a;getline}'`
echo "Public IP: $PUBLIC_IP"
echo "PUBLIC_IP=$PUBLIC_IP" >> /etc/lxq/lxq.cfg
+ echo "Network Interface: $INTERFACE"
+ echo "INTERFACE=$INTERFACE" >> /etc/lxq/lxq.cfg
$ECHO_GREEN"SUCCESS: LXQ init Complete!"$NC
lxq install nginx null
fi
I used as "recipe" to get the interface name this code:
ip link | awk -F: '$0 !~ "lo|vir|lxd|^[^0-9]"{print $2a;getline}'
It's seems correct to me, but could be even better (or maybe asking it during init process?)
Hope it's useful
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.