Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make initialize/upgrade safer, easier, and more powerful #20

Open
dseomn opened this issue Jun 11, 2015 · 1 comment
Open

make initialize/upgrade safer, easier, and more powerful #20

dseomn opened this issue Jun 11, 2015 · 1 comment

Comments

@dseomn
Copy link
Member

dseomn commented Jun 11, 2015

Merge bin/rpki/initialize.in and bin/rpki/upgrade.in into a single script with the following behavior (described in pseudo-code). The forced variable corresponds to a -f or --force argument passed to the new script. Note that some of the below functionality depends on [#17].

if not able to connect to database as rpstir user:
    if not forced:
        log error and exit
    if not able to connect to database as root user:
        ask for database root password
        if still not able to connect as root:
            log error and exit
    create database user with correct password from rpstir.conf
    if still not able to connect to database as rpstir user:
        log error and exit

if not able to select rpstir database:
    if not forced:
        log error and exit
    if not able to create rpstir database:
        if not able to create rpstir database as root:
            log error and exit

if database is empty and directories are empty:
    initialize database and directories
    exit successfully
else if database and directories are already initialized:
    if db/dirs are from an old (known) version of rpstir:
        if (forced) or (all upgrades are safe):
            perform all upgrades
            exit successfully
        else:
            log error and exit
    else if db/dirs are from an old (unknown) version of rpstir:
        log error and exit
    else:
        exit successfully
else:
    log error and exit

Add a separate script to clear an existing database/directories (note that the above code doesn't do this).

Reported by: dseomn

Original Ticket: rpstir/tickets/20

@dseomn
Copy link
Member Author

dseomn commented Jun 11, 2015

  • Description has changed:

Diff:


--- old
+++ new
@@ -23,15 +23,11 @@
         exit successfully
     else if database and directories are already initialized:
         if db/dirs are from an old (known) version of rpstir:
-            if forced:
+            if (forced) or (all upgrades are safe):
                 perform all upgrades
                 exit successfully
             else:
-                perform all safe upgrades possible
-                if there are remaining risky upgrades:
-                    log error and exit
-                else:
-                    exit successfully
+                log error and exit
         else if db/dirs are from an old (unknown) version of rpstir:
             log error and exit
         else:

Original comment by: dseomn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants