alterator-firsttime-0.4/ 0000755 0000000 0000000 00000000000 11275010356 0015354 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/Makefile 0000644 0000000 0000000 00000000267 11275010356 0017021 0 ustar 00root root 0000000 0000000 NAME=firsttime all: clean: install: install-data install-module include /usr/share/alterator/build/module.mak install-data: install -d $(libexecdir)/alterator/hooks/firsttime.d alterator-firsttime-0.4/ahttpd-firsttime.conf 0000644 0000000 0000000 00000000565 11275010356 0021521 0 ustar 00root root 0000000 0000000 #main server settings #format:parameter value server-listen * server-port 8080 server-user _ahttpd server-group _ahttpd server-pidfile /var/run/ahttpd-firsttime.pid server-auth none log-file /var/log/ahttpd/access-firsttime.log log-mode errors tls-key-file /var/lib/ssl/private/ahttpd.key tls-cert-file /var/lib/ssl/certs/ahttpd.cert framework-uri /firsttime/framework alterator-firsttime-0.4/ahttpd-firsttime.init 0000755 0000000 0000000 00000003251 11275010356 0021535 0 ustar 00root root 0000000 0000000 #!/bin/sh # # configd Start/Stop alterator specific httpd (firsttime mode) # # chkconfig: - 95 05 # # processname: ahttpd # config: /etc/httpd-alterator # description: alterator specific httpd # pidfile: /var/run/httpd-alterator/httpd.pid WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions . cert-sh-functions . avahi-sh-functions . shell-config CONFIGFILE=/etc/ahttpd/ahttpd-firsttime.conf PIDFILE=/var/run/ahttpd-firsttime.pid LOCKFILE=/var/lock/subsys/ahttpd-firsttime CERTCONF=/etc/ahttpd/ahttpd.cnf RETVAL=0 ahttpd_port() { shell_config_get "$CONFIGFILE" server-port '[[:space:]]\+' } start() { ssl_generate "ahttpd" start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user _ahttpd --name ahttpd --displayname ahttpd -- ahttpd -c "$CONFIGFILE" RETVAL=$? [ "$RETVAL" != "0" ] || publish_service ahttpd 'Initial system setup at %h' '_https._tcp' "$(ahttpd_port)" return $RETVAL } stop() { stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user _ahttpd --name ahttpd --displayname ahttpd -- ahttpd RETVAL=$? [ "$RETVAL" != "0" ] || unpublish_service ahttpd return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart|condreload) if [ -e "$LOCKFILE" ]; then restart fi ;; status) status --lockfile "$LOCKFILE" --pidfile "$PIDFILE" --expect-user _ahttpd --name ahttpd --displayname ahttpd -- ahttpd RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" RETVAL=1 esac exit $RETVAL alterator-firsttime-0.4/backend3/ 0000755 0000000 0000000 00000000000 11275010356 0017026 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/backend3/firsttime 0000755 0000000 0000000 00000000345 11275010356 0020764 0 ustar 00root root 0000000 0000000 #!/bin/sh -f alterator_api_version=1 . alterator-sh-functions ### do_finish() { sleep 1 run-parts /usr/lib/alterator/hooks/firsttime.d } on_message() { case "$in_action" in finish) do_finish & ;; esac } message_loop alterator-firsttime-0.4/interfaces/ 0000755 0000000 0000000 00000000000 11275010356 0017477 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/interfaces/guile/ 0000755 0000000 0000000 00000000000 11275010356 0020604 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/interfaces/guile/workflow/ 0000755 0000000 0000000 00000000000 11275010356 0022456 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/interfaces/guile/workflow/firsttime-finish.scm 0000644 0000000 0000000 00000001624 11275010356 0026451 0 ustar 00root root 0000000 0000000 (define-module (alterator workflow firsttime-finish) :use-module (alterator algo) :use-module (alterator ahttpd) :use-module (alterator ajax) :use-module (alterator http template) :use-module (alterator http html) :use-module (alterator woo) :export (workflow)) (define (redirect-path msg) (let ((data (woo-read-first "/ahttpd-server"))) (format #f "https://~A:~A" (or (message-header msg "host") "localhost") (woo-get-option data 'port "443")))) (define (workflow url msg template-args) (begin-1 (template (cond-assq 'scm template-args) (replace-tag: "body" (lambda (options content) `(body ,@options ,(html: "script" (format #f "$(document).ready(function() {form_replace_if_ready(~A,3);});" (->json (redirect-path msg)))) ,@content)))) (woo "finish" "/firsttime"))) alterator-firsttime-0.4/interfaces/guile/workflow/firsttime-framework.scm 0000644 0000000 0000000 00000003723 11275010356 0027170 0 ustar 00root root 0000000 0000000 (define-module (alterator workflow firsttime-framework) :use-module (srfi srfi-1) :use-module (srfi srfi-13) :use-module (alterator ahttpd) :use-module (alterator algo) :use-module (alterator woo) :use-module (alterator http template) :use-module (alterator http html) :use-module (alterator ahttpd translate) :use-module (alterator ahttpd html) :use-module (alterator ahttpd workflow) :export (workflow)) (define (scm-content scm name) (call-with-current-continuation (lambda(return) (template scm (tag: name (lambda (options content) (return content)))) '()))) (define (main-tag scm) (and (pair? scm) (tag: "div" (@ 'id "main") (scm-content scm "body")))) (define (title? x) (and (pair? x) (eq? (car x) 'title))) (define (head-tag scm title) (and (pair? scm) (replace-tag: "head" (lambda(options content) (list 'head (remove title? content) (remove title? (scm-content scm "head")) (html: "title" title)))))) (define (title-tag title) (tag: "span" (@ 'id "title") title)) (define (apply-po-domain scm po-domain) (if (string? po-domain) (template scm (replace-tag: "html" (lambda (options content) `(html ,@options ,@content ,(@ 'po-domain po-domain))))) scm)) ;;; main (define (workflow uri msg template-args) (let* ((language (message-accept-language msg)) (init-data (woo-read-first "/menu" 'language language 'ui "html" 'desktopfile "firsttime")) (init-uri (woo-get-option init-data 'uri))) (if (or (uri-prefix? init-uri uri) (uri-prefix? "/firsttime" uri)) (let* ((scm (cond-assq 'scm template-args)) (scm2 (process-module uri msg)) (po-domain (and (pair? scm2) (find-po-domain scm2))) (init-title (woo-get-option init-data 'name))) (apply-po-domain (template scm (head-tag scm2 init-title) (title-tag init-title) (main-tag scm2)) po-domain)) (html:redirect init-uri)))) alterator-firsttime-0.4/ui/ 0000755 0000000 0000000 00000000000 11275010356 0015771 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/ui/firsttime/ 0000755 0000000 0000000 00000000000 11275010356 0017777 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/ui/firsttime/finish/ 0000755 0000000 0000000 00000000000 11275010356 0021257 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/ui/firsttime/finish/index.html 0000644 0000000 0000000 00000000462 11275010356 0023256 0 ustar 00root root 0000000 0000000
Configuring system. Please wait...
alterator-firsttime-0.4/ui/firsttime/framework/ 0000755 0000000 0000000 00000000000 11275010356 0021774 5 ustar 00root root 0000000 0000000 alterator-firsttime-0.4/ui/firsttime/framework/index.html 0000644 0000000 0000000 00000003221 11275010356 0023767 0 ustar 00root root 0000000 0000000Hostname |