Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3310,6 +3310,13 @@ add_test(NAME server_list
COMMAND ${PYTHON3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tests/apps/serverlist_test.py
$<TARGET_FILE:ecce-localdata> ${CMAKE_BINARY_DIR}/server-list-test)
set_tests_properties(server_list PROPERTIES TIMEOUT 60)
add_executable(json_configuration_profile_test
tests/util/json_configuration_profile_test.C)
target_link_libraries(json_configuration_profile_test PRIVATE ecceutil)
add_test(NAME json_configuration_profile
COMMAND json_configuration_profile_test
${CMAKE_BINARY_DIR}/configuration-profile-test.json)
set_tests_properties(json_configuration_profile PROPERTIES TIMEOUT 60)

# The central server over TLS (#236): the real data server and broker scripts
# on loopback with a fresh certificate, then the clients with and without
Expand Down
7 changes: 3 additions & 4 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,9 @@ Unix socket, no port, no password) and data server. The broker stops when
that user's last session ends. Several users on one
machine each get their own broker; mode 3 is only needed to share one.

A single-user install can keep its projects in a folder instead of a data
server; see the next section. Server mode remains the default on Linux;
on macOS, which has no mod_dav for a per-user data server, the data folder
is the default (#133).
A new or unconfigured user keeps projects in a folder by default on every
platform. An explicit server preference or an existing data-server setup
continues to use that server. See the next section for local data mode.

#### Local data mode (a data folder instead of a data server)

Expand Down
14 changes: 14 additions & 0 deletions docs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,20 @@ The Organizer's menus and Preferences, item by item, are on the help pages
`organizer-menubar` (menu bar, toolbar, Preferences) and `organizer-menus`
(right-click menus).

### Data servers (Preferences > Data)

Choose the PEM certificate in the **Add Server** or **Edit Server** dialog,
beside the HTTPS address. ECCE stores the pin for that server's origin in the
user's preferences; without a pin, the system certificate store and host-name
check apply. The same dialog has an optional **Username** field for the account
on that server. It is saved with the server entry and included when exporting
or importing a JSON configuration profile; connecting still prompts for that
account's password. Profiles do not include passwords. The Organizer hook
`prefs data cert PEM [PNG]` loads a certificate for the first listed HTTPS
server and reports `loaded:<installed pin path>` or an error.
`tests/apps/prefs_data_test.py` (ctest `apps_prefs_data`) covers the data server
dialog, username persistence, and valid or invalid certificate files.

### Which codes are offered (Preferences > Codes, #1049)

Codes unticked in **Edit > Preferences > Codes** are hidden from making new
Expand Down
2 changes: 1 addition & 1 deletion docs/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ those settings.
| `ECCE_REMOTE_SERVER` | Central-server mode: read `siteconfig/RemoteServer/{DataServers,site_runtime}`, start no local broker or data server. `ecce -remote` sets it. | Set to enable. Default off. |
| `ECCE_SITE_ADMIN_LOGIN` | The ssh login on the central server for `ecce -admin -remote` (`-l LOGIN` sets it). | Default: ssh's own (`~/.ssh/config`, else your user name). |
| `ECCE_LOCAL` | Set by `ecce --local`: local data mode for this session in the preference's folder, whether or not the preference is ticked. `ECCE_LOCAL_DATA` wins over it. | Any value. Unset: the preference decides. |
| `ECCE_LOCAL_DATA` | Local data mode (#216): keep projects and calculations in this folder instead of a data server; no data server is started. Wins over Edit > Preferences > Data folder. The launchers export it for the whole session, set to the preference's folder or to empty (data server). | Path. Unset: the preference (off by default; folder `~/.ECCE-local`). Empty: a data server. |
| `ECCE_LOCAL_DATA` | Local data mode (#216): keep projects and calculations in this folder instead of a data server; no data server is started. Wins over Edit > Preferences > Data folder. The launchers export it for the whole session, set to the preference's folder or to empty (data server). | Path. Unset: the preference; if unset, new users default to `~/.ECCE-local` and detected existing data-server setups stay on the server. Empty: a data server. |
| `ECCE_NO_MESSAGING` | Run without the message broker. Apps do not publish or subscribe. The launchers set it for `ecce -admin` and `-machine`. | Set to enable. Default off. |
| `ECCE_NO_DATASERVER` | Launchers do not start the per-user data server. | Set to enable. Default off. |
| `ECCE_DATASERVER_PORT` | Port of the per-user data server, as used by `ecce-dataserver-start` and `-status`. The test suite uses it for private servers. | Port. Default 8096. |
Expand Down
20 changes: 10 additions & 10 deletions docs/INSTALLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,16 @@ your `PATH`.

## 2. Choose where your data lives

**In a folder on your computer** — the default on macOS and Windows,
optional on Linux. There is nothing to set up: no account and no login.
On Linux, choose Edit → Preferences → Data folder (default
`~/.ECCE-local`; it takes effect at the next start), or start ECCE with
`ECCE_LOCAL_DATA=<folder>` set. See
**In a folder on your computer** — the default for new users on every
platform. There is nothing to set up: no account and no login. The folder
defaults to `~/.ECCE-local` on Linux and macOS, and `ecce-local` on Windows.
An existing data-server setup is kept. To choose another folder, use
Edit → Preferences → Data folder (it takes effect at the next start), or
start ECCE with `ECCE_LOCAL_DATA=<folder>` set. See
[Deployment modes](../GETTING_STARTED.md#deployment-modes).

**In a data server on this computer** — the default on Linux. The data
server runs as your own user. Create a login on it once:
**In a data server on this computer** — an optional mode for one computer.
The data server runs as your own user. Create a login on it once:

```
ecce-dataserver-start
Expand Down Expand Up @@ -179,9 +180,8 @@ shared is up to the site; the three modes are set up step by step in

1. **Everything local** (the default). Each user's session starts their
own data server and broker; the broker listens on a Unix socket, not
on a network port. Nothing to configure. The data server can be
replaced by a folder (Edit → Preferences → Data folder), which is the
default on macOS and Windows.
on a network port. A new user keeps calculations in a folder by default;
an existing server setup stays on its data server.
2. **A central server** for a group or a class. One account on the
server holds everyone's calculations and the shared libraries; users
elsewhere connect to it. On the server, as that account:
Expand Down
5 changes: 3 additions & 2 deletions docs/OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ input, output and parsed properties, in projects in the Organizer.

## How ECCE is organised

![Two ways to run ECCE. With an ECCE server (on one computer, or a central server for a lab or class): the client saves to and loads from the server, which holds the data server and message broker. On its own (the default): the client keeps its data in a local folder with its own broker, and there is no ECCE server. In both, the client's job agent submits jobs over ssh to a compute machine and follows them.](images/ecce-architecture.svg)
![Two ways to run ECCE. With an ECCE server (on one computer, or a central server for a lab or class): the client saves to and loads from the server, which holds the data server and message broker. On its own (the default for new users): the client keeps its data in a local folder with its own broker, and there is no ECCE server. Existing server configurations remain in place. In both, the client's job agent submits jobs over ssh to a compute machine and follows them.](images/ecce-architecture.svg)

The **client** (`ecce-client`) is the window you work in (the Organizer and the tools as tabs; `ECCE_ONE_PROCESS=0 ecce` opens one window per tool), plus a job agent
that submits and follows jobs. Normally it works with an **ECCE server**
(`ecce-server`: a data server and a message broker) that stores projects
and results. The client can instead run **on its own**, keeping its data
in a folder on your disk (Edit → Preferences → Data folder; the default for a new installation);
in a folder on your disk (the default for new users; Edit → Preferences →
Data folder changes it; existing server configurations stay in server mode);
it still starts a private message broker, ECCE's own (`eccebroker`, no
Mosquitto needed), but no ECCE server. Neither
server nor client runs calculations, except ECCE-QM on the client's own
Expand Down
2 changes: 1 addition & 1 deletion docs/claude/services/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ what the deployment mode needs (GETTING_STARTED, "Deployment modes"):
- **Local (mode 1, the default on Linux):** a per-user `mosquitto` on a Unix
socket and a per-user Apache data server, both non-root.
- **Local data folder** (`ECCE_LOCAL_DATA` or the Data folder preference;
the default on macOS): the same per-user broker, no data server; the
the default for new users on all platforms): the same per-user broker, no data server; the
data lives in a local folder (FileEDSI).
- **Central server (mode 2, `-remote`):** one server account runs Apache and
Mosquitto (TCP, authenticated) for everyone; clients start no data server
Expand Down
2 changes: 1 addition & 1 deletion docs/images/ecce-architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 11 additions & 20 deletions help/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,11 @@ added, with their name, type and address:
another one. An **ECCE server (https)** needs a name and
the address of the server, for example `https://ecce.example.edu`; a port
other than 443 goes in the address, as in `https://ecce.example.edu:8443`.
The login is asked when you connect. **Test connection** checks that an ECCE
server answers and shows whether its certificate is trusted. For an SSH
The **TLS certificate** field lets you choose a PEM certificate for this
server; leave it blank to use the system certificate store. The certificate
is stored for this server's origin in your local preferences. The login is
asked when you connect. **Test connection** checks that an ECCE server
answers and shows whether its certificate is trusted. For an SSH
folder it logs in, checks that the folder exists and can be written, and
offers to create it if it is missing. The server needs only an SSH
account and a folder; nothing is installed or run there. A login and a
Expand Down Expand Up @@ -311,25 +314,13 @@ gives you the host name.

In local data mode there is no data server and no login. Your projects and
calculations are stored in an ordinary folder, by default `~/.ECCE-local`.
This suits one person on one computer.
This is the default for new users on every platform. If ECCE finds an
existing data-server configuration, it keeps using that server.

To use it from the first start:

1. Start ECCE with the folder named in the environment:

```
ECCE_LOCAL_DATA=$HOME/.ECCE-local ecce
```
2. The Organizer opens without a login window.

To make it permanent:

1. In the Organizer, choose **Edit > Preferences**.
2. Open the **Data** tab.
3. To use another folder, click **Change...** next to **Folder:** and
choose it.
4. Close the window and restart ECCE. The setting applies from the next
start.
To use another folder, open **Edit > Preferences > Data**, click
**Change...** next to **Folder:**, choose the folder, and restart ECCE.
To select a folder for one session, start ECCE with
`ECCE_LOCAL_DATA=$HOME/.ECCE-local ecce`.

Changing mode copies nothing. The calculations of the other mode stay where
they are, and the new mode starts empty. The variable `ECCE_LOCAL_DATA`
Expand Down
16 changes: 11 additions & 5 deletions include/dsm/CTLSSocket.H
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// CTLSSocket.H -- TLS client socket (OpenSSL) for the https data server.
//
// Trust: if $ECCE_HOME/siteconfig/RemoteServer/server.pem exists, that
// certificate is the only trust anchor and the presented certificate must be
// identical to it (host name is not checked, so IP addresses and aliases
// work). Otherwise the system store is used and the host name is verified.
// There is no mode in which verification is skipped.
// Trust: a per-user certificate pin for this server origin takes precedence.
// The legacy $ECCE_HOME/siteconfig/RemoteServer/server.pem pin is the fallback.
// A pin requires an exact certificate match; without a pin, the system store
// and host name are verified. There is no mode in which verification is
// skipped.

#if !defined( __CTLSSOCKET_H )
#define __CTLSSOCKET_H
Expand Down Expand Up @@ -53,6 +53,12 @@ public :

// Path of the pinned certificate, or "" when the system store applies.
static string_type pinnedCertPath(void);
// Origin-specific pin, falling back to the legacy shared pin.
static string_type pinnedCertPath(const string_type& host, port_type port);
// Save a PEM certificate pin for one TLS origin. An empty PEM removes it.
static bool storePinnedCertificate(const string_type& host, port_type port,
const string_type& pem,
string_type& error);

private :
SSL_CTX * ctx_;
Expand Down
82 changes: 82 additions & 0 deletions include/util/JsonConfigurationProfile.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Versioned profiles include data-server usernames but never passwords.
#ifndef JSONCONFIGURATIONPROFILE_HH
#define JSONCONFIGURATIONPROFILE_HH

#include <string>
#include <vector>

namespace JsonConfigurationProfile {

struct DataServer {
std::string name;
std::string url;
std::string username;
std::string tlsCertificatePem;
};

struct Code {
std::string name;
std::string program;
std::vector<std::string> modules;
};

struct Queue {
std::string name;
unsigned int minProcessors;
unsigned int maxProcessors;
unsigned int maxCPU;
unsigned int maxMemory;
unsigned int minScratch;
unsigned int defProcessors;
unsigned int defRun;
unsigned int defMemory;
unsigned int defScratch;
std::string memUnits;
std::string requestLines;

Queue() : minProcessors(0), maxProcessors(0), maxCPU(0), maxMemory(0),
minScratch(0), defProcessors(0), defRun(0), defMemory(0),
defScratch(0) {}
};

struct Setting {
std::string name;
std::string value;
};

struct ComputeResource {
std::string name;
std::string host;
std::string vendor;
std::string model;
std::string processor;
unsigned int processors;
unsigned int nodes;
bool allocationAccounts;
std::string queueManager;
std::vector<Code> codes;
std::vector<Queue> queues;
std::vector<Setting> settings;

ComputeResource() : processors(0), nodes(0), allocationAccounts(false) {}
};

struct Profile {
unsigned int version;
std::vector<DataServer> dataServers;
std::vector<ComputeResource> computeResources;
std::vector<std::string> jobCreationCodes;

Profile() : version(3) {}
};

// Save atomically. Only data-server usernames are included; passwords and
// compute-resource machine credentials are excluded.
bool save(const std::string& path, const Profile& profile, std::string& error);

// Parse and validate without applying anything to ECCE preferences.
bool load(const std::string& path, Profile& profile, std::string& error);

} // namespace JsonConfigurationProfile

#endif
3 changes: 2 additions & 1 deletion include/util/ServerList.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* The servers a user has added (#767): SSH folders and ECCE servers, kept
* per user in one plain file, ~/.ECCE/AddedServers, one line per server:
*
* <type><TAB><name><TAB><address><TAB><connect-at-start: 0 or 1>
* <type><TAB><name><TAB><address><TAB><connect-at-start: 0 or 1>[<TAB><username>]
*
* type is "ssh" (address sftp://user@host/folder) or "ecce" (address
* https://host[:port]). wx-free; Edit > Preferences > Data lists them.
Expand All @@ -24,6 +24,7 @@ struct ServerEntry
string name;
string address;
bool connectAtStart = false;
string username; // configured account for an ECCE data server; no password
};

class ServerList
Expand Down
23 changes: 16 additions & 7 deletions include/wxgui/AddServerDialog.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
#include "util/ServerList.H"

class ewxChoice;
class ewxTextCtrl;
class ewxButton;
class ewxStaticText;
class ewxTextCtrl;
class wxProcessEvent;

// Add Server... / Edit...: an SSH folder (name, host, user, folder) or an
// ECCE server (name, address). OK stores the entry in the user's
// ServerList (replacing oldName when editing), so Preferences and the
// Organizer share one dialog. Test connection reaches an ECCE server the
// way the start window does (certificate trusted, else pinned).
// ECCE server (name, HTTPS address, username, optional TLS certificate). OK stores the
// entry in the user's ServerList (replacing oldName when editing), so
// Preferences and the Organizer share one dialog. A selected certificate is
// pinned to that HTTPS origin for this user.
class AddServerDialog : public wxDialog
{
public:
Expand All @@ -30,7 +30,8 @@ public:

// Test hooks: fill the fields as typing does; press OK.
void fillForTest(bool ssh, const std::string& name, const std::string& a,
const std::string& b, const std::string& c);
const std::string& b, const std::string& c,
const std::string& username = "");
void acceptForTest();
void startupForTest(bool on) { p_startup->SetValue(on); }

Expand All @@ -39,9 +40,11 @@ private:
void OnTest(wxCommandEvent& event);
void OnTestDone(wxProcessEvent& event);
void OnOk(wxCommandEvent& event);
void OnChooseCertificate(wxCommandEvent& event);
void testSsh(bool create);
void showType();
bool collect(ServerEntry& e) const;
bool applyCertificate(const string& address, string& error) const;

std::string p_old;
ServerEntry p_entry;
Expand All @@ -53,13 +56,19 @@ private:
ewxTextCtrl* p_folder;
ewxTextCtrl* p_port;
ewxTextCtrl* p_address;
ewxTextCtrl* p_eccUser;
ewxTextCtrl* p_certificate;
ewxButton* p_chooseCertificate;
string p_certificatePath;
wxWindow* p_certificateLabel;
wxWindow* p_eccUserLabel;
ewxButton* p_test;
ewxStaticText* p_status;
wxProcess* p_proc;
std::shared_ptr<std::atomic<bool> > p_alive; // a login thread may outlive the dialog
wxBoxSizer* p_top;
wxWindow* p_sshRows[8];
wxWindow* p_eccRows[2];
wxWindow* p_eccRows[4];
};

#endif
8 changes: 7 additions & 1 deletion include/wxgui/GlobalPrefs.H
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ private:
void OnEditServer(wxCommandEvent& event);
void OnRemoveServer(wxCommandEvent& event);
void OnServerSelect(wxListEvent& event);
bool loadServerCertificate(const string& address, const string& path,
string& error);
void OnSaveConfiguration(wxCommandEvent& event);
void OnLoadConfiguration(wxCommandEvent& event);
void updateServerButtons();
long selectedServer() const;
ProgramRow makeProgramRow(wxWindow* page, wxSizer* sizer,
Expand Down Expand Up @@ -166,13 +170,15 @@ private:
struct ServerRow {
enum { LISTED, ADMIN, EARLIER };
int kind;
string name, type, address;
string name, type, address, username;
};
vector<ServerRow> p_serverRows;
wxListCtrl* p_serverList;
ewxButton* p_addServer;
ewxButton* p_editServer;
ewxButton* p_removeServer;
ewxButton* p_saveConfiguration;
ewxButton* p_loadConfiguration;

// Advanced page (#307): one row per EnvSwitches::all() entry.
struct AdvancedRow {
Expand Down
Loading
Loading