Giter Site home page Giter Site logo

Comments (14)

jullienl avatar jullienl commented on July 19, 2024 1

1/ Make sure you follow what is described in https://github.com/ndejong/pfsense_fauxapi#api-authentication
2/ Make sure your API key follows the rules in credentials.ini
3/ Enable debugging by using &__debug=true to your API call so that you get logs in pFsense / Status / System Logs. Those logs is the first place to go as they provide very useful information for troubleshooting.

from pfsense_fauxapi.

fahadalishah0102 avatar fahadalishah0102 commented on July 19, 2024

Hello jullienl,

I am using the same version but i am lil bit confuse how to use this ?
I have done what ever describe on web but unable to execute it properly authetication failed can you please help me out.

from pfsense_fauxapi.

jullienl avatar jullienl commented on July 19, 2024

I don't know about your Pytest issue but for the HTTP request header, it is used for the API authentication so you need to build a valid HTTP header with the requested fauxapi-auth parameter, the value of fauxapi-auth must use the following format: <apikey>:<timestamp>:<nonce>:<hash>.

Then this header must be used with your CURL request like:

curl \
    -X GET \
    --silent \
    --insecure \
    --header "fauxapi-auth: PFFA4797d073:20161119Z144328:833a45d8:9c4f96ab042f5140386178618be1ae40adc68dd9fd6b158fb82c99f3aaa2bb55" \
    "https://<host-address>/fauxapi/v1/?action=system_stats"

from pfsense_fauxapi.

ndejong avatar ndejong commented on July 19, 2024

@jullienl thanks for assisting @fahadalishah5 - I've trimmed his comments to keep this ticket focused on your issue.

The latest release https://github.com/ndejong/pfsense_fauxapi/releases/tag/v1.3_4 does pass all tests against an earlier pfSense 2.4.4 - I notice you are running p3 which is probably the first place to start looking for me.

I wonder if you are easily able to test against an "earlier" 2.4.4 to confirm? Not essential but would just be helpful to know where to start tracking this down.

from pfsense_fauxapi.

fahadalishah0102 avatar fahadalishah0102 commented on July 19, 2024

from pfsense_fauxapi.

jullienl avatar jullienl commented on July 19, 2024

Thanks @ndejong

I need to check if I can easily downgrade my pfsense without impacting too many things

from pfsense_fauxapi.

ndejong avatar ndejong commented on July 19, 2024

@jullienl were you able to resolve your issue here?

from pfsense_fauxapi.

jullienl avatar jullienl commented on July 19, 2024

from pfsense_fauxapi.

jullienl avatar jullienl commented on July 19, 2024

Has this API issue been resolved in 2.4.5 or 2.5.0 ? I cannot find any fix reference in the Release Notes

from pfsense_fauxapi.

fahadalishah0102 avatar fahadalishah0102 commented on July 19, 2024

from pfsense_fauxapi.

ndejong avatar ndejong commented on July 19, 2024

@jullienl looking at your report again, FauxAPI was updated recently to v1.4 which may not (yet) address this issue.

Re-reading the description of the issue you have I'm wondering if what you are describing is that after the confg_reload your services have not picked up the new configuration(s) - is this the case or are you experiencing something else? The reason I ask is that there is a good chance an appropriate send_event will resolve this which might make sense to add into the config_reload by default

I know it's been a while but if you are still able to check it out and report back that would be awesome

from pfsense_fauxapi.

jullienl avatar jullienl commented on July 19, 2024

Yes this the case, my services did not pick up the new configuration while the API config_reload call was successful. Sadly I ended using a system reboot to active the new config:

# Reload the pfsense config to validate the patch config change   --- NOT WORKING !!!!
# $response = Invoke-WebRequest -Uri "https://$pfsense/fauxapi/v1/?action=config_reload&__debug=true" -Headers $headers -Method GET 

# Restarting pfsense instead to activate the new config
$response = Invoke-WebRequest -Uri "https://$pfsense/fauxapi/v1/?action=system_reboot&__debug=true" -Headers $headers -Method GET 

from pfsense_fauxapi.

Cliftonz avatar Cliftonz commented on July 19, 2024

I am having the same issue too. Is there an eta on this fix?

from pfsense_fauxapi.

akopylov-rdv avatar akopylov-rdv commented on July 19, 2024

@ndejong @jullienl
Hello!
I have the same problem, using python pkg: pfsense-fauxapi:

pfs_config = api.config_get()
# Add new acl rule to forwarding backend in haproxy config
new_acl_item = {...}
pfs_config["installedpackages"]["haproxy"]["ha_backends"]["item"][0]["ha_acls"]["item"].insert(0, new_acl_item)
api.config_set(pfs_config)

Tried to envoke

api.config_reload()
api.send_event("service restart haproxy")

It doesn't help.
New configuration starts to work only if I go to Pfsense UI Services / HAProxy / Frontends and click "Save" configuration and apply it.
Is any way to replay this actions with programming?
Will you fix this problem?

from pfsense_fauxapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.