Skip to content

Commit 0d4e111

Browse files
Resolved merge conflict by combining changes in README
2 parents 8ffd754 + 19d106d commit 0d4e111

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1225
-268
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# Cloudy GNU/Linux Distribution
22

3+
### About
34
A community networking cloud in a box.
45

6+
The *Cloudy GNU/Linux Distribution* turns your embedded, barebone or mini computer into a *community networking cloud in a box*.
7+
8+
### Installation
9+
This repository contains the source code for the scripts, daemons and web GUI of Cloudy. To install Cloudy on your network computing device, use the automated installation script located at https://github.com/Clommunity/cloudynitzar.
10+
511
## Testing with cloudynitzar.sh [![Build Status](https://travis-ci.org/Clommunity/cloudynitzar.svg?branch=master)](https://travis-ci.org/Clommunity/cloudynitzar)
612

7-
### About
13+
### About Cloudynitzar
814
Cloudynitzar is a shell script that turns your plain Debian or Ubuntu system into a community networking cloud in a box (i.e. a full-featured Cloudy device). It might as well work on Debian and Ubuntu derivatives, like Linux Mint. Feel free to test and report!
915

1016
### Requirements
@@ -19,5 +25,5 @@ From your Debian system run, as root:
1925
apt-get update; apt-get install -y curl lsb-release
2026
curl -k https://raw.githubusercontent.com/Clommunity/cloudynitzar/master/cloudynitzar.sh | bash -
2127
````
22-
23-
and let the magic begin!
28+
### Learn more
29+
You can find more information about Cloudy at https://www.cloudy.community and https://www.clommunity-project.eu.

cdistro

Lines changed: 90 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,102 @@ DEMO=0
2121
test -f $CONFFILE && . $CONFFILE || exit 0
2222

2323
start() {
24-
if [ $DEMO -eq 1 ]; then
25-
su - nobody -c "$SERVER $OPTS -S $BINDIP:$PORT -t $DOCROOT >/dev/null 2>&1 &" > /dev/null 2>&1
26-
echo $(pidof php) > $PIDFILE
27-
else
28-
$SERVER $OPTS -S $BINDIP:$PORT -t $DOCROOT >/dev/null 2>&1 &
29-
echo $! > $PIDFILE
24+
STARTPHP=true
25+
STARTPHPSUCCESS=false
26+
STARTCDISTRO=true
27+
STARTCDISTROSUCCESS=false
28+
29+
# First, check for a previously started PHP server
30+
if [ -f "$PIDFILE" ]; then
31+
# Server has been started previously. Check if it is still running
32+
if $(netstat -ant|grep ${BINDIP}|grep ${PORT}|grep -q LISTEN); then
33+
echo "cDistro PHP server is already running."
34+
STARTPHP=false
35+
else
36+
echo "cDistro PHP server was already started but crashed. Restarting it..."
37+
fi
38+
fi
39+
40+
if [ $STARTPHP = true ]; then
41+
echo "Starting cDistro PHP server..."
42+
if [ $DEMO -eq 1 ]; then
43+
echo "cDistro is in demo mode."
44+
su - nobody -c "$SERVER $OPTS -S $BINDIP:$PORT -t $DOCROOT >/dev/null 2>&1 &" > /dev/null 2>&1
45+
echo $(pidof php) > $PIDFILE
46+
else
47+
$SERVER $OPTS -S $BINDIP:$PORT -t $DOCROOT >/dev/null 2>&1 &
48+
echo $! > $PIDFILE
49+
fi
50+
51+
# Check if the daemon has been started properly (wait up to 5 seconds)
52+
for i in $(seq 1 5); do
53+
sleep 1
54+
[ -f $PIDFILE ] && $(netstat -ant|grep ${BINDIP}|grep ${PORT}|grep -q LISTEN) \
55+
&& kill -0 $(cat $PIDFILE) >/dev/null 2>&1 && echo "cDistro PHP server successfully started." \
56+
&& STARTPHPSUCCESS=true && break
57+
done
58+
fi
59+
60+
$STARTPHP && ! $STARTPHPSUCCESS && echo "cDistro PHP server did not start successfully." && exit 1
61+
62+
# First, check for a previously started cDistro daemon
63+
if [ -f "$PIDDAEMON" ]; then
64+
# Server has been started previously. Check if it is still running
65+
if kill -0 $(cat $PIDDAEMON) >/dev/null 2>&1; then
66+
echo "cDistro daemon is already running."
67+
STARTCDISTRO=false
68+
else
69+
echo "cDistro daemon was already started but crashed. Restarting it..."
70+
fi
71+
fi
72+
73+
74+
if [ $STARTCDISTRO = true ]; then
75+
echo "Starting cDistro daemon..."
76+
$DAEMON >/dev/null 2>&1 &
77+
echo $! > $PIDDAEMON
78+
79+
# Check if the daemon has been started properly (wait up to 5 seconds)
80+
for i in $(seq 1 5); do
81+
sleep 1
82+
[ -f $PIDDAEMON ] && kill -0 $(cat $PIDDAEMON) >/dev/null 2>&1 \
83+
&& echo "cDistro daemon server successfully started." \
84+
&& STARTCDISTROSUCCESS=true && break
85+
done
86+
3087
fi
31-
$DAEMON >/dev/null 2>&1 &
32-
echo $! > $PIDDAEMON
88+
89+
$STARTCDISTRO && ! $STARTCDISTROSUCCESS && echo "cDistro daemon server did not start successfully." && exit 1
3390
}
91+
3492
stop() {
35-
kill -9 $(cat $PIDFILE)
36-
rm $PIDFILE
37-
kill -9 $(cat $PIDDAEMON)
38-
rm $PIDDAEMON
93+
# Stop cDistro PHP server
94+
[ -f $PIDFILE ] && $(netstat -ant|grep ${BINDIP}|grep ${PORT}|grep -q LISTEN) && \
95+
echo "Stopping cDistro PHP server..." && echo "Sending terminate signal to process $(cat $PIDFILE)..." && kill -15 $(cat $PIDFILE) && sleep 1
96+
97+
[ -f $PIDFILE ] && $(netstat -ant|grep ${BINDIP}|grep ${PORT}|grep -q LISTEN) && \
98+
echo "Sending interrupt signal to process $(cat $PIDFILE)..." && kill -2 $(cat $PIDFILE) && sleep 1
99+
100+
[ -f $PIDFILE ] && $(netstat -ant|grep ${BINDIP}|grep ${PORT}|grep -q LISTEN) && \
101+
echo "Sending kill signal to process $(cat $PIDFILE)..." && kill -9 $(cat $PIDFILE) && sleep 1
102+
103+
! $(netstat -ant|grep ${BINDIP}|grep ${PORT}|grep -q LISTEN) && [ -f $PIDFILE ] && rm $PIDFILE
104+
105+
# Stop cDistro daemon
106+
[ -f $PIDDAEMON ] && kill -0 $(cat $PIDDAEMON) >/dev/null 2>&1 && echo "Stopping cDistro daemon..." && echo "Sending terminate signal to process $(cat $PIDDAEMON)..." && kill -15 $(cat $PIDDAEMON) && sleep 1
107+
[ -f $PIDDAEMON ] && kill -0 $(cat $PIDDAEMON) >/dev/null 2>&1 && echo "Sending interrupt signal to process $(cat $PIDDAEMON)..." && kill -2 $(cat $PIDDAEMON) && sleep 1
108+
[ -f $PIDDAEMON ] && kill -0 $(cat $PIDDAEMON) >/dev/null 2>&1 && echo "Sending kill signal to process $(cat $PIDDAEMON)..." && kill -9 $(cat $PIDDAEMON) && sleep 1
109+
[ -f $PIDDAEMON ] && ! kill -0 $(cat $PIDDAEMON) >/dev/null 2>&1 && [ -f $PIDDAEMON ] && rm $PIDDAEMON
110+
111+
# Check that everything is stopped
112+
{ ! [ -f $PIDFILE ] && ! $(netstat -ant|grep ${BINDIP}|grep ${PORT}|grep -q LISTEN) \
113+
&& ! { [ -f $PIDDAEMON ] && ! kill -0 $(cat $PIDDAEMON) >/dev/null 2>&1 ;} \
114+
&& echo "cDistro daemon stopped." && return 0; } || { echo "cDistro daemon was not successfully stopped. Quitting..." && exit 1; }
39115
}
116+
40117
restart() {
41118
stop
42-
sleep 0.5
119+
sleep 1
43120
start
44121
}
45122

web/config/global.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
list($wi_ip, $wi_port) = explode(":", $_SERVER['HTTP_HOST']);
88
$protocol="http";
99

10-
if (isset($conf['PORT_SSL'])) {
10+
if ( isset($conf['PORT_SSL']) && ( ! isset($conf['ALLOWHTTP']) || $conf['ALLOWHTTP'] === "0")) {
1111
if (($wi_port != $conf['PORT_SSL']) || ($_SERVER['REMOTE_ADDR'] != "127.0.0.1")) {
1212
header('Location: https://'.$wi_ip.':'.$conf['PORT_SSL']);
1313
} else {

web/css/main.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ footer a {
2424
text-decoration: underline;
2525

2626
}
27+
28+
.dataTables_wrapper{
29+
font-size: medium;
30+
}

web/index.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
$js_end = array('main');
2727
$dir_configs="/etc/cloudy";
2828

29-
3029
if (isset($user) && !$post_login) {
3130
// Default
3231
$controller = "default";
@@ -63,6 +62,16 @@
6362
$action="notFunctionExist";
6463
}
6564
$cb = call_user_func_array($action, $Parameters);
65+
66+
list($wi_ip, $wi_port) = explode(":", $_SERVER['HTTP_HOST']);
67+
68+
if (isset($conf['PORT_SSL']) && $wi_port != $conf['PORT_SSL'] && isset ($conf['ALLOWHTTP']) && $conf['ALLOWHTTP'] === "1" ){
69+
$https_url = 'https://'.$wi_ip.':'.$conf['PORT_SSL'];
70+
$https_alert = "<div class='alert alert-warning text-center'>".t("https_http_pre") . "</br>". "<a href=$https_url>$https_url</a>" . t("https_http_post") . "</div>\n";
71+
if (isset ($cb['page']) ){
72+
$cb['page'] = $https_alert . $cb['page'];
73+
}
74+
}
6675
}
6776

6877
switch ($cb['type']) {

web/js/jquery.dataTables.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/lang/ca.default.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
//Buttons
1010
addS("default_button_back", "Enrere");
11+
addS("default_button_dummy", "Un botonet");
1112
addS("default_button_home", "Inici");
1213

1314
//index

web/lang/ca.docker-compose.php

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?php
2+
3+
4+
//alerts
5+
addS("docker_compose_alert_not_installed", "Docker Compose no está instal·lat");
6+
addS("docker_compose_alert_no_projects", "No s'ha trobat cap projecte de Docker Compose");
7+
addS("docker_compose_alert_not_running", "Docker está aturat");
8+
addS("docker_compose_alert_img_not_available", "No hi ha imatges de Docker disponibles");
9+
addS("docker_compose_alert_form_name_blank", "El nom del projecte no pot estar en blanc");
10+
addS("docker_compose_alert_form_name_empty", "No s'ha especificat el nom del projecte");
11+
addS("docker_compose_alert_form_name_invalid", "El nom del projecte no és vàlid");
12+
addS("docker_compose_alert_form_name_inuse", "Ja existeix un altre projecte amb el mateix nom");
13+
addS("docker_compose_alert_form_name_mkdir_fail_pre", "No s'ha pogut crear el directori ");
14+
addS("docker_compose_alert_form_name_mkdir_fail_post", "");
15+
addS("docker_compose_alert_form_dcy_put_fail_pre", "No s'ha pogut escriure al fitxer ");
16+
addS("docker_compose_alert_form_dcy_put_fail_post", "");
17+
addS("docker_compose_alert_form_dcy_blank", "El fitxer docker-compose.yml está buit");
18+
addS("docker_compose_alert_form_dcy_empty", "No s'ha especificat cap contingut per al fitxer docker-compose.yml");
19+
addS("docker_compose_alert_form_dcy_invalid", "El contingut del fitxer docker-compose.yml no és vàlid");
20+
addS("docker_compose_alert_form_project_pre", "El projecte ");
21+
addS("docker_compose_alert_form_project_post", " s'ha creat satisfactòriament");
22+
addS("docker_compose_alert_ps_not_running", "No hi ha contenidors Docker en execució");
23+
addS("docker_compose_alert_ps_not_stopped", "No hi ha contenidors Docker aturats");
24+
addS("docker_compose_alert_running", "Docker está executant-se");
25+
addS("docker_compose_alert_start_message", "S'ha iniciat Docker");
26+
addS("docker_compose_alert_stop_message", "S'ha aturat Docker");
27+
28+
29+
//buttons
30+
addS("docker_compose_button_install", "Instal·la Docker Compose");
31+
addS("docker_compose_button_start", "Inicia");
32+
addS("docker_compose_button_stop", "Atura");
33+
addS("docker_compose_button_image_rmi", "Esborra imatge");
34+
addS("docker_compose_button_image_run", "Inicia imatge");
35+
addS("docker_compose_button_create", "Crea un nou projecte de Docker Compose");
36+
addS("docker_compose_button_clone", "Clona un projecte de Docker Compose");
37+
addS("docker_compose_button_manage", "Gestiona");
38+
addS("docker_compose_button_delete", "Esborra");
39+
addS("docker_compose_button_back", "Enrere");
40+
41+
42+
//flash
43+
addS("docker_compose_flash_restart_pre", "S'está reiniciant el contenidor ");
44+
addS("docker_compose_flash_restart_mid", " (ID: ");
45+
addS("docker_compose_flash_restart_post", ") en segon pla. Això pot trigar uns segons...");
46+
addS("docker_compose_flash_rm_pre", "S'está esborrant el contenidor ");
47+
addS("docker_compose_flash_rm_mid", " (ID: ");
48+
addS("docker_compose_flash_rm_post", ") en segon pla. Això pot trigar uns segons...");
49+
addS("docker_compose_flash_rmi_pre", "S'está esborrant la imatge ");
50+
addS("docker_compose_flash_rmi_mid", "");
51+
addS("docker_compose_flash_rmi_post", " en segon pla. Això pot trigar uns segons...");
52+
addS("docker_compose_flash_run_pre", "S'está iniciant la imatge ");
53+
addS("docker_compose_flash_run_mid", "");
54+
addS("docker_compose_flash_run_post", " en segon pla. Això pot trigar uns segons...");
55+
addS("docker_compose_flash_pull_pre", "S'está obtenint el contenidor ");
56+
addS("docker_compose_flash_pull_post", " en segon pla. Això pot trigar uns segons...");
57+
addS("docker_compose_flash_down_pre", "S'estan aturant tots els contenidors associats al projecte ");
58+
addS("docker_compose_flash_down_post", " en segon pla. Això pot trigar uns segons...");
59+
addS("docker_compose_flash_up_pre", "S'está iniciant el projecte ");
60+
addS("docker_compose_flash_up_post", " en segon pla. Això pot trigar uns segons...");
61+
addS("docker_compose_flash_delete_pre", "S'ha esborrat el projecte ");
62+
addS("docker_compose_flash_delete_post", "");
63+
addS("docker_compose_flash_delete_error_pre", "No s'ha pogut esborrar el directori ");
64+
addS("docker_compose_flash_delete_error_post", "");
65+
66+
67+
//Common
68+
addS("docker_compose_title", "Docker Compose");
69+
addS("docker_compose_desc", "Amb Compose, podeu fer servir fitxers Compose per configurar els serveis de la vostra aplicació. Així, emprant una sola comanda, podeu crear i iniciar tots els serveis a partir de la vostra configuració. Compose és genial per a desenvolupament i entorns de proves pilot, així com per a fluxos de treball d'integració continuada. Podeu llegir més sobre Docker Compose <a href='https://docs.docker.com/compose'>aquí</a>.");
70+
addS("docker_compose_status", "Estat de Docker Compose:");
71+
addS("docker_compose_subtitle", "Una eina per definir i executar aplicacions Docker multicontenidor");
72+
73+
74+
//down
75+
addS("docker_compose_down_desc_pre", "S'estan aturant tots els contenidors associats al projecte ");
76+
addS("docker_compose_down_desc_post", ":");
77+
78+
//up
79+
addS("docker_compose_up_desc_pre", "Contenidors associats al projecte ");
80+
addS("docker_compose_up_desc_post", ":");
81+
82+
83+
//main
84+
addS("docker_compose_info", "Informació de Docker:");
85+
addS("docker_compose_interface", "Interfícies de xarxa de Docker:");
86+
addS("docker_compose_title_containers_running", "Contenidors de Docker en execució:");
87+
addS("docker_compose_title_containers_stopped", "Contenidors de Docker aturats:");
88+
addS("docker_compose_title_images", "Imatges de Docker disponibles:");
89+
90+
91+
//manage
92+
addS("docker_compose_manage_desc_pre", "Empreu aquesta pàgina per gestionar el projecte de Docker Compose ");
93+
addS("docker_compose_manage_desc_post", ".");
94+
addS("docker_compose_manage_containers", "Contenidors Docker associats:");
95+
addS("docker_compose_manage_files", "Fitxers del projecte:");
96+
97+
98+
//create
99+
addS("docker_compose_create_desc", "Empreu aquesta pàgina per crear un projecte de Docker Compose nou.");
100+
addS("docker_compose_create_form_error", "El formulari conté un error:");
101+
addS("docker_compose_create_form_errors", "El formulari conté errors:");
102+
addS("docker_compose_create_form_name", "Nom del projecte");
103+
addS("docker_compose_create_form_name_placeholder", "ElVostreProjecte");
104+
addS("docker_compose_create_form_name_tooltip", "Escolliu un nom per al vostre projecte de Docker Compose. Feu servir només caràcters alfanumèrics i guionets.");
105+
addS("docker_compose_create_form_dcy", "docker-compose.yml");
106+
addS("docker_compose_create_form_dcy_tooltip", "Feu servir el camp de text de dalt per introduir el contingut del vostre fitxer docker-compose.yml.");

0 commit comments

Comments
 (0)