OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of moonmoonbird »
  • Show Posts »
  • Topics
  • Profile Info
    • Summary
    • Show Stats
    • Show Posts...
      • Messages
      • Topics
      • Attachments

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

  • Messages
  • Topics
  • Attachments

Topics - moonmoonbird

Pages: [1]
1
Development and Code Review / how many ways to pass parameter to python script
« on: October 30, 2020, 05:29:49 am »
I implemented a shell command plugin named myshell, The whole procedure of a request from a button click to the python script:

1, fill the command into textfield in the form, and click send button, 'set' api called;
2,updated and reloaded the config file with form data;
3, then called 'execute' api, which routed to Service Action, in here , Backend()->configdRun('myshell execute'), which called python script;
4,in the python script, we can retreive the form data through the config file which template and jinja2 generated, and do something and return.

What i want to ask is that except for this way of parameter delivery, can i pass it through configdRun() or api restful like?


2
20.7 Legacy Series / Install GUI?
« on: October 29, 2020, 08:26:22 am »
Hi, Can we install gnome3 on Opnsense for desktop user?

3
Development and Code Review / 【closed】configctl myshell test show execute error.
« on: October 29, 2020, 04:10:50 am »
/usr/local/opnsense/scripts/OPNsense/MyShell/executeshell.py:

Code: [Select]
   
import json                                                                     
result = {}                                                                     
result['message'] = 'this is moonmoonbird'                                     
print(json.dumps(result))

/usr/local/opnsense/service/conf/actions.d/actions_myshell.conf:

Code: [Select]
[test]                                                                         
command:/usr/local/opnsense/scripts/OPNsense/MyShell/executeshell.py           
parameters:                                                                     
type:script_output                                                             
message:myshell  module test


and then i restart configd and then  configctl myshell test, an error showed : Execute error.  No more message, anywhere i was doing wrong,



1、add header #!/usr/local/bin/python3 in py files.
2、chmod a+x  /usr/local/opnsense/scripts/OPNsense/MyShell/executeshell.py
3、 service configd restart
4、configctl myshell test

4
Development and Code Review / 【closed】why my cutsom name not work?
« on: October 28, 2020, 12:14:17 pm »
accrording to the HelloWorld example fist step, just create controller, model, views, it is worked, when i change it to my custom name,  say MyWorld, page not found.


I missed the <?php closure in IndexController. sorry : (

5
Development and Code Review / what is relation between /usr/local/opnsense and /usr/local/www.
« on: October 28, 2020, 10:49:24 am »
what is the relation between these two directory? I see codes in these two directories, some follow the mvc rules, some are not, anyone can describe more specific, i am newbie in develop in opnsense. and i have followed the helloworld example, but sometime still confuse me.. Thanks

6
20.7 Legacy Series / make kernel error
« on: October 26, 2020, 09:12:58 am »
command: make kernel-again

result:


>>> stage 3.1: building everything
--------------------------------------------------------------
In file included from /usr/src/sys/kern/imgact_elf32.c:33:
/usr/src/sys/kern/imgact_elf.c:2682:25: error: use of undeclared identifier 'MAP_ASLR'
        if ((imgp->map_flags & MAP_ASLR) == 0)
                               ^
1 error generated.
--- imgact_elf32.o ---
*** [imgact_elf32.o] Error code 1

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/SMP
A failure has been detected in another branch of the parallel make

make[4]: stopped in /usr/src/sys/modules/aac
--- all_subdir_aac ---
*** [all_subdir_aac] Error code 2

make[3]: stopped in /usr/src/sys/modules
1 error

make[3]: stopped in /usr/src/sys/modules
--- modules-all ---
*** [modules-all] Error code 2

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/SMP
2 errors

make[2]: stopped in /usr/obj/usr/src/amd64.amd64/sys/SMP
--- buildkernel ---
*** [buildkernel] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
--- buildkernel ---
*** [buildkernel] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /usr/src
*** Error code 2

Stop.
make: stopped in /usr/tools


how to make it right , thanks.

7
20.7 Legacy Series / how to rebuild dvd image after change config file?
« on: October 26, 2020, 07:53:47 am »
after changing tools/config/20.7/SMP , how to rebuild dvd image to apply this change, what i was doing is to ran `make dvd-again`, but i am not sure it is the right way to do it. thanks.

8
20.7 Legacy Series / Segmentation fault (core dumped)
« on: October 26, 2020, 07:11:34 am »
the process i did are:
1, change dns, make sure domain can be resolved correctly.
2, kldload linux64, make sure can run linux program on unix
3, pkg install linux_base-c7,
4, copy linux_server64 file into opnsense server, say in /usr directory, give it execute privilege, chmod +x linux_server 64
5, when run  ./linux_server64, it occured Segmentation fault (core dumped) error.

what i want to do is  to debug process using IDA (https://www.hex-rays.com/), the file  linux_server64 comes from IDA, and should be running in target server so that IDA client can communicate with target server, but failed, it seemed the security of hbsd prevent this or opnsense prevent this, please guide me how to enable it or something else. thanks very much.

9
20.7 Legacy Series / pkg install vim error: no address record
« on: October 26, 2020, 04:33:55 am »
after install opnsense, i ran 'pkg install vim', showed messages below:

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating OPNsense repository catalogure...
pkg:https://pkg.opnsense.org/FreeBSD:12:amd64/latest/meta.txz:no address record
repository OPNsense has no meta file, using default settings
pkg:https://pkg.opnsense.org/FreeBSD:12:amd64/latest/packagesite.txz: No address record
Unable to upgrade repository OPNsense
Error updating repositories!


how to install packages on opnsense or what config to rewrite to enable it and how to install linux_base-c7 to enbale IDA to debug it?

10
20.7 Legacy Series / build from alternative src?
« on: October 22, 2020, 05:13:55 am »
hi, i want to build dvd image from source and replace /usr/src with freebsd12.1, is that possible?
if possible, just replace /usr/src with freebsd src or something else? and what is the command to rebuild from replaced source ? thanks in advance!

11
20.7 Legacy Series / how much disk space it need to build from source?
« on: October 21, 2020, 09:12:28 am »
i followed the process:
# pkg install git
# cd /usr
# git clone https://github.com/opnsense/tools
# cd tools
# make update
# make dvd

my disk is 80GB SSD, after 5hours more or less, error occurred : no more space, /usr/ports and /usr/src took much space. each took 40GB around. so why it too so much space and how much we need.

Pages: [1]
OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2