From a690fd0e9b0990f9588595134107d8d698399271 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 08:24:29 +0200 Subject: [PATCH 01/36] First implementation --- LICENSE | 365 ++++++++++++++++++++++++++++++- check_process | 36 ++-- conf/app.src | 7 - conf/client.hcl | 49 +++++ conf/driver-lxc.src | 7 + conf/lxc_bridge | 6 + conf/nginx.conf | 34 +-- conf/nomad.hcl | 118 ++++++++++ conf/php-fpm.conf | 430 ------------------------------------- conf/server.hcl | 53 +++++ conf/systemd.service | 39 +--- doc/DESCRIPTION.md | 10 +- doc/DISCLAIMER.md | 12 -- doc/screenshots/assets.png | Bin 0 -> 36526 bytes manifest.json | 56 ++--- scripts/_common.sh | 6 +- scripts/backup | 34 +-- scripts/change_url | 8 +- scripts/config | 8 +- scripts/install | 190 ++++++++-------- scripts/remove | 62 ++---- scripts/restore | 94 ++++---- scripts/upgrade | 115 +++++----- scripts/ynh_install_go | 247 +++++++++++++++++++++ 24 files changed, 1148 insertions(+), 838 deletions(-) delete mode 100644 conf/app.src create mode 100644 conf/client.hcl create mode 100644 conf/driver-lxc.src create mode 100644 conf/lxc_bridge create mode 100644 conf/nomad.hcl delete mode 100644 conf/php-fpm.conf create mode 100644 conf/server.hcl create mode 100644 doc/screenshots/assets.png create mode 100644 scripts/ynh_install_go diff --git a/LICENSE b/LICENSE index 7d1e40b..e87a115 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,363 @@ -File containing the license of your package. +Mozilla Public License, version 2.0 + +1. Definitions + +1.1. "Contributor" + + means each individual or legal entity that creates, contributes to the + creation of, or owns Covered Software. + +1.2. "Contributor Version" + + means the combination of the Contributions of others (if any) used by a + Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + + means Source Code Form to which the initial Contributor has attached the + notice in Exhibit A, the Executable Form of such Source Code Form, and + Modifications of such Source Code Form, in each case including portions + thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + a. that the initial Contributor has attached the notice described in + Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the terms of + a Secondary License. + +1.6. "Executable Form" + + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + + means a work that combines Covered Software with other material, in a + separate file or files, that is not Covered Software. + +1.8. "License" + + means this document. + +1.9. "Licensable" + + means having the right to grant, to the maximum extent possible, whether + at the time of the initial grant or subsequently, any and all of the + rights conveyed by this License. + +1.10. "Modifications" + + means any of the following: + + a. any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. "Patent Claims" of a Contributor + + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the License, + by the making, using, selling, offering for sale, having made, import, + or transfer of either its Contributions or its Contributor Version. + +1.12. "Secondary License" + + means either the GNU General Public License, Version 2.0, the GNU Lesser + General Public License, Version 2.1, the GNU Affero General Public + License, Version 3.0, or any later versions of those licenses. + +1.13. "Source Code Form" + + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that controls, is + controlled by, or is under common control with You. For purposes of this + definition, "control" means (a) the power, direct or indirect, to cause + the direction or management of such entity, whether by contract or + otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + + +2. License Grants and Conditions + +2.1. Grants + + Each Contributor hereby grants You a world-wide, royalty-free, + non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for + sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + + The licenses granted in Section 2.1 with respect to any Contribution + become effective for each Contribution on the date the Contributor first + distributes such Contribution. + +2.3. Limitations on Grant Scope + + The licenses granted in this Section 2 are the only rights granted under + this License. No additional rights or licenses will be implied from the + distribution or licensing of Covered Software under this License. + Notwithstanding Section 2.1(b) above, no patent license is granted by a + Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + + c. under Patent Claims infringed by Covered Software in the absence of + its Contributions. + + This License does not grant any rights in the trademarks, service marks, + or logos of any Contributor (except as may be necessary to comply with + the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + + No Contributor makes additional grants as a result of Your choice to + distribute the Covered Software under a subsequent version of this + License (see Section 10.2) or under the terms of a Secondary License (if + permitted under the terms of Section 3.3). + +2.5. Representation + + Each Contributor represents that the Contributor believes its + Contributions are its original creation(s) or it has sufficient rights to + grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + + This License is not intended to limit any rights You have under + applicable copyright doctrines of fair use, fair dealing, or other + equivalents. + +2.7. Conditions + + Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in + Section 2.1. + + +3. Responsibilities + +3.1. Distribution of Source Form + + All distribution of Covered Software in Source Code Form, including any + Modifications that You create or to which You contribute, must be under + the terms of this License. You must inform recipients that the Source + Code Form of the Covered Software is governed by the terms of this + License, and how they can obtain a copy of this License. You may not + attempt to alter or restrict the recipients' rights in the Source Code + Form. + +3.2. Distribution of Executable Form + + If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, + as described in Section 3.1, and You must inform recipients of the + Executable Form how they can obtain a copy of such Source Code Form by + reasonable means in a timely manner, at a charge no more than the cost + of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter the + recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + + You may create and distribute a Larger Work under terms of Your choice, + provided that You also comply with the requirements of this License for + the Covered Software. If the Larger Work is a combination of Covered + Software with a work governed by one or more Secondary Licenses, and the + Covered Software is not Incompatible With Secondary Licenses, this + License permits You to additionally distribute such Covered Software + under the terms of such Secondary License(s), so that the recipient of + the Larger Work may, at their option, further distribute the Covered + Software under the terms of either this License or such Secondary + License(s). + +3.4. Notices + + You may not remove or alter the substance of any license notices + (including copyright notices, patent notices, disclaimers of warranty, or + limitations of liability) contained within the Source Code Form of the + Covered Software, except that You may alter any license notices to the + extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + + You may choose to offer, and to charge a fee for, warranty, support, + indemnity or liability obligations to one or more recipients of Covered + Software. However, You may do so only on Your own behalf, and not on + behalf of any Contributor. You must make it absolutely clear that any + such warranty, support, indemnity, or liability obligation is offered by + You alone, and You hereby agree to indemnify every Contributor for any + liability incurred by such Contributor as a result of warranty, support, + indemnity or liability terms You offer. You may include additional + disclaimers of warranty and limitations of liability specific to any + jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + + If it is impossible for You to comply with any of the terms of this License + with respect to some or all of the Covered Software due to statute, + judicial order, or regulation then You must: (a) comply with the terms of + this License to the maximum extent possible; and (b) describe the + limitations and the code they affect. Such description must be placed in a + text file included with all distributions of the Covered Software under + this License. Except to the extent prohibited by statute or regulation, + such description must be sufficiently detailed for a recipient of ordinary + skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You + fail to comply with any of its terms. However, if You become compliant, + then the rights granted under this License from a particular Contributor + are reinstated (a) provisionally, unless and until such Contributor + explicitly and finally terminates Your grants, and (b) on an ongoing + basis, if such Contributor fails to notify You of the non-compliance by + some reasonable means prior to 60 days after You have come back into + compliance. Moreover, Your grants from a particular Contributor are + reinstated on an ongoing basis if such Contributor notifies You of the + non-compliance by some reasonable means, this is the first time You have + received notice of non-compliance with this License from such + Contributor, and You become compliant prior to 30 days after Your receipt + of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent + infringement claim (excluding declaratory judgment actions, + counter-claims, and cross-claims) alleging that a Contributor Version + directly or indirectly infringes any patent, then the rights granted to + You by any and all Contributors for the Covered Software under Section + 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user + license agreements (excluding distributors and resellers) which have been + validly granted by You or Your distributors under this License prior to + termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an "as is" basis, + without warranty of any kind, either expressed, implied, or statutory, + including, without limitation, warranties that the Covered Software is free + of defects, merchantable, fit for a particular purpose or non-infringing. + The entire risk as to the quality and performance of the Covered Software + is with You. Should any Covered Software prove defective in any respect, + You (not any Contributor) assume the cost of any necessary servicing, + repair, or correction. This disclaimer of warranty constitutes an essential + part of this License. No use of any Covered Software is authorized under + this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including + negligence), contract, or otherwise, shall any Contributor, or anyone who + distributes Covered Software as permitted above, be liable to You for any + direct, indirect, special, incidental, or consequential damages of any + character including, without limitation, damages for lost profits, loss of + goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses, even if such party shall have been + informed of the possibility of such damages. This limitation of liability + shall not apply to liability for death or personal injury resulting from + such party's negligence to the extent applicable law prohibits such + limitation. Some jurisdictions do not allow the exclusion or limitation of + incidental or consequential damages, so this exclusion and limitation may + not apply to You. + +8. Litigation + + Any litigation relating to this License may be brought only in the courts + of a jurisdiction where the defendant maintains its principal place of + business and such litigation shall be governed by laws of that + jurisdiction, without reference to its conflict-of-law provisions. Nothing + in this Section shall prevent a party's ability to bring cross-claims or + counter-claims. + +9. Miscellaneous + + This License represents the complete agreement concerning the subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. Any law or regulation which provides that + the language of a contract shall be construed against the drafter shall not + be used to construe this License against a Contributor. + + +10. Versions of the License + +10.1. New Versions + + Mozilla Foundation is the license steward. Except as provided in Section + 10.3, no one other than the license steward has the right to modify or + publish new versions of this License. Each version will be given a + distinguishing version number. + +10.2. Effect of New Versions + + You may distribute the Covered Software under the terms of the version + of the License under which You originally received the Covered Software, + or under the terms of any subsequent version published by the license + steward. + +10.3. Modified Versions + + If you create software not governed by this License, and you want to + create a new license for such software, you may create and use a + modified version of this License if you rename the license and remove + any references to the name of the license steward (except to note that + such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary + Licenses If You choose to distribute Source Code Form that is + Incompatible With Secondary Licenses under the terms of this version of + the License, the notice described in Exhibit B of this License must be + attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the + terms of the Mozilla Public License, v. + 2.0. If a copy of the MPL was not + distributed with this file, You can + obtain one at + http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, +then You may include the notice in a location (such as a LICENSE file in a +relevant directory) where a recipient would be likely to look for such a +notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible + With Secondary Licenses", as defined by + the Mozilla Public License, v. 2.0. -More information here: -https://yunohost.org/packaging_apps_guidelines#yep-1-3 diff --git a/check_process b/check_process index da70422..8b7a1e0 100644 --- a/check_process +++ b/check_process @@ -1,21 +1,37 @@ -;; Test complet +;; Test complet server ; Manifest domain="domain.tld" - path="/path" is_public=1 - language="fr" - admin="john" - password="1Strong-Password" - port="666" + node_type="server" + server_ip="none..." ; Checks pkg_linter=1 - setup_sub_dir=1 + setup_sub_dir=0 setup_root=1 setup_nourl=0 setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=CommitHash + #upgrade=1 from_commit=CommitHash + backup_restore=1 + multi_instance=1 + port_already_use=0 + change_url=1 +;; Test complet client + ; Manifest + domain="domain.tld" + is_public=1 + node_type="client" + server_ip="192.168.1.100" + ; Checks + pkg_linter=1 + setup_sub_dir=0 + setup_root=1 + setup_nourl=0 + setup_private=1 + setup_public=1 + upgrade=1 + #upgrade=1 from_commit=CommitHash backup_restore=1 multi_instance=1 port_already_use=0 @@ -23,7 +39,3 @@ ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 17489bf..0000000 --- a/conf/app.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=url of app's source -SOURCE_SUM=sha256 checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true diff --git a/conf/client.hcl b/conf/client.hcl new file mode 100644 index 0000000..1c12243 --- /dev/null +++ b/conf/client.hcl @@ -0,0 +1,49 @@ +#----------------------- client-specific options --------------------- +client { + # A boolean indicating if client mode is enabled. All other client configuration options depend on this value. + # Defaults to false. + enabled = true + + # This is the state dir used to store client state. By default, it lives inside of the data_dir, in the + # "client" sub-path. +# state_dir = "/tmp/client" + + # A directory used to store allocation data. Depending on the workload, the size of this directory can grow + # arbitrarily large as it is used to store downloaded artifacts for drivers (QEMU images, JAR files, etc.). It is therefore + # important to ensure this directory is placed some place on the filesystem with adequate storage capacity. By default, this + # directory lives under the data_dir at the "alloc" sub-path. +# alloc_dir = "/tmp/alloc" + + # An array of server addresses. This list is used to register the client with the server nodes and advertise + # the available resources so that the agent can receive work. + servers = ["__SERVER_IP__:__RPC_PORT__"] + + # This is the value used to uniquely identify the local agent's node registration with the servers. This can be any arbitrary + # string but must be unique to the cluster. By default, if not specified, a randomly- generate UUID will be used. +# node_id = "foo" + + # A string used to logically group client nodes by class. This can be used during job placement as a filter. + # This option is not required and has no default. +# node_class = "experimentation" + + # This is a key/value mapping of metadata pairs. This is a free-form map and can contain any string values. + meta {} + + # This is a key/value mapping of internal configuration for clients, such as for driver configuration. + options {} + + # This is a string to force network fingerprinting to use a specific network interface +# network_interface = "eth0" + + # This is an int that sets the default link speed of network interfaces, in megabits, if their speed can not be + # determined dynamically. + network_speed = 100 +} + +plugin "nomad-driver-lxc" { + config { + enabled = true + volumes_enabled = true + lxc_path = "/var/lib/lxc" + } +} diff --git a/conf/driver-lxc.src b/conf/driver-lxc.src new file mode 100644 index 0000000..50b65e7 --- /dev/null +++ b/conf/driver-lxc.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/hashicorp/nomad-driver-lxc/archive/7ceb969ba7bf4e4fae14856243892b1d51a37d14.tar.gz +SOURCE_SUM=b2b84436e4feb99b39414b4faa3c40f03c433c144832ece1d90dd6ddb870aa95 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/conf/lxc_bridge b/conf/lxc_bridge new file mode 100644 index 0000000..ad75592 --- /dev/null +++ b/conf/lxc_bridge @@ -0,0 +1,6 @@ +auto __LXC_BRIDGE__ +iface __LXC_BRIDGE__ inet static + address __PLAGE_IP__.1/24 + bridge_ports none + bridge_fd 0 + bridge_maxwait 0 \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index d9fdc4e..618f075 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,25 +1,29 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source - alias __FINALPATH__/; + proxy_pass http://127.0.0.1:__HTTP_PORT__; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - index index.php; + # Nomad blocking queries will remain open for a default of 5 minutes. + # Increase the proxy timeout to accommodate this timeout with an + # additional grace period. + proxy_read_timeout 310s; - # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - #client_max_body_size 50M; + # Nomad log streaming uses streaming HTTP requests. In order to + # synchronously stream logs from Nomad to NGINX to the browser + # proxy buffering needs to be turned off. + proxy_buffering off; - try_files $uri $uri/ index.php; - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + # The Upgrade and Connection headers are used to establish + # a WebSockets connection. + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + # The default Origin header will be the proxy address, which + # will be rejected by Nomad. It must be rewritten to be the + # host address instead. + proxy_set_header Origin "${scheme}://${proxy_host}"; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param SCRIPT_FILENAME $request_filename; - } # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/conf/nomad.hcl b/conf/nomad.hcl new file mode 100644 index 0000000..8656f8c --- /dev/null +++ b/conf/nomad.hcl @@ -0,0 +1,118 @@ +# -------------- General options --------------- + +# Specifies the region the Nomad agent is a member of. A region typically maps to a +# geographic region, for example USA, with potentially multiple zones, which map to +# datacenters such as us-west and us-east. Defaults to global. +#region = "USA" + +# Datacenter of the local agent. All members of a datacenter should share a local +# LAN connection. Defaults to dc1. +#datacenter = "data-center-one" + +# The name of the local node. This value is used to identify individual nodes in a +# given datacenter and must be unique per-datacenter. By default this is set to the +# local host's name. +#name = "client-one" + +# A local directory used to store agent state. Client nodes use this directory by +# default to store temporary allocation data as well as cluster information. Server +# nodes use this directory to store cluster state, including the replicated log and +# snapshot data. This option is required to start the Nomad agent. +data_dir = "__DATADIR__" + +# Controls the verbosity of logs the Nomad agent will output. Valid log levels include +# WARN, INFO, or DEBUG in increasing order of verbosity. Defaults to INFO. +#log_level = "DEBUG" + +# Used to indicate which address the Nomad agent should bind to for network services, +# including the HTTP interface as well as the internal gossip protocol and RPC mechanism. +# This should be specified in IP format, and can be used to easily bind all network services +# to the same address. It is also possible to bind the individual services to different +# addresses using the addresses configuration option. Defaults to the local loopback +# address 127.0.0.1. +bind_addr = "0.0.0.0" + +# Enables the debugging HTTP endpoints. These endpoints can be used with profiling tools +# to dump diagnostic information about Nomad's internals. It is not recommended to leave +# this enabled in production environments. Defaults to false. +enable_debug = false + +# Controls the network ports used for different services required by the Nomad agent. +ports { + # The port used to run the HTTP server. Applies to both client and server nodes. Defaults to __HTTP_PORT__. + http = __HTTP_PORT__ + + # The port used for internal RPC communication between agents and servers, and for inter-server + # traffic for the consensus algorithm (raft). Defaults to __RPC_PORT__. Only used on server nodes. + rpc = __RPC_PORT__ + + # The port used for the gossip protocol for cluster membership. Both TCP and UDP should be routable + # between the server nodes on this port. Defaults to __SERF_PORT__. Only used on server nodes. + serf = __SERF_PORT__ +} + +# Controls the bind address for individual network services. Any values configured in this block +# take precedence over the default bind_addr. +addresses { + + # The address the HTTP server is bound to. This is the most common bind address to change. + # Applies to both clients and servers. +# http = "0.0.0.0" + + # The address to bind the internal RPC interfaces to. Should be exposed only to other cluster + # members if possible. Used only on server nodes, but must be accessible from all agents. +# rpc = "0.0.0.0" + + # The address used to bind the gossip layer to. Both a TCP and UDP listener will be exposed on this + # address. Should be restricted to only server nodes from the same datacenter if possible. + # Used only on server nodes. +# serf = "0.0.0.0" +} + +# Controls the advertise address for individual network services. This can be used to advertise a +# different address to the peers of a server node to support more complex network configurations such +# as NAT. This configuration is optional, and defaults to the bind address of the specific network +# service if it is not provided. This configuration is only applicable on server nodes. +#advertise { + + # The address to advertise for the RPC interface. This address should be reachable by all of + # the agents in the cluster. +# rpc = "1.2.3.4:__RPC_PORT__" + + # The address advertised for the gossip layer. This address must be reachable from all server nodes. + # It is not required that clients can reach this address. +# serf = "1.2.3.4:__SERF_PORT__" +#} + +# Used to control how the Nomad agent exposes telemetry data to external metrics collection servers. +telemetry { + # Address of a statsite server to forward metrics data to. +# statsite_address = "1.2.3.4:5678" + + # Address of a statsd server to forward metrics to. +# statsd_address = "1.2.3.4:5678" + + # A boolean indicating if gauge values should not be prefixed with the local hostname. +# disable_hostname = false +} + +# Enables gracefully leaving when receiving the interrupt signal. By default, the agent will +# exit forcefully on any signal. +leave_on_interrupt = false + +# Enables gracefully leaving when receiving the terminate signal. By default, the agent will +# exit forcefully on any signal. +leave_on_terminate = false + +# Enables logging to syslog. This option only works on Unix based systems. +enable_syslog = false + +# Controls the syslog facility that is used. By default, LOCAL0 will be used. This should +# be used with enable_syslog. +syslog_facility = "LOCAL0" + +# Disables automatic checking for security bulletins and new version releases. +disable_update_check = true + +# Disables providing an anonymous signature for de-duplication with the update check. +disable_anonymous_signature = false diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf deleted file mode 100644 index ab1a471..0000000 --- a/conf/php-fpm.conf +++ /dev/null @@ -1,430 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[__NAMETOCHANGE__] - -; Per pool prefix -; It only applies on the following directives: -; - 'access.log' -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = __USER__ -group = __USER__ - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock - -; Set listen(2) backlog. -; Default Value: 511 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 511 - -; Set permissions for unix socket, if one is used. In Linux, read/write -; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0660 -listen.owner = www-data -listen.group = www-data -;listen.mode = 0660 -; When POSIX Access Control Lists are supported you can set them using -; these options, value is a comma separated list of user/group names. -; When set, listen.owner and listen.group are ignored -;listen.acl_users = -;listen.acl_groups = - -; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; process.priority = -19 - -; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user -; or group is differrent than the master process user. It allows to create process -; core dump and ptrace the process for the pool user. -; Default Value: no -; process.dumpable = yes - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 - -; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/7.0/fpm/status.html -; -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %T: time the log has been written (the request has finished) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; The timeout for serving a single request after which a PHP backtrace will be -; dumped to the 'slowlog' file. A value of '0s' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; The timeout for serving a single request after which the worker process will -; be killed. This option should be used when the 'max_execution_time' ini option -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -request_terminate_timeout = 1d - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = __FINALPATH__ - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;catch_workers_output = yes - -; Clear environment in FPM workers -; Prevents arbitrary environment variables from reaching FPM worker processes -; by clearing the environment in workers before env vars specified in this -; pool configuration are added. -; Setting to "no" will make all environment variables available to PHP code -; via getenv(), $_ENV and $_SERVER. -; Default Value: yes -;clear_env = no - -; Limits the extensions of the main script FPM will allow to parse. This can -; prevent configuration mistakes on the web server side. You should only limit -; FPM to .php extensions to prevent malicious users to use other extensions to -; execute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 .php7 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M - -; Common values to change to increase file upload limit -; php_admin_value[upload_max_filesize] = 50M -; php_admin_value[post_max_size] = 50M -; php_admin_flag[mail.add_x_header] = Off - -; Other common parameters -; php_admin_value[max_execution_time] = 600 -; php_admin_value[max_input_time] = 300 -; php_admin_value[memory_limit] = 256M -; php_admin_flag[short_open_tag] = On diff --git a/conf/server.hcl b/conf/server.hcl new file mode 100644 index 0000000..2b80785 --- /dev/null +++ b/conf/server.hcl @@ -0,0 +1,53 @@ +# ------------- server-specific options ----------------------------- +server { + + # A boolean indicating if server mode should be enabled for the local agent. All other server + # options depend on this value being set. Defaults to false. + enabled = true + + # This is an integer representing the number of server nodes to wait for before bootstrapping. It is most + # common to use the odd-numbered integers 3 or 5 for this value, depending on the cluster size. A value of + # 1 does not provide any fault tolerance and is not recommended for production use cases. + bootstrap_expect = 1 + + # This is the data directory used for server-specific data, including the replicated log. By default, this + # directory lives inside of the data_dir in the "server" sub-path. +# data_dir = "/tmp/server" + + # The Nomad protocol version spoken when communicating with other Nomad servers. This value is typically not + # required as the agent internally knows the latest version, but may be useful in some upgrade scenarios. +# protocol_version = 0 + + # The number of parallel scheduler threads to run. This can be as many as one per core, or 0 to disallow this + # server from making any scheduling decisions. This defaults to the number of CPU cores. +# num_schedulers = 1 + + # This is an array of strings indicating which sub-schedulers this server will handle. This can be used to + # restrict the evaluations that worker threads will dequeue for processing. This defaults to all available schedulers. +# enabled_schedulers = "[]" + + # This is a string with a unit suffix, such as "300ms", "1.5h" or "25m". Valid time units are "ns", + # "us" (or "µs"), "ms", "s", "m", "h". Controls how long a node must be in a terminal state before it is + # garbage collected and purged from the system. + node_gc_threshold = "6h" + + # When provided, Nomad will ignore a previous leave and attempt to rejoin the cluster when starting. + # By default, Nomad treats leave as a permanent intent and does not attempt to join the cluster again when + # starting. This flag allows the previous state to be used to rejoin the cluster. + rejoin_after_leave = true + + # Similar to start_join but allows retrying a join if the first attempt fails. This is useful for cases + # where we know the address will become available eventually. +# retry_join = [] + + # The time to wait between join attempts. Defaults to 30s. + retry_interval = "30s" + + # The maximum number of join attempts to be made before exiting with a return code of 1. + # By default, this is set to 0 which is interpreted as infinite retries. + retry_max = 0 + + # An array of strings specifying addresses of nodes to join upon startup. If Nomad is unable to join with any + # of the specified addresses, agent startup will fail. By default, the agent won't join any nodes when it starts up. +# start_join = [] +} diff --git a/conf/systemd.service b/conf/systemd.service index 7bb448e..c499c04 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,45 +1,14 @@ [Unit] -Description=Small description of the service +Description=__APP__ agent After=network.target [Service] Type=simple -User=__APP__ -Group=__APP__ -WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/script +User=__SYSTEMD_USER__ +Group=__SYSTEMD_USER__ +ExecStart=/usr/bin/nomad agent -config=__CONFIG_PATH__ StandardOutput=append:/var/log/__APP__/__APP__.log StandardError=inherit -# Sandboxing options to harden security -# Depending on specificities of your service/app, you may need to tweak these -# .. but this should be a good baseline -# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html -NoNewPrivileges=yes -PrivateTmp=yes -PrivateDevices=yes -RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 -RestrictNamespaces=yes -RestrictRealtime=yes -DevicePolicy=closed -ProtectSystem=full -ProtectControlGroups=yes -ProtectKernelModules=yes -ProtectKernelTunables=yes -LockPersonality=yes -SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap - -# Denying access to capabilities that should not be relevant for webapps -# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html -CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD -CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE -CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT -CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK -CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM -CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG -CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE -CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW -CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG - [Install] WantedBy=multi-user.target diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 0685205..1694e75 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,9 +1 @@ -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." +Nomad is a simple and flexible workload orchestrator to deploy and manage containers ([docker](https://www.nomadproject.io/docs/drivers/docker.html), [podman](https://www.nomadproject.io/docs/drivers/podman)), non-containerized applications ([executable](https://www.nomadproject.io/docs/drivers/exec.html), [Java](https://www.nomadproject.io/docs/drivers/java)), and virtual machines ([qemu](https://www.nomadproject.io/docs/drivers/qemu.html)) across on-prem and clouds at scale. diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index aded581..e69de29 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,12 +0,0 @@ -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... - -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? diff --git a/doc/screenshots/assets.png b/doc/screenshots/assets.png new file mode 100644 index 0000000000000000000000000000000000000000..3297d7aa0eb1e3d29dab6c535d33162a72ff08d7 GIT binary patch literal 36526 zcmb@tXIN8P*EWhBsUlU1C~Tz!1f)qvsnS~rLMXzfcSG-@6saObdasEDks7K#@8^Bad9Uv}e@^~DR@Pi|%rV9s;~w`M>w|`x0x1za5di@K=}SdfEdqjT z5CVd$M1(hiE4_IY_5=h01TSTu>v)W>)f1PenR{+d?0WnM$%Vq}lqM`Ssu5sU%<^St* zt$XvdXS41!;{xYD?NHV~y-u&D+sU|t-L$z$ zi8Hb}Bb3F^{>esdN%htb;&9*nF$LHoyhhNsF+{wA*fe*eVnhG4z1Fr!hVZd6OIq*E zdiN@`{c+opH)8TvV`Y@9n0>aIT(R?~AN}N&qeW%|u66kG+QYCt#r)FN^Utb*XNRl% z9}ncc%z7;=dGt$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ifest.json b/manifest.json index edcc504..f544453 100644 --- a/manifest.json +++ b/manifest.json @@ -5,29 +5,25 @@ "description": { "en": "Simple and flexible workload orchestrator" }, - "version": "1.0~ynh1", - "url": "https://example.com", + "version": "1.3.2~ynh1", + "url": "https://www.nomadproject.io/", "upstream": { - "license": "free", - "website": "https://example.com", - "demo": "https://demo.example.com", - "admindoc": "https://yunohost.org/packaging_apps", - "userdoc": "https://yunohost.org/apps", - "code": "https://some.forge.com/example/example" + "license": "MPL-2.0", + "website": "https://www.nomadproject.io/", + "admindoc": "https://www.nomadproject.io/docs", + "code": "https://github.com/hashicorp/nomad" }, - "license": "free", + "license": "MPL-2.0", "maintainer": { - "name": "John doe", - "email": "john.doe@example.com" + "name": "", + "email": "" }, "requirements": { "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ - "nginx", - "php7.3-fpm", - "mysql" + "nginx" ], "arguments": { "install": [ @@ -35,38 +31,28 @@ "name": "domain", "type": "domain" }, - { - "name": "path", - "type": "path", - "example": "/example", - "default": "/example" - }, { "name": "is_public", "type": "boolean", "default": true }, { - "name": "language", + "name": "node_type", "type": "string", "ask": { - "en": "Choose the application language", - "fr": "Choisissez la langue de l'application" + "en": "What kind of Nomad node you want to install ?" }, - "choices": ["fr", "en"], - "default": "fr" + "choices": ["server", "client"], + "default": "server" }, { - "name": "admin", - "type": "user" - }, - { - "name": "password", - "type": "password", - "help": { - "en": "Use the help field to add an information for the admin about this question.", - "fr": "Utilisez le champ aide pour ajouter une information à l'intention de l'administrateur à propos de cette question." - } + "name": "server_ip", + "type": "string", + "ask": { + "en": "[Client only] What is the Ip of the Nomad server node ?" + }, + "example": "192.168.1.100", + "optional": true } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index 7e55ac0..e1a4f0d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,11 @@ #================================================= # dependencies used by the app -pkg_dependencies="deb1 deb2 php$YNH_DEFAULT_PHP_VERSION-deb1 php$YNH_DEFAULT_PHP_VERSION-deb2" +pkg_dependencies="nomad" + +client_pkg_dependencies="pkg-config lxc-dev lxc lxc-templates" + +go_version=1.15 #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index f5d314a..241c88c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,10 +27,8 @@ ynh_print_info --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) domain=$(ynh_app_setting_get --app=$app --key=domain) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= @@ -38,12 +36,6 @@ datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= ynh_print_info --message="Declaring files to be backed up..." -#================================================= -# BACKUP THE APP MAIN DIR -#================================================= - -ynh_backup --src_path="$final_path" - #================================================= # BACKUP THE DATA DIR #================================================= @@ -56,19 +48,6 @@ ynh_backup --src_path="$datadir" --is_big ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP THE PHP-FPM CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# BACKUP FAIL2BAN CONFIGURATION -#================================================= - -ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" - #================================================= # SPECIFIC BACKUP #================================================= @@ -87,16 +66,7 @@ ynh_backup --src_path="/etc/systemd/system/$app.service" # BACKUP VARIOUS FILES #================================================= -ynh_backup --src_path="/etc/cron.d/$app" - -ynh_backup --src_path="/etc/$app/" - -#================================================= -# BACKUP THE MYSQL DATABASE -#================================================= -ynh_print_info --message="Backing up the MySQL database..." - -ynh_mysql_dump_db --database="$db_name" > db.sql +ynh_backup --src_path="$config_path" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index bb9d67a..8b97891 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -27,12 +27,10 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Loading installation settings..." # Needed for helper "ynh_add_nginx_config" -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) # Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) +http_port=$(ynh_app_setting_get --app=$app --key=http_port) #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP @@ -120,7 +118,7 @@ fi ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Nomad agent started" #================================================= # RELOAD NGINX diff --git a/scripts/config b/scripts/config index b9e79f8..85aa2bf 100644 --- a/scripts/config +++ b/scripts/config @@ -22,7 +22,7 @@ ynh_abort_if_errors # RETRIEVE ARGUMENTS #================================================= -final_path=$(ynh_app_setting_get $app final_path) +config_path=$(ynh_app_setting_get $app config_path) #================================================= # SPECIFIC GETTERS FOR TOML SHORT KEY @@ -52,7 +52,7 @@ EOF } get__prices() { - local prices = "$(grep "DONATION\['" "$final_path/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')" + local prices = "$(grep "DONATION\['" "$config_path/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')" if [ "$prices" == "," ]; then # Return YNH_NULL if you prefer to not return a value at all. @@ -85,9 +85,9 @@ set__prices() { frequency=$(echo $price | cut -d/ -f1) currency=$(echo $price | cut -d/ -f2) price_id=$(echo $price | cut -d/ -f3) - sed "d/DONATION\['$frequency'\]\['$currency'\]" "$final_path/settings.py" + sed "d/DONATION\['$frequency'\]\['$currency'\]" "$config_path/settings.py" - echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$final_path/settings.py" + echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$config_path/settings.py" done #--------------------------------------------- diff --git a/scripts/install b/scripts/install index 883fc79..c18429e 100755 --- a/scripts/install +++ b/scripts/install @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_install_go source /usr/share/yunohost/helpers #================================================= @@ -24,22 +25,22 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -language=$YNH_APP_ARG_LANGUAGE -admin=$YNH_APP_ARG_ADMIN -password=$YNH_APP_ARG_PASSWORD +node_type=$YNH_APP_ARG_NODE_TYPE +server_ip=$YNH_APP_ARG_SERVER_IP app=$YNH_APP_INSTANCE_NAME +lxc_bridge="lxcbr0" +plage_ip="10.1.44" +main_iface=$(sudo ip route | grep default | awk '{print $5;}') + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= ynh_script_progression --message="Validating installation parameters..." -final_path=/var/www/$app -test ! -e "$final_path" || ynh_die --message="This path already contains a folder" - # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -50,8 +51,11 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=language --value=$language -ynh_app_setting_set --app=$app --key=admin --value=$admin +ynh_app_setting_set --app=$app --key=node_type --value=$node_type +ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip +ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge +ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip +ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface #================================================= # STANDARD MODIFICATIONS @@ -61,23 +65,37 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_script_progression --message="Finding an available port..." # Find an available port -port=$(ynh_find_port --port=8095) -ynh_app_setting_set --app=$app --key=port --value=$port +http_port=4646 +ynh_port_available --port=$http_port || ynh_die --message="Port $http_port is needs to be available for this app" +ynh_app_setting_set --app=$app --key=http_port --value=$http_port -# Optional: Expose this port publicly -# (N.B.: you only need to do this if the app actually needs to expose the port publicly. -# If you do this and the app doesn't actually need you are CREATING SECURITY HOLES IN THE SERVER !) +rpc_port=4647 +ynh_port_available --port=$rpc_port || ynh_die --message="Port $rpc_port is needs to be available for this app" +ynh_app_setting_set --app=$app --key=rpc_port --value=$rpc_port + +serf_port=4648 +ynh_port_available --port=$serf_port || ynh_die --message="Port $serf_port is needs to be available for this app" +ynh_app_setting_set --app=$app --key=serf_port --value=$serf_port # Open the port -# ynh_script_progression --message="Configuring firewall..." -# ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $port +ynh_script_progression --message="Configuring firewall..." +ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $rpc_port +if [ "$node_type" == "server" ] +then + ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $serf_port +fi #================================================= # INSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Installing dependencies..." -ynh_install_app_dependencies $pkg_dependencies +if [ "$node_type" == "client" ] +then + ynh_install_app_dependencies $client_pkg_dependencies + ynh_install_go --go_version=$go_version +fi +ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" #================================================= # CREATE DEDICATED USER @@ -85,38 +103,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# CREATE A MYSQL DATABASE -#================================================= -ynh_script_progression --message="Creating a MySQL database..." - -db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name -ynh_app_setting_set --app=$app --key=db_name --value=$db_name -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name - -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= -ynh_script_progression --message="Setting up source files..." - -ynh_app_setting_set --app=$app --key=final_path --value=$final_path -# Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$final_path" - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring PHP-FPM..." - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_system_user_create --username=$app #================================================= # NGINX CONFIGURATION @@ -128,10 +115,6 @@ ynh_add_nginx_config #================================================= # SPECIFIC SETUP -#================================================= -# ... -#================================================= - #================================================= # CREATE DATA DIRECTORY #================================================= @@ -141,46 +124,87 @@ datadir=/home/yunohost.app/$app ynh_app_setting_set --app=$app --key=datadir --value=$datadir mkdir -p $datadir +mkdir -p $datadir/plugins chmod 750 "$datadir" chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" +chown -R $app:$app "$datadir" + +#================================================= +# BUILD LXC DRIVER +#================================================= + +if [ "$node_type" == "client" ] +then + ynh_script_progression --message="Building LXC driver..." + + tempdir="$(mktemp -d)" + ynh_setup_source --dest_dir="$tempdir" --source_id="driver-lxc" + + pushd $tempdir + final_path=$tempdir + ynh_use_go + export GOPATH="$tempdir/go" + export GOCACHE="$tempdir/.cache" + $ynh_go build + popd + + mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc + + ynh_secure_remove --file="$tempdir" + ynh_remove_go +fi #================================================= # ADD A CONFIGURATION #================================================= ynh_script_progression --message="Adding a configuration file..." -ynh_add_config --template="some_config_file" --destination="$final_path/some_config_file" +config_path=/etc/$app.d +ynh_app_setting_set --app=$app --key=config_path --value=$config_path -chmod 400 "$final_path/some_config_file" -chown $app:$app "$final_path/some_config_file" +mkdir -p $config_path +chmod 750 "$config_path" +chmod -R o-rwx "$config_path" +chown -R $app:$app "$config_path" + +ynh_add_config --template="../conf/nomad.hcl" --destination="$config_path/nomad.hcl" +chmod 400 "$config_path/nomad.hcl" +chown $app:$app "$config_path/nomad.hcl" + +if [ "$node_type" == "server" ] +then + ynh_add_config --template="../conf/server.hcl" --destination="$config_path/server.hcl" + chmod 400 "$config_path/server.hcl" + chown $app:$app "$config_path/server.hcl" +fi + +if [ "$node_type" == "client" ] +then + ynh_add_config --template="../conf/client.hcl" --destination="$config_path/client.hcl" + chmod 400 "$config_path/client.hcl" + chown $app:$app "$config_path/client.hcl" + + ynh_add_config --template="../conf/lxc_bridge" --destination="/etc/network/interfaces.d/$lxc_bridge" + ifup $lxc_bridge --interfaces=/etc/network/interfaces.d/$lxc_bridge + iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT + iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT + iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE +fi #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Configuring a systemd service..." +systemd_user=$app +if [ "$node_type" == "client" ] +then + systemd_user="root" +fi # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# SETUP APPLICATION WITH CURL -#================================================= -ynh_script_progression --message="Setuping application with CURL..." - -# Set the app as temporarily public for curl call -ynh_script_progression --message="Configuring SSOwat..." -# Making the app public for curl -ynh_permission_update --permission="main" --add="visitors" - -# Installation with curl -ynh_script_progression --message="Finalizing installation..." -ynh_local_curl "/INSTALL_PATH" "key1=value1" "key2=value2" "key3=value3" - -# Remove the public access -ynh_permission_update --permission="main" --remove="visitors" - #================================================= # GENERIC FINALIZATION #================================================= @@ -204,15 +228,7 @@ yunohost service add $app --log="/var/log/$app/$app.log" ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - -#================================================= -# SETUP FAIL2BAN -#================================================= -ynh_script_progression --message="Configuring Fail2Ban..." - -# Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Nomad agent started" #================================================= # SETUP SSOWAT @@ -227,14 +243,6 @@ then ynh_permission_update --permission="main" --add="visitors" fi -# Only the admin can access the admin panel of the app (if the app has an admin panel) -ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin - -# Everyone can access the API part -# We don't want to display the tile in the SSO so we put --show_tile="false" -# And we don't want the YunoHost admin to be able to remove visitors group to this permission, so we put --protected="true" -ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" - #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/remove b/scripts/remove index 7d50280..f4f579b 100755 --- a/scripts/remove +++ b/scripts/remove @@ -17,11 +17,11 @@ ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) -port=$(ynh_app_setting_get --app=$app --key=port) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -final_path=$(ynh_app_setting_get --app=$app --key=final_path) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) +node_type=$(ynh_app_setting_get --app=$app --key=node_type) +rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) +serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) #================================================= # STANDARD REMOVE @@ -52,22 +52,6 @@ ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Removing the MySQL database..." - -# Remove a database if it exists, along with the associated user -ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name - -#================================================= -# REMOVE APP MAIN DIR -#================================================= -ynh_script_progression --message="Removing app main directory..." - -# Remove the app directory securely -ynh_secure_remove --file="$final_path" - #================================================= # REMOVE DATA DIR #================================================= @@ -87,14 +71,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." - -# Remove the dedicated PHP-FPM config -ynh_remove_fpm_config - #================================================= # REMOVE DEPENDENCIES #================================================= @@ -107,19 +83,26 @@ ynh_remove_app_dependencies # CLOSE A PORT #================================================= -if yunohost firewall list | grep -q "\- $port$" +if yunohost firewall list | grep -q "\- $rpc_port$" then - ynh_script_progression --message="Closing port $port..." - ynh_exec_warn_less yunohost firewall disallow TCP $port + ynh_script_progression --message="Closing port $rpc_port..." + ynh_exec_warn_less yunohost firewall disallow TCP $rpc_port fi -#================================================= -# REMOVE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Removing Fail2Ban configuration..." +if yunohost firewall list | grep -q "\- $serf_port$" +then + ynh_script_progression --message="Closing port $serf_port..." + ynh_exec_warn_less yunohost firewall disallow TCP $serf_port +fi -# Remove the dedicated Fail2Ban config -ynh_remove_fail2ban_config +if [ "$node_type" == "client" ] +then + + lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) + + ifdown --force $lxc_bridge + ynh_secure_remove --file="/etc/network/interfaces.d/$lxc_bridge" +fi #================================================= # SPECIFIC REMOVE @@ -128,11 +111,8 @@ ynh_remove_fail2ban_config #================================================= ynh_script_progression --message="Removing various files..." -# Remove a cron file -ynh_secure_remove --file="/etc/cron.d/$app" - # Remove a directory securely -ynh_secure_remove --file="/etc/$app" +ynh_secure_remove --file="$config_path" # Remove the log files ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index 9549d86..f271791 100755 --- a/scripts/restore +++ b/scripts/restore @@ -29,20 +29,18 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) +node_type=$(ynh_app_setting_get --app=$app --key=node_type) +http_port=$(ynh_app_setting_get --app=$app --key=http_port) +rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) +serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path \ - || ynh_die --message="There is already a directory: $final_path " - #================================================= # STANDARD RESTORATION STEPS #================================================= @@ -51,18 +49,7 @@ test ! -d $final_path \ ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." - -ynh_restore_file --origin_path="$final_path" - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +ynh_system_user_create --username=$app #================================================= # RESTORE THE DATA DIRECTORY @@ -75,16 +62,7 @@ mkdir -p $datadir chmod 750 "$datadir" chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - -#================================================= -# RESTORE FAIL2BAN CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the Fail2Ban configuration..." - -ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf" -ynh_restore_file --origin_path="/etc/fail2ban/filter.d/$app.conf" -ynh_systemd_action --action=restart --service_name=fail2ban +chown -R $app:$app "$datadir" #================================================= # SPECIFIC RESTORATION @@ -93,15 +71,11 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= ynh_script_progression --message="Reinstalling dependencies..." -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +if [ "$node_type" == "client" ] +then + ynh_install_app_dependencies $client_pkg_dependencies +fi +ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" #================================================= # RESTORE THE NGINX CONFIGURATION @@ -110,23 +84,38 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." - -db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - #================================================= # RESTORE VARIOUS FILES #================================================= ynh_script_progression --message="Restoring various files..." -ynh_restore_file --origin_path="/etc/cron.d/$app" +ynh_restore_file --origin_path="$config_path" -ynh_restore_file --origin_path="/etc/$app/" +chmod 750 "$config_path" +chmod -R o-rwx "$config_path" +chown -R $app:$app "$config_path" + +# Open the port +ynh_script_progression --message="Configuring firewall..." +ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $rpc_port +if [ "$node_type" == "server" ] +then + ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $serf_port +fi + +if [ "$node_type" == "client" ] +then + + lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) + plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) + main_iface=$(sudo ip route | grep default | awk '{print $5;}') + ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface + ynh_add_config --template="../conf/lxc_bridge" --destination="/etc/network/interfaces.d/$lxc_bridge" + ifup $lxc_bridge --interfaces=/etc/network/interfaces.d/$lxc_bridge + iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT + iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT + iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE +fi #================================================= # RESTORE SYSTEMD @@ -155,16 +144,15 @@ yunohost service add $app --log="/var/log/$app/$app.log" #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Nomad agent started" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX AND PHP-FPM +# RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." +ynh_script_progression --message="Reloading NGINX web server..." -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5dcba32..b30f818 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_install_go source /usr/share/yunohost/helpers #================================================= @@ -18,10 +19,11 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -language=$(ynh_app_setting_get --app=$app --key=language) -admin=$(ynh_app_setting_get --app=$app --key=admin) -final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) +config_path=$(ynh_app_setting_get --app=$app --key=config_path) +node_type=$(ynh_app_setting_get --app=$app --key=node_type) +http_port=$(ynh_app_setting_get --app=$app --key=http_port) +rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) +serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) #================================================= # CHECK VERSION @@ -66,54 +68,25 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -if ! ynh_permission_exists --permission="admin"; then - # Create the required permissions - ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin -fi - -# Create a permission if needed -if ! ynh_permission_exists --permission="api"; then - ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" -fi - #================================================= # CREATE DEDICATED USER #================================================= ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir="$final_path" - -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" -fi - -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" +ynh_system_user_create --username=$app #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_script_progression --message="Upgrading dependencies..." -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config +if [ "$node_type" == "client" ] +then + ynh_install_app_dependencies $client_pkg_dependencies + ynh_install_go --go_version=$go_version +fi +ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" #================================================= # NGINX CONFIGURATION @@ -126,24 +99,68 @@ ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE #================================================= -# ... +# BUILD LXC DRIVER #================================================= +if [ "$node_type" == "client" ] +then + ynh_script_progression --message="Building LXC driver..." + + tempdir="$(mktemp -d)" + ynh_setup_source --dest_dir="$tempdir" --source_id="driver-lxc" + + pushd $tempdir + final_path=$tempdir + ynh_use_go + export GOPATH="$tempdir/go" + export GOCACHE="$tempdir/.cache" + $ynh_go build + popd + + mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc + + ynh_secure_remove --file="$tempdir" + ynh_remove_go +fi + #================================================= # UPDATE A CONFIG FILE #================================================= ynh_script_progression --message="Updating a configuration file..." -ynh_add_config --template="some_config_file" --destination="$final_path/some_config_file" +mkdir -p $config_path +chmod 750 "$config_path" +chmod -R o-rwx "$config_path" +chown -R $app:$app "$config_path" -chmod 400 "$final_path/some_config_file" -chown $app:$app "$final_path/some_config_file" +ynh_add_config --template="../conf/nomad.hcl" --destination="$config_path/nomad.hcl" +chmod 400 "$config_path/nomad.hcl" +chown $app:$app "$config_path/nomad.hcl" + +if [ "$node_type" == "server" ] +then + ynh_add_config --template="../conf/server.hcl" --destination="$config_path/server.hcl" + chmod 400 "$config_path/server.hcl" + chown $app:$app "$config_path/server.hcl" +fi + +if [ "$node_type" == "client" ] +then + ynh_add_config --template="../conf/client.hcl" --destination="$config_path/client.hcl" + chmod 400 "$config_path/client.hcl" + chown $app:$app "$config_path/client.hcl" +fi #================================================= # SETUP SYSTEMD #================================================= ynh_script_progression --message="Upgrading systemd configuration..." +systemd_user=$app +if [ "$node_type" == "client" ] +then + systemd_user="root" +fi # Create a dedicated systemd config ynh_add_systemd_config @@ -169,15 +186,7 @@ yunohost service add $app --log="/var/log/$app/$app.log" #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" - -#================================================= -# UPGRADE FAIL2BAN -#================================================= -ynh_script_progression --message="Reconfiguring Fail2Ban..." - -# Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login" +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Nomad agent started" #================================================= # RELOAD NGINX diff --git a/scripts/ynh_install_go b/scripts/ynh_install_go new file mode 100644 index 0000000..e3ad06a --- /dev/null +++ b/scripts/ynh_install_go @@ -0,0 +1,247 @@ +#!/bin/bash + +ynh_go_try_bash_extension() { + if [ -x src/configure ]; then + src/configure && make -C src || { + ynh_print_info --message="Optional bash extension failed to build, but things will still work normally." + } + fi +} + +goenv_install_dir="/opt/goenv" +go_version_path="$goenv_install_dir/versions" +# goenv_ROOT is the directory of goenv, it needs to be loaded as a environment variable. +export GOENV_ROOT="$goenv_install_dir" + +# Load the version of Go for an app, and set variables. +# +# ynh_use_go has to be used in any app scripts before using Go for the first time. +# This helper will provide alias and variables to use in your scripts. +# +# To use gem or Go, use the alias `ynh_gem` and `ynh_go` +# Those alias will use the correct version installed for the app +# For example: use `ynh_gem install` instead of `gem install` +# +# With `sudo` or `ynh_exec_as`, use instead the fallback variables `$ynh_gem` and `$ynh_go` +# And propagate $PATH to sudo with $ynh_go_load_path +# Exemple: `ynh_exec_as $app $ynh_go_load_path $ynh_gem install` +# +# $PATH contains the path of the requested version of Go. +# However, $PATH is duplicated into $go_path to outlast any manipulation of $PATH +# You can use the variable `$ynh_go_load_path` to quickly load your Go version +# in $PATH for an usage into a separate script. +# Exemple: $ynh_go_load_path $final_path/script_that_use_gem.sh` +# +# +# Finally, to start a Go service with the correct version, 2 solutions +# Either the app is dependent of Go or gem, but does not called it directly. +# In such situation, you need to load PATH +# `Environment="__YNH_GO_LOAD_PATH__"` +# `ExecStart=__FINALPATH__/my_app` +# You will replace __YNH_GO_LOAD_PATH__ with $ynh_go_load_path +# +# Or Go start the app directly, then you don't need to load the PATH variable +# `ExecStart=__YNH_GO__ my_app run` +# You will replace __YNH_GO__ with $ynh_go +# +# +# one other variable is also available +# - $go_path: The absolute path to Go binaries for the chosen version. +# +# usage: ynh_use_go +# +# Requires YunoHost version 3.2.2 or higher. +ynh_use_go () { + go_version=$(ynh_app_setting_get --app=$app --key=go_version) + + # Get the absolute path of this version of Go + go_path="$go_version_path/$go_version/bin" + + # Allow alias to be used into bash script + shopt -s expand_aliases + + # Create an alias for the specific version of Go and a variable as fallback + ynh_go="$go_path/go" + alias ynh_go="$ynh_go" + + # Load the path of this version of Go in $PATH + if [[ :$PATH: != *":$go_path"* ]]; then + PATH="$go_path:$PATH" + fi + # Create an alias to easily load the PATH + ynh_go_load_path="PATH=$PATH" + + # Sets the local application-specific Go version + pushd $final_path + $goenv_install_dir/bin/goenv local $go_version + popd +} + +# Install a specific version of Go +# +# ynh_install_go will install the version of Go provided as argument by using goenv. +# +# This helper creates a /etc/profile.d/goenv.sh that configures PATH environment for goenv +# for every LOGIN user, hence your user must have a defined shell (as opposed to /usr/sbin/nologin) +# +# Don't forget to execute go-dependent command in a login environment +# (e.g. sudo --login option) +# When not possible (e.g. in systemd service definition), please use direct path +# to goenv shims (e.g. $goenv_ROOT/shims/bundle) +# +# usage: ynh_install_go --go_version=go_version +# | arg: -v, --go_version= - Version of go to install. +# +# Requires YunoHost version 3.2.2 or higher. +ynh_install_go () { + # Declare an array to define the options of this helper. + local legacy_args=v + local -A args_array=( [v]=go_version= ) + local go_version + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + # Load goenv path in PATH + local CLEAR_PATH="$goenv_install_dir/bin:$PATH" + + # Remove /usr/local/bin in PATH in case of Go prior installation + PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') + + # Move an existing Go binary, to avoid to block goenv + test -x /usr/bin/go && mv /usr/bin/go /usr/bin/go_goenv + + # Install or update goenv + goenv="$(command -v goenv $goenv_install_dir/bin/goenv | head -1)" + if [ -n "$goenv" ]; then + ynh_print_info --message="goenv already seems installed in \`$goenv'." + pushd "${goenv%/*/*}" + if git remote -v 2>/dev/null | grep "https://github.com/syndbg/goenv.git"; then + echo "Trying to update with git..." + git pull -q --tags origin master + cd .. + ynh_go_try_bash_extension + fi + popd + else + ynh_print_info --message="Installing goenv with git..." + mkdir -p $goenv_install_dir + pushd $goenv_install_dir + git init -q + git remote add -f -t master origin https://github.com/syndbg/goenv.git > /dev/null 2>&1 + git checkout -q -b master origin/master + ynh_go_try_bash_extension + goenv=$goenv_install_dir/bin/goenv + popd + fi + + goenv_latest="$(command -v "$goenv_install_dir"/plugins/*/bin/goenv-latest goenv-latest | head -1)" + if [ -n "$goenv_latest" ]; then + ynh_print_info --message="\`goenv latest' command already available in \`$goenv_latest'." + pushd "${goenv_latest%/*/*}" + if git remote -v 2>/dev/null | grep "https://github.com/momo-lab/xxenv-latest.git"; then + ynh_print_info --message="Trying to update xxenv-latest with git..." + git pull -q origin master + fi + popd + else + ynh_print_info --message="Installing xxenv-latest with git..." + mkdir -p "${goenv_install_dir}/plugins" + git clone -q https://github.com/momo-lab/xxenv-latest.git "${goenv_install_dir}/plugins/xxenv-latest" + fi + + # Enable caching + mkdir -p "${goenv_install_dir}/cache" + + # Create shims directory if needed + mkdir -p "${goenv_install_dir}/shims" + + # Restore /usr/local/bin in PATH + PATH=$CLEAR_PATH + + # And replace the old Go binary + test -x /usr/bin/go_goenv && mv /usr/bin/go_goenv /usr/bin/go + + # Install the requested version of Go + local final_go_version=$(goenv latest --print $go_version) + ynh_print_info --message="Installation of Go-$final_go_version" + goenv install --skip-existing $final_go_version + + # Store go_version into the config of this app + ynh_app_setting_set --app=$YNH_APP_INSTANCE_NAME --key=go_version --value=$final_go_version + + # Cleanup Go versions + ynh_cleanup_go + + # Set environment for Go users + echo "#goenv +export GOENV_ROOT=$goenv_install_dir +export PATH=\"$goenv_install_dir/bin:$PATH\" +eval \"\$(goenv init -)\" +#goenv" > /etc/profile.d/goenv.sh + + # Load the environment + eval "$(goenv init -)" +} + +# Remove the version of Go used by the app. +# +# This helper will also cleanup Go versions +# +# usage: ynh_remove_go +ynh_remove_go () { + local go_version=$(ynh_app_setting_get --app=$YNH_APP_INSTANCE_NAME --key=go_version) + + # Load goenv path in PATH + local CLEAR_PATH="$goenv_install_dir/bin:$PATH" + + # Remove /usr/local/bin in PATH in case of Go prior installation + PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') + + # Remove the line for this app + ynh_app_setting_delete --app=$YNH_APP_INSTANCE_NAME --key=go_version + + # Cleanup Go versions + ynh_cleanup_go +} + +# Remove no more needed versions of Go used by the app. +# +# This helper will check what Go version are no more required, +# and uninstall them +# If no app uses Go, goenv will be also removed. +# +# usage: ynh_cleanup_go +ynh_cleanup_go () { + + # List required Go versions + local installed_apps=$(yunohost app list --output-as json --quiet | jq -r .apps[].id) + local required_go_versions="" + for installed_app in $installed_apps + do + local installed_app_go_version=$(ynh_app_setting_get --app=$installed_app --key="go_version") + if [[ $installed_app_go_version ]] + then + required_go_versions="${installed_app_go_version}\n${required_go_versions}" + fi + done + + # Remove no more needed Go versions + local installed_go_versions=$(goenv versions --bare --skip-aliases | grep -Ev '/') + for installed_go_version in $installed_go_versions + do + if ! `echo ${required_go_versions} | grep "${installed_go_version}" 1>/dev/null 2>&1` + then + ynh_print_info --message="Removing of Go-$installed_go_version" + $goenv_install_dir/bin/goenv uninstall --force $installed_go_version + fi + done + + # If none Go version is required + if [[ ! $required_go_versions ]] + then + # Remove goenv environment configuration + ynh_print_info --message="Removing of goenv" + ynh_secure_remove --file="$goenv_install_dir" + ynh_secure_remove --file="/etc/profile.d/goenv.sh" + fi +} From b1effe472b7ba0822eede561aaec6596e2df0dba Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 21 Jul 2022 06:24:35 +0000 Subject: [PATCH 02/36] Auto-update README --- README.md | 37 ++++++------------------------------- README_fr.md | 37 ++++++------------------------------- 2 files changed, 12 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 1789a62..8bc517b 100644 --- a/README.md +++ b/README.md @@ -15,46 +15,21 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." +Nomad is a simple and flexible workload orchestrator to deploy and manage containers ([docker](https://www.nomadproject.io/docs/drivers/docker.html), [podman](https://www.nomadproject.io/docs/drivers/podman)), non-containerized applications ([executable](https://www.nomadproject.io/docs/drivers/exec.html), [Java](https://www.nomadproject.io/docs/drivers/java)), and virtual machines ([qemu](https://www.nomadproject.io/docs/drivers/qemu.html)) across on-prem and clouds at scale. -**Shipped version:** 1.0~ynh1 - -**Demo:** https://demo.example.com +**Shipped version:** 1.3.2~ynh1 ## Screenshots +![Screenshot of Nomad](./doc/screenshots/assets.png) ![Screenshot of Nomad](./doc/screenshots/example.jpg) -## Disclaimers / important information - -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... - -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? - ## Documentation and resources -* Official app website: -* Official user documentation: -* Official admin documentation: -* Upstream app code repository: +* Official app website: +* Official admin documentation: +* Upstream app code repository: * YunoHost documentation for this app: * Report a bug: diff --git a/README_fr.md b/README_fr.md index 2476f76..27aead9 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,46 +15,21 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour ## Vue d'ensemble -Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. - -### Features - -- Ut enim ad minim veniam, quis nostrud exercitation ullamco ; -- Laboris nisi ut aliquip ex ea commodo consequat ; -- Duis aute irure dolor in reprehenderit in voluptate ; -- Velit esse cillum dolore eu fugiat nulla pariatur ; -- Excepteur sint occaecat cupidatat non proident, sunt in culpa." +Nomad is a simple and flexible workload orchestrator to deploy and manage containers ([docker](https://www.nomadproject.io/docs/drivers/docker.html), [podman](https://www.nomadproject.io/docs/drivers/podman)), non-containerized applications ([executable](https://www.nomadproject.io/docs/drivers/exec.html), [Java](https://www.nomadproject.io/docs/drivers/java)), and virtual machines ([qemu](https://www.nomadproject.io/docs/drivers/qemu.html)) across on-prem and clouds at scale. -**Version incluse :** 1.0~ynh1 - -**Démo :** https://demo.example.com +**Version incluse :** 1.3.2~ynh1 ## Captures d'écran +![Capture d'écran de Nomad](./doc/screenshots/assets.png) ![Capture d'écran de Nomad](./doc/screenshots/example.jpg) -## Avertissements / informations importantes - -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * requiring a full dedicated domain ? - * architectures not supported ? - * not-working single-sign on or LDAP integration ? - * the app requires an important amount of RAM / disk / .. to install or to work properly - * etc... - -* Other infos that people should be aware of, such as: - * any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...) - * how to configure / administrate the application if it ain't obvious - * upgrade process / specificities / things to be aware of ? - * security considerations ? - ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle utilisateur : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l'app : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : * Documentation YunoHost pour cette app : * Signaler un bug : From 76ee33d927e6ae1d01f087a4d021a3829ce24be0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 19:46:49 +0200 Subject: [PATCH 03/36] disable multi_instance --- check_process | 4 ++-- manifest.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 8b7a1e0..52e6750 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,7 @@ upgrade=1 #upgrade=1 from_commit=CommitHash backup_restore=1 - multi_instance=1 + multi_instance=0 port_already_use=0 change_url=1 ;; Test complet client @@ -33,7 +33,7 @@ upgrade=1 #upgrade=1 from_commit=CommitHash backup_restore=1 - multi_instance=1 + multi_instance=0 port_already_use=0 change_url=1 ;;; Options diff --git a/manifest.json b/manifest.json index f544453..1953668 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "requirements": { "yunohost": ">= 4.3.0" }, - "multi_instance": true, + "multi_instance": false, "services": [ "nginx" ], From 629fbd55c55f89cbf08f6dbce337b5a0e8195f34 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 19:51:27 +0200 Subject: [PATCH 04/36] Fix needs_exposed_ports --- scripts/install | 4 +++- scripts/restore | 4 +++- scripts/upgrade | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index c18429e..740294c 100755 --- a/scripts/install +++ b/scripts/install @@ -80,9 +80,11 @@ ynh_app_setting_set --app=$app --key=serf_port --value=$serf_port # Open the port ynh_script_progression --message="Configuring firewall..." ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $rpc_port +needs_exposed_ports="$rpc_port" if [ "$node_type" == "server" ] then ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $serf_port + needs_exposed_ports="$serf_port $needs_exposed_ports" fi #================================================= @@ -220,7 +222,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index f271791..7f460de 100755 --- a/scripts/restore +++ b/scripts/restore @@ -98,9 +98,11 @@ chown -R $app:$app "$config_path" # Open the port ynh_script_progression --message="Configuring firewall..." ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $rpc_port +needs_exposed_ports="$rpc_port" if [ "$node_type" == "server" ] then ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $serf_port + needs_exposed_ports="$serf_port $needs_exposed_ports" fi if [ "$node_type" == "client" ] @@ -137,7 +139,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index b30f818..b8d7869 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -179,7 +179,12 @@ ynh_use_logrotate --non-append #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" +needs_exposed_ports="$rpc_port" +if [ "$node_type" == "server" ] +then + needs_exposed_ports="$serf_port $needs_exposed_ports" +fi +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" #================================================= # START SYSTEMD SERVICE From 7f6f33211076ef15238e2889a4b47f6fa117f2d7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 19:52:20 +0200 Subject: [PATCH 05/36] Remove sudo --- scripts/install | 2 +- scripts/restore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 740294c..dcf3404 100755 --- a/scripts/install +++ b/scripts/install @@ -34,7 +34,7 @@ app=$YNH_APP_INSTANCE_NAME lxc_bridge="lxcbr0" plage_ip="10.1.44" -main_iface=$(sudo ip route | grep default | awk '{print $5;}') +main_iface=$(ip route | grep default | awk '{print $5;}') #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS diff --git a/scripts/restore b/scripts/restore index 7f460de..ea9cf10 100755 --- a/scripts/restore +++ b/scripts/restore @@ -110,7 +110,7 @@ then lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) - main_iface=$(sudo ip route | grep default | awk '{print $5;}') + main_iface=$(ip route | grep default | awk '{print $5;}') ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface ynh_add_config --template="../conf/lxc_bridge" --destination="/etc/network/interfaces.d/$lxc_bridge" ifup $lxc_bridge --interfaces=/etc/network/interfaces.d/$lxc_bridge From 15516013e0f395bfdb8c4f2b7003f1e18049805c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 19:56:12 +0200 Subject: [PATCH 06/36] Fix logs --- scripts/restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/restore b/scripts/restore index ea9cf10..dbca386 100755 --- a/scripts/restore +++ b/scripts/restore @@ -132,6 +132,8 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Restoring the logrotate configuration..." +mkdir -p /var/log/$app +chown -R $app:$app "/var/log/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= From 72cd4227a552cd7fdf39688710a78656a53439d8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 19:56:55 +0200 Subject: [PATCH 07/36] Missing datadir --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index b8d7869..551cbb2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) config_path=$(ynh_app_setting_get --app=$app --key=config_path) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) node_type=$(ynh_app_setting_get --app=$app --key=node_type) http_port=$(ynh_app_setting_get --app=$app --key=http_port) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) From 8e88d1549d865769c19967d38b6e7738112cb650 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 20:25:55 +0200 Subject: [PATCH 08/36] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 1953668..5e0561f 100644 --- a/manifest.json +++ b/manifest.json @@ -49,7 +49,7 @@ "name": "server_ip", "type": "string", "ask": { - "en": "[Client only] What is the Ip of the Nomad server node ?" + "en": "[Client only] What is the IP of the Nomad server node ?" }, "example": "192.168.1.100", "optional": true From 2ce28c4e3ff59e6e0feaa64fdf0f70ca212c70bb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 21 Jul 2022 23:14:02 +0200 Subject: [PATCH 09/36] fix needs_exposed_ports --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index dcf3404..fcc3fdd 100755 --- a/scripts/install +++ b/scripts/install @@ -222,7 +222,7 @@ ynh_use_logrotate #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports $needs_exposed_ports #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index dbca386..aafd41a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -141,7 +141,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." -yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports $needs_exposed_ports #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 551cbb2..4a5239f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -185,7 +185,7 @@ if [ "$node_type" == "server" ] then needs_exposed_ports="$serf_port $needs_exposed_ports" fi -yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports="$needs_exposed_ports" +yunohost service add $app --log="/var/log/$app/$app.log" --needs_exposed_ports $needs_exposed_ports #================================================= # START SYSTEMD SERVICE From fb0d5a7fb8baffea83e9c39c1d7efbb2e9a30f47 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 00:25:18 +0200 Subject: [PATCH 10/36] Update check_process --- check_process | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/check_process b/check_process index 52e6750..4b75a1f 100644 --- a/check_process +++ b/check_process @@ -1,22 +1,3 @@ -;; Test complet server - ; Manifest - domain="domain.tld" - is_public=1 - node_type="server" - server_ip="none..." - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - #upgrade=1 from_commit=CommitHash - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=1 ;; Test complet client ; Manifest domain="domain.tld" @@ -36,6 +17,25 @@ multi_instance=0 port_already_use=0 change_url=1 +;; Test complet server + ; Manifest + domain="domain.tld" + is_public=1 + node_type="server" + server_ip="none..." + ; Checks + pkg_linter=1 + setup_sub_dir=0 + setup_root=1 + setup_nourl=0 + setup_private=1 + setup_public=1 + upgrade=1 + #upgrade=1 from_commit=CommitHash + backup_restore=1 + multi_instance=0 + port_already_use=0 + change_url=1 ;;; Options Email= Notification=none From dbb99a141a91ff8efb982a7e9bafa00116d04559 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 02:31:36 +0200 Subject: [PATCH 11/36] Implement bridge --- conf/default.conf | 6 ++ conf/lxc-net | 9 +++ conf/lxc_bridge | 6 -- doc/DISCLAIMER.md | 175 ++++++++++++++++++++++++++++++++++++++++++++++ scripts/install | 16 +++-- scripts/remove | 22 +++--- scripts/restore | 17 +++-- 7 files changed, 225 insertions(+), 26 deletions(-) create mode 100644 conf/default.conf create mode 100644 conf/lxc-net delete mode 100644 conf/lxc_bridge diff --git a/conf/default.conf b/conf/default.conf new file mode 100644 index 0000000..89f8c4b --- /dev/null +++ b/conf/default.conf @@ -0,0 +1,6 @@ +lxc.net.0.type = veth +lxc.net.0.link = __LXC_BRIDGE__ +lxc.net.0.flags = up +lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx +lxc.apparmor.profile = generated +lxc.apparmor.allow_nesting = 1 diff --git a/conf/lxc-net b/conf/lxc-net new file mode 100644 index 0000000..c19bedb --- /dev/null +++ b/conf/lxc-net @@ -0,0 +1,9 @@ +USE_LXC_BRIDGE="true" +LXC_BRIDGE="__LXC_BRIDGE__" +LXC_ADDR="__PLAGE_IP__.1" +LXC_NETMASK="255.255.255.0" +LXC_NETWORK="__PLAGE_IP__.0/24" +LXC_DHCP_RANGE="__PLAGE_IP__.2,__PLAGE_IP__.254" +LXC_DHCP_MAX="253" +LXC_DHCP_CONFILE="" +LXC_DOMAIN="" diff --git a/conf/lxc_bridge b/conf/lxc_bridge deleted file mode 100644 index ad75592..0000000 --- a/conf/lxc_bridge +++ /dev/null @@ -1,6 +0,0 @@ -auto __LXC_BRIDGE__ -iface __LXC_BRIDGE__ inet static - address __PLAGE_IP__.1/24 - bridge_ports none - bridge_fd 0 - bridge_maxwait 0 \ No newline at end of file diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index e69de29..f37d4cd 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -0,0 +1,175 @@ +## Some Nomad Job examples + +### Busybox + +`lxc-create --name=busybox --template=busybox` + +``` +job "job-busybox" { + datacenters = ["dc1"] + type = "service" + + group "group-busybox" { + task "task-busybox" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-busybox" + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian + +`lxc-create --name=debian --template=debian` + +``` +job "job-debian" { + datacenters = ["dc1"] + type = "service" + + group "group-debian" { + task "task-debian" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian Stretch + +`lxc-create --name=stretch --template=debian -- --release=stretch` + +``` +job "job-stretch" { + datacenters = ["dc1"] + type = "service" + + group "group-stretch" { + task "task-stretch" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + template_args = ["--release=stretch"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +} +``` + +### Debian Buster + +`lxc-create --name=buster --template=debian -- --release=buster` + +``` +job "job-buster" { + datacenters = ["dc1"] + type = "service" + + group "group-buster" { + task "task-buster" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + template_args = ["--release=buster"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +} +``` + +### Debian Buster from images.linuxcontainers.org + +`lxc-create --name=download-buster --template=download -- --dist=debian --release=buster --arch=amd64 --keyserver=hkp://keyserver.ubuntu.com` + +``` +job "job-download-buster" { + datacenters = ["dc1"] + type = "service" + + group "group-download-buster" { + task "task-download-buster" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-download" + template_args = ["--dist=debian","--release=buster","--arch=amd64","--keyserver=hkp://keyserver.ubuntu.com"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian Bullseye from images.linuxcontainers.org + +`lxc-create --name=download-bullseye --template=download -- --dist=debian --release=bullseye --arch=amd64 --keyserver=hkp://keyserver.ubuntu.com` + +``` +job "job-download-bullseye" { + datacenters = ["dc1"] + type = "service" + + group "group-download-bullseye" { + task "task-download-bullseye" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-download" + template_args = ["--dist=debian","--release=bullseye","--arch=amd64","--keyserver=hkp://keyserver.ubuntu.com"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` diff --git a/scripts/install b/scripts/install index fcc3fdd..9ea0f5f 100755 --- a/scripts/install +++ b/scripts/install @@ -187,11 +187,17 @@ then chmod 400 "$config_path/client.hcl" chown $app:$app "$config_path/client.hcl" - ynh_add_config --template="../conf/lxc_bridge" --destination="/etc/network/interfaces.d/$lxc_bridge" - ifup $lxc_bridge --interfaces=/etc/network/interfaces.d/$lxc_bridge - iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT - iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT - iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE + echo "bind-interfaces +except-interface=lxdbr0" > /etc/dnsmasq.d/lxd + systemctl restart dnsmasq + + ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" + ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + systemctl enable lxc-net --quiet + systemctl start lxc-net --quiet + #iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT + #iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT + #iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE fi #================================================= diff --git a/scripts/remove b/scripts/remove index f4f579b..648451f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -71,14 +71,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # CLOSE A PORT #================================================= @@ -100,10 +92,20 @@ then lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - ifdown --force $lxc_bridge - ynh_secure_remove --file="/etc/network/interfaces.d/$lxc_bridge" + systemctl stop lxc-net --quiet + systemctl disable lxc-net --quiet + ynh_secure_remove --file="/etc/default/lxc-net" + ynh_secure_remove --file="/etc/lxc/default.conf" fi +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index aafd41a..0cc003f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -112,11 +112,18 @@ then plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) main_iface=$(ip route | grep default | awk '{print $5;}') ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface - ynh_add_config --template="../conf/lxc_bridge" --destination="/etc/network/interfaces.d/$lxc_bridge" - ifup $lxc_bridge --interfaces=/etc/network/interfaces.d/$lxc_bridge - iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT - iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT - iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE + + echo "bind-interfaces +except-interface=lxdbr0" > /etc/dnsmasq.d/lxd + systemctl restart dnsmasq + + ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" + systemctl enable lxc-net --quiet + systemctl start lxc-net --quiet + #iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT + #iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT + #iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE fi #================================================= From 7de044879a9ce3c173012bd154457ec132d31f60 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 22 Jul 2022 00:31:41 +0000 Subject: [PATCH 12/36] Auto-update README --- README.md | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 356 insertions(+) diff --git a/README.md b/README.md index 8bc517b..e7e31c5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,184 @@ Nomad is a simple and flexible workload orchestrator to deploy and manage contai ![Screenshot of Nomad](./doc/screenshots/assets.png) ![Screenshot of Nomad](./doc/screenshots/example.jpg) +## Disclaimers / important information + +## Some Nomad Job examples + +### Busybox + +`lxc-create --name=busybox --template=busybox` + +``` +job "job-busybox" { + datacenters = ["dc1"] + type = "service" + + group "group-busybox" { + task "task-busybox" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-busybox" + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian + +`lxc-create --name=debian --template=debian` + +``` +job "job-debian" { + datacenters = ["dc1"] + type = "service" + + group "group-debian" { + task "task-debian" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian Stretch + +`lxc-create --name=stretch --template=debian -- --release=stretch` + +``` +job "job-stretch" { + datacenters = ["dc1"] + type = "service" + + group "group-stretch" { + task "task-stretch" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + template_args = ["--release=stretch"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +} +``` + +### Debian Buster + +`lxc-create --name=buster --template=debian -- --release=buster` + +``` +job "job-buster" { + datacenters = ["dc1"] + type = "service" + + group "group-buster" { + task "task-buster" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + template_args = ["--release=buster"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +} +``` + +### Debian Buster from images.linuxcontainers.org + +`lxc-create --name=download-buster --template=download -- --dist=debian --release=buster --arch=amd64 --keyserver=hkp://keyserver.ubuntu.com` + +``` +job "job-download-buster" { + datacenters = ["dc1"] + type = "service" + + group "group-download-buster" { + task "task-download-buster" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-download" + template_args = ["--dist=debian","--release=buster","--arch=amd64","--keyserver=hkp://keyserver.ubuntu.com"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian Bullseye from images.linuxcontainers.org + +`lxc-create --name=download-bullseye --template=download -- --dist=debian --release=bullseye --arch=amd64 --keyserver=hkp://keyserver.ubuntu.com` + +``` +job "job-download-bullseye" { + datacenters = ["dc1"] + type = "service" + + group "group-download-bullseye" { + task "task-download-bullseye" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-download" + template_args = ["--dist=debian","--release=bullseye","--arch=amd64","--keyserver=hkp://keyserver.ubuntu.com"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + ## Documentation and resources * Official app website: diff --git a/README_fr.md b/README_fr.md index 27aead9..a47a8fd 100644 --- a/README_fr.md +++ b/README_fr.md @@ -25,6 +25,184 @@ Nomad is a simple and flexible workload orchestrator to deploy and manage contai ![Capture d'écran de Nomad](./doc/screenshots/assets.png) ![Capture d'écran de Nomad](./doc/screenshots/example.jpg) +## Avertissements / informations importantes + +## Some Nomad Job examples + +### Busybox + +`lxc-create --name=busybox --template=busybox` + +``` +job "job-busybox" { + datacenters = ["dc1"] + type = "service" + + group "group-busybox" { + task "task-busybox" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-busybox" + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian + +`lxc-create --name=debian --template=debian` + +``` +job "job-debian" { + datacenters = ["dc1"] + type = "service" + + group "group-debian" { + task "task-debian" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian Stretch + +`lxc-create --name=stretch --template=debian -- --release=stretch` + +``` +job "job-stretch" { + datacenters = ["dc1"] + type = "service" + + group "group-stretch" { + task "task-stretch" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + template_args = ["--release=stretch"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +} +``` + +### Debian Buster + +`lxc-create --name=buster --template=debian -- --release=buster` + +``` +job "job-buster" { + datacenters = ["dc1"] + type = "service" + + group "group-buster" { + task "task-buster" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-debian" + template_args = ["--release=buster"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +} +``` + +### Debian Buster from images.linuxcontainers.org + +`lxc-create --name=download-buster --template=download -- --dist=debian --release=buster --arch=amd64 --keyserver=hkp://keyserver.ubuntu.com` + +``` +job "job-download-buster" { + datacenters = ["dc1"] + type = "service" + + group "group-download-buster" { + task "task-download-buster" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-download" + template_args = ["--dist=debian","--release=buster","--arch=amd64","--keyserver=hkp://keyserver.ubuntu.com"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + +### Debian Bullseye from images.linuxcontainers.org + +`lxc-create --name=download-bullseye --template=download -- --dist=debian --release=bullseye --arch=amd64 --keyserver=hkp://keyserver.ubuntu.com` + +``` +job "job-download-bullseye" { + datacenters = ["dc1"] + type = "service" + + group "group-download-bullseye" { + task "task-download-bullseye" { + driver = "lxc" + + config { + log_level = "info" + verbosity = "verbose" + template = "/usr/share/lxc/templates/lxc-download" + template_args = ["--dist=debian","--release=bullseye","--arch=amd64","--keyserver=hkp://keyserver.ubuntu.com"] + } + + resources { + cpu = 500 + memory = 256 + } + } + } +} +``` + ## Documentations et ressources * Site officiel de l'app : From 4ede8266f11a4f0f49c40e614cde80a9c0b2268a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 02:32:56 +0200 Subject: [PATCH 13/36] Update check_process --- check_process | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/check_process b/check_process index 4b75a1f..69c79f2 100644 --- a/check_process +++ b/check_process @@ -17,25 +17,6 @@ multi_instance=0 port_already_use=0 change_url=1 -;; Test complet server - ; Manifest - domain="domain.tld" - is_public=1 - node_type="server" - server_ip="none..." - ; Checks - pkg_linter=1 - setup_sub_dir=0 - setup_root=1 - setup_nourl=0 - setup_private=1 - setup_public=1 - upgrade=1 - #upgrade=1 from_commit=CommitHash - backup_restore=1 - multi_instance=0 - port_already_use=0 - change_url=1 ;;; Options Email= Notification=none From 15fec3c66b5143e61e7ce5b365bf96b7899dcb5b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 02:33:53 +0200 Subject: [PATCH 14/36] Delete example.jpg --- doc/screenshots/example.jpg | Bin 35451 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 doc/screenshots/example.jpg diff --git a/doc/screenshots/example.jpg b/doc/screenshots/example.jpg deleted file mode 100644 index a1efa1a36d593384df59dc13db03fa83b0436d69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 35451 zcmc$_1zc6l)-b+FN$C#h?gr`ZZj|nlln#*w=}wW5?i3X1?vPYUN&%MvR z_q*TszQ6x4XZD(z)w9-|*_(Z?=dM=(ba`nxX#ff=Oi)Y!aD4?}Nw`>;xLKH!dDysF zlgY>_sa~%^SIbFA7^$kONXscof!F{5{nXyf!4;Mb0300MT-0U6$#nJf$!@&|U;#V; z9pDF8P0U=K#8g!kfqz*}X918C08BAMc>PPXzn?%gw{SHB04OqWTGY(R#SMgwL72zG z%?SdhfiSk2wTU?hmxC~q3#cFn&q2mbzr%YF*y;v`20;MZMN?e@v<(}C$*lf>P5*$+ ztX&*H94-)t%G|*b~05dcWf000^*koUcRVK)Lu@XK%i7Uzfmt``9b00tTwQo#ZXRyYJWI9OOX zq+7S(5m1m&P>_+3kx_4BqNCo%xQ&dAj*E_gg^h!QgMx;KkBg0uiH(B|VFCpM(!jzY z!oeY8qaveX|JUWZ6Tm=#T7f=*fx-ZwF`!^Dpsu??W1s*iI7lA-Dp1fcu<*Cw5Wra? zZ~_|UA7|mabmE={qFt&Ar;Zsam}Sk2L2jjh>Wy{q~1T5VjYE#`Y%V$?z8=# zBkZf{So0CY9ti@&`kxDSEtS2Yij~Edz^Gc==GpBsj{^JSt9P06@iFH{QRd-4Dd1c7 zJ~>y$rclw~75^OjXo4=6;y0w`)2R%7sf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@h24B*5(jb1lYGr@l85aq~LIi|6UQ!@_eQxWZ$)a*s<*3}dpbBb`K&u`k zoCT?tGH(XGqUmTsi$&wv7{+t15If^2?|0sr?!w3JuJj1pLslAzHj1_1nf#RyBSsly z!j_XsR~xwtUt{gj=|j2O{MB1Vu3&YN$0^j3dyec5{w(V!%Q#BxYlFuMI>eKg{7T0L zZ;O~Y!`V!EtW=b&8UW*hPMyi;Ds;bez8?d$%WVk zUy2(yCEv=+tT=N|DAiEp{a%BvZ|!<}=S6E-o-cm~>mAEsxk$nvWQEpt=e}J-qfsjm) UE-)&$xd9C0IsX9d#{5|Pe`qLcKmY&$ From de744d00da78675f94d5e015282641298f8bc7d1 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 22 Jul 2022 00:33:59 +0000 Subject: [PATCH 15/36] Auto-update README --- README.md | 1 - README_fr.md | 1 - 2 files changed, 2 deletions(-) diff --git a/README.md b/README.md index e7e31c5..7fbe99d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Nomad is a simple and flexible workload orchestrator to deploy and manage contai ## Screenshots ![Screenshot of Nomad](./doc/screenshots/assets.png) -![Screenshot of Nomad](./doc/screenshots/example.jpg) ## Disclaimers / important information diff --git a/README_fr.md b/README_fr.md index a47a8fd..15f55cc 100644 --- a/README_fr.md +++ b/README_fr.md @@ -23,7 +23,6 @@ Nomad is a simple and flexible workload orchestrator to deploy and manage contai ## Captures d'écran ![Capture d'écran de Nomad](./doc/screenshots/assets.png) -![Capture d'écran de Nomad](./doc/screenshots/example.jpg) ## Avertissements / informations importantes From 711d1894631cfd427fc7e0746b22748e5509dd31 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 03:13:37 +0200 Subject: [PATCH 16/36] Fix dnsmasq --- conf/dnsmasq-lxd | 2 ++ scripts/install | 3 +-- scripts/remove | 3 +++ scripts/restore | 3 +-- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 conf/dnsmasq-lxd diff --git a/conf/dnsmasq-lxd b/conf/dnsmasq-lxd new file mode 100644 index 0000000..aa50cdd --- /dev/null +++ b/conf/dnsmasq-lxd @@ -0,0 +1,2 @@ +bind-interfaces +except-interface=__LXC_BRIDGE__ diff --git a/scripts/install b/scripts/install index 9ea0f5f..5640bde 100755 --- a/scripts/install +++ b/scripts/install @@ -187,8 +187,7 @@ then chmod 400 "$config_path/client.hcl" chown $app:$app "$config_path/client.hcl" - echo "bind-interfaces -except-interface=lxdbr0" > /etc/dnsmasq.d/lxd + ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" systemctl restart dnsmasq ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" diff --git a/scripts/remove b/scripts/remove index 648451f..80619b3 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,6 +41,7 @@ fi #================================================= ynh_script_progression --message="Stopping and removing the systemd service..." +nomad node drain -self -enable # Remove the dedicated systemd config ynh_remove_systemd_config @@ -96,6 +97,8 @@ then systemctl disable lxc-net --quiet ynh_secure_remove --file="/etc/default/lxc-net" ynh_secure_remove --file="/etc/lxc/default.conf" + ynh_secure_remove --file="/etc/dnsmasq.d/lxd" + systemctl restart dnsmasq fi #================================================= diff --git a/scripts/restore b/scripts/restore index 0cc003f..7423905 100755 --- a/scripts/restore +++ b/scripts/restore @@ -113,8 +113,7 @@ then main_iface=$(ip route | grep default | awk '{print $5;}') ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface - echo "bind-interfaces -except-interface=lxdbr0" > /etc/dnsmasq.d/lxd + ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" systemctl restart dnsmasq ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" From 4ecc09abfc200584296566a746a0657254d403c7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 03:42:13 +0200 Subject: [PATCH 17/36] Fix systemctl start --- scripts/install | 5 +---- scripts/remove | 24 ++++++++++++------------ scripts/restore | 5 +---- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/scripts/install b/scripts/install index 5640bde..f2fcded 100755 --- a/scripts/install +++ b/scripts/install @@ -193,10 +193,7 @@ then ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" systemctl enable lxc-net --quiet - systemctl start lxc-net --quiet - #iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT - #iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT - #iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE + ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 80619b3..88ea8f8 100755 --- a/scripts/remove +++ b/scripts/remove @@ -53,17 +53,6 @@ ynh_script_progression --message="Removing logrotate configuration..." # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE DATA DIR -#================================================= - -# Remove the data directory if --purge option is used -if [ "${YNH_APP_PURGE:-0}" -eq 1 ] -then - ynh_script_progression --message="Removing app data directory..." - ynh_secure_remove --file="$datadir" -fi - #================================================= # REMOVE NGINX CONFIGURATION #================================================= @@ -93,7 +82,7 @@ then lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - systemctl stop lxc-net --quiet + ynh_systemd_action --service_name=lxc-net --action="stop" systemctl disable lxc-net --quiet ynh_secure_remove --file="/etc/default/lxc-net" ynh_secure_remove --file="/etc/lxc/default.conf" @@ -109,6 +98,17 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." + ynh_secure_remove --file="$datadir" +fi + #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index 7423905..597f3ff 100755 --- a/scripts/restore +++ b/scripts/restore @@ -119,10 +119,7 @@ then ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" systemctl enable lxc-net --quiet - systemctl start lxc-net --quiet - #iptables -A FORWARD -i $lxc_bridge -o $main_iface -j ACCEPT - #iptables -A FORWARD -i $main_iface -o $lxc_bridge -j ACCEPT - #iptables -t nat -A POSTROUTING -s $plage_ip.0/24 -j MASQUERADE + ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi #================================================= From 45dcd7037544683fa2acd116533295ca760f58fb Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 03:42:16 +0200 Subject: [PATCH 18/36] Update driver-lxc.src --- conf/driver-lxc.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/driver-lxc.src b/conf/driver-lxc.src index 50b65e7..44fc2aa 100644 --- a/conf/driver-lxc.src +++ b/conf/driver-lxc.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/hashicorp/nomad-driver-lxc/archive/7ceb969ba7bf4e4fae14856243892b1d51a37d14.tar.gz -SOURCE_SUM=b2b84436e4feb99b39414b4faa3c40f03c433c144832ece1d90dd6ddb870aa95 +SOURCE_URL=https://github.com/hashicorp/nomad-driver-lxc/archive/68239f4f639bde68e80616b7e931b8cc368969b0.tar.gz +SOURCE_SUM=50ddae947a189fefe0f6a5419d8f5ae749daa124f100b3ce900d83eab073c2ad SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true From e2c429c189bffa42d6bb8856dee1b62964d2b817 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 03:48:31 +0200 Subject: [PATCH 19/36] Update remove --- scripts/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 88ea8f8..cf1cbb2 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,7 +41,7 @@ fi #================================================= ynh_script_progression --message="Stopping and removing the systemd service..." -nomad node drain -self -enable +ynh_exec_warn_less nomad node drain -self -enable # Remove the dedicated systemd config ynh_remove_systemd_config From 1475937eb6c46253d1c19762d53dfc60d76604a3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 14:32:37 +0200 Subject: [PATCH 20/36] Fix ynh_remove_go --- check_process | 19 +++++++++++++++++++ scripts/install | 1 - scripts/remove | 1 + scripts/upgrade | 1 - 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 69c79f2..4b75a1f 100644 --- a/check_process +++ b/check_process @@ -17,6 +17,25 @@ multi_instance=0 port_already_use=0 change_url=1 +;; Test complet server + ; Manifest + domain="domain.tld" + is_public=1 + node_type="server" + server_ip="none..." + ; Checks + pkg_linter=1 + setup_sub_dir=0 + setup_root=1 + setup_nourl=0 + setup_private=1 + setup_public=1 + upgrade=1 + #upgrade=1 from_commit=CommitHash + backup_restore=1 + multi_instance=0 + port_already_use=0 + change_url=1 ;;; Options Email= Notification=none diff --git a/scripts/install b/scripts/install index f2fcded..be5e89f 100755 --- a/scripts/install +++ b/scripts/install @@ -154,7 +154,6 @@ then mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc ynh_secure_remove --file="$tempdir" - ynh_remove_go fi #================================================= diff --git a/scripts/remove b/scripts/remove index cf1cbb2..1d1a119 100755 --- a/scripts/remove +++ b/scripts/remove @@ -97,6 +97,7 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies +ynh_remove_go #================================================= # REMOVE DATA DIR diff --git a/scripts/upgrade b/scripts/upgrade index 4a5239f..bc97c15 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,7 +121,6 @@ then mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc ynh_secure_remove --file="$tempdir" - ynh_remove_go fi #================================================= From 1568ec97a51773e7d26cdb8da07aeb576aa3fda5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 22 Jul 2022 23:40:27 +0200 Subject: [PATCH 21/36] Cleanup --- doc/DISCLAIMER.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index f37d4cd..9bbe2f0 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -83,7 +83,6 @@ job "job-stretch" { } } } -} ``` ### Debian Buster @@ -113,7 +112,6 @@ job "job-buster" { } } } -} ``` ### Debian Buster from images.linuxcontainers.org From 7eb1ae70ae4505f39359c7d6a61d1e1822bc23fd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 22 Jul 2022 21:40:32 +0000 Subject: [PATCH 22/36] Auto-update README --- README.md | 2 -- README_fr.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/README.md b/README.md index 7fbe99d..8039528 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,6 @@ job "job-stretch" { } } } -} ``` ### Debian Buster @@ -141,7 +140,6 @@ job "job-buster" { } } } -} ``` ### Debian Buster from images.linuxcontainers.org diff --git a/README_fr.md b/README_fr.md index 15f55cc..9d95f4a 100644 --- a/README_fr.md +++ b/README_fr.md @@ -111,7 +111,6 @@ job "job-stretch" { } } } -} ``` ### Debian Buster @@ -141,7 +140,6 @@ job "job-buster" { } } } -} ``` ### Debian Buster from images.linuxcontainers.org From 264ecc4311585712739f7b32d410b129c5e566fd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 03:41:02 +0200 Subject: [PATCH 23/36] Fix package_check --- scripts/install | 4 +++- scripts/restore | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index be5e89f..4de8a4d 100755 --- a/scripts/install +++ b/scripts/install @@ -189,8 +189,10 @@ then ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" systemctl restart dnsmasq + if [ ! ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + fi ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" - ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" systemctl enable lxc-net --quiet ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi diff --git a/scripts/restore b/scripts/restore index 597f3ff..4317a7f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -116,7 +116,9 @@ then ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" systemctl restart dnsmasq - ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + if [ ! ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + fi ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" systemctl enable lxc-net --quiet ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" From b818f49906e12348cff0c6bf94ae6e24e6d29909 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 03:46:50 +0200 Subject: [PATCH 24/36] Less warnings --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4de8a4d..d225cfd 100755 --- a/scripts/install +++ b/scripts/install @@ -148,7 +148,7 @@ then ynh_use_go export GOPATH="$tempdir/go" export GOCACHE="$tempdir/.cache" - $ynh_go build + ynh_exec_warn_less $ynh_go build popd mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc diff --git a/scripts/upgrade b/scripts/upgrade index bc97c15..94ff385 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -115,7 +115,7 @@ then ynh_use_go export GOPATH="$tempdir/go" export GOCACHE="$tempdir/.cache" - $ynh_go build + ynh_exec_warn_less$ynh_go build popd mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc From 818e7e1fde509b9fa019a4de32207ec4f65ba490 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 03:49:39 +0200 Subject: [PATCH 25/36] specific driver-lxc config file --- conf/client.hcl | 8 -------- conf/driver-lxc.hcl | 7 +++++++ scripts/install | 4 ++++ scripts/upgrade | 4 ++++ 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 conf/driver-lxc.hcl diff --git a/conf/client.hcl b/conf/client.hcl index 1c12243..ee2067f 100644 --- a/conf/client.hcl +++ b/conf/client.hcl @@ -39,11 +39,3 @@ client { # determined dynamically. network_speed = 100 } - -plugin "nomad-driver-lxc" { - config { - enabled = true - volumes_enabled = true - lxc_path = "/var/lib/lxc" - } -} diff --git a/conf/driver-lxc.hcl b/conf/driver-lxc.hcl new file mode 100644 index 0000000..b0b9431 --- /dev/null +++ b/conf/driver-lxc.hcl @@ -0,0 +1,7 @@ +plugin "nomad-driver-lxc" { + config { + enabled = true + volumes_enabled = true + lxc_path = "/var/lib/lxc" + } +} diff --git a/scripts/install b/scripts/install index d225cfd..fb436dc 100755 --- a/scripts/install +++ b/scripts/install @@ -186,6 +186,10 @@ then chmod 400 "$config_path/client.hcl" chown $app:$app "$config_path/client.hcl" + ynh_add_config --template="../conf/driver-lxc.hcl" --destination="$config_path/driver-lxc.hcl" + chmod 400 "$config_path/driver-lxc.hcl" + chown $app:$app "$config_path/driver-lxc.hcl" + ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" systemctl restart dnsmasq diff --git a/scripts/upgrade b/scripts/upgrade index 94ff385..09cfc68 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,6 +149,10 @@ then ynh_add_config --template="../conf/client.hcl" --destination="$config_path/client.hcl" chmod 400 "$config_path/client.hcl" chown $app:$app "$config_path/client.hcl" + + ynh_add_config --template="../conf/driver-lxc.hcl" --destination="$config_path/driver-lxc.hcl" + chmod 400 "$config_path/driver-lxc.hcl" + chown $app:$app "$config_path/driver-lxc.hcl" fi #================================================= From 4ca49c1226ea1685e8c10eebdd7f75607df8b10a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 04:26:44 +0200 Subject: [PATCH 26/36] Update upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 09cfc68..9fcf541 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) node_type=$(ynh_app_setting_get --app=$app --key=node_type) +server_ip=$(ynh_app_setting_get --app=$app --key=server_ip) http_port=$(ynh_app_setting_get --app=$app --key=http_port) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) From 7b74a3b4efabba163b9ea85420c1a609c3925c16 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 04:31:09 +0200 Subject: [PATCH 27/36] bootstrap_expect --- check_process | 2 ++ conf/server.hcl | 2 +- manifest.json | 12 ++++++++++++ scripts/install | 2 ++ scripts/upgrade | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index 4b75a1f..0525f7b 100644 --- a/check_process +++ b/check_process @@ -3,6 +3,7 @@ domain="domain.tld" is_public=1 node_type="client" + bootstrap_expect="1" server_ip="192.168.1.100" ; Checks pkg_linter=1 @@ -22,6 +23,7 @@ domain="domain.tld" is_public=1 node_type="server" + bootstrap_expect="1" server_ip="none..." ; Checks pkg_linter=1 diff --git a/conf/server.hcl b/conf/server.hcl index 2b80785..0f937b5 100644 --- a/conf/server.hcl +++ b/conf/server.hcl @@ -8,7 +8,7 @@ server { # This is an integer representing the number of server nodes to wait for before bootstrapping. It is most # common to use the odd-numbered integers 3 or 5 for this value, depending on the cluster size. A value of # 1 does not provide any fault tolerance and is not recommended for production use cases. - bootstrap_expect = 1 + bootstrap_expect = __BOOTSTRAP_EXPECT__ # This is the data directory used for server-specific data, including the replicated log. By default, this # directory lives inside of the data_dir in the "server" sub-path. diff --git a/manifest.json b/manifest.json index 5e0561f..6581c06 100644 --- a/manifest.json +++ b/manifest.json @@ -45,6 +45,18 @@ "choices": ["server", "client"], "default": "server" }, + { + "name": "bootstrap_expect", + "type": "string", + "ask": { + "en": "[Server only] How many server nodes to wait for before bootstrapping ?" + }, + "choices": ["1", "3", "5", "7", "9"], + "default": "1", + "help": { + "en": "For production, it's recommanded to have 3 to 5 server nodes." + } + }, { "name": "server_ip", "type": "string", diff --git a/scripts/install b/scripts/install index fb436dc..686e9a2 100755 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC node_type=$YNH_APP_ARG_NODE_TYPE +bootstrap_expect=$YNH_APP_ARG_BOOTSTRAP_EXPECT server_ip=$YNH_APP_ARG_SERVER_IP app=$YNH_APP_INSTANCE_NAME @@ -52,6 +53,7 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=node_type --value=$node_type +ynh_app_setting_set --app=$app --key=bootstrap_expect --value=$bootstrap_expect ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip diff --git a/scripts/upgrade b/scripts/upgrade index 9fcf541..e54f780 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) node_type=$(ynh_app_setting_get --app=$app --key=node_type) server_ip=$(ynh_app_setting_get --app=$app --key=server_ip) +bootstrap_expect=$(ynh_app_setting_get --app=$app --key=bootstrap_expect) http_port=$(ynh_app_setting_get --app=$app --key=http_port) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) From ba83dc8281f50f7d7ee977db6a5398a72127f102 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 04:35:37 +0200 Subject: [PATCH 28/36] Retry_join --- check_process | 2 ++ conf/server.hcl | 2 +- manifest.json | 9 +++++++++ scripts/install | 2 ++ scripts/upgrade | 3 ++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 0525f7b..8d574fc 100644 --- a/check_process +++ b/check_process @@ -4,6 +4,7 @@ is_public=1 node_type="client" bootstrap_expect="1" + retry_join="192.168.1.100" server_ip="192.168.1.100" ; Checks pkg_linter=1 @@ -24,6 +25,7 @@ is_public=1 node_type="server" bootstrap_expect="1" + retry_join="192.168.1.100" server_ip="none..." ; Checks pkg_linter=1 diff --git a/conf/server.hcl b/conf/server.hcl index 0f937b5..7310a15 100644 --- a/conf/server.hcl +++ b/conf/server.hcl @@ -38,7 +38,7 @@ server { # Similar to start_join but allows retrying a join if the first attempt fails. This is useful for cases # where we know the address will become available eventually. -# retry_join = [] + retry_join = ["__RETRY_JOIN__"] # The time to wait between join attempts. Defaults to 30s. retry_interval = "30s" diff --git a/manifest.json b/manifest.json index 6581c06..89ee8f3 100644 --- a/manifest.json +++ b/manifest.json @@ -57,6 +57,15 @@ "en": "For production, it's recommanded to have 3 to 5 server nodes." } }, + { + "name": "retry_join", + "type": "string", + "ask": { + "en": "[Server only] What is the IP of another server to join ?" + }, + "example": "192.168.1.100", + "optional": true + }, { "name": "server_ip", "type": "string", diff --git a/scripts/install b/scripts/install index 686e9a2..2335f96 100755 --- a/scripts/install +++ b/scripts/install @@ -29,6 +29,7 @@ path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC node_type=$YNH_APP_ARG_NODE_TYPE bootstrap_expect=$YNH_APP_ARG_BOOTSTRAP_EXPECT +retry_join=$YNH_APP_ARG_RETRY_JOIN server_ip=$YNH_APP_ARG_SERVER_IP app=$YNH_APP_INSTANCE_NAME @@ -54,6 +55,7 @@ ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=node_type --value=$node_type ynh_app_setting_set --app=$app --key=bootstrap_expect --value=$bootstrap_expect +ynh_app_setting_set --app=$app --key=retry_join --value=$retry_join ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip diff --git a/scripts/upgrade b/scripts/upgrade index e54f780..f75b4c0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,8 +22,9 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) node_type=$(ynh_app_setting_get --app=$app --key=node_type) -server_ip=$(ynh_app_setting_get --app=$app --key=server_ip) bootstrap_expect=$(ynh_app_setting_get --app=$app --key=bootstrap_expect) +retry_join=$(ynh_app_setting_get --app=$app --key=retry_join) +server_ip=$(ynh_app_setting_get --app=$app --key=server_ip) http_port=$(ynh_app_setting_get --app=$app --key=http_port) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) From 700cb2ac758fd377490534a881858497e05ad9f6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 04:57:16 +0200 Subject: [PATCH 29/36] LXC driver --- check_process | 2 ++ manifest.json | 20 ++++++++++++++ scripts/_common.sh | 5 +++- scripts/install | 67 +++++++++++++++++++++++++++++----------------- scripts/remove | 20 ++++++++------ scripts/restore | 38 +++++++++++++++++--------- scripts/upgrade | 52 ++++++++++++++++++++++------------- 7 files changed, 139 insertions(+), 65 deletions(-) diff --git a/check_process b/check_process index 8d574fc..0d02bbf 100644 --- a/check_process +++ b/check_process @@ -6,6 +6,7 @@ bootstrap_expect="1" retry_join="192.168.1.100" server_ip="192.168.1.100" + driver_lxc=1 ; Checks pkg_linter=1 setup_sub_dir=0 @@ -27,6 +28,7 @@ bootstrap_expect="1" retry_join="192.168.1.100" server_ip="none..." + driver_lxc=1 ; Checks pkg_linter=1 setup_sub_dir=0 diff --git a/manifest.json b/manifest.json index 89ee8f3..fb5c379 100644 --- a/manifest.json +++ b/manifest.json @@ -74,6 +74,26 @@ }, "example": "192.168.1.100", "optional": true + }, + { + "name": "server_ip", + "type": "string", + "ask": { + "en": "[Client only] What is the IP of the Nomad server node ?" + }, + "example": "192.168.1.100", + "optional": true + }, + { + "name": "driver_lxc", + "type": "boolean", + "ask": { + "en": "[Client only] Do you want to install LXC driver ?" + }, + "default": true, + "help": { + "en": "It will also install lxc." + } } ] } diff --git a/scripts/_common.sh b/scripts/_common.sh index e1a4f0d..8a15aaa 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -7,7 +7,10 @@ # dependencies used by the app pkg_dependencies="nomad" -client_pkg_dependencies="pkg-config lxc-dev lxc lxc-templates" +server_pkg_dependencies="" + +client_pkg_dependencies="" +client_lxc_pkg_dependencies="pkg-config lxc-dev lxc lxc-templates" go_version=1.15 diff --git a/scripts/install b/scripts/install index 2335f96..74ccc72 100755 --- a/scripts/install +++ b/scripts/install @@ -31,6 +31,7 @@ node_type=$YNH_APP_ARG_NODE_TYPE bootstrap_expect=$YNH_APP_ARG_BOOTSTRAP_EXPECT retry_join=$YNH_APP_ARG_RETRY_JOIN server_ip=$YNH_APP_ARG_SERVER_IP +driver_lxc=$YNH_APP_ARG_DRIVER_LXC app=$YNH_APP_INSTANCE_NAME @@ -57,6 +58,7 @@ ynh_app_setting_set --app=$app --key=node_type --value=$node_type ynh_app_setting_set --app=$app --key=bootstrap_expect --value=$bootstrap_expect ynh_app_setting_set --app=$app --key=retry_join --value=$retry_join ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip +ynh_app_setting_set --app=$app --key=driver_lxc --value=$driver_lxc ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface @@ -96,10 +98,19 @@ fi #================================================= ynh_script_progression --message="Installing dependencies..." +if [ "$node_type" == "server" ] +then + ynh_install_app_dependencies $server_pkg_dependencies +fi + if [ "$node_type" == "client" ] then + if [ $driver_lxc -eq 1 ] + then + $client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" + ynh_install_go --go_version=$go_version + fi ynh_install_app_dependencies $client_pkg_dependencies - ynh_install_go --go_version=$go_version fi ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" @@ -137,27 +148,30 @@ chmod -R o-rwx "$datadir" chown -R $app:$app "$datadir" #================================================= -# BUILD LXC DRIVER +# BUILD DRIVERS #================================================= if [ "$node_type" == "client" ] then - ynh_script_progression --message="Building LXC driver..." + if [ $driver_lxc -eq 1 ] + then + ynh_script_progression --message="Building LXC driver..." - tempdir="$(mktemp -d)" - ynh_setup_source --dest_dir="$tempdir" --source_id="driver-lxc" + tempdir="$(mktemp -d)" + ynh_setup_source --dest_dir="$tempdir" --source_id="driver-lxc" - pushd $tempdir - final_path=$tempdir - ynh_use_go - export GOPATH="$tempdir/go" - export GOCACHE="$tempdir/.cache" - ynh_exec_warn_less $ynh_go build - popd + pushd $tempdir + final_path=$tempdir + ynh_use_go + export GOPATH="$tempdir/go" + export GOCACHE="$tempdir/.cache" + ynh_exec_warn_less $ynh_go build + popd - mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc + mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc - ynh_secure_remove --file="$tempdir" + ynh_secure_remove --file="$tempdir" + fi fi #================================================= @@ -189,20 +203,23 @@ then ynh_add_config --template="../conf/client.hcl" --destination="$config_path/client.hcl" chmod 400 "$config_path/client.hcl" chown $app:$app "$config_path/client.hcl" + + if [ $driver_lxc -eq 1 ] + then + ynh_add_config --template="../conf/driver-lxc.hcl" --destination="$config_path/driver-lxc.hcl" + chmod 400 "$config_path/driver-lxc.hcl" + chown $app:$app "$config_path/driver-lxc.hcl" - ynh_add_config --template="../conf/driver-lxc.hcl" --destination="$config_path/driver-lxc.hcl" - chmod 400 "$config_path/driver-lxc.hcl" - chown $app:$app "$config_path/driver-lxc.hcl" + ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" + systemctl restart dnsmasq - ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" - systemctl restart dnsmasq - - if [ ! ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + if [ ! ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + fi + ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" + systemctl enable lxc-net --quiet + ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi - ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" - systemctl enable lxc-net --quiet - ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi #================================================= diff --git a/scripts/remove b/scripts/remove index 1d1a119..b764c2d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) node_type=$(ynh_app_setting_get --app=$app --key=node_type) +driver_lxc=$(ynh_app_setting_get --app=$app --key=driver_lxc) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) @@ -79,15 +80,18 @@ fi if [ "$node_type" == "client" ] then + + if [ $driver_lxc -eq 1 ] + then + lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - - ynh_systemd_action --service_name=lxc-net --action="stop" - systemctl disable lxc-net --quiet - ynh_secure_remove --file="/etc/default/lxc-net" - ynh_secure_remove --file="/etc/lxc/default.conf" - ynh_secure_remove --file="/etc/dnsmasq.d/lxd" - systemctl restart dnsmasq + ynh_systemd_action --service_name=lxc-net --action="stop" + systemctl disable lxc-net --quiet + ynh_secure_remove --file="/etc/default/lxc-net" + ynh_secure_remove --file="/etc/lxc/default.conf" + ynh_secure_remove --file="/etc/dnsmasq.d/lxd" + systemctl restart dnsmasq + fi fi #================================================= diff --git a/scripts/restore b/scripts/restore index 4317a7f..fb98a2e 100755 --- a/scripts/restore +++ b/scripts/restore @@ -32,6 +32,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) node_type=$(ynh_app_setting_get --app=$app --key=node_type) +driver_lxc=$(ynh_app_setting_get --app=$app --key=driver_lxc) http_port=$(ynh_app_setting_get --app=$app --key=http_port) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) @@ -71,8 +72,17 @@ chown -R $app:$app "$datadir" #================================================= ynh_script_progression --message="Reinstalling dependencies..." +if [ "$node_type" == "server" ] +then + ynh_install_app_dependencies $server_pkg_dependencies +fi + if [ "$node_type" == "client" ] then + if [ $driver_lxc -eq 1 ] + then + $client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" + fi ynh_install_app_dependencies $client_pkg_dependencies fi ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" @@ -106,22 +116,24 @@ then fi if [ "$node_type" == "client" ] -then +then + if [ $driver_lxc -eq 1 ] + then + lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) + plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) + main_iface=$(ip route | grep default | awk '{print $5;}') + ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface - lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) - main_iface=$(ip route | grep default | awk '{print $5;}') - ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface + ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" + systemctl restart dnsmasq - ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" - systemctl restart dnsmasq - - if [ ! ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then - ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + if [ ! ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then + ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" + fi + ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" + systemctl enable lxc-net --quiet + ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi - ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" - systemctl enable lxc-net --quiet - ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f75b4c0..6093f6c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,7 @@ node_type=$(ynh_app_setting_get --app=$app --key=node_type) bootstrap_expect=$(ynh_app_setting_get --app=$app --key=bootstrap_expect) retry_join=$(ynh_app_setting_get --app=$app --key=retry_join) server_ip=$(ynh_app_setting_get --app=$app --key=server_ip) +driver_lxc=$(ynh_app_setting_get --app=$app --key=driver_lxc) http_port=$(ynh_app_setting_get --app=$app --key=http_port) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) serf_port=$(ynh_app_setting_get --app=$app --key=serf_port) @@ -85,10 +86,19 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading dependencies..." +if [ "$node_type" == "server" ] +then + ynh_install_app_dependencies $server_pkg_dependencies +fi + if [ "$node_type" == "client" ] then + if [ $driver_lxc -eq 1 ] + then + $client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" + ynh_install_go --go_version=$go_version + fi ynh_install_app_dependencies $client_pkg_dependencies - ynh_install_go --go_version=$go_version fi ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" @@ -103,27 +113,30 @@ ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE #================================================= -# BUILD LXC DRIVER +# BUILD DRIVERS #================================================= if [ "$node_type" == "client" ] then - ynh_script_progression --message="Building LXC driver..." + if [ $driver_lxc -eq 1 ] + then + ynh_script_progression --message="Building LXC driver..." - tempdir="$(mktemp -d)" - ynh_setup_source --dest_dir="$tempdir" --source_id="driver-lxc" + tempdir="$(mktemp -d)" + ynh_setup_source --dest_dir="$tempdir" --source_id="driver-lxc" - pushd $tempdir - final_path=$tempdir - ynh_use_go - export GOPATH="$tempdir/go" - export GOCACHE="$tempdir/.cache" - ynh_exec_warn_less$ynh_go build - popd + pushd $tempdir + final_path=$tempdir + ynh_use_go + export GOPATH="$tempdir/go" + export GOCACHE="$tempdir/.cache" + ynh_exec_warn_less$ynh_go build + popd - mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc + mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc - ynh_secure_remove --file="$tempdir" + ynh_secure_remove --file="$tempdir" + fi fi #================================================= @@ -152,10 +165,13 @@ then ynh_add_config --template="../conf/client.hcl" --destination="$config_path/client.hcl" chmod 400 "$config_path/client.hcl" chown $app:$app "$config_path/client.hcl" - - ynh_add_config --template="../conf/driver-lxc.hcl" --destination="$config_path/driver-lxc.hcl" - chmod 400 "$config_path/driver-lxc.hcl" - chown $app:$app "$config_path/driver-lxc.hcl" + + if [ $driver_lxc -eq 1 ] + then + ynh_add_config --template="../conf/driver-lxc.hcl" --destination="$config_path/driver-lxc.hcl" + chmod 400 "$config_path/driver-lxc.hcl" + chown $app:$app "$config_path/driver-lxc.hcl" + fi fi #================================================= From 16958f774fcd6f7ae472c1a5b46b61f22d1a1377 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 05:05:47 +0200 Subject: [PATCH 30/36] Few fixes --- scripts/install | 2 +- scripts/remove | 1 + scripts/upgrade | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index fb436dc..77b391e 100755 --- a/scripts/install +++ b/scripts/install @@ -95,7 +95,7 @@ ynh_script_progression --message="Installing dependencies..." if [ "$node_type" == "client" ] then ynh_install_app_dependencies $client_pkg_dependencies - ynh_install_go --go_version=$go_version + ynh_exec_warn_less ynh_install_go --go_version=$go_version fi ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" diff --git a/scripts/remove b/scripts/remove index 1d1a119..7ca4c2f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -7,6 +7,7 @@ #================================================= source _common.sh +source ynh_install_go source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9fcf541..653acb4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,7 +86,7 @@ ynh_script_progression --message="Upgrading dependencies..." if [ "$node_type" == "client" ] then ynh_install_app_dependencies $client_pkg_dependencies - ynh_install_go --go_version=$go_version + ynh_exec_warn_less ynh_install_go --go_version=$go_version fi ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" @@ -116,7 +116,7 @@ then ynh_use_go export GOPATH="$tempdir/go" export GOCACHE="$tempdir/.cache" - ynh_exec_warn_less$ynh_go build + ynh_exec_warn_less $ynh_go build popd mv -f $tempdir/nomad-driver-lxc $datadir/plugins/nomad-driver-lxc From 34fb3a94d47a2c42696b27cbd71146e0a66a57ea Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 05:17:02 +0200 Subject: [PATCH 31/36] typo --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 13443ce..1c3289f 100644 --- a/scripts/install +++ b/scripts/install @@ -107,7 +107,7 @@ if [ "$node_type" == "client" ] then if [ $driver_lxc -eq 1 ] then - $client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" + client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" ynh_exec_warn_less ynh_install_go --go_version=$go_version fi ynh_install_app_dependencies $client_pkg_dependencies diff --git a/scripts/restore b/scripts/restore index fb98a2e..50c5aaa 100755 --- a/scripts/restore +++ b/scripts/restore @@ -81,7 +81,7 @@ if [ "$node_type" == "client" ] then if [ $driver_lxc -eq 1 ] then - $client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" + client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" fi ynh_install_app_dependencies $client_pkg_dependencies fi diff --git a/scripts/upgrade b/scripts/upgrade index 1c91bba..c48777c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,7 +95,7 @@ if [ "$node_type" == "client" ] then if [ $driver_lxc -eq 1 ] then - $client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" + client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" ynh_exec_warn_less ynh_install_go --go_version=$go_version fi ynh_install_app_dependencies $client_pkg_dependencies From bbb24494955274d5609a03011c7db90060169025 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 15:56:06 +0200 Subject: [PATCH 32/36] package_check --- scripts/remove | 5 ++++- scripts/restore | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 7ca4c2f..961cbf9 100755 --- a/scripts/remove +++ b/scripts/remove @@ -98,7 +98,10 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_app_dependencies -ynh_remove_go +if [ "$node_type" == "client" ] +then + ynh_remove_go +fi #================================================= # REMOVE DATA DIR diff --git a/scripts/restore b/scripts/restore index 4317a7f..3c44878 100755 --- a/scripts/restore +++ b/scripts/restore @@ -119,6 +119,7 @@ then if [ ! ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then ynh_add_config --template="../conf/lxc-net" --destination="/etc/default/lxc-net" fi + ynh_secure_remove --file="/etc/lxc/default.conf" ynh_add_config --template="../conf/default.conf" --destination="/etc/lxc/default.conf" systemctl enable lxc-net --quiet ynh_systemd_action --service_name=lxc-net --action="restart" --line_match="Started LXC network bridge" --log_path="systemd" From 7b1afd5ee24c354846854328886f1c8cc43972a5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 15:58:32 +0200 Subject: [PATCH 33/36] Update remove --- scripts/remove | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 2c88020..1f58367 100755 --- a/scripts/remove +++ b/scripts/remove @@ -104,7 +104,10 @@ ynh_script_progression --message="Removing dependencies..." ynh_remove_app_dependencies if [ "$node_type" == "client" ] then - ynh_remove_go + if [ $driver_lxc -eq 1 ] + then + ynh_remove_go + fi fi #================================================= From dd981783ddca3839dd2d576369961db45c578050 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 16:56:59 +0200 Subject: [PATCH 34/36] client_lxc specific parameters --- conf/default.conf | 2 +- conf/dnsmasq-lxd | 2 +- conf/lxc-net | 8 ++++---- scripts/install | 12 ++++++------ scripts/remove | 2 +- scripts/restore | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/conf/default.conf b/conf/default.conf index 89f8c4b..ae6ea01 100644 --- a/conf/default.conf +++ b/conf/default.conf @@ -1,5 +1,5 @@ lxc.net.0.type = veth -lxc.net.0.link = __LXC_BRIDGE__ +lxc.net.0.link = __CLIENT_LXC_BRIDGE__ lxc.net.0.flags = up lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx lxc.apparmor.profile = generated diff --git a/conf/dnsmasq-lxd b/conf/dnsmasq-lxd index aa50cdd..ebadaf0 100644 --- a/conf/dnsmasq-lxd +++ b/conf/dnsmasq-lxd @@ -1,2 +1,2 @@ bind-interfaces -except-interface=__LXC_BRIDGE__ +except-interface=__CLIENT_LXC_BRIDGE__ diff --git a/conf/lxc-net b/conf/lxc-net index c19bedb..2307d88 100644 --- a/conf/lxc-net +++ b/conf/lxc-net @@ -1,9 +1,9 @@ USE_LXC_BRIDGE="true" -LXC_BRIDGE="__LXC_BRIDGE__" -LXC_ADDR="__PLAGE_IP__.1" +LXC_BRIDGE="__CLIENT_LXC_BRIDGE__" +LXC_ADDR="__CLIENT_LXC_PLAGE_IP__.1" LXC_NETMASK="255.255.255.0" -LXC_NETWORK="__PLAGE_IP__.0/24" -LXC_DHCP_RANGE="__PLAGE_IP__.2,__PLAGE_IP__.254" +LXC_NETWORK="__CLIENT_LXC_PLAGE_IP__.0/24" +LXC_DHCP_RANGE="__CLIENT_LXC_PLAGE_IP__.2,__CLIENT_LXC_PLAGE_IP__.254" LXC_DHCP_MAX="253" LXC_DHCP_CONFILE="" LXC_DOMAIN="" diff --git a/scripts/install b/scripts/install index 1c3289f..27645a0 100644 --- a/scripts/install +++ b/scripts/install @@ -35,9 +35,9 @@ driver_lxc=$YNH_APP_ARG_DRIVER_LXC app=$YNH_APP_INSTANCE_NAME -lxc_bridge="lxcbr0" -plage_ip="10.1.44" -main_iface=$(ip route | grep default | awk '{print $5;}') +client_lxc_bridge="lxcbr0" +client_lxc_plage_ip="10.1.44" +client_lxc_main_iface=$(ip route | grep default | awk '{print $5;}') #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -59,9 +59,9 @@ ynh_app_setting_set --app=$app --key=bootstrap_expect --value=$bootstrap_expect ynh_app_setting_set --app=$app --key=retry_join --value=$retry_join ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip ynh_app_setting_set --app=$app --key=driver_lxc --value=$driver_lxc -ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge -ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip -ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface +ynh_app_setting_set --app=$app --key=client_lxc_bridge --value=$client_lxc_bridge +ynh_app_setting_set --app=$app --key=client_lxc_plage_ip --value=$client_lxc_plage_ip +ynh_app_setting_set --app=$app --key=client_lxc_main_iface --value=$client_lxc_main_iface #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/remove b/scripts/remove index 1f58367..0a4afe1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -84,7 +84,7 @@ then if [ $driver_lxc -eq 1 ] then - lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) + client_lxc_bridge=$(ynh_app_setting_get --app=$app --key=client_lxc_bridge) ynh_systemd_action --service_name=lxc-net --action="stop" systemctl disable lxc-net --quiet diff --git a/scripts/restore b/scripts/restore index 98b03d0..7ecc196 100644 --- a/scripts/restore +++ b/scripts/restore @@ -119,10 +119,10 @@ if [ "$node_type" == "client" ] then if [ $driver_lxc -eq 1 ] then - lxc_bridge=$(ynh_app_setting_get --app=$app --key=lxc_bridge) - plage_ip=$(ynh_app_setting_get --app=$app --key=plage_ip) - main_iface=$(ip route | grep default | awk '{print $5;}') - ynh_app_setting_set --app=$app --key=main_iface --value=$main_iface + client_lxc_bridge=$(ynh_app_setting_get --app=$app --key=client_lxc_bridge) + client_lxc_plage_ip=$(ynh_app_setting_get --app=$app --key=client_lxc_plage_ip) + client_lxc_main_iface=$(ip route | grep default | awk '{print $5;}') + ynh_app_setting_set --app=$app --key=client_lxc_main_iface --value=$client_lxc_main_iface ynh_add_config --template="../conf/dnsmasq-lxd" --destination="/etc/dnsmasq.d/lxd" systemctl restart dnsmasq From 556f154522d495e9cbe65cc37c94c79df17cb571 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 17:10:52 +0200 Subject: [PATCH 35/36] better dependencies management --- scripts/_common.sh | 3 ++- scripts/install | 7 ++++--- scripts/restore | 7 ++++--- scripts/upgrade | 7 ++++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8a15aaa..e8fd2a4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -5,7 +5,8 @@ #================================================= # dependencies used by the app -pkg_dependencies="nomad" +pkg_dependencies="" +extra_pkg_dependencies="nomad" server_pkg_dependencies="" diff --git a/scripts/install b/scripts/install index 27645a0..e071819 100644 --- a/scripts/install +++ b/scripts/install @@ -100,7 +100,7 @@ ynh_script_progression --message="Installing dependencies..." if [ "$node_type" == "server" ] then - ynh_install_app_dependencies $server_pkg_dependencies + pkg_dependencies="$pkg_dependencies $server_pkg_dependencies" fi if [ "$node_type" == "client" ] @@ -110,9 +110,10 @@ then client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" ynh_exec_warn_less ynh_install_go --go_version=$go_version fi - ynh_install_app_dependencies $client_pkg_dependencies + pkg_dependencies="$pkg_dependencies $client_pkg_dependencies" fi -ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" +ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$extra_pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" #================================================= # CREATE DEDICATED USER diff --git a/scripts/restore b/scripts/restore index 7ecc196..cdc1c18 100644 --- a/scripts/restore +++ b/scripts/restore @@ -74,7 +74,7 @@ ynh_script_progression --message="Reinstalling dependencies..." if [ "$node_type" == "server" ] then - ynh_install_app_dependencies $server_pkg_dependencies + pkg_dependencies="$pkg_dependencies $server_pkg_dependencies" fi if [ "$node_type" == "client" ] @@ -83,9 +83,10 @@ then then client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" fi - ynh_install_app_dependencies $client_pkg_dependencies + pkg_dependencies="$pkg_dependencies $client_pkg_dependencies" fi -ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" +ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$extra_pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" #================================================= # RESTORE THE NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index c48777c..853cc02 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -88,7 +88,7 @@ ynh_script_progression --message="Upgrading dependencies..." if [ "$node_type" == "server" ] then - ynh_install_app_dependencies $server_pkg_dependencies + pkg_dependencies="$pkg_dependencies $server_pkg_dependencies" fi if [ "$node_type" == "client" ] @@ -98,9 +98,10 @@ then client_pkg_dependencies="$client_pkg_dependencies $client_lxc_pkg_dependencies" ynh_exec_warn_less ynh_install_go --go_version=$go_version fi - ynh_install_app_dependencies $client_pkg_dependencies + pkg_dependencies="$pkg_dependencies $client_pkg_dependencies" fi -ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" +ynh_install_app_dependencies $pkg_dependencies +ynh_install_extra_app_dependencies --repo="deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" --package="$extra_pkg_dependencies" --key="https://apt.releases.hashicorp.com/gpg" #================================================= # NGINX CONFIGURATION From dfc2b9e57062f654ab590129927a09aa4cf2cfb1 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 23 Jul 2022 19:00:23 +0200 Subject: [PATCH 36/36] implement autoupdater --- .github/workflows/updater.sh | 73 ----------------------------------- .github/workflows/updater.yml | 49 +++++++++++++++++++++++ manifest.json | 13 ++++++- 3 files changed, 60 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/updater.yml diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 41459bb..299a131 100755 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -9,9 +9,6 @@ # Since each app is different, maintainers can adapt its contents so as to perform # automatic actions when a new upstream release is detected. -# Remove this exit command when you are ready to run this Action -exit 1 - #================================================= # FETCHING LATEST RELEASE AND ITS ASSETS #================================================= @@ -21,7 +18,6 @@ current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') # Some jq magic is needed, because the latest upstream release is not always the latest version (e.g. security patches for older versions) version=$(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '.[] | select( .prerelease != true ) | .tag_name' | sort -V | tail -1) -assets=($(curl --silent "https://api.github.com/repos/$repo/releases" | jq -r '[ .[] | select(.tag_name=="'$version'").assets[].browser_download_url ] | join(" ") | @sh' | tr -d "'")) # Later down the script, we assume the version has only digits and dots # Sometimes the release name starts with a "v", so let's filter it out. @@ -48,75 +44,6 @@ elif git ls-remote -q --exit-code --heads https://github.com/$GITHUB_REPOSITORY. exit 0 fi -# Each release can hold multiple assets (e.g. binaries for different architectures, source code, etc.) -echo "${#assets[@]} available asset(s)" - -#================================================= -# UPDATE SOURCE FILES -#================================================= - -# Here we use the $assets variable to get the resources published in the upstream release. -# Here is an example for Grav, it has to be adapted in accordance with how the upstream releases look like. - -# Let's loop over the array of assets URLs -for asset_url in ${assets[@]}; do - - echo "Handling asset at $asset_url" - - # Assign the asset to a source file in conf/ directory - # Here we base the source file name upon a unique keyword in the assets url (admin vs. update) - # Leave $src empty to ignore the asset - case $asset_url in - *"admin"*) - src="app" - ;; - *"update"*) - src="app-upgrade" - ;; - *) - src="" - ;; - esac - - # If $src is not empty, let's process the asset - if [ ! -z "$src" ]; then - - # Create the temporary directory - tempdir="$(mktemp -d)" - - # Download sources and calculate checksum - filename=${asset_url##*/} - curl --silent -4 -L $asset_url -o "$tempdir/$filename" - checksum=$(sha256sum "$tempdir/$filename" | head -c 64) - - # Delete temporary directory - rm -rf $tempdir - - # Get extension - if [[ $filename == *.tar.gz ]]; then - extension=tar.gz - else - extension=${filename##*.} - fi - - # Rewrite source file - cat < conf/$src.src -SOURCE_URL=$asset_url -SOURCE_SUM=$checksum -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=$extension -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= -SOURCE_EXTRACT=true -EOT - echo "... conf/$src.src updated" - - else - echo "... asset ignored" - fi - -done - #================================================= # SPECIFIC UPDATE STEPS #================================================= diff --git a/.github/workflows/updater.yml b/.github/workflows/updater.yml new file mode 100644 index 0000000..fb72ba0 --- /dev/null +++ b/.github/workflows/updater.yml @@ -0,0 +1,49 @@ +# This workflow allows GitHub Actions to automagically update your app whenever a new upstream release is detected. +# You need to enable Actions in your repository settings, and fetch this Action from the YunoHost-Apps organization. +# This file should be enough by itself, but feel free to tune it to your needs. +# It calls updater.sh, which is where you should put the app-specific update steps. +name: Check for new upstream releases +on: + # Allow to manually trigger the workflow + workflow_dispatch: + # Run it every day at 6:00 UTC + schedule: + - cron: '0 6 * * *' +jobs: + updater: + runs-on: ubuntu-latest + steps: + - name: Fetch the source code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run the updater script + id: run_updater + run: | + # Setting up Git user + git config --global user.name 'yunohost-bot' + git config --global user.email 'yunohost-bot@users.noreply.github.com' + # Run the updater script + /bin/bash .github/workflows/updater.sh + - name: Commit changes + id: commit + if: ${{ env.PROCEED == 'true' }} + run: | + git commit -am "Upgrade to v$VERSION" + - name: Create Pull Request + id: cpr + if: ${{ env.PROCEED == 'true' }} + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update to version ${{ env.VERSION }} + committer: 'yunohost-bot ' + author: 'yunohost-bot ' + signoff: false + base: testing + branch: ci-auto-update-v${{ env.VERSION }} + delete-branch: true + title: 'Upgrade to version ${{ env.VERSION }}' + body: | + Upgrade to v${{ env.VERSION }} + draft: false diff --git a/manifest.json b/manifest.json index fb5c379..3c482f1 100644 --- a/manifest.json +++ b/manifest.json @@ -42,7 +42,10 @@ "ask": { "en": "What kind of Nomad node you want to install ?" }, - "choices": ["server", "client"], + "choices": [ + "server", + "client" + ], "default": "server" }, { @@ -51,7 +54,13 @@ "ask": { "en": "[Server only] How many server nodes to wait for before bootstrapping ?" }, - "choices": ["1", "3", "5", "7", "9"], + "choices": [ + "1", + "3", + "5", + "7", + "9" + ], "default": "1", "help": { "en": "For production, it's recommanded to have 3 to 5 server nodes."